chore(dashboard): Ignore empty json value for overwrite confirm
SUMMARY
Minor regression from #21819
When user change a single layout but no filter_scope updates, there's unrelated overwrite confirmation kept popping up because the default json value is not empty string but an empty object {}.
This commit updates the default json value to skip the unnecessary overwrite warning.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
https://user-images.githubusercontent.com/1392866/203666144-493d55cd-6fa5-408e-a457-2532ba9d60c9.mov
After:
No overwrite confirm
TESTING INSTRUCTIONS
- Enable
CONFIRM_DASHBOARD_DIFF - Edit dashboard and change one chart position
- Save and check the confirmation
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
cc: @ktmud @john-bodley
Codecov Report
Merging #22214 (265564c) into master (888f43c) will decrease coverage by
0.03%. The diff coverage is50.00%.
@@ Coverage Diff @@
## master #22214 +/- ##
==========================================
- Coverage 66.96% 66.92% -0.04%
==========================================
Files 1835 1835
Lines 69927 69988 +61
Branches 7590 7612 +22
==========================================
+ Hits 46826 46839 +13
- Misses 21135 21183 +48
Partials 1966 1966
| Flag | Coverage Δ | |
|---|---|---|
| javascript | 53.75% <50.00%> (-0.06%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...t-frontend/src/dashboard/util/getOverwriteItems.ts | 90.90% <50.00%> (ø) |
|
| ...ntend/plugins/plugin-chart-echarts/src/defaults.ts | 20.00% <0.00%> (-80.00%) |
:arrow_down: |
| .../src/explore/components/ControlPanelsContainer.tsx | 75.35% <0.00%> (-2.03%) |
:arrow_down: |
| ...tend/plugins/plugin-chart-echarts/src/Pie/types.ts | 100.00% <0.00%> (ø) |
|
| ...tend/plugins/plugin-chart-echarts/src/constants.ts | 100.00% <0.00%> (ø) |
|
| ...nd/plugins/plugin-chart-echarts/src/Graph/types.ts | 100.00% <0.00%> (ø) |
|
| ...nd/plugins/plugin-chart-echarts/src/Radar/types.ts | 100.00% <0.00%> (ø) |
|
| ...d/plugins/plugin-chart-echarts/src/Funnel/types.ts | 100.00% <0.00%> (ø) |
|
| .../plugins/plugin-chart-echarts/src/BoxPlot/types.ts | 0.00% <0.00%> (ø) |
|
| .../plugins/plugin-chart-echarts/src/Treemap/types.ts | 100.00% <0.00%> (ø) |
|
| ... and 29 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more