stable

Clone or download

Read-only

feat: Have a multi-values autocompleter

story #31191 [pullrequest-overview] Add reviewers and make them updatable This contribution implements a multi-values selection manager in link-selector. The goal here is to have an complete autocompleter in order to replace select2 where we need to select several values fetched from REST on the fly. In the next steps, I'll rename the lib "link-selector" in something more generic, as this component is basically an autocompleter, and not particularily a link-selector. How to test: - Go to the section "link-selector" in the section "Forms" of the tlp-doc. --> There is a multi-users picker right below the link-selector --> It has already a value selected --> It will show some users if you start to type "jo" in its search input --> Already selected values have the "selected" state in the dropdown --> You can select several users --> You can unselect all the users by clicking on the cross on the right --> You can unselect a given user by clicking on its cross on its left Change-Id: I44bb82debba7c6ad8c0e3b0ed7321f8c50d610bd

Modified Files

Name
M lib/frontend/link-selector/package.json +1 −0 Go to diff View file
M lib/frontend/link-selector/pnpm-lock.yaml +2 −0 Go to diff View file
M lib/frontend/link-selector/src/dropdown/DropdownContentRefresher.ts +3 −3 Go to diff View file
M lib/frontend/link-selector/src/dropdown/DropdownManager.test.ts +1 −1 Go to diff View file
M lib/frontend/link-selector/src/events/EventManager.test.ts +1 −1 Go to diff View file
M lib/frontend/link-selector/src/events/EventManager.ts +1 −1 Go to diff View file
M lib/frontend/link-selector/src/items/GroupCollection.ts +1 −0 Go to diff View file
M lib/frontend/link-selector/src/items/ItemsMapManager.test.ts +5 −3 Go to diff View file
M lib/frontend/link-selector/src/items/ListItemMapBuilder.test.ts +24 −24 Go to diff View file
M lib/frontend/link-selector/src/items/ListItemMapBuilder.ts +17 −13 Go to diff View file
M lib/frontend/link-selector/src/link-selector.ts +33 −12 Go to diff View file
M lib/frontend/link-selector/src/navigation/KeyboardNavigationManager.test.ts +6 −5 Go to diff View file
M lib/frontend/link-selector/src/renderers/BaseComponentRenderer.test.ts +9 −2 Go to diff View file
M lib/frontend/link-selector/src/renderers/BaseComponentRenderer.ts +31 −9 Go to diff View file
M lib/frontend/link-selector/src/renderers/DropdownContentRenderer.test.ts +4 −3 Go to diff View file
M lib/frontend/link-selector/src/renderers/__snapshots__/DropdownContentRenderer.test.ts.snap +6 −6 Go to diff View file
A lib/frontend/link-selector/src/selection/MultipleSelectionManager.test.ts +232 −0 Go to diff View file
A lib/frontend/link-selector/src/selection/MultipleSelectionManager.ts +206 −0 Go to diff View file
M lib/frontend/link-selector/src/selection/SelectionManager.test.ts +25 −28 Go to diff View file
M lib/frontend/link-selector/src/selection/SelectionManager.ts +12 −19 Go to diff View file
A lib/frontend/link-selector/src/selection/templates/clear-selection-button-template.test.ts +32 −0 Go to diff View file
A lib/frontend/link-selector/src/selection/templates/clear-selection-button-template.ts +46 −0 Go to diff View file
A lib/frontend/link-selector/src/selection/templates/selected-value-badge-template.test.ts +61 −0 Go to diff View file
A lib/frontend/link-selector/src/selection/templates/selected-value-badge-template.ts +56 −0 Go to diff View file
M lib/frontend/link-selector/src/type.ts +15 −0 Go to diff View file
M lib/frontend/link-selector/tests/builders/GroupCollectionBuilder.ts +6 −6 Go to diff View file
M lib/frontend/link-selector/tests/stubs/ManageSelectionStub.ts +8 −1 Go to diff View file
M lib/frontend/link-selector/themes/style.scss +53 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/LinkField.ts +1 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/dropdown/LinkSelectorItemProxy.test.ts +2 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/src/adapters/UI/fields/link-field/dropdown/LinkSelectorItemProxy.ts +1 −0 Go to diff View file
M plugins/tracker/scripts/lib/artifact-modal/tests/stubs/LinkSelectorStub.ts +1 −0 Go to diff View file
M src/scripts/tlp-doc/css/_demos.scss +6 −0 Go to diff View file
M src/scripts/tlp-doc/src/editors.js +180 −85 Go to diff View file
M src/www/tlp-doc/resources/forms/link-selector/doc.html +6 −0 Go to diff View file
M src/www/tlp-doc/resources/forms/link-selector/example.html +42 −0 Go to diff View file