From 189cf24c899bf376f64df318ffeb6e42b042bdef Mon Sep 17 00:00:00 2001 From: Harry Young Date: Tue, 4 Mar 2025 10:53:54 +0000 Subject: [PATCH] Move last fetched from UI to a data attribute --- src/web/CareLeavers.Web/Views/Contentful/Page.cshtml | 5 +++-- .../CareLeavers.Web/Views/Shared/_LastUpdated.cshtml | 10 +++------- .../Tests/SnapshotTests/Input/SimpleParagraph.json | 4 +++- .../Tests/SnapshotTests/Output/ComponentTest.html | 6 +----- .../SnapshotTests/Output/HomePageWithSupport.html | 6 +----- .../Tests/SnapshotTests/Output/SimpleAsset.html | 2 +- .../Tests/SnapshotTests/Output/SimpleParagraph.html | 2 +- 7 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/web/CareLeavers.Web/Views/Contentful/Page.cshtml b/src/web/CareLeavers.Web/Views/Contentful/Page.cshtml index 8554412..3a8f0ac 100644 --- a/src/web/CareLeavers.Web/Views/Contentful/Page.cshtml +++ b/src/web/CareLeavers.Web/Views/Contentful/Page.cshtml @@ -1,3 +1,4 @@ +@using System.Globalization @using CareLeavers.Web.Configuration @using CareLeavers.Web.Models.Enums @using Microsoft.AspNetCore.Mvc.TagHelpers @@ -33,7 +34,7 @@ } -
+
@if (Model.Type.HasValue) { @@ -48,7 +49,7 @@ @if (Model.ShowLastUpdated) {
- + }
diff --git a/src/web/CareLeavers.Web/Views/Shared/_LastUpdated.cshtml b/src/web/CareLeavers.Web/Views/Shared/_LastUpdated.cshtml index caf851b..ccaa927 100644 --- a/src/web/CareLeavers.Web/Views/Shared/_LastUpdated.cshtml +++ b/src/web/CareLeavers.Web/Views/Shared/_LastUpdated.cshtml @@ -1,5 +1,5 @@ @using System.Globalization -@model CareLeavers.Web.Models.Content.ContentfulContent +@model Contentful.Core.Models.SystemProperties
diff --git a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Input/SimpleParagraph.json b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Input/SimpleParagraph.json index 80b0831..48f581b 100644 --- a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Input/SimpleParagraph.json +++ b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Input/SimpleParagraph.json @@ -104,5 +104,7 @@ ] } ] - } + }, + "metadata": null, + "fetched": "2025-02-26T13:03:09.51649+00:00" } \ No newline at end of file diff --git a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/ComponentTest.html b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/ComponentTest.html index fdf68a3..a31a79d 100644 --- a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/ComponentTest.html +++ b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/ComponentTest.html @@ -130,7 +130,7 @@

-
+
Guide
@@ -213,10 +213,6 @@

- -

diff --git a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/HomePageWithSupport.html b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/HomePageWithSupport.html index cf3720a..0146e3e 100644 --- a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/HomePageWithSupport.html +++ b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/HomePageWithSupport.html @@ -125,7 +125,7 @@

-
+
@@ -203,10 +203,6 @@

Housing and accommodation

- -
diff --git a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleAsset.html b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleAsset.html index 25a9e96..849f81a 100644 --- a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleAsset.html +++ b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleAsset.html @@ -130,7 +130,7 @@

-
+
Test alt description

diff --git a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleParagraph.html b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleParagraph.html index 3fdd8ba..d031c00 100644 --- a/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleParagraph.html +++ b/src/web/tests/CareLeavers.Integration.Tests/Tests/SnapshotTests/Output/SimpleParagraph.html @@ -123,7 +123,7 @@

-
+

Test 1

Test 1