diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/consts.ts b/superset-frontend/plugins/plugin-chart-handlebars/src/consts.ts index 562f654431b..e566fd66b27 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/consts.ts +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/consts.ts @@ -18,10 +18,7 @@ */ import { debounce } from 'lodash'; import { formatSelectOptions } from '@superset-ui/chart-controls'; -import { addLocaleData, SLOW_DEBOUNCE, t } from '@superset-ui/core'; -import i18n from './i18n'; - -addLocaleData(i18n); +import { SLOW_DEBOUNCE, t } from '@superset-ui/core'; export const PAGE_SIZE_OPTIONS = formatSelectOptions([ [0, t('page_size.all')], diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/i18n.ts b/superset-frontend/plugins/plugin-chart-handlebars/src/i18n.ts deleted file mode 100644 index 5d015b56659..00000000000 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/i18n.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { Locale } from '@superset-ui/core'; - -const en = { - 'Query Mode': [''], - Aggregate: [''], - 'Raw Records': [''], - 'Emit Filter Events': [''], - 'Show Cell Bars': [''], - 'page_size.show': ['Show'], - 'page_size.all': ['All'], - 'page_size.entries': ['entries'], - 'table.previous_page': ['Previous'], - 'table.next_page': ['Next'], - 'search.num_records': ['%s record', '%s records...'], -}; - -const translations: Partial> = { - en, - fr: { - 'Query Mode': [''], - Aggregate: [''], - 'Raw Records': [''], - 'Emit Filter Events': [''], - 'Show Cell Bars': [''], - 'page_size.show': ['Afficher'], - 'page_size.all': ['tous'], - 'page_size.entries': ['entrées'], - 'table.previous_page': ['Précédent'], - 'table.next_page': ['Suivante'], - 'search.num_records': ['%s enregistrement', '%s enregistrements...'], - }, - zh: { - 'Query Mode': ['查询模式'], - Aggregate: ['分组聚合'], - 'Raw Records': ['原始数据'], - 'Emit Filter Events': ['关联看板过滤器'], - 'Show Cell Bars': ['为指标添加条状图背景'], - 'page_size.show': ['每页显示'], - 'page_size.all': ['全部'], - 'page_size.entries': ['条'], - 'table.previous_page': ['上一页'], - 'table.next_page': ['下一页'], - 'search.num_records': ['%s条记录...'], - }, -}; - -export default translations; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx index 288ec0972e8..7242e737f65 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controlPanel.tsx @@ -22,8 +22,7 @@ import { getStandardizedControls, sections, } from '@superset-ui/chart-controls'; -import { addLocaleData, t } from '@superset-ui/core'; -import i18n from '../i18n'; +import { t } from '@superset-ui/core'; import { allColumnsControlSetItem } from './controls/columns'; import { groupByControlSetItem } from './controls/groupBy'; import { handlebarsTemplateControlSetItem } from './controls/handlebarTemplate'; @@ -48,8 +47,6 @@ import { import { queryModeControlSetItem } from './controls/queryMode'; import { styleControlSetItem } from './controls/style'; -addLocaleData(i18n); - const config: ControlPanelConfig = { controlPanelSections: [ sections.legacyTimeseriesTime, diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx index 51639d0f38d..ee9ec5c1f39 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx @@ -19,7 +19,6 @@ */ import React from 'react'; import { - addLocaleData, ChartDataResponseResult, ensureIsArray, FeatureFlag, @@ -50,11 +49,8 @@ import { getStandardizedControls, } from '@superset-ui/chart-controls'; -import i18n from './i18n'; import { PAGE_SIZE_OPTIONS } from './consts'; -addLocaleData(i18n); - function getQueryMode(controls: ControlStateMapping): QueryMode { const mode = controls?.query_mode?.value; if (mode === QueryMode.aggregate || mode === QueryMode.raw) { diff --git a/superset-frontend/src/components/PageHeaderWithActions/index.tsx b/superset-frontend/src/components/PageHeaderWithActions/index.tsx index 4449d1c6b34..e85ccdfc825 100644 --- a/superset-frontend/src/components/PageHeaderWithActions/index.tsx +++ b/superset-frontend/src/components/PageHeaderWithActions/index.tsx @@ -92,7 +92,7 @@ const buttonsStyles = (theme: SupersetTheme) => css` & .fave-unfave-icon { padding: 0 ${theme.gridUnit}px; - &:first-child { + &:first-of-type { padding-left: 0; } } diff --git a/superset-frontend/src/explore/components/ExploreChartPanel.jsx b/superset-frontend/src/explore/components/ExploreChartPanel.jsx index 6fc3fe941dc..db97db24525 100644 --- a/superset-frontend/src/explore/components/ExploreChartPanel.jsx +++ b/superset-frontend/src/explore/components/ExploreChartPanel.jsx @@ -62,7 +62,7 @@ const propTypes = { vizType: PropTypes.string.isRequired, form_data: PropTypes.object, ownState: PropTypes.object, - standalone: PropTypes.number, + standalone: PropTypes.bool, force: PropTypes.bool, timeout: PropTypes.number, chartIsStale: PropTypes.bool, diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx index 82443fc3ab2..3f0e84cf7c2 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx @@ -74,7 +74,7 @@ const propTypes = { controls: PropTypes.object.isRequired, forcedHeight: PropTypes.string, form_data: PropTypes.object.isRequired, - standalone: PropTypes.number.isRequired, + standalone: PropTypes.bool.isRequired, force: PropTypes.bool, timeout: PropTypes.number, impressionId: PropTypes.string, diff --git a/superset-frontend/src/explore/components/controls/SelectControl.jsx b/superset-frontend/src/explore/components/controls/SelectControl.jsx index 59141458a46..7fc6b52aae8 100644 --- a/superset-frontend/src/explore/components/controls/SelectControl.jsx +++ b/superset-frontend/src/explore/components/controls/SelectControl.jsx @@ -176,7 +176,6 @@ export default class SelectControl extends React.PureComponent { name, placeholder, onFocus, - optionRenderer, showHeader, value, tokenSeparators, @@ -241,7 +240,6 @@ export default class SelectControl extends React.PureComponent { name: `select-${name}`, onChange: this.onChange, onFocus, - optionRenderer, options: this.state.options, placeholder, sortComparator: this.props.sortComparator, diff --git a/superset-frontend/src/views/components/Menu.tsx b/superset-frontend/src/views/components/Menu.tsx index 61bfc5a3295..739d7258c6e 100644 --- a/superset-frontend/src/views/components/Menu.tsx +++ b/superset-frontend/src/views/components/Menu.tsx @@ -155,7 +155,7 @@ const StyledHeader = styled.header` .ant-menu > .ant-menu-item > a { padding: 0px; } - .main-nav .ant-menu-submenu-title > svg:nth-child(1) { + .main-nav .ant-menu-submenu-title > svg:nth-of-type(1) { display: none; } .ant-menu-item-active > a { diff --git a/superset-frontend/src/views/menu.tsx b/superset-frontend/src/views/menu.tsx index d29f9a3aee3..4d27e3d6a46 100644 --- a/superset-frontend/src/views/menu.tsx +++ b/superset-frontend/src/views/menu.tsx @@ -31,7 +31,7 @@ import { Provider } from 'react-redux'; import { setupStore } from './store'; // Disable connecting to redux debugger so that the React app injected -// Below the menu like SqlLab or Explore can conect its redux store to the debugger +// Below the menu like SqlLab or Explore can connect its redux store to the debugger const store = setupStore(true); const container = document.getElementById('app'); const bootstrapJson = container?.getAttribute('data-bootstrap') ?? '{}';