Skip to content

Commit 0ca5821

Browse files
Merge branch 'main' into fmd-911-report-issues-with-metadata
2 parents 383fe63 + 268c147 commit 0ca5821

File tree

9 files changed

+19
-22
lines changed

9 files changed

+19
-22
lines changed

home/service/details.py

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def _get_context(self):
146146
return {
147147
"entity": self.chart_metadata,
148148
"entity_type": _("Chart"),
149+
"platform_name": _(self.chart_metadata.platform.display_name),
149150
"parent_entity": self.parent_entity,
150151
"parent_type": ResultType.DASHBOARD.name.lower(),
151152
"h1_value": self.chart_metadata.name,
@@ -168,6 +169,7 @@ def _get_context(self):
168169
"entity": self.dashboard_metadata,
169170
"entity_type": "Dashboard",
170171
"h1_value": self.dashboard_metadata.name,
172+
"platform_name": _(self.dashboard_metadata.platform.display_name),
171173
"charts": sorted(
172174
self.children,
173175
key=lambda d: d.entity_ref.display_name,

locale/en/LC_MESSAGES/django.po

+3-5
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,6 @@ msgstr "first name"
595595
msgid "last name"
596596
msgstr "last name"
597597

598-
#~ msgid "Search metadata catalogue"
599-
#~ msgstr "Search for data"
600-
601-
#~ msgid "Chart details"
602-
#~ msgstr "Chart details"
598+
# Workaround for Justice Data platform not having a readable display name
599+
msgid "justice-data"
600+
msgstr "Justice Data"

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"babel-jest": "^29.7.0",
66
"govuk-frontend": "^5.7.1",
77
"jest-environment-jsdom": "^29.7.0",
8-
"sass": "^1.79.5"
8+
"sass": "^1.80.2"
99
},
1010
"scripts": {
1111
"dependencies": "bash scripts/import-static.sh",

poetry.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ selenium = "~=4.25.0"
3333
flake8 = ">=6.1.0"
3434
pytest-django = "^4.9.0"
3535
pytest-cov = "^5.0.0"
36-
faker = "^30.3.0"
36+
faker = "^30.6.0"
3737
isort = "^5.13.2"
3838

3939
[build-system]

templates/details_chart.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ <h2 class="govuk-heading-s govuk-!-margin-top-3">
88
{% translate "Access this data" %}
99
</h2>
1010
<div class="govuk-body">
11-
<a href="{{entity.external_url}}" class="govuk-link" rel="noreferrer noopener" target="_blank">
12-
{% blocktranslate with display_name=entity.display_name %}{{ display_name }} on Justice Data (opens in new tab){% endblocktranslate %}
13-
</a>
11+
<a href="{{entity.external_url}}" class="govuk-link" rel="noreferrer noopener" target="_blank">{% blocktranslate with display_name=entity.display_name platform_name=platform_name %}"{{ display_name }}" on {{platform_name}}{% endblocktranslate %}</a> {% translate '(opens in new tab)' %}
1412
</div>
1513
</div>
1614
</div>

templates/details_dashboard.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ <h2 class="govuk-heading-m">{% translate "Dashboard content" %}</h2>
4040
<div class="govuk-grid-row">
4141
<div class="govuk-grid-column-two-thirds">
4242
<h2 class="govuk-heading-s govuk-!-margin-top-3">
43-
URL
43+
{% translate "Access this data" %}
4444
</h2>
4545
<div class="govuk-body">
46-
<a href="{{entity.external_url}}" class="govuk-link" rel="noreferrer noopener" target="_blank">
47-
{% translate "Justice Data (opens in new tab)" %}
48-
</a>
46+
<a href="{{entity.external_url}}" class="govuk-link" rel="noreferrer noopener" target="_blank">{{ platform_name }}</a> {% translate "(opens in new tab)" %}
4947
</div>
5048
</div>
5149
</div>

tests/home/service/test_details.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,15 @@ def test_get_context(self, mock_catalogue):
206206
)
207207
],
208208
),
209-
platform=EntityRef(urn="", display_name=""),
209+
platform=EntityRef(urn="", display_name="justice-data"),
210210
)
211211
mock_catalogue.get_chart_details.return_value = chart_metadata
212212

213213
context = ChartDetailsService("urn").context
214214
expected = {
215215
"entity": chart_metadata,
216216
"entity_type": "Chart",
217+
"platform_name": "Justice Data",
217218
"parent_entity": None,
218219
"parent_type": "dashboard",
219220
"h1_value": "test",

0 commit comments

Comments
 (0)