superset/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts

166 lines
5.3 KiB
TypeScript
Raw Normal View History

/**
* 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.
*/
// ***********************************************
// Tests for setting controls in the UI
// ***********************************************
import { FORM_DATA_DEFAULTS, NUM_METRIC } from './visualizations/shared.helper';
describe('Datasource control', () => {
const newMetricName = `abc${Date.now()}`;
before(() => {
cy.server();
cy.login();
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});
it('should allow edit datasource', () => {
let numScripts = 0;
cy.visitChartByName('Num Births Trend');
cy.verifySliceSuccess({ waitAlias: '@postJson' });
cy.get('#datasource_menu').click();
cy.get('script').then(nodes => {
numScripts = nodes.length;
});
cy.get('a').contains('Edit Datasource').click();
// should load additional scripts for the modal
cy.get('script').then(nodes => {
expect(nodes.length).to.greaterThan(numScripts);
});
// create new metric
cy.get('table button').contains('Add Item', { timeout: 10000 }).click();
cy.get('input[value="<new metric>"]').click();
cy.get('input[value="<new metric>"]')
.focus()
.clear()
.type(`${newMetricName}{enter}`);
cy.get('.modal-footer button').contains('Save').click();
cy.get('.modal-footer button').contains('OK').click();
// select new metric
cy.get('[data-test=metrics]')
.find('.Select__control input')
.focus()
.type(newMetricName, { force: true });
// delete metric
cy.get('#datasource_menu').click();
cy.get('a').contains('Edit Datasource').click();
cy.get(`input[value="${newMetricName}"]`)
.closest('tr')
.find('.fa-trash')
.click();
cy.get('.modal-footer button').contains('Save').click();
cy.get('.modal-footer button').contains('OK').click();
cy.get('.Select__multi-value__label')
.contains(newMetricName)
.should('not.exist');
});
});
describe('VizType control', () => {
beforeEach(() => {
cy.login();
cy.server();
Fetch charts with GET to benefit from browser cache and conditional requests (#7032) * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Fix the white background shown in SQL editor on drag (#7021) This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends. * Show tooltip with time frame (#6979) * Fix time filter control (#6978) * Enhancement of query context and object. (#6962) * added more functionalities for query context and object. * fixed cache logic * added default value for groupby * updated comments and removed print (cherry picked from commit d5b9795f87f79fa2c41e144ffc00fd9586be7657) * [fix] /superset/slice/id url is too long (#6989) (cherry picked from commit 6a4d507ab607b01ed324cb3341b71c6fb2cb5c97) * [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027) (cherry picked from commit cc58f0e661044e95c7c86d0da8d77a0a6640efe7) * feat: add ability to change font size in big number (#7003) * Add ability to change font sizes in Big Number * rename big number to header * Add comment to clarify font size values * Allow LIMIT to be specified in parameters (#7052) * [fix] Cursor jumping when editing chart and dashboard titles (#7038) (cherry picked from commit fc1770f7b79a4d8815b646b46390fabf190c3815) * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * [db-engine-spec] Aligning Hive/Presto partition logic (#7007) (cherry picked from commit 05be86611785fef2904992e4e7d31dce23f1c51b) * [fix] explore chart from dashboard missed slice title (#7046) (cherry picked from commit a6d48d4052839286aec725d51303b3b2bf6e8dd4) * fix inaccurate data calculation with adata rolling and contribution (#7035) (cherry picked from commit 0782e831cd37f665a2838119d87c433269f1b36b) * Adding warning message for sqllab save query (#7028) (cherry picked from commit ead3d48133e7e1ab8b91d51e561544a544b4eaad) * [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037) * Update datasource.py * Update datasource.py (cherry picked from commit c771625f1068d3a7f41e6bced14b0cbdbf9962cc) * [csv-upload] Fixing message encoding (#6971) (cherry picked from commit 48431ab5b9375a94c5262a0336d9c69e5f01a3ac) * [sql-parse] Fixing LIMIT exceptions (#6963) (cherry picked from commit 3e076cb60b385e675ed1c9a8053493375e43370b) * Adding custom control overrides (#6956) * Adding extraOverrides to line chart * Updating extraOverrides to fit with more cases * Moving extraOverrides to index.js * Removing webpack-merge in package.json * Fixing metrics control clearing metric (cherry picked from commit e6194051f486e42922dc4e34a861f4490c1062fc) * [sqlparse] Fixing table name extraction for ill-defined query (#7029) (cherry picked from commit 07c340cf8203f13222f16efad1e55e202deb1865) * [missing values] Removing replacing missing values (#4905) (cherry picked from commit 61add606ca16a6ba981ccde864b121f5464b697a) * [SQL Lab] Improved query and results tabs rendering reliability (#7082) closes #7080 (cherry picked from commit 9b58e9f4920ef424e5b545dcbb4726e22bed5982) * Fix filter_box migration PR #6523 (#7066) * Fix filter_box migration PR #6523 * Fix druid-related bug (cherry picked from commit b210742ad24d01ca05bc58ca3342c90e301fe073) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * [forms] Fix handling of NULLs (cherry picked from commit e83a07d3dfda350cc44041cb6cbaec4510887902) * handle null column_name in sqla and druid models (cherry picked from commit 2ff721ae072b8d69c5cabddc3e1a388a596b1b6f) * Use metric name instead of metric in filter box (#7106) (cherry picked from commit 003364e74ea70cad1a4a6e784933fe8bef4c78ec) * Bump python lib croniter to an existing version (#7132) Package maintainers should really never delete packages, but it appears this happened with croniter and resulted in breaking our builds. This PR bumps to a more recent existing version of the library (cherry picked from commit 215ed392a11598eac228f57341dbfd232cf770e3) * Revert PR #6933 (#7162) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Fix bad merge * Use far future when max_age=0
2019-04-03 15:11:08 -04:00
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});
it('Can change vizType', () => {
cy.visitChartByName('Daily Totals');
cy.verifySliceSuccess({ waitAlias: '@postJson' });
let numScripts = 0;
cy.get('script').then(nodes => {
numScripts = nodes.length;
});
cy.get('.Control .label').contains('Table').click();
cy.get('[role="button"]').contains('Line Chart').click();
// should load mathjs for line chart
cy.get('script[src*="mathjs"]').should('have.length', 1);
cy.get('script').then(nodes => {
expect(nodes.length).to.greaterThan(numScripts);
});
style: Pass at propagating (and enhancing) Button component throughout Superset (#10649) * getting rid of weird focus/active outline ring * Buttons... buttons _everywhere_ * linting * Nixing views/CRUD/dataset/Button component * fixing 2 typing errors * fixing more TS errors * prefer src path for include * one more real button, one less CSS class * one more "button" to "Button" * Published Status is now a proper clickable Label * nixing the CRUD button again * touching up stories, with SupersetButton story * SIP-34 button colors * adding polished package to mix colors * updating button colors to match Superset theme * abstracting away from bootstrap-specific props (might pivot libraries soon!) * more abstraction from bsStyle/bsSize props * exchanging styles for a prop * linting * restoring feature flag to stock * using src alias * last <button> replacement * this classname would never be applied * more linting action * fixing unsupported bsSize 'medium', and cta typing error * more cta action * unnecessary styles * errant bsSize prop * cleanup * tweaks to make new New button work * Linting * fixing a couple tests * fixing theme based test failure * margin tweak for NEW button * another fixed test * another fixed test * fixing two more tests * fixing last broken tests. * always be linting * Adding tertiary/dashed buttons * cleaning up QueryAndSave buttons * fixing "link" button styles * fixing/updating link button styles * cta buttons on Modal component * linting. * exporting button story knobs, making ALL knobs safe for export. * capitalizing a file... no big whoop * Basic button tests * renaming button - temporarily * renaming file to fix capitalization issue * passing theme through to a difficult popover. * fixin' a newly busted unit test * lint fixin' * oops, shouldn't have changed this prop! * adding a dive() to themedShallow, and fixing a cypress/jest test * addressing lint stuff * touching up stories, with SupersetButton story * SIP-34 button colors * updating button colors to match Superset theme * abstracting away from bootstrap-specific props (might pivot libraries soon!) * linting * restoring feature flag to stock * cleanup * Linting * renaming button - temporarily * renaming file to fix capitalization issue * oops, shouldn't have changed this prop! * adding a dive() to themedShallow, and fixing a cypress/jest test * addressing lint stuff * nixing new modal button * Fixing another popover/button issue that should break cypress * lint :sparkles: * passing classNames through to new button (should fix some tests) * cleaning unused classes, making cypress tests use data attrs * fixin' the test * fixing another class-based test with data-test attr * no longer passing theme as prop to buttons in popovers... themeprovider is better * outline/border tweaks!
2020-08-28 20:34:28 -04:00
cy.get('button[data-test="run-query-button"]').click();
Fetch charts with GET to benefit from browser cache and conditional requests (#7032) * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Fix the white background shown in SQL editor on drag (#7021) This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends. * Show tooltip with time frame (#6979) * Fix time filter control (#6978) * Enhancement of query context and object. (#6962) * added more functionalities for query context and object. * fixed cache logic * added default value for groupby * updated comments and removed print (cherry picked from commit d5b9795f87f79fa2c41e144ffc00fd9586be7657) * [fix] /superset/slice/id url is too long (#6989) (cherry picked from commit 6a4d507ab607b01ed324cb3341b71c6fb2cb5c97) * [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027) (cherry picked from commit cc58f0e661044e95c7c86d0da8d77a0a6640efe7) * feat: add ability to change font size in big number (#7003) * Add ability to change font sizes in Big Number * rename big number to header * Add comment to clarify font size values * Allow LIMIT to be specified in parameters (#7052) * [fix] Cursor jumping when editing chart and dashboard titles (#7038) (cherry picked from commit fc1770f7b79a4d8815b646b46390fabf190c3815) * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * [db-engine-spec] Aligning Hive/Presto partition logic (#7007) (cherry picked from commit 05be86611785fef2904992e4e7d31dce23f1c51b) * [fix] explore chart from dashboard missed slice title (#7046) (cherry picked from commit a6d48d4052839286aec725d51303b3b2bf6e8dd4) * fix inaccurate data calculation with adata rolling and contribution (#7035) (cherry picked from commit 0782e831cd37f665a2838119d87c433269f1b36b) * Adding warning message for sqllab save query (#7028) (cherry picked from commit ead3d48133e7e1ab8b91d51e561544a544b4eaad) * [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037) * Update datasource.py * Update datasource.py (cherry picked from commit c771625f1068d3a7f41e6bced14b0cbdbf9962cc) * [csv-upload] Fixing message encoding (#6971) (cherry picked from commit 48431ab5b9375a94c5262a0336d9c69e5f01a3ac) * [sql-parse] Fixing LIMIT exceptions (#6963) (cherry picked from commit 3e076cb60b385e675ed1c9a8053493375e43370b) * Adding custom control overrides (#6956) * Adding extraOverrides to line chart * Updating extraOverrides to fit with more cases * Moving extraOverrides to index.js * Removing webpack-merge in package.json * Fixing metrics control clearing metric (cherry picked from commit e6194051f486e42922dc4e34a861f4490c1062fc) * [sqlparse] Fixing table name extraction for ill-defined query (#7029) (cherry picked from commit 07c340cf8203f13222f16efad1e55e202deb1865) * [missing values] Removing replacing missing values (#4905) (cherry picked from commit 61add606ca16a6ba981ccde864b121f5464b697a) * [SQL Lab] Improved query and results tabs rendering reliability (#7082) closes #7080 (cherry picked from commit 9b58e9f4920ef424e5b545dcbb4726e22bed5982) * Fix filter_box migration PR #6523 (#7066) * Fix filter_box migration PR #6523 * Fix druid-related bug (cherry picked from commit b210742ad24d01ca05bc58ca3342c90e301fe073) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * [forms] Fix handling of NULLs (cherry picked from commit e83a07d3dfda350cc44041cb6cbaec4510887902) * handle null column_name in sqla and druid models (cherry picked from commit 2ff721ae072b8d69c5cabddc3e1a388a596b1b6f) * Use metric name instead of metric in filter box (#7106) (cherry picked from commit 003364e74ea70cad1a4a6e784933fe8bef4c78ec) * Bump python lib croniter to an existing version (#7132) Package maintainers should really never delete packages, but it appears this happened with croniter and resulted in breaking our builds. This PR bumps to a more recent existing version of the library (cherry picked from commit 215ed392a11598eac228f57341dbfd232cf770e3) * Revert PR #6933 (#7162) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Fix bad merge * Use far future when max_age=0
2019-04-03 15:11:08 -04:00
cy.verifySliceSuccess({ waitAlias: '@postJson', chartSelector: 'svg' });
});
});
describe('Time range filter', () => {
beforeEach(() => {
cy.login();
cy.server();
Fetch charts with GET to benefit from browser cache and conditional requests (#7032) * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Fix the white background shown in SQL editor on drag (#7021) This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends. * Show tooltip with time frame (#6979) * Fix time filter control (#6978) * Enhancement of query context and object. (#6962) * added more functionalities for query context and object. * fixed cache logic * added default value for groupby * updated comments and removed print (cherry picked from commit d5b9795f87f79fa2c41e144ffc00fd9586be7657) * [fix] /superset/slice/id url is too long (#6989) (cherry picked from commit 6a4d507ab607b01ed324cb3341b71c6fb2cb5c97) * [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027) (cherry picked from commit cc58f0e661044e95c7c86d0da8d77a0a6640efe7) * feat: add ability to change font size in big number (#7003) * Add ability to change font sizes in Big Number * rename big number to header * Add comment to clarify font size values * Allow LIMIT to be specified in parameters (#7052) * [fix] Cursor jumping when editing chart and dashboard titles (#7038) (cherry picked from commit fc1770f7b79a4d8815b646b46390fabf190c3815) * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * [db-engine-spec] Aligning Hive/Presto partition logic (#7007) (cherry picked from commit 05be86611785fef2904992e4e7d31dce23f1c51b) * [fix] explore chart from dashboard missed slice title (#7046) (cherry picked from commit a6d48d4052839286aec725d51303b3b2bf6e8dd4) * fix inaccurate data calculation with adata rolling and contribution (#7035) (cherry picked from commit 0782e831cd37f665a2838119d87c433269f1b36b) * Adding warning message for sqllab save query (#7028) (cherry picked from commit ead3d48133e7e1ab8b91d51e561544a544b4eaad) * [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037) * Update datasource.py * Update datasource.py (cherry picked from commit c771625f1068d3a7f41e6bced14b0cbdbf9962cc) * [csv-upload] Fixing message encoding (#6971) (cherry picked from commit 48431ab5b9375a94c5262a0336d9c69e5f01a3ac) * [sql-parse] Fixing LIMIT exceptions (#6963) (cherry picked from commit 3e076cb60b385e675ed1c9a8053493375e43370b) * Adding custom control overrides (#6956) * Adding extraOverrides to line chart * Updating extraOverrides to fit with more cases * Moving extraOverrides to index.js * Removing webpack-merge in package.json * Fixing metrics control clearing metric (cherry picked from commit e6194051f486e42922dc4e34a861f4490c1062fc) * [sqlparse] Fixing table name extraction for ill-defined query (#7029) (cherry picked from commit 07c340cf8203f13222f16efad1e55e202deb1865) * [missing values] Removing replacing missing values (#4905) (cherry picked from commit 61add606ca16a6ba981ccde864b121f5464b697a) * [SQL Lab] Improved query and results tabs rendering reliability (#7082) closes #7080 (cherry picked from commit 9b58e9f4920ef424e5b545dcbb4726e22bed5982) * Fix filter_box migration PR #6523 (#7066) * Fix filter_box migration PR #6523 * Fix druid-related bug (cherry picked from commit b210742ad24d01ca05bc58ca3342c90e301fe073) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * [forms] Fix handling of NULLs (cherry picked from commit e83a07d3dfda350cc44041cb6cbaec4510887902) * handle null column_name in sqla and druid models (cherry picked from commit 2ff721ae072b8d69c5cabddc3e1a388a596b1b6f) * Use metric name instead of metric in filter box (#7106) (cherry picked from commit 003364e74ea70cad1a4a6e784933fe8bef4c78ec) * Bump python lib croniter to an existing version (#7132) Package maintainers should really never delete packages, but it appears this happened with croniter and resulted in breaking our builds. This PR bumps to a more recent existing version of the library (cherry picked from commit 215ed392a11598eac228f57341dbfd232cf770e3) * Revert PR #6933 (#7162) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Fix bad merge * Use far future when max_age=0
2019-04-03 15:11:08 -04:00
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});
it('Defaults to the correct tab for time_range params', () => {
const formData = {
...FORM_DATA_DEFAULTS,
metrics: [NUM_METRIC],
viz_type: 'line',
time_range: '100 years ago : now',
};
cy.visitChartByParams(JSON.stringify(formData));
Fetch charts with GET to benefit from browser cache and conditional requests (#7032) * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Fix the white background shown in SQL editor on drag (#7021) This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends. * Show tooltip with time frame (#6979) * Fix time filter control (#6978) * Enhancement of query context and object. (#6962) * added more functionalities for query context and object. * fixed cache logic * added default value for groupby * updated comments and removed print (cherry picked from commit d5b9795f87f79fa2c41e144ffc00fd9586be7657) * [fix] /superset/slice/id url is too long (#6989) (cherry picked from commit 6a4d507ab607b01ed324cb3341b71c6fb2cb5c97) * [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027) (cherry picked from commit cc58f0e661044e95c7c86d0da8d77a0a6640efe7) * feat: add ability to change font size in big number (#7003) * Add ability to change font sizes in Big Number * rename big number to header * Add comment to clarify font size values * Allow LIMIT to be specified in parameters (#7052) * [fix] Cursor jumping when editing chart and dashboard titles (#7038) (cherry picked from commit fc1770f7b79a4d8815b646b46390fabf190c3815) * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * [db-engine-spec] Aligning Hive/Presto partition logic (#7007) (cherry picked from commit 05be86611785fef2904992e4e7d31dce23f1c51b) * [fix] explore chart from dashboard missed slice title (#7046) (cherry picked from commit a6d48d4052839286aec725d51303b3b2bf6e8dd4) * fix inaccurate data calculation with adata rolling and contribution (#7035) (cherry picked from commit 0782e831cd37f665a2838119d87c433269f1b36b) * Adding warning message for sqllab save query (#7028) (cherry picked from commit ead3d48133e7e1ab8b91d51e561544a544b4eaad) * [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037) * Update datasource.py * Update datasource.py (cherry picked from commit c771625f1068d3a7f41e6bced14b0cbdbf9962cc) * [csv-upload] Fixing message encoding (#6971) (cherry picked from commit 48431ab5b9375a94c5262a0336d9c69e5f01a3ac) * [sql-parse] Fixing LIMIT exceptions (#6963) (cherry picked from commit 3e076cb60b385e675ed1c9a8053493375e43370b) * Adding custom control overrides (#6956) * Adding extraOverrides to line chart * Updating extraOverrides to fit with more cases * Moving extraOverrides to index.js * Removing webpack-merge in package.json * Fixing metrics control clearing metric (cherry picked from commit e6194051f486e42922dc4e34a861f4490c1062fc) * [sqlparse] Fixing table name extraction for ill-defined query (#7029) (cherry picked from commit 07c340cf8203f13222f16efad1e55e202deb1865) * [missing values] Removing replacing missing values (#4905) (cherry picked from commit 61add606ca16a6ba981ccde864b121f5464b697a) * [SQL Lab] Improved query and results tabs rendering reliability (#7082) closes #7080 (cherry picked from commit 9b58e9f4920ef424e5b545dcbb4726e22bed5982) * Fix filter_box migration PR #6523 (#7066) * Fix filter_box migration PR #6523 * Fix druid-related bug (cherry picked from commit b210742ad24d01ca05bc58ca3342c90e301fe073) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * [forms] Fix handling of NULLs (cherry picked from commit e83a07d3dfda350cc44041cb6cbaec4510887902) * handle null column_name in sqla and druid models (cherry picked from commit 2ff721ae072b8d69c5cabddc3e1a388a596b1b6f) * Use metric name instead of metric in filter box (#7106) (cherry picked from commit 003364e74ea70cad1a4a6e784933fe8bef4c78ec) * Bump python lib croniter to an existing version (#7132) Package maintainers should really never delete packages, but it appears this happened with croniter and resulted in breaking our builds. This PR bumps to a more recent existing version of the library (cherry picked from commit 215ed392a11598eac228f57341dbfd232cf770e3) * Revert PR #6933 (#7162) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Sparkline dates aren't formatting in Time Series Table (#6976) * Exclude venv for python linter to ignore * Fix NaN error * Changing time table viz to pass formatTime a date (#7020) (cherry picked from commit 7f3c145b1f5a4e2d8b95982119503e98772e2c47) * SQL editor layout makeover (#7102) This PR includes the following layout and css tweaks: - Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox - Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane - Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars - css tweaks on the basic.html page so the loading animation appears in the center of the page across the board (cherry picked from commit 71f1bbd2ec59b99d6ba6d9a4a2f9cfceaf922b80) * Add decorator for etag cache * Fetch charts with GET * Small fixes * Fix typo * Compute correct cache key; fix logging * Check perms on cached response * Revert change * If perms fail, return naked response * Fix lint * Compute cache key from all form data * Pass extra_filters in GET request * Fix pylint * Fix flake8 * Use ETags even if no cache is set * Handle adhoc filters * Raise in debug mode * Rename actions * Fix integration tests * Do POST request on new charts * Set extra/adhoc filters only in GET requests * Raise if check_perms fails * Refactor auth * Fix flake8 * Fix js unit tests * Fix js unit tests that fail in lyftga * Fix js * Fix bad merge * Use far future when max_age=0
2019-04-03 15:11:08 -04:00
cy.verifySliceSuccess({ waitAlias: '@postJson' });
cy.get('[data-test=time_range]').within(() => {
cy.get('span.label').click();
});
cy.get('#filter-popover').within(() => {
cy.get('div.tab-pane.active').within(() => {
cy.get('div.PopoverSection :not(.dimmed)').within(() => {
cy.get('input[value="100 years ago"]');
cy.get('input[value="now"]');
});
});
});
cy.get('#filter-popover button').contains('Ok').click();
cy.get('#filter-popover').should('not.exist');
});
});
describe('Groupby control', () => {
it('Set groupby', () => {
cy.server();
cy.login();
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
cy.visitChartByName('Num Births Trend');
cy.verifySliceSuccess({ waitAlias: '@postJson' });
cy.get('[data-test=groupby]').within(() => {
cy.get('.Select__control').click();
cy.get('input[type=text]').type('state{enter}');
});
cy.get('button[data-test="run-query-button"]').click();
cy.verifySliceSuccess({ waitAlias: '@postJson', chartSelector: 'svg' });
});
});