-
Notifications
You must be signed in to change notification settings - Fork 356
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: edit/move modals for projects in workspaces unexpectedly closes [DET-10388] #9588
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9588 +/- ##
==========================================
- Coverage 49.86% 45.26% -4.61%
==========================================
Files 1247 923 -324
Lines 162293 121980 -40313
Branches 2887 2887
==========================================
- Hits 80922 55209 -25713
+ Misses 81200 66600 -14600
Partials 171 171
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
||
if (!_.isEqual(workspaceAssignments, response.assignments)) { | ||
setWorkspaceAssignments(response.assignments); | ||
} |
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.
I prefer to write this kind of logic as something like
setWorkspaceAssignments(prev => _.isEqual(prev, response.assignments) ? prev : response.assignments);
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 logic looks good to me, but I usually prefer to use the prev
callback function instead of monitoring the state
73e072b
to
bc7c824
Compare
_.isEqual(prev, response.assignments) ? prev : response.assignments, | ||
); | ||
} catch (e) { | ||
handleError(e, { silent: true }); |
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.
handleError(e, { silent: true }); | |
handleError(e, { silent: false }); |
Ticket
Description
Projects (under workspaces) modals get closed randomly when in list view and RBAC enabled. This change band-aids the problem by making sure the problematic code doesn't get called unless it has to.
Test Plan
Checklist
docs/release-notes/
See Release Note for details.