•  
     
    story #24969 [modal] add and remove links (replace current artifact link)
Summary
Empty
[modal] add and remove links (replace current artifact link)
Empty

The field can now be used to add & remove links:

  • Add "Unlink" in the table for existing links
  • Allow to link:
    • without type ("is linked to")
    • or "is child of" (to allow parent selection)
      • Warning: there can be only one selected parent so the "is child of" option can't be selected twice
  • "Add link" adds links one by one. Added links:
    • are appended at the bottom of the list with a green background
    • can be removed directly using the "Remove" button
  • Selector allow to pick-up
    • Link to an id : the picker returns as a result the artifact corresponding to the id (GET request triggered after delay). If no artifact is returned, the picker shows a "No result found message"
    • Possible parents, either by filtering on their name or their id. The possible parents list is loaded when "is child of" is selected and the picker is open

Given there was already an existing link (not marked for removal) to artifact A or a newly added link to artifact A, when artifact A is listed in the artifact picker, it will be disabled and cannot be added again. This prevents situations where user links twice artifact A : the last link "wins" and erases the type of the previous link, which is probably unexpected by the user. This also prevents link "cycles" where artifact A ⇄ artifact B, for example artifact A is child of artifact B who is child of artifact A. If such situations are desirable, we need to gather use-cases before allowing them. See mockups below

At this stage, the field replace the existing "artifact link field" in the modal by default for everyone

Mockups

Artifact picker mockup for this story is available in this figma: https://www.figma.com/file/f8zfcbUP4bpqqs7MB2IsqQ/New-Artifact-Links?node-id=0%3A1

Links list mockup for this story is available in this codepen : https://cdpn.io/pen/debug/eYReNXM/29d1a2e6760a69e567af62c783f2f8de

Figma mockup for the disabled option (to prevent linking twice): https://www.figma.com/file/f8zfcbUP4bpqqs7MB2IsqQ/New-Artifact-Links?node-id=34%3A599
Codepen live mockup for the "already linked" dropdown options (to show ellipsis of title): https://codepen.io/enalean/pen/bGLwwXx/45aea0c272a0fc15eb3ab045a65f5785

Empty
Empty
Status
Trackers
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#24969
Manuel Vacelet (vaceletm)
2022-06-16 13:09
2022-01-04 17:38
3579

References
Referencing story #24969

Git commit

tuleap/tuleap/stable

