chore: Restructure explore redux state - #20448
Conversation
|
CC @eric-briscoe since you were interested in this project 🙂 |
Codecov Report
@@ Coverage Diff @@
## master #20448 +/- ##
==========================================
+ Coverage 66.75% 66.76% +0.01%
==========================================
Files 1740 1744 +4
Lines 65172 65172
Branches 6900 6901 +1
==========================================
+ Hits 43505 43514 +9
+ Misses 19918 19908 -10
- Partials 1749 1750 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
michael-s-molina
left a comment
There was a problem hiding this comment.
Thanks for the PR @kgabryje! I left some first-pass comments.
|
Thanks for comments Michael, they all make sense to me. Will fix |
There was a problem hiding this comment.
no blocking suggestion, define a constant for the unsaved chart, default value is 0, and this function might be splited into getChartKeyFromSlice and getChartKeyFromFromData.
There was a problem hiding this comment.
+1 for creating a constant for default slice id, but is there a use case for splitting this function in 2?
There was a problem hiding this comment.
This type will probably change in the future to include other datasource types.
There was a problem hiding this comment.
Should I change it now? Or just add a todo when those new datasource types are introduced?
There was a problem hiding this comment.
Either way would work. Using the intersection type may cause some typescript errors because you'll need to resolve the difference in the schema of the datasources, which is something that we're working on now in a feature branch. It may be easiest to leave it as a todo, honestly.
|
/testenv up |
|
@jinghua-qa Ephemeral environment spinning up at http://54.70.20.159:8080. Credentials are |
There was a problem hiding this comment.
Can we confirm the exact type of getState return here?
There was a problem hiding this comment.
Good point... which resulted in finding a bug. I thought that getState returns the state of reducer, but it actually returns global redux state.
Added a unit test for that
32a2b4b to
e5a3228
Compare
|
Explore regression is tested in ephemeral env , did not find major issue related to this PR, LGTM |
b5c5591 to
eade95e
Compare
|
/testenv up |
|
@kgabryje Ephemeral environment spinning up at http://34.221.129.165:8080. Credentials are |
| datasource_type: explore.datasource.type, | ||
| datasourceId: explore.datasource_id, | ||
| datasource, | ||
| datasource_type: datasource.type, |
There was a problem hiding this comment.
I think this might be a good time to make also the property names consistent, some of them are camel case, some others use hyphens currently
There was a problem hiding this comment.
Good call. I'll fix it in a follow up PR
|
/testenv up |
|
@kgabryje Ephemeral environment spinning up at http://34.223.225.190:8080. Credentials are |
|
Ephemeral environment shutdown and build artifacts deleted. |
* chore: Restructure explore redux state * fixes * fix tests * add new tests * Fix type * Address comments * Fix bug * Fix import * Add new test * Move unsaved chart id to a constant * Add todo
* chore: Restructure explore redux state * fixes * fix tests * add new tests * Fix type * Address comments * Fix bug * Fix import * Add new test * Move unsaved chart id to a constant * Add todo
SUMMARY
This PR restructures Explore redux state, so that it's more consistent with redux state of Dashboard view. This is a prerequisite for upcoming Explore SPA project - we need the redux states to be consistent so that we can smoothly navigate between dashboards and charts.
Now the following structure is used:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION