stable

Clone or download

Read-only

feat: Prevent form submission when selected tracker is Nothing

How to test: - In your web container, enable the feature flag: `tuleap config-set feature_flag_create_artifact 1` - Choose a tracker where we cannot create an artifact with only its title (for example it has two required fields). Make sure that tracker has an artifact links field. - Edit an artifact of this tracker with the modal (kanban, TTM or planning view). - Click on the "Create a new artifact" button in the link selector dropdown. - Write a title but DO NOT select a tracker. By default, you should not have a tracker selected because the current tracker is disabled. - Click on the "Create" button in the inline form. The tracker selectbox should show an error state and the browser should warn you that you did not select a tracker. - If you select a valid tracker and submit again, the artifact will be created. - If you select another project and do not select any tracker, the form will be in error again. Notes: There is an issue when you clear the tracker list-picker by clicking on the "cross" icon to remove all values, the list-picker will appear empty, but the inner `<select>` will have the value of the first non-disabled tracker. The code will proceed and behave like that tracker is selected, but the list-picker will appear empty. This issue should be adressed specifically on a dedicated contribution. part of story #28823 [modal] create artifact Change-Id: Ic41c52111f9a0575741d303cdd9b0bf4e1f79323

Modified Files

Name
M plugins/tracker/scripts/lib/artifact-modal/package.json +1 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/pnpm-lock.yaml +3 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/po/fr_FR.po +4 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/po/pt_BR.po +3 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/creation/ArtifactCreatorElement.test.ts +55 −6 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/creation/ArtifactCreatorElement.ts +48 −11 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field/creation/ArtifactCreatorController.test.ts +3 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field/creation/ArtifactCreatorController.ts +3 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/gettext-catalog.ts +2 −0 Go to diff View file