"Static method" style 0fb72f7d5c
Harden identifier typing 9792087886
Using Faults in artifact-modal e403c34701
Toggle removal of link in UI 665dfb91d1
feat(new-art-link-field): Display "Linked to" when no type 9070c634f9
feat(new-art-link-field): Delete forward links 35567d1866
refacto(artifact-links): Split getFieldDataFromRESTValue in several classes c6a47bd67b
refactor: Namespace ArtifactUpdater 0632975598
Deprecate Artifact::getAnArtifactLinkField f1f35c7ae7
refactor: call NewChangesetCreator directly 4686c4ed0b
Add missed deprecations to Psalm baseline 80b4b8ebee
chore: Deprecate Artifact::getWorkflow ca02cb9cc4
refactor: remove inheritance to ChangesetCreatorBase 2176a2bddd
chore: Deprecate \Tracker_Artifact_Changeset::executePostCreationActions b8f27953eb
refactor: remove inheritance to NewChangesetCreatorBase 615c535109
refactor: move comment saving to a dedicated class 79598c0409
feat: Return allowed link types in link field representation 478a9a365a
refactor: rename ArtifactValidator to FieldsDataBuilder d6e11dbad1
refactor: Group NewChangesetCreator parameters 6ac7e8dd26
refactor: add interfaces in front of FormElementFactory 7022eed56d
refactor: remove inheritance to InitialChangesetCreatorBase 1731a91832
refactor: stop using Tracker_ArtifactLinkInfo e2af7e63e4
refactor: build Artifact link value outside of Field f5570e852d
chore: Reorganize namespaces 7e9def3cb7
refactor: build Initial changeset value outside of Field e6032efb02
fix: parent link id can be a string 761b7ff630
refactor: harmonize new changeset value with initial b26761eb3a
chore: deprecate Artifact::createNewChangeset 92ce991d3c
feat: Introduce a basic link-selector 047d281d5e
feat: Display link types <select> 965782b382
fix: CollectionOfAllowedLinksTypesPresenters properties should be readonly b3eed6d7cd
feat: Display errors in tlp-modal-feedback ba77909737
docs: ADR to implement artifact link auto-completer fdfbe9b45a
fix: Filter border is square 2b7d8b0c2c
feat: Restrict allowed types to "no type" and Child (forward) a1a0c3ce02
feat: Filter and auto-complete link-selector 7f2cb8ddce
refactor: Display parent retrieval error in tlp-modal-feedback ce4a30479a
refactor: Give only controller to LinkField a25dcf4aae
feat: search artifacts to link by id cba8b5b8d1
feat: prevent user to search the current artifact ae5a8af96a
link-selector does not depend on <select> element 1051a1217e
refactor: split ParentArtifact type from Artifact f1a5e37e57
refactor: Prevent direct usage of ArtifactResponse and TrackerResponse 3514ff91c7
feat: display cross-ref in link selector badge 82dc8acfbb
refactor: reuse cross ref object for LinkedArtifact 0f336fa149
feat: toggle add link button disabled 2e154a50e3
feat: add new link e1dfb26ec3
feat: Spinner on Matching artifact section 366358dc11
refactor: TuleapAPIClient uses only fetch-result dfb59cfd78
feat: Display newly added link and save it ee1d4a3112
feat: show Error when autocomplete error code is not 403 or 404 69bbd33f75
refactor: remove dependency on @tuleap/core e7745dfadf
feat: Remove newly added link aa085ec241
refactor: Build allowed link types separately from field 9ac6b15ff9
chore: Remove unused dependency `@tuleap/po-gettext-plugin` 40ee7ce22f
feat: toggle Parent link type 2c63ea80f7
feat: Add a new parent link 6cb39592e8
Disable Parent link type when caller has already set a parent 3b0604237f
refactor: memory adapter for selected link type 95f8857eed
feat: Parents route returns tracker color and artifact xref c673883e2a
feat: Display possible parents fcf246e388
chore: Placholder can be set after DOM Element initialization 1d053601ea
feat: Filter possible parents d412ecb82b
feat: Update placeholder based on the selected link type c31ed65d7c
feat: Handle disabled values in link-selector ab3ed4e013
feat: disallow linking twice the same artifact 44be8b7812
feat: Do not take "mark for removal" into account for link checks eed6fb0fa2
feat: Add a note about only one parent for artifact a3178a2437
refacto: setter hybrids instead of controller af71600f6a
fix: clear selection when new links are edited 475ebdcd04
feat: clear search field when selection has been cleared 8121642792
feat: Add already linked information in disabled element 7d1e676224
feat: Clear search field when dropdown is closed w/out selection 9d2d30c7b9
feat: Reset selection only when type change from/to parent ce12003f42
fix: Prevent link-selector cell to expand when artifact's title is very long 255e415471
fix: remove user-select: none on search field ac366e5cf0
feat: Add artifact badge in parent note 7ef40595e8
feat: Group possible parents by project 15eb2a4417
feat: focus link-selector after a link has been added a4db74b254
fix: Take into account design check feedback bb7ad72ca2
feat: Have links and popovers for reverse links 96785869d7
fix: have a title attribut on items 7e1828bbca
chore: Remove feature flag and trash old field c7f51cd67f
fix: adapt e2e modal test to new link field edd426984e
chore: drop v2 suffix and clean up 09c19d479e

Follow-ups

User avatar
Joris MASSON (jmasson)2022-05-12 12:48

Add links to specific mockups for the disabled options (already linked).


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2022-05-12 12:00

Edit Acceptance criteria to explain that linking twice the same artifact is not allowed.


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gorka (tgorka)2022-05-10 11:50

gerrit #25884 integrated into Tuleap 13.8.99.61


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Category set to Trackers
User avatar
Joris MASSON (jmasson)2022-03-31 12:16

Fix links


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Attachments image.png removed
User avatar
Joris MASSON (jmasson)2022-03-28 14:34
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • I want to
    -[modal] add and remove links without types 
    +[modal] add and remove links (replace current artifact link) 
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Thomas Gorka (tgorka)2022-01-28 10:09

gerrit #25003 integrated into Tuleap 13.4.99.156


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes