diff --git a/backend/src/Designer/Controllers/AppDevelopmentController.cs b/backend/src/Designer/Controllers/AppDevelopmentController.cs index ae927c4eb05..745fd9a2b4e 100644 --- a/backend/src/Designer/Controllers/AppDevelopmentController.cs +++ b/backend/src/Designer/Controllers/AppDevelopmentController.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text.Json.Nodes; using System.Threading; using System.Threading.Tasks; @@ -123,8 +124,17 @@ public async Task SaveFormLayout(string org, string app, [FromQuer if (formLayoutPayload.ComponentIdsChange is not null && !string.IsNullOrEmpty(layoutSetName)) { - foreach (var componentIdChange in formLayoutPayload.ComponentIdsChange) + foreach (var componentIdChange in formLayoutPayload.ComponentIdsChange.Where((componentIdChange) => componentIdChange.OldComponentId != componentIdChange.NewComponentId)) { + if (componentIdChange.NewComponentId == null) + { + await _mediator.Publish(new ComponentDeletedEvent + { + ComponentId = componentIdChange.OldComponentId, + LayoutSetName = layoutSetName, + EditingContext = editingContext + }, cancellationToken); + } await _mediator.Publish(new ComponentIdChangedEvent { OldComponentId = componentIdChange.OldComponentId, @@ -159,16 +169,26 @@ await _mediator.Publish(new LayoutPageAddedEvent /// Application identifier which is unique within an organisation. /// The name of the layout set the specific layout belongs to /// The form layout to be deleted + /// A that observes if operation is cancelled. /// A success message if the save was successful [HttpDelete] [Route("form-layout/{layoutName}")] - public ActionResult DeleteFormLayout(string org, string app, [FromQuery] string layoutSetName, [FromRoute] string layoutName) + public async Task DeleteFormLayout(string org, string app, [FromQuery] string layoutSetName, [FromRoute] string layoutName, CancellationToken cancellationToken) { try { string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, app, developer); + + await _mediator.Publish(new LayoutPageDeletedEvent + { + EditingContext = editingContext, + LayoutSetName = layoutSetName, + LayoutName = layoutName, + }, cancellationToken); + _appDevelopmentService.DeleteFormLayout(editingContext, layoutSetName, layoutName); + return Ok(); } catch (FileNotFoundException exception) @@ -402,13 +422,15 @@ public async Task DeleteLayoutSet(string org, string app, [FromRou { string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, app, developer); - LayoutSets layoutSets = await _appDevelopmentService.DeleteLayoutSet(editingContext, layoutSetIdToUpdate, cancellationToken); await _mediator.Publish(new LayoutSetDeletedEvent { EditingContext = editingContext, - LayoutSetId = layoutSetIdToUpdate + LayoutSetName = layoutSetIdToUpdate }, cancellationToken); + + LayoutSets layoutSets = await _appDevelopmentService.DeleteLayoutSet(editingContext, layoutSetIdToUpdate, cancellationToken); + return Ok(layoutSets); } diff --git a/backend/src/Designer/EventHandlers/ComponentDeleted/ComponentDeletedLayoutsHandler.cs b/backend/src/Designer/EventHandlers/ComponentDeleted/ComponentDeletedLayoutsHandler.cs new file mode 100644 index 00000000000..93865d5c5b6 --- /dev/null +++ b/backend/src/Designer/EventHandlers/ComponentDeleted/ComponentDeletedLayoutsHandler.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Altinn.Studio.Designer.Events; +using Altinn.Studio.Designer.Hubs.SyncHub; +using Altinn.Studio.Designer.Models; +using Altinn.Studio.Designer.Services.Interfaces; +using MediatR; + +namespace Altinn.Studio.Designer.EventHandlers.ComponentDeleted; + +public class ComponentDeletedLayoutsHandler(IFileSyncHandlerExecutor fileSyncHandlerExecutor, IAppDevelopmentService appDevelopmentService) : INotificationHandler +{ + public async Task Handle(ComponentDeletedEvent notification, CancellationToken cancellationToken) + { + await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( + notification.EditingContext, + SyncErrorCodes.ComponentDeletedLayoutsSyncError, + "layouts", + async () => + { + List referencesToDelete = [new Reference("component", notification.LayoutSetName, notification.ComponentId)]; + return await appDevelopmentService.UpdateLayoutReferences(notification.EditingContext, referencesToDelete, cancellationToken); + }); + } +} diff --git a/backend/src/Designer/EventHandlers/ComponentIdChanged/ComponentIdChangedLayoutsHandler.cs b/backend/src/Designer/EventHandlers/ComponentIdChanged/ComponentIdChangedLayoutsHandler.cs index df9923093fa..ecbfcc46d1e 100644 --- a/backend/src/Designer/EventHandlers/ComponentIdChanged/ComponentIdChangedLayoutsHandler.cs +++ b/backend/src/Designer/EventHandlers/ComponentIdChanged/ComponentIdChangedLayoutsHandler.cs @@ -15,7 +15,8 @@ public class ComponentIdChangedLayoutsHandler : INotificationHandler +{ + public async Task Handle(LayoutPageDeletedEvent notification, CancellationToken cancellationToken) + { + await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( + notification.EditingContext, + SyncErrorCodes.LayoutPageDeletedLayoutsSyncError, + "layouts", + async () => + { + List referencesToDelete = [new Reference("page", notification.LayoutSetName, notification.LayoutName)]; + return await appDevelopmentService.UpdateLayoutReferences(notification.EditingContext, referencesToDelete, cancellationToken); + }); + } +} diff --git a/backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedComponentRefHandler.cs b/backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedComponentRefHandler.cs deleted file mode 100644 index 95b38685a47..00000000000 --- a/backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedComponentRefHandler.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Collections.Generic; -using System.Text.Json.Nodes; -using System.Threading; -using System.Threading.Tasks; -using Altinn.App.Core.Helpers; -using Altinn.Studio.Designer.Events; -using Altinn.Studio.Designer.Hubs.SyncHub; -using Altinn.Studio.Designer.Infrastructure.GitRepository; -using Altinn.Studio.Designer.Services.Interfaces; -using MediatR; - -namespace Altinn.Studio.Designer.EventHandlers.LayoutSetDeleted; - -public class LayoutSetDeletedComponentRefHandler(IAltinnGitRepositoryFactory altinnGitRepositoryFactory, IFileSyncHandlerExecutor fileSyncHandlerExecutor) : INotificationHandler -{ - public async Task Handle(LayoutSetDeletedEvent notification, CancellationToken cancellationToken) - { - AltinnAppGitRepository altinnAppGitRepository = altinnGitRepositoryFactory.GetAltinnAppGitRepository( - notification.EditingContext.Org, - notification.EditingContext.Repo, - notification.EditingContext.Developer); - - string[] layoutSetNames = altinnAppGitRepository.GetLayoutSetNames(); - - await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( - notification.EditingContext, - SyncErrorCodes.LayoutSetSubLayoutSyncError, - "layouts", - async () => - { - bool hasChanges = false; - foreach (string layoutSetName in layoutSetNames) - { - Dictionary formLayouts = await altinnAppGitRepository.GetFormLayouts(layoutSetName, cancellationToken); - foreach (var formLayout in formLayouts) - { - hasChanges |= await RemoveComponentsReferencingLayoutSet( - notification, - altinnAppGitRepository, - layoutSetName, - formLayout, - cancellationToken); - } - } - return hasChanges; - }); - } - - private static async Task RemoveComponentsReferencingLayoutSet(LayoutSetDeletedEvent notification, AltinnAppGitRepository altinnAppGitRepository, string layoutSetName, KeyValuePair formLayout, CancellationToken cancellationToken) - { - if (formLayout.Value["data"] is not JsonObject data || data["layout"] is not JsonArray layoutArray) - { - return false; - } - - bool hasChanges = false; - layoutArray.RemoveAll(jsonNode => - { - if (jsonNode["layoutSet"]?.GetValue() == notification.LayoutSetId) - { - hasChanges = true; - return true; - } - return false; - }); - - if (hasChanges) - { - await altinnAppGitRepository.SaveLayout(layoutSetName, $"{formLayout.Key}.json", formLayout.Value, cancellationToken); - } - return hasChanges; - } -} diff --git a/backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedLayoutsHandler.cs b/backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedLayoutsHandler.cs new file mode 100644 index 00000000000..8d97d60f53c --- /dev/null +++ b/backend/src/Designer/EventHandlers/LayoutSetDeleted/LayoutSetDeletedLayoutsHandler.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Altinn.Studio.Designer.Events; +using Altinn.Studio.Designer.Hubs.SyncHub; +using Altinn.Studio.Designer.Models; +using Altinn.Studio.Designer.Services.Interfaces; +using MediatR; + +namespace Altinn.Studio.Designer.EventHandlers.LayoutSetDeleted; + +public class LayoutSetDeletedLayoutsHandler(IFileSyncHandlerExecutor fileSyncHandlerExecutor, IAppDevelopmentService appDevelopmentService) : INotificationHandler +{ + public async Task Handle(LayoutSetDeletedEvent notification, CancellationToken cancellationToken) + { + await fileSyncHandlerExecutor.ExecuteWithExceptionHandlingAndConditionalNotification( + notification.EditingContext, + SyncErrorCodes.LayoutSetDeletedLayoutsSyncError, + "layouts", + async () => + { + List referencesToDelete = [new Reference("layoutSet", notification.LayoutSetName, notification.LayoutSetName)]; + return await appDevelopmentService.UpdateLayoutReferences(notification.EditingContext, referencesToDelete, cancellationToken); + }); + } +} diff --git a/backend/src/Designer/Events/ComponentDeletedEvent.cs b/backend/src/Designer/Events/ComponentDeletedEvent.cs new file mode 100644 index 00000000000..a6897eee55d --- /dev/null +++ b/backend/src/Designer/Events/ComponentDeletedEvent.cs @@ -0,0 +1,11 @@ +using Altinn.Studio.Designer.Models; +using MediatR; + +namespace Altinn.Studio.Designer.Events; + +public class ComponentDeletedEvent : INotification +{ + public AltinnRepoEditingContext EditingContext { get; set; } + public string LayoutSetName { get; set; } + public string ComponentId { get; set; } +} diff --git a/backend/src/Designer/Events/LayoutPageDeletedEvent.cs b/backend/src/Designer/Events/LayoutPageDeletedEvent.cs new file mode 100644 index 00000000000..8411d583169 --- /dev/null +++ b/backend/src/Designer/Events/LayoutPageDeletedEvent.cs @@ -0,0 +1,11 @@ +using Altinn.Studio.Designer.Models; +using MediatR; + +namespace Altinn.Studio.Designer.Events; + +public class LayoutPageDeletedEvent : INotification +{ + public AltinnRepoEditingContext EditingContext { get; set; } + public string LayoutSetName { get; set; } + public string LayoutName { get; set; } +} diff --git a/backend/src/Designer/Events/LayoutSetDeletedEvent.cs b/backend/src/Designer/Events/LayoutSetDeletedEvent.cs index aadbd44a4c0..00bf4a926cf 100644 --- a/backend/src/Designer/Events/LayoutSetDeletedEvent.cs +++ b/backend/src/Designer/Events/LayoutSetDeletedEvent.cs @@ -5,6 +5,6 @@ namespace Altinn.Studio.Designer.Events; public class LayoutSetDeletedEvent : INotification { - public string LayoutSetId { get; set; } public AltinnRepoEditingContext EditingContext { get; set; } + public string LayoutSetName { get; set; } } diff --git a/backend/src/Designer/Hubs/SyncHub/SyncErrorCodes.cs b/backend/src/Designer/Hubs/SyncHub/SyncErrorCodes.cs index 23556793c7b..04178d4eb7e 100644 --- a/backend/src/Designer/Hubs/SyncHub/SyncErrorCodes.cs +++ b/backend/src/Designer/Hubs/SyncHub/SyncErrorCodes.cs @@ -9,8 +9,10 @@ public static class SyncErrorCodes public const string ApplicationMetadataDataTypeSyncError = nameof(ApplicationMetadataDataTypeSyncError); public const string LayoutSetsDataTypeSyncError = nameof(LayoutSetsDataTypeSyncError); public const string LayoutSetComponentIdSyncError = nameof(LayoutSetComponentIdSyncError); - public const string LayoutSetSubLayoutSyncError = nameof(LayoutSetSubLayoutSyncError); + public const string LayoutSetDeletedLayoutsSyncError = nameof(LayoutSetDeletedLayoutsSyncError); public const string LayoutSetSubFormButtonSyncError = nameof(LayoutSetSubFormButtonSyncError); public const string SettingsComponentIdSyncError = nameof(SettingsComponentIdSyncError); public const string LayoutPageAddSyncError = nameof(LayoutPageAddSyncError); + public const string ComponentDeletedLayoutsSyncError = nameof(ComponentDeletedLayoutsSyncError); + public const string LayoutPageDeletedLayoutsSyncError = nameof(LayoutPageDeletedLayoutsSyncError); } diff --git a/backend/src/Designer/Models/Reference.cs b/backend/src/Designer/Models/Reference.cs new file mode 100644 index 00000000000..ba16ffddb91 --- /dev/null +++ b/backend/src/Designer/Models/Reference.cs @@ -0,0 +1,3 @@ +namespace Altinn.Studio.Designer.Models; + +public record Reference(string Type, string LayoutSetName, string Id, string NewId = null); diff --git a/backend/src/Designer/Services/Implementation/AppDevelopmentService.cs b/backend/src/Designer/Services/Implementation/AppDevelopmentService.cs index cc04b5523ec..6b7cb76324e 100644 --- a/backend/src/Designer/Services/Implementation/AppDevelopmentService.cs +++ b/backend/src/Designer/Services/Implementation/AppDevelopmentService.cs @@ -593,5 +593,158 @@ public async Task AddComponentToLayout( layoutArray.Add(component); await SaveFormLayout(editingContext, layoutSetName, layoutName, formLayout, cancellationToken); } + + public async Task UpdateLayoutReferences(AltinnRepoEditingContext editingContext, List referencesToUpdate, CancellationToken cancellationToken) + { + AltinnAppGitRepository altinnAppGitRepository = _altinnGitRepositoryFactory.GetAltinnAppGitRepository( + editingContext.Org, + editingContext.Repo, + editingContext.Developer); + + LayoutSets layoutSets = await altinnAppGitRepository.GetLayoutSetsFile(cancellationToken); + + return await UpdateLayoutReferences(altinnAppGitRepository, layoutSets.Sets, referencesToUpdate, cancellationToken); + } + + private async Task UpdateLayoutReferences(AltinnAppGitRepository altinnAppGitRepository, List layoutSets, List referencesToUpdate, CancellationToken cancellationToken) + { + List referencesToDelete = []; + bool hasChanges = false; + + var deletedReferences = referencesToUpdate.Where(item => string.IsNullOrEmpty(item.NewId)).ToList(); + + var deletedLayoutsSetIds = deletedReferences.Where(item => item.Type == "layoutSet").Select(item => item.Id).ToList(); + var deletedLayouts = deletedReferences.Where(item => item.Type == "page").ToList(); + var deletedComponents = deletedReferences.Where(item => item.Type == "component").ToList(); + + foreach (LayoutSetConfig layoutSet in layoutSets ?? [new() { Id = null }]) + { + bool isLayoutSetDeleted = deletedLayoutsSetIds.Contains(layoutSet.Id); + + Dictionary layouts = await altinnAppGitRepository.GetFormLayouts(layoutSet.Id, cancellationToken); + + var deletedLayoutIdsFromCurrentLayoutSet = deletedLayouts.Where(item => item.LayoutSetName == layoutSet.Id && string.IsNullOrEmpty(item.NewId)).Select(item => item.Id).ToList(); + foreach (KeyValuePair layout in layouts) + { + bool isLayoutDeleted = deletedLayoutIdsFromCurrentLayoutSet.Contains(layout.Key); + bool hasLayoutChanges = false; + + // TODO : https://github.com/Altinn/altinn-studio/issues/14073 + if (layout.Value["data"] is not JsonObject data) + { + continue; + } + + var deletedComponentIdsFromCurrentLayoutSet = deletedComponents.Where(item => item.LayoutSetName == layoutSet.Id && string.IsNullOrEmpty(item.NewId)).Select(item => item.Id).ToList(); + + if (data["layout"] is JsonArray componentList) + { + for (int i = componentList.Count - 1; i >= 0; i--) + { + JsonNode componentNode = componentList[i]; + if (componentNode is not JsonObject component) + { + continue; + } + + string componentId = component["id"]?.GetValue(); + bool isComponentDeleted = deletedComponentIdsFromCurrentLayoutSet.Contains(componentId); + + if (isComponentDeleted) + { + componentList.RemoveAt(i); + hasLayoutChanges = true; + } + + if (isLayoutSetDeleted || isLayoutDeleted || isComponentDeleted) + { + if (!isComponentDeleted) + { + referencesToDelete.Add(new Reference("component", layoutSet.Id, componentId)); + } + + continue; + } + + string componentType = component["type"]?.GetValue(); + switch (componentType) + { + case "Subform": + string subformLayoutSet = component["layoutSet"]?.GetValue(); + if (deletedLayoutsSetIds.Contains(subformLayoutSet)) + { + referencesToDelete.Add(new Reference("component", layoutSet.Id, componentId)); + componentList.RemoveAt(i); + hasLayoutChanges = true; + } + break; + case "Summary2": + if (component["target"] is JsonObject target) + { + string type = target["type"]?.GetValue(); + string id = target["id"]?.GetValue(); + string taskId = target["taskId"]?.GetValue(); + string layoutSetId = string.IsNullOrEmpty(taskId) ? layoutSet.Id : layoutSets?.FirstOrDefault(item => item.Tasks?.Contains(taskId) ?? false)?.Id; + + if ( + (type == "page" && deletedLayouts.Exists(item => item.LayoutSetName == layoutSetId && item.Id == id)) + || (type == "component" && deletedComponents.Exists(item => item.LayoutSetName == layoutSetId && item.Id == id)) + || deletedLayoutsSetIds.Contains(layoutSetId) + ) + { + referencesToDelete.Add(new Reference("component", layoutSet.Id, componentId)); + componentList.RemoveAt(i); + hasLayoutChanges = true; + } + + if (component["overrides"] is JsonArray overrideList) + { + for (int j = overrideList.Count - 1; j >= 0; j--) + { + JsonNode overrideItem = overrideList[j]; + string overrideComponentId = overrideItem["componentId"]?.GetValue(); + if (deletedComponents.Exists(item => item.LayoutSetName == layoutSetId && item.Id == overrideComponentId)) + { + overrideList.RemoveAt(j); + hasLayoutChanges = true; + } + + if (overrideList.Count == 0) + { + component.Remove("overrides"); + } + } + } + } + break; + } + } + } + + if (isLayoutSetDeleted || isLayoutDeleted) + { + if (!isLayoutDeleted) + { + referencesToDelete.Add(new Reference("page", layoutSet.Id, layout.Key)); + } + + continue; + } + + if (hasLayoutChanges) + { + await altinnAppGitRepository.SaveLayout(layoutSet.Id, $"{layout.Key}.json", layout.Value, cancellationToken); + hasChanges = true; + } + } + } + + if (referencesToDelete.Count > 0) + { + hasChanges |= await UpdateLayoutReferences(altinnAppGitRepository, layoutSets, referencesToDelete, cancellationToken); + } + + return hasChanges; + } } } diff --git a/backend/src/Designer/Services/Interfaces/IAppDevelopmentService.cs b/backend/src/Designer/Services/Interfaces/IAppDevelopmentService.cs index e175fba77d0..11e656b1ec0 100644 --- a/backend/src/Designer/Services/Interfaces/IAppDevelopmentService.cs +++ b/backend/src/Designer/Services/Interfaces/IAppDevelopmentService.cs @@ -213,5 +213,13 @@ public Task GetModelMetadata( /// The component to add. /// An that observes if operation is cancelled. public Task AddComponentToLayout(AltinnRepoEditingContext altinnRepoEditingContext, string layoutSetName, string layoutName, object component, CancellationToken cancellationToken = default); + + /// + /// Update layout references + /// + /// An . + /// The references to update. + /// An that observes if operation is cancelled. + public Task UpdateLayoutReferences(AltinnRepoEditingContext altinnRepoEditingContext, List referencesToUpdate, CancellationToken cancellationToken); } } diff --git a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteFormLayoutTests.cs b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteFormLayoutTests.cs index 07ad105e57f..691575e6269 100644 --- a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteFormLayoutTests.cs +++ b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteFormLayoutTests.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -7,6 +8,7 @@ using FluentAssertions; using JetBrains.Annotations; using Microsoft.AspNetCore.Mvc.Testing; +using SharedResources.Tests; using Xunit; namespace Designer.Tests.Controllers.AppDevelopmentController @@ -55,5 +57,36 @@ public async Task DeleteFormLayout_NonExistingFile_Should_AndReturnNotFound(stri using var response = await HttpClient.SendAsync(httpRequestMessage); response.StatusCode.Should().Be(HttpStatusCode.NotFound); } + + [Theory] + [InlineData("ttd", "testUser", "layout", "Side2")] + public async Task DeleteFormLayout_DeletesAssociatedSummary2Components_ReturnsOk(string org, string developer, string layoutSetName, string layoutName) + { + string actualApp = "app-with-summary2-components"; + string app = TestDataHelper.GenerateTestRepoName(); + await CopyRepositoryForTest(org, actualApp, developer, app); + + string url = $"{VersionPrefix(org, app)}/form-layout/{layoutName}?layoutSetName={layoutSetName}"; + using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Delete, url); + + using var response = await HttpClient.SendAsync(httpRequestMessage); + response.StatusCode.Should().Be(HttpStatusCode.OK); + + string expectedApp = "app-with-summary2-components-after-deleting-references"; + + string[] layoutPaths = [ + "layout/layouts/Side1.json", + "layout/layouts/Side2.json", + "layout2/layouts/Side1.json", + "layout2/layouts/Side2.json", + ]; + + layoutPaths.ToList().ForEach(file => + { + string actual = TestDataHelper.GetFileFromRepo(org, app, developer, $"App/ui/{file}"); + string expected = TestDataHelper.GetFileFromRepo(org, expectedApp, developer, $"App/ui/{file}"); + JsonUtils.DeepEquals(actual, expected).Should().BeTrue(); + }); + } } } diff --git a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteLayoutSetTests.cs b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteLayoutSetTests.cs index 8acf823a8a2..4178a0b31fc 100644 --- a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteLayoutSetTests.cs +++ b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/DeleteLayoutSetTests.cs @@ -160,6 +160,37 @@ public async Task DeleteLayoutSet_RemovesComponentsReferencingLayoutSet(string o $"No components should reference the deleted layout set {deletedComponentId}"); } + [Theory] + [InlineData("ttd", "testUser", "layoutSet")] + public async Task DeleteLayoutSet_DeletesAssociatedSummary2Components_ReturnsOk(string org, string developer, string layoutSetName) + { + string actualApp = "app-with-summary2-components"; + string app = TestDataHelper.GenerateTestRepoName(); + await CopyRepositoryForTest(org, actualApp, developer, app); + + string url = $"{VersionPrefix(org, app)}/layout-set/{layoutSetName}"; + using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Delete, url); + + using var response = await HttpClient.SendAsync(httpRequestMessage); + response.StatusCode.Should().Be(HttpStatusCode.OK, await response.Content.ReadAsStringAsync()); + + string expectedApp = "app-with-summary2-components-after-deleting-references"; + + string[] layoutPaths = [ + "layoutSet/layouts/Side1.json", + "layoutSet/layouts/Side2.json", + "layoutSet2/layouts/Side1.json", + "layoutSet2/layouts/Side2.json" + ]; + + layoutPaths.ToList().ForEach(file => + { + string actual = TestDataHelper.GetFileFromRepo(org, app, developer, $"App/ui/{file}"); + string expected = TestDataHelper.GetFileFromRepo(org, expectedApp, developer, $"App/ui/{file}"); + JsonUtils.DeepEquals(actual, expected).Should().BeTrue(); + }); + } + private async Task GetLayoutSetsFile(string org, string app, string developer) { AltinnGitRepositoryFactory altinnGitRepositoryFactory = diff --git a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/SaveFormLayoutTests.cs b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/SaveFormLayoutTests.cs index 496f39223fb..9244a74ddd9 100644 --- a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/SaveFormLayoutTests.cs +++ b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/SaveFormLayoutTests.cs @@ -1,4 +1,6 @@ -using System.Net; +using System; +using System.Linq; +using System.Net; using System.Net.Http; using System.Net.Mime; using System.Text; @@ -93,6 +95,50 @@ public async Task SaveFormLayoutWithComponentIdsChange_ReturnsOk(string org, str JsonUtils.DeepEquals(layout, savedLayout).Should().BeTrue(); } + [Theory] + [InlineData("ttd", "testUser", "component", "Side2", "Input-Om7N3y")] + public async Task SaveFormLayoutWithDeletedComponent_DeletesAssociatedSummary2Components_ReturnsOk(string org, string developer, string layoutSetName, string layoutName, string componentId) + { + string actualApp = "app-with-summary2-components"; + string app = TestDataHelper.GenerateTestRepoName(); + await CopyRepositoryForTest(org, actualApp, developer, app); + + string layout = TestDataHelper.GetFileFromRepo(org, app, developer, $"App/ui/{layoutSetName}/layouts/{layoutName}.json"); + JsonNode layoutWithDeletedComponent = JsonNode.Parse(layout); + JsonArray layoutArray = layoutWithDeletedComponent["data"]["layout"] as JsonArray; + layoutArray?.RemoveAt(0); + + string url = $"{VersionPrefix(org, app)}/form-layout/{layoutName}?layoutSetName={layoutSetName}"; + var payload = new JsonObject + { + ["componentIdsChange"] = new JsonArray() { + new JsonObject + { + ["oldComponentId"] = componentId, + } + }, + ["layout"] = layoutWithDeletedComponent + }; + HttpResponseMessage response = await SendHttpRequest(url, payload); + response.StatusCode.Should().Be(HttpStatusCode.OK); + + string expectedApp = "app-with-summary2-components-after-deleting-references"; + + string[] layoutPaths = [ + "component/layouts/Side1.json", + "component/layouts/Side2.json", + "component2/layouts/Side1.json", + "component2/layouts/Side2.json" + ]; + + layoutPaths.ToList().ForEach(file => + { + string actual = TestDataHelper.GetFileFromRepo(org, app, developer, $"App/ui/{file}"); + string expected = TestDataHelper.GetFileFromRepo(org, expectedApp, developer, $"App/ui/{file}"); + JsonUtils.DeepEquals(actual, expected).Should().BeTrue(); + }); + } + [Theory] [InlineData("ttd", "app-with-layoutsets", "testUser", "testLayout", "layoutSet1", "TestData/App/ui/layoutWithUnknownProperties.json")] public async Task SaveFormLayoutWithNewPageLanguageUpdate_ReturnsOk(string org, string app, string developer, string layoutName, string layoutSetName, string layoutPath) diff --git a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/UpdateFormLayoutNameTests.cs b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/UpdateFormLayoutNameTests.cs index a14d0f12964..4f5ebe84218 100644 --- a/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/UpdateFormLayoutNameTests.cs +++ b/backend/tests/Designer.Tests/Controllers/AppDevelopmentController/UpdateFormLayoutNameTests.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Linq; using System.Net; using System.Net.Http; using System.Net.Mime; @@ -8,6 +9,7 @@ using Designer.Tests.Utils; using FluentAssertions; using Microsoft.AspNetCore.Mvc.Testing; +using SharedResources.Tests; using Xunit; namespace Designer.Tests.Controllers.AppDevelopmentController diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/layouts/Side1.json new file mode 100644 index 00000000000..880092a7380 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/layouts/Side1.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "" + }, + "id": "Summary2-9iG1lB", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "" + }, + "id": "Summary2-R8HsuB", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-mL8NjJ", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-qWr0oa", + "taskId": "" + }, + "id": "Summary2-0BV88Q", + "type": "Summary2" + }, + { + "id": "NavigationButtons-DfcNol", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/layouts/Side2.json new file mode 100644 index 00000000000..1fc7b9c90e0 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component/layouts/Side2.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-qWr0oa", + "type": "Input" + }, + { + "id": "NavigationButtons-GAW8Dx", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/layouts/Side1.json new file mode 100644 index 00000000000..8489464261c --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/layouts/Side1.json @@ -0,0 +1,56 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-LCr3oK", + "type": "Input" + }, + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "" + }, + "id": "Summary2-eoT5QK", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "" + }, + "id": "Summary2-NJfE92", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-BGHvph", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-LCr3oK", + "taskId": "" + }, + "id": "Summary2-rb2ml2", + "type": "Summary2" + }, + { + "id": "NavigationButtons-t7UTGJ", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/layouts/Side2.json new file mode 100644 index 00000000000..5ebc0f7df8b --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/component2/layouts/Side2.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "component" + }, + "id": "Summary2-2FSqcf", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "component" + }, + "id": "Summary2-eGrDpP", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "component" + }, + "id": "Summary2-uJDgMu", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-qWr0oa", + "taskId": "component" + }, + "id": "Summary2-2JiT3P", + "type": "Summary2" + }, + { + "id": "NavigationButtons-BYcvaT", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout-sets.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout-sets.json new file mode 100644 index 00000000000..f916f692bec --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout-sets.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout-sets.schema.v1.json", + "sets": [ + { + "id": "component", + "tasks": [ + "component" + ] + }, + { + "id": "layout", + "tasks": [ + "layout" + ] + }, + { + "id": "component2", + "tasks": [ + "component2" + ] + }, + { + "id": "layout2", + "tasks": [ + "layout2" + ] + }, + { + "id": "layoutSet2", + "tasks": [ + "layoutSet2" + ] + } + ], + "uiSettings": {} +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout/Settings.json new file mode 100644 index 00000000000..b40e33a3211 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout/Settings.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout/layouts/Side1.json new file mode 100644 index 00000000000..2f467af518a --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout/layouts/Side1.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "" + }, + "id": "Summary2-FEI1HC", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "" + }, + "id": "Summary2-e2yYpk", + "type": "Summary2" + }, + { + "id": "NavigationButtons-7g3XcW", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/layouts/Side1.json new file mode 100644 index 00000000000..2530921cc4e --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/layouts/Side1.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-QCSonu", + "type": "Input" + }, + { + "target": { + "type": "layoutSet", + "id": "" + }, + "id": "Summary2-18hFaH", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1" + }, + "id": "Summary2-iZJ80j", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-V55C6Q", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-QCSonu" + }, + "id": "Summary2-aI91Tv", + "type": "Summary2" + }, + { + "id": "NavigationButtons-2hGPi1", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/layouts/Side2.json new file mode 100644 index 00000000000..edd72d878e9 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layout2/layouts/Side2.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "layout" + }, + "id": "Summary2-MfRiX8", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "layout" + }, + "id": "Summary2-66YavC", + "type": "Summary2" + }, + { + "id": "NavigationButtons-h0g3Wt", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/layouts/Side1.json new file mode 100644 index 00000000000..60fc1029c15 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/layouts/Side1.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-wrspcN", + "type": "Input" + }, + { + "target": { + "type": "layoutSet", + "id": "" + }, + "id": "Summary2-00SFBO", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1" + }, + "id": "Summary2-4069IB", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-Orxmu1", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-wrspcN", + "taskId": "" + }, + "id": "Summary2-2YoJGY", + "type": "Summary2" + }, + { + "id": "NavigationButtons-KnXA9y", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/layouts/Side2.json new file mode 100644 index 00000000000..ba9b66dff54 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components-after-deleting-references/App/ui/layoutSet2/layouts/Side2.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "id": "NavigationButtons-5ukC2N", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/layouts/Side1.json new file mode 100644 index 00000000000..112caa4c318 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/layouts/Side1.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "" + }, + "id": "Summary2-9iG1lB", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "" + }, + "id": "Summary2-R8HsuB", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-mL8NjJ", + "type": "Summary2", + "overrides": [ + { + "componentId": "Input-Om7N3y", + "displayType": "string" + } + ] + }, + { + "target": { + "type": "component", + "id": "Input-qWr0oa", + "taskId": "" + }, + "id": "Summary2-0BV88Q", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-Om7N3y", + "taskId": "" + }, + "id": "Summary2-dTepe0", + "type": "Summary2" + }, + { + "id": "NavigationButtons-DfcNol", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/layouts/Side2.json new file mode 100644 index 00000000000..3989fafc6be --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component/layouts/Side2.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-Om7N3y", + "type": "Input" + }, + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-qWr0oa", + "type": "Input" + }, + { + "id": "NavigationButtons-GAW8Dx", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/layouts/Side1.json new file mode 100644 index 00000000000..8489464261c --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/layouts/Side1.json @@ -0,0 +1,56 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-LCr3oK", + "type": "Input" + }, + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "" + }, + "id": "Summary2-eoT5QK", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "" + }, + "id": "Summary2-NJfE92", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-BGHvph", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-LCr3oK", + "taskId": "" + }, + "id": "Summary2-rb2ml2", + "type": "Summary2" + }, + { + "id": "NavigationButtons-t7UTGJ", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/layouts/Side2.json new file mode 100644 index 00000000000..b754c0caf49 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/component2/layouts/Side2.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "component" + }, + "id": "Summary2-2FSqcf", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "component" + }, + "id": "Summary2-eGrDpP", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "component" + }, + "id": "Summary2-uJDgMu", + "type": "Summary2", + "overrides": [ + { + "componentId": "Input-Om7N3y", + "displayType": "string" + } + ] + }, + { + "target": { + "type": "component", + "id": "Input-qWr0oa", + "taskId": "component" + }, + "id": "Summary2-2JiT3P", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-Om7N3y", + "taskId": "component" + }, + "id": "Summary2-vIXkWO", + "type": "Summary2" + }, + { + "id": "NavigationButtons-BYcvaT", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout-sets.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout-sets.json new file mode 100644 index 00000000000..536ae9da2c2 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout-sets.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout-sets.schema.v1.json", + "sets": [ + { + "id": "component", + "tasks": [ + "component" + ] + }, + { + "id": "layout", + "tasks": [ + "layout" + ] + }, + { + "id": "layoutSet", + "tasks": [ + "layoutSet" + ] + }, + { + "id": "component2", + "tasks": [ + "component2" + ] + }, + { + "id": "layout2", + "tasks": [ + "layout2" + ] + }, + { + "id": "layoutSet2", + "tasks": [ + "layoutSet2" + ] + } + ], + "uiSettings": {} +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/layouts/Side1.json new file mode 100644 index 00000000000..a7e9078479d --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/layouts/Side1.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "" + }, + "id": "Summary2-FEI1HC", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "" + }, + "id": "Summary2-e2yYpk", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-qOn2O1", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-AVRSNf", + "taskId": "" + }, + "id": "Summary2-da0Tq6", + "type": "Summary2" + }, + { + "id": "NavigationButtons-7g3XcW", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/layouts/Side2.json new file mode 100644 index 00000000000..8b8ea337e26 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout/layouts/Side2.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-AVRSNf", + "type": "Input" + }, + { + "id": "NavigationButtons-wDmNQu", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/layouts/Side1.json new file mode 100644 index 00000000000..2530921cc4e --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/layouts/Side1.json @@ -0,0 +1,53 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-QCSonu", + "type": "Input" + }, + { + "target": { + "type": "layoutSet", + "id": "" + }, + "id": "Summary2-18hFaH", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1" + }, + "id": "Summary2-iZJ80j", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-V55C6Q", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-QCSonu" + }, + "id": "Summary2-aI91Tv", + "type": "Summary2" + }, + { + "id": "NavigationButtons-2hGPi1", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/layouts/Side2.json new file mode 100644 index 00000000000..6f3ad889e8f --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layout2/layouts/Side2.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "layout" + }, + "id": "Summary2-MfRiX8", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "layout" + }, + "id": "Summary2-66YavC", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "layout" + }, + "id": "Summary2-bmqvUb", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-AVRSNf", + "taskId": "layout" + }, + "id": "Summary2-uuKXTD", + "type": "Summary2" + }, + { + "id": "NavigationButtons-h0g3Wt", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/layouts/Side1.json new file mode 100644 index 00000000000..48f8a1f9cf7 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/layouts/Side1.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "id": "NavigationButtons-n2jUp6", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/layouts/Side2.json new file mode 100644 index 00000000000..6fa6e9455ff --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet/layouts/Side2.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-hqcYqo", + "type": "Input" + }, + { + "id": "NavigationButtons-QzkEka", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/Settings.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/Settings.json new file mode 100644 index 00000000000..6bb44cf6db8 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/Settings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://altinncdn.no/schemas/json/layout/layoutSettings.schema.v1.json", + "pages": { + "order": [ + "Side1", + "Side2" + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/layouts/Side1.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/layouts/Side1.json new file mode 100644 index 00000000000..60fc1029c15 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/layouts/Side1.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "dataModelBindings": { + "simpleBinding": "" + }, + "id": "Input-wrspcN", + "type": "Input" + }, + { + "target": { + "type": "layoutSet", + "id": "" + }, + "id": "Summary2-00SFBO", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1" + }, + "id": "Summary2-4069IB", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "" + }, + "id": "Summary2-Orxmu1", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-wrspcN", + "taskId": "" + }, + "id": "Summary2-2YoJGY", + "type": "Summary2" + }, + { + "id": "NavigationButtons-KnXA9y", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/layouts/Side2.json b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/layouts/Side2.json new file mode 100644 index 00000000000..c49447d2904 --- /dev/null +++ b/backend/tests/Designer.Tests/_TestData/Repositories/testUser/ttd/app-with-summary2-components/App/ui/layoutSet2/layouts/Side2.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://altinncdn.no/toolkits/altinn-app-frontend/4/schemas/json/layout/layout.schema.v1.json", + "data": { + "layout": [ + { + "target": { + "type": "layoutSet", + "id": "", + "taskId": "layoutSet" + }, + "id": "Summary2-6VQ3LC", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side1", + "taskId": "layoutSet" + }, + "id": "Summary2-LZxPWb", + "type": "Summary2" + }, + { + "target": { + "type": "page", + "id": "Side2", + "taskId": "layoutSet" + }, + "id": "Summary2-El9z2Y", + "type": "Summary2" + }, + { + "target": { + "type": "component", + "id": "Input-hqcYqo", + "taskId": "layoutSet" + }, + "id": "Summary2-SMqpYV", + "type": "Summary2" + }, + { + "id": "NavigationButtons-5ukC2N", + "showBackButton": true, + "textResourceBindings": {}, + "type": "NavigationButtons" + } + ] + } +} \ No newline at end of file diff --git a/frontend/language/src/nb.json b/frontend/language/src/nb.json index 73a04014688..4efb041e37c 100644 --- a/frontend/language/src/nb.json +++ b/frontend/language/src/nb.json @@ -1177,7 +1177,7 @@ "ux_editor.component_category.select": "Flervalg", "ux_editor.component_category.text": "Tekst", "ux_editor.component_deletion_confirm": "Ja, slett komponenten", - "ux_editor.component_deletion_text": "Er du sikker på at du vil slette denne komponenten?", + "ux_editor.component_deletion_text": "Er du sikker på at du vil slette denne komponenten?\nAlle Summary2-komponenter knyttet til denne komponenten vil også bli slettet.", "ux_editor.component_dropdown_set_preselected": "Sett forhåndsvalgt verdi for nedtrekksliste", "ux_editor.component_group_deletion_text": "Er du sikker på at du vil slette denne gruppen?\nAlle komponenter i denne gruppen blir også slettet", "ux_editor.component_help_text.Accordion": "Med Trekkspilliste kan du presentere mye innhold på liten plass, i en eller flere rader. Brukerne kan klikke på hele raden for å vise eller skjule innholdet under.", @@ -1775,7 +1775,7 @@ "ux_editor.page_config_pdf_delete_existing_pdf": "Slett eksisterende PDF", "ux_editor.page_config_pdf_exclude_components_from_default_pdf": "Velg hvilke komponenter fra siden som skal skjules i standard PDF", "ux_editor.page_config_pdf_exclude_page_from_default_pdf": "Ekskluder siden fra standard PDF", - "ux_editor.page_delete_text": "Er du sikker på at du vil slette denne siden?\nAlt innholdet på siden vil bli fjernet.", + "ux_editor.page_delete_text": "Er du sikker på at du vil slette denne siden?\nAlt innholdet på siden vil bli fjernet.\nAlle Summary2-komponenter knyttet til denne siden vil også bli slettet.", "ux_editor.page_menu_down": "Flytt ned", "ux_editor.page_menu_edit": "Gi nytt navn", "ux_editor.page_menu_up": "Flytt opp", diff --git a/frontend/packages/process-editor/src/bpmnProviders/SupportedContextPadProvider.js b/frontend/packages/process-editor/src/bpmnProviders/SupportedContextPadProvider.js index 0971159f330..b124370dec0 100644 --- a/frontend/packages/process-editor/src/bpmnProviders/SupportedContextPadProvider.js +++ b/frontend/packages/process-editor/src/bpmnProviders/SupportedContextPadProvider.js @@ -16,7 +16,7 @@ class SupportedContextPadProvider { } const isConfirmed = confirm( - 'Prosess-steget du vil slette kan være knyttet til en sidegruppe. Den kan inneholde visningsoppsett eller skjema du har satt opp. Hvis du sletter steget, sletter du også hele sidegruppen og alt som hører til.', + 'Prosess-steget du vil slette kan være knyttet til en sidegruppe. Den kan inneholde visningsoppsett eller skjema du har satt opp. Hvis du sletter steget, sletter du også hele sidegruppen og alt som hører til.\nAlle Summary2-komponenter knyttet til dette prosess-steget vil også bli slettet.', ); if (isConfirmed) {