Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Simplify folder structure

Patryk Zawadzkie83128c7ece6
diff --git a/package.json b/package.json
index ec8a7780e2..f46f895a28 100644
--- a/package.json
+++ b/package.json
@@ -143,11 +143,11 @@
},
"scripts": {
"build-assets": "webpack -p --progress",
- "build-schema": "python manage.py graphql_schema --schema saleor.dashboard.graphql.api.schema --out saleor/static/dashboard-next/js/schema.json",
- "generate-types": "apollo-codegen generate 'saleor/static/dashboard-next/js/**/*.ts' --schema saleor/static/dashboard-next/js/schema.json --target typescript --output saleor/static/dashboard-next/js/gql-types.ts",
+ "build-schema": "python manage.py graphql_schema --schema saleor.dashboard.graphql.api.schema --out saleor/static/dashboard-next/schema.json",
+ "generate-types": "apollo-codegen generate 'saleor/static/dashboard-next/**/*.ts' --schema saleor/static/dashboard-next/schema.json --target typescript --output saleor/static/dashboard-next/gql-types.ts",
"heroku-postbuild": "npm run build-assets && npm run build-emails",
"start": "webpack -d --watch --progress",
"build-emails": "mjml --config.beautify false -l skip \"templates/templated_email/source/*.mjml\" -o templates/templated_email/compiled",
- "test": "jest saleor/static/dashboard-next/js/"
+ "test": "jest saleor/static/dashboard-next/"
}
}
diff --git a/saleor/static/dashboard-next/js/AppRoot.tsx b/saleor/static/dashboard-next/AppRoot.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/AppRoot.tsx
rename to saleor/static/dashboard-next/AppRoot.tsx
diff --git a/saleor/static/dashboard-next/js/category/components/BaseForm.tsx b/saleor/static/dashboard-next/category/components/BaseForm.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/components/BaseForm.tsx
rename to saleor/static/dashboard-next/category/components/BaseForm.tsx
diff --git a/saleor/static/dashboard-next/js/category/components/CategoryDeleteDialog.tsx b/saleor/static/dashboard-next/category/components/CategoryDeleteDialog.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/components/CategoryDeleteDialog.tsx
rename to saleor/static/dashboard-next/category/components/CategoryDeleteDialog.tsx
diff --git a/saleor/static/dashboard-next/js/category/components/CategoryProducts.tsx b/saleor/static/dashboard-next/category/components/CategoryProducts.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/components/CategoryProducts.tsx
rename to saleor/static/dashboard-next/category/components/CategoryProducts.tsx
diff --git a/saleor/static/dashboard-next/js/category/components/CategorySubcategories.tsx b/saleor/static/dashboard-next/category/components/CategorySubcategories.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/components/CategorySubcategories.tsx
rename to saleor/static/dashboard-next/category/components/CategorySubcategories.tsx
diff --git a/saleor/static/dashboard-next/js/category/components/ProductFilters.tsx b/saleor/static/dashboard-next/category/components/ProductFilters.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/components/ProductFilters.tsx
rename to saleor/static/dashboard-next/category/components/ProductFilters.tsx
diff --git a/saleor/static/dashboard-next/js/category/components/RootCategoryList.tsx b/saleor/static/dashboard-next/category/components/RootCategoryList.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/components/RootCategoryList.tsx
rename to saleor/static/dashboard-next/category/components/RootCategoryList.tsx
diff --git a/saleor/static/dashboard-next/js/category/index.tsx b/saleor/static/dashboard-next/category/index.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/index.tsx
rename to saleor/static/dashboard-next/category/index.tsx
diff --git a/saleor/static/dashboard-next/js/category/mutations.ts b/saleor/static/dashboard-next/category/mutations.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/category/mutations.ts
rename to saleor/static/dashboard-next/category/mutations.ts
diff --git a/saleor/static/dashboard-next/js/category/queries.ts b/saleor/static/dashboard-next/category/queries.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/category/queries.ts
rename to saleor/static/dashboard-next/category/queries.ts
diff --git a/saleor/static/dashboard-next/js/category/views/CategoryCreateForm.tsx b/saleor/static/dashboard-next/category/views/CategoryCreateForm.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/views/CategoryCreateForm.tsx
rename to saleor/static/dashboard-next/category/views/CategoryCreateForm.tsx
diff --git a/saleor/static/dashboard-next/js/category/views/CategoryUpdateForm.tsx b/saleor/static/dashboard-next/category/views/CategoryUpdateForm.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/views/CategoryUpdateForm.tsx
rename to saleor/static/dashboard-next/category/views/CategoryUpdateForm.tsx
diff --git a/saleor/static/dashboard-next/js/category/views/details.tsx b/saleor/static/dashboard-next/category/views/details.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/category/views/details.tsx
rename to saleor/static/dashboard-next/category/views/details.tsx
diff --git a/saleor/static/dashboard-next/js/components/CategoryList/CategoryList.test.tsx b/saleor/static/dashboard-next/components/CategoryList/CategoryList.test.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryList/CategoryList.test.tsx
rename to saleor/static/dashboard-next/components/CategoryList/CategoryList.test.tsx
diff --git a/saleor/static/dashboard-next/js/components/CategoryList/CategoryList.tsx b/saleor/static/dashboard-next/components/CategoryList/CategoryList.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryList/CategoryList.tsx
rename to saleor/static/dashboard-next/components/CategoryList/CategoryList.tsx
diff --git a/saleor/static/dashboard-next/js/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap b/saleor/static/dashboard-next/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap
rename to saleor/static/dashboard-next/components/CategoryList/__snapshots__/CategoryList.test.tsx.snap
diff --git a/saleor/static/dashboard-next/js/components/CategoryList/index.ts b/saleor/static/dashboard-next/components/CategoryList/index.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryList/index.ts
rename to saleor/static/dashboard-next/components/CategoryList/index.ts
diff --git a/saleor/static/dashboard-next/js/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx b/saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx
rename to saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.test.tsx
diff --git a/saleor/static/dashboard-next/js/components/CategoryPropertiesCard/CategoryPropertiesCard.tsx b/saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryPropertiesCard/CategoryPropertiesCard.tsx
rename to saleor/static/dashboard-next/components/CategoryPropertiesCard/CategoryPropertiesCard.tsx
diff --git a/saleor/static/dashboard-next/js/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap b/saleor/static/dashboard-next/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap
rename to saleor/static/dashboard-next/components/CategoryPropertiesCard/__snapshots__/CategoryPropertiesCard.test.tsx.snap
diff --git a/saleor/static/dashboard-next/js/components/CategoryPropertiesCard/index.ts b/saleor/static/dashboard-next/components/CategoryPropertiesCard/index.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/components/CategoryPropertiesCard/index.ts
rename to saleor/static/dashboard-next/components/CategoryPropertiesCard/index.ts
diff --git a/saleor/static/dashboard-next/js/components/ControlledCheckbox.tsx b/saleor/static/dashboard-next/components/ControlledCheckbox.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ControlledCheckbox.tsx
rename to saleor/static/dashboard-next/components/ControlledCheckbox.tsx
diff --git a/saleor/static/dashboard-next/js/components/ErrorMessageCard/ErrorMessageCard.test.tsx b/saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.test.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ErrorMessageCard/ErrorMessageCard.test.tsx
rename to saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.test.tsx
diff --git a/saleor/static/dashboard-next/js/components/ErrorMessageCard/ErrorMessageCard.tsx b/saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ErrorMessageCard/ErrorMessageCard.tsx
rename to saleor/static/dashboard-next/components/ErrorMessageCard/ErrorMessageCard.tsx
diff --git a/saleor/static/dashboard-next/js/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap b/saleor/static/dashboard-next/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap
rename to saleor/static/dashboard-next/components/ErrorMessageCard/__snapshots__/ErrorMessageCard.test.tsx.snap
diff --git a/saleor/static/dashboard-next/js/components/ErrorMessageCard/index.ts b/saleor/static/dashboard-next/components/ErrorMessageCard/index.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ErrorMessageCard/index.ts
rename to saleor/static/dashboard-next/components/ErrorMessageCard/index.ts
diff --git a/saleor/static/dashboard-next/js/components/FilterCard/FilterCard.test.tsx b/saleor/static/dashboard-next/components/FilterCard/FilterCard.test.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/FilterCard/FilterCard.test.tsx
rename to saleor/static/dashboard-next/components/FilterCard/FilterCard.test.tsx
diff --git a/saleor/static/dashboard-next/js/components/FilterCard/FilterCard.tsx b/saleor/static/dashboard-next/components/FilterCard/FilterCard.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/FilterCard/FilterCard.tsx
rename to saleor/static/dashboard-next/components/FilterCard/FilterCard.tsx
diff --git a/saleor/static/dashboard-next/js/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap b/saleor/static/dashboard-next/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap
similarity index 100%
rename from saleor/static/dashboard-next/js/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap
rename to saleor/static/dashboard-next/components/FilterCard/__snapshots__/FilterCard.test.tsx.snap
diff --git a/saleor/static/dashboard-next/js/components/FilterCard/index.ts b/saleor/static/dashboard-next/components/FilterCard/index.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/components/FilterCard/index.ts
rename to saleor/static/dashboard-next/components/FilterCard/index.ts
diff --git a/saleor/static/dashboard-next/js/components/FormSpacer.tsx b/saleor/static/dashboard-next/components/FormSpacer.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/FormSpacer.tsx
rename to saleor/static/dashboard-next/components/FormSpacer.tsx
diff --git a/saleor/static/dashboard-next/js/components/MultiSelectField.tsx b/saleor/static/dashboard-next/components/MultiSelectField.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/MultiSelectField.tsx
rename to saleor/static/dashboard-next/components/MultiSelectField.tsx
diff --git a/saleor/static/dashboard-next/js/components/Navigator.tsx b/saleor/static/dashboard-next/components/Navigator.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/Navigator.tsx
rename to saleor/static/dashboard-next/components/Navigator.tsx
diff --git a/saleor/static/dashboard-next/js/components/PageHeader.tsx b/saleor/static/dashboard-next/components/PageHeader.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/PageHeader.tsx
rename to saleor/static/dashboard-next/components/PageHeader.tsx
diff --git a/saleor/static/dashboard-next/js/components/PriceField.tsx b/saleor/static/dashboard-next/components/PriceField.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/PriceField.tsx
rename to saleor/static/dashboard-next/components/PriceField.tsx
diff --git a/saleor/static/dashboard-next/js/components/ProductList/ProductList.test.tsx b/saleor/static/dashboard-next/components/ProductList/ProductList.test.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ProductList/ProductList.test.tsx
rename to saleor/static/dashboard-next/components/ProductList/ProductList.test.tsx
diff --git a/saleor/static/dashboard-next/js/components/ProductList/ProductList.tsx b/saleor/static/dashboard-next/components/ProductList/ProductList.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ProductList/ProductList.tsx
rename to saleor/static/dashboard-next/components/ProductList/ProductList.tsx
diff --git a/saleor/static/dashboard-next/js/components/ProductList/__snapshots__/ProductList.test.tsx.snap b/saleor/static/dashboard-next/components/ProductList/__snapshots__/ProductList.test.tsx.snap
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ProductList/__snapshots__/ProductList.test.tsx.snap
rename to saleor/static/dashboard-next/components/ProductList/__snapshots__/ProductList.test.tsx.snap
diff --git a/saleor/static/dashboard-next/js/components/ProductList/index.ts b/saleor/static/dashboard-next/components/ProductList/index.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/components/ProductList/index.ts
rename to saleor/static/dashboard-next/components/ProductList/index.ts
diff --git a/saleor/static/dashboard-next/js/components/RichTextEditor.tsx b/saleor/static/dashboard-next/components/RichTextEditor.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/RichTextEditor.tsx
rename to saleor/static/dashboard-next/components/RichTextEditor.tsx
diff --git a/saleor/static/dashboard-next/js/components/SingleSelectField.tsx b/saleor/static/dashboard-next/components/SingleSelectField.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/SingleSelectField.tsx
rename to saleor/static/dashboard-next/components/SingleSelectField.tsx
diff --git a/saleor/static/dashboard-next/js/components/Skeleton.tsx b/saleor/static/dashboard-next/components/Skeleton.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/Skeleton.tsx
rename to saleor/static/dashboard-next/components/Skeleton.tsx
diff --git a/saleor/static/dashboard-next/js/components/TablePagination.tsx b/saleor/static/dashboard-next/components/TablePagination.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/TablePagination.tsx
rename to saleor/static/dashboard-next/components/TablePagination.tsx
diff --git a/saleor/static/dashboard-next/js/components/TablePaginationActions.tsx b/saleor/static/dashboard-next/components/TablePaginationActions.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/TablePaginationActions.tsx
rename to saleor/static/dashboard-next/components/TablePaginationActions.tsx
diff --git a/saleor/static/dashboard-next/js/components/Toggle.tsx b/saleor/static/dashboard-next/components/Toggle.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/components/Toggle.tsx
rename to saleor/static/dashboard-next/components/Toggle.tsx
diff --git a/saleor/static/dashboard-next/js/gql-types.ts b/saleor/static/dashboard-next/gql-types.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/gql-types.ts
rename to saleor/static/dashboard-next/gql-types.ts
diff --git a/saleor/static/dashboard-next/js/i18n.ts b/saleor/static/dashboard-next/i18n.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/i18n.ts
rename to saleor/static/dashboard-next/i18n.ts
diff --git a/saleor/static/dashboard-next/js/index.tsx b/saleor/static/dashboard-next/index.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/index.tsx
rename to saleor/static/dashboard-next/index.tsx
diff --git a/saleor/static/dashboard-next/js/.eslintrc.json b/saleor/static/dashboard-next/js/.eslintrc.json
deleted file mode 100644
index d85df46bb2..0000000000
--- a/saleor/static/dashboard-next/js/.eslintrc.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "env": {
- "browser": true,
- "es6": true
- },
- "extends": [
- "prettier",
- "prettier/react"
- ],
- "parser": "babel-eslint",
- "globals": {
- "gettext": true,
- "pgettext": true,
- "ngettext": true,
- "interpolate": true,
- "beforeAll": true,
- "it": true,
- "describe": true
- }
-}
diff --git a/saleor/static/dashboard-next/js/misc.ts b/saleor/static/dashboard-next/misc.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/misc.ts
rename to saleor/static/dashboard-next/misc.ts
diff --git a/saleor/static/dashboard-next/js/page/components/PageBaseForm.tsx b/saleor/static/dashboard-next/page/components/PageBaseForm.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/components/PageBaseForm.tsx
rename to saleor/static/dashboard-next/page/components/PageBaseForm.tsx
diff --git a/saleor/static/dashboard-next/js/page/components/PageDeleteDialog.tsx b/saleor/static/dashboard-next/page/components/PageDeleteDialog.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/components/PageDeleteDialog.tsx
rename to saleor/static/dashboard-next/page/components/PageDeleteDialog.tsx
diff --git a/saleor/static/dashboard-next/js/page/components/PageFilters.tsx b/saleor/static/dashboard-next/page/components/PageFilters.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/components/PageFilters.tsx
rename to saleor/static/dashboard-next/page/components/PageFilters.tsx
diff --git a/saleor/static/dashboard-next/js/page/components/PageListComponent.tsx b/saleor/static/dashboard-next/page/components/PageListComponent.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/components/PageListComponent.tsx
rename to saleor/static/dashboard-next/page/components/PageListComponent.tsx
diff --git a/saleor/static/dashboard-next/js/page/index.tsx b/saleor/static/dashboard-next/page/index.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/index.tsx
rename to saleor/static/dashboard-next/page/index.tsx
diff --git a/saleor/static/dashboard-next/js/page/mutations.ts b/saleor/static/dashboard-next/page/mutations.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/page/mutations.ts
rename to saleor/static/dashboard-next/page/mutations.ts
diff --git a/saleor/static/dashboard-next/js/page/queries.ts b/saleor/static/dashboard-next/page/queries.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/page/queries.ts
rename to saleor/static/dashboard-next/page/queries.ts
diff --git a/saleor/static/dashboard-next/js/page/views/PageCreateForm.tsx b/saleor/static/dashboard-next/page/views/PageCreateForm.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/views/PageCreateForm.tsx
rename to saleor/static/dashboard-next/page/views/PageCreateForm.tsx
diff --git a/saleor/static/dashboard-next/js/page/views/PageList.tsx b/saleor/static/dashboard-next/page/views/PageList.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/views/PageList.tsx
rename to saleor/static/dashboard-next/page/views/PageList.tsx
diff --git a/saleor/static/dashboard-next/js/page/views/PageUpdateForm.tsx b/saleor/static/dashboard-next/page/views/PageUpdateForm.tsx
similarity index 100%
rename from saleor/static/dashboard-next/js/page/views/PageUpdateForm.tsx
rename to saleor/static/dashboard-next/page/views/PageUpdateForm.tsx
diff --git a/saleor/static/dashboard-next/js/schema.json b/saleor/static/dashboard-next/schema.json
similarity index 100%
rename from saleor/static/dashboard-next/js/schema.json
rename to saleor/static/dashboard-next/schema.json
diff --git a/saleor/static/dashboard-next/js/theme.ts b/saleor/static/dashboard-next/theme.ts
similarity index 100%
rename from saleor/static/dashboard-next/js/theme.ts
rename to saleor/static/dashboard-next/theme.ts
diff --git a/tsconfig.json b/tsconfig.json
index d7534b7bf0..83c2a16a9a 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,6 +5,6 @@
"target": "es5"
},
"include": [
- "saleor/static/dashboard-next/js/index.tsx"
+ "saleor/static/dashboard-next/index.tsx"
]
}
diff --git a/webpack.config.js b/webpack.config.js
index 70b0e7a261..4854eeb608 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -60,7 +60,7 @@ var providePlugin = new webpack.ProvidePlugin({
var config = {
entry: {
dashboard: './saleor/static/dashboard/js/dashboard.js',
- 'dashboard-next': './saleor/static/dashboard-next/js/index.tsx',
+ 'dashboard-next': './saleor/static/dashboard-next/index.tsx',
document: './saleor/static/dashboard/js/document.js',
storefront: './saleor/static/js/storefront.js'
},