diff --git a/superset-frontend/.eslintignore b/superset-frontend/.eslintignore index 36e0e2dda..7d3533acb 100644 --- a/superset-frontend/.eslintignore +++ b/superset-frontend/.eslintignore @@ -19,9 +19,9 @@ coverage/** dist/* src/assets/images/* +src/assets/stylesheets/* node_modules/* node_modules*/* -stylesheets/* vendor/* docs/* src/dashboard/deprecated/* diff --git a/superset-frontend/package.json b/superset-frontend/package.json index a6cb4567c..232699612 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -19,10 +19,10 @@ "build-instrumented": "cross-env NODE_ENV=development BABEL_ENV=instrumented webpack --mode=development --color", "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV=\"${BABEL_ENV:=production}\" webpack --mode=production --color", "lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx . && npm run type", - "prettier-check": "prettier --check '{src,stylesheets}/**/*.{css,less,sass,scss}'", + "prettier-check": "prettier --check 'src/**/*.{css,less,sass,scss}'", "lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx . && npm run clean-css && npm run type", - "clean-css": "prettier --write '{src,stylesheets}/**/*.{css,less,sass,scss}'", - "format": "prettier --write './{src,spec,stylesheets,cypress-base}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}'", + "clean-css": "prettier --write 'src/**/*.{css,less,sass,scss}'", + "format": "prettier --write './{src,spec,cypress-base}/**/*{.js,.jsx,.ts,.tsx,.css,.less,.scss,.sass}'", "prettier": "npm run format", "check-translation": "prettier --check ../superset/translations/**/LC_MESSAGES/*.json", "clean-translation": "prettier --write ../superset/translations/**/LC_MESSAGES/*.json", diff --git a/superset-frontend/src/CRUD/crud.less b/superset-frontend/src/CRUD/crud.less index cace6f8e5..a12df7f43 100644 --- a/superset-frontend/src/CRUD/crud.less +++ b/superset-frontend/src/CRUD/crud.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../stylesheets/less/variables.less'; +@import '../assets/stylesheets/less/variables.less'; .CRUD { .text-right { diff --git a/superset-frontend/src/SqlLab/App.jsx b/superset-frontend/src/SqlLab/App.jsx index 857d1db40..b0b5e7320 100644 --- a/superset-frontend/src/SqlLab/App.jsx +++ b/superset-frontend/src/SqlLab/App.jsx @@ -39,7 +39,7 @@ import { BYTES_PER_CHAR, KB_STORAGE } from './constants'; import setupApp from '../setup/setupApp'; import './main.less'; -import '../../stylesheets/reactable-pagination.less'; +import '../assets/stylesheets/reactable-pagination.less'; import '../components/FilterableTable/FilterableTableStyles.less'; import { theme } from '../preamble'; diff --git a/superset-frontend/src/SqlLab/main.less b/superset-frontend/src/SqlLab/main.less index 7e5cf6eeb..a6c473889 100644 --- a/superset-frontend/src/SqlLab/main.less +++ b/superset-frontend/src/SqlLab/main.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../stylesheets/less/variables.less'; +@import '../assets/stylesheets/less/variables.less'; body { min-height: ~'max(100vh, 500px)'; // Set a min height so the gutter is always visible when resizing diff --git a/superset-frontend/stylesheets/antd/index.less b/superset-frontend/src/assets/stylesheets/antd/index.less similarity index 100% rename from superset-frontend/stylesheets/antd/index.less rename to superset-frontend/src/assets/stylesheets/antd/index.less diff --git a/superset-frontend/stylesheets/less/cosmo/bootswatch.less b/superset-frontend/src/assets/stylesheets/less/cosmo/bootswatch.less similarity index 100% rename from superset-frontend/stylesheets/less/cosmo/bootswatch.less rename to superset-frontend/src/assets/stylesheets/less/cosmo/bootswatch.less diff --git a/superset-frontend/stylesheets/less/cosmo/cosmoTheme.js b/superset-frontend/src/assets/stylesheets/less/cosmo/cosmoTheme.js similarity index 99% rename from superset-frontend/stylesheets/less/cosmo/cosmoTheme.js rename to superset-frontend/src/assets/stylesheets/less/cosmo/cosmoTheme.js index c3a578309..817049da6 100644 --- a/superset-frontend/stylesheets/less/cosmo/cosmoTheme.js +++ b/superset-frontend/src/assets/stylesheets/less/cosmo/cosmoTheme.js @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +/* eslint-disable */ (function () { $(window).scroll(function () { var top = $(document).scrollTop(); diff --git a/superset-frontend/stylesheets/less/cosmo/variables.less b/superset-frontend/src/assets/stylesheets/less/cosmo/variables.less similarity index 100% rename from superset-frontend/stylesheets/less/cosmo/variables.less rename to superset-frontend/src/assets/stylesheets/less/cosmo/variables.less diff --git a/superset-frontend/stylesheets/less/fonts.less b/superset-frontend/src/assets/stylesheets/less/fonts.less similarity index 100% rename from superset-frontend/stylesheets/less/fonts.less rename to superset-frontend/src/assets/stylesheets/less/fonts.less diff --git a/superset-frontend/stylesheets/less/index.less b/superset-frontend/src/assets/stylesheets/less/index.less similarity index 100% rename from superset-frontend/stylesheets/less/index.less rename to superset-frontend/src/assets/stylesheets/less/index.less diff --git a/superset-frontend/stylesheets/less/variables.less b/superset-frontend/src/assets/stylesheets/less/variables.less similarity index 100% rename from superset-frontend/stylesheets/less/variables.less rename to superset-frontend/src/assets/stylesheets/less/variables.less diff --git a/superset-frontend/stylesheets/reactable-pagination.less b/superset-frontend/src/assets/stylesheets/reactable-pagination.less similarity index 97% rename from superset-frontend/stylesheets/reactable-pagination.less rename to superset-frontend/src/assets/stylesheets/reactable-pagination.less index f3bb9f051..9b48d2143 100644 --- a/superset-frontend/stylesheets/reactable-pagination.less +++ b/superset-frontend/src/assets/stylesheets/reactable-pagination.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../stylesheets/less/variables.less'; +@import './less/variables.less'; .reactable-pagination td { padding: 15px 0 0 0 !important; diff --git a/superset-frontend/stylesheets/superset.less b/superset-frontend/src/assets/stylesheets/superset.less similarity index 99% rename from superset-frontend/stylesheets/superset.less rename to superset-frontend/src/assets/stylesheets/superset.less index eb2b083cd..ecfdd017f 100644 --- a/superset-frontend/stylesheets/superset.less +++ b/superset-frontend/src/assets/stylesheets/superset.less @@ -579,6 +579,6 @@ hr { border-top: 1px solid @gray-light; } .ace_gutter-cell.ace_error { - background-image: url('../src/assets/images/icons/error_solid_small_red.svg') !important; + background-image: url('../images/icons/error_solid_small_red.svg') !important; background-position: -2px center !important; } diff --git a/superset-frontend/src/components/FilterableTable/FilterableTableStyles.less b/superset-frontend/src/components/FilterableTable/FilterableTableStyles.less index 714462467..00786db70 100644 --- a/superset-frontend/src/components/FilterableTable/FilterableTableStyles.less +++ b/superset-frontend/src/components/FilterableTable/FilterableTableStyles.less @@ -17,7 +17,7 @@ * under the License. */ -@import '../../../stylesheets/less/variables.less'; +@import '../../assets/stylesheets/less/variables.less'; .ReactVirtualized__Grid__innerScrollContainer { border: 1px solid @gray-light; diff --git a/superset-frontend/src/components/TableLoader/index.tsx b/superset-frontend/src/components/TableLoader/index.tsx index 2956df3f7..d354a32d6 100644 --- a/superset-frontend/src/components/TableLoader/index.tsx +++ b/superset-frontend/src/components/TableLoader/index.tsx @@ -21,7 +21,7 @@ import { t, SupersetClient, JsonObject } from '@superset-ui/core'; import TableView, { EmptyWrapperType } from 'src/components/TableView'; import withToasts from 'src/components/MessageToasts/withToasts'; import Loading from 'src/components/Loading'; -import 'stylesheets/reactable-pagination.less'; +import '../../assets/stylesheets/reactable-pagination.less'; export interface TableLoaderProps { dataEndpoint?: string; diff --git a/superset-frontend/src/dashboard/stylesheets/builder-sidepane.less b/superset-frontend/src/dashboard/stylesheets/builder-sidepane.less index a5e48096f..5fbf66a98 100644 --- a/superset-frontend/src/dashboard/stylesheets/builder-sidepane.less +++ b/superset-frontend/src/dashboard/stylesheets/builder-sidepane.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../../stylesheets/less/variables.less'; +@import '../../assets/stylesheets/less/variables.less'; .dashboard-builder-sidepane { flex: 0 0 @builder-pane-width; diff --git a/superset-frontend/src/dashboard/stylesheets/components/new-component.less b/superset-frontend/src/dashboard/stylesheets/components/new-component.less index 0401515e5..2202a59ff 100644 --- a/superset-frontend/src/dashboard/stylesheets/components/new-component.less +++ b/superset-frontend/src/dashboard/stylesheets/components/new-component.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../../../stylesheets/less/variables.less'; +@import '../../../assets/stylesheets/less/variables.less'; .new-component { display: flex; diff --git a/superset-frontend/src/dashboard/stylesheets/filter-scope-selector.less b/superset-frontend/src/dashboard/stylesheets/filter-scope-selector.less index 344964aeb..06e9bae63 100644 --- a/superset-frontend/src/dashboard/stylesheets/filter-scope-selector.less +++ b/superset-frontend/src/dashboard/stylesheets/filter-scope-selector.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../../stylesheets/less/variables.less'; +@import '../../assets/stylesheets/less/variables.less'; .filter-scope-container { display: flex; diff --git a/superset-frontend/src/dashboard/stylesheets/index.less b/superset-frontend/src/dashboard/stylesheets/index.less index 6dee17e77..9c93d6b78 100644 --- a/superset-frontend/src/dashboard/stylesheets/index.less +++ b/superset-frontend/src/dashboard/stylesheets/index.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import './../../../stylesheets/less/variables.less'; +@import '../../assets/stylesheets/less/variables.less'; @import './builder.less'; @import './builder-sidepane.less'; diff --git a/superset-frontend/src/explore/App.jsx b/superset-frontend/src/explore/App.jsx index 86e04020a..63bd55238 100644 --- a/superset-frontend/src/explore/App.jsx +++ b/superset-frontend/src/explore/App.jsx @@ -27,7 +27,7 @@ import ToastContainer from 'src/components/MessageToasts/ToastContainer'; import setupApp from 'src/setup/setupApp'; import setupPlugins from 'src/setup/setupPlugins'; import './main.less'; -import 'stylesheets/reactable-pagination.less'; +import '../assets/stylesheets/reactable-pagination.less'; import { theme } from 'src/preamble'; import ExploreViewContainer from './components/ExploreViewContainer'; diff --git a/superset-frontend/src/explore/main.less b/superset-frontend/src/explore/main.less index 43de0da2a..d85e855b4 100644 --- a/superset-frontend/src/explore/main.less +++ b/superset-frontend/src/explore/main.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../stylesheets/less/variables.less'; +@import '../assets/stylesheets/less/variables.less'; .scrollbar-container { position: relative; diff --git a/superset-frontend/src/profile/main.less b/superset-frontend/src/profile/main.less index ce1f0a740..7e16c6749 100644 --- a/superset-frontend/src/profile/main.less +++ b/superset-frontend/src/profile/main.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../stylesheets/less/variables.less'; +@import '../assets/stylesheets/less/variables.less'; .tab-pane { min-height: 400px; diff --git a/superset-frontend/src/theme.ts b/superset-frontend/src/theme.ts index b140f841b..33e7eae58 100644 --- a/superset-frontend/src/theme.ts +++ b/superset-frontend/src/theme.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import '../stylesheets/superset.less'; +import './assets/stylesheets/superset.less'; // Importing Antd under its own stylesheet to prevent unintentional theming. -import '../stylesheets/antd/index.less'; +import './assets/stylesheets/antd/index.less'; diff --git a/superset-frontend/src/utils/downloadAsImage.ts b/superset-frontend/src/utils/downloadAsImage.ts index b19dfe29a..da9ca8b61 100644 --- a/superset-frontend/src/utils/downloadAsImage.ts +++ b/superset-frontend/src/utils/downloadAsImage.ts @@ -24,7 +24,7 @@ import { addWarningToast } from 'src/components/MessageToasts/actions'; /** * @remark - * same as https://github.com/apache/superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/stylesheets/less/variables.less#L34 + * same as https://github.com/apache/superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/src/assets/stylesheets/less/variables.less#L34 */ const GRAY_BACKGROUND_COLOR = '#F5F5F5'; diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBox.less b/superset-frontend/src/visualizations/FilterBox/FilterBox.less index b1252b275..5a8f09536 100644 --- a/superset-frontend/src/visualizations/FilterBox/FilterBox.less +++ b/superset-frontend/src/visualizations/FilterBox/FilterBox.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -@import '../../../stylesheets/less/variables.less'; +@import '../../assets/stylesheets/less/variables.less'; .dashboard .filter_box .slice_container > div:not(.alert) { padding-top: 0; diff --git a/superset-frontend/webpack.config.js b/superset-frontend/webpack.config.js index 1bd304342..440812b6e 100644 --- a/superset-frontend/webpack.config.js +++ b/superset-frontend/webpack.config.js @@ -129,7 +129,7 @@ const plugins = [ patterns: [ 'package.json', { from: 'src/assets/images', to: 'images' }, - { from: 'stylesheets', to: 'stylesheets' }, + { from: 'src/assets/stylesheets', to: 'stylesheets' }, ], }),