Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/EnxDev/superset
Browse files Browse the repository at this point in the history
  • Loading branch information
EnxDev committed Mar 21, 2024
2 parents 018870e + 964fccd commit 446f370
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Partial<QueryFormData>> = {
Expand Down
10 changes: 5 additions & 5 deletions superset-frontend/src/components/AlteredSliceTag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ export interface ControlMap {
};
}

type FilterItem = {
type FilterItemType = {
comparator?: string | string[];
subject: string;
operator: string;
label?: string;
};

export type DiffItemType<
T = FilterItem | number | string | Record<string | number, any>,
T = FilterItemType | number | string | Record<string | number, any>,
> =
| T[]
| boolean
Expand Down Expand Up @@ -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(', ')}]`
Expand All @@ -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') {
Expand Down

0 comments on commit 446f370

Please sign in to comment.