web-client-ui
web-client-ui copied to clipboard
feat: Make rollup group behaviour a setting in the global settings menu
Closes #2128
@mofojed I tried experimenting with trying to have the IrisGridModelUpdater listen for the COLUMNS_CHANGED event, and then accordingly set the modelColumns in the event handler, but that was not working (it also effectively does the same hack, if it were to work, where we set to the model.columns anyways).
I am going to push the "hacky" code that we discussed yesterday, and then we can continue the conversation on finding a cleaner way to do this.
Codecov Report
Attention: Patch coverage is 63.47826% with 42 lines in your changes missing coverage. Please review.
Project coverage is 46.64%. Comparing base (
336e1f3) to head (f10645a).
Additional details and impacted files
@@ Coverage Diff @@
## main #2183 +/- ##
========================================
Coverage 46.64% 46.64%
========================================
Files 692 693 +1
Lines 38571 38606 +35
Branches 9647 9839 +192
========================================
+ Hits 17992 18009 +17
+ Misses 20568 20544 -24
- Partials 11 53 +42
| Flag | Coverage Δ | |
|---|---|---|
| unit | 46.64% <63.47%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
For the image mismatches, will need to have new images taken, to replace the rollup-rows-and-aggregate-columns images, where the group column is shown by default (given that the setting will be activated by default)
@mofojed Adjusted logic according to your review, e2e tests may still fail because of the rollup images. How can we update those?
@AkshatJawne Run npm run e2e:update-ci-snapshots to update the snapshots: https://github.com/deephaven/web-client-ui/blob/main/README.md#e2e-tests
@mofojed Ran command, appears the snapshots were not updated?
Tried running npm run clean then npm i, and then also restarted my computer and TS server, keep getting the above
I don't understand why this is going on the formatter and not as a prop to IrisGrid or something like that. The value is only used in IrisGridTreeTableModel, so why pass it through the formatter? To me it doesn't feel like it belongs on formatter since that's for "how to display a cell based on its value and column type".
So I think my proposal is to remove this from the formatter settings and instead in componentDidUpdate where it checks the settings, add a separate check for if this value changed. If it did, then update the model. That way should work without the worry of useEffect
Or you could add showExtraGroupColumn to the IrisGridModelUpdater as a prop and then you would still need the change from useEffect I think. Or columns would need to be updated at the end possibly. Either way shouldn't need useEffect and if you remove the usePrevious hook and use a ref instead in the useOnChange hook (so that the value is always up to date even if the render is discarded so effects don't run), then that should be fine