diff --git a/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTagMocks.ts b/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTagMocks.ts index 233f519446d70..6428b503b85ad 100644 --- a/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTagMocks.ts +++ b/superset-frontend/src/components/AlteredSliceTag/AlteredSliceTagMocks.ts @@ -17,7 +17,7 @@ * under the License. */ import { QueryFormData } from '@superset-ui/core'; -import { ControlPanelConfig } from 'packages/superset-ui-chart-controls/src/types'; +import { ControlPanelConfig } from '@superset-ui/chart-controls'; import { DiffType, RowType } from './index'; export const defaultProps: Record> = { diff --git a/superset-frontend/src/components/AlteredSliceTag/index.tsx b/superset-frontend/src/components/AlteredSliceTag/index.tsx index cea972f2b41b0..bcea8bb78c211 100644 --- a/superset-frontend/src/components/AlteredSliceTag/index.tsx +++ b/superset-frontend/src/components/AlteredSliceTag/index.tsx @@ -38,7 +38,7 @@ export interface ControlMap { }; } -type FilterItem = { +type FilterItemType = { comparator?: string | string[]; subject: string; operator: string; @@ -46,7 +46,7 @@ type FilterItem = { }; export type DiffItemType< - T = FilterItem | number | string | Record, + T = FilterItemType | number | string | Record, > = | T[] | boolean @@ -180,7 +180,7 @@ class AlteredSliceTag extends React.Component< return '[]'; } return value - .map((v: FilterItem) => { + .map((v: FilterItemType) => { const filterVal = v.comparator && v.comparator.constructor === Array ? `[${v.comparator.join(', ')}]` @@ -199,14 +199,14 @@ class AlteredSliceTag extends React.Component< return value.map(v => safeStringify(v)).join(', '); } if (controlsMap[key]?.type === 'MetricsControl' && Array.isArray(value)) { - const formattedValue = value.map((v: FilterItem) => v?.label ?? v); + const formattedValue = value.map((v: FilterItemType) => v?.label ?? v); return formattedValue.length ? formattedValue.join(', ') : '[]'; } if (typeof value === 'boolean') { return value ? 'true' : 'false'; } if (Array.isArray(value)) { - const formattedValue = value.map((v: FilterItem) => v?.label ?? v); + const formattedValue = value.map((v: FilterItemType) => v?.label ?? v); return formattedValue.length ? formattedValue.join(', ') : '[]'; } if (typeof value === 'string' || typeof value === 'number') {