kgabryje commented on code in PR #30848:
URL: https://github.com/apache/superset/pull/30848#discussion_r1830825810
##########
superset-frontend/packages/superset-ui-chart-controls/src/sections/timeComparison.tsx:
##########
@@ -94,9 +98,29 @@ export const timeComparisonControls: ({
name: 'start_date_offset',
config: {
type: 'TimeOffsetControl',
- label: t('shift start date'),
+ label: t('Shift start date'),
visibility: ({ controls }) =>
controls?.time_compare.value === 'custom',
+ mapStateToProps: (
+ state: ControlPanelState,
+ controlState: ControlState,
+ ) => {
+ const { form_data } = state;
+ const { time_compare } = form_data;
+ const newState = { ...controlState };
+ if (
+ time_compare === 'custom' &&
+ (controlState.value === '' ||
+ controlState.value === 'Invalid date')
Review Comment:
We use „Invalid date” here and in explore. Should we move it to a const in
chart controls package? Also, should it be translated or does that string come
from some external library?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]