Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added validation for the number of characters in the name of the receipt #13294

1 change: 1 addition & 0 deletions frontend/language/src/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@
"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_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",
Expand Down
2 changes: 2 additions & 0 deletions frontend/packages/shared/src/utils/layoutSetsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const getLayoutSetIdValidationErrorKey = (
if (oldLayoutSetId === newLayoutSetId) return null;
if (!validateLayoutNameAndLayoutSetName(newLayoutSetId)) return 'ux_editor.pages_error_format';
if (!newLayoutSetId) return 'validation_errors.required';
if (newLayoutSetId.length === 1)
framitdavid marked this conversation as resolved.
Show resolved Hide resolved
return 'process_editor.configuration_panel_custom_receipt_layout_set_name_validation';
if (layoutSets.sets.some((set) => set.id === newLayoutSetId))
return 'process_editor.configuration_panel_layout_set_id_not_unique';
return null;
Expand Down