diff --git a/.github/workflows/docker-dev-integration-tests.yml b/.github/workflows/docker-dev-integration-tests.yml index 5593ec67..418cba56 100644 --- a/.github/workflows/docker-dev-integration-tests.yml +++ b/.github/workflows/docker-dev-integration-tests.yml @@ -12,15 +12,35 @@ jobs: CPD_DELIVERY_KEY: ${{secrets.TF_VAR_CPD_DELIVERY_KEY}} CPD_CLARITY: ${{secrets.TF_VAR_CPD_CLARITY}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build the Docker App Image run: cd Childrens-Social-Care-CPD; docker build . --file Dockerfile --tag childrens-social-care-cpd:latest + - name: Install Docker Compose + uses: ndeloof/install-compose-action@v0.0.1 + with: + version: latest + legacy: true # install in PATH as `docker-compose` + + - name: Verify Docker Compose installation + run: docker-compose --version + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 'latest' + + - name: Install latest NPM version + run: npm install -g npm@latest + + - name: Verify NPM version + run: npm version + - name: Run the dev integration tests run: cd browser-tests/dev-integration-tests; docker-compose up --exit-code-from dev-integration-tests - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 name: Playwright report if: always() with: diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index af1390ad..85308f82 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -14,13 +14,13 @@ jobs: fetch-depth: 0 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 distribution: "zulu" # Alternative distribution options are available. - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-sonar @@ -28,7 +28,7 @@ jobs: - name: Cache SonarCloud scanner id: cache-sonar-scanner - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-sonar @@ -36,7 +36,7 @@ jobs: - name: Cache SonarCloud coverage id: cache-sonar-coverage - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~\sonar\cache key: ${{ runner.os }}-coverage diff --git a/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs b/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs index 97e24c8e..a5b285d1 100644 --- a/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs +++ b/Childrens-Social-Care-CPD-Tests/Contentful/EntityResolverTests.cs @@ -36,6 +36,7 @@ public class EntityResolverTests [TestCase("pageContents", typeof(PageContents))] [TestCase("pageContentsItem", typeof(PageContentsItem))] [TestCase("pdfFileResource", typeof(PdfFileResource))] + [TestCase("quoteBox", typeof(QuoteBox))] [TestCase("richTextBlock", typeof(RichTextBlock))] [TestCase("roleList", typeof(RoleList))] [TestCase("navigationMenu", typeof(NavigationMenu))] diff --git a/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs b/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs index b04dd707..af54213e 100644 --- a/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs +++ b/Childrens-Social-Care-CPD-Tests/Contentful/PartialsFactoryTests.cs @@ -36,6 +36,7 @@ public partial class PartialsFactoryTests new object[] { new PageContents(), "_PageContents" }, new object[] { new PageContentsItem(), "_PageContentsItem" }, new object[] { new PdfFileResource(), "_PdfFileResource" }, + new object[] { new QuoteBox(), "_QuoteBox" }, new object[] { new RichTextBlock(), "_RichTextBlock" }, new object[] { new RoleList(), "_RoleList" }, new object[] { new TextBlock(), "_TextBlock" }, diff --git a/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs b/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs index 4b7fc89d..ac39b3ac 100644 --- a/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs +++ b/Childrens-Social-Care-CPD/Contentful/EntityResolver.cs @@ -39,6 +39,7 @@ public Type Resolve(string contentTypeId) "pageContents" => typeof(PageContents), "pageContentsItem" => typeof(PageContentsItem), "pdfFileResource" => typeof(PdfFileResource), + "quoteBox" => typeof(QuoteBox), "richTextBlock" => typeof(RichTextBlock), "roleList" => typeof(RoleList), "navigationMenu" => typeof(NavigationMenu), diff --git a/Childrens-Social-Care-CPD/Contentful/Models/InfoBox.cs b/Childrens-Social-Care-CPD/Contentful/Models/InfoBox.cs index 510d07af..c04ea9c0 100644 --- a/Childrens-Social-Care-CPD/Contentful/Models/InfoBox.cs +++ b/Childrens-Social-Care-CPD/Contentful/Models/InfoBox.cs @@ -2,10 +2,18 @@ namespace Childrens_Social_Care_CPD.Contentful.Models; +public static class InfoBoxType +{ + public const string BlueI = "Blue \"i\" icon"; + public const string GreenI = "Green \"i\" icon"; + public const string GreenBrain = "Green \"brain\" icon"; +} + public class InfoBox : IContent { public string Title { get; set; } public bool DisplayTitle { get; set; } public int TitleLevel { get; set; } public Document Document { get; set; } + public string Type { get; set; } } diff --git a/Childrens-Social-Care-CPD/Contentful/Models/QuoteBox.cs b/Childrens-Social-Care-CPD/Contentful/Models/QuoteBox.cs new file mode 100644 index 00000000..e36d67a1 --- /dev/null +++ b/Childrens-Social-Care-CPD/Contentful/Models/QuoteBox.cs @@ -0,0 +1,18 @@ +using Contentful.Core.Models; + +namespace Childrens_Social_Care_CPD.Contentful.Models; + +public static class QuoteAttributionAlignment +{ + public const string Left = "Left"; + public const string Centre = "Centre"; + public const string Right = "Right"; +} + +public class QuoteBox : IContent +{ + public string Name { get; set; } + public Document QuoteText { get; set; } + public Document Attribution { get ; set; } + public string AttributionAlignment { get; set; } +} diff --git a/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs b/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs index 9c5631b1..df4f4963 100644 --- a/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs +++ b/Childrens-Social-Care-CPD/Contentful/PartialsFactory.cs @@ -38,6 +38,7 @@ public static string GetPartialFor(IContent item) PageContents => "_PageContents", PageContentsItem => "_PageContentsItem", PdfFileResource => "_PdfFileResource", + QuoteBox => "_QuoteBox", RichTextBlock => "_RichTextBlock", RoleList => "_RoleList", NavigationMenu => "_NavigationMenu", diff --git a/Childrens-Social-Care-CPD/Views/Shared/_Header.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_Header.cshtml index e93d1f44..277d53fa 100644 --- a/Childrens-Social-Care-CPD/Views/Shared/_Header.cshtml +++ b/Childrens-Social-Care-CPD/Views/Shared/_Header.cshtml @@ -25,12 +25,9 @@