From cbcabea3dfe2c7f4939038aa01ea2cb9bbb104c0 Mon Sep 17 00:00:00 2001 From: Mat Moore Date: Fri, 29 Nov 2024 11:40:42 +0000 Subject: [PATCH] fix: hide data last updated for CaDeT We were deliberately hiding this because the dbt last modified date is misleading. --- home/service/details.py | 5 +++++ home/urns.py | 3 +++ templates/details_base.html | 2 +- templates/details_metric.html | 2 +- templates/partial/contact_info.html | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 home/urns.py diff --git a/home/service/details.py b/home/service/details.py index 39d2c0f7..a2352e45 100644 --- a/home/service/details.py +++ b/home/service/details.py @@ -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 @@ -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 @@ -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): @@ -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, } @@ -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, } diff --git a/home/urns.py b/home/urns.py new file mode 100644 index 00000000..68b11b7f --- /dev/null +++ b/home/urns.py @@ -0,0 +1,3 @@ +class PlatformUrns: + CADET = "dbt" + PLATFORM_URNS = "performance-hub" diff --git a/templates/details_base.html b/templates/details_base.html index 5524d54e..a4b8def7 100644 --- a/templates/details_base.html +++ b/templates/details_base.html @@ -64,7 +64,7 @@

{{entity.created | date:"jS F Y"}} ({{entity.created|naturaltime}}) {% endif %} - {% if entity.data_last_modified %} + {% if entity.data_last_modified and entity.platform.urn != PlatformUrns.CADET %}
  • {% translate "Last updated:" %} {{entity.data_last_modified | date:"jS F Y"}} diff --git a/templates/details_metric.html b/templates/details_metric.html index 037de16a..7c81f2b0 100644 --- a/templates/details_metric.html +++ b/templates/details_metric.html @@ -1,7 +1,7 @@ {% extends "details_base.html" %} {% block extra_description %} -{% if entity.platform.urn == 'performance-hub' %} +{% if entity.platform.urn == PlatformUrns.PERFORMANCE_HUB %}

    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.

    Please remember that this data is for INTERNAL USE ONLY and not to be shared outside the organisation.

    diff --git a/templates/partial/contact_info.html b/templates/partial/contact_info.html index 41527812..070d21d6 100644 --- a/templates/partial/contact_info.html +++ b/templates/partial/contact_info.html @@ -58,7 +58,7 @@

    {% translate "Data custodian

    {% 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 - contact the Data Catalogue team about this data.{% endblocktranslate %}