stable

Clone or download

Read-only

feat: Edit link type for new links

How to test: - No functional change for the link type selectbox that lets you add new links (it still works) - after adding a new link, its type is now an editable selectbox - when you change the new link's type, it is saved correctly in backend - you cannot choose `_mirrored_milestone` type - when the artifact already has a parent (when you edit an existing task OR when you add a new task to a story in Planning), then "is Child of" type will be disabled - after adding a new parent ("is Child of" type), if change its type (for example to "is Linked to"), then you can once again add a new parent. You should not be able to add two parents by changing the type of links. Notes: Having a full element for the types selector means it is easier to reuse it. It keeps the same logic but depending on where it is used, the onChange and the value will be different. The SCSS classes will be merged again in a later contribution when we can edit existing link types too. part of story #24970 [modal] select type for links Change-Id: Iddb2edbc44b260157f1c51bc6e6c7a0ca954937d

Modified Files

Name
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/Memory/fields/link-field/NewLinksStore.test.ts +17 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/Memory/fields/link-field/NewLinksStore.ts +14 −2 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkField.test.ts +19 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkField.ts +14 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkFieldController.test.ts +20 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkFieldController.ts +8 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkTypeSelectorElement.test.ts +122 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkTypeSelectorElement.ts +107 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkedArtifactTemplate.test.ts +2 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/NewLinkTemplate.test.ts +33 −14 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/NewLinkTemplate.ts +20 −6 Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/TypeSelectorTemplate.test.ts +0 −187 Go to diff View file
D plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/TypeSelectorTemplate.ts +0 −89 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/link-field.scss +8 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field/ChangeNewLinkType.ts +25 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field/NewLink.ts +5 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal-controller.js +1 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/tests/stubs/ChangeNewLinkTypeStub.ts +36 −0 Go to diff View file