stable

Clone or download

Read-only

feat: toggle Parent link type

part of story #24969 [modal] add and remove links (replace current artifact link) How to test: - the reverse "_is_child" (Parent) link type is now allowed and selectable in the link types selector. - if there is an existing Parent link, the type should be disabled. - if you add a new Parent link, the type should be disabled. The selectbox value should switch to "untyped". - if you remove a newly added Parent link, the type should be enabled again. - if you submit, the Parent link is filtered out of the payload and is discarded. Taking it into account will come in a later contribution. Notes: If you forge the "disabled" attribute in HTML, you can still add two parents in the UI component. Submitting does not save them though. Change-Id: I519b51d345aabb240ddc4449511681ab9754107c

Modified Files

Name
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/AddLinkButtonTemplate.test.ts +58 −8 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/AddLinkButtonTemplate.ts +19 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/CollectionOfAllowedLinksTypesPresenters.test.ts +26 −5 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/CollectionOfAllowedLinksTypesPresenters.ts +21 −17 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkField.ts +8 −14 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldController.test.ts +55 −19 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkFieldController.ts +87 −54 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkTypeProxy.test.ts +12 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkTypeProxy.ts +8 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/LinkedArtifactTemplate.test.ts +2 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/NewLinkCollectionPresenter.ts +3 −5 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/NewLinkTemplate.test.ts +19 −3 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/NewLinkTemplate.ts +3 −1 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/TypeSelectorTemplate.test.ts +37 −14 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field-v2/TypeSelectorTemplate.ts +25 −13 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/LinkFieldValueFormatter.test.ts +21 −4 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/LinkFieldValueFormatter.ts +4 −1 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/ParentLinkVerifier.test.ts +87 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/ParentLinkVerifier.ts +51 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/src/domain/fields/link-field-v2/VerifyHasParentLink.ts +22 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/tuleap-artifact-modal-controller.js +2 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/LinkTypeStub.ts +5 −0 Go to diff View file
A plugins/tracker/scripts/lib/artifact-modal/tests/stubs/VerifyHasParentLinkStub.ts +30 −0 Go to diff View file