From 4e170a24ece32b337713f712c45b533234d400da Mon Sep 17 00:00:00 2001 From: andreastanderen Date: Thu, 5 Sep 2024 16:08:33 +0200 Subject: [PATCH] Change recommendedNextAction in process to update layoutsetname and add section to change in panel --- frontend/language/src/nb.json | 6 +- .../ConfigContent/ConfigContent.tsx | 22 ++++--- .../EditDataTypes/EditDataTypes.module.css | 0 .../EditDataTypes/EditDataTypes.test.tsx | 8 +-- .../EditDataTypes/EditDataTypes.tsx | 2 +- .../SelectDataTypes.module.css | 0 .../SelectDataTypes/SelectDataTypes.test.tsx | 10 ++-- .../SelectDataTypes/SelectDataTypes.tsx | 2 +- .../EditDataTypes/SelectDataTypes/index.ts | 0 .../EditDataTypes/index.ts | 0 .../EditDataTypesToSign.module.css | 0 .../EditDataTypesToSign.test.tsx | 15 +++-- .../EditDataTypesToSign.tsx | 2 +- .../SelectDataTypesToSign.module.css | 0 .../SelectDataTypesToSign.test.tsx | 21 ++++--- .../SelectDataTypesToSign.tsx | 8 +-- .../SelectDataTypesToSign/index.ts | 0 .../EditDataTypesToSign/index.ts | 0 .../EditLayoutSetName/EditLayoutSetName.tsx | 57 +++++++++++++++++++ .../ConfigContent/EditLayoutSetName/index.ts | 1 + .../RecommendedActionChangeName.test.tsx | 0 .../RecommendedActionChangeName.tsx | 26 +++++---- ...UniqueFromSignaturesInDataTypes.module.css | 0 ...itUniqueFromSignaturesInDataTypes.test.tsx | 12 ++-- .../EditUniqueFromSignaturesInDataTypes.tsx | 4 +- ...UniqueFromSignaturesInDataTypes.module.css | 0 ...ctUniqueFromSignaturesInDataTypes.test.tsx | 21 ++++--- .../SelectUniqueFromSignaturesInDataTypes.tsx | 4 +- .../index.ts | 0 .../UniqueFromSignaturesInDataTypesUtils.ts | 2 +- .../index.ts | 0 .../CreateCustomReceiptForm.test.tsx | 8 +-- .../CustomReceipt/CustomReceipt.tsx | 2 +- 33 files changed, 155 insertions(+), 78 deletions(-) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/EditDataTypes.module.css (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/EditDataTypes.test.tsx (96%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/EditDataTypes.tsx (96%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/SelectDataTypes/SelectDataTypes.module.css (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx (94%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx (97%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/SelectDataTypes/index.ts (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypes/index.ts (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/EditDataTypesToSign.module.css (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/EditDataTypesToSign.test.tsx (92%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/EditDataTypesToSign.tsx (92%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.module.css (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx (88%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx (87%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/SelectDataTypesToSign/index.ts (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditDataTypesToSign/index.ts (100%) create mode 100644 frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/EditLayoutSetName.tsx create mode 100644 frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/index.ts rename frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/{EditTaskRecommendedActions => EditLayoutSetNameRecommendedAction}/RecommendedActionChangeName.test.tsx (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/{EditTaskRecommendedActions => EditLayoutSetNameRecommendedAction}/RecommendedActionChangeName.tsx (70%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.module.css (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx (93%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx (94%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.module.css (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx (86%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx (95%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/index.ts (100%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts (96%) rename frontend/packages/process-editor/src/components/ConfigPanel/{ => ConfigContent}/EditUniqueFromSignaturesInDataTypes/index.ts (100%) diff --git a/frontend/language/src/nb.json b/frontend/language/src/nb.json index f5be433c826..86a78664cc1 100644 --- a/frontend/language/src/nb.json +++ b/frontend/language/src/nb.json @@ -625,13 +625,13 @@ "process_editor.configuration_panel_custom_receipt_delete_receipt": "Er du sikker på at du vil slette kvitteringen din?", "process_editor.configuration_panel_custom_receipt_heading": "Opprett din egen kvittering", "process_editor.configuration_panel_custom_receipt_info": "Hvis du heller vil lage din egen kvittering, kan du opprette den her. Kvitteringen du lager selv vil overstyre standardkvitteringen.", - "process_editor.configuration_panel_custom_receipt_layout_set_name": "Navn på sidegruppe: ", + "process_editor.configuration_panel_custom_receipt_layout_set_name": "Navn på kvittering: ", "process_editor.configuration_panel_custom_receipt_layout_set_name_validation": "Navnet må ha minst 2 tegn", "process_editor.configuration_panel_custom_receipt_navigate_to_lage_button": "Gå til Lage", "process_editor.configuration_panel_custom_receipt_navigate_to_lage_title": "Gå til Lage for å utforme kvitteringen din", "process_editor.configuration_panel_custom_receipt_select_data_model_label": "Datamodellknytning", "process_editor.configuration_panel_custom_receipt_spinner_title": "Laster inn kvittering", - "process_editor.configuration_panel_custom_receipt_textfield_label": "Navn på sidegruppe", + "process_editor.configuration_panel_custom_receipt_textfield_label": "Navn på kvittering", "process_editor.configuration_panel_data_model_selection_description": "Velg en datamodell å knytte til prosessteget", "process_editor.configuration_panel_data_task": "Oppgave: Utfylling", "process_editor.configuration_panel_data_types_to_sign_required": "Du må velge minst en datatype", @@ -646,6 +646,8 @@ "process_editor.configuration_panel_header_help_text_signing": "Du bruker oppgaven Signering (signing) når du vil at sluttbrukerne skal bekrefte med signatur.", "process_editor.configuration_panel_header_help_text_title": "Informasjon om valgt oppgave", "process_editor.configuration_panel_id_label": "ID:", + "process_editor.configuration_panel_layout_set_name": "Navn på sidegruppe: ", + "process_editor.configuration_panel_layout_set_name_label": "Navn på sidegruppe", "process_editor.configuration_panel_layout_set_id_not_unique": "Navnet på sidegruppen må være unikt", "process_editor.configuration_panel_missing_task": "Oppgave", "process_editor.configuration_panel_name_label": "Navn: ", diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/ConfigContent.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/ConfigContent.tsx index 4afb48d93d8..9ee1a6c0ba1 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/ConfigContent.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/ConfigContent.tsx @@ -4,16 +4,17 @@ import { useTranslation } from 'react-i18next'; import { useBpmnContext } from '../../../contexts/BpmnContext'; import { EditTaskId } from './EditTaskId/EditTaskId'; import { StudioDisplayTile, useStudioRecommendedNextActionContext } from '@studio/components'; -import { EditDataTypes } from '../EditDataTypes'; +import { EditDataTypes } from './EditDataTypes'; import { useBpmnApiContext } from '../../../contexts/BpmnApiContext'; import { Accordion } from '@digdir/designsystemet-react'; import { EditActions } from './EditActions'; import { EditPolicy } from './EditPolicy'; -import { EditDataTypesToSign } from '../EditDataTypesToSign'; -import { EditUniqueFromSignaturesInDataTypes } from '../EditUniqueFromSignaturesInDataTypes'; +import { EditDataTypesToSign } from './EditDataTypesToSign'; +import { EditUniqueFromSignaturesInDataTypes } from './EditUniqueFromSignaturesInDataTypes'; import { StudioModeler } from '../../../utils/bpmnModeler/StudioModeler'; -import { RecommendedActionChangeName } from './EditTaskRecommendedActions/RecommendedActionChangeName'; +import { RecommendedActionChangeName } from './EditLayoutSetNameRecommendedAction/RecommendedActionChangeName'; import { ConfigContentContainer } from './ConfigContentContainer'; +import { EditLayoutSetName } from '@altinn/process-editor/components/ConfigPanel/ConfigContent/EditLayoutSetName'; export const ConfigContent = (): React.ReactElement => { const { t } = useTranslation(); @@ -53,11 +54,14 @@ export const ConfigContent = (): React.ReactElement => { showPadlock={false} /> {taskHasConnectedLayoutSet && ( - + <> + + + )} {isSigningTask && ( <> diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.module.css b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.module.css similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.module.css rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.module.css diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.test.tsx similarity index 96% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.test.tsx index 5f1fee66eea..57c834d10f5 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.test.tsx @@ -2,14 +2,14 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { textMock } from '@studio/testing/mocks/i18nMock'; import userEvent from '@testing-library/user-event'; -import { type BpmnApiContextProps, BpmnApiContext } from '../../../contexts/BpmnApiContext'; -import { BpmnContext } from '../../../contexts/BpmnContext'; +import { type BpmnApiContextProps, BpmnApiContext } from '../../../../contexts/BpmnApiContext'; +import { BpmnContext } from '../../../../contexts/BpmnContext'; import { EditDataTypes, type EditDataTypesProps } from './EditDataTypes'; -import { BpmnConfigPanelFormContextProvider } from '../../../contexts/BpmnConfigPanelContext'; +import { BpmnConfigPanelFormContextProvider } from '../../../../contexts/BpmnConfigPanelContext'; import { mockBpmnApiContextValue, mockBpmnContextValue, -} from '../../../../test/mocks/bpmnContextMock'; +} from '../../../../../test/mocks/bpmnContextMock'; import type { LayoutSets } from 'app-shared/types/api/LayoutSetsResponse'; const mockTaskId: string = 'testId'; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.tsx similarity index 96% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.tsx index 6d4e8b1f954..4a93d1a569b 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/EditDataTypes.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/EditDataTypes.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'; import { LinkIcon } from '@studio/icons'; import { SelectDataTypes } from './SelectDataTypes'; import classes from './EditDataTypes.module.css'; -import { useBpmnContext } from '../../../contexts/BpmnContext'; +import { useBpmnContext } from '../../../../contexts/BpmnContext'; export type EditDataTypesProps = { dataModelIds: string[]; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.module.css b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.module.css similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.module.css rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.module.css diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx similarity index 94% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx index c2b7c5d03dc..6b7e693ed55 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.test.tsx @@ -2,16 +2,16 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { textMock } from '@studio/testing/mocks/i18nMock'; import userEvent from '@testing-library/user-event'; -import type { BpmnApiContextProps } from '../../../../contexts/BpmnApiContext'; -import { BpmnApiContext } from '../../../../contexts/BpmnApiContext'; -import { BpmnContext } from '../../../../contexts/BpmnContext'; +import type { BpmnApiContextProps } from '../../../../../contexts/BpmnApiContext'; +import { BpmnApiContext } from '../../../../../contexts/BpmnApiContext'; +import { BpmnContext } from '../../../../../contexts/BpmnContext'; import type { SelectDataTypesProps } from './SelectDataTypes'; import { SelectDataTypes } from './SelectDataTypes'; -import { BpmnConfigPanelFormContextProvider } from '../../../../contexts/BpmnConfigPanelContext'; +import { BpmnConfigPanelFormContextProvider } from '../../../../../contexts/BpmnConfigPanelContext'; import { mockBpmnApiContextValue, mockBpmnContextValue, -} from '../../../../../test/mocks/bpmnContextMock'; +} from '../../../../../../test/mocks/bpmnContextMock'; const connectedTaskId = mockBpmnApiContextValue.layoutSets.sets[0].tasks[0]; const mockOnClose = jest.fn(); diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx similarity index 97% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx index 1ed203cc544..fafa80cb87d 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/SelectDataTypes.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Combobox } from '@digdir/designsystemet-react'; import { StudioButton, StudioDeleteButton } from '@studio/components'; -import { useBpmnApiContext } from '../../../../contexts/BpmnApiContext'; +import { useBpmnApiContext } from '../../../../../contexts/BpmnApiContext'; import { useTranslation } from 'react-i18next'; import { XMarkIcon } from '@studio/icons'; import classes from './SelectDataTypes.module.css'; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/index.ts similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/SelectDataTypes/index.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/SelectDataTypes/index.ts diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/index.ts similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypes/index.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypes/index.ts diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.module.css b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.module.css similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.module.css rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.module.css diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.test.tsx similarity index 92% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.test.tsx index 4ebbc20141b..60f6efc33f3 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.test.tsx @@ -2,16 +2,19 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { textMock } from '@studio/testing/mocks/i18nMock'; import userEvent from '@testing-library/user-event'; -import { type BpmnApiContextProps, BpmnApiContext } from '../../../contexts/BpmnApiContext'; -import type { BpmnContextProps } from '../../../contexts/BpmnContext'; -import { BpmnContext } from '../../../contexts/BpmnContext'; +import { type BpmnApiContextProps, BpmnApiContext } from '../../../../contexts/BpmnApiContext'; +import type { BpmnContextProps } from '../../../../contexts/BpmnContext'; +import { BpmnContext } from '../../../../contexts/BpmnContext'; import { EditDataTypesToSign } from './EditDataTypesToSign'; -import { BpmnConfigPanelFormContextProvider } from '../../../contexts/BpmnConfigPanelContext'; +import { BpmnConfigPanelFormContextProvider } from '../../../../contexts/BpmnConfigPanelContext'; import { mockBpmnApiContextValue, mockBpmnContextValue, -} from '../../../../test/mocks/bpmnContextMock'; -import { getMockBpmnElementForTask, mockBpmnDetails } from '../../../../test/mocks/bpmnDetailsMock'; +} from '../../../../../test/mocks/bpmnContextMock'; +import { + getMockBpmnElementForTask, + mockBpmnDetails, +} from '../../../../../test/mocks/bpmnDetailsMock'; const availableDataTypeIds = ['dataType1', 'dataType2', 'dataType3']; const existingDataTypeIds = ['dataType1', 'dataType2']; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.tsx similarity index 92% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.tsx index 919dad1a74d..5dce58d8741 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/EditDataTypesToSign.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/EditDataTypesToSign.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'; import { LinkIcon } from '@studio/icons'; import { SelectDataTypesToSign } from './SelectDataTypesToSign'; import classes from './EditDataTypesToSign.module.css'; -import { useGetDataTypesToSign } from '../../../hooks/dataTypesToSign/useGetDataTypesToSign'; +import { useGetDataTypesToSign } from '../../../../hooks/dataTypesToSign/useGetDataTypesToSign'; export const EditDataTypesToSign = () => { const { t } = useTranslation(); diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.module.css b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.module.css similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.module.css rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.module.css diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx similarity index 88% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx index bf24601bd96..c2385a9ff4d 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.test.tsx @@ -1,24 +1,27 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; -import { textMock } from '../../../../../../../testing/mocks/i18nMock'; +import { textMock } from '../../../../../../../../testing/mocks/i18nMock'; import userEvent from '@testing-library/user-event'; -import type { BpmnApiContextProps } from '../../../../contexts/BpmnApiContext'; -import { BpmnApiContext } from '../../../../contexts/BpmnApiContext'; -import type { BpmnContextProps } from '../../../../contexts/BpmnContext'; -import { BpmnContext } from '../../../../contexts/BpmnContext'; +import type { BpmnApiContextProps } from '../../../../../contexts/BpmnApiContext'; +import { BpmnApiContext } from '../../../../../contexts/BpmnApiContext'; +import type { BpmnContextProps } from '../../../../../contexts/BpmnContext'; +import { BpmnContext } from '../../../../../contexts/BpmnContext'; import type { SelectDataTypesToSignProps } from './SelectDataTypesToSign'; import { SelectDataTypesToSign } from './SelectDataTypesToSign'; -import { BpmnConfigPanelFormContextProvider } from '../../../../contexts/BpmnConfigPanelContext'; +import { BpmnConfigPanelFormContextProvider } from '../../../../../contexts/BpmnConfigPanelContext'; import { mockBpmnApiContextValue, mockBpmnContextValue, -} from '../../../../../test/mocks/bpmnContextMock'; -import { createMock, updateModdlePropertiesMock } from '../../../../../test/mocks/bpmnModelerMock'; +} from '../../../../../../test/mocks/bpmnContextMock'; +import { + createMock, + updateModdlePropertiesMock, +} from '../../../../../../test/mocks/bpmnModelerMock'; import { AUTOSAVE_DEBOUNCE_INTERVAL_MILLISECONDS } from 'app-shared/constants'; import { getMockBpmnElementForTask, mockBpmnDetails, -} from '../../../../../test/mocks/bpmnDetailsMock'; +} from '../../../../../../test/mocks/bpmnDetailsMock'; jest.useFakeTimers({ advanceTimers: true }); createMock.mockImplementation((_, data) => data.dataType); diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx similarity index 87% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx index b2bc2e99e34..55d6133442a 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/SelectDataTypesToSign.tsx @@ -4,10 +4,10 @@ import { StudioButton } from '@studio/components'; import { useTranslation } from 'react-i18next'; import { XMarkIcon } from '@studio/icons'; import classes from './SelectDataTypesToSign.module.css'; -import { useBpmnApiContext } from '../../../../contexts/BpmnApiContext'; -import { StudioModeler } from '../../../../utils/bpmnModeler/StudioModeler'; -import { useGetDataTypesToSign } from '../../../../hooks/dataTypesToSign/useGetDataTypesToSign'; -import { useUpdateDataTypesToSign } from '../../../../hooks/dataTypesToSign/useUpdateDataTypesToSign'; +import { useBpmnApiContext } from '../../../../../contexts/BpmnApiContext'; +import { StudioModeler } from '../../../../../utils/bpmnModeler/StudioModeler'; +import { useGetDataTypesToSign } from '../../../../../hooks/dataTypesToSign/useGetDataTypesToSign'; +import { useUpdateDataTypesToSign } from '../../../../../hooks/dataTypesToSign/useUpdateDataTypesToSign'; export interface SelectDataTypesToSignProps { onClose: () => void; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/index.ts similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/SelectDataTypesToSign/index.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/SelectDataTypesToSign/index.ts diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/index.ts similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditDataTypesToSign/index.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditDataTypesToSign/index.ts diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/EditLayoutSetName.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/EditLayoutSetName.tsx new file mode 100644 index 00000000000..d56a59a691e --- /dev/null +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/EditLayoutSetName.tsx @@ -0,0 +1,57 @@ +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import { StudioToggleableTextfield } from '@studio/components'; +import { KeyVerticalIcon } from '@studio/icons'; +import { useBpmnContext } from '../../../../contexts/BpmnContext'; +import { useBpmnApiContext } from '@altinn/process-editor/contexts/BpmnApiContext'; +import { getLayoutSetIdValidationErrorKey } from 'app-shared/utils/layoutSetsUtils'; +import { Paragraph } from '@digdir/designsystemet-react'; + +interface EditLayoutSetNameProps { + existingLayoutSetName: string; +} +export const EditLayoutSetName = ({ + existingLayoutSetName, +}: EditLayoutSetNameProps): React.ReactElement => { + const { t } = useTranslation(); + const { layoutSets, mutateLayoutSetId } = useBpmnApiContext(); + const { bpmnDetails } = useBpmnContext(); + + const handleOnLayoutSetNameBlur = (event: React.ChangeEvent): void => { + const newName = event.target.value; + if (newName === existingLayoutSetName) return; + mutateLayoutSetId({ layoutSetIdToUpdate: existingLayoutSetName, newLayoutSetId: newName }); + }; + + const handleValidation = (newLayoutSetId: string): string => { + const validationResult = getLayoutSetIdValidationErrorKey( + layoutSets, + bpmnDetails.element.id, + newLayoutSetId, + ); + return validationResult ? t(validationResult) : undefined; + }; + + return ( + , + label: t('process_editor.configuration_panel_layout_set_name_label'), + value: existingLayoutSetName, + onBlur: (event) => handleOnLayoutSetNameBlur(event), + size: 'small', + }} + viewProps={{ + children: ( + + {t('process_editor.configuration_panel_layout_set_name')} + {existingLayoutSetName} + + ), + variant: 'tertiary', + 'aria-label': t('process_editor.configuration_panel_layout_set_name_label'), + }} + /> + ); +}; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/index.ts new file mode 100644 index 00000000000..9cf275e114d --- /dev/null +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/index.ts @@ -0,0 +1 @@ +export { EditLayoutSetName } from './EditLayoutSetName'; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditTaskRecommendedActions/RecommendedActionChangeName.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetNameRecommendedAction/RecommendedActionChangeName.test.tsx similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditTaskRecommendedActions/RecommendedActionChangeName.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetNameRecommendedAction/RecommendedActionChangeName.test.tsx diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditTaskRecommendedActions/RecommendedActionChangeName.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetNameRecommendedAction/RecommendedActionChangeName.tsx similarity index 70% rename from frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditTaskRecommendedActions/RecommendedActionChangeName.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetNameRecommendedAction/RecommendedActionChangeName.tsx index 45612ebdb40..40e6b27b41f 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditTaskRecommendedActions/RecommendedActionChangeName.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetNameRecommendedAction/RecommendedActionChangeName.tsx @@ -1,4 +1,3 @@ -import { useValidateBpmnTaskId } from '../../../../hooks/useValidateBpmnId'; import { useBpmnContext } from '../../../../contexts/BpmnContext'; import { StudioIconTextfield, @@ -8,29 +7,34 @@ import { import { KeyVerticalIcon } from '@studio/icons'; import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { StudioModeler } from '../../../../utils/bpmnModeler/StudioModeler'; +import { getLayoutSetIdValidationErrorKey } from 'app-shared/utils/layoutSetsUtils'; +import { useBpmnApiContext } from '@altinn/process-editor/contexts/BpmnApiContext'; export const RecommendedActionChangeName = (): React.ReactElement => { - const { bpmnDetails, setBpmnDetails } = useBpmnContext(); - const studioModeler = new StudioModeler(bpmnDetails.element); + const { bpmnDetails } = useBpmnContext(); + const { layoutSets, mutateLayoutSetId } = useBpmnApiContext(); const { t } = useTranslation(); - const { validateBpmnTaskId } = useValidateBpmnTaskId(); const { removeAction } = useStudioRecommendedNextActionContext(); const [newName, setNewName] = useState(''); const [newNameError, setNewNameError] = useState(''); + const handleValidation = (newLayoutSetId: string): string => { + const validationResult = getLayoutSetIdValidationErrorKey( + layoutSets, + bpmnDetails.element.id, + newLayoutSetId, + ); + return validationResult ? t(validationResult) : undefined; + }; + const saveNewName = (e: React.FormEvent) => { e.preventDefault(); if (newNameError || newName === '') { return false; } + mutateLayoutSetId({ layoutSetIdToUpdate: bpmnDetails.element.id, newLayoutSetId: newName }); removeAction(bpmnDetails.element.id); - studioModeler.updateElementProperties({ id: newName }); - setBpmnDetails({ - ...bpmnDetails, - id: newName, - }); }; const cancelAction = () => { @@ -54,7 +58,7 @@ export const RecommendedActionChangeName = (): React.ReactElement => { label={t('process_editor.recommended_action.new_name_label')} onChange={(event: React.ChangeEvent) => { setNewName(event.target.value); - setNewNameError(validateBpmnTaskId(event.target.value)); + setNewNameError(handleValidation(event.target.value)); }} value={newName} /> diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.module.css b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.module.css similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.module.css rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.module.css diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx similarity index 93% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx index c48625c9d93..1c04dada282 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.test.tsx @@ -2,16 +2,16 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { textMock } from '@studio/testing/mocks/i18nMock'; import userEvent from '@testing-library/user-event'; -import { type BpmnApiContextProps, BpmnApiContext } from '../../../contexts/BpmnApiContext'; -import type { BpmnContextProps } from '../../../contexts/BpmnContext'; -import { BpmnContext } from '../../../contexts/BpmnContext'; +import { type BpmnApiContextProps, BpmnApiContext } from '../../../../contexts/BpmnApiContext'; +import type { BpmnContextProps } from '../../../../contexts/BpmnContext'; +import { BpmnContext } from '../../../../contexts/BpmnContext'; import { EditUniqueFromSignaturesInDataTypes } from './EditUniqueFromSignaturesInDataTypes'; -import { BpmnConfigPanelFormContextProvider } from '../../../contexts/BpmnConfigPanelContext'; +import { BpmnConfigPanelFormContextProvider } from '../../../../contexts/BpmnConfigPanelContext'; import { mockBpmnApiContextValue, mockBpmnContextValue, -} from '../../../../test/mocks/bpmnContextMock'; -import { getMockBpmnElementForTask, mockBpmnDetails } from '../../../../test/mocks/bpmnDetailsMock'; +} from '../../../../../test/mocks/bpmnContextMock'; +import { getMockBpmnElementForTask, mockBpmnDetails } from '../../../../../test/mocks/bpmnDetailsMock'; const existingDataTypes = [ { id: 'dataType1', name: 'Name 1' }, diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx similarity index 94% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx index eb75a06f0b1..c95a559cb31 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/EditUniqueFromSignaturesInDataTypes.tsx @@ -1,12 +1,12 @@ import React, { useState } from 'react'; -import { useBpmnContext } from '../../../contexts/BpmnContext'; +import { useBpmnContext } from '../../../../contexts/BpmnContext'; import { StudioProperty } from '@studio/components'; import { useTranslation } from 'react-i18next'; import { PersonPencilIcon } from '@studio/icons'; import { SelectUniqueFromSignaturesInDataTypes } from './SelectUniqueFromSignaturesInDataTypes'; import classes from './EditUniqueFromSignaturesInDataTypes.module.css'; import { getSelectedDataTypes } from './UniqueFromSignaturesInDataTypesUtils'; -import { StudioModeler } from '../../../utils/bpmnModeler/StudioModeler'; +import { StudioModeler } from '../../../../utils/bpmnModeler/StudioModeler'; export const EditUniqueFromSignaturesInDataTypes = () => { const { t } = useTranslation(); diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.module.css b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.module.css similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.module.css rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.module.css diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx similarity index 86% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx index b987853643b..9c7998110ab 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.test.tsx @@ -1,24 +1,27 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; -import { textMock } from '../../../../../../../testing/mocks/i18nMock'; +import { textMock } from '@studio/testing/mocks/i18nMock'; import userEvent from '@testing-library/user-event'; -import type { BpmnApiContextProps } from '../../../../contexts/BpmnApiContext'; -import { BpmnApiContext } from '../../../../contexts/BpmnApiContext'; -import type { BpmnContextProps } from '../../../../contexts/BpmnContext'; -import { BpmnContext } from '../../../../contexts/BpmnContext'; +import type { BpmnApiContextProps } from '../../../../../contexts/BpmnApiContext'; +import { BpmnApiContext } from '../../../../../contexts/BpmnApiContext'; +import type { BpmnContextProps } from '../../../../../contexts/BpmnContext'; +import { BpmnContext } from '../../../../../contexts/BpmnContext'; import type { SelectUniqueFromSignaturesInDataTypesProps } from './SelectUniqueFromSignaturesInDataTypes'; import { SelectUniqueFromSignaturesInDataTypes } from './SelectUniqueFromSignaturesInDataTypes'; -import { BpmnConfigPanelFormContextProvider } from '../../../../contexts/BpmnConfigPanelContext'; +import { BpmnConfigPanelFormContextProvider } from '../../../../../contexts/BpmnConfigPanelContext'; import { mockBpmnApiContextValue, mockBpmnContextValue, -} from '../../../../../test/mocks/bpmnContextMock'; -import { createMock, updateModdlePropertiesMock } from '../../../../../test/mocks/bpmnModelerMock'; +} from '../../../../../../test/mocks/bpmnContextMock'; +import { + createMock, + updateModdlePropertiesMock, +} from '../../../../../../test/mocks/bpmnModelerMock'; import { AUTOSAVE_DEBOUNCE_INTERVAL_MILLISECONDS } from 'app-shared/constants'; import { getMockBpmnElementForTask, mockBpmnDetails, -} from '../../../../../test/mocks/bpmnDetailsMock'; +} from '../../../../../../test/mocks/bpmnDetailsMock'; jest.useFakeTimers({ advanceTimers: true }); createMock.mockImplementation(() => []); diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx similarity index 95% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx index cddc7abec66..8460fcec031 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes.tsx @@ -5,12 +5,12 @@ import { useDebounce } from '@studio/hooks'; import { useTranslation } from 'react-i18next'; import { XMarkIcon } from '@studio/icons'; import classes from './SelectUniqueFromSignaturesInDataTypes.module.css'; -import { useBpmnContext } from '../../../../contexts/BpmnContext'; +import { useBpmnContext } from '../../../../../contexts/BpmnContext'; import { updateDataTypes, getSelectedDataTypes } from '../UniqueFromSignaturesInDataTypesUtils'; import type Modeling from 'bpmn-js/lib/features/modeling/Modeling'; import type BpmnFactory from 'bpmn-js/lib/features/modeling/BpmnFactory'; import { AUTOSAVE_DEBOUNCE_INTERVAL_MILLISECONDS } from 'app-shared/constants'; -import { StudioModeler } from '../../../../utils/bpmnModeler/StudioModeler'; +import { StudioModeler } from '../../../../../utils/bpmnModeler/StudioModeler'; export interface SelectUniqueFromSignaturesInDataTypesProps { onClose: () => void; diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/index.ts similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/index.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/SelectUniqueFromSignaturesInDataTypes/index.ts diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts similarity index 96% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts index 6e596f8623f..109b9e61af9 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/UniqueFromSignaturesInDataTypesUtils.ts @@ -1,7 +1,7 @@ import type { ModdleElement } from 'bpmn-js/lib/BaseModeler'; import type Modeling from 'bpmn-js/lib/features/modeling/Modeling'; import type BpmnFactory from 'bpmn-js/lib/features/modeling/BpmnFactory'; -import type { BpmnDetails } from '../../../types/BpmnDetails'; +import type { BpmnDetails } from '../../../../types/BpmnDetails'; export const updateDataTypes = ( bpmnFactory: BpmnFactory, diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/index.ts b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/index.ts similarity index 100% rename from frontend/packages/process-editor/src/components/ConfigPanel/EditUniqueFromSignaturesInDataTypes/index.ts rename to frontend/packages/process-editor/src/components/ConfigPanel/ConfigContent/EditUniqueFromSignaturesInDataTypes/index.ts diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CreateCustomReceiptForm/CreateCustomReceiptForm.test.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CreateCustomReceiptForm/CreateCustomReceiptForm.test.tsx index 155ce6f0706..a3073dd6431 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CreateCustomReceiptForm/CreateCustomReceiptForm.test.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CreateCustomReceiptForm/CreateCustomReceiptForm.test.tsx @@ -38,7 +38,7 @@ describe('CreateCustomReceiptForm', () => { renderCreateCustomReceiptForm(); const layoutSetInput = screen.getByLabelText( - textMock('process_editor.configuration_panel_custom_receipt_textfield_label'), + textMock('process_editor.configuration_panel_layout_set_name_label'), ); const newId: string = 'newLayoutSetId'; await user.type(layoutSetInput, newId); @@ -114,7 +114,7 @@ describe('CreateCustomReceiptForm', () => { }); const inputField = screen.getByLabelText( - textMock('process_editor.configuration_panel_custom_receipt_textfield_label'), + textMock('process_editor.configuration_panel_layout_set_name_label'), ); await user.type(inputField, 'a'); @@ -160,7 +160,7 @@ describe('CreateCustomReceiptForm', () => { const invalidFormatLayoutSetName: string = 'Receipt/'; const inputField = screen.getByLabelText( - textMock('process_editor.configuration_panel_custom_receipt_textfield_label'), + textMock('process_editor.configuration_panel_layout_set_name_label'), ); await user.type(inputField, invalidFormatLayoutSetName); @@ -182,7 +182,7 @@ describe('CreateCustomReceiptForm', () => { }); const layoutSetInput = screen.getByLabelText( - textMock('process_editor.configuration_panel_custom_receipt_textfield_label'), + textMock('process_editor.configuration_panel_layout_set_name_label'), ); await user.type(layoutSetInput, 'newLayoutSetId'); diff --git a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CustomReceipt/CustomReceipt.tsx b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CustomReceipt/CustomReceipt.tsx index e1d3bc469a9..5ead21cd544 100644 --- a/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CustomReceipt/CustomReceipt.tsx +++ b/frontend/packages/process-editor/src/components/ConfigPanel/ConfigEndEvent/CustomReceiptContent/CustomReceipt/CustomReceipt.tsx @@ -6,7 +6,7 @@ import { useBpmnApiContext } from '../../../../../contexts/BpmnApiContext'; import { getDataTypeFromLayoutSetsWithExistingId } from '../../../../../utils/configPanelUtils'; import { RedirectToCreatePageButton } from '../RedirectToCreatePageButton'; import { useTranslation } from 'react-i18next'; -import { EditDataTypes } from '../../../EditDataTypes'; +import { EditDataTypes } from '../../../ConfigContent/EditDataTypes'; import { PROTECTED_TASK_NAME_CUSTOM_RECEIPT } from 'app-shared/constants'; import { getLayoutSetIdValidationErrorKey } from 'app-shared/utils/layoutSetsUtils'; import { Paragraph } from '@digdir/designsystemet-react';