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

[MPDX-8240] Deselect removed ids #1151

Merged
merged 3 commits into from
Oct 25, 2024
Merged

[MPDX-8240] Deselect removed ids #1151

merged 3 commits into from
Oct 25, 2024

Conversation

canac
Copy link
Contributor

@canac canac commented Oct 23, 2024

Description

When the list of contacts, tasks, or other entities changes, deselect any that were removed from the list.

Testing

  • Go to the tasks page and select 2 tasks. You should see "2 Selected" in the header.
  • Change the tasks filters so that only one of the selected tasks is visible. You should see "1 Selected" in the header.

MPDX-8240

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@canac canac added the Preview Environment Add this label to create an Amplify Preview label Oct 23, 2024
@canac canac requested a review from dr-bizz October 23, 2024 16:18
@canac canac self-assigned this Oct 23, 2024
Copy link

Preview branch generated at https://8240-deselect-removed-ids.d3dytjb8adxkk5.amplifyapp.com

Copy link

github-actions bot commented Oct 23, 2024

Bundle sizes [mpdx-react]

Compared against 6c3cb0b

No significant changes found

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

The code and UI look great! On the first test, it removed all of my selected tasks, but on the second test it worked as described. - It also did this on contacts.

@canac
Copy link
Contributor Author

canac commented Oct 24, 2024

On the first test, it removed all of my selected tasks.

@dr-bizz Good catch! That should be fixed now, as well as a performance improvement. Instead of waiting for the contacts or tasks to load before loading the mass selection ids, we load the mass selection ids immediately.

@canac canac requested a review from dr-bizz October 24, 2024 19:43
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

This works well in the UI, and the code looks great. I didn't know you could fetch previousData. At first I was worried that if no tasks are present, it would default back to the previousData, but that isn't the case.

This change is for consistency and also so that you can modify the
selected ids multiple times during the same render and get the expected
results.
Also speeds up loading mass selection ids by not waiting for the
contacts or tasks to load first.
@canac canac enabled auto-merge October 25, 2024 14:45
@canac canac merged commit ada0000 into main Oct 25, 2024
17 checks passed
@canac canac deleted the 8240-deselect-removed-ids branch October 25, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants