Skip to content

Commit

Permalink
fix: hide data last updated for CaDeT
Browse files Browse the repository at this point in the history
We were deliberately hiding this because the dbt last modified date is
misleading.
  • Loading branch information
MatMoore committed Nov 29, 2024
1 parent 42615b2 commit cbcabea
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions home/service/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.core.validators import URLValidator
from django.utils.translation import gettext as _

from ..urns import PlatformUrns
from .base import GenericService


Expand Down Expand Up @@ -79,6 +80,7 @@ def _get_context(self):
"is_access_requirements_a_url": is_access_requirements_a_url(
self.database_metadata.custom_properties.access_information.dc_access_requirements
),
"PlatformUrns": PlatformUrns,
}

return context
Expand Down Expand Up @@ -119,6 +121,7 @@ def _get_context(self):
"is_access_requirements_a_url": is_access_requirements_a_url(
self.table_metadata.custom_properties.access_information.dc_access_requirements
),
"PlatformUrns": PlatformUrns,
}

def _get_template(self):
Expand Down Expand Up @@ -162,6 +165,7 @@ def _get_context(self):
"is_access_requirements_a_url": is_access_requirements_a_url(
self.chart_metadata.custom_properties.access_information.dc_access_requirements
),
"PlatformUrns": PlatformUrns,
}


Expand All @@ -188,4 +192,5 @@ def _get_context(self):
"is_access_requirements_a_url": is_access_requirements_a_url(
self.dashboard_metadata.custom_properties.access_information.dc_access_requirements
),
"PlatformUrns": PlatformUrns,
}
3 changes: 3 additions & 0 deletions home/urns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class PlatformUrns:
CADET = "dbt"
PLATFORM_URNS = "performance-hub"
2 changes: 1 addition & 1 deletion templates/details_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2 class="govuk-heading-s govuk-!-margin-top-3">
{{entity.created | date:"jS F Y"}} ({{entity.created|naturaltime}})
</li>
{% endif %}
{% if entity.data_last_modified %}
{% if entity.data_last_modified and entity.platform.urn != PlatformUrns.CADET %}
<li>
<span class="govuk-!-font-weight-bold">{% translate "Last updated:" %}</span>
{{entity.data_last_modified | date:"jS F Y"}}
Expand Down
2 changes: 1 addition & 1 deletion templates/details_metric.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "details_base.html" %}

{% block extra_description %}
{% if entity.platform.urn == 'performance-hub' %}
{% if entity.platform.urn == PlatformUrns.PERFORMANCE_HUB %}
<p>Data quality: the data is checked to be good enough to support the outcomes it is being used for. Data values
should be right, but there are other factors that help ensure data meets the needs of its users.</p>
<p>Please remember that this data is for INTERNAL USE ONLY and not to be shared outside the organisation.</p>
Expand Down
2 changes: 1 addition & 1 deletion templates/partial/contact_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2 class="govuk-heading-s govuk-!-margin-bottom-1">{% translate "Data custodian
<p id="data_owner" class="govuk-body">
{% if governance.data_owner.email %}
{{ governance.data_owner.email|urlize }}
{% elif platform.urn == 'performance-hub' %}
{% elif platform.urn == PlatformUrns.PERFORMANCE_HUB %}
No owner is listed as this data is undergoing a review of ownership.
{% else %}
{% blocktranslate %}Not provided - <a href="https://moj.enterprise.slack.com/archives/C06NPM2200N" class="govuk-link" rel="noreferrer noopener" target="_blank">contact the Data Catalogue team</a> about this data.{% endblocktranslate %}
Expand Down

0 comments on commit cbcabea

Please sign in to comment.