superset
superset copied to clipboard
feat: Add comparison time label to Big Number with Time Period plugin
SUMMARY
Add a custom control to Big Number with Time Period Comparison plugin, which adds a label with actual time range for comparison below the range for comparison selector.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
https://github.com/apache/superset/assets/15073128/2829e113-c320-451f-aa27-45a24f8ec7cc
TESTING INSTRUCTIONS
- Create a Big Number with Time Period Comparison chart
- Add some time filter
- Select range for comparison
- Verify that the label updates whenever the time filter or range for comparison changes
- Run query
- Verify that the label matches the time filter in second query
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
Codecov Report
Attention: Patch coverage is 33.33333%
with 32 lines
in your changes are missing coverage. Please review.
Project coverage is 69.70%. Comparing base (
89e89de
) to head (553a721
).
Additional details and impacted files
@@ Coverage Diff @@
## master #27253 +/- ##
==========================================
- Coverage 69.73% 69.70% -0.03%
==========================================
Files 1909 1910 +1
Lines 74670 74716 +46
Branches 8324 8329 +5
==========================================
+ Hits 52069 52084 +15
- Misses 20550 20580 +30
- Partials 2051 2052 +1
Flag | Coverage Δ | |
---|---|---|
hive | 53.72% <46.66%> (-0.01%) |
:arrow_down: |
javascript | 57.17% <12.12%> (-0.05%) |
:arrow_down: |
mysql | 78.00% <80.00%> (-0.02%) |
:arrow_down: |
postgres | 78.13% <80.00%> (+<0.01%) |
:arrow_up: |
presto | 53.67% <46.66%> (-0.01%) |
:arrow_down: |
python | 83.16% <80.00%> (+<0.01%) |
:arrow_up: |
sqlite | 77.57% <80.00%> (+<0.01%) |
:arrow_up: |
unit | 56.54% <46.66%> (-0.01%) |
:arrow_down: |
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.
I'm not up to speed on the controls changes happening here, but if they're JUST for this plugin, any new controls should be added in that plugin src. If it's a shared control and new functionality, it should be in the superset-ui package(s). In general, we should not be adding code to the superset-frontend codebase, as that should be migrated to external packages for enhanced reusability. Also, if the plugin is intended to be published as an npm
package (which I would think we should do for all plugins) then this code can't be modified/published as part of that package release.
IMO, the time comparison hundred percent frontend changes enough, I post my thoughts in the PR: https://github.com/apache/superset/pull/27145/files#r1499727676
The key point of design for the date time expression is that just needs frontend to build a expression.
@rusackas good points, thank you! yes this control is just for that 1 plugin. I moved it to src/explore/components
so that we could use dateFilterUtils
, but maybe we should simply move those utils to @superset-ui/core
@kgabryje I opened a PR for fetching multiple time range https://github.com/apache/superset/pull/27370/files
/testenv up
@kgabryje Ephemeral environment spinning up at http://34.222.22.95:8080. Credentials are admin
/admin
. Please allow several minutes for bootstrapping and startup.
/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true
@Antonio-RiveroMartnez Ephemeral environment spinning up at http://35.162.209.131:8080. Credentials are admin
/admin
. Please allow several minutes for bootstrapping and startup.
/testenv up FEATURE_CHART_PLUGINS_EXPERIMENTAL=true
@kgabryje Ephemeral environment spinning up at http://34.217.114.83:8080. Credentials are admin
/admin
. Please allow several minutes for bootstrapping and startup.