Skip to content
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

[WIP]fix(platform): cache user selection after searching for new user list for approval flow #12505

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CSEHoangV
Copy link
Contributor

closes #12093
ng-15 #12107

@CSEHoangV CSEHoangV self-assigned this Oct 6, 2024
Copy link

netlify bot commented Oct 6, 2024

Deploy Preview for fundamental-ngx ready!

Name Link
🔨 Latest commit 8efde6d
🔍 Latest deploy log https://app.netlify.com/sites/fundamental-ngx/deploys/6702534511e3af0008f38191
😎 Deploy Preview https://deploy-preview-12505--fundamental-ngx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Oct 6, 2024

Visit the preview URL for this PR (updated for commit 8efde6d):

https://fundamental-ngx-gh--pr12505-fix-approval-flow-se-7r9odk1q.web.app

(expires Wed, 09 Oct 2024 09:11:50 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 41b993ee8e451bd7c6770b342ce142dc886eacff

@droshev droshev added this to the Sprint 139 - October 2024 milestone Oct 7, 2024
@droshev droshev requested a review from a team October 7, 2024 13:16
this.selectedItems = this._selectionModel.selected;
const event = new SelectionChangeEvent();
event.selectedItems = this.selectedItems;
if (selection.added?.length) {
event.added = selection.added[0];
Copy link
Member

@mikerodonnell89 mikerodonnell89 Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this change does fix the issue we are seeing for the approval flow component. However, I think this code could pose a problem in the future for the list component, agnostic to the approval flow. It is interesting that added on a selectionChangeEvent is always just one BaseListItem but selectionModel emits an array of them. Which makes me think, instead of doing event.added = selection.added[0]; we need to either:

  • Iterate over selection.added and emit a selectedItemChange event for each selection.item
  • Or, update the selectedItemChange event to be able to pass either a single item (as it is now), or emit an array of them

Same idea goes for selection.removed as well. I'm inclined to say we should go for the first bullet point, as to not have to update the selectedItemChange api.

Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment above

@CSEHoangV CSEHoangV marked this pull request as draft October 23, 2024 17:44
@CSEHoangV CSEHoangV changed the title fix(platform): cache user selection after searching for new user list for approval flow [WIP]fix(platform): cache user selection after searching for new user list for approval flow Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[P2][Sourcing] Unable to select multiple users if using search in approval flow
3 participants