diff --git a/.github/workflows/code-pr-check.yml b/.github/workflows/code-pr-check.yml index 0c43a2b..96df990 100644 --- a/.github/workflows/code-pr-check.yml +++ b/.github/workflows/code-pr-check.yml @@ -47,18 +47,18 @@ jobs: distribution: "microsoft" java-version: "17" -# - name: Start SonarCloud scanner -# run: | -# dotnet-sonarscanner begin \ -# /k:"DFE-Digital_sts-content-support" \ -# /o:"dfe-digital" \ -# /d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ -# /d:sonar.host.url="https://sonarcloud.io" \ -# /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ -# /d:sonar.coverage.exclusions=**/Program.cs,**/wwwroot/** \ -# /d:sonar.issue.ignore.multicriteria=e1 \ -# /d:sonar.issue.ignore.multicriteria.e1.ruleKey=csharpsquid:S6602 \ -# /d:sonar.issue.ignore.multicriteria.e1.resourceKey=src/**/*.cs + - name: Start SonarCloud scanner + run: | + dotnet-sonarscanner begin \ + /k:"DFE-Digital_sts-content-support" \ + /o:"dfe-digital" \ + /d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ + /d:sonar.host.url="https://sonarcloud.io" \ + /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ + /d:sonar.coverage.exclusions=**/Program.cs,**/wwwroot/** \ + /d:sonar.issue.ignore.multicriteria=e1 \ + /d:sonar.issue.ignore.multicriteria.e1.ruleKey=csharpsquid:S6602 \ + /d:sonar.issue.ignore.multicriteria.e1.resourceKey=src/**/*.cs - name: Build web app uses: ./.github/actions/build-dotnet-app @@ -71,15 +71,14 @@ jobs: with: solution_filename: sts-contentsupport.sln -# - name: Merge test results -# run: dotnet-coverage merge -f xml -o "coverage.xml" -s "coverage.settings.xml" -r coverage.cobertura.xml -# -# - name: End SonarCloud Scanner -# run: dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" -# -# - name: Archive code coverage results -# uses: actions/upload-artifact@v4 -# with: -# name: code-coverage-report -# path: coverage.xml -# \ No newline at end of file + - name: Merge test results + run: dotnet-coverage merge -f xml -o "coverage.xml" -s "coverage.settings.xml" -r coverage.cobertura.xml + + - name: End SonarCloud Scanner + run: dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" + + - name: Archive code coverage results + uses: actions/upload-artifact@v4 + with: + name: code-coverage-report + path: coverage.xml diff --git a/src/Dfe.ContentSupport.Web/Controllers/ContentController.cs b/src/Dfe.ContentSupport.Web/Controllers/ContentController.cs index 681091a..210f61f 100644 --- a/src/Dfe.ContentSupport.Web/Controllers/ContentController.cs +++ b/src/Dfe.ContentSupport.Web/Controllers/ContentController.cs @@ -28,8 +28,10 @@ public async Task Home() return View(defaultModel); } + + [HttpGet("{slug}/{page?}")] - public async Task Index(string slug, string page = "", bool isPreview = false) + public async Task Index(string slug, string page = "", bool isPreview = false, [FromQuery] List? tags = null) { if (!ModelState.IsValid) return RedirectToAction("error"); if (string.IsNullOrEmpty(slug)) return RedirectToAction("error"); @@ -38,10 +40,12 @@ public async Task Index(string slug, string page = "", bool isPre if (resp is null) return RedirectToAction("error"); resp = layoutService.GenerateLayout(resp, Request, page); + ViewBag.tags = tags; return View("CsIndex", resp); } + public IActionResult Privacy() { return View(); diff --git a/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs b/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs index 0af6280..fb8338d 100644 --- a/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs +++ b/src/Dfe.ContentSupport.Web/Controllers/SitemapController.cs @@ -10,7 +10,6 @@ namespace Dfe.ContentSupport.Web.Controllers; public class SitemapController(IContentService contentfulService) : Controller { - [HttpGet] [Route("/sitemap.xml")] public async Task Sitemap() diff --git a/src/Dfe.ContentSupport.Web/Dfe.ContentSupport.Web.csproj b/src/Dfe.ContentSupport.Web/Dfe.ContentSupport.Web.csproj index 056b476..c927a0e 100644 --- a/src/Dfe.ContentSupport.Web/Dfe.ContentSupport.Web.csproj +++ b/src/Dfe.ContentSupport.Web/Dfe.ContentSupport.Web.csproj @@ -8,24 +8,12 @@ - - - - - - Never - true - Never - - - - - - - - - - - + + + + + + + diff --git a/src/Dfe.ContentSupport.Web/Models/ContentBase.cs b/src/Dfe.ContentSupport.Web/Models/ContentBase.cs index c1b04e3..86ad154 100644 --- a/src/Dfe.ContentSupport.Web/Models/ContentBase.cs +++ b/src/Dfe.ContentSupport.Web/Models/ContentBase.cs @@ -1,9 +1,8 @@ using System.Diagnostics.CodeAnalysis; - namespace Dfe.ContentSupport.Web.Models; [ExcludeFromCodeCoverage] -public class ContentBase : ContentType +public class ContentBase : Contentful.Core.Models.Entry { public string InternalName { get; set; } = null!; diff --git a/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs b/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs index a33cad6..4450612 100644 --- a/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs +++ b/src/Dfe.ContentSupport.Web/Models/ContentItemBase.cs @@ -1,4 +1,5 @@ -using System.Diagnostics.CodeAnalysis; +using Contentful.Core.Models; +using System.Diagnostics.CodeAnalysis; namespace Dfe.ContentSupport.Web.Models; diff --git a/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs b/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs index 24863d3..fe6206f 100644 --- a/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs +++ b/src/Dfe.ContentSupport.Web/Models/Mapped/CsPage.cs @@ -17,5 +17,5 @@ public class CsPage public DateTime? UpdatedAt { get; init; } public bool HasFeedbackBanner { get; set; } public List? MenuItems { get; set; } - + public List Tags { get;set; } = null!; } \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Models/Mapped/RichTextContentItem.cs b/src/Dfe.ContentSupport.Web/Models/Mapped/RichTextContentItem.cs index c38f1a5..d65671d 100644 --- a/src/Dfe.ContentSupport.Web/Models/Mapped/RichTextContentItem.cs +++ b/src/Dfe.ContentSupport.Web/Models/Mapped/RichTextContentItem.cs @@ -9,4 +9,5 @@ public class RichTextContentItem : CsContentItem public List Content { get; set; } = null!; public RichTextNodeType NodeType { get; set; } = RichTextNodeType.Unknown; public string Value { get; set; } = null!; + public List Tags { get; set; } = []; } \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs b/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs index d976b76..b36ae15 100644 --- a/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs +++ b/src/Dfe.ContentSupport.Web/Services/ModelMapper.cs @@ -1,4 +1,5 @@ -using Dfe.ContentSupport.Web.Common; +using Contentful.Core.Models; +using Dfe.ContentSupport.Web.Common; using Dfe.ContentSupport.Web.Configuration; using Dfe.ContentSupport.Web.Models; using Dfe.ContentSupport.Web.Models.Mapped; @@ -29,12 +30,20 @@ public CsPage MapToCsPage(ContentSupportPage incoming) HasPrint = incoming.HasPrint, Content = MapEntriesToContent(incoming.Content), ShowVerticalNavigation = incoming.ShowVerticalNavigation, - CreatedAt = incoming.Sys.CreatedAt, - UpdatedAt = incoming.Sys.UpdatedAt + CreatedAt = incoming.SystemProperties.CreatedAt, + UpdatedAt = incoming.SystemProperties.UpdatedAt, + Tags = FlattenMetadata(incoming.Metadata) }; return result; } + private static List FlattenMetadata(ContentfulMetadata item) + { + if (item is null) return []; + + return item.Tags.Select(o => o.Sys.Id).ToList(); + } + private List MapEntriesToContent(List entries) { return entries.Select(ConvertEntryToContentItem).ToList(); @@ -59,6 +68,7 @@ public CsContentItem ConvertEntryToContentItem(Entry entry) Subtitle = entry.Subtitle, NodeType = ConvertToRichTextNodeType(richText.NodeType), Content = MapRichTextNodes(richText.Content), + Tags = FlattenMetadata(entry.Metadata) }; return item; } @@ -69,11 +79,14 @@ public List MapRichTextNodes(List nodes) { NodeType = RichTextNodeType.Unknown, InternalName = node.InternalName }).ToList(); } + public RichTextContentItem? MapContent(ContentItem contentItem) { RichTextContentItem? item; var nodeType = ConvertToRichTextNodeType(contentItem.NodeType); var internalName = contentItem.InternalName; + + switch (nodeType) { case RichTextNodeType.Text: @@ -84,7 +97,7 @@ public List MapRichTextNodes(List nodes) break; case RichTextNodeType.Hyperlink: var uri = contentItem.Data.Uri.ToString(); - item = new Hyperlink + item = new Models.Mapped.Standard.Hyperlink { Uri = uri, IsVimeo = uri.Contains("vimeo.com") @@ -137,12 +150,13 @@ public List MapRichTextNodes(List nodes) item.Content = MapRichTextNodes(contentItem.Content); item.Value = contentItem.Value; item.InternalName = internalName; + item.Tags = FlattenMetadata(contentItem.Metadata); return item; } public CustomComponent? GenerateCustomComponent(Target target) { - var contentType = target.Sys.ContentType?.Sys.Id; + var contentType = target.SystemProperties.ContentType?.SystemProperties.Id; if (contentType is null) return null; return contentType switch { diff --git a/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml b/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml index 8ae4e3f..b1567d9 100644 --- a/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Content/CsIndex.cshtml @@ -30,9 +30,7 @@ { } - - -
+ @if (Model.HasCitation) { diff --git a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_RichText.cshtml b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_RichText.cshtml index 5133429..2b45ff4 100644 --- a/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_RichText.cshtml +++ b/src/Dfe.ContentSupport.Web/Views/Shared/RichText/_RichText.cshtml @@ -1,61 +1,66 @@ @model RichTextContentItem - @{ + var tags = ViewBag.tags ?? new List(); +} + + +@if (tags.Count == 0 || (Model.Tags.Count == 0 || Model.Tags.Exists(el => tags.Contains(el)))) +{ var nodeType = Model.NodeType; switch (nodeType) { case RichTextNodeType.Document: - + break; case RichTextNodeType.Paragraph: - + break; case RichTextNodeType.Heading2: case RichTextNodeType.Heading3: case RichTextNodeType.Heading4: case RichTextNodeType.Heading5: case RichTextNodeType.Heading6: - + break; case RichTextNodeType.UnorderedList: - + break; case RichTextNodeType.OrderedList: - + break; case RichTextNodeType.ListItem: - + break; case RichTextNodeType.Hyperlink: - + break; case RichTextNodeType.Table: - + break; case RichTextNodeType.TableRow: - + break; case RichTextNodeType.TableHeaderCell: - + break; case RichTextNodeType.TableCell: - + break; case RichTextNodeType.Hr: -
+
break; case RichTextNodeType.EmbeddedAsset: - + break; case RichTextNodeType.Text: - + break; case RichTextNodeType.EmbeddedEntry: - + break; default: - + break; } -} \ No newline at end of file +} diff --git a/src/Dfe.ContentSupport.Web/appsettings.json b/src/Dfe.ContentSupport.Web/appsettings.json deleted file mode 100644 index 169b3df..0000000 --- a/src/Dfe.ContentSupport.Web/appsettings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "CacheTimeOutMs": 30000, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "cs:supportedAssetTypes": { - "ImageTypes": [ - "image/jpeg", - "image/png" - ], - "VideoTypes": [ - "video/mp4", - "video/quicktime" - ] - } -} \ No newline at end of file diff --git a/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css b/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css index 8b89f4d..9787741 100644 --- a/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css +++ b/src/Dfe.ContentSupport.Web/wwwroot/css/cands-site.css @@ -10,160 +10,62 @@ video { position: relative; } - .attachment:after { - content: ''; - display: block; - clear: both; - } - .attachment:after { - content: ''; - display: block; - clear: both; - } - .attachment:after { - content: ''; - display: block; - clear: both; - } +.attachment:after { + content: ''; + display: block; + clear: both; +} - .attachment .attachment-title { - font-weight: 400; - font-size: 1.6875rem; - line-height: 1.1111111111; - margin: 0 0 15px; - } - .attachment .attachment-title { - font-weight: 400; - font-size: 1.6875rem; - line-height: 1.1111111111; - margin: 0 0 15px; - } - .attachment .attachment-title { - font-weight: 400; - font-size: 1.6875rem; - line-height: 1.1111111111; - margin: 0 0 15px; - } +.attachment .attachment-title { + font-weight: 400; + font-size: 1.6875rem; + line-height: 1.1111111111; + margin: 0 0 15px; +} - .attachment .attachment-title .attachment-link { - line-height: 1.29; - } - .attachment .attachment-title .attachment-link { - line-height: 1.29; - } - .attachment .attachment-title .attachment-link { - line-height: 1.29; - } - - .attachment .attachment-details { - padding-left: 134px; - } - .attachment .attachment-details { - padding-left: 134px; - } - .attachment .attachment-details { - padding-left: 134px; - } +.attachment .attachment-title .attachment-link { + line-height: 1.29; +} - .attachment .attachment-thumbnail { - position: relative; - float: left; - margin-right: 25px; - margin-bottom: 15px; - padding: 5px; - display: block; - max-height: 140px; - max-width: 99px; - border: #e6e6e6; - outline: 5px solid #e6e6e6; - background: #ffffff; - box-shadow: 0 2px 2px #999999; - fill: #d8d8d8; - stroke: #d8d8d8; - } - .attachment .attachment-thumbnail { - position: relative; - float: left; - margin-right: 25px; - margin-bottom: 15px; - padding: 5px; - display: block; - max-height: 140px; - max-width: 99px; - border: #e6e6e6; - outline: 5px solid #e6e6e6; - background: #ffffff; - box-shadow: 0 2px 2px #999999; - fill: #d8d8d8; - stroke: #d8d8d8; - } - .attachment .attachment-thumbnail { - position: relative; - float: left; - margin-right: 25px; - margin-bottom: 15px; - padding: 5px; - display: block; - max-height: 140px; - max-width: 99px; - border: #e6e6e6; - outline: 5px solid #e6e6e6; - background: #ffffff; - box-shadow: 0 2px 2px #999999; - fill: #d8d8d8; - stroke: #d8d8d8; - } +.attachment .attachment-details { + padding-left: 134px; +} - .attachment .attachment-metadata { - font-weight: 400; - font-size: 1.1875rem; - line-height: 1.32; - margin: 0 0 15px; - color: #505a5f; - } - .attachment .attachment-metadata { - font-weight: 400; - font-size: 1.1875rem; - line-height: 1.32; - margin: 0 0 15px; - color: #505a5f; - } - .attachment .attachment-metadata { - font-weight: 400; - font-size: 1.1875rem; - line-height: 1.32; - margin: 0 0 15px; - color: #505a5f; - } +.attachment .attachment-thumbnail { + position: relative; + float: left; + margin-right: 25px; + margin-bottom: 15px; + padding: 5px; + display: block; + max-height: 140px; + max-width: 99px; + border: #e6e6e6; + outline: 5px solid #e6e6e6; + background: #ffffff; + box-shadow: 0 2px 2px #999999; + fill: #d8d8d8; + stroke: #d8d8d8; +} + +.attachment .attachment-metadata { + font-weight: 400; + font-size: 1.1875rem; + line-height: 1.32; + margin: 0 0 15px; + color: #505a5f; +} - .attachment .attachment-metadata:last-of-type { - margin-bottom: 0; - } - .attachment .attachment-metadata:last-of-type { - margin-bottom: 0; - } - .attachment .attachment-metadata:last-of-type { - margin-bottom: 0; - } - - .attachment .attachment-metadata .attachment-attribute { - word-wrap: break-word; - overflow-wrap: break-word; - text-decoration: none; - cursor: help; - } - .attachment .attachment-metadata .attachment-attribute { - word-wrap: break-word; - overflow-wrap: break-word; - text-decoration: none; - cursor: help; - } - .attachment .attachment-metadata .attachment-attribute { - word-wrap: break-word; - overflow-wrap: break-word; - text-decoration: none; - cursor: help; - } +.attachment .attachment-metadata:last-of-type { + margin-bottom: 0; +} + +.attachment .attachment-metadata .attachment-attribute { + word-wrap: break-word; + overflow-wrap: break-word; + text-decoration: none; + cursor: help; +} .attachment-thumbnail { display: block; @@ -247,15 +149,9 @@ video { line-height: 1.25; } - .gem-c-metadata a { - font-family: sans-serif; - } - .gem-c-metadata a { - font-family: sans-serif; - } - .gem-c-metadata a { - font-family: sans-serif; - } + .gem-c-metadata a { + font-family: sans-serif; + } .gem-c-metadata--inverse-padded .gem-c-metadata__list { margin: 15px; @@ -269,15 +165,9 @@ video { margin-top: 0; } - .gem-c-metadata__term .gem-c-metadata__definition { - line-height: 1.4; - } - .gem-c-metadata__term .gem-c-metadata__definition { - line-height: 1.4; - } - .gem-c-metadata__term .gem-c-metadata__definition { - line-height: 1.4; - } + .gem-c-metadata__term .gem-c-metadata__definition { + line-height: 1.4; + } .gem-c-metadata__definition:not(:last-of-type) { margin-bottom: 5px; @@ -307,48 +197,24 @@ video { color: #ffffff; } - .gem-c-metadata-inverse a:link, - .gem-c-metadata-inverse a:hover, - .gem-c-metadata-inverse a:visited, - .gem-c-metadata-inverse a:active { - color: #ffffff; - } - .gem-c-metadata-inverse a:link, - .gem-c-metadata-inverse a:hover, - .gem-c-metadata-inverse a:visited, - .gem-c-metadata-inverse a:active { - color: #ffffff; - } - .gem-c-metadata-inverse a:link, - .gem-c-metadata-inverse a:hover, - .gem-c-metadata-inverse a:visited, - .gem-c-metadata-inverse a:active { - color: #ffffff; - } +.gem-c-metadata-inverse a:link, +.gem-c-metadata-inverse a:hover, +.gem-c-metadata-inverse a:visited, +.gem-c-metadata-inverse a:active { + color: #ffffff; +} - .gem-c-metadata-inverse a:focus { - color: #0b0c0c; - } - .gem-c-metadata-inverse a:focus { - color: #0b0c0c; - } - .gem-c-metadata-inverse a:focus { - color: #0b0c0c; - } +.gem-c-metadata-inverse a:focus { + color: #0b0c0c; +} .gem-c-metadata-inverse-padded { padding: 10px; } - .gem-c-metadata-inverse-padded .gem-c-metadata-inverse.gem-c-metadata__list { - margin: 10px; - } - .gem-c-metadata-inverse-padded .gem-c-metadata-inverse.gem-c-metadata__list { - margin: 10px; - } - .gem-c-metadata-inverse-padded .gem-c-metadata-inverse.gem-c-metadata__list { - margin: 10px; - } +.gem-c-metadata-inverse-padded .gem-c-metadata-inverse.gem-c-metadata__list { + margin: 10px; +} .gem-c-metadata__definition { margin: 0; @@ -418,15 +284,14 @@ dl.gem-c-metadata__list { line-height: 1.14286; } - .dfe-vertical-nav .dfe-vertical-nav--section-header { - color: #505a5f; - font-size: 19px; - line-height: 1.25; - font-weight: 600; - color: #505a5f; - margin-bottom: 15px; - padding-top: 0; - } +.dfe-vertical-nav .dfe-vertical-nav--section-header { + color: #505a5f; + font-size: 19px; + line-height: 1.25; + font-weight: 600; + margin-bottom: 15px; + padding-top: 0; +} @media (min-width: 40.0625em) { .dfe-vertical-nav { @@ -468,12 +333,8 @@ dl.gem-c-metadata__list { line-height: 1.25; } - .dfe-vertical-nav__section-item:hover { - border-left: 4px solid #347ca9; - } - -.dfe-vertical-nav__link:focus { - background: inherit; +.dfe-vertical-nav__section-item:hover { + border-left: 4px solid #347ca9; } .dfe-vertical-nav__section-item--current { @@ -504,221 +365,27 @@ dl.gem-c-metadata__list { color: #003a69; } - .dfe-vertical-nav__section-item--current .dfe-vertical-nav__link:hover { - text-decoration: none; - } +.dfe-vertical-nav__section-item--current .dfe-vertical-nav__link:hover { + text-decoration: none; +} .dfe-vertical-nav__section--nested { margin-bottom: 5px; } - .dfe-vertical-nav__section--nested .dfe-vertical-nav__link { - padding-left: 20px; - font-weight: 400; - margin-bottom: 0; - margin-top: -5px; - } - - .dfe-vertical-nav__section--nested .dfe-vertical-nav__section-item::before { - content: "�"; - margin-left: -20px; - color: #505a5f; - } - -.dfe-vertical-nav--count { - float: right; - background: #b1b4b6; - padding: 9px 5px 9px 5px; - border-radius: 0; - color: #0b0c0c; - font-weight: 700; - min-width: 25px; - text-align: center; - font-size: 12px; -} - -@media print { - .dfe-vertical-nav__theme { - font-family: sans-serif; - } -} - -@media (min-width: 40.0625em) { - .dfe-vertical-nav__theme { - font-size: 19px; - font-size: 1.1875rem; - line-height: 1.31579; - } - - .dfe-vertical-nav--count { - padding: 12px 8px 12px 8px; - } -} - -.dfe-vertical-nav__section .dfe-vertical-nav__section-item--current--child-active .dfe-vertical-nav__link { +.dfe-vertical-nav__section--nested .dfe-vertical-nav__link { + padding-left: 20px; font-weight: 400; -} - -.dfe-vertical-nav__section .dfe-vertical-nav__section { margin-bottom: 0; + margin-top: -5px; } - .dfe-vertical-nav__section .dfe-vertical-nav__section .dfe-vertical-nav__section-item { - border-left: none; - } - - - .dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current { - border-left: none; - background: #347ca9; - } - - .dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current .dfe-vertical-nav__link { - font-weight: 700; - } - -.print-link-button { - background: url(/assets/icon-print.png) no-repeat 10px 50%; - background-size: 16px 18px; - padding: 10px 10px 10px 36px; - border: 1px solid #b1b4b6; - color: #1d70b8; - cursor: pointer; - margin: 0; - margin-bottom: 15px; - font-weight: 400; - font-size: 14px; - font-size: 0.875rem; - line-height: 1.1429; -} - -.print-button { - margin-top: 2rem; -} - -.govuk-list.govuk-list--bullet li .govuk-body { - margin-bottom: 0; -} - - - - -.dfe-vertical-nav { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-weight: 400; - font-size: 16px; - font-size: 0.875rem; - line-height: 1.14286; -} - - .dfe-vertical-nav .dfe-vertical-nav--section-header { - color: #505a5f; - font-size: 19px; - line-height: 1.25; - font-weight: 600; - color: #505a5f; - margin-bottom: 15px; - padding-top: 0; - } - -@media (min-width: 40.0625em) { - .dfe-vertical-nav { - padding-left: 15px; - } -} - -@media print { - .dfe-vertical-nav { - font-size: 14pt; - line-height: 1.2; - } -} - -@media (min-width: 40.0625em) { - .dfe-vertical-nav { - margin-left: -15px; - } -} - -.dfe-vertical-nav__section { - margin: 0 0 20px; - padding: 0; - list-style-type: none; -} - -.dfe-vertical-nav__link { - display: block; - padding: 7px 30px 8px 10px; - text-decoration: none; - margin-bottom: 5px; - color: #003a69; -} - -.dfe-vertical-nav__section-item { - border-left: 4px solid #b1b4b6; - font-size: 16px; - font-size: 1rem; - line-height: 1.25; -} - - .dfe-vertical-nav__section-item:hover { - border-left: 4px solid #347ca9; - } - -.dfe-vertical-nav__link:focus { - background: inherit; -} - -.dfe-vertical-nav__section-item--current { - border-left: 4px solid #003a69; - font-weight: 700; - background: #f3f2f1; -} - -.dfe-vertical-nav__link:active, .dfe-vertical-nav__link:hover { - color: #1d70b8; - border-left-color: #347ca9; - text-decoration: none; - box-shadow: none; - outline: 0; -} - -.dfe-vertical-nav__link:focus { - background: #fd0; - color: #0b0c0c; - text-decoration: none; - box-shadow: none; - outline: 0; -} - -.dfe-vertical-nav__section-item--current .dfe-vertical-nav__link { - border-left-color: #003a69; - font-weight: 700; - color: #003a69; -} - - .dfe-vertical-nav__section-item--current .dfe-vertical-nav__link:hover { - text-decoration: none; - } - -.dfe-vertical-nav__section--nested { - margin-bottom: 5px; +.dfe-vertical-nav__section--nested .dfe-vertical-nav__section-item::before { + content: "�"; + margin-left: -20px; + color: #505a5f; } - .dfe-vertical-nav__section--nested .dfe-vertical-nav__link { - padding-left: 20px; - font-weight: 400; - margin-bottom: 0; - margin-top: -5px; - } - - .dfe-vertical-nav__section--nested .dfe-vertical-nav__section-item::before { - content: "�"; - margin-left: -20px; - color: #505a5f; - } - .dfe-vertical-nav--count { float: right; background: #b1b4b6; @@ -757,19 +424,19 @@ dl.gem-c-metadata__list { margin-bottom: 0; } - .dfe-vertical-nav__section .dfe-vertical-nav__section .dfe-vertical-nav__section-item { - border-left: none; - } +.dfe-vertical-nav__section .dfe-vertical-nav__section .dfe-vertical-nav__section-item { + border-left: none; +} - .dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current { - border-left: none; - background: #347ca9; - } +.dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current { + border-left: none; + background: #347ca9; +} - .dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current .dfe-vertical-nav__link { - font-weight: 700; - } +.dfe-vertical-nav__section .dfe-vertical-nav__section.dfe-vertical-nav__section-item--current .dfe-vertical-nav__link { + font-weight: 700; +} .print-link-button { background: url(/assets/icon-print.png) no-repeat 10px 50%; @@ -792,4 +459,4 @@ dl.gem-c-metadata__list { .govuk-list.govuk-list--bullet li .govuk-body { margin-bottom: 0; -} +} diff --git a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs index dd1b845..1beccdc 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAccordionTests.cs @@ -1,4 +1,5 @@ -using Dfe.ContentSupport.Web.Common; +using Contentful.Core.Models; +using Dfe.ContentSupport.Web.Common; using Dfe.ContentSupport.Web.Configuration; using Dfe.ContentSupport.Web.Models; using Dfe.ContentSupport.Web.Models.Mapped; @@ -28,11 +29,11 @@ public class CustomAccordionTests InternalName = InternalName, Title = Title, SummaryLine = SummaryLine, - Sys = new Sys + SystemProperties = new SystemProperties { - ContentType = new ContentType + ContentType = new Contentful.Core.Models.ContentType { - Sys = new Sys + SystemProperties = new SystemProperties { Id = ContentId } diff --git a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAttachmentTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAttachmentTests.cs index 7b2ffdf..da395a0 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAttachmentTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomAttachmentTests.cs @@ -31,11 +31,12 @@ public class CustomAttachmentTests { InternalName = InternalName, Title = Title, - Sys = new Sys + SystemProperties = new SystemProperties { - ContentType = new ContentType + ContentType = new Contentful.Core.Models.ContentType { - Sys = new Sys + + SystemProperties = new SystemProperties { Id = ContentId } diff --git a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomCardTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomCardTests.cs index c90df3a..f368f3c 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomCardTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomCardTests.cs @@ -34,11 +34,11 @@ public class CustomCardTests Meta = Meta, ImageAlt = ImageAlt, Description = Description, - Sys = new Sys + SystemProperties = new Contentful.Core.Models.SystemProperties { - ContentType = new ContentType + ContentType = new Contentful.Core.Models.ContentType { - Sys = new Sys + SystemProperties = new Contentful.Core.Models.SystemProperties { Id = ContentId } @@ -52,10 +52,10 @@ public class CustomCardTests { Url = ImageUri } - } + }, } - } - } + }, + }, }; [Fact] diff --git a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomGridContainerTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomGridContainerTests.cs index 0bab7f3..cd74279 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomGridContainerTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Custom/CustomGridContainerTests.cs @@ -1,4 +1,5 @@ -using Dfe.ContentSupport.Web.Common; +using Contentful.Core.Models; +using Dfe.ContentSupport.Web.Common; using Dfe.ContentSupport.Web.Configuration; using Dfe.ContentSupport.Web.Models; using Dfe.ContentSupport.Web.Models.Mapped.Custom; @@ -31,11 +32,12 @@ public class CustomGridContainerTests Meta = CardMeta, ImageAlt = CardImageAlt, Description = CardDescription, - Sys = new Sys + SystemProperties = new SystemProperties { - ContentType = new ContentType + ContentType = new Contentful.Core.Models.ContentType { - Sys = new Sys + + SystemProperties = new SystemProperties { Id = CardContentId } @@ -45,7 +47,7 @@ public class CustomGridContainerTests { Fields = new Fields { - File = new FileDetails + File = new Web.Models.FileDetails { Url = CardImageUri } @@ -61,11 +63,11 @@ public class CustomGridContainerTests Target = new Target { InternalName = ContainerInternalName, - Sys = new Sys + SystemProperties = new Contentful.Core.Models.SystemProperties { - ContentType = new ContentType + ContentType = new Contentful.Core.Models.ContentType { - Sys = new Sys + SystemProperties = new Contentful.Core.Models.SystemProperties { Id = ContainerContentId } diff --git a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Standard/EmbeddedEntryTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Standard/EmbeddedEntryTests.cs index 23f8ca5..c285b58 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Standard/EmbeddedEntryTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Models/Mapped/Standard/EmbeddedEntryTests.cs @@ -1,4 +1,5 @@ -using Dfe.ContentSupport.Web.Common; +using Contentful.Core.Models; +using Dfe.ContentSupport.Web.Common; using Dfe.ContentSupport.Web.Configuration; using Dfe.ContentSupport.Web.Models; using Dfe.ContentSupport.Web.Models.Mapped.Standard; @@ -22,7 +23,7 @@ public class EmbeddedEntryTests { InternalName = InternalName, JumpIdentifier = JumpIdentifier, - Sys = new Sys() + SystemProperties = new SystemProperties() } } }; diff --git a/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs index 704f487..135cfba 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Services/ContentServiceTests.cs @@ -19,9 +19,9 @@ public class ContentServiceTests { Items = new List { - new() { Slug = "slug1", IsSitemap = true, Sys = new Sys() }, - new() { Slug = "slug2", IsSitemap = false, Sys = new Sys() }, - new() { Slug = "slug3", IsSitemap = true, Sys = new Sys() } + new() { Slug = "slug1", IsSitemap = true, SystemProperties = new SystemProperties() }, + new() { Slug = "slug2", IsSitemap = false, SystemProperties = new SystemProperties() }, + new() { Slug = "slug3", IsSitemap = true, SystemProperties = new SystemProperties() } } }; diff --git a/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs b/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs index 9f6b38b..e5dffba 100644 --- a/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs +++ b/tests/Dfe.ContentSupport.Web.Tests/Services/ModelMapperTests.cs @@ -1,4 +1,5 @@ -using Dfe.ContentSupport.Web.Common; +using Contentful.Core.Models; +using Dfe.ContentSupport.Web.Common; using Dfe.ContentSupport.Web.Configuration; using Dfe.ContentSupport.Web.Models; using Dfe.ContentSupport.Web.Models.Mapped; @@ -22,15 +23,15 @@ public void MapToCsPages_Return_Correct_Amount() { new() { - Sys = new Sys() + SystemProperties = new SystemProperties() }, new() { - Sys = new Sys() + SystemProperties = new SystemProperties() }, new() - { - Sys = new Sys() + { + SystemProperties = new SystemProperties() } }; @@ -132,11 +133,12 @@ public void UnknownCustom_Returns_Null() { var testValue = new Target { - Sys = new Sys + SystemProperties = new SystemProperties { - ContentType = new ContentType + ContentType = new Contentful.Core.Models.ContentType { - Sys = new Sys + + SystemProperties = new SystemProperties { Id = "DUMMY" }