diff --git a/backend/src/Designer/Controllers/PreviewController.cs b/backend/src/Designer/Controllers/PreviewController.cs index eba1205149b..2f0d7d1de00 100644 --- a/backend/src/Designer/Controllers/PreviewController.cs +++ b/backend/src/Designer/Controllers/PreviewController.cs @@ -849,7 +849,7 @@ public IActionResult UpdateAttachmentWithTag(string org, string app, [FromQuery] private string GetSelectedLayoutSetInEditorFromRefererHeader(string refererHeader) { Uri refererUri = new(refererHeader); - string layoutSetName = HttpUtility.ParseQueryString(refererUri.Query)["selectedLayoutSetInEditor"]; + string layoutSetName = HttpUtility.ParseQueryString(refererUri.Query)["selectedLayoutSet"]; return string.IsNullOrEmpty(layoutSetName) ? null : layoutSetName; } diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/DeleteAttachmentTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/DeleteAttachmentTests.cs index 0ee46612cab..c18b2e418e7 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/DeleteAttachmentTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/DeleteAttachmentTests.cs @@ -19,7 +19,7 @@ public async Task Delete_Attachment_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/data/{AttachmentGuId}"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Delete, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -30,7 +30,7 @@ public async Task Delete_AttachmentForStateFulApp_Ok() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/data/{AttachmentGuId}"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Delete, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/GetFormDataTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/GetFormDataTests.cs index ab77e8cb537..05ce8da85bc 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/GetFormDataTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/GetFormDataTests.cs @@ -24,7 +24,7 @@ public async Task Get_FormData_Ok() string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/data/test-datatask-id"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -38,7 +38,7 @@ public async Task Get_FormDataForAppWithoutDatamodel_Ok() { string dataPathWithData = $"{Org}/empty-app/instances/{PartyId}/{InstanceGuId}/data/test-datatask-id"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -54,7 +54,7 @@ public async Task Get_FormDataForStatefulApp_Ok() string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/data/test-datatask-id"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -68,7 +68,7 @@ public async Task Get_FormDataForStatefulAppForTaskWithoutDatamodel_Ok() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/data/test-datatask-id"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName2}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName2}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/InstanceForNextTaskTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/InstanceForNextTaskTests.cs index 9f74248d81d..64101fb7118 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/InstanceForNextTaskTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/InstanceForNextTaskTests.cs @@ -22,7 +22,7 @@ public async Task Get_InstanceForNextProcess_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -39,7 +39,7 @@ public async Task Get_InstanceForNextTaskForStatefulApp_Ok_TaskIsIncreased() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/InstancesTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/InstancesTests.cs index 5e144a0be4d..b34f76acb73 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/InstancesTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/InstancesTests.cs @@ -26,7 +26,7 @@ public async Task Post_Instance_Ok() string dataPathWithData = $"{Org}/{targetRepository}/instances?instanceOwnerPartyId=51001"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -46,7 +46,7 @@ public async Task Post_InstanceForStatefulApp_Ok() string dataPathWithData = $"{Org}/{targetRepository}/instances?instanceOwnerPartyId=51001"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/PostAttachmentTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/PostAttachmentTests.cs index cb4d8d55def..ac4290b66a1 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/PostAttachmentTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/PostAttachmentTests.cs @@ -20,7 +20,7 @@ public async Task Post_Attachment_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/data?dataType=FileUploadId"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.Created, response.StatusCode); @@ -31,7 +31,7 @@ public async Task Post_AttachmentForStateFulApp_Ok() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/data?dataType=FileUploadId"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Post, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(StatusCodes.Status201Created, (int)response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessNextTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessNextTests.cs index bbbe4f4fee5..4186499d052 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessNextTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessNextTests.cs @@ -22,7 +22,7 @@ public async Task Get_ProcessNext_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/process/next"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -39,7 +39,7 @@ public async Task Get_ProcessNextForStatefulApp_Ok() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/process/next"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessTests.cs index 90d7c272297..2244275d508 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/ProcessTests.cs @@ -22,7 +22,7 @@ public async Task Get_Process_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/process"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -39,7 +39,7 @@ public async Task Get_ProcessForStatefulApp_Ok() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/process"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateFormDataTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateFormDataTests.cs index 485e674d1c1..561d878d350 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateFormDataTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateFormDataTests.cs @@ -19,7 +19,7 @@ public async Task Put_UpdateFormData_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/data/test-datatask-id"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Put, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(StatusCodes.Status200OK, (int)response.StatusCode); diff --git a/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateProcessNextTests.cs b/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateProcessNextTests.cs index df9441628bc..11a306bc156 100644 --- a/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateProcessNextTests.cs +++ b/backend/tests/Designer.Tests/Controllers/PreviewController/UpdateProcessNextTests.cs @@ -22,7 +22,7 @@ public async Task Put_ProcessNext_Ok() { string dataPathWithData = $"{Org}/{App}/instances/{PartyId}/{InstanceGuId}/process/next"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Put, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSetInEditor="); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={App}&selectedLayoutSet="); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); @@ -36,7 +36,7 @@ public async Task Put_ProcessNextForStatefulAppForNonExistingTask_Ok() { string dataPathWithData = $"{Org}/{StatefulApp}/instances/{PartyId}/{InstanceGuId}/process/next"; using HttpRequestMessage httpRequestMessage = new(HttpMethod.Put, dataPathWithData); - httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSetInEditor={LayoutSetName}"); + httpRequestMessage.Headers.Referrer = new Uri($"{MockedReferrerUrl}?org={Org}&app={StatefulApp}&selectedLayoutSet={LayoutSetName}"); using HttpResponseMessage response = await HttpClient.SendAsync(httpRequestMessage); Assert.Equal(HttpStatusCode.OK, response.StatusCode); diff --git a/frontend/app-preview/src/views/LandingPage.tsx b/frontend/app-preview/src/views/LandingPage.tsx index dd5d08647cd..4c0100deb1e 100644 --- a/frontend/app-preview/src/views/LandingPage.tsx +++ b/frontend/app-preview/src/views/LandingPage.tsx @@ -35,9 +35,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => { const [openSaveChoiceInSession, setOpenShowSaveChoiceInSession] = useState(false); const showPreviewLimitationsInfoSession: boolean = typedSessionStorage.getItem('showPreviewLimitationsInfo'); const [showPreviewLimitationsInfo, setShowPreviewLimitationsInfo] = useState(showPreviewLimitationsInfoSession ?? true); - const [selectedLayoutSetInEditor, setSelectedLayoutSetInEditor] = useLocalStorage( - 'layoutSet/' + app, - ); + const [selectedLayoutSet, setSelectedLayoutSet] = useLocalStorage('layoutSet/' + app, null); const [previewViewSize, setPreviewViewSize] = useLocalStorage( 'viewSize', 'desktop', @@ -49,7 +47,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => { input !== null && input.tagName === 'IFRAME'; const handleChangeLayoutSet = (layoutSet: string) => { - setSelectedLayoutSetInEditor(layoutSet); + setSelectedLayoutSet(layoutSet); // might need to remove selected layout from local storage to make sure first page is selected window.location.reload(); }; @@ -94,7 +92,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => { } @@ -121,7 +119,7 @@ export const LandingPage = ({ variant = 'preview' }: LandingPageProps) => {