diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts index 01dc4b34952..b409aa06d0a 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts @@ -59,13 +59,6 @@ import { import { DASHBOARD_LIST } from '../dashboard_list/dashboard_list.helper'; import { CHART_LIST } from '../chart_list/chart_list.helper'; -const getTestTitle = ( - test: Mocha.Suite = (Cypress as any).mocha.getRunner().suite.ctx.test, -): string => - test.parent?.title - ? `${getTestTitle(test.parent)} -- ${test.title}` - : test.title; - // TODO: fix flaky init logic and re-enable const milliseconds = new Date().getTime(); const dashboard = `Test Dashboard${milliseconds}`; diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js b/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js index b0e9d1141cd..3c815a222ce 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/save.test.js @@ -36,7 +36,7 @@ describe('Dashboard save action', () => { beforeEach(() => { cy.login(); cy.visit(WORLD_HEALTH_DASHBOARD); - cy.get('#app').then(data => { + cy.get('#app').then(() => { cy.get('.dashboard-header-container').then(headerContainerElement => { const dashboardId = headerContainerElement.attr('data-test-id'); @@ -57,7 +57,7 @@ describe('Dashboard save action', () => { // change to what the title should be it('should save as new dashboard', () => { - cy.wait('@copyRequest').then(xhr => { + cy.wait('@copyRequest').then(() => { cy.get('[data-test="editable-title"]').then(element => { const dashboardTitle = element.attr('title'); expect(dashboardTitle).to.not.equal(`World Bank's Data`); diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/contributionOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/contributionOperator.ts index 484117c44fc..39fa9c44337 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/contributionOperator.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/contributionOperator.ts @@ -19,6 +19,7 @@ import { PostProcessingContribution } from '@superset-ui/core'; import { PostProcessingFactory } from './types'; +/* eslint-disable @typescript-eslint/no-unused-vars */ export const contributionOperator: PostProcessingFactory = (formData, queryObject) => { if (formData.contributionMode) { diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/flattenOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/flattenOperator.ts index 2fe732fc83d..d5aa4ab186b 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/flattenOperator.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/flattenOperator.ts @@ -19,6 +19,7 @@ import { PostProcessingFlatten } from '@superset-ui/core'; import { PostProcessingFactory } from './types'; +/* eslint-disable @typescript-eslint/no-unused-vars */ export const flattenOperator: PostProcessingFactory = ( formData, queryObject, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/prophetOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/prophetOperator.ts index a55c8d3d9e4..ff0fa0fb654 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/prophetOperator.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/prophetOperator.ts @@ -23,6 +23,7 @@ import { } from '@superset-ui/core'; import { PostProcessingFactory } from './types'; +/* eslint-disable @typescript-eslint/no-unused-vars */ export const prophetOperator: PostProcessingFactory = ( formData, queryObject, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/resampleOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/resampleOperator.ts index 2306ea38f92..b157a054d13 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/resampleOperator.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/resampleOperator.ts @@ -20,6 +20,7 @@ import { PostProcessingResample } from '@superset-ui/core'; import { PostProcessingFactory } from './types'; +/* eslint-disable @typescript-eslint/no-unused-vars */ export const resampleOperator: PostProcessingFactory = ( formData, queryObject, diff --git a/superset-frontend/packages/superset-ui-core/src/query/buildQueryContext.ts b/superset-frontend/packages/superset-ui-core/src/query/buildQueryContext.ts index ad35434cad0..dbc1289c546 100644 --- a/superset-frontend/packages/superset-ui-core/src/query/buildQueryContext.ts +++ b/superset-frontend/packages/superset-ui-core/src/query/buildQueryContext.ts @@ -24,19 +24,7 @@ import { QueryContext, QueryObject } from './types/Query'; import { SetDataMaskHook } from '../chart'; import { JsonObject } from '../connection'; -const WRAP_IN_ARRAY = ( - baseQueryObject: QueryObject, - options?: { - extras?: { - cachedChanges?: any; - }; - ownState?: JsonObject; - hooks?: { - setDataMask: SetDataMaskHook; - setCachedChanges: (newChanges: any) => void; - }; - }, -) => [baseQueryObject]; +const WRAP_IN_ARRAY = (baseQueryObject: QueryObject) => [baseQueryObject]; export type BuildFinalQueryObjects = ( baseQueryObject: QueryObject, @@ -53,23 +41,11 @@ export default function buildQueryContext( } | BuildFinalQueryObjects, ): QueryContext { - const { - queryFields, - buildQuery = WRAP_IN_ARRAY, - hooks = {}, - ownState = {}, - } = typeof options === 'function' - ? { buildQuery: options, queryFields: {} } - : options || {}; - const queries = buildQuery(buildQueryObject(formData, queryFields), { - extras: {}, - ownState, - hooks: { - setDataMask: () => {}, - setCachedChanges: () => {}, - ...hooks, - }, - }); + const { queryFields, buildQuery = WRAP_IN_ARRAY } = + typeof options === 'function' + ? { buildQuery: options, queryFields: {} } + : options || {}; + const queries = buildQuery(buildQueryObject(formData, queryFields)); queries.forEach(query => { if (Array.isArray(query.post_processing)) { // eslint-disable-next-line no-param-reassign diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx index 797c7504282..d7f2d7dd6dd 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx @@ -26,9 +26,6 @@ import ModalTrigger from 'src/components/ModalTrigger'; import { EmptyWrapperType } from 'src/components/TableView/TableView'; interface EstimateQueryCostButtonProps { - dbId: number; - schema: string; - sql: string; getEstimate: Function; queryCostEstimate: Record; selectedText?: string; @@ -37,9 +34,6 @@ interface EstimateQueryCostButtonProps { } const EstimateQueryCostButton = ({ - dbId, - schema, - sql, getEstimate, queryCostEstimate = {}, selectedText, diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx index a01ff33a969..d40ca65f2f6 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx @@ -686,9 +686,6 @@ class SqlEditor extends React.PureComponent { this.props.database.allows_cost_estimate && ( { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx index f5fe459e4b2..fe56777c4b0 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx @@ -146,36 +146,6 @@ const FilterTitleContainer = forwardRef( ); }; - const recursivelyRender = ( - elementId: string, - nodeList: Array<{ id: string; parentId: string | null }>, - rendered: Array, - ): React.ReactNode => { - const didAlreadyRender = rendered.indexOf(elementId) >= 0; - if (didAlreadyRender) { - return null; - } - let parent = null; - const element = nodeList.filter(el => el.id === elementId)[0]; - if (!element) { - return null; - } - - rendered.push(elementId); - if (element.parentId) { - parent = recursivelyRender(element.parentId, nodeList, rendered); - } - const children = nodeList - .filter(item => item.parentId === elementId) - .map(item => recursivelyRender(item.id, nodeList, rendered)); - return ( - <> - {parent} - {renderComponent(elementId)} - {children} - - ); - }; const renderFilterGroups = () => { const items: React.ReactNode[] = []; diff --git a/superset-frontend/src/filters/components/TimeColumn/buildQuery.ts b/superset-frontend/src/filters/components/TimeColumn/buildQuery.ts index 1cc839c4cb6..c271a697957 100644 --- a/superset-frontend/src/filters/components/TimeColumn/buildQuery.ts +++ b/superset-frontend/src/filters/components/TimeColumn/buildQuery.ts @@ -33,7 +33,7 @@ import { buildQueryContext, QueryFormData } from '@superset-ui/core'; * if a viz needs multiple different result sets. */ export default function buildQuery(formData: QueryFormData) { - return buildQueryContext(formData, baseQueryObject => [ + return buildQueryContext(formData, () => [ { result_type: 'columns', columns: [], diff --git a/superset-frontend/src/middleware/asyncEvent.ts b/superset-frontend/src/middleware/asyncEvent.ts index 9d252f99cc4..9ae4f90e479 100644 --- a/superset-frontend/src/middleware/asyncEvent.ts +++ b/superset-frontend/src/middleware/asyncEvent.ts @@ -193,13 +193,13 @@ const wsConnect = (): void => { if (lastReceivedEventId) url += `?last_id=${lastReceivedEventId}`; ws = new WebSocket(url); - ws.addEventListener('open', event => { + ws.addEventListener('open', () => { logging.log('WebSocket connected'); clearTimeout(wsConnectTimeout); wsConnectRetries = 0; }); - ws.addEventListener('close', event => { + ws.addEventListener('close', () => { wsConnectTimeout = setTimeout(() => { wsConnectRetries += 1; if (wsConnectRetries <= wsConnectMaxRetries) { @@ -211,7 +211,7 @@ const wsConnect = (): void => { }, wsConnectErrorDelay); }); - ws.addEventListener('error', event => { + ws.addEventListener('error', () => { // https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState if (ws.readyState < 2) ws.close(); }); diff --git a/superset-frontend/src/utils/downloadAsImage.ts b/superset-frontend/src/utils/downloadAsImage.ts index da9ca8b614b..8c074bcdf2e 100644 --- a/superset-frontend/src/utils/downloadAsImage.ts +++ b/superset-frontend/src/utils/downloadAsImage.ts @@ -17,7 +17,7 @@ * under the License. */ import { SyntheticEvent } from 'react'; -import domToImage, { Options } from 'dom-to-image'; +import domToImage from 'dom-to-image'; import kebabCase from 'lodash/kebabCase'; import { t } from '@superset-ui/core'; import { addWarningToast } from 'src/components/MessageToasts/actions'; @@ -50,7 +50,6 @@ const generateFileStem = (description: string, date = new Date()) => export default function downloadAsImage( selector: string, description: string, - domToImageOptions: Options = {}, isExactSelector = false, ) { return (event: SyntheticEvent) => { diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx index 96a0bfef07c..454070b52a9 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/SqlAlchemyForm.tsx @@ -29,14 +29,12 @@ const SqlAlchemyTab = ({ onInputChange, testConnection, conf, - isEditMode = false, testInProgress = false, }: { db: DatabaseObject | null; onInputChange: EventHandler>; testConnection: EventHandler>; conf: { SQLALCHEMY_DOCS_URL: string; SQLALCHEMY_DISPLAY_TEXT: string }; - isEditMode?: boolean; testInProgress?: boolean; }) => { let fallbackDocsUrl; diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx index ca387a28a06..7891e6b0e2e 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -1275,7 +1275,6 @@ const DatabaseModal: FunctionComponent = ({ } conf={conf} testConnection={testConnection} - isEditMode={isEditMode} testInProgress={testInProgress} /> {isDynamic(db?.backend || db?.engine) && !isEditMode && ( diff --git a/superset-frontend/src/views/CRUD/data/query/QueryList.tsx b/superset-frontend/src/views/CRUD/data/query/QueryList.tsx index da590f729a2..6ab71b8d436 100644 --- a/superset-frontend/src/views/CRUD/data/query/QueryList.tsx +++ b/superset-frontend/src/views/CRUD/data/query/QueryList.tsx @@ -80,7 +80,7 @@ const StyledPopoverItem = styled.div` color: ${({ theme }) => theme.colors.grayscale.dark2}; `; -function QueryList({ addDangerToast, addSuccessToast }: QueryListProps) { +function QueryList({ addDangerToast }: QueryListProps) { const { state: { loading, resourceCount: queryCount, resourceCollection: queries }, fetchData, diff --git a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx index d2dc6aff9c3..f3d58fe52cc 100644 --- a/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx +++ b/superset-frontend/src/views/CRUD/data/savedquery/SavedQueryList.tsx @@ -90,7 +90,6 @@ const StyledPopoverItem = styled.div` function SavedQueryList({ addDangerToast, addSuccessToast, - user, }: SavedQueryListProps) { const { state: {