From 44c1ad5c714e1972ac9933dea256cb3dfc9bc4a5 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Mon, 6 Jul 2026 12:54:33 -0700 Subject: [PATCH] fix: delint frontend files (#41802) --- .../superset-ui-chart-controls/src/types.ts | 12 +-- .../AsyncAceEditor/AsyncAceEditor.stories.tsx | 8 +- .../src/components/Button/types.ts | 7 +- .../src/components/CodeEditor/index.tsx | 8 +- .../src/components/DropdownButton/index.tsx | 20 +++-- .../components/DynamicEditableTitle/index.tsx | 20 +++-- .../src/components/EmptyState/index.tsx | 8 +- .../src/components/Form/types.ts | 3 +- .../src/components/Icons/index.tsx | 3 +- .../src/components/Label/types.ts | 7 +- .../src/components/Loading/types.ts | 5 +- .../src/components/MetadataBar/ContentType.ts | 9 +- .../src/components/Modal/Modal.tsx | 86 ++++++++++--------- .../src/components/Tabs/Tabs.tsx | 14 +-- .../superset-ui-core/src/connection/types.ts | 11 +-- .../src/currency-format/types.ts | 8 +- .../superset-ui-core/src/models/Registry.ts | 4 +- .../src/query/api/v1/handleError.ts | 3 +- .../src/query/getClientErrorObject.ts | 10 +-- .../src/query/types/Dashboard.ts | 13 +-- .../src/query/types/Filter.ts | 4 +- .../src/query/types/Metric.ts | 7 +- .../src/query/types/PostProcessing.ts | 30 +++---- .../src/query/types/QueryFormData.ts | 3 +- .../src/time-comparison/types.ts | 9 +- .../components/ChartDataProvider.test.tsx | 3 +- .../src/controlPanel.tsx | 3 +- .../src/transformProps.ts | 3 +- .../plugin-chart-ag-grid-table/src/types.ts | 5 +- .../test/controlPanel.test.tsx | 3 +- .../plugin-chart-echarts/src/BoxPlot/types.ts | 6 +- .../src/Radar/controlPanel.tsx | 3 +- .../src/Timeseries/transformers.ts | 3 +- .../src/Waterfall/types.ts | 6 +- .../src/utils/legendLayout.ts | 6 +- .../src/utils/safeEChartOptionsParser.ts | 8 +- .../plugin-chart-echarts/src/utils/series.ts | 6 +- .../test/Timeseries/transformProps.test.ts | 15 ++-- .../test/utils/series.test.ts | 12 +-- .../src/plugin/controls/shared.ts | 3 +- .../src/react-pivottable/utilities.ts | 3 +- .../plugin-chart-pivot-table/src/types.ts | 4 +- .../plugin-chart-table/src/TableChart.tsx | 48 ++++++----- .../plugin-chart-table/src/controlPanel.tsx | 3 +- .../test/controlPanel.test.tsx | 3 +- .../src/layers/Path/buildQuery.ts | 3 +- .../src/utilities/Shared_DeckGL.tsx | 3 +- .../src/utils/crossFiltersDataMask.ts | 12 +-- .../TableExploreTree/TreeNodeRenderer.tsx | 6 +- .../middlewares/persistSqlLabStateEnhancer.ts | 5 +- .../src/SqlLab/reducers/sqlLab.ts | 3 +- .../FoldersEditor/TreeItem.styles.ts | 24 +++--- .../Datasource/FoldersEditor/treeUtils.ts | 4 +- .../src/components/GridTable/Header.test.tsx | 6 +- .../ListView/Filters/CompactSelectPanel.tsx | 6 +- .../src/dashboard/actions/dashboardLayout.ts | 2 +- .../src/dashboard/actions/dashboardState.ts | 3 +- .../components/AddSliceCard/AddSliceCard.tsx | 3 +- .../AutoRefreshStatus/StatusIndicatorDot.tsx | 14 +-- .../src/dashboard/components/Dashboard.tsx | 4 +- .../DashboardBuilder/DashboardBuilder.tsx | 19 ++-- .../DashboardContainer.test.tsx | 3 +- .../dashboard/components/dnd/DragHandle.tsx | 10 ++- .../components/gridComponents/Chart/Chart.tsx | 3 +- .../gridComponents/Header/Header.tsx | 7 +- .../FilterBar/ActionButtons/index.tsx | 60 +++++++------ .../FilterBar/CrossFilters/CrossFilter.tsx | 20 +++-- .../FilterBar/CrossFilters/CrossFilterTag.tsx | 10 ++- .../CrossFilters/CrossFilterTitle.tsx | 8 +- .../FilterControls.overflow.test.tsx | 3 +- .../FilterBar/UrlFilters/UrlFilterTag.tsx | 8 +- .../FiltersConfigForm/FiltersConfigForm.tsx | 10 ++- .../hooks/useItemStateManager.ts | 3 +- .../hooks/useModalSaveLogic.ts | 3 +- .../transformers/customizationTransformer.ts | 8 +- .../transformers/filterTransformer.ts | 4 +- .../components/nativeFilters/state.ts | 11 +-- .../dashboard/containers/DashboardPage.tsx | 3 +- .../src/dashboard/reducers/dashboardInfo.ts | 3 +- .../src/dashboard/reducers/nativeFilters.ts | 5 +- superset-frontend/src/dashboard/types.ts | 3 +- .../src/dashboard/util/risonFilters.ts | 6 +- superset-frontend/src/dataMask/reducer.ts | 2 +- .../controls/ColumnConfigControl/types.ts | 4 +- .../controls/DateFilterControl/types.ts | 22 +---- .../AdhocFilterEditPopover/index.tsx | 3 +- .../index.tsx | 5 +- .../LayerConfigsPopoverContent.tsx | 3 +- .../components/controls/SelectControl.tsx | 3 +- .../components/controls/TextAreaControl.tsx | 16 +--- .../controls/VerticalRadioControl.tsx | 8 +- .../controls/VizTypeControl/VizTile.tsx | 50 ++++++----- .../useExploreAdditionalActionsMenu/index.tsx | 3 +- .../controlUtils/standardizedFormData.ts | 3 +- superset-frontend/src/explore/types.ts | 6 +- .../features/alerts/AlertReportModal.test.tsx | 8 +- .../src/features/alerts/AlertReportModal.tsx | 29 +++---- .../databases/UploadDataModel/index.tsx | 11 +-- .../src/features/databases/types.ts | 3 +- .../src/features/home/ActivityTable.tsx | 6 +- .../src/features/home/RightMenu.tsx | 10 ++- .../src/middleware/loggerMiddleware.ts | 6 +- superset-frontend/src/pages/Chart/index.tsx | 3 +- .../FileHandler.subdirectory.test.tsx | 4 +- .../src/pages/FileHandler/index.test.tsx | 4 +- superset-frontend/src/views/CRUD/types.ts | 7 +- 106 files changed, 403 insertions(+), 582 deletions(-) diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts index 9f63e423309..83523d4d0a4 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts @@ -330,8 +330,7 @@ export interface SelectControlConfig< optionRenderer?: (option: O) => ReactNode; valueRenderer?: (option: O) => ReactNode; filterOption?: - | ((option: FilterOption, rawInput: string) => boolean) - | null; + ((option: FilterOption, rawInput: string) => boolean) | null; } export type SharedControlConfig< @@ -396,9 +395,7 @@ export const isCustomControlItem = (obj: unknown): obj is CustomControlItem => export type ExpandedControlItem = CustomControlItem | ReactElement | null; export type ControlSetItem = - | SharedControlAlias - | OverrideSharedControlItem - | ExpandedControlItem; + SharedControlAlias | OverrideSharedControlItem | ExpandedControlItem; export type ControlSetRow = ControlSetItem[]; @@ -702,10 +699,7 @@ export interface DataColumnMeta { originalLabel?: string; dataType: GenericDataType; formatter?: - | TimeFormatter - | NumberFormatter - | CustomFormatter - | CurrencyFormatter; + TimeFormatter | NumberFormatter | CustomFormatter | CurrencyFormatter; isMetric?: boolean; isPercentMetric?: boolean; isNumeric?: boolean; diff --git a/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx b/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx index 5f6b7679f11..cf775804930 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/AsyncAceEditor.stories.tsx @@ -29,13 +29,7 @@ import { import type { AsyncAceEditorOptions } from './types'; type EditorType = - | 'sql' - | 'full-sql' - | 'markdown' - | 'text-area' - | 'css' - | 'json' - | 'config'; + 'sql' | 'full-sql' | 'markdown' | 'text-area' | 'css' | 'json' | 'config'; const editorTypes: EditorType[] = [ 'sql', diff --git a/superset-frontend/packages/superset-ui-core/src/components/Button/types.ts b/superset-frontend/packages/superset-ui-core/src/components/Button/types.ts index 4bdee16d9c6..815b318be11 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Button/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Button/types.ts @@ -31,12 +31,7 @@ export type { AntdButtonProps, ButtonType, ButtonVariantType, ButtonColorType }; export type OnClickHandler = MouseEventHandler; export type ButtonStyle = - | 'primary' - | 'secondary' - | 'tertiary' - | 'danger' - | 'link' - | 'dashed'; + 'primary' | 'secondary' | 'tertiary' | 'danger' | 'link' | 'dashed'; export type ButtonSize = 'default' | 'small' | 'xsmall'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/CodeEditor/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/CodeEditor/index.tsx index 4096c9d1238..e766778ccbd 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/CodeEditor/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/CodeEditor/index.tsx @@ -37,13 +37,7 @@ import 'ace-builds/src-noconflict/theme-github'; import 'ace-builds/src-noconflict/theme-monokai'; export type CodeEditorMode = - | 'handlebars' - | 'css' - | 'json' - | 'sql' - | 'markdown' - | 'javascript' - | 'html'; + 'handlebars' | 'css' | 'json' | 'sql' | 'markdown' | 'javascript' | 'html'; export type CodeEditorTheme = 'light' | 'dark'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx index 63c556995e1..aa860cc4b05 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/DropdownButton/index.tsx @@ -34,8 +34,9 @@ export const DropdownButton = ({ const { type: buttonType } = rest; // divider implementation for default (non-primary) buttons const defaultBtnCss = css` - ${(!buttonType || buttonType === 'default') && - `.ant-dropdown-trigger { + ${ + (!buttonType || buttonType === 'default') && + `.ant-dropdown-trigger { position: relative; &:before { content: ''; @@ -48,7 +49,8 @@ export const DropdownButton = ({ .anticon { vertical-align: middle; } - }`} + }` + } `; const button = ( 0 && - css` - width: ${inputWidth}px; - `} + ${ + inputWidth && + inputWidth > 0 && + css` + width: ${inputWidth}px; + ` + } `} disabled={!canEdit} /> diff --git a/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx index 71f840e7aab..73c27d672d5 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/EmptyState/index.tsx @@ -167,9 +167,11 @@ export const EmptyState: React.FC = ({ {image && }
css` - max-width: ${containerSize === 'large' - ? theme.sizeUnit * 150 - : theme.sizeUnit * 100}px; + max-width: ${ + containerSize === 'large' + ? theme.sizeUnit * 150 + : theme.sizeUnit * 100 + }px; `} > {title && {title}} diff --git a/superset-frontend/packages/superset-ui-core/src/components/Form/types.ts b/superset-frontend/packages/superset-ui-core/src/components/Form/types.ts index a0ebd8eb72a..ffff65dc35a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Form/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Form/types.ts @@ -21,8 +21,7 @@ export type { FormProps, FormInstance, FormItemProps } from 'antd/es/form'; export interface LabeledErrorBoundInputProps { label?: string; validationMethods: - | { onBlur: (value: any) => void } - | { onChange: (value: any) => void }; + { onBlur: (value: any) => void } | { onChange: (value: any) => void }; errorMessage?: string | null; helpText?: string; required?: boolean; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Icons/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/Icons/index.tsx index 8750d8299ad..3a72c71e3d0 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Icons/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Icons/index.tsx @@ -77,8 +77,7 @@ customIcons.forEach(customIcon => { }); export type IconNameType = - | keyof typeof antdEnhancedIcons - | keyof typeof iconOverrides; + keyof typeof antdEnhancedIcons | keyof typeof iconOverrides; type IconComponentType = Record; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Label/types.ts b/superset-frontend/packages/superset-ui-core/src/components/Label/types.ts index 3cb38e947a1..5b66eb8972b 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Label/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Label/types.ts @@ -27,12 +27,7 @@ import type { export type OnClickHandler = MouseEventHandler; export type LabelType = - | 'success' - | 'warning' - | 'error' - | 'info' - | 'default' - | 'primary'; + 'success' | 'warning' | 'error' | 'info' | 'default' | 'primary'; export interface LabelProps extends HTMLAttributes { key?: string; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Loading/types.ts b/superset-frontend/packages/superset-ui-core/src/components/Loading/types.ts index 1edfd5dbbde..76752771ac8 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Loading/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/Loading/types.ts @@ -17,10 +17,7 @@ * under the License. */ export type PositionOption = - | 'floating' - | 'inline' - | 'inline-centered' - | 'normal'; + 'floating' | 'inline' | 'inline-centered' | 'normal'; export type SizeOption = 's' | 'm' | 'l'; diff --git a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentType.ts b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentType.ts index 6f88d556a99..72f7cc176cd 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentType.ts +++ b/superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentType.ts @@ -81,11 +81,4 @@ export type Tags = { }; export type ContentType = - | Dashboards - | Description - | LastModified - | Owner - | Rows - | Sql - | Table - | Tags; + Dashboards | Description | LastModified | Owner | Rows | Sql | Table | Tags; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx b/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx index 0f0e73debff..21216206f5a 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx @@ -73,14 +73,16 @@ export const StyledModal = styled(BaseModal)` const closeButtonWidth = theme.sizeUnit * 14; return css` - ${responsive && - css` - max-width: ${maxWidth ?? '900px'}; - padding-left: ${theme.sizeUnit * 3}px; - padding-right: ${theme.sizeUnit * 3}px; - padding-bottom: 0; - top: 0; - `} + ${ + responsive && + css` + max-width: ${maxWidth ?? '900px'}; + padding-left: ${theme.sizeUnit * 3}px; + padding-right: ${theme.sizeUnit * 3}px; + padding-bottom: 0; + top: 0; + ` + } .ant-modal-content { background-color: ${theme.colorBgContainer}; @@ -168,40 +170,46 @@ export const StyledModal = styled(BaseModal)` padding: 0; } - ${draggable && - css` - .ant-modal-header { - padding: 0; + ${ + draggable && + css` + .ant-modal-header { + padding: 0; - .draggable-trigger { - cursor: move; - padding: ${theme.sizeUnit * 4}px ${closeButtonWidth}px - ${theme.sizeUnit * 4}px ${theme.sizeUnit * 4}px; - width: 100%; - } - } - `} - - ${resizable && - css` - .resizable { - pointer-events: all; - - .resizable-wrapper { - height: 100%; - } - - .ant-modal-content { - height: 100%; - - .ant-modal-body { - height: ${hideFooter - ? `calc(100% - ${MODAL_HEADER_HEIGHT}px)` - : `calc(100% - ${MODAL_HEADER_HEIGHT}px - ${MODAL_FOOTER_HEIGHT}px)`}; + .draggable-trigger { + cursor: move; + padding: ${theme.sizeUnit * 4}px ${closeButtonWidth}px + ${theme.sizeUnit * 4}px ${theme.sizeUnit * 4}px; + width: 100%; } } - } - `} + ` + } + + ${ + resizable && + css` + .resizable { + pointer-events: all; + + .resizable-wrapper { + height: 100%; + } + + .ant-modal-content { + height: 100%; + + .ant-modal-body { + height: ${ + hideFooter + ? `calc(100% - ${MODAL_HEADER_HEIGHT}px)` + : `calc(100% - ${MODAL_HEADER_HEIGHT}px - ${MODAL_FOOTER_HEIGHT}px)` + }; + } + } + } + ` + } `; }} `; diff --git a/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx b/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx index 3d479975e85..3551805da77 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/Tabs/Tabs.tsx @@ -51,8 +51,10 @@ const StyledTabs = ({ .ant-tabs-content-holder { overflow: ${allowOverflow ? 'visible' : 'auto'}; ${fullHeight && 'height: 100%;'} - ${contentHeight && - `height: ${typeof contentHeight === 'number' ? `${contentHeight}px` : contentHeight};`} + ${ + contentHeight && + `height: ${typeof contentHeight === 'number' ? `${contentHeight}px` : contentHeight};` + } ${contentPadding} } .ant-tabs-content { @@ -66,9 +68,11 @@ const StyledTabs = ({ margin: 0; } .ant-tabs-nav-wrap { - ${!(tabBarStyle && 'paddingLeft' in tabBarStyle) - ? `padding: 0 ${theme.sizeUnit * 4}px;` - : ''} + ${ + !(tabBarStyle && 'paddingLeft' in tabBarStyle) + ? `padding: 0 ${theme.sizeUnit * 4}px;` + : '' + } } .ant-tabs-tab { flex: 1 1 auto; diff --git a/superset-frontend/packages/superset-ui-core/src/connection/types.ts b/superset-frontend/packages/superset-ui-core/src/connection/types.ts index 1893444fe2d..87d50eb37a1 100644 --- a/superset-frontend/packages/superset-ui-core/src/connection/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/connection/types.ts @@ -51,9 +51,7 @@ export type JsonPrimitive = string | number | boolean | null; * (Ref: https://github.com/microsoft/TypeScript/issues/15300). */ export type StrictJsonValue = - | JsonPrimitive - | StrictJsonObject - | StrictJsonArray; + JsonPrimitive | StrictJsonObject | StrictJsonArray; export type StrictJsonArray = StrictJsonValue[]; /** * More strict JSON objects that makes sure all values are plain objects. @@ -79,12 +77,7 @@ export type Mode = RequestInit['mode']; export type Redirect = RequestInit['redirect']; export type ClientTimeout = number | undefined; export type ParseMethod = - | 'json' - | 'json-bigint' - | 'text' - | 'raw' - | null - | undefined; + 'json' | 'json-bigint' | 'text' | 'raw' | null | undefined; export type Signal = RequestInit['signal']; export type Stringify = boolean; export type Url = string; diff --git a/superset-frontend/packages/superset-ui-core/src/currency-format/types.ts b/superset-frontend/packages/superset-ui-core/src/currency-format/types.ts index 882fca6f42a..45259d76098 100644 --- a/superset-frontend/packages/superset-ui-core/src/currency-format/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/currency-format/types.ts @@ -18,12 +18,6 @@ */ export type RowDataValue = - | string - | number - | boolean - | Date - | bigint - | null - | undefined; + string | number | boolean | Date | bigint | null | undefined; export type RowData = Record; diff --git a/superset-frontend/packages/superset-ui-core/src/models/Registry.ts b/superset-frontend/packages/superset-ui-core/src/models/Registry.ts index 7488ab82459..c3e7083cb78 100644 --- a/superset-frontend/packages/superset-ui-core/src/models/Registry.ts +++ b/superset-frontend/packages/superset-ui-core/src/models/Registry.ts @@ -36,9 +36,7 @@ export interface ItemWithLoader { type InclusiveLoaderResult = V | Promise; export type RegistryValue> = - | V - | W - | undefined; + V | W | undefined; export type RegistryEntry> = { key: string; diff --git a/superset-frontend/packages/superset-ui-core/src/query/api/v1/handleError.ts b/superset-frontend/packages/superset-ui-core/src/query/api/v1/handleError.ts index 62c13c9d8cd..71344340488 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/api/v1/handleError.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/api/v1/handleError.ts @@ -59,8 +59,7 @@ export default async function handleError(error: ErrorInput): Promise { errorMessage = `${status} ${statusText}`; try { errorJson = (await error.json()) as - | SupersetApiErrorPayload - | SupersetApiMultiErrorsPayload; + SupersetApiErrorPayload | SupersetApiMultiErrorsPayload; originalError = errorJson; } catch (error_) { originalError = error; diff --git a/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts b/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts index cc555fa4e93..9e9731dbfd3 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/getClientErrorObject.ts @@ -46,10 +46,7 @@ interface TimeoutError { } type ErrorType = - | SupersetClientResponse - | TimeoutError - | { response: Response } - | string; + SupersetClientResponse | TimeoutError | { response: Response } | string; type ErrorTextSource = 'dashboard' | 'chart' | 'query' | 'dataset' | 'database'; @@ -162,10 +159,7 @@ export function parseErrorJson(responseJson: JsonObject): ClientErrorObject { export function getClientErrorObject( response: - | SupersetClientResponse - | TimeoutError - | { response: Response } - | string, + SupersetClientResponse | TimeoutError | { response: Response } | string, ): Promise { // takes a SupersetClientResponse as input, attempts to read response as Json // if possible, and returns a Promise that resolves to a plain object with diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Dashboard.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Dashboard.ts index d1de2b70b06..40cdbbcad3d 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Dashboard.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Dashboard.ts @@ -186,10 +186,7 @@ export function isFilterDivider( export function isChartCustomization( filterElement: - | Filter - | Divider - | ChartCustomization - | ChartCustomizationDivider, + Filter | Divider | ChartCustomization | ChartCustomizationDivider, ): filterElement is ChartCustomization { return filterElement.type === ChartCustomizationType.ChartCustomization; } @@ -204,10 +201,7 @@ export type FilterConfiguration = Array; export type Filters = { [filterId: string]: - | Filter - | Divider - | ChartCustomization - | ChartCustomizationDivider; + Filter | Divider | ChartCustomization | ChartCustomizationDivider; }; export type PartialFilters = { @@ -226,8 +220,7 @@ export type ChartCustomizationConfiguration = Array< export type ChartCustomizations = { [chartCustomizationId: string]: - | ChartCustomization - | ChartCustomizationDivider; + ChartCustomization | ChartCustomizationDivider; }; export type PartialChartCustomizations = { diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Filter.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Filter.ts index a9aa7b653ee..2e59126c265 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Filter.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Filter.ts @@ -53,9 +53,7 @@ export type SetAdhocFilter = BaseSimpleAdhocFilter & { }; export type SimpleAdhocFilter = - | UnaryAdhocFilter - | BinaryAdhocFilter - | SetAdhocFilter; + UnaryAdhocFilter | BinaryAdhocFilter | SetAdhocFilter; export interface FreeFormAdhocFilter extends BaseAdhocFilter { expressionType: 'SQL'; diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/Metric.ts b/superset-frontend/packages/superset-ui-core/src/query/types/Metric.ts index 15b59fb22ab..2bc59d1cefc 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/Metric.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/Metric.ts @@ -21,12 +21,7 @@ import { Currency, Maybe, QueryFormMetric } from '../../types'; import { Column } from './Column'; export type Aggregate = - | 'AVG' - | 'COUNT' - | 'COUNT_DISTINCT' - | 'MAX' - | 'MIN' - | 'SUM'; + 'AVG' | 'COUNT' | 'COUNT_DISTINCT' | 'MAX' | 'MIN' | 'SUM'; export interface AdhocMetricBase { hasCustomLabel?: boolean; diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/PostProcessing.ts b/superset-frontend/packages/superset-ui-core/src/query/types/PostProcessing.ts index 96dd51bf7ba..56e802ae594 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/PostProcessing.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/PostProcessing.ts @@ -74,8 +74,7 @@ interface _PostProcessingAggregation { }; } export type PostProcessingAggregation = - | _PostProcessingAggregation - | DefaultPostProcessing; + _PostProcessingAggregation | DefaultPostProcessing; export type BoxPlotQueryObjectWhiskerType = 'tukey' | 'min/max' | 'percentile'; interface _PostProcessingBoxplot { @@ -88,8 +87,7 @@ interface _PostProcessingBoxplot { }; } export type PostProcessingBoxplot = - | _PostProcessingBoxplot - | DefaultPostProcessing; + _PostProcessingBoxplot | DefaultPostProcessing; interface _PostProcessingContribution { operation: 'contribution'; @@ -101,8 +99,7 @@ interface _PostProcessingContribution { }; } export type PostProcessingContribution = - | _PostProcessingContribution - | DefaultPostProcessing; + _PostProcessingContribution | DefaultPostProcessing; interface _PostProcessingPivot { operation: 'pivot'; @@ -132,8 +129,7 @@ interface _PostProcessingProphet { }; } export type PostProcessingProphet = - | _PostProcessingProphet - | DefaultPostProcessing; + _PostProcessingProphet | DefaultPostProcessing; interface _PostProcessingDiff { operation: 'diff'; @@ -155,8 +151,7 @@ interface _PostProcessingRolling { }; } export type PostProcessingRolling = - | _PostProcessingRolling - | DefaultPostProcessing; + _PostProcessingRolling | DefaultPostProcessing; interface _PostProcessingCum { operation: 'cum'; @@ -177,8 +172,7 @@ export interface _PostProcessingCompare { }; } export type PostProcessingCompare = - | _PostProcessingCompare - | DefaultPostProcessing; + _PostProcessingCompare | DefaultPostProcessing; interface _PostProcessingSort { operation: 'sort'; @@ -199,8 +193,7 @@ interface _PostProcessingResample { }; } export type PostProcessingResample = - | _PostProcessingResample - | DefaultPostProcessing; + _PostProcessingResample | DefaultPostProcessing; interface _PostProcessingRename { operation: 'rename'; @@ -211,8 +204,7 @@ interface _PostProcessingRename { }; } export type PostProcessingRename = - | _PostProcessingRename - | DefaultPostProcessing; + _PostProcessingRename | DefaultPostProcessing; interface _PostProcessingFlatten { operation: 'flatten'; @@ -222,8 +214,7 @@ interface _PostProcessingFlatten { }; } export type PostProcessingFlatten = - | _PostProcessingFlatten - | DefaultPostProcessing; + _PostProcessingFlatten | DefaultPostProcessing; interface _PostProcessingRank { operation: 'rank'; @@ -245,8 +236,7 @@ interface _PostProcessingHistogram { }; } export type PostProcessingHistogram = - | _PostProcessingHistogram - | DefaultPostProcessing; + _PostProcessingHistogram | DefaultPostProcessing; /** * Parameters for chart data postprocessing. diff --git a/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts b/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts index a3de0fb3b91..ad02b3e03c7 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/types/QueryFormData.ts @@ -51,8 +51,7 @@ export type QueryFormColumn = PhysicalColumn | AdhocColumn; * Format: [metric/column, is_ascending]. */ export type QueryFormOrderBy = - | [QueryFormColumn | QueryFormMetric | {}, boolean] - | []; + [QueryFormColumn | QueryFormMetric | {}, boolean] | []; export interface FormDataResidual { [key: string]: any; diff --git a/superset-frontend/packages/superset-ui-core/src/time-comparison/types.ts b/superset-frontend/packages/superset-ui-core/src/time-comparison/types.ts index 5c4f564be86..8fba188ac01 100644 --- a/superset-frontend/packages/superset-ui-core/src/time-comparison/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/time-comparison/types.ts @@ -30,14 +30,7 @@ export enum ComparisonTimeRangeType { } export type DateTimeGrainType = - | 'second' - | 'minute' - | 'hour' - | 'day' - | 'week' - | 'month' - | 'quarter' - | 'year'; + 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; export type CustomRangeKey = | 'sinceMode' diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx index 906bb8ad019..4c44433e4ae 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx @@ -30,8 +30,7 @@ const defaultMockLoadFormData = jest.fn(({ formData }: { formData: unknown }) => ); type MockLoadFormData = - | typeof defaultMockLoadFormData - | jest.Mock, unknown[]>; + typeof defaultMockLoadFormData | jest.Mock, unknown[]>; let mockLoadFormData: MockLoadFormData = defaultMockLoadFormData; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx index 3ef4ee27a40..a1a434c529d 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx @@ -80,8 +80,7 @@ function getQueryMode(controls: ControlStateMapping): QueryMode { return mode as QueryMode; } const rawColumns = controls?.all_columns?.value as - | QueryFormColumn[] - | undefined; + QueryFormColumn[] | undefined; const hasRawColumns = rawColumns && rawColumns.length > 0; return hasRawColumns ? QueryMode.Raw : QueryMode.Aggregate; } diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts index 18f109fed44..656f139e85a 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts @@ -753,8 +753,7 @@ const transformProps = ( // Strip saved filter from chartState after initial application to prevent re-injection let chartState = serverPaginationData?.chartState as - | AgGridChartState - | undefined; + AgGridChartState | undefined; const chartStateHasFilter = !!( chartState?.filterModel && Object.keys(chartState.filterModel).length > 0 ); diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/types.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/types.ts index 2c8fe982ea9..a82ec920ddc 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/types.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/types.ts @@ -189,10 +189,7 @@ export interface InputColumn { isPercentMetric: boolean; config: TableColumnConfig; formatter?: - | TimeFormatter - | NumberFormatter - | CustomFormatter - | CurrencyFormatter; + TimeFormatter | NumberFormatter | CustomFormatter | CurrencyFormatter; originalLabel?: string; metricName?: string; } diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx index 68c34b5f98e..f5b88edd35a 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/controlPanel.test.tsx @@ -47,8 +47,7 @@ const findConditionalFormattingControl = (): ControlConfig | null => { }; const findMetricsMapStateToProps = (): - | ControlConfig['mapStateToProps'] - | null => { + ControlConfig['mapStateToProps'] | null => { for (const section of config.controlPanelSections) { if (!section) continue; for (const row of section.controlSetRows) { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/types.ts index 622f8e2853b..612d28b7ca8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/types.ts @@ -42,11 +42,7 @@ export type BoxPlotFormDataWhiskerOptions = | '10/90 percentiles'; export type BoxPlotFormXTickLayout = - | '45°' - | '90°' - | 'auto' - | 'flat' - | 'staggered'; + '45°' | '90°' | 'auto' | 'flat' | 'staggered'; // @ts-expect-error export const DEFAULT_FORM_DATA: BoxPlotQueryFormData = { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx index c11d4dab16b..4a40efcaf44 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx @@ -221,8 +221,7 @@ const config: ControlPanelConfig = { return { queryResponse: chart?.queriesResponse?.[0] as - | ChartDataResponseResult - | undefined, + ChartDataResponseResult | undefined, appliedColumnNames: metricColumn, columnsPropsObject: { colnames, coltypes }, }; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts index a7a40ddaa07..8e4919e63fc 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts @@ -521,8 +521,7 @@ export function transformIntervalAnnotation( }); const allIntervalData: ( - | MarkArea1DDataItemOption - | MarkArea2DDataItemOption + MarkArea1DDataItemOption | MarkArea2DDataItemOption )[] = annotations.map(annotation => { const { intervalEnd, time = '' } = annotation; const combinedLabel = (intervalsByStartTime.get(time) || []).join('\n'); diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/types.ts index 9ca53991486..a8b70758df9 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/types.ts @@ -29,11 +29,7 @@ import type { CallbackDataParams } from 'echarts/types/src/util/types'; import { BaseTransformedProps, LegendFormData } from '../types'; export type WaterfallFormXTicksLayout = - | '45°' - | '90°' - | 'auto' - | 'flat' - | 'staggered'; + '45°' | '90°' | 'auto' | 'flat' | 'staggered'; export type ISeriesData = { originalValue?: number; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/legendLayout.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/legendLayout.ts index c4a8740e0c1..200efc71b98 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/legendLayout.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/legendLayout.ts @@ -21,11 +21,7 @@ import { LegendOrientation, LegendType } from '../types'; import { getLegendLayoutResult, LegendLayoutResult } from './series'; type LegendDataItem = - | string - | number - | null - | undefined - | { name?: string | number | null }; + string | number | null | undefined | { name?: string | number | null }; export type ResolvedLegendLayout = { effectiveLegendMargin?: string | number | null; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/safeEChartOptionsParser.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/safeEChartOptionsParser.ts index 528a602199b..3e9a4853292 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/safeEChartOptionsParser.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/safeEChartOptionsParser.ts @@ -46,9 +46,7 @@ import { */ export class EChartOptionsParseError extends Error { public readonly errorType: - | 'parse_error' - | 'security_error' - | 'validation_error'; + 'parse_error' | 'security_error' | 'validation_error'; public readonly validationErrors: string[]; @@ -57,9 +55,7 @@ export class EChartOptionsParseError extends Error { constructor( message: string, errorType: - | 'parse_error' - | 'security_error' - | 'validation_error' = 'parse_error', + 'parse_error' | 'security_error' | 'validation_error' = 'parse_error', validationErrors: string[] = [], location?: { line: number; column: number }, ) { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts index 535a310dcc5..d8c899be77a 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts @@ -73,11 +73,7 @@ const ESTIMATED_LEGEND_SELECTOR_WIDTH = 112; const LEGEND_TEXT_WIDTH_CACHE = new Map(); type LegendDataItem = - | string - | number - | null - | undefined - | { name?: string | number | null }; + string | number | null | undefined | { name?: string | number | null }; export type LegendLayoutResult = { effectiveMargin?: number; diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts index 1c2a09b5d50..00cc84ff11f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts @@ -968,11 +968,9 @@ test('should apply dashed line style to time comparison series with single metri const series = (transformed.echartOptions.series as SeriesOption[]) || []; const mainSeries = series.find(s => s.name === 'sum__num') as - | (SeriesOption & { lineStyle?: { type?: number[] | string } }) - | undefined; + (SeriesOption & { lineStyle?: { type?: number[] | string } }) | undefined; const comparisonSeries = series.find(s => s.name === '1 week ago') as - | (SeriesOption & { lineStyle?: { type?: number[] | string } }) - | undefined; + (SeriesOption & { lineStyle?: { type?: number[] | string } }) | undefined; expect(mainSeries).toBeDefined(); expect(comparisonSeries).toBeDefined(); @@ -1013,13 +1011,11 @@ test('should apply dashed line style to time comparison series with metric__offs const series = (transformed.echartOptions.series as SeriesOption[]) || []; const mainSeries = series.find(s => s.name === 'sum__num') as - | (SeriesOption & { lineStyle?: { type?: number[] | string } }) - | undefined; + (SeriesOption & { lineStyle?: { type?: number[] | string } }) | undefined; const comparisonSeries = series.find( s => s.name === 'sum__num__1 week ago', ) as - | (SeriesOption & { lineStyle?: { type?: number[] | string } }) - | undefined; + (SeriesOption & { lineStyle?: { type?: number[] | string } }) | undefined; expect(mainSeries).toBeDefined(); expect(comparisonSeries).toBeDefined(); @@ -1051,8 +1047,7 @@ test('should apply connectNulls to time comparison series', () => { const series = (transformed.echartOptions.series as SeriesOption[]) || []; const comparisonSeries = series.find(s => s.name === '1 week ago') as - | (SeriesOption & { connectNulls?: boolean }) - | undefined; + (SeriesOption & { connectNulls?: boolean }) | undefined; expect(comparisonSeries).toBeDefined(); expect(comparisonSeries?.connectNulls).toBe(true); diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts index 0817e2896b2..62489ee6b02 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts @@ -67,11 +67,7 @@ const { chartHeight: number; chartWidth: number; legendItems?: ( - | string - | number - | null - | undefined - | { name?: string | number | null } + string | number | null | undefined | { name?: string | number | null } )[]; legendMargin?: string | number | null; orientation: LegendOrientation; @@ -94,11 +90,7 @@ const { chartHeight: number; chartWidth: number; legendItems?: ( - | string - | number - | null - | undefined - | { name?: string | number | null } + string | number | null | undefined | { name?: string | number | null } )[]; legendMargin?: string | number | null; orientation: LegendOrientation; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts index 895e7f70d3e..7b6cf2155f9 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/shared.ts @@ -29,8 +29,7 @@ export function getQueryMode(controls: ControlStateMapping): QueryMode { return mode as QueryMode; } const rawColumns = controls?.all_columns?.value as - | QueryFormColumn[] - | undefined; + QueryFormColumn[] | undefined; const hasRawColumns = rawColumns && rawColumns.length > 0; return hasRawColumns ? QueryMode.Raw : QueryMode.Aggregate; } diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts index 0dccc885143..c845b24611a 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts @@ -900,8 +900,7 @@ class PivotData { props: Record; aggregator: (...args: unknown[]) => Aggregator; formattedAggregators: - | Record Aggregator>> - | false; + Record Aggregator>> | false; tree: Record>; rowKeys: string[][]; colKeys: string[][]; diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/types.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/types.ts index d154031397b..a13e52cd85f 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/types.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/types.ts @@ -42,9 +42,7 @@ export type FilterType = Record; export type SelectedFiltersType = Record; export type DateFormatter = - | TimeFormatter - | NumberFormatter - | ((value: DataRecordValue) => string); + TimeFormatter | NumberFormatter | ((value: DataRecordValue) => string); export enum MetricsLayoutEnum { ROWS = 'ROWS', COLUMNS = 'COLUMNS', diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index 159031e5caf..59a7faff912 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -1135,13 +1135,15 @@ export default function TableChart( text-align: ${sharedStyle.textAlign}; white-space: ${value instanceof Date ? 'nowrap' : undefined}; position: relative; - font-weight: ${color - ? `${theme.fontWeightBold}` - : `${theme.fontWeightNormal}`}; + font-weight: ${ + color ? `${theme.fontWeightBold}` : `${theme.fontWeightNormal}` + }; background: ${backgroundColor || undefined}; - padding-left: ${column.isChildColumn - ? `${theme.sizeUnit * 5}px` - : `${theme.sizeUnit}px`}; + padding-left: ${ + column.isChildColumn + ? `${theme.sizeUnit * 5}px` + : `${theme.sizeUnit}px` + }; `; const cellBarStyles = css` @@ -1149,10 +1151,11 @@ export default function TableChart( height: 100%; display: block; top: 0; - ${valueRange && - typeof value === 'number' && - valueRangeFlag && - ` + ${ + valueRange && + typeof value === 'number' && + valueRangeFlag && + ` width: ${`${cellWidth({ value: value as number, valueRange, @@ -1171,15 +1174,18 @@ export default function TableChart( theme, }) }; - `} + ` + } `; let arrowStyles = css` - color: ${basicColorFormatters && - basicColorFormatters[row.index][originKey]?.arrowColor === - ColorSchemeEnum.Green - ? theme.colorSuccess - : theme.colorError}; + color: ${ + basicColorFormatters && + basicColorFormatters[row.index][originKey]?.arrowColor === + ColorSchemeEnum.Green + ? theme.colorSuccess + : theme.colorError + }; margin-right: ${theme.sizeUnit}px; `; @@ -1188,10 +1194,12 @@ export default function TableChart( basicColorColumnFormatters?.length > 0 ) { arrowStyles = css` - color: ${basicColorColumnFormatters[row.index][column.key] - ?.arrowColor === ColorSchemeEnum.Green - ? theme.colorSuccess - : theme.colorError}; + color: ${ + basicColorColumnFormatters[row.index][column.key] + ?.arrowColor === ColorSchemeEnum.Green + ? theme.colorSuccess + : theme.colorError + }; margin-right: ${theme.sizeUnit}px; `; } diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx index 5a81e4ff526..3597dfb6f2e 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx @@ -66,8 +66,7 @@ function getQueryMode(controls: ControlStateMapping): QueryMode { return mode as QueryMode; } const rawColumns = controls?.all_columns?.value as - | QueryFormColumn[] - | undefined; + QueryFormColumn[] | undefined; const hasRawColumns = rawColumns && rawColumns.length > 0; return hasRawColumns ? QueryMode.Raw : QueryMode.Aggregate; } diff --git a/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx b/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx index 9c45037683f..7b276d432e0 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/controlPanel.test.tsx @@ -48,8 +48,7 @@ const findConditionalFormattingControl = (): ControlConfig | null => { }; const findMetricsMapStateToProps = (): - | ControlConfig['mapStateToProps'] - | null => { + ControlConfig['mapStateToProps'] | null => { for (const section of config.controlPanelSections) { if (!section) continue; for (const row of section.controlSetRows) { diff --git a/superset-frontend/plugins/preset-chart-deckgl/src/layers/Path/buildQuery.ts b/superset-frontend/plugins/preset-chart-deckgl/src/layers/Path/buildQuery.ts index da0d1449219..d5acef75dfc 100644 --- a/superset-frontend/plugins/preset-chart-deckgl/src/layers/Path/buildQuery.ts +++ b/superset-frontend/plugins/preset-chart-deckgl/src/layers/Path/buildQuery.ts @@ -36,8 +36,7 @@ export interface DeckPathFormData extends SqlaFormData { tooltip_contents?: unknown[]; tooltip_template?: string; line_width?: - | string - | { type?: 'fix' | 'metric'; value?: QueryFormMetric | number }; + string | { type?: 'fix' | 'metric'; value?: QueryFormMetric | number }; line_width_multiplier?: number; min_width?: number; max_width?: number; diff --git a/superset-frontend/plugins/preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx b/superset-frontend/plugins/preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx index 199e97c52ec..0712d451cb4 100644 --- a/superset-frontend/plugins/preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx +++ b/superset-frontend/plugins/preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx @@ -529,8 +529,7 @@ export const mapProvider = { options: getLabeledMapRendererOptions({ hasMapboxKey: hasKey, currentValue: state.form_data?.map_renderer as - | MapProvider - | undefined, + MapProvider | undefined, }), default: getDefaultMapRenderer(), }; diff --git a/superset-frontend/plugins/preset-chart-deckgl/src/utils/crossFiltersDataMask.ts b/superset-frontend/plugins/preset-chart-deckgl/src/utils/crossFiltersDataMask.ts index cbf8e20b64b..b599986a0a1 100644 --- a/superset-frontend/plugins/preset-chart-deckgl/src/utils/crossFiltersDataMask.ts +++ b/superset-frontend/plugins/preset-chart-deckgl/src/utils/crossFiltersDataMask.ts @@ -422,11 +422,7 @@ const getLineColumnFilters = ({ const obj = data.object ?? {}; const extraProps = (obj.extraProps ?? {}) as Record; const dimensionVal = (obj[col] ?? extraProps[col]) as - | string - | number - | boolean - | null - | undefined; + string | number | boolean | null | undefined; if (dimensionVal == null) { throw new Error( @@ -484,11 +480,7 @@ const getGeojsonFilters = ({ unknown >; const dimensionVal = properties[col] as - | string - | number - | boolean - | null - | undefined; + string | number | boolean | null | undefined; if (dimensionVal == null) { throw new Error( diff --git a/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx b/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx index cc37497145d..52c1dca2f0d 100644 --- a/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx +++ b/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx @@ -348,9 +348,9 @@ const TreeNodeRenderer: React.FC = ({ } diff --git a/superset-frontend/src/SqlLab/middlewares/persistSqlLabStateEnhancer.ts b/superset-frontend/src/SqlLab/middlewares/persistSqlLabStateEnhancer.ts index fdd7cbefe91..36103d5dffe 100644 --- a/superset-frontend/src/SqlLab/middlewares/persistSqlLabStateEnhancer.ts +++ b/superset-frontend/src/SqlLab/middlewares/persistSqlLabStateEnhancer.ts @@ -37,10 +37,7 @@ import { BYTES_PER_CHAR, KB_STORAGE } from '../constants'; type SqlLabState = SqlLabRootState['sqlLab']; type ClearEntityHelperValue = - | Table[] - | SqlLabState['queries'] - | QueryEditor[] - | UnsavedQueryEditor; + Table[] | SqlLabState['queries'] | QueryEditor[] | UnsavedQueryEditor; interface ClearEntityHelpersMap { tables: (tables: Table[]) => ReturnType; diff --git a/superset-frontend/src/SqlLab/reducers/sqlLab.ts b/superset-frontend/src/SqlLab/reducers/sqlLab.ts index b4b511c635a..c4593a73683 100644 --- a/superset-frontend/src/SqlLab/reducers/sqlLab.ts +++ b/superset-frontend/src/SqlLab/reducers/sqlLab.ts @@ -613,8 +613,7 @@ export default function sqlLabReducer( ? actionId : (( getFromArr(state.queryEditors, actionId, 'tabViewId') as - | QueryEditor - | undefined + QueryEditor | undefined )?.id ?? actionId); if ( unsavedQueryEditor?.id === normalizedId && diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts index 8c95a3a4a6a..1f3d79a5258 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts @@ -188,17 +188,21 @@ export const EmptyFolderDropZone = styled.div<{ margin-left: ${depth * FOLDER_INDENTATION_WIDTH + ITEM_INDENTATION_WIDTH}px; padding: ${theme.paddingLG}px; border: 2px dashed - ${isOver - ? isForbidden - ? theme.colorError - : theme.colorPrimary - : 'transparent'}; + ${ + isOver + ? isForbidden + ? theme.colorError + : theme.colorPrimary + : 'transparent' + }; border-radius: ${theme.borderRadius}px; - background: ${isOver - ? isForbidden - ? theme.colorErrorBg - : theme.colorPrimaryBg - : 'transparent'}; + background: ${ + isOver + ? isForbidden + ? theme.colorErrorBg + : theme.colorPrimaryBg + : 'transparent' + }; text-align: center; transition: all 0.2s ease-in-out; cursor: ${isOver && isForbidden ? 'not-allowed' : 'default'}; diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/treeUtils.ts b/superset-frontend/src/components/Datasource/FoldersEditor/treeUtils.ts index fbf89dbb6d3..5f2d24cb63d 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/treeUtils.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/treeUtils.ts @@ -305,8 +305,8 @@ export function serializeForAPI(items: TreeItem[]): DatasourceFolder[] { ( child, ): child is - | DatasourceFolder - | { uuid: string; type: FoldersEditorItemType } => child !== null, + DatasourceFolder | { uuid: string; type: FoldersEditorItemType } => + child !== null, ); }; diff --git a/superset-frontend/src/components/GridTable/Header.test.tsx b/superset-frontend/src/components/GridTable/Header.test.tsx index 0140fcfacdc..800bf31e493 100644 --- a/superset-frontend/src/components/GridTable/Header.test.tsx +++ b/superset-frontend/src/components/GridTable/Header.test.tsx @@ -210,7 +210,11 @@ test('does not attach click handler when enableSorting is false', () => { test('does not call progressSort on click when enableSorting is false', () => { const progressSort = jest.fn(); const { getByText } = render( -
, +
, ); fireEvent.click(getByText(mockedProps.displayName)); expect(progressSort).not.toHaveBeenCalled(); diff --git a/superset-frontend/src/components/ListView/Filters/CompactSelectPanel.tsx b/superset-frontend/src/components/ListView/Filters/CompactSelectPanel.tsx index cde60f9355f..74941e11c93 100644 --- a/superset-frontend/src/components/ListView/Filters/CompactSelectPanel.tsx +++ b/superset-frontend/src/components/ListView/Filters/CompactSelectPanel.tsx @@ -106,9 +106,9 @@ const OptionItem = styled.li<{ $active: boolean }>` transition: background 0.15s; &:hover { - background: ${$active - ? theme.colorPrimaryBgHover - : theme.colorFillTertiary}; + background: ${ + $active ? theme.colorPrimaryBgHover : theme.colorFillTertiary + }; outline: 2px solid ${theme.colorPrimary}; outline-offset: -2px; } diff --git a/superset-frontend/src/dashboard/actions/dashboardLayout.ts b/superset-frontend/src/dashboard/actions/dashboardLayout.ts index 192eaaeee86..829953f1a81 100644 --- a/superset-frontend/src/dashboard/actions/dashboardLayout.ts +++ b/superset-frontend/src/dashboard/actions/dashboardLayout.ts @@ -312,7 +312,7 @@ export function handleComponentDrop(dropResult: DropResult) { source && !( // ensure it has moved - (destination.id === source.id && destination.index === source.index) + destination.id === source.id && destination.index === source.index ) ) { dispatch(moveComponent(dropResult)); diff --git a/superset-frontend/src/dashboard/actions/dashboardState.ts b/superset-frontend/src/dashboard/actions/dashboardState.ts index 397e29a2d7f..f29688ad3f5 100644 --- a/superset-frontend/src/dashboard/actions/dashboardState.ts +++ b/superset-frontend/src/dashboard/actions/dashboardState.ts @@ -725,8 +725,7 @@ export function saveDashboardRequest( updatedBy: dashboard.changed_by_name as string, overwriteConfirmItems: overwriteConfirmItems as DashboardState['overwriteConfirmMetadata'] extends - | { overwriteConfirmItems: infer I } - | undefined + { overwriteConfirmItems: infer I } | undefined ? I : never, dashboardId: id, diff --git a/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx b/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx index acb5463fdc2..93992fbf3a1 100644 --- a/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx +++ b/superset-frontend/src/dashboard/components/AddSliceCard/AddSliceCard.tsx @@ -174,8 +174,7 @@ const AddSliceCard: FC<{ datasourceUrl?: string; datasourceName?: string; innerRef?: - | RefObject - | ((node: HTMLDivElement | null) => void); + RefObject | ((node: HTMLDivElement | null) => void); isSelected?: boolean; lastModified?: string; sliceName: string; diff --git a/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx b/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx index 39a33546cb9..7592423152c 100644 --- a/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx +++ b/superset-frontend/src/dashboard/components/AutoRefreshStatus/StatusIndicatorDot.tsx @@ -144,12 +144,14 @@ export const StatusIndicatorDot: FC = ({ background-color ${theme.motionDurationMid} ease-in-out, border-color ${theme.motionDurationMid} ease-in-out; border: ${statusConfig.needsBorder ? '1px solid' : 'none'}; - border-color: ${statusConfig.needsBorder - ? statusConfig.outlineColor - : 'transparent'}; - box-shadow: ${statusConfig.needsBorder - ? 'none' - : `0 0 0 2px ${theme.colorBgContainer}`}; + border-color: ${ + statusConfig.needsBorder ? statusConfig.outlineColor : 'transparent' + }; + box-shadow: ${ + statusConfig.needsBorder + ? 'none' + : `0 0 0 2px ${theme.colorBgContainer}` + }; margin-left: ${theme.marginXS}px; margin-right: ${theme.marginXS}px; cursor: help; diff --git a/superset-frontend/src/dashboard/components/Dashboard.tsx b/superset-frontend/src/dashboard/components/Dashboard.tsx index 410e9dec899..06f4204a6e9 100644 --- a/superset-frontend/src/dashboard/components/Dashboard.tsx +++ b/superset-frontend/src/dashboard/components/Dashboard.tsx @@ -53,9 +53,7 @@ import type { } from '../types'; type RelatedChartsFilter = - | AppliedNativeFilterType - | AppliedCrossFilterType - | Filter; + AppliedNativeFilterType | AppliedCrossFilterType | Filter; interface DashboardActions { addSliceToDashboard: (id: number, component: LayoutItem | undefined) => void; diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 86783cf3424..cd7ebc414f0 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -141,8 +141,9 @@ const DashboardContentWrapper = styled.div` & .dashboard-component-tabs { box-shadow: 0 ${theme.sizeUnit}px ${theme.sizeUnit}px 0 ${addAlpha(theme.colorBorderSecondary, 0.1)}; - padding-left: ${theme.sizeUnit * - 2}px; /* note this is added to tab-level padding, to match header */ + padding-left: ${ + theme.sizeUnit * 2 + }px; /* note this is added to tab-level padding, to match header */ } .dropdown-toggle.btn.btn-primary .caret { @@ -295,12 +296,14 @@ const StyledDashboardContent = styled.div<{ margin: ${theme.sizeUnit * 4}px; margin-left: ${marginLeft}px; - ${editMode && - ` + ${ + editMode && + ` max-width: calc(100% - ${ BUILDER_SIDEPANEL_WIDTH + theme.sizeUnit * 16 }px); - `} + ` + } /* this is the ParentSize wrapper */ & > div:first-of-type { @@ -337,8 +340,10 @@ const StyledDashboardContent = styled.div<{ } &.fade-out { - box-shadow: ${theme.dashboardTileBoxShadow ?? - `0 0 0 1px ${addAlpha(theme.colorBorder, 0.5)}`}; + box-shadow: ${ + theme.dashboardTileBoxShadow ?? + `0 0 0 1px ${addAlpha(theme.colorBorder, 0.5)}` + }; } & .missing-chart-container { diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx index d941b9f2324..eed56be697c 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx @@ -75,8 +75,7 @@ const defaultTestFilter = { function createTestState(overrides: Record = {}) { const nativeFilterConfig = ( overrides.dashboardInfo as - | { metadata?: { native_filter_configuration?: unknown[] } } - | undefined + { metadata?: { native_filter_configuration?: unknown[] } } | undefined )?.metadata?.native_filter_configuration ?? [defaultTestFilter]; const nativeFiltersMap: Record = {}; diff --git a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx index 4d3023e72d5..2f41307ab11 100644 --- a/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx +++ b/superset-frontend/src/dashboard/components/dnd/DragHandle.tsx @@ -30,10 +30,12 @@ const DragHandleContainer = styled.div<{ position: 'left' | 'top' }>` height: ${theme.sizeUnit * 5}px; overflow: hidden; cursor: move; - ${position === 'top' && - css` - transform: rotate(90deg); - `} + ${ + position === 'top' && + css` + transform: rotate(90deg); + ` + } & path { fill: ${theme.colorIcon}; } diff --git a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx index 3e6be60d9bd..c49aff42b1b 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx @@ -537,8 +537,7 @@ const Chart = (props: ChartProps) => { actualRowCount = (queriesResponse![0] as JsonObject).rowcount as number; } else { actualRowCount = (exportFormData as JsonObject)?.row_limit as - | number - | undefined; + number | undefined; } // Handle streaming CSV exports based on row threshold diff --git a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx index 44133f90f65..04a318770ac 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Header/Header.tsx @@ -43,13 +43,10 @@ export type ComponentType = (typeof componentTypes)[keyof typeof componentTypes]; export type HeaderStyleValue = - | typeof SMALL_HEADER - | typeof MEDIUM_HEADER - | typeof LARGE_HEADER; + typeof SMALL_HEADER | typeof MEDIUM_HEADER | typeof LARGE_HEADER; export type BackgroundStyleValue = - | typeof BACKGROUND_TRANSPARENT - | typeof BACKGROUND_WHITE; + typeof BACKGROUND_TRANSPARENT | typeof BACKGROUND_WHITE; export interface ComponentMeta { width?: number; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx index 7b0c671000b..73dc306152b 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/ActionButtons/index.tsx @@ -46,32 +46,36 @@ const ButtonsContainer = styled.div<{ isVertical: boolean }>` ${({ theme, isVertical }) => css` display: flex; - ${isVertical - ? css` - flex-direction: column; - align-items: center; - position: sticky; - z-index: 100; - bottom: 0; - padding: ${theme.sizeUnit * 4}px; - padding-top: ${theme.sizeUnit * 6}px; - background: linear-gradient( - ${tinycolor(theme.colorBgLayout).setAlpha(0).toRgbString()}, - ${theme.colorBgContainer} 20% - ); - ` - : css` - align-items: center; - margin-left: auto; - `} + ${ + isVertical + ? css` + flex-direction: column; + align-items: center; + position: sticky; + z-index: 100; + bottom: 0; + padding: ${theme.sizeUnit * 4}px; + padding-top: ${theme.sizeUnit * 6}px; + background: linear-gradient( + ${tinycolor(theme.colorBgLayout).setAlpha(0).toRgbString()}, + ${theme.colorBgContainer} 20% + ); + ` + : css` + align-items: center; + margin-left: auto; + ` + } `} `; const applyButtonStyle = (theme: SupersetTheme, isVertical: boolean) => css` - ${isVertical && - css` - margin-bottom: ${theme.sizeUnit * 3}px; - `} + ${ + isVertical && + css` + margin-bottom: ${theme.sizeUnit * 3}px; + ` + } `; const clearAllButtonStyle = (theme: SupersetTheme, isVertical: boolean) => css` @@ -88,11 +92,13 @@ const clearAllButtonStyle = (theme: SupersetTheme, isVertical: boolean) => css` color: ${theme.colorTextDisabled}; } - ${!isVertical && - css` - text-transform: capitalize; - font-weight: ${theme.fontWeightNormal}; - `} + ${ + !isVertical && + css` + text-transform: capitalize; + font-weight: ${theme.fontWeightNormal}; + ` + } } `; diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx index fd43a6b4beb..6083db0380e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilter.tsx @@ -63,14 +63,16 @@ const CrossFilter = (props: {
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx index 81b76579579..44467a356f9 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTag.tsx @@ -67,13 +67,15 @@ const CrossFilterTag = (props: { return ( removeCrossFilter(filter.emitterId)} diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx index 459551f125b..f6a97bee95d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/CrossFilterTitle.tsx @@ -63,9 +63,11 @@ const CrossFilterChartTitle = (props: { void) - | null; + ((s: { overflowed: string[]; notOverflowed: string[] }) => void) | null; } = { current: null }; // Mock the DropdownContainer subpath rather than the barrel diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/UrlFilters/UrlFilterTag.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/UrlFilters/UrlFilterTag.tsx index 0371deb9997..432e5b13978 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/UrlFilters/UrlFilterTag.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/UrlFilters/UrlFilterTag.tsx @@ -64,9 +64,11 @@ const UrlFilterTag = (props: { return ( onRemove(filter)} diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx index 70705dab529..bb79657a54a 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx @@ -1898,10 +1898,12 @@ const FiltersConfigForm = ( iconSize="xl" iconColor={theme.colorPrimary} css={css` - margin-left: ${theme.sizeUnit * - 2}px; - margin-top: ${theme.sizeUnit * - 1.5}px; + margin-left: ${ + theme.sizeUnit * 2 + }px; + margin-top: ${ + theme.sizeUnit * 1.5 + }px; `} onClick={() => refreshHandler(true)} /> diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useItemStateManager.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useItemStateManager.ts index de783d13782..e03e5b086bc 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useItemStateManager.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useItemStateManager.ts @@ -44,8 +44,7 @@ export interface ItemStateManager { renderedIds: string[]; setChanges: ( changes: - | FilterChangesType - | ((prev: FilterChangesType) => FilterChangesType), + FilterChangesType | ((prev: FilterChangesType) => FilterChangesType), ) => void; setNewIds: (ids: string[]) => void; setRemovedItems: ( diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts index 5894c30cdf1..3cd2d8a684d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useModalSaveLogic.ts @@ -329,8 +329,7 @@ export function useModalSaveLogic({ ), ) .filter(Boolean) as ( - | ChartCustomization - | ChartCustomizationDivider + ChartCustomization | ChartCustomizationDivider )[]; saveChanges.customizationChanges = { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/customizationTransformer.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/customizationTransformer.ts index 4c5c8f9f8fd..818c7a84f2b 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/customizationTransformer.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/customizationTransformer.ts @@ -42,16 +42,12 @@ type CustomizationFormInput = | Divider; type ChartCustomizationFormOrSaved = - | ChartCustomizationsFormItem - | ChartCustomization; + ChartCustomizationsFormItem | ChartCustomization; function isFilterType( formInputs: CustomizationFormInput, ): formInputs is - | NativeFiltersFormItem - | NativeFilterDivider - | Filter - | Divider { + NativeFiltersFormItem | NativeFilterDivider | Filter | Divider { return ( 'type' in formInputs && (formInputs.type === NativeFilterType.NativeFilter || diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/filterTransformer.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/filterTransformer.ts index 575d6baebe9..d2cceb9646e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/filterTransformer.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/filterTransformer.ts @@ -47,9 +47,7 @@ type NativeFilterFormOrSaved = NativeFiltersFormItem | Filter; function isCustomizationType( formInputs: FilterFormInput, ): formInputs is - | ChartCustomizationsFormItem - | ChartCustomization - | ChartCustomizationDivider { + ChartCustomizationsFormItem | ChartCustomization | ChartCustomizationDivider { return ( 'type' in formInputs && (formInputs.type === ChartCustomizationType.ChartCustomization || diff --git a/superset-frontend/src/dashboard/components/nativeFilters/state.ts b/superset-frontend/src/dashboard/components/nativeFilters/state.ts index af2b87a8076..046457f28c4 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/state.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/state.ts @@ -54,10 +54,7 @@ export const selectFilterConfiguration: ( return nativeFilterConfig.filter( ( filter: - | Filter - | Divider - | ChartCustomization - | ChartCustomizationDivider, + Filter | Divider | ChartCustomization | ChartCustomizationDivider, ) => filter.type !== 'CHART_CUSTOMIZATION' && filter.type !== 'CHART_CUSTOMIZATION_DIVIDER', @@ -387,12 +384,10 @@ export function useSelectCustomizationsInScope( return useMemo(() => { let customizationsInScope: ( - | ChartCustomization - | ChartCustomizationDivider + ChartCustomization | ChartCustomizationDivider )[] = []; const customizationsOutOfScope: ( - | ChartCustomization - | ChartCustomizationDivider + ChartCustomization | ChartCustomizationDivider )[] = []; // we check customization scopes only on dashboards with tabs diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx index 516b04ba786..6baf36d437a 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -221,8 +221,7 @@ export const DashboardPage: FC = ({ idOrSlug }: PageProps) => { if (permalinkValue?.state) { ({ dataMask, activeTabs, anchor } = permalinkValue.state); chartStates = permalinkValue.state.chartStates as - | DashboardChartStates - | undefined; + DashboardChartStates | undefined; } } else if (nativeFilterKeyValue) { dataMask = await getFilterValue(id, nativeFilterKeyValue); diff --git a/superset-frontend/src/dashboard/reducers/dashboardInfo.ts b/superset-frontend/src/dashboard/reducers/dashboardInfo.ts index 26c919f01b3..1ea0c88b495 100644 --- a/superset-frontend/src/dashboard/reducers/dashboardInfo.ts +++ b/superset-frontend/src/dashboard/reducers/dashboardInfo.ts @@ -66,8 +66,7 @@ export interface HydrateDashboardInfoAction { } type DashboardInfoReducerAction = - | DashboardInfoAction - | HydrateDashboardInfoAction; + DashboardInfoAction | HydrateDashboardInfoAction; type DashboardInfoState = Partial & { last_modified_time?: number; diff --git a/superset-frontend/src/dashboard/reducers/nativeFilters.ts b/superset-frontend/src/dashboard/reducers/nativeFilters.ts index 37f406dbaf6..e769864d2c5 100644 --- a/superset-frontend/src/dashboard/reducers/nativeFilters.ts +++ b/superset-frontend/src/dashboard/reducers/nativeFilters.ts @@ -114,10 +114,7 @@ export default function nativeFilterReducer( const existingFilters = state.filters; type FilterType = - | Filter - | Divider - | ChartCustomization - | ChartCustomizationDivider; + Filter | Divider | ChartCustomization | ChartCustomizationDivider; const mergedFilters: Record = {}; Object.entries(incomingFilters).forEach(([id, incomingFilter]) => { diff --git a/superset-frontend/src/dashboard/types.ts b/superset-frontend/src/dashboard/types.ts index da2eee81525..cec314a88b3 100644 --- a/superset-frontend/src/dashboard/types.ts +++ b/superset-frontend/src/dashboard/types.ts @@ -187,8 +187,7 @@ export type DashboardInfo = { map_label_colors: JsonObject; cross_filters_enabled: boolean; chart_customization_config?: ( - | ChartCustomization - | ChartCustomizationDivider + ChartCustomization | ChartCustomizationDivider )[]; timed_refresh_immune_slices?: number[]; refresh_frequency?: number; diff --git a/superset-frontend/src/dashboard/util/risonFilters.ts b/superset-frontend/src/dashboard/util/risonFilters.ts index 9aa1678c21e..ba798459b2e 100644 --- a/superset-frontend/src/dashboard/util/risonFilters.ts +++ b/superset-frontend/src/dashboard/util/risonFilters.ts @@ -273,11 +273,7 @@ export function risonFiltersToString(filters: RisonFilter[]): string { } type RisonValue = - | string - | number - | boolean - | (string | number)[] - | Record; + string | number | boolean | (string | number)[] | Record; const risonObject: Record = {}; const notObject: Record = {}; diff --git a/superset-frontend/src/dataMask/reducer.ts b/superset-frontend/src/dataMask/reducer.ts index 6f69d6bec78..0d484d3c707 100644 --- a/superset-frontend/src/dataMask/reducer.ts +++ b/superset-frontend/src/dataMask/reducer.ts @@ -126,7 +126,7 @@ function fillNativeFilters( !( // Treat all-null arrays (range filters use [null, null] as their // canonical cleared value) and empty arrays as "no value". - (Array.isArray(loadedValue) && loadedValue.every(v => v === null)) + Array.isArray(loadedValue) && loadedValue.every(v => v === null) ); const loadedHasExtraFormData = !!loaded?.extraFormData && Object.keys(loaded.extraFormData).length > 0; diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts b/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts index c77a7fe408a..0f42e232baa 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/types.ts @@ -29,7 +29,9 @@ import { ControlFormItemComponents } from './ControlForm'; * Column formatting configs. */ export type ColumnConfig = { - [key in SharedColumnConfigProp]?: (typeof SHARED_COLUMN_CONFIG_PROPS)[key]['value']; + [ + key in SharedColumnConfigProp + ]?: (typeof SHARED_COLUMN_CONFIG_PROPS)[key]['value']; } & Record; /** diff --git a/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts b/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts index e06c5409cce..cdc016c63ce 100644 --- a/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DateFilterControl/types.ts @@ -22,22 +22,10 @@ export type SelectOptionType = { }; export type FrameType = - | 'Common' - | 'Calendar' - | 'Current' - | 'Custom' - | 'Advanced' - | 'No filter'; + 'Common' | 'Calendar' | 'Current' | 'Custom' | 'Advanced' | 'No filter'; export type DateTimeGrainType = - | 'second' - | 'minute' - | 'hour' - | 'day' - | 'week' - | 'month' - | 'quarter' - | 'year'; + 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; export type CustomRangeKey = | 'sinceMode' @@ -72,11 +60,7 @@ export type CustomRangeDecodeType = { }; export type CommonRangeType = - | 'Last day' - | 'Last week' - | 'Last month' - | 'Last quarter' - | 'Last year'; + 'Last day' | 'Last week' | 'Last month' | 'Last quarter' | 'Last year'; export const PreviousCalendarWeek = 'previous calendar week'; export const PreviousCalendarMonth = 'previous calendar month'; diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx index 01ef9f6ce1f..098899c3897 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx @@ -229,8 +229,7 @@ function AdhocFilterEditPopover({ loadLayerOptions(0, 100).then(result => { setLayerOptions(result.data); const layerFilterScope = propsAdhocFilter?.layerFilterScope as - | number[] - | undefined; + number[] | undefined; if (layerFilterScope) { const layers = layerFilterScope .map(item => result.data.find(option => option.value === item)) diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx index 0c66026f8e1..e464fe55cfa 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx @@ -83,10 +83,7 @@ export interface MetricColumnType { } export type ColumnType = - | ColumnMeta - | SimpleExpressionType - | SQLExpressionType - | MetricColumnType; + ColumnMeta | SimpleExpressionType | SQLExpressionType | MetricColumnType; export interface Props { adhocFilter: AdhocFilter; diff --git a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx index f59c00704c7..60dbec50f62 100644 --- a/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx +++ b/superset-frontend/src/explore/components/controls/LayerConfigsControl/LayerConfigsPopoverContent.tsx @@ -301,8 +301,7 @@ export const LayerConfigsPopoverContent: FC< const wfsParser = new WfsDataParser(); try { let requestParams: RequestParams1_1_0 | RequestParams2_0_0 = {} as - | RequestParams1_1_0 - | RequestParams2_0_0; + RequestParams1_1_0 | RequestParams2_0_0; if (conf.version.startsWith('1.')) { requestParams = { version: conf.version as RequestParams1_1_0['version'], diff --git a/superset-frontend/src/explore/components/controls/SelectControl.tsx b/superset-frontend/src/explore/components/controls/SelectControl.tsx index 9587fa43453..c07627fefe2 100644 --- a/superset-frontend/src/explore/components/controls/SelectControl.tsx +++ b/superset-frontend/src/explore/components/controls/SelectControl.tsx @@ -102,8 +102,7 @@ export const areAllValuesNumbers = ( }; type SortComparator = - | ((a: SelectOption, b: SelectOption) => number) - | undefined; + ((a: SelectOption, b: SelectOption) => number) | undefined; export const getSortComparator = ( choices: unknown[] | undefined, diff --git a/superset-frontend/src/explore/components/controls/TextAreaControl.tsx b/superset-frontend/src/explore/components/controls/TextAreaControl.tsx index 753b6fd8e73..64afeb0103d 100644 --- a/superset-frontend/src/explore/components/controls/TextAreaControl.tsx +++ b/superset-frontend/src/explore/components/controls/TextAreaControl.tsx @@ -47,23 +47,11 @@ interface TextAreaControlProps { maxLines?: number; offerEditInModal?: boolean; language?: - | 'json' - | 'html' - | 'sql' - | 'markdown' - | 'javascript' - | 'handlebars' - | null; + 'json' | 'html' | 'sql' | 'markdown' | 'javascript' | 'handlebars' | null; aboveEditorSection?: React.ReactNode; readOnly?: boolean; resize?: - | 'block' - | 'both' - | 'horizontal' - | 'inline' - | 'none' - | 'vertical' - | null; + 'block' | 'both' | 'horizontal' | 'inline' | 'none' | 'vertical' | null; textAreaStyles?: React.CSSProperties; tooltipOptions?: Record; hotkeys?: HotkeyConfig[]; diff --git a/superset-frontend/src/explore/components/controls/VerticalRadioControl.tsx b/superset-frontend/src/explore/components/controls/VerticalRadioControl.tsx index ee382d7faf9..306706878c8 100644 --- a/superset-frontend/src/explore/components/controls/VerticalRadioControl.tsx +++ b/superset-frontend/src/explore/components/controls/VerticalRadioControl.tsx @@ -86,9 +86,11 @@ export default function VerticalRadioControl({ css={css` margin-left: 4px; font-size: 12px; - color: ${disabled - ? theme.colorTextDisabled - : theme.colorTextTertiary}; + color: ${ + disabled + ? theme.colorTextDisabled + : theme.colorTextTertiary + }; cursor: help; `} /> diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx index 42b750e4925..19a42490f31 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTile.tsx @@ -97,30 +97,34 @@ export const VizTile = ({ white-space: nowrap; overflow: hidden; max-width: fit-content; - ${!isActive && - css` - flex-shrink: 0; - width: ${theme.sizeUnit * 6}px; - background-color: transparent; - transition: none; - &:hover svg path { - fill: ${theme.colorPrimary}; - transition: fill ${theme.motionDurationMid} ease-out; - } - `} + ${ + !isActive && + css` + flex-shrink: 0; + width: ${theme.sizeUnit * 6}px; + background-color: transparent; + transition: none; + &:hover svg path { + fill: ${theme.colorPrimary}; + transition: fill ${theme.motionDurationMid} ease-out; + } + ` + } - ${isActive && - css` - width: 100%; - background-color: ${theme.colorBgLayout}; - transition: - width ${TILE_TRANSITION_TIME} ease-out, - background-color ${TILE_TRANSITION_TIME} ease-out; - cursor: default; - svg path { - fill: ${theme.colorPrimary}; - } - `} + ${ + isActive && + css` + width: 100%; + background-color: ${theme.colorBgLayout}; + transition: + width ${TILE_TRANSITION_TIME} ease-out, + background-color ${TILE_TRANSITION_TIME} ease-out; + cursor: default; + svg path { + fill: ${theme.colorPrimary}; + } + ` + } `} > void, ownState: OwnStateWithClientView | undefined, dashboards: - | NonNullable['dashboards'] - | undefined, + NonNullable['dashboards'] | undefined, showReportModal: () => void, setCurrentReportDeleting: Dispatch>, ...rest: MenuProps[] diff --git a/superset-frontend/src/explore/controlUtils/standardizedFormData.ts b/superset-frontend/src/explore/controlUtils/standardizedFormData.ts index be65ecb7699..0ff3dc9335b 100644 --- a/superset-frontend/src/explore/controlUtils/standardizedFormData.ts +++ b/superset-frontend/src/explore/controlUtils/standardizedFormData.ts @@ -167,8 +167,7 @@ export class StandardizedFormData { controlsState: Record, ): void { const control = controlsState?.time_compare as - | { value?: unknown; choices?: unknown } - | undefined; + { value?: unknown; choices?: unknown } | undefined; if (!control || !Array.isArray(control.value)) { return; } diff --git a/superset-frontend/src/explore/types.ts b/superset-frontend/src/explore/types.ts index 63b3401b653..da0cec9815f 100644 --- a/superset-frontend/src/explore/types.ts +++ b/superset-frontend/src/explore/types.ts @@ -41,11 +41,7 @@ export enum ChartStatusType { } export type ChartStatus = - | 'loading' - | 'rendered' - | 'failed' - | 'stopped' - | 'success'; + 'loading' | 'rendered' | 'failed' | 'stopped' | 'success'; export interface ChartState { id: number; diff --git a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx index 06b10f11e30..f1649816e7c 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx @@ -694,7 +694,9 @@ test('open chart button opens explore with slice_id', async () => { }); expect(openChartButton).toBeInTheDocument(); - const navSpy = jest.spyOn(navigationUtils, 'navigateTo').mockImplementation(() => null); + const navSpy = jest + .spyOn(navigationUtils, 'navigateTo') + .mockImplementation(() => null); try { await userEvent.click(openChartButton); expect(navSpy).toHaveBeenCalledWith( @@ -721,7 +723,9 @@ test('open dashboard button opens dashboard url', async () => { }); expect(openDashButton).toBeInTheDocument(); - const navSpy = jest.spyOn(navigationUtils, 'navigateTo').mockImplementation(() => null); + const navSpy = jest + .spyOn(navigationUtils, 'navigateTo') + .mockImplementation(() => null); try { await userEvent.click(openDashButton); expect(navSpy).toHaveBeenCalledWith( diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index 67cf34e1b98..4b38efcfaab 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -1625,12 +1625,7 @@ const AlertReportModal: FunctionComponent = ({ const onChangeDashboardFilterValue = ( idx: number, filterValues: - | SelectValue - | SelectValue[] - | string - | string[] - | number - | number[], + SelectValue | SelectValue[] | string | string[] | number | number[], ) => { let values: any; if (typeof filterValues === 'string') { @@ -1799,12 +1794,10 @@ const AlertReportModal: FunctionComponent = ({ }; const validateContentSection = () => { const errors = []; - if ( - !( - (contentType === ContentType.Dashboard && !!currentAlert?.dashboard) || - (contentType === ContentType.Chart && !!currentAlert?.chart) - ) - ) { + if (!( + (contentType === ContentType.Dashboard && !!currentAlert?.dashboard) || + (contentType === ContentType.Chart && !!currentAlert?.chart) + )) { errors.push(TRANSLATIONS.CONTENT_ERROR_TEXT); } @@ -1839,13 +1832,11 @@ const AlertReportModal: FunctionComponent = ({ if (!currentAlert?.sql?.length) { errors.push(TRANSLATIONS.SQL_ERROR_TEXT); } - if ( - !( - (conditionNotNull || !!currentAlert?.validator_config_json?.op) && - (conditionNotNull || - currentAlert?.validator_config_json?.threshold !== undefined) - ) - ) { + if (!( + (conditionNotNull || !!currentAlert?.validator_config_json?.op) && + (conditionNotNull || + currentAlert?.validator_config_json?.threshold !== undefined) + )) { errors.push(TRANSLATIONS.ALERT_CONDITION_ERROR_TEXT); } updateValidationStatus(Sections.Alert, errors); diff --git a/superset-frontend/src/features/databases/UploadDataModel/index.tsx b/superset-frontend/src/features/databases/UploadDataModel/index.tsx index 91d20aa20a0..eb28e9877f5 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/index.tsx +++ b/superset-frontend/src/features/databases/UploadDataModel/index.tsx @@ -439,13 +439,10 @@ const UploadDataModal: FunctionComponent = ({ const appendFormData = (formData: FormData, data: Record) => { const allFieldsNotInType = getAllFieldsNotInType(); Object.entries(data).forEach(([key, value]) => { - if ( - !( - allFieldsNotInType.includes(key) || - (NonNullFields.includes(key) && - (value === undefined || value === null)) - ) - ) { + if (!( + allFieldsNotInType.includes(key) || + (NonNullFields.includes(key) && (value === undefined || value === null)) + )) { formData.append(key, value); } }); diff --git a/superset-frontend/src/features/databases/types.ts b/superset-frontend/src/features/databases/types.ts index 162980f7f81..fcb5302e73f 100644 --- a/superset-frontend/src/features/databases/types.ts +++ b/superset-frontend/src/features/databases/types.ts @@ -282,8 +282,7 @@ type CustomHTMLTextAreaElement = Omit< CustomTextType; export type CustomParametersChangeType = - | FormEvent - | { target: T }; + FormEvent | { target: T }; export type CustomEventHandlerType = EventHandler< ChangeEvent diff --git a/superset-frontend/src/features/home/ActivityTable.tsx b/superset-frontend/src/features/home/ActivityTable.tsx index e71006a3adb..7cce8a0bc32 100644 --- a/superset-frontend/src/features/home/ActivityTable.tsx +++ b/superset-frontend/src/features/home/ActivityTable.tsx @@ -48,11 +48,7 @@ interface RecentDashboard extends RecentActivity { * Recent activity objects fetched by `getRecentActivityObjs`. */ type ActivityObject = - | RecentSlice - | RecentDashboard - | Chart - | Dashboard - | SavedQueryObject; + RecentSlice | RecentDashboard | Chart | Dashboard | SavedQueryObject; interface ActivityProps { user: { diff --git a/superset-frontend/src/features/home/RightMenu.tsx b/superset-frontend/src/features/home/RightMenu.tsx index a9296a3498d..352e3c807ff 100644 --- a/superset-frontend/src/features/home/RightMenu.tsx +++ b/superset-frontend/src/features/home/RightMenu.tsx @@ -104,10 +104,12 @@ const StyledMenuItem = styled.div<{ disabled?: boolean }>` color: ${!disabled && theme.colorPrimary}; cursor: ${!disabled ? 'pointer' : 'not-allowed'}; } - ${disabled && - css` - color: ${theme.colorTextDisabled}; - `} + ${ + disabled && + css` + color: ${theme.colorTextDisabled}; + ` + } `} `; diff --git a/superset-frontend/src/middleware/loggerMiddleware.ts b/superset-frontend/src/middleware/loggerMiddleware.ts index b16c75503df..6097572cc20 100644 --- a/superset-frontend/src/middleware/loggerMiddleware.ts +++ b/superset-frontend/src/middleware/loggerMiddleware.ts @@ -34,11 +34,7 @@ import type { DashboardInfo, DashboardLayoutState } from '../dashboard/types'; import type { QueryEditor } from '../SqlLab/types'; type LogEventSource = - | 'dashboard' - | 'embedded_dashboard' - | 'explore' - | 'sqlLab' - | 'slice'; + 'dashboard' | 'embedded_dashboard' | 'explore' | 'sqlLab' | 'slice'; interface LogEventData { source?: LogEventSource; diff --git a/superset-frontend/src/pages/Chart/index.tsx b/superset-frontend/src/pages/Chart/index.tsx index d1e3f7b8f75..d5b52e06970 100644 --- a/superset-frontend/src/pages/Chart/index.tsx +++ b/superset-frontend/src/pages/Chart/index.tsx @@ -303,8 +303,7 @@ export default function ExplorePage() { useEffect(() => { const unlisten = history.listen((loc: Location, action: Action) => { const saveAction = (loc.state as Record)?.saveAction as - | SaveActionType - | undefined; + SaveActionType | undefined; if (action === 'PUSH' || action === 'POP') { setIsLoaded(false); loadExploreData(loc, saveAction); diff --git a/superset-frontend/src/pages/FileHandler/FileHandler.subdirectory.test.tsx b/superset-frontend/src/pages/FileHandler/FileHandler.subdirectory.test.tsx index f7d1942f850..40c8a4c469d 100644 --- a/superset-frontend/src/pages/FileHandler/FileHandler.subdirectory.test.tsx +++ b/superset-frontend/src/pages/FileHandler/FileHandler.subdirectory.test.tsx @@ -145,8 +145,8 @@ const MAX_CONSUMER_POLL_ATTEMPTS = 50; // setTimeout, and inline consumer calls deadlock Jest). const setupLaunchQueue = (fileHandle: MockFileHandle | null = null) => { let savedConsumer: - | ((params: { files?: MockFileHandle[] }) => void | Promise) - | null = null; + ((params: { files?: MockFileHandle[] }) => void | Promise) | null = + null; (window as unknown as Window & { launchQueue: LaunchQueue }).launchQueue = { setConsumer: (consumer: (params: { files?: MockFileHandle[] }) => void) => { savedConsumer = consumer; diff --git a/superset-frontend/src/pages/FileHandler/index.test.tsx b/superset-frontend/src/pages/FileHandler/index.test.tsx index b51149daaa0..18d66bce3e7 100644 --- a/superset-frontend/src/pages/FileHandler/index.test.tsx +++ b/superset-frontend/src/pages/FileHandler/index.test.tsx @@ -124,8 +124,8 @@ const consumerPromises: Promise[] = []; // MessageChannel mock in jsDomWithFetchAPI forces React to schedule via setTimeout. const setupLaunchQueue = (fileHandle: MockFileHandle | null = null) => { let savedConsumer: - | ((params: { files?: MockFileHandle[] }) => void | Promise) - | null = null; + ((params: { files?: MockFileHandle[] }) => void | Promise) | null = + null; (window as unknown as Window & { launchQueue: LaunchQueue }).launchQueue = { setConsumer: (consumer: (params: { files?: MockFileHandle[] }) => void) => { savedConsumer = consumer; diff --git a/superset-frontend/src/views/CRUD/types.ts b/superset-frontend/src/views/CRUD/types.ts index dce68699370..908094221fe 100644 --- a/superset-frontend/src/views/CRUD/types.ts +++ b/superset-frontend/src/views/CRUD/types.ts @@ -135,12 +135,7 @@ export enum QueryObjectColumns { } export type ImportResourceName = - | 'chart' - | 'dashboard' - | 'database' - | 'dataset' - | 'saved_query' - | 'theme'; + 'chart' | 'dashboard' | 'database' | 'dataset' | 'saved_query' | 'theme'; export interface Tag { changed_on_delta_humanized: string;