-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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(explore): hide advanced analytics for non temporal xaxis #28312
fix(explore): hide advanced analytics for non temporal xaxis #28312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @justinpark. I left some first-pass comments.
import { isAdhocColumn, isPhysicalColumn } from '@superset-ui/core'; | ||
import type { ColumnMeta, ControlPanelsContainerProps } from '../types'; | ||
|
||
export default function showIfTimeSeries({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to showTimeRelatedControls
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-s-molina to clarify and specify the functionality, i'm thinking of use displayWhenTimeRelatedControls
.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
displayTimeRelatedControls
(without when) works too.
}, | ||
}; | ||
|
||
describe('showIfTimeSeries', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you avoid describe
?
controlPanelSections: [ | ||
{ | ||
label: t('Advanced analytics'), | ||
description: t('Advanced analytical post processin'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: t('Advanced analytical post processin'), | |
description: t('Advanced analytics post processing'), |
@@ -144,4 +144,41 @@ describe('ControlPanelsContainer', () => { | |||
await screen.findAllByTestId('collapsible-control-panel-header'), | |||
).toHaveLength(2); | |||
}); | |||
|
|||
test('hide ControlPanelSections when its visibility is false', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're also testing if the panel is displayed when the visibility is true
.
test('hide ControlPanelSections when its visibility is false', async () => { | |
test('visibility of panels is correctly applied', async () => { |
d5e2c33
to
24da739
Compare
@justinpark Can you also make sure to ignore or remove the values from the form data in case a user starts with a temporal column, fills the advanced properties and later changes to a categorial x-axis? |
800e989
to
f1278a8
Compare
Done |
f1278a8
to
c213433
Compare
(cherry picked from commit 07cd1d8)
...form_data, | ||
...restoredField, | ||
}, | ||
hiddenFormData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit too late, but I guess there should be omit(hiddenFormData, fieldNames)
, otherwise it seems to break any field that was hidden once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SUMMARY
The superset feature allows users to choose a non-temporal column for the x-axis.
However, when a non-temporal column is selected, advanced analytics and forecast options are not compatible.
In order to address this, UI should dynamically hide these features when a non-temporal column is selected.
This commit introduces the visibility option in the ControlPanelSectionConfig, enabling the hiding of specific groups of controlSets.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
before--hide-non-temporal.mov
After:
after--hide-non-temporal.mov
TESTING INSTRUCTIONS
Choose non-temporal column in x-axis option
Verify that "Advanced analytics" and "Predictive Analytics" sections are hidden
ADDITIONAL INFORMATION