-
Notifications
You must be signed in to change notification settings - Fork 44
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
front: fix row deletion in timestop input table #9739
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9739 +/- ##
==========================================
- Coverage 37.85% 37.78% -0.07%
==========================================
Files 990 994 +4
Lines 90921 91210 +289
Branches 1176 1178 +2
==========================================
+ Hits 34415 34462 +47
- Misses 56052 56294 +242
Partials 454 454
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
4e131ce
to
07c4387
Compare
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.
Working perfectly, thanks !
Hm, I must admit I'm not a huge fan of this workaround. Could we instead fix the function which checks whether two rows are equal, to consider that |
Right now we're just using lodash isEqual. I suppose we could call a normalizing function setting null to undefined (or both to false for stopSignal) on both rows before comparing. Would you prefer that? |
We could do something like: const { stopFor, theoreticalMargin, ...rest } = row;
return isEqual(rest, …) && stopFor == … && theoreticalMargin == …; Normalizing sounds fine to me as well. |
Another upside of normalizing is that we can stick to |
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.
LGTM !
77481df
to
4b788ca
Compare
if (!newRowData.stopFor && op.fromRowIndex !== allWaypointsLength - 1) { | ||
if ( | ||
!newRowData.stopFor && | ||
newRowData.onStopSignal && |
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.
Nit: does this change really matter? If we reset the field to false when it's already false, it's a no-op so should be fine as well?
(In general, I prefer keeping the list of conditions in a if
as small as possible.)
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.
It does because we also set null/undefined to false, which means we need to add the row to the path to remember it.
We could also put it in the format function, but here I think it makes more sense to directly avoid doing a modification rather than do it then drop it after the comparison
Signed-off-by: Alice Khoudli <alice.khoudli@polytechnique.org>
4b788ca
to
f584878
Compare
Partial fix of #8959
-> IV. Multi selected fields modification is bugged
-> V. Delete the value of a stopping time field behaves weirdly
Prevents deletion of empty fields from creating a via