From 48e4cdaa8819f1495a3701c181f9a00aad6339bb Mon Sep 17 00:00:00 2001 From: Andreas Zerbst <73799582+andr317c@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:13:26 +0200 Subject: [PATCH 1/6] V14 QA new E2E test pipeline (#17064) * Added E2E pipeline * Set up CI with Azure Pipelines [skip ci] * Update nightly-E2E-test-pipelines.yml for Azure Pipelines * Updated solution file * Added fetch depth * Update nightly-E2E-test-pipelines.yml for Azure Pipelines * Added a step for installing wait-on * Added runSqlServerE2ETests * Update nightly-E2E-test-pipelines.yml for Azure Pipelines * Update nightly-E2E-test-pipelines.yml for Azure Pipelines * Updated pipeline so we only run smoke * Update nightly-E2E-test-pipelines.yml for Azure Pipelines * Update nightly-E2E-test-pipelines.yml for Azure Pipelines * Removed pipeline --- build/azure-pipelines.yml | 10 +- build/nightly-E2E-test-pipelines.yml | 395 +++++++++++++++++++++++++++ umbraco.sln | 1 + 3 files changed, 398 insertions(+), 8 deletions(-) create mode 100644 build/nightly-E2E-test-pipelines.yml diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 977ce443d0..dc5ef96bde 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -517,10 +517,7 @@ stages: workingDirectory: tests/Umbraco.Tests.AcceptanceTest # Test - - ${{ if eq(parameters.isNightly, true) }}: - pwsh: npm run test --ignore-certificate-errors - ${{ else }}: - pwsh: npm run smokeTest --ignore-certificate-errors + - pwsh: npm run smokeTest --ignore-certificate-errors displayName: Run Playwright tests continueOnError: true workingDirectory: tests/Umbraco.Tests.AcceptanceTest @@ -660,10 +657,7 @@ stages: workingDirectory: tests/Umbraco.Tests.AcceptanceTest # Test - - ${{ if eq(parameters.isNightly, true) }}: - pwsh: npm run test --ignore-certificate-errors - ${{ else }}: - pwsh: npm run smokeTest --ignore-certificate-errors + - pwsh: npm run smokeTest --ignore-certificate-errors displayName: Run Playwright tests continueOnError: true workingDirectory: tests/Umbraco.Tests.AcceptanceTest diff --git a/build/nightly-E2E-test-pipelines.yml b/build/nightly-E2E-test-pipelines.yml new file mode 100644 index 0000000000..b50b2405d6 --- /dev/null +++ b/build/nightly-E2E-test-pipelines.yml @@ -0,0 +1,395 @@ +name: Nightly_E2E_Test_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) + +pr: none +trigger: none + +schedules: +- cron: '0 0 * * *' + displayName: Daily midnight build + branches: + include: + - v14/dev + ## Uncomment after merged to v15/dev + ## - v15/dev + +variables: + nodeVersion: 20 + solution: umbraco.sln + buildConfiguration: Release + UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042 + DOTNET_NOLOGO: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + npm_config_cache: $(Pipeline.Workspace)/.npm_client + NODE_OPTIONS: --max_old_space_size=16384 + +parameters: + - name: runSqlServerE2ETests + displayName: Run the SQL Server E2E Tests + type: boolean + default: false + +stages: + ############################################### + ## Build + ############################################### + - stage: Build + jobs: + - job: A + displayName: Build Umbraco CMS + pool: + vmImage: 'ubuntu-latest' + steps: + - checkout: self + fetchDepth: 10 + submodules: true + - task: UseDotNet@2 + displayName: Use .NET SDK from global.json + inputs: + useGlobalJson: true + - template: templates/backoffice-install.yml + - script: npm run build:for:cms + displayName: Run build (Bellissima) + workingDirectory: src/Umbraco.Web.UI.Client + - script: npm ci --no-fund --no-audit --prefer-offline + displayName: Run npm ci (Login) + workingDirectory: src/Umbraco.Web.UI.Login + - script: npm run build + displayName: Run npm build (Login) + workingDirectory: src/Umbraco.Web.UI.Login + - task: DotNetCoreCLI@2 + displayName: Run dotnet restore + inputs: + command: restore + projects: $(solution) + - task: DotNetCoreCLI@2 + name: build + displayName: Run dotnet build and generate NuGet packages + inputs: + command: build + projects: $(solution) + arguments: '--configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg' + - task: PublishPipelineArtifact@1 + displayName: Publish nupkg + inputs: + targetPath: $(Build.ArtifactStagingDirectory)/nupkg + artifactName: nupkg + - task: PublishPipelineArtifact@1 + displayName: Publish build artifacts + inputs: + targetPath: $(Build.SourcesDirectory) + artifactName: build_output + + - stage: E2E + displayName: E2E Tests + dependsOn: Build + variables: + npm_config_cache: $(Pipeline.Workspace)/.npm_e2e + # Enable console logging in Release mode + SERILOG__WRITETO__0__NAME: Async + SERILOG__WRITETO__0__ARGS__CONFIGURE__0__NAME: Console + # Set unattended install settings + UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED: true + UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME: Playwright Test + UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD: UmbracoAcceptance123! + UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL: playwright@umbraco.com + # Custom Umbraco settings + UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP: false + UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER: true + UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE: true + UMBRACO__CMS__GLOBAL__ID: 00000000-0000-0000-0000-000000000042 + UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD: 0 + UMBRACO__CMS__GLOBAL__USEHTTPS: true + UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED: false + UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK: true + UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL: https://localhost:44331/ + ASPNETCORE_URLS: https://localhost:44331 + jobs: + # E2E Tests + - job: + displayName: E2E Tests (SQLite) + timeoutInMinutes: 120 + variables: + # Connection string + CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=Umbraco;Mode=Memory;Cache=Shared;Foreign Keys=True;Pooling=True + CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.Sqlite + strategy: + matrix: + Linux: + vmImage: 'ubuntu-latest' + Windows: + vmImage: 'windows-latest' + pool: + vmImage: $(vmImage) + steps: + # Setup test environment + - task: DownloadPipelineArtifact@2 + displayName: Download NuGet artifacts + inputs: + artifact: nupkg + path: $(Agent.BuildDirectory)/app/nupkg + + - task: NodeTool@0 + displayName: Use Node.js $(nodeVersion) + retryCountOnTaskFailure: 3 + inputs: + versionSpec: $(nodeVersion) + + - task: UseDotNet@2 + displayName: Use .NET SDK from global.json + inputs: + useGlobalJson: true + + - pwsh: | + "UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL) + UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD) + URL=$(ASPNETCORE_URLS) + STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env + displayName: Generate .env + workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest + + # Cache and restore NPM packages + - task: Cache@2 + displayName: Cache NPM packages + inputs: + key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json' + restoreKeys: | + npm_e2e | "$(Agent.OS)" + npm_e2e + path: $(npm_config_cache) + + - script: npm ci --no-fund --no-audit --prefer-offline + workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest + displayName: Restore NPM packages + + # Build application + - pwsh: | + $cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g" + dotnet new nugetconfig + dotnet nuget add source ./nupkg --name Local + dotnet new install Umbraco.Templates::$cmsVersion + dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check + dotnet restore UmbracoProject + cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject + dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore + dotnet dev-certs https + displayName: Build application + workingDirectory: $(Agent.BuildDirectory)/app + + # Run application + - bash: | + nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 & + echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!" + displayName: Run application (Linux) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) + workingDirectory: $(Agent.BuildDirectory)/app + + - pwsh: | + $process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log + Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)" + displayName: Run application (Windows) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + workingDirectory: $(Agent.BuildDirectory)/app + + # Ensures we have the package wait-on installed + - pwsh: npm install wait-on + displayName: Install wait-on package + + # Wait for application to start responding to requests + - pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS) + displayName: Wait for application + workingDirectory: tests/Umbraco.Tests.AcceptanceTest + + # Install Playwright and dependencies + - pwsh: npx playwright install --with-deps + displayName: Install Playwright + workingDirectory: tests/Umbraco.Tests.AcceptanceTest + + # Test + - pwsh: npm run test --ignore-certificate-errors + displayName: Run Playwright tests + continueOnError: true + workingDirectory: tests/Umbraco.Tests.AcceptanceTest + env: + CI: true + CommitId: $(Build.SourceVersion) + AgentOs: $(Agent.OS) + + # Stop application + - bash: kill -15 $(AcceptanceTestProcessId) + displayName: Stop application (Linux) + condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux')) + + - pwsh: Stop-Process -Id $(AcceptanceTestProcessId) + displayName: Stop application (Windows) + condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT')) + + # Copy artifacts + - pwsh: | + if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) { + Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse + } + displayName: Copy Playwright results + condition: succeededOrFailed() + + # Publish + - task: PublishPipelineArtifact@1 + displayName: Publish test artifacts + condition: succeededOrFailed() + inputs: + targetPath: $(Build.ArtifactStagingDirectory) + artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)' + + - job: + displayName: E2E Tests (SQL Server) + condition: and(succeeded(), ${{ eq(parameters.runSqlServerE2ETests, true) }}) + timeoutInMinutes: 120 + variables: + # Connection string + CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True + CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME: Microsoft.Data.SqlClient + strategy: + matrix: + Linux: + vmImage: 'ubuntu-latest' + SA_PASSWORD: $(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD) + CONNECTIONSTRINGS__UMBRACODBDSN: 'Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True' + Windows: + vmImage: 'windows-latest' + pool: + vmImage: $(vmImage) + steps: + # Setup test environment + - task: DownloadPipelineArtifact@2 + displayName: Download NuGet artifacts + inputs: + artifact: nupkg + path: $(Agent.BuildDirectory)/app/nupkg + + - task: NodeTool@0 + displayName: Use Node.js $(nodeVersion) + inputs: + versionSpec: $(nodeVersion) + + - task: UseDotNet@2 + displayName: Use .NET SDK from global.json + inputs: + useGlobalJson: true + + - pwsh: | + "UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL) + UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD) + URL=$(ASPNETCORE_URLS)" | Out-File .env + displayName: Generate .env + workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest + + # Cache and restore NPM packages + - task: Cache@2 + displayName: Cache NPM packages + inputs: + key: 'npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json' + restoreKeys: | + npm_e2e | "$(Agent.OS)" + npm_e2e + path: $(npm_config_cache) + + - script: npm ci --no-fund --no-audit --prefer-offline + workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest + displayName: Restore NPM packages + + # Build application + - pwsh: | + $cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g" + dotnet new nugetconfig + dotnet nuget add source ./nupkg --name Local + dotnet new install Umbraco.Templates::$cmsVersion + dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check + dotnet restore UmbracoProject + cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject + dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore + dotnet dev-certs https + displayName: Build application + workingDirectory: $(Agent.BuildDirectory)/app + + # Start SQL Server + - powershell: docker run --name mssql -d -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$(SA_PASSWORD)" mcr.microsoft.com/mssql/server:2022-latest + displayName: Start SQL Server Docker image (Linux) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) + + - pwsh: SqlLocalDB start MSSQLLocalDB + displayName: Start SQL Server LocalDB (Windows) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + + # Run application + - bash: | + nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 & + echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!" + displayName: Run application (Linux) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) + workingDirectory: $(Agent.BuildDirectory)/app + + - pwsh: | + $process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log + Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)" + displayName: Run application (Windows) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + workingDirectory: $(Agent.BuildDirectory)/app + + # Ensures we have the package wait-on installed + - pwsh: npm install wait-on + displayName: Install wait-on package + + # Wait for application to start responding to requests + - pwsh: npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS) + displayName: Wait for application + workingDirectory: tests/Umbraco.Tests.AcceptanceTest + + # Install Playwright and dependencies + - pwsh: npx playwright install --with-deps + displayName: Install Playwright + workingDirectory: tests/Umbraco.Tests.AcceptanceTest + + # Test + - pwsh: npm run test --ignore-certificate-errors + displayName: Run Playwright tests + continueOnError: true + workingDirectory: tests/Umbraco.Tests.AcceptanceTest + env: + CI: true + CommitId: $(Build.SourceVersion) + AgentOs: $(Agent.OS) + + # Stop application + - bash: kill -15 $(AcceptanceTestProcessId) + displayName: Stop application (Linux) + condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux')) + + - pwsh: Stop-Process -Id $(AcceptanceTestProcessId) + displayName: Stop application (Windows) + condition: and(succeeded(), ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT')) + + # Stop SQL Server + - pwsh: docker stop mssql + displayName: Stop SQL Server Docker image (Linux) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) + + - pwsh: SqlLocalDB stop MSSQLLocalDB + displayName: Stop SQL Server LocalDB (Windows) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + + # Copy artifacts + - pwsh: | + if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) { + Copy-Item tests/Umbraco.Tests.AcceptanceTest/results $(Build.ArtifactStagingDirectory) -Recurse + } + displayName: Copy Playwright results + condition: succeededOrFailed() + + # Publish + - task: PublishPipelineArtifact@1 + displayName: Publish test artifacts + condition: succeededOrFailed() + inputs: + targetPath: $(Build.ArtifactStagingDirectory) + artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)' \ No newline at end of file diff --git a/umbraco.sln b/umbraco.sln index 5e26e18d8c..87d95422f8 100644 --- a/umbraco.sln +++ b/umbraco.sln @@ -141,6 +141,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{20CE9C97 build\azure-pipelines.yml = build\azure-pipelines.yml build\nightly-build-trigger.yml = build\nightly-build-trigger.yml build\templates\backoffice-install.yml = build\templates\backoffice-install.yml + build\nightly-E2E-test-pipelines.yml = build\nightly-E2E-test-pipelines.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "csharp-docs", "csharp-docs", "{F2BF84D9-0A14-40AF-A0F3-B9BBBBC16A44}" From 017209c5baa104b40baf865387bc6a5cca42430d Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 16 Sep 2024 12:15:36 +0200 Subject: [PATCH 2/6] Updated nuget packages (#17062) --- Directory.Packages.props | 6 +++--- tests/Directory.Packages.props | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 23acaa35f2..47df4cf510 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -47,7 +47,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -90,4 +90,4 @@ - + \ No newline at end of file diff --git a/tests/Directory.Packages.props b/tests/Directory.Packages.props index f5eef701cb..34370c21df 100644 --- a/tests/Directory.Packages.props +++ b/tests/Directory.Packages.props @@ -17,9 +17,9 @@ - + - + \ No newline at end of file From d12dedb5262ff9b4d7a09bb20700ef133b5c14fa Mon Sep 17 00:00:00 2001 From: Andreas Zerbst <73799582+andr317c@users.noreply.github.com> Date: Tue, 17 Sep 2024 05:16:29 +0200 Subject: [PATCH 3/6] V14 QA update fetch depth (#17068) * Removed fetch depth * Added fetch depth 0 --- build/nightly-E2E-test-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/nightly-E2E-test-pipelines.yml b/build/nightly-E2E-test-pipelines.yml index b50b2405d6..b1dfe9261c 100644 --- a/build/nightly-E2E-test-pipelines.yml +++ b/build/nightly-E2E-test-pipelines.yml @@ -9,7 +9,7 @@ schedules: branches: include: - v14/dev - ## Uncomment after merged to v15/dev + ## Uncomment after merged to v15/dev ## - v15/dev variables: @@ -42,7 +42,7 @@ stages: vmImage: 'ubuntu-latest' steps: - checkout: self - fetchDepth: 10 + fetchDepth: 0 submodules: true - task: UseDotNet@2 displayName: Use .NET SDK from global.json @@ -335,7 +335,7 @@ stages: displayName: Run application (Windows) condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) workingDirectory: $(Agent.BuildDirectory)/app - + # Ensures we have the package wait-on installed - pwsh: npm install wait-on displayName: Install wait-on package @@ -392,4 +392,4 @@ stages: condition: succeededOrFailed() inputs: targetPath: $(Build.ArtifactStagingDirectory) - artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)' \ No newline at end of file + artifact: 'Acceptance Tests - $(Agent.JobName) - Attempt #$(System.JobAttempt)' From e6f379034fb856c45ef701a18a3fe74dccb875b4 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 17 Sep 2024 10:58:47 +0200 Subject: [PATCH 4/6] Add notification alias to document notifications endpoint output (#17028) --- .../DocumentNotificationPresentationFactory.cs | 15 ++++++++------- src/Umbraco.Cms.Api.Management/OpenApi.json | 4 ++++ .../DocumentNotificationsResponseModel.cs | 2 ++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentNotificationPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentNotificationPresentationFactory.cs index 549163df91..7daf762b78 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DocumentNotificationPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentNotificationPresentationFactory.cs @@ -27,13 +27,14 @@ internal sealed class DocumentNotificationPresentationFactory : IDocumentNotific .ToArray() ?? Array.Empty(); - var availableActionIds = _actionCollection.Where(a => a.ShowInNotifier).Select(a => a.Letter.ToString()).ToArray(); - - return await Task.FromResult( - availableActionIds.Select(actionId => new DocumentNotificationResponseModel + return await Task.FromResult(_actionCollection + .Where(action => action.ShowInNotifier) + .Select(action => new DocumentNotificationResponseModel { - ActionId = actionId, - Subscribed = subscribedActionIds.Contains(actionId) - }).ToArray()); + ActionId = action.Letter, + Alias = action.Alias, + Subscribed = subscribedActionIds.Contains(action.Letter) + }) + .ToArray()); } } diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index e5e2f04d42..d1b5eea473 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -36279,6 +36279,7 @@ "DocumentNotificationResponseModel": { "required": [ "actionId", + "alias", "subscribed" ], "type": "object", @@ -36286,6 +36287,9 @@ "actionId": { "type": "string" }, + "alias": { + "type": "string" + }, "subscribed": { "type": "boolean" } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentNotificationsResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentNotificationsResponseModel.cs index b3ae3b8f6e..cf7665a643 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentNotificationsResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentNotificationsResponseModel.cs @@ -4,5 +4,7 @@ public class DocumentNotificationResponseModel { public required string ActionId { get; set; } + public required string Alias { get; set; } + public required bool Subscribed { get; set; } } From 8ebc44f95968676fb06452adabc6554d4a89a495 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:01:30 +0200 Subject: [PATCH 5/6] update OpenApi.json --- src/Umbraco.Cms.Api.Management/OpenApi.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index d1b5eea473..6482df8801 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -9875,6 +9875,14 @@ "format": "int32", "default": 100 } + }, + { + "name": "parentId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } } ], "responses": { @@ -15545,6 +15553,14 @@ "format": "int32", "default": 100 } + }, + { + "name": "parentId", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } } ], "responses": { @@ -37946,7 +37962,9 @@ }, "providerProperties": { "type": "object", - "additionalProperties": { }, + "additionalProperties": { + "nullable": true + }, "nullable": true } }, From 625366f82bcf1c15eb39aa19f5ab4bb6f9413777 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:46:51 +0200 Subject: [PATCH 6/6] update backoffice submodule --- src/Umbraco.Web.UI.Client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client b/src/Umbraco.Web.UI.Client index 8725950d3e..c1c99408ad 160000 --- a/src/Umbraco.Web.UI.Client +++ b/src/Umbraco.Web.UI.Client @@ -1 +1 @@ -Subproject commit 8725950d3e78d4bade333085110f606b73c4a966 +Subproject commit c1c99408ad5910e559f4f12318cfd34cb8a8ea76