Skip to content
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

fix: Allow only dttm columns in comparison filter in Period over Period chart #27209

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

kgabryje
Copy link
Member

SUMMARY

When user selected Custom range for comparison on Big Number With Time Period Comparison chart, the filter control would accept any column. That worked but didn't make much sense, so this PR restricts the control to accept only dttm columns for filtering.
Please note that user can still write custom sql which will filter anything, so that's just a UX improvement.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2024-02-22.at.18.12.53.mov

TESTING INSTRUCTIONS

  1. Create Big Number With Time Period Comparison chart
  2. Select Custom range for comparison
  3. Verify that you can drag only temporal columns
  4. Verify that in the columns select in the popover you can only select temporal columns

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

Copy link
Member

@Antonio-RiveroMartnez Antonio-RiveroMartnez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@@ -382,7 +382,18 @@ const DndFilterSelect = (props: DndFilterSelectProps) => {
return new AdhocFilter(config);
}, [droppedItem]);

const canDrop = useCallback(() => true, []);
const canDrop = useCallback(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non blocking: does any testable behavior changed with this block? If so, could add include it in the DndMetricSelect.test.tsx file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The drag and drop behavior tested in DndMetricSelect.test.tsx is related to reordering the metric values. Testing drag and drop from the datasource panel to the control field is more complicated - I suggest we add those tests in a separate PR, both for filters and metrics

controlState.value,
),
}),
) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Feb 22, 2024
@kgabryje kgabryje force-pushed the feat/pop-kpi-comparison-only-dttm branch from 4ceb9a7 to 5c0be0d Compare February 23, 2024 11:51
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 10.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 67.34%. Comparing base (721977a) to head (263b76e).

Files Patch % Lines
...igNumber/BigNumberPeriodOverPeriod/controlPanel.ts 0.00% 5 Missing ⚠️
...ontrols/DndColumnSelectControl/DndFilterSelect.tsx 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27209      +/-   ##
==========================================
- Coverage   67.34%   67.34%   -0.01%     
==========================================
  Files        1909     1909              
  Lines       74592    74600       +8     
  Branches     8320     8323       +3     
==========================================
+ Hits        50235    50236       +1     
- Misses      22305    22312       +7     
  Partials     2052     2052              
Flag Coverage Δ
javascript 57.21% <10.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Feb 23, 2024
@kgabryje kgabryje force-pushed the feat/pop-kpi-comparison-only-dttm branch from 5c0be0d to 263b76e Compare March 5, 2024 16:56
@kgabryje kgabryje merged commit a4c771e into apache:master Mar 5, 2024
27 checks passed
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 7, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 8, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 14, 2024
@justinpark justinpark added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Mar 18, 2024
@michael-s-molina michael-s-molina removed the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Mar 19, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 19, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 22, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 26, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 26, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 28, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 1, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 2, 2024
betodealmeida pushed a commit that referenced this pull request Apr 25, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
eschutho pushed a commit that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants