Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/apache/superset into chor…
Browse files Browse the repository at this point in the history
…e/certified_dashboards_charts
  • Loading branch information
geido committed Nov 17, 2021
2 parents fb3c2a3 + c54027a commit 082ef5a
Show file tree
Hide file tree
Showing 124 changed files with 2,449 additions and 2,221 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 0

- package-ecosystem: "npm"
directory: "/docs/"
schedule:
interval: "daily"
open-pull-requests-limit: 0
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ repos:
hooks:
- id: check-docstring-first
- id: check-added-large-files
exclude: \.(geojson)$
- id: check-yaml
exclude: ^helm/superset/templates/
- id: debug-statements
Expand All @@ -45,7 +46,7 @@ repos:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1 # Use the sha or tag you want to point at
rev: v2.4.1 # Use the sha or tag you want to point at
hooks:
- id: prettier
files: 'superset-frontend'
13 changes: 13 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,16 @@ vendor/*
# github configuration
.github/*
.*mdx

# skip license check in superset-ui
tmp/*
lib/*
esm/*
tsconfig.tsbuildinfo
.*ipynb
.*yml
.*iml
.esprintrc
.prettierignore
superset-frontend/packages/generator-superset
superset-frontend/temporary_superset_ui
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ RUN mkdir -p ${PYTHONPATH} \
default-libmysqlclient-dev \
libsasl2-modules-gssapi-mit \
libpq-dev \
libecpg-dev \
&& rm -rf /var/lib/apt/lists/*

COPY --from=superset-py /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
Expand Down
54 changes: 45 additions & 9 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/

const packageConfig = require('./package');

const importCoreModules = [];
Object.entries(packageConfig.dependencies).forEach(([pkg]) => {
if (/@superset-ui/.test(pkg)) {
importCoreModules.push(pkg);
}
});
module.exports = {
extends: [
'airbnb',
Expand All @@ -33,7 +42,15 @@ module.exports = {
browser: true,
},
settings: {
'import/resolver': 'webpack',
'import/resolver': {
webpack: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
},
// Allow only core/src and core/test, avoid import modules from lib
'import/internal-regex': /^@superset-ui\/core\/(src|test)\/.*/,
'import/core-modules': importCoreModules,
react: {
version: 'detect',
},
Expand Down Expand Up @@ -76,11 +93,11 @@ module.exports = {
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-use-before-define': 1, // disabled temporarily
'@typescript-eslint/no-non-null-assertion': 0, // disabled temporarily
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0, // re-enable up for discussion
camelcase: 0,
'class-methods-use-this': 0,
curly: 1,
'func-names': 0,
'guard-for-in': 0,
'import/no-cycle': 0, // re-enable up for discussion, might require some major refactors
Expand Down Expand Up @@ -170,11 +187,11 @@ module.exports = {
},
{
files: [
'src/**/*.test.ts',
'src/**/*.test.tsx',
'src/**/*.test.js',
'src/**/*.test.jsx',
'src/**/fixtures.*',
'*.test.ts',
'*.test.tsx',
'*.test.js',
'*.test.jsx',
'fixtures.*',
],
plugins: ['jest', 'jest-dom', 'no-only-tests', 'testing-library'],
env: {
Expand All @@ -195,9 +212,28 @@ module.exports = {
'error',
{ devDependencies: true },
],
'jest/consistent-test-it': 'error',
'no-only-tests/no-only-tests': 'error',
'max-classes-per-file': 0,
'@typescript-eslint/no-non-null-assertion': 0,
// TODO: disabled temporarily, re-enable after monorepo
'jest/consistent-test-it': 'error',
'jest/expect-expect': 0,
'jest/no-test-prefixes': 0,
'jest/valid-expect-in-promise': 0,
'jest/valid-expect': 0,
'jest/valid-title': 0,
'jest-dom/prefer-to-have-attribute': 0,
'jest-dom/prefer-to-have-text-content': 0,
'jest-dom/prefer-to-have-style': 0,
},
},
{
files: './packages/generator-superset/**/*.test.*',
env: {
node: true,
},
rules: {
'jest/expect-expect': 0,
},
},
],
Expand All @@ -210,7 +246,7 @@ module.exports = {
},
],
'class-methods-use-this': 0,
curly: 1,
curly: 2,
'func-names': 0,
'guard-for-in': 0,
'import/extensions': [
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
const packageConfig = require('./package.json');
const packageConfig = require('./package');

module.exports = {
sourceMaps: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ describe('Nativefilters Sanity test', () => {
cy.get(nativeFilters.modal.container).should('be.visible');
});
it('User can add a new native filter', () => {
cy.get(nativeFilters.filterFromDashboardView.expand)
.should('be.visible')
.click();
cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true });
cy.get(nativeFilters.createFilterButton).should('be.visible').click();
cy.get(nativeFilters.modal.container)
.find(nativeFilters.filtersPanel.filterName)
Expand Down Expand Up @@ -208,7 +206,7 @@ describe('Nativefilters Sanity test', () => {
cy.get(nativeFilters.modal.container)
.find(nativeFilters.filtersPanel.datasetName)
.click()
.type("World Bank's Data{enter}");
.type('wb_health_population{enter}');

cy.get('.loading inline-centered css-101mkpk').should('not.exist');
// hack for unclickable country_name
Expand Down Expand Up @@ -288,6 +286,50 @@ describe('Nativefilters Sanity test', () => {
'By default, each filter loads at most 1000 choices at the initial page load. Check this box if you have more than 1000 filter values and want to enable dynamically searching that loads filter values as users type (may add stress to your database).',
);
});
it("User can check 'Filter has default value'", () => {
cy.get(nativeFilters.filterFromDashboardView.expand).click({ force: true });
cy.get(nativeFilters.createFilterButton)
.should('be.visible')
.click({ force: true });
cy.get(nativeFilters.modal.container).should('be.visible');

cy.get(nativeFilters.modal.container)
.find(nativeFilters.filtersPanel.datasetName)
.click()
.type('wb_health_population{enter}');
cy.get(nativeFilters.modal.container)
.find(nativeFilters.filtersPanel.filterName)
.click()
.type('country_name');
// hack for unclickable datetime
cy.wait(5000);
cy.get(nativeFilters.filtersPanel.filterInfoInput)
.last()
.click({ force: true });
cy.get(nativeFilters.filtersPanel.filterInfoInput)
.last()
.type('country_name');
cy.get(nativeFilters.filtersPanel.inputDropdown)
.should('be.visible', { timeout: 20000 })
.last()
.click();
cy.contains('Filter has default value').click();
cy.contains('Default value is required');
cy.get(nativeFilters.modal.defaultValueCheck).should('be.visible');
cy.get(nativeFilters.filtersPanel.columnEmptyInput)
.last()
.type('United States{enter}');
cy.get(nativeFilters.modal.footer)
.find(nativeFilters.modal.saveButton)
.should('be.visible')
.click({ force: true });
cy.get(nativeFilters.filterFromDashboardView.filterContent).contains(
'United States',
);
cy.get('.line').within(() => {
cy.contains('United States').should('be.visible');
});
});
});

xdescribe('Nativefilters', () => {
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/cypress-base/cypress/support/directories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ export const nativeFilters = {
removeTab: '[aria-label="trash"]',
},
addFilter: dataTestLocator('add-filter-button'),
defaultValueCheck: '.ant-checkbox-checked',
},
filtersPanel: {
filterName: dataTestLocator('filters-config-modal__name-input'),
Expand All @@ -339,6 +340,7 @@ export const nativeFilters = {
expand: dataTestLocator('filter-bar__expand-button'),
collapse: dataTestLocator('filter-bar__collapse-button'),
filterName: dataTestLocator('filter-control-name'),
filterContent: '.ant-select-selection-item-content',
},
createFilterButton: dataTestLocator('filter-bar__create-filter'),
removeFilter: '[aria-label="remove"]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
export default function parsePostForm(requestBody: ArrayBuffer) {
type ParsedFields = Record<string, string[] | string>;
if (requestBody.constructor.name !== 'ArrayBuffer') {
return (requestBody as unknown) as ParsedFields;
return requestBody as unknown as ParsedFields;
}
const lines = new TextDecoder('utf-8').decode(requestBody).split('\n');
const fields: ParsedFields = {};
Expand Down
Loading

0 comments on commit 082ef5a

Please sign in to comment.