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

fix(widget-builder): Update table sort when field removed or modified #82898

Conversation

narsaynorath
Copy link
Member

When a field is removed or modified, the sort field should update accordingly. This relies on the fact that we're only going to update one step at a time (i.e. we won't update two fields through the hook in one action) and determines if:

a) a field was removed
b) a field was modified

When a field was removed, we simply reset to the first option.

When a field is modified, we look for which field that was and then update the sort to reflect that field.

I had to fix a bug in the visualize component that was updating the state directly (i.e. directly modifying the memory) instead of updating it through the dispatch method. I fixed this by doing a deep clone and updating the field then calling the dispatch function.

@narsaynorath narsaynorath requested a review from a team as a code owner January 3, 2025 22:01
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 3, 2025
@narsaynorath narsaynorath merged commit 75ae0ed into master Jan 6, 2025
43 checks passed
@narsaynorath narsaynorath deleted the nar/fix/widget-builder-reset-table-sort-when-corresponding-field-removed branch January 6, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants