-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added multi select reorder functionality #2334
Added multi select reorder functionality #2334
Conversation
Deployed to https://pr-2334.aam-digital.net/ |
…tps://github.com/Aam-Digital/ndb-core into feature/enable-multiselect-for-tostringattribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.../admin/admin-entity/admin-entity-general-settings/admin-entity-general-settings.component.ts
Outdated
Show resolved
Hide resolved
src/app/core/common-components/basic-autocomplete/basic-autocomplete.component.html
Outdated
Show resolved
Hide resolved
@@ -101,6 +107,8 @@ export class BasicAutocompleteComponent<O, V = O> | |||
* Whether the user should be able to select multiple values. | |||
*/ | |||
@Input() multi?: boolean; | |||
@Input() reorder?: boolean; | |||
autocompleteDraggableOptions: SelectableOption<O, V>[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not use the same autocompleteSuggestedOptions array also if drag&drop is availalbe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The drop method expects an array as input to perform operations such as moving items within the array. However, autocompleteSuggestedOptions is an Observable that emits values asynchronously, and it's not directly usable as an array in the drop method. That is why I am using different arrays to drag and drop.
Hi @sleidig I have fixed this. Does this look fine or do we need some more modifications here? |
…tps://github.com/Aam-Digital/ndb-core into feature/enable-multiselect-for-tostringattribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI looks good now. Did some minor code cleanup.
One issue I still discovered: After switching tab and coming back (i.e. re-initializing the options), the order in the form field is still correct but in the dropdown it is back to original order not matching the reordered sorting anymore.
I would suggest to put all selected items at the top of the dropdown, in the order they are selected. And then drop all the remaining fields in their default order.
I have updated the functionality a little bit. Can you please check now that it's looking fine or do you have any suggestions? |
🎉 This PR is included in version 3.35.0-master.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.35.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
closes: #2120
Visible/Frontend Changes