From ee81078194580ecbf42f14595beff27e77ab4a3b Mon Sep 17 00:00:00 2001 From: Maria Date: Mon, 19 Aug 2024 17:24:45 +0100 Subject: [PATCH 01/12] WiP: Details component --- .../Contentful/EntityResolverTests.cs | 1 + .../Contentful/PartialsFactoryTests.cs | 1 + .../Contentful/EntityResolver.cs | 1 + .../Contentful/Models/Details.cs | 9 +++++++++ .../Contentful/PartialsFactory.cs | 1 + .../Views/Shared/_Details.cshtml | 16 ++++++++++++++++ 6 files changed, 29 insertions(+) create mode 100644 Childrens-Social-Care-CPD/Contentful/Models/Details.cs create mode 100644 Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml diff --git a/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs b/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs index a7486e1e..39372e58 100644 --- a/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs +++ b/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs @@ -25,6 +25,7 @@ public class EntityResolverTests [TestCase("contentSeparator", typeof(ContentSeparator))] [TestCase("detailedPathway", typeof(DetailedPathway))] [TestCase("detailedRole", typeof(DetailedRole))] + [TestCase("details", typeof(Details))] [TestCase("feedback", typeof(Feedback))] [TestCase("heroBanner", typeof(HeroBanner))] [TestCase("imageCard", typeof(ImageCard))] diff --git a/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs b/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs index 4387a32d..22f2274d 100644 --- a/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs +++ b/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs @@ -24,6 +24,7 @@ public partial class PartialsFactoryTests new object[] { new ContentsAnchor(), "_ContentsAnchor" }, new object[] { new DetailedPathway(), "_DetailedPathway" }, new object[] { new DetailedRole(), "_DetailedRole" }, + new object[] { new Details(), "_Details" }, new object[] { new Feedback(), "_Feedback" }, new object[] { new HeroBanner(), string.Empty }, new object[] { new LinkCard(), "_LinkCard" }, diff --git a/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs b/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs index 2f5fab1c..084d1019 100644 --- a/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs +++ b/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs @@ -28,6 +28,7 @@ public Type Resolve(string contentTypeId) "contentSeparator" => typeof(ContentSeparator), "detailedPathway" => typeof(DetailedPathway), "detailedRole" => typeof(DetailedRole), + "details" => typeof(Details), "feedback" => typeof(Feedback), "heroBanner" => typeof(HeroBanner), "imageCard" => typeof(ImageCard), diff --git a/Childrens-Social-Care-CPD/Contentful/Models/Details.cs b/Childrens-Social-Care-CPD/Contentful/Models/Details.cs new file mode 100644 index 00000000..03f29241 --- /dev/null +++ b/Childrens-Social-Care-CPD/Contentful/Models/Details.cs @@ -0,0 +1,9 @@ +using Contentful.Core.Models; + +namespace Childrens_Social_Care_CPD.Contentful.Models; + +public class Details : IContent +{ + public string SummaryText { get; set; } + public string DetailsText { get; set; } +} diff --git a/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs b/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs index 73669f0d..906bf0bd 100644 --- a/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs +++ b/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs @@ -27,6 +27,7 @@ public static string GetPartialFor(IContent item) ContentsAnchor => "_ContentsAnchor", DetailedRole => "_DetailedRole", DetailedPathway => "_DetailedPathway", + Details => "_Details", Feedback => "_Feedback", HeroBanner => string.Empty,// skip - handled in specific layout section ImageCard => "_ImageCard", diff --git a/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml new file mode 100644 index 00000000..ff1a5ad9 --- /dev/null +++ b/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml @@ -0,0 +1,16 @@ +@using Childrens_Social_Care_CPD.Contentful; +@using Childrens_Social_Care_CPD.Contentful.Models; +@using Childrens_Social_Care_CPD.Contentful.Renderers; + +@model Details + +
+ + + SUMMARY TEXT PLACEHOLDER + + +
+ DETAILS TEXT PLACEHOLDER +
+
\ No newline at end of file From 8147eadf6c431144a920c539f1e74b4afe46d380 Mon Sep 17 00:00:00 2001 From: Maria Date: Fri, 23 Aug 2024 14:01:18 +0100 Subject: [PATCH 02/12] WiP: details migration script --- .../Views/Shared/_Details.cshtml | 5 +- .../migrations/0008-details-component.cjs | 71 +++++++++++++++++++ Contentful-Schema/migrations/manifest.txt | 3 +- 3 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 Contentful-Schema/migrations/0008-details-component.cjs diff --git a/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml index ff1a5ad9..ed07aab3 100644 --- a/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml +++ b/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml @@ -7,10 +7,11 @@
- SUMMARY TEXT PLACEHOLDER + @* TODO: add ID? *@ + @Model.SummaryText
- DETAILS TEXT PLACEHOLDER + @Model.DetailsText
\ No newline at end of file diff --git a/Contentful-Schema/migrations/0008-details-component.cjs b/Contentful-Schema/migrations/0008-details-component.cjs new file mode 100644 index 00000000..e06ff02b --- /dev/null +++ b/Contentful-Schema/migrations/0008-details-component.cjs @@ -0,0 +1,71 @@ +module.exports = function (migration) { + const details = migration + .createContentType("details") + .description( + "Allows users to view more detailed information if they need it, as per the GDS component of the same name." + ) + .displayField("summaryText"); + + details + .createField("summaryText") + .name("Summary text") + .type("Symbol") + .localized(false) + .required(true) + .validations([ + { + unique: true, + }, + ]) + .disabled(false) + .omitted(false); + + details + .createfield("detailsText") + .name("Summary text") + .type("RichText") + .localized(false) + .required(true) + .validations([ + { + enabledMarks: [ + "bold", + "italic", + "underline", + "code", + "superscript", + "subscript", + ], + message: + "Only bold, italic, underline, code, superscript, and subscript marks are allowed", + }, + { + enabledNodeTypes: [ + "heading-1", + "heading-2", + "heading-3", + "heading-4", + "heading-5", + "heading-6", + "ordered-list", + "unordered-list", + "hr", + "blockquote", + "embedded-entry-block", + "embedded-asset-block", + "table", + "asset-hyperlink", + "embedded-entry-inline", + "entry-hyperlink", + "hyperlink" + ], + message: + "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, table, link to asset, inline entry, link to entry, and link to Url nodes are allowed" + }, + { + nodes: {} + } + ]) + .disabled(false) + .omitted(false); + } \ No newline at end of file diff --git a/Contentful-Schema/migrations/manifest.txt b/Contentful-Schema/migrations/manifest.txt index a975447b..430a1228 100644 --- a/Contentful-Schema/migrations/manifest.txt +++ b/Contentful-Schema/migrations/manifest.txt @@ -4,4 +4,5 @@ 0004-back-to-top-component.cjs 0005-create-employer-standards-page-category.cjs 0006-accordion-component.cjs -0007-add-header-field-to-navigation-menu.cjs \ No newline at end of file +0007-add-header-field-to-navigation-menu.cjs +0008-details-component.cjs \ No newline at end of file From 74f4fee7be9d6d835733ce176b07adba6de64551 Mon Sep 17 00:00:00 2001 From: Maria Date: Tue, 27 Aug 2024 16:52:58 +0100 Subject: [PATCH 03/12] WiP: details component migration script --- .../migrations/0008-details-component.cjs | 164 ++++++++++-------- 1 file changed, 95 insertions(+), 69 deletions(-) diff --git a/Contentful-Schema/migrations/0008-details-component.cjs b/Contentful-Schema/migrations/0008-details-component.cjs index e06ff02b..7501fab6 100644 --- a/Contentful-Schema/migrations/0008-details-component.cjs +++ b/Contentful-Schema/migrations/0008-details-component.cjs @@ -1,71 +1,97 @@ module.exports = function (migration) { const details = migration - .createContentType("details") - .description( - "Allows users to view more detailed information if they need it, as per the GDS component of the same name." - ) - .displayField("summaryText"); - - details - .createField("summaryText") - .name("Summary text") - .type("Symbol") - .localized(false) - .required(true) - .validations([ - { - unique: true, - }, - ]) - .disabled(false) - .omitted(false); - - details - .createfield("detailsText") - .name("Summary text") - .type("RichText") - .localized(false) - .required(true) - .validations([ - { - enabledMarks: [ - "bold", - "italic", - "underline", - "code", - "superscript", - "subscript", - ], - message: - "Only bold, italic, underline, code, superscript, and subscript marks are allowed", - }, - { - enabledNodeTypes: [ - "heading-1", - "heading-2", - "heading-3", - "heading-4", - "heading-5", - "heading-6", - "ordered-list", - "unordered-list", - "hr", - "blockquote", - "embedded-entry-block", - "embedded-asset-block", - "table", - "asset-hyperlink", - "embedded-entry-inline", - "entry-hyperlink", - "hyperlink" - ], - message: - "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, table, link to asset, inline entry, link to entry, and link to Url nodes are allowed" - }, - { - nodes: {} - } - ]) - .disabled(false) - .omitted(false); - } \ No newline at end of file + .createContentType("details") + .description( + "Allows users to view more detailed information if they need it, as per the GDS component of the same name." + ) + .displayField("summaryText"); + + details + .createField("summaryText") + .name("Summary text") + .type("Symbol") + .localized(false) + .required(true) + .validations([ + { + unique: true, + }, + ]) + .disabled(false) + .omitted(false); + + details + .createfield("detailsText") + .name("Summary text") + .type("RichText") + .localized(false) + .required(true) + .validations([ + { + enabledMarks: [ + "bold", + "italic", + "underline", + "code", + "superscript", + "subscript", + ], + message: + "Only bold, italic, underline, code, superscript, and subscript marks are allowed", + }, + { + enabledNodeTypes: [ + "heading-1", + "heading-2", + "heading-3", + "heading-4", + "heading-5", + "heading-6", + "ordered-list", + "unordered-list", + "hr", + "blockquote", + "embedded-entry-block", + "embedded-asset-block", + "table", + "asset-hyperlink", + "embedded-entry-inline", + "entry-hyperlink", + "hyperlink", + ], + message: + "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, table, link to asset, inline entry, link to entry, and link to Url nodes are allowed", + }, + { + nodes: {}, + }, + ]) + .disabled(false) + .omitted(false); + + const contentTypeId = "content", + linkingFieldId = "items", + detailsTypeId = "details"; + + const response = await makeRequest({ + method: "GET", + url: `/content_types?sys.id[in]=${contentTypeId}` + }); + + const validations = response.items[0].fields + .filter(field => field.id == linkingFieldId)[0] + .items.validations.map(rule => { + if (rule.linkContentType && !rule.linkContentType.includes(detailsTypeId)) { + rule.linkContentType.push(detailsTypeId) + } + return rule; + }); + + migration.editContentType(contentTypeId) + .editField(linkingFieldId).items({ + type: 'Link', + linkType: 'Entry', + validations: validations, + }); + +}; \ No newline at end of file From 68a08f7f2b2f69b0cde460b46357ff3ae42b933f Mon Sep 17 00:00:00 2001 From: Maria Date: Tue, 27 Aug 2024 16:54:47 +0100 Subject: [PATCH 04/12] WiP: async added --- .../migrations/0008-details-component.cjs | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Contentful-Schema/migrations/0008-details-component.cjs b/Contentful-Schema/migrations/0008-details-component.cjs index 7501fab6..d1cd9bbf 100644 --- a/Contentful-Schema/migrations/0008-details-component.cjs +++ b/Contentful-Schema/migrations/0008-details-component.cjs @@ -1,5 +1,5 @@ -module.exports = function (migration) { - const details = migration +module.exports = async function (migration) { + const details = migration .createContentType("details") .description( "Allows users to view more detailed information if they need it, as per the GDS component of the same name." @@ -70,28 +70,29 @@ module.exports = function (migration) { .omitted(false); const contentTypeId = "content", - linkingFieldId = "items", - detailsTypeId = "details"; + linkingFieldId = "items", + detailsTypeId = "details"; const response = await makeRequest({ method: "GET", - url: `/content_types?sys.id[in]=${contentTypeId}` + url: `/content_types?sys.id[in]=${contentTypeId}`, }); const validations = response.items[0].fields - .filter(field => field.id == linkingFieldId)[0] - .items.validations.map(rule => { - if (rule.linkContentType && !rule.linkContentType.includes(detailsTypeId)) { - rule.linkContentType.push(detailsTypeId) + .filter((field) => field.id == linkingFieldId)[0] + .items.validations.map((rule) => { + if ( + rule.linkContentType && + !rule.linkContentType.includes(detailsTypeId) + ) { + rule.linkContentType.push(detailsTypeId); } return rule; - }); + }); - migration.editContentType(contentTypeId) - .editField(linkingFieldId).items({ - type: 'Link', - linkType: 'Entry', - validations: validations, + migration.editContentType(contentTypeId).editField(linkingFieldId).items({ + type: "Link", + linkType: "Entry", + validations: validations, }); - -}; \ No newline at end of file +}; From 0dad41f12dc62588709f824a88389ea08cc5f7d7 Mon Sep 17 00:00:00 2001 From: Maria Date: Wed, 28 Aug 2024 12:16:08 +0100 Subject: [PATCH 05/12] migrations file updated --- .../migrations/migrations.tar.gz | Bin 4063 -> 3884 bytes migrations.tar.gz | Bin 0 -> 45 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 migrations.tar.gz diff --git a/Contentful-Schema/migrations/migrations.tar.gz b/Contentful-Schema/migrations/migrations.tar.gz index 1a6f72cf4f725fd1ef9b32c55cc9ee889471868a..6a2385feff458985b2eeeb05899a0fd6f6b1a300 100644 GIT binary patch literal 3884 zcmV+{57Y1;iwFP!000001MMAaZ`(MspBLEwz%vf(WMR9qEjxz7pjkR_2?-;c#A@T9!5Jd%-;HUxl9sv;W1< zwx29WQ`>%KO|9X{WXS%7VOhR~pVsu*(4LM@tdVVeB)JybPlxCNIc54Q7cK2IOerT}KXn9+QV}zafxjVGt(-vE^0x z8S3UWcrm8IETT?AUxz_LgXH3VNsl_BLFZVi7B~wic?%^(FLG%-i@YWFdsJj&>bxWg z{hSa$RdVMgH^d>ncYOmHeo9GvB}Ur!JVzozzeM?EtPGX+Z4Ip#R%> z=ajI4B#=Gs5@Zaw-qBm?S0NZFmvV5uh2woqqm{u`Dp?KDyx^3481~4hN5+?}F|7^Y zNBaW08_v=NkP{P*nu<8QfAwZJ7eHh74R9K;#lz+JF$U0=D=;7e#c?~mib5}e5oeXf zK&NTsdjYMiF$>-5!Z=;hh~F1Ab*`#w=xBs#LF3rDrl%GC{VVYA39h+E_~LpbUqz4L zbbCaaSC8F8`6S2!fk~W*636$$J6ZzWW3TPLyoa&yj;-078|t`TaNQqPf+wpnYOFDC ztYJ6Sm^9XyR@Mk3fHHOaz86>Tb{e#*b`w<=UBSWn_$dvOYP6$^E9wH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ations/0008-details-component.cjs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Contentful-Schema/migrations/0008-details-component.cjs b/Contentful-Schema/migrations/0008-details-component.cjs index d1cd9bbf..d1f0ddb4 100644 --- a/Contentful-Schema/migrations/0008-details-component.cjs +++ b/Contentful-Schema/migrations/0008-details-component.cjs @@ -1,6 +1,7 @@ module.exports = async function (migration) { const details = migration .createContentType("details") + .name("Details") .description( "Allows users to view more detailed information if they need it, as per the GDS component of the same name." ) @@ -12,17 +13,13 @@ module.exports = async function (migration) { .type("Symbol") .localized(false) .required(true) - .validations([ - { - unique: true, - }, - ]) + .validations([]) .disabled(false) .omitted(false); details - .createfield("detailsText") - .name("Summary text") + .createField("detailsText") + .name("Details text") .type("RichText") .localized(false) .required(true) @@ -59,6 +56,7 @@ module.exports = async function (migration) { "entry-hyperlink", "hyperlink", ], + message: "Only heading 1, heading 2, heading 3, heading 4, heading 5, heading 6, ordered list, unordered list, horizontal rule, quote, block entry, asset, table, link to asset, inline entry, link to entry, and link to Url nodes are allowed", }, @@ -69,6 +67,9 @@ module.exports = async function (migration) { .disabled(false) .omitted(false); + details.changeFieldControl("summaryText", "builtin", "singleLine", {}); + details.changeFieldControl("detailsText", "builtin", "richTextEditor", {}); + const contentTypeId = "content", linkingFieldId = "items", detailsTypeId = "details"; From 8fc2a8f34518b2520b62442333e54b4343cf7531 Mon Sep 17 00:00:00 2001 From: Maria Date: Wed, 28 Aug 2024 15:12:26 +0100 Subject: [PATCH 07/12] rectify error on details view --- Childrens-Social-Care-CPD/Contentful/Models/Details.cs | 2 +- Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Childrens-Social-Care-CPD/Contentful/Models/Details.cs b/Childrens-Social-Care-CPD/Contentful/Models/Details.cs index 03f29241..f899df5f 100644 --- a/Childrens-Social-Care-CPD/Contentful/Models/Details.cs +++ b/Childrens-Social-Care-CPD/Contentful/Models/Details.cs @@ -5,5 +5,5 @@ namespace Childrens_Social_Care_CPD.Contentful.Models; public class Details : IContent { public string SummaryText { get; set; } - public string DetailsText { get; set; } + public Document DetailsText { get; set; } } diff --git a/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml index ed07aab3..4de3522a 100644 --- a/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml +++ b/Childrens-Social-Care-CPD/Views/Shared/_Details.cshtml @@ -7,11 +7,10 @@
- @* TODO: add ID? *@ @Model.SummaryText
- @Model.DetailsText +
\ No newline at end of file From 66444a083523ba41b1b03ba8526d4b904bada88f Mon Sep 17 00:00:00 2001 From: Maria Date: Fri, 30 Aug 2024 11:54:01 +0100 Subject: [PATCH 08/12] details component finalised --- .../migrations/0008-details-component.cjs | 2 +- .../migrations/migrations.tar.gz | Bin 3884 -> 3913 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Contentful-Schema/migrations/0008-details-component.cjs b/Contentful-Schema/migrations/0008-details-component.cjs index d1f0ddb4..ffe49ce7 100644 --- a/Contentful-Schema/migrations/0008-details-component.cjs +++ b/Contentful-Schema/migrations/0008-details-component.cjs @@ -1,4 +1,4 @@ -module.exports = async function (migration) { +module.exports = async function (migration, { makeRequest }) { const details = migration .createContentType("details") .name("Details") diff --git a/Contentful-Schema/migrations/migrations.tar.gz b/Contentful-Schema/migrations/migrations.tar.gz index 6a2385feff458985b2eeeb05899a0fd6f6b1a300..5cd70594b48c902c6984447855c139d5c7e7e5a9 100644 GIT binary patch literal 3913 zcmV-P54P|hiwFP!000001MMCCZ`(GuKM&adz%veWGT5$c%g!N1@6dL=tw7fsmh6B- z5!@7uNpzJZPajFMApiTlM^X|=k+S@m4l{waGQauw`1ro~>Nw7@A4FGi|1$nOnEfw( zw*BNln!4^YXX*@3CPVfw49oHz{B)+zhVFEH;*4D9Wc17#4kr`$8F6+nms-lx%u5J) z_M?{s-aZEWveG>E^N+))S9*m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t29Z3ybLmQ zY17IQySjG(0M-wF2ob(p9-2LKz~MQ@fXwa$^7#sx4$LVHUtEA})UNU4!MKVzLIUqX+0M4G(8a(`gk?p!1S&Z3_YFhnx($j>Ten z9KiY51M;(T&lc$b$-;LO?8$$R2)B9uDl8^p#9<$|iUp8+5MUYqTVHJnHU@tJ2@>!1 z?EORq(9Tq4Jb-OHZCV{x*_)sih(mrd)ZHBnH+$aIcKva>SUAj7Y(kkb49d&v?c_(4V@e6nFYfSk5lD+>&ZjwfQhPLPn7&y1yHCuOoL4$M?dq9)@cRCtr`v2*4 zc+mgvCAHW8H<^12g!vipC8O)Qzh5i2kdpR>>Tg4TQZsks|I7- z_L?)=R&uKwB1ba9zs8$*)Q#5nrduDp6;d;e+PxCp@}RY$f}SW~0MOsR^<4^5q`!lg z|M?ho^nYSa#z_CCCHCzL+dU%&;GSIG60rBED7(l$0Pj9n?PR6pAm!^;^u} zM6;FZ3eC=x=*gek@!Pcaxo~>tMXRk{4`jR5)z?I;HN>bjMy9QbM{9^eTOE7W9C23G zSD3n-SK$d3J%W?eW_A@y$in`^p-!;w@t__&UC=TsL;S;S&j_{yHu>xfUB* zp&lzLH0a3`=;sQkmTy_r#w)qKwpEF>RfHMT@m2co7Oz;p3TN1_FfE+Gn*+rdB%hOA zjnN?gS@!sZ$$!J?#J0ya{{KH?dvuWh_K__8|9|@Sn^i-?vKF;L1X+!mXXdPYrDsU2 uMWy39D{ZaTX0>;&1UaNbI;2B7q(eHSLpr2GI;2B-;`D#HZSfHRcmM!2c9aYN From 242de115345925558db9794773d901ade8444f0c Mon Sep 17 00:00:00 2001 From: Maria Date: Wed, 4 Sep 2024 10:47:20 +0100 Subject: [PATCH 09/12] feat: completed Details component --- .../Views/Shared/_AudioResource.cshtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Childrens-Social-Care-CPD/Views/Shared/_AudioResource.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_AudioResource.cshtml index 1e8ab5d3..1d1513bb 100644 --- a/Childrens-Social-Care-CPD/Views/Shared/_AudioResource.cshtml +++ b/Childrens-Social-Care-CPD/Views/Shared/_AudioResource.cshtml @@ -14,7 +14,8 @@ @if (Model.Transcript.Content != null) {
- View transcript + View transcript +
@{ await Html.RenderPartialAsync("_RichText", Model.Transcript); @@ -23,5 +24,4 @@
} - - + \ No newline at end of file From bacee40917dd59bce7faac1e9c6c974b7dd5e6ef Mon Sep 17 00:00:00 2001 From: Maria Date: Mon, 9 Sep 2024 11:16:06 +0100 Subject: [PATCH 10/12] sonar checkout version updated and fetch-depth set to 0 --- .github/workflows/sonarqube.yml | 128 ++++++++++++++++---------------- 1 file changed, 65 insertions(+), 63 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index caaab92b..722d9037 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -1,66 +1,68 @@ +name: Static code analysis +on: + pull_request: + branches: + - main + - next +jobs: + code-analysis: name: Static code analysis - on: - pull_request: - branches: - - main - - next - jobs: - code-analysis: - name: Static code analysis - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'zulu' # Alternative distribution options are available. - - - name: Cache SonarCloud packages - uses: actions/cache@v1 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v3 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache SonarCloud coverage - id: cache-sonar-coverage - uses: actions/cache@v3 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-coverage - restore-keys: ${{ runner.os }}-coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Install SonarCloud scanners - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - run: dotnet tool install --global dotnet-sonarscanner - - - name: Install SonarCloud coverage - if: steps.cache-sonar-coverage.outputs.cache-hit != 'true' - run: dotnet tool install --global dotnet-coverage + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: "zulu" # Alternative distribution options are available. - - name: Build, Test and Analyze - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - dotnet-sonarscanner begin \ - /k:"DFE-Digital_childrens-social-care-cpd" \ - /o:"dfe-digital" \ - /d:sonar.qualitygate.wait=true \ - /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ - /d:sonar.exclusions="**/*.css,**/*.scss,**/Models/*,**/Program.cs,**/WebApplicationBuilderExtensions.cs,**/GraphQL/Queries/*" \ - /d:sonar.test.exclusions="Childrens-Social-Care-CPD-Tests/**/*" \ - /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ - /d:sonar.host.url="https://sonarcloud.io" - dotnet build --no-incremental - dotnet-coverage collect --settings dotnet-cover-config.xml -f xml -o coverage.xml "dotnet test" - dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~\sonar\cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache SonarCloud scanner + id: cache-sonar-scanner + uses: actions/cache@v3 + with: + path: ~\sonar\cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache SonarCloud coverage + id: cache-sonar-coverage + uses: actions/cache@v3 + with: + path: ~\sonar\cache + key: ${{ runner.os }}-coverage + restore-keys: ${{ runner.os }}-coverage + + - name: Install SonarCloud scanners + if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' + run: dotnet tool install --global dotnet-sonarscanner + + - name: Install SonarCloud coverage + if: steps.cache-sonar-coverage.outputs.cache-hit != 'true' + run: dotnet tool install --global dotnet-coverage + + - name: Build, Test and Analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + dotnet-sonarscanner begin \ + /k:"DFE-Digital_childrens-social-care-cpd" \ + /o:"dfe-digital" \ + /d:sonar.qualitygate.wait=true \ + /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ + /d:sonar.exclusions="**/*.css,**/*.scss,**/Models/*,**/Program.cs,**/WebApplicationBuilderExtensions.cs,**/GraphQL/Queries/*" \ + /d:sonar.test.exclusions="Childrens-Social-Care-CPD-Tests/**/*" \ + /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ + /d:sonar.host.url="https://sonarcloud.io" + dotnet build --no-incremental + dotnet-coverage collect --settings dotnet-cover-config.xml -f xml -o coverage.xml "dotnet test" + dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" From d4a72e192a6223a44fd70db1d8ccb8ff0a930858 Mon Sep 17 00:00:00 2001 From: Maria Date: Mon, 9 Sep 2024 11:58:10 +0100 Subject: [PATCH 11/12] exclude Contentful migrations on sonar checks --- .github/workflows/sonarqube.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 722d9037..b3e67aef 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -59,7 +59,7 @@ jobs: /o:"dfe-digital" \ /d:sonar.qualitygate.wait=true \ /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ - /d:sonar.exclusions="**/*.css,**/*.scss,**/Models/*,**/Program.cs,**/WebApplicationBuilderExtensions.cs,**/GraphQL/Queries/*" \ + /d:sonar.exclusions="**/*.css,**/*.scss,**/Models/*,**/Program.cs,**/WebApplicationBuilderExtensions.cs,**/GraphQL/Queries/*,**/Contentful-Schema/migrations/*.cjs" \ /d:sonar.test.exclusions="Childrens-Social-Care-CPD-Tests/**/*" \ /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ /d:sonar.host.url="https://sonarcloud.io" From e2cf83bb0883d6f0d0286b24ec10465d6c7ca01b Mon Sep 17 00:00:00 2001 From: Maria Date: Mon, 9 Sep 2024 12:04:47 +0100 Subject: [PATCH 12/12] feat: details component --- README.md | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index bef557d6..900de7c5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # childrens-social-care-cpd -This repository contains the code needed to host the Social Workforce career progression service. This service helps workers in this profession to easily find information about the pathways to further their career - +This repository contains the code needed to host the Social Workforce career progression service. This service helps workers in this profession to easily find information about the pathways to further their career. + ## Live examples The live site can be found [here](https://www.develop-child-family-social-work-career.education.gov.uk) @@ -20,25 +20,25 @@ You will need a Contentful CMS instance with the correct Data models. The CMS is The following environment variables are to be configured -| Variable | description | -| --- | --- | -| CPD_GOOGLEANALYTICSTAG | The google analytics API (optional) | -| CPD_CONTENTFUL_ENVIRONMENT | The contentful environment being consumed | -| CPD_SPACE_ID | The contentful space id | -| CPD_DELIVERY_KEY | The live content for the environment set | -| CPD_PREVIEW_KEY | The preview content for the environment set | -| CPD_AZURE_ENVIRONMENT | The environment for the system | -| CPD_INSTRUMENTATION_CONNECTIONSTRING | Application insights connection string | -| CPD_FEATURE_POLLING_INTERVAL | Polling interval for feature configuration udpates | -| CPD_SEARCH_CLIENT_API_KEY | Client API Key for the search service | -| CPD_SEARCH_ENDPOINT | Search service endpoint | -| CPD_SEARCH_INDEX_NAME | The Index name to query against | +| Variable | description | +| ------------------------------------ | -------------------------------------------------- | +| CPD_GOOGLEANALYTICSTAG | The google analytics API (optional) | +| CPD_CONTENTFUL_ENVIRONMENT | The contentful environment being consumed | +| CPD_SPACE_ID | The contentful space id | +| CPD_DELIVERY_KEY | The live content for the environment set | +| CPD_PREVIEW_KEY | The preview content for the environment set | +| CPD_AZURE_ENVIRONMENT | The environment for the system | +| CPD_INSTRUMENTATION_CONNECTIONSTRING | Application insights connection string | +| CPD_FEATURE_POLLING_INTERVAL | Polling interval for feature configuration udpates | +| CPD_SEARCH_CLIENT_API_KEY | Client API Key for the search service | +| CPD_SEARCH_ENDPOINT | Search service endpoint | +| CPD_SEARCH_INDEX_NAME | The Index name to query against | In order to run the application locally, you can either open the solution, build and run in the IDE of your choice or there is a [docker-compose](~/docker-compose.yml) file that allows for local running of the app. In order to run the app with the compose file you will need `docker` and `docker-compose` installed and run the following command in the root directory. -`docker-compose up` +`docker-compose up` ### Running the test suite @@ -53,9 +53,11 @@ followed by Cypress testing is also included. ### Compiling the Sass -The Sass is compiled using the ```compile-sass.ps1``` script in the main project. The commands can also be used in *nix environments. + +The Sass is compiled using the `compile-sass.ps1` script in the main project. The commands can also be used in \*nix environments. ## Releases + Information around the Github Release process can be found in the [release documentation](./docs/RELEASE.md). ## Contentful @@ -63,4 +65,5 @@ Information around the Github Release process can be found in the [release docum More information on Contentful can be found [here](https://www.contentful.com/) --- + Copyright (c) 2023 Crown Copyright (Department for Education)