diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a194ad477bc0..6302d58e37458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,15 @@ under the License. --> ## Change Log +### 0.35.1 (2019/11/15 13:47 +00:00) +- [#8457](https://github.com/apache/incubator-superset/pull/8457) [fix] Improve csv upload functionality (#8457) (@villebro) +- [#8566](https://github.com/apache/incubator-superset/pull/8566) [druid] Fix, pydruid forced dependency (#8566) (@dpgaspar) +- [#8558](https://github.com/apache/incubator-superset/pull/8558) bump legacy-preset-chart-nvd3 to 0.11.5 (#8558) (@nytai) +- [#8498](https://github.com/apache/incubator-superset/pull/8498) build: bump dompurify version because of nasty xss bypass. (#8498) (@MarcusSorealheis) +- [#8477](https://github.com/apache/incubator-superset/pull/8477) [cli] Fix, import datasources exported by UI (#8477) (@dpgaspar) +- [#8487](https://github.com/apache/incubator-superset/pull/8487) fixing typo. (#8487) (@MarcusSorealheis) +- [#8430](https://github.com/apache/incubator-superset/pull/8430) [pydruid] Bumping the pydruid version (#8430) (@john-bodley) + ### 0.35.0 (2019/10/31 11:12 +00:00) - [#8436](https://github.com/apache/incubator-superset/pull/8436) [fix] Updating parse_human_timedelta typing (#8436) (@john-bodley) - [#8423](https://github.com/apache/incubator-superset/pull/8423) chore: disable another flaky cypress test (#8423) (@mistercrunch) diff --git a/RELEASING/README.md b/RELEASING/README.md index 2a37fc8db73b2..a94159b4d7a1e 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -72,6 +72,11 @@ set your GITHUB_TOKEN environment variable. github-changes -o apache -r incubator-superset --token $GITHUB_TOKEN --between-tags ... ``` +Then, in `UPDATING.md`, a file that contains a list of notifications around +deprecations and upgrading-related topics, +make sure to move the content now under the `Next Version` section under a new +section for the new release. + Finally bump the version number on `superset/static/assets/package.json`: ```json @@ -88,14 +93,14 @@ the same terminal session won't be used for crafting the release candidate and t final release. Therefore, it's a good idea to do the following every time you work on a new phase of the release process to make sure you aren't releasing the wrong files/using wrong names. There's a script to help you set correctly all the -necessary environment variables. Change you current directory to `superset/RELEASING` +necessary environment variables. Change your current directory to `superset/RELEASING` ```bash # usage: set_release_env.sh "" . ./set_release_env.sh XX.YY.ZZ QQ "YOUR PGP KEY NAME" ``` -The script will output the exported variables, for example for 0.34.1 RC1: +The script will output the exported variables. Here's example for 0.34.1 RC1: ``` ------------------------------- @@ -169,7 +174,7 @@ https://lists.apache.org/thread.html/e60f080ebdda26896214f7d3d5be1ccadfab95d48fb To easily send a voting request to Superset community, still on the `superset/RELEASING` directory: ```bash - # Note use Superset's virtualenv + # Note: use Superset's virtualenv (venv)$ python send_email.py vote_pmc ``` @@ -189,7 +194,7 @@ https://lists.apache.org/thread.html/50a6b134d66b86b237d5d7bc89df1b567246d125a71 To easily send the result email, still on the `superset/RELEASING` directory: ```bash - # Note use Superset's virtualenv + # Note: use Superset's virtualenv (venv)$ python send_email.py result_pmc ``` @@ -212,19 +217,34 @@ started at general@incubator.apache.org. To easily send the voting request to Apache community, still on the `superset/RELEASING` directory: ```bash - # Note use Superset's virtualenv + # Note: use Superset's virtualenv (venv)$ python send_email.py vote_ipmc ``` -### Announcing +Once 3+ binding votes (by IPMC members) have been cast and at +least 72 hours have past, you can post a [RESULT] thread -Once it's all done, an [ANNOUNCE] thread announcing the release to the dev@ mailing list is the final step. +To easily send the result email, still on the `superset/RELEASING` directory: ```bash - # Note use Superset's virtualenv - (venv)$ python send_email.py announce + # Note: use Superset's virtualenv + (venv)$ python send_email.py result_ipmc +``` + +Again, the script will interactively ask for extra information needed to fill out the email template. Based on the +voting description, it will generate a passing, non passing or non conclusive email. +here's an example: + +```bash + Sender email (ex: user@apache.org): your_apache_email@apache.org + Apache username: your_apache_user + Apache password: your_apache_password + A List of people with +1 binding vote (ex: Alan, Justin): Alan,Jeff, + A List of people with +1 non binding vote (ex: Ville): + A List of people with -1 vote (ex: John): ``` + ### Validating a release https://www.apache.org/info/verification.html @@ -252,10 +272,13 @@ Then tag the final release: git tag -f ${SUPERSET_VERSION} ``` -Now you can announce the release on the mailing list, make sure to use the -proper template +### Update CHANGELOG and UPDATING on superset + +Now that we have a final Apache source release we need to open a pull request on Superset +with the changes on `CHANGELOG.md` and `UPDATING.md`. ### Publishing a Convenience Release to PyPI + From the root of the repo running ./pypi_push.sh will build the Javascript bundle and echo the twine command allowing you to publish to PyPI. You may need to ask a fellow committer to grant @@ -263,14 +286,18 @@ you access to it if you don't have access already. Make sure to create an account first if you don't have one, and reference your username while requesting access to push packages. -## Post release +### Announcing -In `UPDATING.md`, a file that contains a list of notifications around -deprecations and upgrading-related topics, -make sure to move the content now under the `Next Version` section under a new -section for the new release. +Once it's all done, an [ANNOUNCE] thread announcing the release to the dev@ mailing list is the final step. + +```bash + # Note use Superset's virtualenv + (venv)$ python send_email.py announce +``` + +## Post release -# Refresh documentation website +#### Refresh documentation website Every once in a while we want to compile the documentation and publish it. Here's how to do it. diff --git a/RELEASING/email_templates/announce.j2 b/RELEASING/email_templates/announce.j2 index b43739e708b07..ebd9628972837 100644 --- a/RELEASING/email_templates/announce.j2 +++ b/RELEASING/email_templates/announce.j2 @@ -37,7 +37,7 @@ https://pypi.org/project/apache-superset/ If you have any usage questions, or have problems when upgrading or find any problems about enhancements included in this release, please -don’t hesitate to let us know by sending feedback to this mailing +don't hesitate to let us know by sending feedback to this mailing list. ===== diff --git a/RELEASING/send_email.py b/RELEASING/send_email.py index 936d464bc9728..27da07f8d2c8e 100755 --- a/RELEASING/send_email.py +++ b/RELEASING/send_email.py @@ -123,9 +123,7 @@ def __repr__(self): help="Your Apache email this will be used for SMTP From", ) @click.option( - "--apache_username", - prompt="Apache username", - help="Your LDAP Apache username", + "--apache_username", prompt="Apache username", help="Your LDAP Apache username" ) @click.option( "--apache_password", @@ -196,7 +194,9 @@ def vote_pmc(base_parameters, receiver_email): prompt="A List of people with -1 vote (ex: John)", ) @click.pass_obj -def result_pmc(base_parameters, receiver_email, vote_bindings, vote_nonbindings, vote_negatives): +def result_pmc( + base_parameters, receiver_email, vote_bindings, vote_nonbindings, vote_negatives +): template_file = "email_templates/result_pmc.j2" base_parameters.template_arguments["receiver_email"] = receiver_email base_parameters.template_arguments["vote_bindings"] = string_comma_to_list( @@ -257,10 +257,39 @@ def vote_ipmc(base_parameters, receiver_email, voting_thread, vote_mentors): type=str, prompt="The receiver email (To:)", ) +@click.option( + "--vote_bindings", + default="", + type=str, + prompt="A List of people with +1 binding vote (ex: Alan,Justin)", +) +@click.option( + "--vote_nonbindings", + default="", + type=str, + prompt="A List of people with +1 non binding vote (ex: Ville)", +) +@click.option( + "--vote_negatives", + default="", + type=str, + prompt="A List of people with -1 vote (ex: John)", +) @click.pass_obj -def result_ipmc(base_parameters, receiver_email): +def result_ipmc( + base_parameters, receiver_email, vote_bindings, vote_nonbindings, vote_negatives +): template_file = "email_templates/result_ipmc.j2" base_parameters.template_arguments["receiver_email"] = receiver_email + base_parameters.template_arguments["vote_bindings"] = string_comma_to_list( + vote_bindings + ) + base_parameters.template_arguments["vote_nonbindings"] = string_comma_to_list( + vote_nonbindings + ) + base_parameters.template_arguments["vote_negatives"] = string_comma_to_list( + vote_negatives + ) message = render_template(template_file, **base_parameters.template_arguments) inter_send_email( base_parameters.username, diff --git a/UPDATING.md b/UPDATING.md index 34c8e14e71200..83909708f55f5 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -21,7 +21,11 @@ under the License. This file documents any backwards-incompatible changes in Superset and assists people when migrating to a new version. -## Next Version +## 0.35.0 + +* [8512](https://github.com/apache/incubator-superset/pull/8512): `DRUID_IS_ACTIVE` now +defaults to False. To enable Druid-API-based functionality, override the +`DRUID_IS_ACTIVE` configuration variable by setting it to `True` for your deployment. * [8450](https://github.com/apache/incubator-superset/pull/8450): The time ranger picker now uses UTC for the tooltips and default placeholder timestamps (sans timezone). diff --git a/superset/app.py b/superset/app.py index efa0622808a88..5eb246eb52ea1 100644 --- a/superset/app.py +++ b/superset/app.py @@ -96,6 +96,22 @@ def post_init(self) -> None: def configure_celery(self) -> None: celery_app.config_from_object(self.config["CELERY_CONFIG"]) celery_app.set_default() + flask_app = self.flask_app + + # Here, we want to ensure that every call into Celery task has an app context + # setup properly + task_base = celery_app.Task + + class AppContextTask(task_base): # type: ignore + # pylint: disable=too-few-public-methods + abstract = True + + # Grab each call into the task and set up an app context + def __call__(self, *args, **kwargs): + with flask_app.app_context(): + return task_base.__call__(self, *args, **kwargs) + + celery_app.Task = AppContextTask @staticmethod def init_views() -> None: diff --git a/superset/assets/package.json b/superset/assets/package.json index ab7a384c7a24f..6d6d4ae0b1d57 100644 --- a/superset/assets/package.json +++ b/superset/assets/package.json @@ -17,7 +17,7 @@ "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors --progress", "lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json ./{src,spec}/**/*.ts{,x}", "lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json --fix ./{src,spec}/**/*.ts{,x} && npm run clean-css", - "clean-css": "prettier --write src/**/*.{css,less,sass,scss}", + "clean-css": "prettier --write 'src/**/*.{css,less,sass,scss}'", "cypress": "cypress", "cypress-debug": "cypress open --config watchForFileChanges=true", "install-cypress": "npm install cypress@3.6.1" @@ -233,7 +233,8 @@ }, "stylelint": { "rules": { - "block-opening-brace-space-before": "always" + "block-opening-brace-space-before": "always", + "no-missing-end-of-source-newline": "never" } } } diff --git a/superset/assets/src/CRUD/crud.less b/superset/assets/src/CRUD/crud.less index af1838e959713..478e08f8f4d37 100644 --- a/superset/assets/src/CRUD/crud.less +++ b/superset/assets/src/CRUD/crud.less @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +@import "../../stylesheets/less/variables.less"; + .CRUD { .text-right { text-align: right; @@ -24,24 +26,24 @@ padding: 10px; } .control-label { - font-weight: bold; - font-size: 16px; + font-weight: @font-weight-bold; + font-size: @font-size-l; } .tiny-cell { width: 5px; } i.fa-caret-down, i.fa-caret-up { - width: "5px"; + width: 5px; } td.expanded { - border-top: "0px"; - padding: "0px"; + border-top: 0; + padding: 0; } .frame { - border: "1px solid #AAA"; + border: 1px solid @gray-heading; border-radius: 5; padding: 10; - background: "#F4F4F4"; + background: @gray-bg; } } diff --git a/superset/assets/src/SqlLab/components/TableElement.jsx b/superset/assets/src/SqlLab/components/TableElement.jsx index b130c54bba3ee..a1ba5a567abc7 100644 --- a/superset/assets/src/SqlLab/components/TableElement.jsx +++ b/superset/assets/src/SqlLab/components/TableElement.jsx @@ -196,7 +196,7 @@ class TableElement extends React.PureComponent {
{ this.toggleTable(e); }} > diff --git a/superset/assets/src/SqlLab/main.less b/superset/assets/src/SqlLab/main.less index ee2faaa14c184..e06cb333bd502 100644 --- a/superset/assets/src/SqlLab/main.less +++ b/superset/assets/src/SqlLab/main.less @@ -126,7 +126,8 @@ div.Workspace { form { margin-block-end: 0; } - .leftItems form, .rightItems { + .leftItems form, + .rightItems { & > span { margin-right: 5px; margin-bottom: 5px; @@ -151,12 +152,12 @@ div.Workspace { height: 10px; display: inline-block; background-color: @gray-light; - line-height: 8px; + line-height: 8px; // set specifically for closing 'x' text-align: center; vertical-align: middle; - font-size: 15px; + font-size: @font-size-m; margin-top: -3px; - font-weight: bold; + font-weight: @font-weight-bold; } .running { background-color: fade(@success, @opacity-heavy); @@ -185,7 +186,7 @@ div.Workspace { padding: 0px !important; margin: 0px; border: none; - font-size: 12px; + font-size: @font-size-s; background-color: transparent !important; } @@ -233,7 +234,7 @@ div.Workspace { .ddbtn-tab { font-size: inherit; - font-weight: bold; + font-weight: @font-weight-bold; &:active { background: none; @@ -361,7 +362,7 @@ a.Link { border: none; text-align: left; color: @lightest; - font-size: 10px; + font-size: @font-size-xs; } .tooltip-inner { max-width: 500px; @@ -414,5 +415,5 @@ a.Link { } .cost-estimate { - font-size: 12px; + font-size: @font-size-s; } diff --git a/superset/assets/src/chart/chart.less b/superset/assets/src/chart/chart.less index b8cc75ab1ad54..18e8a1050985a 100644 --- a/superset/assets/src/chart/chart.less +++ b/superset/assets/src/chart/chart.less @@ -16,7 +16,9 @@ * specific language governing permissions and limitations * under the License. */ +@import "../../stylesheets/less/variables.less"; + .chart-tooltip { opacity: 0.75; - font-size: 12px; + font-size: @font-size-s; } diff --git a/superset/assets/src/components/FilterEditIcon.jsx b/superset/assets/src/components/FilterEditIcon.jsx deleted file mode 100644 index 1daa89524375d..0000000000000 --- a/superset/assets/src/components/FilterEditIcon.jsx +++ /dev/null @@ -1,42 +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 React from 'react'; -import PropTypes from 'prop-types'; - -import './FilterEditIcon.less'; - -const propTypes = { - clickIconHandler: PropTypes.func, -}; - -export default function FilterEditIcon({ clickIconHandler = () => {} }) { - return ( - - - - ); -} - -FilterEditIcon.propTypes = propTypes; diff --git a/superset/assets/src/components/FilterEditIcon.less b/superset/assets/src/components/FilterEditIcon.less deleted file mode 100644 index dd8195c41c5e0..0000000000000 --- a/superset/assets/src/components/FilterEditIcon.less +++ /dev/null @@ -1,26 +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 "../../stylesheets/less/variables.less"; - -.filter-edit { - cursor: pointer; - path { - fill: @lightest; - } -} diff --git a/superset/assets/src/components/FilterableTable/FilterableTableStyles.less b/superset/assets/src/components/FilterableTable/FilterableTableStyles.less index dc567273e2ed3..510ac4b9ac85f 100644 --- a/superset/assets/src/components/FilterableTable/FilterableTableStyles.less +++ b/superset/assets/src/components/FilterableTable/FilterableTableStyles.less @@ -17,13 +17,13 @@ * under the License. */ -@import '../../../stylesheets/less/variables.less'; +@import "../../../stylesheets/less/variables.less"; .ReactVirtualized__Grid__innerScrollContainer { border: 1px solid; } .ReactVirtualized__Table__headerRow { - font-weight: 700; + font-weight: @font-weight-bold; display: flex; flex-direction: row; align-items: center; @@ -48,10 +48,10 @@ border-right: 1px solid @gray-light; align-self: center; padding: 12px; - font-size: 12px; + font-size: @font-size-s; } .grid-header-cell { - font-weight: 700; + font-weight: @font-weight-bold; } .ReactVirtualized__Table__headerColumn:last-of-type, .ReactVirtualized__Table__rowColumn:last-of-type { @@ -78,8 +78,12 @@ width: 1em; fill: currentColor; } -.even-row { background: @gray-bg; } -.odd-row { background: @lightest; } +.even-row { + background: @gray-bg; +} +.odd-row { + background: @lightest; +} .header-style { overflow: hidden; text-overflow: ellipsis; @@ -93,5 +97,5 @@ } .cell-text-for-measuring { font-family: Helvetica, Arial, sans-serif; - font-size: 12px; + font-size: @font-size-s; } diff --git a/superset/assets/src/components/RefreshLabel.less b/superset/assets/src/components/RefreshLabel.less index 3bf895b1cf3af..a1b055f6fa38e 100644 --- a/superset/assets/src/components/RefreshLabel.less +++ b/superset/assets/src/components/RefreshLabel.less @@ -23,5 +23,5 @@ } .RefreshLabel { - color: @gray-light; + color: @bs-gray-light; } diff --git a/superset/assets/src/dashboard/components/FilterIndicatorTooltip.jsx b/superset/assets/src/dashboard/components/FilterIndicatorTooltip.jsx index 6aab00d9073ab..93e42fbe5b447 100644 --- a/superset/assets/src/dashboard/components/FilterIndicatorTooltip.jsx +++ b/superset/assets/src/dashboard/components/FilterIndicatorTooltip.jsx @@ -21,8 +21,6 @@ import PropTypes from 'prop-types'; import { t } from '@superset-ui/translation'; import { isEmpty } from 'lodash'; -import FilterEditIcon from '../../components/FilterEditIcon'; - const propTypes = { label: PropTypes.string.isRequired, values: PropTypes.array.isRequired, @@ -48,7 +46,12 @@ export default function FilterIndicatorTooltip({
{clickIconHandler && ( - + )} ); diff --git a/superset/assets/src/dashboard/stylesheets/builder-sidepane.less b/superset/assets/src/dashboard/stylesheets/builder-sidepane.less index 1ae4a6f9921c7..2f8155400b90e 100644 --- a/superset/assets/src/dashboard/stylesheets/builder-sidepane.less +++ b/superset/assets/src/dashboard/stylesheets/builder-sidepane.less @@ -22,8 +22,8 @@ position: relative; .dashboard-builder-sidepane-header { - font-size: 15px; - font-weight: 700; + font-size: @font-size-l; + font-weight: @font-weight-bold; border-top: 1px solid @gray-light; border-bottom: 1px solid @gray-light; padding: 16px; @@ -32,7 +32,7 @@ } .trigger { - font-size: 16px; + font-size: @font-size-l; color: @almost-black; opacity: 1; margin-left: auto; @@ -92,7 +92,7 @@ .chart-card-container { .chart-card { border: 1px solid @gray-light; - font-weight: 200; + font-weight: @font-weight-light; padding: 16px; margin: 0 16px 16px 16px; position: relative; @@ -107,7 +107,7 @@ .card-title { margin-right: 60px; margin-bottom: 8px; - font-weight: 800; + font-weight: @font-weight-bold; } .card-body { @@ -119,7 +119,7 @@ word-break: break-all; &:first-child { - font-weight: 400; + font-weight: @font-weight-normal; } } } @@ -133,8 +133,8 @@ .is-added-label { background: @almost-black; color: @lightest; - font-size: 12px; - line-height: 1em; + font-size: @font-size-s; + line-height: @line-height-tight; text-transform: uppercase; position: absolute; padding: 4px 8px; @@ -164,8 +164,7 @@ .dropdown.btn-group button, input { - font-size: 14px; - line-height: 16px; + font-size: @font-size-m; padding: 7px 12px; height: 32px; border: 1px solid @gray-light; diff --git a/superset/assets/src/dashboard/stylesheets/buttons.less b/superset/assets/src/dashboard/stylesheets/buttons.less index 709a7fbddda25..501b2e7c4cae9 100644 --- a/superset/assets/src/dashboard/stylesheets/buttons.less +++ b/superset/assets/src/dashboard/stylesheets/buttons.less @@ -16,9 +16,11 @@ * specific language governing permissions and limitations * under the License. */ +@import '../../../stylesheets/less/variables.less'; + .icon-button { color: @gray; - font-size: 1.2em; + font-size: @font-size-l; display: flex; flex-direction: row; align-items: center; @@ -37,5 +39,5 @@ .icon-button-label { color: @gray-dark; padding-left: 8px; - font-size: 0.9em; + font-size: @font-size-m; } diff --git a/superset/assets/src/dashboard/stylesheets/components/chart.less b/superset/assets/src/dashboard/stylesheets/components/chart.less index 1d03578e72d02..2e1544794c812 100644 --- a/superset/assets/src/dashboard/stylesheets/components/chart.less +++ b/superset/assets/src/dashboard/stylesheets/components/chart.less @@ -31,7 +31,7 @@ overflow-y: auto; .missing-chart-body { - font-size: 12px; + font-size: @font-size-s; } .loading-container { @@ -42,7 +42,8 @@ &.fade-in { border-radius: 4px; - box-shadow: inset 0 0 0 2px fade(@shadow-highlight, 1), 0 0 0 3px fade(@shadow-highlight, @opacity-light); + box-shadow: inset 0 0 0 2px fade(@shadow-highlight, 1), + 0 0 0 3px fade(@shadow-highlight, @opacity-light); transition: box-shadow 1s ease-in-out; } diff --git a/superset/assets/src/dashboard/stylesheets/components/divider.less b/superset/assets/src/dashboard/stylesheets/components/divider.less index 7cea082b7e33d..7ee4956ddfc09 100644 --- a/superset/assets/src/dashboard/stylesheets/components/divider.less +++ b/superset/assets/src/dashboard/stylesheets/components/divider.less @@ -23,7 +23,7 @@ } .dashboard-component-divider:after { - content: ""; + content: ''; height: 1px; width: 100%; background-color: @gray-light; @@ -31,7 +31,7 @@ } .new-component-placeholder.divider-placeholder:after { - content: ""; + content: ''; height: 2px; width: 100%; background-color: @gray-light; diff --git a/superset/assets/src/dashboard/stylesheets/components/header.less b/superset/assets/src/dashboard/stylesheets/components/header.less index 26d06ecb81f92..81b4ce14d1d4f 100644 --- a/superset/assets/src/dashboard/stylesheets/components/header.less +++ b/superset/assets/src/dashboard/stylesheets/components/header.less @@ -18,8 +18,7 @@ */ .dashboard-component-header { width: 100%; - line-height: 1.1; - font-weight: 700; + font-weight: @font-weight-bold; padding: 16px 0; color: @almost-black; } @@ -42,36 +41,30 @@ } .dashboard-header .dashboard-component-header { - font-weight: 300; + font-weight: @font-weight-light; width: auto; } -.dashboard-header .undo-action, -.dashboard-header .redo-action { - line-height: 18px; - font-size: 12px; -} - .dashboard--editing .dragdroppable-row .dashboard-component-header { cursor: move; } .header-style-option { - font-weight: 700; + font-weight: @font-weight-bold; color: @almost-black; } /* note: sizes should be a multiple of the 8px grid unit so that rows in the grid align */ .header-small { - font-size: 16px; + font-size: @font-size-l; } .header-medium { - font-size: 24px; + font-size: @font-size-xl; } .header-large { - font-size: 32px; + font-size: @font-size-xxl; } .background--white .dashboard-component-header, diff --git a/superset/assets/src/dashboard/stylesheets/components/index.less b/superset/assets/src/dashboard/stylesheets/components/index.less index 17b383b2fbf0e..4669bd830bc01 100644 --- a/superset/assets/src/dashboard/stylesheets/components/index.less +++ b/superset/assets/src/dashboard/stylesheets/components/index.less @@ -23,4 +23,4 @@ @import './new-component.less'; @import './row.less'; @import './tabs.less'; -@import './markdown.less'; \ No newline at end of file +@import './markdown.less'; diff --git a/superset/assets/src/dashboard/stylesheets/components/markdown.less b/superset/assets/src/dashboard/stylesheets/components/markdown.less index 722d1e8e29357..3970af9773a67 100644 --- a/superset/assets/src/dashboard/stylesheets/components/markdown.less +++ b/superset/assets/src/dashboard/stylesheets/components/markdown.less @@ -19,15 +19,16 @@ .dashboard-markdown { overflow: hidden; - h4, h5 { - font-weight: 300; + h4, + h5 { + font-weight: @font-weight-light; } h5 { color: @gray-heading; } h6 { - font-weight: 400; - font-size: 12px; + font-weight: @font-weight-normal; + font-size: @font-size-s; } .dashboard-component-chart-holder { diff --git a/superset/assets/src/dashboard/stylesheets/components/new-component.less b/superset/assets/src/dashboard/stylesheets/components/new-component.less index bd33746a95469..0bae3c18e51da 100644 --- a/superset/assets/src/dashboard/stylesheets/components/new-component.less +++ b/superset/assets/src/dashboard/stylesheets/components/new-component.less @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +@import '../../../../stylesheets/less/variables.less'; + .new-component { display: flex; flex-direction: row; @@ -41,9 +43,11 @@ align-items: center; justify-content: center; color: @gray; - font-size: 1.5em; -} - -.new-component-placeholder.fa-window-restore { - font-size: 1em; + font-size: @font-size-xxl; + &.fa-window-restore { + font-size: @font-size-l; + } + &.fa-area-chart { + font-size: @font-size-xl; + } } diff --git a/superset/assets/src/dashboard/stylesheets/components/tabs.less b/superset/assets/src/dashboard/stylesheets/components/tabs.less index 6bf636c205007..549647bd7412b 100644 --- a/superset/assets/src/dashboard/stylesheets/components/tabs.less +++ b/superset/assets/src/dashboard/stylesheets/components/tabs.less @@ -31,7 +31,7 @@ color: @almost-black; border: none; padding: 12px 0 14px 0; - font-size: 15px; + font-size: @font-size-m; margin-right: 0; } @@ -71,7 +71,7 @@ & .fa-plus { color: @gray-dark; - font-size: 14px; + font-size: @font-size-m; margin-top: 3px; } @@ -90,7 +90,11 @@ height: 3px; width: 100%; bottom: 0; - background: linear-gradient(to right, @indicator-color, shade(@indicator-color, @colorstop-two)); + background: linear-gradient( + to right, + @indicator-color, + shade(@indicator-color, @colorstop-two) + ); } } diff --git a/superset/assets/src/dashboard/stylesheets/dashboard.less b/superset/assets/src/dashboard/stylesheets/dashboard.less index 3f3a300a62dab..c926a511eba53 100644 --- a/superset/assets/src/dashboard/stylesheets/dashboard.less +++ b/superset/assets/src/dashboard/stylesheets/dashboard.less @@ -23,17 +23,17 @@ header.top { body { h1 { - font-weight: 600; - line-height: normal; - font-size: 24px; + font-weight: @font-weight-bold; + line-height: @line-height-base; + font-size: @font-size-xxl; letter-spacing: -0.2px; margin-top: 12px; margin-bottom: 12px; } h2 { - font-weight: 600; - line-height: normal; - font-size: 20px; + font-weight: @font-weight-bold; + line-height: @line-height-base; + font-size: @font-size-xl; margin-top: 12px; margin-bottom: 8px; } @@ -41,9 +41,9 @@ body { h4, h5, h6 { - font-weight: 600; - line-height: normal; - font-size: 16px; + font-weight: @font-weight-bold; + line-height: @line-height-base; + font-size: @font-size-l; letter-spacing: 0.2px; margin-top: 8px; margin-bottom: 4px; @@ -55,8 +55,8 @@ body { .dashboard .chart-header { position: relative; - font-size: 16px; - font-weight: bold; + font-size: @font-size-l; + font-weight: @font-weight-bold; .dropdown.btn-group { position: absolute; @@ -77,14 +77,6 @@ body { margin: 5px 0; } - .fa-circle { - position: absolute; - left: 7px; - top: 18px; - font-size: 4px; - color: @pink; - } - .refresh-tooltip { display: block; height: 16px; @@ -142,9 +134,7 @@ body { .dropdown-menu li a { padding: 3px 16px; color: @almost-black; - line-height: 16px; - font-size: 14px; - letter-spacing: 0.4px; + font-size: @font-size-m; &:hover, &:focus { @@ -217,7 +207,7 @@ body { align-items: center; .favstar { - font-size: 24px; + font-size: @font-size-xl; position: relative; margin-left: 8px; } diff --git a/superset/assets/src/dashboard/stylesheets/filter-indicator-tooltip.less b/superset/assets/src/dashboard/stylesheets/filter-indicator-tooltip.less index bc8473ecda1a7..54518aeced3a8 100644 --- a/superset/assets/src/dashboard/stylesheets/filter-indicator-tooltip.less +++ b/superset/assets/src/dashboard/stylesheets/filter-indicator-tooltip.less @@ -16,8 +16,10 @@ * specific language governing permissions and limitations * under the License. */ +@import '../../../stylesheets/less/variables.less'; + #filter-indicator-tooltip { - font-size: 15px; + font-size: @font-size-m; text-align: left; > .tooltip-arrow { @@ -40,7 +42,6 @@ position: relative; .filter-content { - line-height: 22px; margin-right: 22px; text-align: left; display: flex; @@ -48,7 +49,7 @@ align-items: stretch; label { - font-weight: 700; + font-weight: @font-weight-bold; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; @@ -57,6 +58,7 @@ } .filter-edit { + cursor: pointer; position: absolute; top: 4px; right: 0; diff --git a/superset/assets/src/dashboard/stylesheets/filter-indicator.less b/superset/assets/src/dashboard/stylesheets/filter-indicator.less index 462aae979854b..0f63f46e95ea1 100644 --- a/superset/assets/src/dashboard/stylesheets/filter-indicator.less +++ b/superset/assets/src/dashboard/stylesheets/filter-indicator.less @@ -59,7 +59,8 @@ } .show-outline .filter-indicator-group { - box-shadow: @shadow-highlight -2px 0 0 0, @lightest -4px 0 0 0, @gray-light -6px 0 0 0; + box-shadow: @shadow-highlight -2px 0 0 0, @lightest -4px 0 0 0, + @gray-light -6px 0 0 0; } .dashboard-component-chart-holder, @@ -85,4 +86,3 @@ box-shadow: @lightest -4px 0 0 0, @gray-light -6px 0 0 0; } } - diff --git a/superset/assets/src/dashboard/stylesheets/filter-scope-selector.less b/superset/assets/src/dashboard/stylesheets/filter-scope-selector.less index 0f65c7f6f1b4d..61daaf8fad231 100644 --- a/superset/assets/src/dashboard/stylesheets/filter-scope-selector.less +++ b/superset/assets/src/dashboard/stylesheets/filter-scope-selector.less @@ -16,14 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -@import "../../../stylesheets/less/cosmo/variables.less"; +@import '../../../stylesheets/less/cosmo/variables.less'; .filter-scope-container { display: flex; flex-direction: column; height: 80%; margin-right: -24px; - font-size: 14px; + font-size: @font-size-m; .nav.nav-tabs { border: none; @@ -41,7 +41,7 @@ .dashboard-modal-actions-container { height: 64px; - border-top: 1px solid #ccc; + border-top: 1px solid @gray-light; padding: 24px; margin: 0 0 0 -24px; } @@ -53,7 +53,7 @@ .filter-scope-header { height: 64px; - border-bottom: 1px solid #ccc; + border-bottom: 1px solid @gray-light; padding-left: 24px; margin-left: -24px; @@ -81,14 +81,16 @@ position: relative; height: 100%; - a, a:active, a:hover { + a, + a:active, + a:hover { color: @almost-black; text-decoration: none; } .react-checkbox-tree .rct-icon.rct-icon-expand-all, .react-checkbox-tree .rct-icon.rct-icon-collapse-all { - font-size: 13px; + font-size: @font-size-m; font-family: @font-family-sans-serif; color: @brand-primary; @@ -109,11 +111,11 @@ position: relative; width: 40%; padding: 16px 16px 16px 0; - border-right: 1px solid #ccc; + border-right: 1px solid @gray-light; .filter-container { label { - font-weight: normal; + font-weight: @font-weight-normal; margin: 0 0 0 16px; word-break: break-all; } @@ -127,16 +129,16 @@ margin-left: -24px; &.is-selected { - border: 1px solid #aaa; + border: 1px solid @gray-heading; border-radius: 4px; - background-color: #eee; + background-color: @gray-bg; margin-left: -25px; } } .react-checkbox-tree { .rct-title .root { - font-weight: bold; + font-weight: @font-weight-bold; } .rct-text { @@ -154,7 +156,7 @@ .react-checkbox-tree { flex-direction: column; color: @almost-black; - font-size: 14px; + font-size: @font-size-m; .filter-scope-type { padding: 8px 0; @@ -167,16 +169,16 @@ } &.chart { - font-weight: normal; + font-weight: @font-weight-normal; } &.selected-filter { padding-left: 28px; position: relative; - color: #aaa; + color: @gray-heading; &::before { - content: " "; + content: ' '; position: absolute; left: 0; top: 50%; @@ -184,13 +186,13 @@ height: 18px; border-radius: 2px; margin-top: -9px; - box-shadow: inset 0 0 0 2px #ccc; + box-shadow: inset 0 0 0 2px @gray-light; background: #f2f2f2; } } &.root { - font-weight: bold; + font-weight: @font-weight-bold; } } @@ -256,9 +258,9 @@ right: 16px; top: 16px; border-radius: 4px; - border: 1px solid #ccc; + border: 1px solid @gray-light; padding: 4px 8px 4px 8px; - font-size: 13px; + font-size: @font-size-m; outline: none; &:focus { diff --git a/superset/assets/src/dashboard/stylesheets/hover-menu.less b/superset/assets/src/dashboard/stylesheets/hover-menu.less index 729bf1efa019c..077fc1a13002f 100644 --- a/superset/assets/src/dashboard/stylesheets/hover-menu.less +++ b/superset/assets/src/dashboard/stylesheets/hover-menu.less @@ -20,7 +20,7 @@ opacity: 0; position: absolute; z-index: 10; - font-size: 14px; + font-size: @font-size-m; } .hover-menu--left { diff --git a/superset/assets/src/dashboard/stylesheets/popover-menu.less b/superset/assets/src/dashboard/stylesheets/popover-menu.less index ec15daf1675ea..c61af2dd534c2 100644 --- a/superset/assets/src/dashboard/stylesheets/popover-menu.less +++ b/superset/assets/src/dashboard/stylesheets/popover-menu.less @@ -51,7 +51,7 @@ padding: 0 16px; background: @lightest; box-shadow: 0 1px 2px 1px fade(@darkest, @opacity-medium-light); - font-size: 14px; + font-size: @font-size-m; cursor: default; z-index: 1000; } @@ -115,7 +115,7 @@ .hover-dropdown li.dropdown-item.active a, .popover-menu li.dropdown-item.active a { background: @gray-light; - font-weight: bold; + font-weight: @font-weight-bold; color: @almost-black; } diff --git a/superset/assets/src/dashboard/stylesheets/resizable.less b/superset/assets/src/dashboard/stylesheets/resizable.less index 2bbf3a8a2bea1..68a399319137a 100644 --- a/superset/assets/src/dashboard/stylesheets/resizable.less +++ b/superset/assets/src/dashboard/stylesheets/resizable.less @@ -23,7 +23,7 @@ /* after ensures border visibility on top of any children */ .resizable-container--resizing:after { - content: ""; + content: ''; position: absolute; top: 0; left: 0; @@ -37,10 +37,10 @@ z-index: 10; } - .resizable-container:hover .resize-handle, - .resizable-container--resizing .resize-handle { - opacity: 1; - } +.resizable-container:hover .resize-handle, +.resizable-container--resizing .resize-handle { + opacity: 1; +} .resize-handle--bottom-right { position: absolute; @@ -54,7 +54,6 @@ height: 8px; } - .resize-handle--right { width: 2px; height: 20px; diff --git a/superset/assets/src/dashboard/util/activeDashboardFilters.js b/superset/assets/src/dashboard/util/activeDashboardFilters.js index 3674eb3960ed4..01d66ac2c21a5 100644 --- a/superset/assets/src/dashboard/util/activeDashboardFilters.js +++ b/superset/assets/src/dashboard/util/activeDashboardFilters.js @@ -24,6 +24,7 @@ import { getDashboardFilterKey, } from './getDashboardFilterKey'; import { CHART_TYPE } from '../util/componentTypes'; +import { DASHBOARD_FILTER_SCOPE_GLOBAL } from '../reducers/dashboardFilters'; let allFilterBoxChartIds = []; let activeFilters = {}; @@ -61,7 +62,9 @@ export function getAppliedFilterValues(chartId) { return appliedFilterValuesByChart[chartId]; } -export function getChartIdsInFilterScope({ filterScope }) { +export function getChartIdsInFilterScope({ + filterScope = DASHBOARD_FILTER_SCOPE_GLOBAL, +}) { function traverse(chartIds = [], component = {}, immuneChartIds = []) { if (!component) { return; diff --git a/superset/assets/src/dashboard/util/getFilterConfigsFromFormdata.js b/superset/assets/src/dashboard/util/getFilterConfigsFromFormdata.js index 12c275cfec1df..dccb6a27f934c 100644 --- a/superset/assets/src/dashboard/util/getFilterConfigsFromFormdata.js +++ b/superset/assets/src/dashboard/util/getFilterConfigsFromFormdata.js @@ -18,12 +18,20 @@ */ /* eslint-disable camelcase */ import { + TIME_FILTER_MAP, TIME_RANGE, FILTER_LABELS, } from '../../visualizations/FilterBox/FilterBox'; export default function getFilterConfigsFromFormdata(form_data = {}) { - const { date_filter, filter_configs = [] } = form_data; + const { + date_filter, + filter_configs = [], + show_druid_time_granularity, + show_druid_time_origin, + show_sqla_time_column, + show_sqla_time_granularity, + } = form_data; let configs = filter_configs.reduce( ({ columns, labels }, config) => { const updatedColumns = { @@ -44,15 +52,43 @@ export default function getFilterConfigsFromFormdata(form_data = {}) { ); if (date_filter) { - const updatedColumns = { + let updatedColumns = { ...configs.columns, - [TIME_RANGE]: form_data[TIME_RANGE], + [TIME_FILTER_MAP.time_range]: form_data.time_range, }; const updatedLabels = { ...configs.labels, - [TIME_RANGE]: FILTER_LABELS[TIME_RANGE], + [TIME_FILTER_MAP.time_range]: FILTER_LABELS[TIME_RANGE], }; + if (show_sqla_time_column) { + updatedColumns = { + ...updatedColumns, + [TIME_FILTER_MAP.time_grain_sqla]: form_data.time_grain_sqla, + }; + } + + if (show_sqla_time_granularity) { + updatedColumns = { + ...updatedColumns, + [TIME_FILTER_MAP.granularity_sqla]: form_data.granularity_sqla, + }; + } + + if (show_druid_time_granularity) { + updatedColumns = { + ...updatedColumns, + [TIME_FILTER_MAP.granularity]: form_data.granularity, + }; + } + + if (show_druid_time_origin) { + updatedColumns = { + ...updatedColumns, + [TIME_FILTER_MAP.druid_time_origin]: form_data.druid_time_origin, + }; + } + configs = { ...configs, columns: updatedColumns, diff --git a/superset/assets/src/datasource/main.less b/superset/assets/src/datasource/main.less index 9959a92a68be2..e91f0ffb0ed7e 100644 --- a/superset/assets/src/datasource/main.less +++ b/superset/assets/src/datasource/main.less @@ -29,5 +29,5 @@ } .Datasource .change-warning .bold { - font-weight: bold; + font-weight: @font-weight-bold; } diff --git a/superset/assets/src/explore/components/controls/CollectionControl.less b/superset/assets/src/explore/components/controls/CollectionControl.less index bd78f7fb8b37a..5d23e4e3cbbf2 100644 --- a/superset/assets/src/explore/components/controls/CollectionControl.less +++ b/superset/assets/src/explore/components/controls/CollectionControl.less @@ -17,5 +17,5 @@ * under the License. */ .CollectionControl .list-group-item i.fa { - padding-top: 5px; + padding-top: 5px; } diff --git a/superset/assets/src/explore/components/controls/DatasourceControl.less b/superset/assets/src/explore/components/controls/DatasourceControl.less index b1f8db0658bdc..711ea2672c73a 100644 --- a/superset/assets/src/explore/components/controls/DatasourceControl.less +++ b/superset/assets/src/explore/components/controls/DatasourceControl.less @@ -19,19 +19,19 @@ @import "../../../../stylesheets/less/variables.less"; #datasource_menu { - border-radius: 2px; - padding-left: 8px; - padding-right: 8px; + border-radius: 2px; + padding-left: 8px; + padding-right: 8px; } #datasource_menu .caret { - position: relative; - padding-right: 8px; - margin-left: 4px; - color: @lightest; - top: -8px; + position: relative; + padding-right: 8px; + margin-left: 4px; + color: @lightest; + top: -8px; } #datasource_menu + ul { - margin-top: 26px; + margin-top: 26px; } diff --git a/superset/assets/src/explore/components/controls/DateFilterControl.less b/superset/assets/src/explore/components/controls/DateFilterControl.less index 9ceb6fd1a088b..ed5a0ac0f2f14 100644 --- a/superset/assets/src/explore/components/controls/DateFilterControl.less +++ b/superset/assets/src/explore/components/controls/DateFilterControl.less @@ -16,6 +16,8 @@ * specific language governing permissions and limitations * under the License. */ +@import "../../../../stylesheets/less/variables.less"; + .rdtPicker table { - font-size: 12; + font-size: @font-size-s; } diff --git a/superset/assets/src/explore/components/controls/VizTypeControl.less b/superset/assets/src/explore/components/controls/VizTypeControl.less index 915d5b7d7b51c..b737d1c25358e 100644 --- a/superset/assets/src/explore/components/controls/VizTypeControl.less +++ b/superset/assets/src/explore/components/controls/VizTypeControl.less @@ -16,10 +16,12 @@ * specific language governing permissions and limitations * under the License. */ +@import "../../../../stylesheets/less/variables.less"; + .viztype-label { margin-top: 10px; text-align: center; - font-size: 14px; + font-size: @font-size-m; } .viztype-selector-container { @@ -29,7 +31,7 @@ } .viztype-selector-container:hover img { - border: 1px solid #aaa; + border: 1px solid @gray-heading; } .viztype-selector-container.selected { @@ -38,13 +40,13 @@ } .viztype-selector-container.selected img { - border: 1px solid #333; + border: 1px solid @almost-black; } .viztype-selector-container img { - border: 1px solid #ddd; + border: 1px solid @gray-light; border-radius: 4px; - transition: border-color .2s; + transition: border-color 0.2s; } .viztype-control-search-box { diff --git a/superset/assets/src/explore/main.less b/superset/assets/src/explore/main.less index e915562ec065b..8e73bf7ec960b 100644 --- a/superset/assets/src/explore/main.less +++ b/superset/assets/src/explore/main.less @@ -39,7 +39,7 @@ .fave-unfave-icon, .edit-desc-icon { padding: 0 0 0 0.5em; - font-size: 14px; + font-size: @font-size-m; } .checkbox { @@ -99,7 +99,6 @@ } .input-inline { float: left; - display: inline-block; padding-right: 3px; } .input-inline .Select-control { @@ -131,7 +130,7 @@ width: 30px; display: inline-block; text-align: center; - font-weight: bold; + font-weight: @font-weight-bold; } .datasource-container { @@ -179,7 +178,7 @@ } .filter-edit-clause-info { - font-size: 10px; + font-size: @font-size-xs; padding-left: 5px; } @@ -197,12 +196,12 @@ .label-default { background-color: @gray; - font-weight: normal; + font-weight: @font-weight-normal; } .btn.label-btn { background-color: @gray; - font-weight: normal; + font-weight: @font-weight-normal; color: @lightest; padding: 5px 4px 4px; border: 0; @@ -230,7 +229,7 @@ } .adhoc-label-arrow { - font-size: 9px; + font-size: @font-size-xxs; margin-left: 3px; position: static; } @@ -245,14 +244,14 @@ .custom-sql-disabled-message { color: @gray; - font-size: 11px; + font-size: @font-size-xs; text-align: center; margin-top: 60px; } h1.section-header { - font-size: 14px; - font-weight: bold; + font-size: @font-size-m; + font-weight: @font-weight-bold; margin-bottom: 0; margin-top: 0; padding-bottom: 5px; @@ -260,8 +259,8 @@ h1.section-header { } h2.section-header { - font-size: 13px; - font-weight: bold; + font-size: @font-size-s; + font-weight: @font-weight-bold; margin-bottom: 0; margin-top: 0; padding-bottom: 5px; diff --git a/superset/assets/src/visualizations/FilterBox/FilterBox.jsx b/superset/assets/src/visualizations/FilterBox/FilterBox.jsx index fad0bff3f56dd..40a954eb469f1 100644 --- a/superset/assets/src/visualizations/FilterBox/FilterBox.jsx +++ b/superset/assets/src/visualizations/FilterBox/FilterBox.jsx @@ -36,7 +36,7 @@ import FilterBadgeIcon from '../../components/FilterBadgeIcon'; import './FilterBox.less'; // maps control names to their key in extra_filters -const TIME_FILTER_MAP = { +export const TIME_FILTER_MAP = { time_range: '__time_range', granularity_sqla: '__time_col', time_grain_sqla: '__time_grain', @@ -44,7 +44,8 @@ const TIME_FILTER_MAP = { granularity: '__granularity', }; -export const TIME_RANGE = '__time_range'; +// a shortcut to a map key, used by many components +export const TIME_RANGE = TIME_FILTER_MAP.time_range; export const FILTER_LABELS = { [TIME_RANGE]: 'Time range', }; diff --git a/superset/assets/src/visualizations/FilterBox/FilterBox.less b/superset/assets/src/visualizations/FilterBox/FilterBox.less index a3975d12f9360..e37c3d6776fbb 100644 --- a/superset/assets/src/visualizations/FilterBox/FilterBox.less +++ b/superset/assets/src/visualizations/FilterBox/FilterBox.less @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../../stylesheets/less/variables.less'; - +@import "../../../stylesheets/less/variables.less"; + .select2-highlighted > .filter_box { background-color: transparent; border: 1px superset @darkest; @@ -66,7 +66,7 @@ ul.select2-results div.filter_box { .filter-container label { display: flex; - font-weight: bold; + font-weight: @font-weight-bold; margin: 0 0 8px 8px; } diff --git a/superset/assets/stylesheets/less/cosmo/bootswatch.less b/superset/assets/stylesheets/less/cosmo/bootswatch.less index a2cf346fc2569..a3eedcb61f69f 100644 --- a/superset/assets/stylesheets/less/cosmo/bootswatch.less +++ b/superset/assets/stylesheets/less/cosmo/bootswatch.less @@ -94,7 +94,7 @@ .caret:before { font-family: "FontAwesome"; - font-size: 10px; + font-size: @font-size-xs; content: "\f078"; } @@ -281,7 +281,7 @@ table, border-radius: 2px; } label { - font-weight: normal; + font-weight: @font-weight-normal; } // Progress bars ============================================================== @@ -290,7 +290,7 @@ label { height: 14px; .box-shadow(none); .progress-bar { - font-size: 12px; + font-size: @font-size-s; line-height: 12px; padding-top: 1px; } @@ -317,7 +317,7 @@ label { border-bottom: 1px solid @gray-light; h1, h2, h3, h4, h5, h6 { margin: 10px 0 0 0; - font-weight: bold; + font-weight: @font-weight-bold; } } .close { @@ -335,7 +335,7 @@ label { border-bottom: 1px solid @gray-light; h1, h2, h3, h4, h5, h6 { margin: 10px 0 0 0; - font-weight: bold; + font-weight: @font-weight-bold; } } .close { @@ -402,7 +402,7 @@ a.list-group-item { .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { background-color: #fff; - font-weight: bold; + font-weight: @font-weight-bold; border-top: 3px solid @brand-primary; } diff --git a/superset/assets/stylesheets/less/cosmo/variables.less b/superset/assets/stylesheets/less/cosmo/variables.less index 7b979c2245251..0b136b9c82db3 100644 --- a/superset/assets/stylesheets/less/cosmo/variables.less +++ b/superset/assets/stylesheets/less/cosmo/variables.less @@ -21,15 +21,15 @@ // -------------------------------------------------- -//== Colors +// == Colors // -//## Gray and brand colors for use across Bootstrap. +// ## Gray and brand colors for use across Bootstrap. @gray-base: #000; @gray-darker: lighten(@gray-base, 13.5%); @gray-dark: lighten(@gray-base, 20%); -@gray: lighten(@gray-base, 33.5%); -@gray-light: lighten(@gray-base, 70%); +@bs-gray: lighten(@gray-base, 33.5%); +@bs-gray-light: lighten(@gray-base, 70%); @gray-lighter: lighten(@gray-base, 95%); @brand-primary: #00A699; @@ -38,31 +38,31 @@ @brand-warning: #FED766; @brand-danger: #FE4A49; -//== Scaffolding +// == Scaffolding // -//## Settings for some of the most global styles. +// ## Settings for some of the most global styles. -//** Background color for ``. +// ** Background color for ``. @body-bg: #f5f5f5; -//** Global text color on ``. +// ** Global text color on ``. @text-color: @gray-dark; -//** Global textual link color. -@link-color: @brand-primary; -//** Link hover color set via `darken()` function. +// ** Global textual link color. +@link-color: @brand-primary; +// ** Link hover color set via `darken()` function. @link-hover-color: darken(@link-color, 15%); -//** Link hover decoration. +// ** Link hover decoration. @link-hover-decoration: underline; -//== Typography +// == Typography // -//## Font, line-height, and color for body text, headings, and more. +// ## Font, line-height, and color for body text, headings, and more. @font-family-sans-serif: Helvetica, Arial; @font-family-serif: Georgia, "Times New Roman", Times, serif; -//** Default monospace fonts for ``, ``, and `
`.
+// ** Default monospace fonts for ``, ``, and `
`.
 @font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace;
 @font-family-base:        @font-family-sans-serif;
 
@@ -77,33 +77,33 @@
 @font-size-h5:            @font-size-base;
 @font-size-h6:            ceil((@font-size-base * 0.85)); // ~12px
 
-//** Unit-less `line-height` for use in components like buttons.
+// ** Unit-less `line-height` for use in components like buttons.
 @line-height-base:        1.428571429; // 20/14
-//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
+// ** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
 @line-height-computed:    floor((@font-size-base * @line-height-base)); // ~20px
 
-//** By default, this inherits from the ``.
+// ** By default, this inherits from the ``.
 @headings-font-family:    @font-family-base;
 @headings-font-weight:    300;
 @headings-line-height:    1.1;
 @headings-color:          inherit;
 
 
-//== Iconography
+// == Iconography
 //
-//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
+// ## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
 
-//** Load fonts from this directory.
+// ** Load fonts from this directory.
 @icon-font-path:          "../fonts/";
-//** File name for all font files.
+// ** File name for all font files.
 @icon-font-name:          "glyphicons-halflings-regular";
-//** Element ID within SVG icon file.
+// ** Element ID within SVG icon file.
 @icon-font-svg-id:        "glyphicons_halflingsregular";
 
 
-//== Components
+// == Components
 //
-//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
+// ## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
 
 @padding-base-vertical:     10px;
 @padding-base-horizontal:   18px;
@@ -124,41 +124,41 @@
 @border-radius-large:       2px;
 @border-radius-small:       2px;
 
-//** Global color for active items (e.g., navs or dropdowns).
+// ** Global color for active items (e.g., navs or dropdowns).
 @component-active-color:    #fff;
-//** Global background color for active items (e.g., navs or dropdowns).
+// ** Global background color for active items (e.g., navs or dropdowns).
 @component-active-bg:       @brand-primary;
 
-//** Width of the `border` for generating carets that indicate dropdowns.
+// ** Width of the `border` for generating carets that indicate dropdowns.
 @caret-width-base:          4px;
-//** Carets increase slightly in size for larger components.
+// ** Carets increase slightly in size for larger components.
 @caret-width-large:         5px;
 
 
-//== Tables
+// == Tables
 //
-//## Customizes the `.table` component with basic values, each used across all table variations.
+// ## Customizes the `.table` component with basic values, each used across all table variations.
 
-//** Padding for ``s and ``s.
+// ** Padding for ``s and ``s.
 @table-cell-padding:            8px;
-//** Padding for cells in `.table-condensed`.
+// ** Padding for cells in `.table-condensed`.
 @table-condensed-cell-padding:  5px;
 
-//** Default background color used for all tables.
+// ** Default background color used for all tables.
 @table-bg:                      transparent;
-//** Background color used for `.table-striped`.
+// ** Background color used for `.table-striped`.
 @table-bg-accent:               #f9f9f9;
-//** Background color used for `.table-hover`.
+// ** Background color used for `.table-hover`.
 @table-bg-hover:                #f5f5f5;
 @table-bg-active:               @table-bg-hover;
 
-//** Border color for table and cell borders.
+// ** Border color for table and cell borders.
 @table-border-color:            #ddd;
 
 
-//== Buttons
+// == Buttons
 //
-//## For each of Bootstrap's buttons, define text, background and border color.
+// ## For each of Bootstrap's buttons, define text, background and border color.
 
 @btn-font-weight:                normal;
 
@@ -166,9 +166,9 @@
 @btn-primary-bg:                 @brand-primary;
 @btn-primary-border:             @brand-primary;
 
-@btn-default-color:              @gray;
+@btn-default-color:              @bs-gray;
 @btn-default-bg:                 #fff;
-@btn-default-border:             @gray-light;
+@btn-default-border:             @bs-gray-light;
 
 @btn-success-color:              @btn-primary-color;
 @btn-success-bg:                 @brand-success;
@@ -186,7 +186,7 @@
 @btn-danger-bg:                  @brand-danger;
 @btn-danger-border:              @btn-danger-bg;
 
-@btn-link-disabled-color:        @gray-light;
+@btn-link-disabled-color:        @bs-gray-light;
 
 // Allows for customizing button radius independently from global border radius
 @btn-border-radius-base:         @border-radius-base;
@@ -194,89 +194,89 @@
 @btn-border-radius-small:        @border-radius-small;
 
 
-//== Forms
+// == Forms
 //
-//##
+// ##
 
-//** `` background color
+// ** `` background color
 @input-bg:                       #fff;
-//** `` background color
+// ** `` background color
 @input-bg-disabled:              @gray-lighter;
 
-//** Text color for ``s
+// ** Text color for ``s
 @input-color:                    @text-color;
-//** `` border color
+// ** `` border color
 @input-border:                   #ccc;
 
 // TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4
-//** Default `.form-control` border radius
+// ** Default `.form-control` border radius
 // This has no effect on ``s in CSS.
 @input-border-radius:            @border-radius-base;
-//** Large `.form-control` border radius
+// ** Large `.form-control` border radius
 @input-border-radius-large:      @border-radius-large;
-//** Small `.form-control` border radius
+// ** Small `.form-control` border radius
 @input-border-radius-small:      @border-radius-small;
 
-//** Border color for inputs on focus
+// ** Border color for inputs on focus
 @input-border-focus:             #66afe9;
 
-//** Placeholder text color
-@input-color-placeholder:        @gray-light;
+// ** Placeholder text color
+@input-color-placeholder:        @bs-gray-light;
 
-//** Default `.form-control` height
+// ** Default `.form-control` height
 @input-height-base:              (@line-height-computed + (@padding-base-vertical * 2) + 2);
-//** Large `.form-control` height
+// ** Large `.form-control` height
 @input-height-large:             (ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2);
-//** Small `.form-control` height
+// ** Small `.form-control` height
 @input-height-small:             (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2);
 
-//** `.form-group` margin
+// ** `.form-group` margin
 @form-group-margin-bottom:       10px;
 
 @legend-color:                   @text-color;
 @legend-border-color:            #e5e5e5;
 
-//** Background color for textual input addons
+// ** Background color for textual input addons
 @input-group-addon-bg:           @gray-lighter;
-//** Border color for textual input addons
+// ** Border color for textual input addons
 @input-group-addon-border-color: @input-border;
 
-//** Disabled cursor for form controls and buttons.
+// ** Disabled cursor for form controls and buttons.
 @cursor-disabled:                not-allowed;
 
 
-//== Dropdowns
+// == Dropdowns
 //
-//## Dropdown menu container and contents.
+// ## Dropdown menu container and contents.
 
-//** Background for the dropdown menu.
+// ** Background for the dropdown menu.
 @dropdown-bg:                    #fff;
-//** Dropdown menu `border-color`.
+// ** Dropdown menu `border-color`.
 @dropdown-border:                rgba(0,0,0,.15);
-//** Dropdown menu `border-color` **for IE8**.
+// ** Dropdown menu `border-color` **for IE8**.
 @dropdown-fallback-border:       #ccc;
-//** Divider color for between dropdown items.
+// ** Divider color for between dropdown items.
 @dropdown-divider-bg:            #e5e5e5;
 
-//** Dropdown link text color.
+// ** Dropdown link text color.
 @dropdown-link-color:            @gray-dark;
-//** Hover color for dropdown links.
+// ** Hover color for dropdown links.
 @dropdown-link-hover-color:      #fff;
-//** Hover background for dropdown links.
+// ** Hover background for dropdown links.
 @dropdown-link-hover-bg:         @component-active-bg;
 
-//** Active dropdown menu item text color.
+// ** Active dropdown menu item text color.
 @dropdown-link-active-color:     #fff;
-//** Active dropdown menu item background color.
+// ** Active dropdown menu item background color.
 @dropdown-link-active-bg:        @component-active-bg;
 
-//** Disabled dropdown menu item background color.
-@dropdown-link-disabled-color:   @gray-light;
+// ** Disabled dropdown menu item background color.
+@dropdown-link-disabled-color:   @bs-gray-light;
 
-//** Text color for headers within dropdown menus.
-@dropdown-header-color:          @gray-light;
+// ** Text color for headers within dropdown menus.
+@dropdown-header-color:          @bs-gray-light;
 
-//** Deprecated `@dropdown-caret-color` as of v3.1.0
+// ** Deprecated `@dropdown-caret-color` as of v3.1.0
 @dropdown-caret-color:           #000;
 
 
@@ -296,37 +296,37 @@
 @zindex-modal:             1050;
 
 
-//== Media queries breakpoints
+// == Media queries breakpoints
 //
-//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
+// ## Define the breakpoints at which your layout will change, adapting to different screen sizes.
 
 // Extra small screen / phone
-//** Deprecated `@screen-xs` as of v3.0.1
+// ** Deprecated `@screen-xs` as of v3.0.1
 @screen-xs:                  480px;
-//** Deprecated `@screen-xs-min` as of v3.2.0
+// ** Deprecated `@screen-xs-min` as of v3.2.0
 @screen-xs-min:              @screen-xs;
-//** Deprecated `@screen-phone` as of v3.0.1
+// ** Deprecated `@screen-phone` as of v3.0.1
 @screen-phone:               @screen-xs-min;
 
 // Small screen / tablet
-//** Deprecated `@screen-sm` as of v3.0.1
+// ** Deprecated `@screen-sm` as of v3.0.1
 @screen-sm:                  768px;
 @screen-sm-min:              @screen-sm;
-//** Deprecated `@screen-tablet` as of v3.0.1
+// ** Deprecated `@screen-tablet` as of v3.0.1
 @screen-tablet:              @screen-sm-min;
 
 // Medium screen / desktop
-//** Deprecated `@screen-md` as of v3.0.1
+// ** Deprecated `@screen-md` as of v3.0.1
 @screen-md:                  992px;
 @screen-md-min:              @screen-md;
-//** Deprecated `@screen-desktop` as of v3.0.1
+// ** Deprecated `@screen-desktop` as of v3.0.1
 @screen-desktop:             @screen-md-min;
 
 // Large screen / wide desktop
-//** Deprecated `@screen-lg` as of v3.0.1
+// ** Deprecated `@screen-lg` as of v3.0.1
 @screen-lg:                  1200px;
 @screen-lg-min:              @screen-lg;
-//** Deprecated `@screen-lg-desktop` as of v3.0.1
+// ** Deprecated `@screen-lg-desktop` as of v3.0.1
 @screen-lg-desktop:          @screen-lg-min;
 
 // So media queries don't overlap when required, provide a maximum
@@ -335,44 +335,44 @@
 @screen-md-max:              (@screen-lg-min - 1);
 
 
-//== Grid system
+// == Grid system
 //
-//## Define your custom responsive grid.
+// ## Define your custom responsive grid.
 
-//** Number of columns in the grid.
+// ** Number of columns in the grid.
 @grid-columns:              12;
-//** Padding between columns. Gets divided in half for the left and right.
+// ** Padding between columns. Gets divided in half for the left and right.
 @grid-gutter-width:         20px;
 // Navbar collapse
-//** Point at which the navbar becomes uncollapsed.
+// ** Point at which the navbar becomes uncollapsed.
 @grid-float-breakpoint:     @screen-sm-min;
-//** Point at which the navbar begins collapsing.
+// ** Point at which the navbar begins collapsing.
 @grid-float-breakpoint-max: (@grid-float-breakpoint - 1);
 
 
-//== Container sizes
+// == Container sizes
 //
-//## Define the maximum width of `.container` for different screen sizes.
+// ## Define the maximum width of `.container` for different screen sizes.
 
 // Small screen / tablet
 @container-tablet:             (720px + @grid-gutter-width);
-//** For `@screen-sm-min` and up.
+// ** For `@screen-sm-min` and up.
 @container-sm:                 @container-tablet;
 
 // Medium screen / desktop
 @container-desktop:            (940px + @grid-gutter-width);
-//** For `@screen-md-min` and up.
+// ** For `@screen-md-min` and up.
 @container-md:                 @container-desktop;
 
 // Large screen / wide desktop
 @container-large-desktop:      (1140px + @grid-gutter-width);
-//** For `@screen-lg-min` and up.
+// ** For `@screen-lg-min` and up.
 @container-lg:                 @container-large-desktop;
 
 
-//== Navbar
+// == Navbar
 //
-//##
+// ##
 
 // Basics of a navbar
 @navbar-height:                    50px;
@@ -406,7 +406,7 @@
 @navbar-default-toggle-border-color:       transparent;
 
 
-//=== Inverted navbar
+// === Inverted navbar
 // Reset inverted navbar basics
 @navbar-inverse-color:                      @gray-dark;
 @navbar-inverse-bg:                         #fff;
@@ -432,38 +432,38 @@
 @navbar-inverse-toggle-border-color:        transparent;
 
 
-//== Navs
+// == Navs
 //
-//##
+// ##
 
-//=== Shared nav styles
+// === Shared nav styles
 @nav-link-padding:                          10px 15px;
 @nav-link-hover-bg:                         @gray-lighter;
 
-@nav-disabled-link-color:                   @gray-light;
-@nav-disabled-link-hover-color:             @gray-light;
+@nav-disabled-link-color:                   @bs-gray-light;
+@nav-disabled-link-hover-color:             @bs-gray-light;
 
-//== Tabs
+// == Tabs
 @nav-tabs-border-color:                     #bbb;
 
 @nav-tabs-link-hover-border-color:          @gray-lighter;
 
 @nav-tabs-active-link-hover-bg:             @body-bg;
-@nav-tabs-active-link-hover-color:          @gray;
+@nav-tabs-active-link-hover-color:          @bs-gray;
 @nav-tabs-active-link-hover-border-color:   #bbb;
 
 @nav-tabs-justified-link-border-color:            #bbb;
 @nav-tabs-justified-active-link-border-color:     @body-bg;
 
-//== Pills
+// == Pills
 @nav-pills-border-radius:                   @border-radius-base;
 @nav-pills-active-link-hover-bg:            @component-active-bg;
 @nav-pills-active-link-hover-color:         @component-active-color;
 
 
-//== Pagination
+// == Pagination
 //
-//##
+// ##
 
 @pagination-color:                     @link-color;
 @pagination-bg:                        #fff;
@@ -473,18 +473,18 @@
 @pagination-hover-bg:                  @gray-lighter;
 @pagination-hover-border:              #ddd;
 
-@pagination-active-color:              @gray-light;
+@pagination-active-color:              @bs-gray-light;
 @pagination-active-bg:                 #f5f5f5;
 @pagination-active-border:             #ddd;
 
-@pagination-disabled-color:            @gray-light;
+@pagination-disabled-color:            @bs-gray-light;
 @pagination-disabled-bg:               #fff;
 @pagination-disabled-border:           #ddd;
 
 
-//== Pager
+// == Pager
 //
-//##
+// ##
 
 @pager-bg:                             @pagination-bg;
 @pager-border:                         @pagination-border;
@@ -495,12 +495,12 @@
 @pager-active-bg:                      @pagination-active-bg;
 @pager-active-color:                   @pagination-active-color;
 
-@pager-disabled-color:                 @gray-light;
+@pager-disabled-color:                 @bs-gray-light;
 
 
-//== Jumbotron
+// == Jumbotron
 //
-//##
+// ##
 
 @jumbotron-padding:              30px;
 @jumbotron-color:                inherit;
@@ -510,9 +510,9 @@
 @jumbotron-heading-font-size:    ceil((@font-size-base * 4.5));
 
 
-//== Form states and alerts
+// == Form states and alerts
 //
-//## Define colors for form feedback states and, by default, alerts.
+// ## Define colors for form feedback states and, by default, alerts.
 
 @state-success-text:             darken(@brand-success, 20%);
 @state-success-bg:               lighten(@brand-success, 35%);
@@ -531,102 +531,102 @@
 @state-danger-border:            darken(spin(@state-danger-bg, -10), 3%);
 
 
-//== Tooltips
+// == Tooltips
 //
-//##
+// ##
 
-//** Tooltip max width
+// ** Tooltip max width
 @tooltip-max-width:           200px;
-//** Tooltip text color
+// ** Tooltip text color
 @tooltip-color:               #fff;
-//** Tooltip background color
+// ** Tooltip background color
 @tooltip-bg:                  #000;
 @tooltip-opacity:             .9;
 
-//** Tooltip arrow width
+// ** Tooltip arrow width
 @tooltip-arrow-width:         5px;
-//** Tooltip arrow color
+// ** Tooltip arrow color
 @tooltip-arrow-color:         @tooltip-bg;
 
 
-//== Popovers
+// == Popovers
 //
-//##
+// ##
 
-//** Popover body background color
+// ** Popover body background color
 @popover-bg:                          #fff;
-//** Popover maximum width
+// ** Popover maximum width
 @popover-max-width:                   276px;
-//** Popover border color
+// ** Popover border color
 @popover-border-color:                rgba(0,0,0,.2);
-//** Popover fallback border color
+// ** Popover fallback border color
 @popover-fallback-border-color:       #ccc;
 
-//** Popover title background color
+// ** Popover title background color
 @popover-title-bg:                    darken(@popover-bg, 3%);
 
-//** Popover arrow width
+// ** Popover arrow width
 @popover-arrow-width:                 10px;
-//** Popover arrow color
+// ** Popover arrow color
 @popover-arrow-color:                 @popover-bg;
 
-//** Popover outer arrow width
+// ** Popover outer arrow width
 @popover-arrow-outer-width:           (@popover-arrow-width + 1);
-//** Popover outer arrow color
+// ** Popover outer arrow color
 @popover-arrow-outer-color:           fadein(@popover-border-color, 5%);
-//** Popover outer arrow fallback color
+// ** Popover outer arrow fallback color
 @popover-arrow-outer-fallback-color:  darken(@popover-fallback-border-color, 20%);
 
 
-//== Labels
+// == Labels
 //
-//##
+// ##
 
-//** Default label background color
-@label-default-bg:            @gray-light;
-//** Primary label background color
+// ** Default label background color
+@label-default-bg:            @bs-gray-light;
+// ** Primary label background color
 @label-primary-bg:            @brand-primary;
-//** Success label background color
+// ** Success label background color
 @label-success-bg:            @brand-success;
-//** Info label background color
+// ** Info label background color
 @label-info-bg:               @brand-info;
-//** Warning label background color
+// ** Warning label background color
 @label-warning-bg:            @brand-warning;
-//** Danger label background color
+// ** Danger label background color
 @label-danger-bg:             @brand-danger;
 
-//** Default label text color
+// ** Default label text color
 @label-color:                 #fff;
-//** Default text color of a linked label
+// ** Default text color of a linked label
 @label-link-hover-color:      #fff;
 
 
-//== Modals
+// == Modals
 //
-//##
+// ##
 
-//** Padding applied to the modal body
+// ** Padding applied to the modal body
 @modal-inner-padding:         20px;
 
-//** Padding applied to the modal title
+// ** Padding applied to the modal title
 @modal-title-padding:         15px;
-//** Modal title line-height
+// ** Modal title line-height
 @modal-title-line-height:     @line-height-base;
 
-//** Background color of modal content area
+// ** Background color of modal content area
 @modal-content-bg:                             #fff;
-//** Modal content border color
+// ** Modal content border color
 @modal-content-border-color:                   transparent;
-//** Modal content border color **for IE8**
+// ** Modal content border color **for IE8**
 @modal-content-fallback-border-color:          #999;
 
-//** Modal backdrop background color
+// ** Modal backdrop background color
 @modal-backdrop-bg:           #000;
-//** Modal backdrop opacity
+// ** Modal backdrop opacity
 @modal-backdrop-opacity:      .5;
-//** Modal header border color
+// ** Modal header border color
 @modal-header-border-color:   #e5e5e5;
-//** Modal footer border color
+// ** Modal footer border color
 @modal-footer-border-color:   @modal-header-border-color;
 
 @modal-lg:                    900px;
@@ -634,9 +634,9 @@
 @modal-sm:                    300px;
 
 
-//== Alerts
+// == Alerts
 //
-//## Define alert colors, border radius, and padding.
+// ## Define alert colors, border radius, and padding.
 
 @alert-padding:               15px;
 @alert-border-radius:         @border-radius-base;
@@ -659,56 +659,56 @@
 @alert-danger-border:         @state-danger-border;
 
 
-//== Progress bars
+// == Progress bars
 //
-//##
+// ##
 
-//** Background color of the whole progress component
+// ** Background color of the whole progress component
 @progress-bg:                 #ccc;
-//** Progress bar text color
+// ** Progress bar text color
 @progress-bar-color:          #fff;
-//** Variable for setting rounded corners on progress bar.
+// ** Variable for setting rounded corners on progress bar.
 @progress-border-radius:      @border-radius-base;
 
-//** Default progress bar color
+// ** Default progress bar color
 @progress-bar-bg:             @brand-primary;
-//** Success progress bar color
+// ** Success progress bar color
 @progress-bar-success-bg:     @brand-success;
-//** Warning progress bar color
+// ** Warning progress bar color
 @progress-bar-warning-bg:     @brand-warning;
-//** Danger progress bar color
+// ** Danger progress bar color
 @progress-bar-danger-bg:      @brand-danger;
-//** Info progress bar color
+// ** Info progress bar color
 @progress-bar-info-bg:        @brand-info;
 
 
-//== List group
+// == List group
 //
-//##
+// ##
 
-//** Background color on `.list-group-item`
+// ** Background color on `.list-group-item`
 @list-group-bg:                 #fff;
-//** `.list-group-item` border color
+// ** `.list-group-item` border color
 @list-group-border:             #ddd;
-//** List group border radius
+// ** List group border radius
 @list-group-border-radius:      @border-radius-base;
 
-//** Background color of single list items on hover
+// ** Background color of single list items on hover
 @list-group-hover-bg:           #f5f5f5;
-//** Text color of active list items
+// ** Text color of active list items
 @list-group-active-color:       @component-active-color;
-//** Background color of active list items
+// ** Background color of active list items
 @list-group-active-bg:          @component-active-bg;
-//** Border color of active list elements
+// ** Border color of active list elements
 @list-group-active-border:      @list-group-border;
-//** Text color for content within active list items
+// ** Text color for content within active list items
 @list-group-active-text-color:  lighten(@list-group-active-bg, 40%);
 
-//** Text color of disabled list items
-@list-group-disabled-color:      @gray-light;
-//** Background color of disabled list items
+// ** Text color of disabled list items
+@list-group-disabled-color:      @bs-gray-light;
+// ** Background color of disabled list items
 @list-group-disabled-bg:         @gray-lighter;
-//** Text color for content within disabled list items
+// ** Text color for content within disabled list items
 @list-group-disabled-text-color: @list-group-disabled-color;
 
 @list-group-link-color:         #555;
@@ -716,9 +716,9 @@
 @list-group-link-heading-color: #333;
 
 
-//== Panels
+// == Panels
 //
-//##
+// ##
 
 @panel-bg:                    #fff;
 @panel-body-padding:          15px;
@@ -726,7 +726,7 @@
 @panel-footer-padding:        @panel-heading-padding;
 @panel-border-radius:         @border-radius-base;
 
-//** Border color for elements within panels
+// ** Border color for elements within panels
 @panel-inner-border:          #ddd;
 @panel-footer-bg:             #f5f5f5;
 
@@ -755,45 +755,45 @@
 @panel-danger-heading-bg:     @state-danger-bg;
 
 
-//== Thumbnails
+// == Thumbnails
 //
-//##
+// ##
 
-//** Padding around the thumbnail image
+// ** Padding around the thumbnail image
 @thumbnail-padding:           4px;
-//** Thumbnail background color
+// ** Thumbnail background color
 @thumbnail-bg:                @body-bg;
-//** Thumbnail border color
+// ** Thumbnail border color
 @thumbnail-border:            #ddd;
-//** Thumbnail border radius
+// ** Thumbnail border radius
 @thumbnail-border-radius:     @border-radius-base;
 
-//** Custom text color for thumbnail captions
+// ** Custom text color for thumbnail captions
 @thumbnail-caption-color:     @text-color;
-//** Padding around the thumbnail caption
+// ** Padding around the thumbnail caption
 @thumbnail-caption-padding:   9px;
 
 
-//== Wells
+// == Wells
 //
-//##
+// ##
 
 @well-bg:                     #f5f5f5;
 @well-border:                 darken(@well-bg, 7%);
 
 
-//== Badges
+// == Badges
 //
-//##
+// ##
 
 @badge-color:                 #fff;
-//** Linked badge text color on hover
+// ** Linked badge text color on hover
 @badge-link-hover-color:      #fff;
 @badge-bg:                    @brand-primary;
 
-//** Badge text color in active nav link
+// ** Badge text color in active nav link
 @badge-active-color:          @link-color;
-//** Badge background color in active nav link
+// ** Badge background color in active nav link
 @badge-active-bg:             #fff;
 
 @badge-font-weight:           bold;
@@ -801,25 +801,25 @@
 @badge-border-radius:         10px;
 
 
-//== Breadcrumbs
+// == Breadcrumbs
 //
-//##
+// ##
 
 @breadcrumb-padding-vertical:   8px;
 @breadcrumb-padding-horizontal: 15px;
-//** Breadcrumb background color
+// ** Breadcrumb background color
 @breadcrumb-bg:                 #f5f5f5;
-//** Breadcrumb text color
+// ** Breadcrumb text color
 @breadcrumb-color:              #ccc;
-//** Text color of current page in the breadcrumb
-@breadcrumb-active-color:       @gray-light;
-//** Textual separator for between breadcrumb elements
+// ** Text color of current page in the breadcrumb
+@breadcrumb-active-color:       @bs-gray-light;
+// ** Textual separator for between breadcrumb elements
 @breadcrumb-separator:          "/";
 
 
-//== Carousel
+// == Carousel
 //
-//##
+// ##
 
 @carousel-text-shadow:                        0 1px 2px rgba(0,0,0,.6);
 
@@ -834,18 +834,18 @@
 @carousel-caption-color:                      #fff;
 
 
-//== Close
+// == Close
 //
-//##
+// ##
 
 @close-font-weight:           bold;
 @close-color:                 #fff;
 @close-text-shadow:           0 1px 0 #fff;
 
 
-//== Code
+// == Code
 //
-//##
+// ##
 
 @code-color:                  #c7254e;
 @code-bg:                     #f9f2f4;
@@ -859,29 +859,29 @@
 @pre-scrollable-max-height:   340px;
 
 
-//== Type
+// == Type
 //
-//##
+// ##
 
-//** Horizontal offset for forms and lists.
+// ** Horizontal offset for forms and lists.
 @component-offset-horizontal: 180px;
-//** Text muted color
-@text-muted:                  @gray-light;
-//** Abbreviations and acronyms border color
-@abbr-border-color:           @gray-light;
-//** Headings small color
-@headings-small-color:        @gray-light;
-//** Blockquote small color
-@blockquote-small-color:      @gray-light;
-//** Blockquote font size
+// ** Text muted color
+@text-muted:                  @bs-gray-light;
+// ** Abbreviations and acronyms border color
+@abbr-border-color:           @bs-gray-light;
+// ** Headings small color
+@headings-small-color:        @bs-gray-light;
+// ** Blockquote small color
+@blockquote-small-color:      @bs-gray-light;
+// ** Blockquote font size
 @blockquote-font-size:        (@font-size-base * 1.25);
-//** Blockquote border color
+// ** Blockquote border color
 @blockquote-border-color:     @gray-lighter;
-//** Page header border color
+// ** Page header border color
 @page-header-border-color:    @gray-lighter;
-//** Width of horizontal description list titles
+// ** Width of horizontal description list titles
 @dl-horizontal-offset:        @component-offset-horizontal;
-//** Point at which .dl-horizontal becomes horizontal
+// ** Point at which .dl-horizontal becomes horizontal
 @dl-horizontal-breakpoint:    @grid-float-breakpoint;
-//** Horizontal line color.
+// ** Horizontal line color.
 @hr-border:                   @gray-lighter;
diff --git a/superset/assets/stylesheets/less/index.less b/superset/assets/stylesheets/less/index.less
index b1fc604323c0e..dea21cd1026a6 100644
--- a/superset/assets/stylesheets/less/index.less
+++ b/superset/assets/stylesheets/less/index.less
@@ -21,9 +21,12 @@
 @import "~bootstrap/less/bootstrap.less";
 @import "./cosmo/variables.less";
 @import "./cosmo/bootswatch.less";
+@import "../../stylesheets/less/variables.less";
 
-@stroke-primary:  @brand-primary;
-
+html, body {
+  font-size: @font-size-base;
+  line-height: @line-height-base;
+}
 body {
   position: absolute;
   top: 0;
diff --git a/superset/assets/stylesheets/less/variables.less b/superset/assets/stylesheets/less/variables.less
index 6cb3ba9136aa8..e6a10758b73fa 100644
--- a/superset/assets/stylesheets/less/variables.less
+++ b/superset/assets/stylesheets/less/variables.less
@@ -28,8 +28,8 @@
 
 @almost-black: #263238;
 @gray-dark: #484848;
-@gray: #879399;
 @gray-light: #CFD8DC;
+@gray: #879399;
 @gray-bg: #f5f5f5;
 @gray-heading: #A3A3A3;
 @menu-hover: #F2F3F5;
@@ -122,4 +122,33 @@
 /* Try to keep these to a minimum                                       */
 /************************************************************************/
 @z-index-max: 1000;
-@z-index-dropdown: 11;
\ No newline at end of file
+@z-index-dropdown: 11;
+
+/************************************************************************/
+/* TYPOGRAPHY                                                           */
+/* Commonly used font weights, line heights, etc. These should be the   */
+/* core values used to build more complex styles for headers, etc.      */
+/************************************************************************/
+
+// Weights
+@font-weight-light: 200;
+@font-weight-normal: 400;
+@font-weight-bold: 700;
+
+// Font Sizes
+@font-size-base: 14px; // Base `rem` units on this, as needed.
+// Ranged Sizes
+@font-size-xxs: 9px;
+@font-size-xs: 10px;
+@font-size-s: 12px; // mapping 11px;
+@font-size-m: @font-size-base; // maps to @font-size-base; for now
+@font-size-l: 16px;
+@font-size-xl: 21px; // mapping 20px, 24px when there's a 32 aboves it
+@font-size-xxl: 28px;
+
+// Line Heights
+@line-height-base: 1.4;
+// Ranged Sizes
+@line-height-tight: 1;
+@line-height-normal: @line-height-base;
+@line-height-loose: 2;
diff --git a/superset/assets/stylesheets/react-select/select.less b/superset/assets/stylesheets/react-select/select.less
index 11e0199769207..d2c2a0221fc81 100644
--- a/superset/assets/stylesheets/react-select/select.less
+++ b/superset/assets/stylesheets/react-select/select.less
@@ -66,5 +66,5 @@
   opacity: 0.5;
 }
 .VirtualizedSelectSelectedOption {
-  font-weight: bold;
+  font-weight: @font-weight-bold;
 }
diff --git a/superset/assets/stylesheets/reactable-pagination.less b/superset/assets/stylesheets/reactable-pagination.less
index 28244df35d98d..677b54d3e4df6 100644
--- a/superset/assets/stylesheets/reactable-pagination.less
+++ b/superset/assets/stylesheets/reactable-pagination.less
@@ -34,8 +34,7 @@
   border: 1px solid @gray-light  ;
   color: @gray-dark;
   display: inline-block;
-  font-size: 12px;
-  line-height: 1.5;
+  font-size: @font-size-s;
   margin-right: 5px;
   padding: 5px 10px;
   text-align: center;
@@ -46,7 +45,7 @@
 .reactable-current-page {
   border: 1px solid @gray-light;
   color: @gray-dark;
-  font-weight: bold;
+  font-weight: @font-weight-bold;
   pointer-events: none;
   opacity: 0.65;
 }
diff --git a/superset/assets/stylesheets/superset.less b/superset/assets/stylesheets/superset.less
index 8e94c67918825..fb0facb2e09b1 100644
--- a/superset/assets/stylesheets/superset.less
+++ b/superset/assets/stylesheets/superset.less
@@ -23,10 +23,6 @@
 
 @datasource-sql-expression-width: 450px;
 
-.emph {
-  font-weight: bold !important;
-}
-
 .alert.alert-danger > .debugger {
     color: @error;
 }
@@ -69,7 +65,7 @@ input.form-control {
     border: 1px solid @gray-light;
     background-color: @gray-bg;
     border-radius: 5px;
-    font-size: 12px;
+    font-size: @font-size-s;
 }
 
 .slice_info {
@@ -124,7 +120,7 @@ span.title-block {
     border-radius: 4px;
     padding: 6px 12px;
     margin: 0px 10px;
-    font-size: 20px;
+    font-size: @font-size-xl;
 }
 
 .nvtooltip {
@@ -137,14 +133,14 @@ span.title-block {
     -webkit-transition-delay: 0ms;
 }
 .nvtooltip table td {
-    font-size: 11px !important;
+    font-size: @font-size-s !important;
 }
 div.navbar {
   z-index: 999;
   .dropdown-menu .fineprint {
     padding: 10px 20px 0 20px;
     color: @gray-light;
-    font-size: 1rem;
+    font-size: @font-size-m;
     div {
       white-space: nowrap;
     }
@@ -181,7 +177,7 @@ li.widget:hover {
 }
 
 .chart-header .header-text {
-  font-size: 20px;
+  font-size: @font-size-xl;
   line-height: 22px;
   padding-bottom: 8px;
   border-bottom: 1px solid @gray;
@@ -206,7 +202,7 @@ li.widget:hover {
 }
 
 .table-condensed {
-    font-size: 12px;
+    font-size: @font-size-s;
 }
 
 .table-condensed input[type="checkbox"] {
@@ -243,7 +239,6 @@ table.table-no-hover tr:hover {
 
 .editable-title.datasource-sql-expression {
   font-family: @font-family-monospace;
-  font-size: 95%;
   display: inline-block;
   min-width: @datasource-sql-expression-width;
 }
@@ -261,7 +256,6 @@ table.table-no-hover tr:hover {
   border-color: transparent;
   background: transparent;
   font-size: inherit;
-  line-height: inherit;
   white-space: normal;
   text-align: left;
   cursor: initial;
@@ -292,7 +286,7 @@ table.table-no-hover tr:hover {
     top: 2px;
     right: 0;
     visibility: hidden;
-    font-size: 11px;
+    font-size: @font-size-s;
     text-align: center;
     vertical-align: middle;
   }
@@ -305,7 +299,7 @@ table.table-no-hover tr:hover {
 
 .dashboard-component.dashboard-component-header .anchor-link-container {
   .fa.fa-link {
-    font-size: 16px;
+    font-size: @font-size-l;
   }
 }
 
@@ -455,7 +449,7 @@ table.table-no-hover tr:hover {
 
 .list-add-action .btn.btn-sm {
   padding: 5px 6px;
-  font-size: 10px;
+  font-size: @font-size-xs;
   line-height: 2px;
   border-radius: 50%;
   box-shadow: 2px 2px 4px -1px fade(@darkest, @opacity-light);
@@ -490,11 +484,11 @@ iframe {
 
 g.annotation-container {
   line {
-    stroke: @stroke-primary;
+    stroke: @brand-primary;
   }
 
   rect.annotation {
-    stroke: @stroke-primary;
+    stroke: @brand-primary;
     fill-opacity: 0.1;
     stroke-width: 1;
   }
@@ -534,12 +528,12 @@ tr.reactable-column-header th.reactable-header-sortable {
 }
 
 .refresh-overlay-btn {
-  font-weight: bold;
+  font-weight: @font-weight-bold;
   margin-right: 10px;
 }
 
 .dismiss-overlay-btn {
-  font-weight: bold;
+  font-weight: @font-weight-bold;
   background: @lightest;
   color: @brand-primary;
   border-color: @brand-primary;
@@ -567,6 +561,6 @@ tr.reactable-column-header th.reactable-header-sortable {
 td.filtered {
   background-color: lighten(desaturate(@brand-primary, 50%), 50%);
 }
-.text-bigger {
-  font-size: 110%;
+.table-name {
+  font-size: @font-size-l;
 }
diff --git a/superset/assets/webpack.config.js b/superset/assets/webpack.config.js
index 6b08d93865616..e0910263f5305 100644
--- a/superset/assets/webpack.config.js
+++ b/superset/assets/webpack.config.js
@@ -204,7 +204,12 @@ const config = {
         ],
         use: [
           isDevMode ? 'style-loader' : MiniCssExtractPlugin.loader,
-          'css-loader',
+          {
+            loader: 'css-loader',
+            options: {
+              sourceMap: true,
+            },
+          },
         ],
       },
       {
@@ -212,8 +217,18 @@ const config = {
         include: APP_DIR,
         use: [
           isDevMode ? 'style-loader' : MiniCssExtractPlugin.loader,
-          'css-loader',
-          'less-loader',
+          {
+            loader: 'css-loader',
+            options: {
+              sourceMap: true,
+            },
+          },
+          {
+            loader: 'less-loader',
+            options: {
+              sourceMap: true,
+            },
+          },
         ],
       },
       /* for css linking images */
diff --git a/superset/config.py b/superset/config.py
index 04fc9bcc4408e..af1e56a4c9d41 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -170,10 +170,15 @@ def _try_json_readsha(filepath):
 # [TimeZone List]
 # See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
 # other tz can be overridden by providing a local_config
-DRUID_IS_ACTIVE = True
 DRUID_TZ = tz.tzutc()
 DRUID_ANALYSIS_TYPES = ["cardinality"]
 
+# Legacy Druid connector
+# Druid supports a SQL interface in its newer versions.
+# Setting this flag to True enables the deprecated, API-based Druid
+# connector. This feature may be removed at a future date.
+DRUID_IS_ACTIVE = False
+
 # ----------------------------------------------------
 # AUTHENTICATION CONFIG
 # ----------------------------------------------------
diff --git a/superset/db_engine_specs/presto.py b/superset/db_engine_specs/presto.py
index 661fe3517a2b5..f3564cf984587 100644
--- a/superset/db_engine_specs/presto.py
+++ b/superset/db_engine_specs/presto.py
@@ -445,7 +445,7 @@ def select_star(  # pylint: disable=too-many-arguments
     @classmethod
     def estimate_statement_cost(  # pylint: disable=too-many-locals
         cls, statement: str, database, cursor, user_name: str
-    ) -> Dict[str, float]:
+    ) -> Dict[str, Any]:
         """
         Run a SQL query that estimates the cost of a given statement.
 
@@ -453,7 +453,7 @@ def estimate_statement_cost(  # pylint: disable=too-many-locals
         :param database: Database instance
         :param cursor: Cursor instance
         :param username: Effective username
-        :return: JSON estimate from Presto
+        :return: JSON response from Presto
         """
         parsed_query = ParsedQuery(statement)
         sql = parsed_query.stripped()
@@ -479,11 +479,11 @@ def estimate_statement_cost(  # pylint: disable=too-many-locals
         #     }
         #   }
         result = json.loads(cursor.fetchone()[0])
-        return result["estimate"]
+        return result
 
     @classmethod
     def query_cost_formatter(
-        cls, raw_cost: List[Dict[str, float]]
+        cls, raw_cost: List[Dict[str, Any]]
     ) -> List[Dict[str, str]]:
         """
         Format cost estimate.
@@ -516,10 +516,11 @@ def humanize(value: Any, suffix: str) -> str:
             ("networkCost", "Network cost", ""),
         ]
         for row in raw_cost:
+            estimate: Dict[str, float] = row.get("estimate", {})
             statement_cost = {}
             for key, label, suffix in columns:
-                if key in row:
-                    statement_cost[label] = humanize(row[key], suffix).strip()
+                if key in estimate:
+                    statement_cost[label] = humanize(estimate[key], suffix).strip()
             cost.append(statement_cost)
 
         return cost
diff --git a/superset/examples/css_templates.py b/superset/examples/css_templates.py
index 09af029164b06..d84a01a9f2c6e 100644
--- a/superset/examples/css_templates.py
+++ b/superset/examples/css_templates.py
@@ -48,7 +48,7 @@ def load_css_templates():
         opacity: 1;
     }
     .chart-header .header{
-        font-weight: normal;
+        font-weight: @font-weight-normal;
         font-size: 12px;
     }
     /*
@@ -96,7 +96,7 @@ def load_css_templates():
         opacity: 1;
     }
     .chart-header .header{
-        font-weight: normal;
+        font-weight: @font-weight-normal;
         font-size: 12px;
     }
     .nvd3 text {
diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index 842f292e27874..d7fe551cd9092 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -54,6 +54,7 @@
 SQLLAB_TIMEOUT = config["SQLLAB_ASYNC_TIME_LIMIT_SEC"]
 SQLLAB_HARD_TIMEOUT = SQLLAB_TIMEOUT + 60
 log_query = config["QUERY_LOGGER"]
+logger = logging.getLogger(__name__)
 
 
 class SqlLabException(Exception):
@@ -84,9 +85,9 @@ def handle_query_error(msg, query, session, payload=None):
 
 def get_query_backoff_handler(details):
     query_id = details["kwargs"]["query_id"]
-    logging.error(f"Query with id `{query_id}` could not be retrieved")
+    logger.error(f"Query with id `{query_id}` could not be retrieved")
     stats_logger.incr("error_attempting_orm_query_{}".format(details["tries"] - 1))
-    logging.error(f"Query {query_id}: Sleeping for a sec before retrying...")
+    logger.error(f"Query {query_id}: Sleeping for a sec before retrying...")
 
 
 def get_query_giveup_handler(details):
@@ -128,7 +129,7 @@ def session_scope(nullpool):
         session.commit()
     except Exception as e:
         session.rollback()
-        logging.exception(e)
+        logger.exception(e)
         raise
     finally:
         session.close()
@@ -166,7 +167,7 @@ def get_sql_results(
                 expand_data=expand_data,
             )
         except Exception as e:
-            logging.exception(f"Query {query_id}: {e}")
+            logger.exception(f"Query {query_id}: {e}")
             stats_logger.incr("error_sqllab_unhandled")
             query = get_query(query_id, session)
             return handle_query_error(str(e), query, session)
@@ -224,13 +225,13 @@ def execute_sql_statement(sql_statement, query, user_name, session, cursor):
         query.executed_sql = sql
         session.commit()
         with stats_timing("sqllab.query.time_executing_query", stats_logger):
-            logging.info(f"Query {query_id}: Running query: \n{sql}")
+            logger.info(f"Query {query_id}: Running query: \n{sql}")
             db_engine_spec.execute(cursor, sql, async_=True)
-            logging.info(f"Query {query_id}: Handling cursor")
+            logger.info(f"Query {query_id}: Handling cursor")
             db_engine_spec.handle_cursor(cursor, query, session)
 
         with stats_timing("sqllab.query.time_fetching_results", stats_logger):
-            logging.debug(
+            logger.debug(
                 "Query {}: Fetching data for query object: {}".format(
                     query_id, query.to_dict()
                 )
@@ -238,16 +239,16 @@ def execute_sql_statement(sql_statement, query, user_name, session, cursor):
             data = db_engine_spec.fetch_data(cursor, query.limit)
 
     except SoftTimeLimitExceeded as e:
-        logging.exception(f"Query {query_id}: {e}")
+        logger.exception(f"Query {query_id}: {e}")
         raise SqlLabTimeoutException(
             "SQL Lab timeout. This environment's policy is to kill queries "
             "after {} seconds.".format(SQLLAB_TIMEOUT)
         )
     except Exception as e:
-        logging.exception(f"Query {query_id}: {e}")
+        logger.exception(f"Query {query_id}: {e}")
         raise SqlLabException(db_engine_spec.extract_error_message(e))
 
-    logging.debug(f"Query {query_id}: Fetching cursor description")
+    logger.debug(f"Query {query_id}: Fetching cursor description")
     cursor_description = cursor.description
     return SupersetDataFrame(data, cursor_description, db_engine_spec)
 
@@ -255,7 +256,7 @@ def execute_sql_statement(sql_statement, query, user_name, session, cursor):
 def _serialize_payload(
     payload: dict, use_msgpack: Optional[bool] = False
 ) -> Union[bytes, str]:
-    logging.debug(f"Serializing to msgpack: {use_msgpack}")
+    logger.debug(f"Serializing to msgpack: {use_msgpack}")
     if use_msgpack:
         return msgpack.dumps(payload, default=json_iso_dttm_ser, use_bin_type=True)
     else:
@@ -324,9 +325,9 @@ def execute_sql_statements(
     # Breaking down into multiple statements
     parsed_query = ParsedQuery(rendered_query)
     statements = parsed_query.get_statements()
-    logging.info(f"Query {query_id}: Executing {len(statements)} statement(s)")
+    logger.info(f"Query {query_id}: Executing {len(statements)} statement(s)")
 
-    logging.info(f"Query {query_id}: Set query to 'running'")
+    logger.info(f"Query {query_id}: Set query to 'running'")
     query.status = QueryStatus.RUNNING
     query.start_running_time = now_as_float()
     session.commit()
@@ -350,7 +351,7 @@ def execute_sql_statements(
 
                 # Run statement
                 msg = f"Running statement {i+1} out of {statement_count}"
-                logging.info(f"Query {query_id}: {msg}")
+                logger.info(f"Query {query_id}: {msg}")
                 query.set_extra_json_key("progress", msg)
                 session.commit()
                 try:
@@ -396,9 +397,7 @@ def execute_sql_statements(
 
     if store_results and results_backend:
         key = str(uuid.uuid4())
-        logging.info(
-            f"Query {query_id}: Storing results in results backend, key: {key}"
-        )
+        logger.info(f"Query {query_id}: Storing results in results backend, key: {key}")
         with stats_timing("sqllab.query.results_backend_write", stats_logger):
             with stats_timing(
                 "sqllab.query.results_backend_write_serialization", stats_logger
@@ -411,10 +410,10 @@ def execute_sql_statements(
                 cache_timeout = config["CACHE_DEFAULT_TIMEOUT"]
 
             compressed = zlib_compress(serialized_payload)
-            logging.debug(
+            logger.debug(
                 f"*** serialized payload size: {getsizeof(serialized_payload)}"
             )
-            logging.debug(f"*** compressed payload size: {getsizeof(compressed)}")
+            logger.debug(f"*** compressed payload size: {getsizeof(compressed)}")
             results_backend.set(key, compressed, cache_timeout)
         query.results_key = key
 
diff --git a/superset/templates/superset/models/database/macros.html b/superset/templates/superset/models/database/macros.html
index 0d47a844283b9..911b6f7c45b9a 100644
--- a/superset/templates/superset/models/database/macros.html
+++ b/superset/templates/superset/models/database/macros.html
@@ -57,15 +57,6 @@
         contentType: "application/json; charset=utf-8"
       }).done(function(data) {
           alert("Seems OK!");
-          if ($('#tables').length == 0)
-            $('body div.container').append('
'); - div = $('#tables') - div.html('Tables:
'); - $.each(data, function(i, d){ - var id = 'tbl_' + d; - div.append('' + d + '') - $('#' + id).click(function(){window.location = '/tablemodelview/add';}) - }); }).fail(function(error) { var respJSON = error.responseJSON; var errorMsg = error.responseText; diff --git a/tests/celery_tests.py b/tests/celery_tests.py index 954c84d5fade4..521be0bf8ea8c 100644 --- a/tests/celery_tests.py +++ b/tests/celery_tests.py @@ -23,10 +23,14 @@ import unittest import unittest.mock as mock -from tests.test_app import app # isort:skip +import flask +from flask import current_app + +from tests.test_app import app from superset import db, sql_lab from superset.dataframe import SupersetDataFrame from superset.db_engine_specs.base import BaseEngineSpec +from superset.extensions import celery_app from superset.models.helpers import QueryStatus from superset.models.sql_lab import Query from superset.sql_parse import ParsedQuery @@ -69,6 +73,23 @@ def test_create_table_as(self): ) +class AppContextTests(SupersetTestCase): + def test_in_app_context(self): + @celery_app.task() + def my_task(): + self.assertTrue(current_app) + + # Make sure we can call tasks with an app already setup + my_task() + + # Make sure the app gets pushed onto the stack properly + try: + popped_app = flask._app_ctx_stack.pop() + my_task() + finally: + flask._app_ctx_stack.push(popped_app) + + class CeleryTestCase(SupersetTestCase): def get_query_by_name(self, sql): session = db.session diff --git a/tests/db_engine_specs/presto_tests.py b/tests/db_engine_specs/presto_tests.py index bfb032294bee8..cf62b282d4a47 100644 --- a/tests/db_engine_specs/presto_tests.py +++ b/tests/db_engine_specs/presto_tests.py @@ -372,3 +372,66 @@ def test_convert_dttm(self): PrestoEngineSpec.convert_dttm("TIMESTAMP", dttm), "from_iso8601_timestamp('2019-01-02T03:04:05.678900')", ) + + def test_query_cost_formatter(self): + raw_cost = [ + { + "inputTableColumnInfos": [ + { + "table": { + "catalog": "hive", + "schemaTable": { + "schema": "default", + "table": "fact_passenger_state", + }, + }, + "columnConstraints": [ + { + "columnName": "ds", + "typeSignature": "varchar", + "domain": { + "nullsAllowed": False, + "ranges": [ + { + "low": { + "value": "2019-07-10", + "bound": "EXACTLY", + }, + "high": { + "value": "2019-07-10", + "bound": "EXACTLY", + }, + } + ], + }, + } + ], + "estimate": { + "outputRowCount": 9.04969899e8, + "outputSizeInBytes": 3.54143678301e11, + "cpuCost": 3.54143678301e11, + "maxMemory": 0.0, + "networkCost": 0.0, + }, + } + ], + "estimate": { + "outputRowCount": 9.04969899e8, + "outputSizeInBytes": 3.54143678301e11, + "cpuCost": 3.54143678301e11, + "maxMemory": 0.0, + "networkCost": 3.54143678301e11, + }, + } + ] + formatted_cost = PrestoEngineSpec.query_cost_formatter(raw_cost) + expected = [ + { + "Output count": "904 M rows", + "Output size": "354 GB", + "CPU cost": "354 G", + "Max memory": "0 B", + "Network cost": "354 G", + } + ] + self.assertEqual(formatted_cost, expected) diff --git a/tests/druid_tests.py b/tests/druid_tests.py index c5ab02895a31d..73c621d2cc505 100644 --- a/tests/druid_tests.py +++ b/tests/druid_tests.py @@ -21,6 +21,7 @@ from unittest.mock import Mock, patch from superset import db, security_manager +from tests.test_app import app from .base_tests import SupersetTestCase @@ -297,6 +298,7 @@ def check(): @unittest.skipUnless( SupersetTestCase.is_module_installed("pydruid"), "pydruid not installed" ) + @unittest.skipUnless(app.config["DRUID_IS_ACTIVE"], "DRUID_IS_ACTIVE is false") def test_filter_druid_datasource(self): CLUSTER_NAME = "new_druid" cluster = self.get_or_create( diff --git a/tests/security_tests.py b/tests/security_tests.py index e993cbc44ea3c..cd48d7369a7d3 100644 --- a/tests/security_tests.py +++ b/tests/security_tests.py @@ -55,9 +55,6 @@ def assert_can_all(self, view_menu, permissions_set): self.assert_can_read(view_menu, permissions_set) self.assert_can_write(view_menu, permissions_set) - def assert_cannot_gamma(self, perm_set): - self.assert_cannot_write("DruidColumnInlineView", perm_set) - def assert_can_gamma(self, perm_set): self.assert_can_read("DatabaseAsync", perm_set) self.assert_can_read("TableModelView", perm_set) @@ -86,12 +83,8 @@ def assert_can_alpha(self, perm_set): self.assert_can_all("SqlMetricInlineView", perm_set) self.assert_can_all("TableColumnInlineView", perm_set) self.assert_can_all("TableModelView", perm_set) - self.assert_can_all("DruidColumnInlineView", perm_set) - self.assert_can_all("DruidDatasourceModelView", perm_set) - self.assert_can_all("DruidMetricInlineView", perm_set) self.assertIn(("all_datasource_access", "all_datasource_access"), perm_set) - self.assertIn(("muldelete", "DruidDatasourceModelView"), perm_set) def assert_cannot_alpha(self, perm_set): if app.config["ENABLE_ACCESS_REQUEST"]: @@ -104,7 +97,6 @@ def assert_cannot_alpha(self, perm_set): def assert_can_admin(self, perm_set): self.assert_can_read("DatabaseAsync", perm_set) self.assert_can_all("DatabaseView", perm_set) - self.assert_can_all("DruidClusterModelView", perm_set) self.assert_can_all("RoleModelView", perm_set) self.assert_can_all("UserDBModelView", perm_set) @@ -185,13 +177,6 @@ def test_is_alpha_only(self): ) ) ) - self.assertTrue( - security_manager._is_alpha_only( - security_manager.find_permission_view_menu( - "can_delete", "DruidMetricInlineView" - ) - ) - ) self.assertTrue( security_manager._is_alpha_only( security_manager.find_permission_view_menu( @@ -209,7 +194,6 @@ def test_is_gamma_pvm(self): def test_gamma_permissions_basic(self): self.assert_can_gamma(get_perm_tuples("Gamma")) - self.assert_cannot_gamma(get_perm_tuples("Gamma")) self.assert_cannot_alpha(get_perm_tuples("Alpha")) @unittest.skipUnless( @@ -234,7 +218,6 @@ def test_sql_lab_permissions(self): self.assertIn(("can_csv", "Superset"), sql_lab_set) self.assertIn(("can_search_queries", "Superset"), sql_lab_set) - self.assert_cannot_gamma(sql_lab_set) self.assert_cannot_alpha(sql_lab_set) def test_granter_permissions(self): @@ -242,7 +225,6 @@ def test_granter_permissions(self): self.assertIn(("can_override_role_permissions", "Superset"), granter_set) self.assertIn(("can_approve", "Superset"), granter_set) - self.assert_cannot_gamma(granter_set) self.assert_cannot_alpha(granter_set) def test_gamma_permissions(self): @@ -273,7 +255,6 @@ def assert_can_all(view_menu): # check read only perms assert_can_read("TableModelView") - assert_cannot_write("DruidColumnInlineView") # make sure that user can create slices and dashboards assert_can_all("SliceModelView")