Skip to content

Commit

Permalink
Denormalize form data in mixed timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Jun 8, 2022
1 parent 2185ae5 commit 869e7fb
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
* under the License.
*/
import React from 'react';
import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core';
import {
ensureIsArray,
FeatureFlag,
isFeatureEnabled,
t,
} from '@superset-ui/core';
import { cloneDeep } from 'lodash';
import {
ControlPanelConfig,
Expand Down Expand Up @@ -452,6 +457,21 @@ const config: ControlPanelConfig = {
],
},
],
denormalizeFormData: formData => {
const groupby =
formData.standardizedFormData.standardizedState.columns.filter(
col => !ensureIsArray(formData.groupby_b).includes(col),
);
const metrics =
formData.standardizedFormData.standardizedState.metrics.filter(
metric => !ensureIsArray(formData.metrics_b).includes(metric),
);
return {
...formData,
metrics,
groupby,
};
},
};

export default config;

0 comments on commit 869e7fb

Please sign in to comment.