This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new d93b2b9 Re-enable rule sort-comp (#10872)
d93b2b9 is described below
commit d93b2b99b28c66f0815637b9f8a5fecae3a4e33c
Author: Kamil Gabryjelski <[email protected]>
AuthorDate: Mon Sep 14 19:45:05 2020 +0200
Re-enable rule sort-comp (#10872)
---
superset-frontend/.eslintrc.js | 2 --
.../src/SqlLab/components/SqlEditor.jsx | 6 ++--
.../components/FilterableTable/FilterableTable.tsx | 14 ++++-----
.../src/views/CRUD/welcome/DashboardTable.tsx | 36 ++++++++++++----------
4 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js
index 1a935c7..e101820 100644
--- a/superset-frontend/.eslintrc.js
+++ b/superset-frontend/.eslintrc.js
@@ -128,7 +128,6 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
- 'react/sort-comp': 0, // disabled temporarily
'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
@@ -246,7 +245,6 @@ module.exports = {
'react/no-unused-prop-types': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
- 'react/sort-comp': 0, // disabled temporarily
'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // disabled temporarily
'prettier/prettier': 'error',
diff --git a/superset-frontend/src/SqlLab/components/SqlEditor.jsx
b/superset-frontend/src/SqlLab/components/SqlEditor.jsx
index 6964d70..c3757c7 100644
--- a/superset-frontend/src/SqlLab/components/SqlEditor.jsx
+++ b/superset-frontend/src/SqlLab/components/SqlEditor.jsx
@@ -246,12 +246,12 @@ class SqlEditor extends React.PureComponent {
this.props.actions.estimateQueryCost(query);
}
}
- handleWindowResize() {
- this.setState({ height: this.getSqlEditorHeight() });
- }
handleToggleAutocompleteEnabled = () => {
this.setState({ autocompleteEnabled: !this.state.autocompleteEnabled });
};
+ handleWindowResize() {
+ this.setState({ height: this.getSqlEditorHeight() });
+ }
elementStyle(dimension, elementSize, gutterSize) {
return {
[dimension]: `calc(${elementSize}% - ${
diff --git
a/superset-frontend/src/components/FilterableTable/FilterableTable.tsx
b/superset-frontend/src/components/FilterableTable/FilterableTable.tsx
index d320b0c..99bfb5e 100644
--- a/superset-frontend/src/components/FilterableTable/FilterableTable.tsx
+++ b/superset-frontend/src/components/FilterableTable/FilterableTable.tsx
@@ -123,6 +123,13 @@ export default class FilterableTable extends PureComponent<
expandedColumns: [],
};
+ list: List<Datum>;
+ complexColumns: Record<string, boolean>;
+ widthsForColumnsByKey: Record<string, number>;
+ totalTableWidth: number;
+ totalTableHeight: number;
+ container: React.RefObject<HTMLDivElement>;
+
constructor(props: FilterableTableProps) {
super(props);
this.list = List(this.formatTableData(props.data));
@@ -228,13 +235,6 @@ export default class FilterableTable extends PureComponent<
return this.complexColumns[columnKey] ? truncated : content;
}
- list: List<Datum>;
- complexColumns: Record<string, boolean>;
- widthsForColumnsByKey: Record<string, number>;
- totalTableWidth: number;
- totalTableHeight: number;
- container: React.RefObject<HTMLDivElement>;
-
formatTableData(data: Record<string, unknown>[]): Datum[] {
const formattedData = data.map(row => {
const newRow = {};
diff --git a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
index f75d773..8e04ea7 100644
--- a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
@@ -40,23 +40,6 @@ class DashboardTable extends React.PureComponent<
DashboardTableProps,
DashboardTableState
> {
- state = {
- dashboards: [],
- dashboard_count: 0,
- loading: false,
- };
-
- componentDidUpdate(prevProps: DashboardTableProps) {
- if (prevProps.search !== this.props.search) {
- this.fetchDataDebounced({
- pageSize: PAGE_SIZE,
- pageIndex: 0,
- sortBy: this.initialSort,
- filters: [],
- });
- }
- }
-
columns = [
{
accessor: 'dashboard_title',
@@ -109,6 +92,23 @@ class DashboardTable extends React.PureComponent<
initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
+ state = {
+ dashboards: [],
+ dashboard_count: 0,
+ loading: false,
+ };
+
+ componentDidUpdate(prevProps: DashboardTableProps) {
+ if (prevProps.search !== this.props.search) {
+ this.fetchDataDebounced({
+ pageSize: PAGE_SIZE,
+ pageIndex: 0,
+ sortBy: this.initialSort,
+ filters: [],
+ });
+ }
+ }
+
fetchData = ({ pageIndex, pageSize, sortBy, filters }: FetchDataConfig) => {
this.setState({ loading: true });
const filterExps = Object.keys(filters)
@@ -159,6 +159,8 @@ class DashboardTable extends React.PureComponent<
.finally(() => this.setState({ loading: false }));
};
+ // sort-comp disabled because of conflict with no-use-before-define rule
+ // eslint-disable-next-line react/sort-comp
fetchDataDebounced = debounce(this.fetchData, 200);
render() {