-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change recommendedNextAction in process to update layoutsetname and a…
…dd section to change in panel
- Loading branch information
Showing
33 changed files
with
155 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Types/SelectDataTypes/SelectDataTypes.tsx → ...Types/SelectDataTypes/SelectDataTypes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
21 changes: 12 additions & 9 deletions
21
...ypesToSign/SelectDataTypesToSign.test.tsx → ...ypesToSign/SelectDataTypesToSign.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
...s-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/EditLayoutSetName.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<HTMLInputElement>): 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 ( | ||
<StudioToggleableTextfield | ||
customValidation={handleValidation} | ||
inputProps={{ | ||
icon: <KeyVerticalIcon />, | ||
label: t('process_editor.configuration_panel_layout_set_name_label'), | ||
value: existingLayoutSetName, | ||
onBlur: (event) => handleOnLayoutSetNameBlur(event), | ||
size: 'small', | ||
}} | ||
viewProps={{ | ||
children: ( | ||
<Paragraph size='small'> | ||
<strong>{t('process_editor.configuration_panel_layout_set_name')}</strong> | ||
{existingLayoutSetName} | ||
</Paragraph> | ||
), | ||
variant: 'tertiary', | ||
'aria-label': t('process_editor.configuration_panel_layout_set_name_label'), | ||
}} | ||
/> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
...ckages/process-editor/src/components/ConfigPanel/ConfigContent/EditLayoutSetName/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { EditLayoutSetName } from './EditLayoutSetName'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...s/EditUniqueFromSignaturesInDataTypes.tsx → ...s/EditUniqueFromSignaturesInDataTypes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.