diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 56f936bee..b8131fd87 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -29,4 +29,4 @@ greatly reduce the amount of work needed to review your work. --> -API_URI=https://master.staging.saleor.cloud/graphql/ +API_URI=https://qa.staging.saleor.cloud/graphql/ \ No newline at end of file diff --git a/.github/workflows/test-env-deploy.yml b/.github/workflows/test-env-deploy.yml index d7603e822..c9d70388b 100644 --- a/.github/workflows/test-env-deploy.yml +++ b/.github/workflows/test-env-deploy.yml @@ -59,7 +59,7 @@ jobs: - name: Run build env: # Use custom API_URI or the default one - API_URI: ${{ steps.api_uri.outputs.custom_api_uri || 'https://master.staging.saleor.cloud/graphql/' }} + API_URI: ${{ steps.api_uri.outputs.custom_api_uri || 'https://qa.staging.saleor.cloud/graphql/' }} APP_MOUNT_URI: / STATIC_URL: / run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af5f372c5..e21f06193 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -93,7 +93,9 @@ jobs: APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }} CYPRESS_baseUrl: ${{ secrets.CYPRESS_BASEURL }} CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} + CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }} CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} + CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} with: build: npm run build start: npx local-web-server --spa index.html diff --git a/CHANGELOG.md b/CHANGELOG.md index c2a30e241..939a5594c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ All notable, unreleased changes to this project will be documented in this file. - Fix trigger form change when collections are being added to list of product collections - #987 by @gax97 - Add product variant webhooks - #1006 by @piotrgrundas - Use default sort for search products list - #997 by @orzechdev +- Update CollectionBulkDelete error type - #1030 by @d-wysocki - Unconfirmed order manipulation - #967 by @tomaszszymanski129 # 2.11.1 diff --git a/cypress/Data/permissions.js b/cypress/Data/permissions.js new file mode 100644 index 000000000..063faade2 --- /dev/null +++ b/cypress/Data/permissions.js @@ -0,0 +1,90 @@ +import * as menuSelectors from "../elements/account/left-menu/left-menu-selectors"; +import { CONFIGURATION_SELECTORS } from "../elements/configuration/configuration-selectors"; + +const configurationAsParent = { + parentMenuSelector: menuSelectors.LEFT_MENU_SELECTORS.configuration, + parentSelectors: CONFIGURATION_SELECTORS +}; + +export const PERMISSIONS = { + app: { + permissionSelectors: [menuSelectors.LEFT_MENU_SELECTORS.app] + }, + customer: { + permissionSelectors: [menuSelectors.LEFT_MENU_SELECTORS.customers] + }, + discounts: { + parent: { + parentMenuSelector: menuSelectors.LEFT_MENU_SELECTORS.discounts, + parentSelectors: [menuSelectors.DISCOUNTS_MENU_SELECTORS] + }, + permissionSelectors: [ + menuSelectors.DISCOUNTS_MENU_SELECTORS.sales, + menuSelectors.DISCOUNTS_MENU_SELECTORS.sales + ] + }, + order: { + parent: { + parentMenuSelector: menuSelectors.LEFT_MENU_SELECTORS.orders, + parentSelectors: menuSelectors.ORDERS + }, + permissionSelectors: [ + menuSelectors.ORDERS.orders, + menuSelectors.ORDERS.draftOrders + ] + }, + page: { + parent: configurationAsParent, + permissionSelectors: [ + CONFIGURATION_SELECTORS.pageTypes, + CONFIGURATION_SELECTORS.pages + ] + }, + plugin: { + parent: configurationAsParent, + permissionSelectors: [CONFIGURATION_SELECTORS.plugin] + }, + product: { + parent: { + parentMenuSelector: menuSelectors.LEFT_MENU_SELECTORS.catalog, + parentSelectors: menuSelectors.CATALOG + }, + permissionSelectors: [ + menuSelectors.CATALOG.categories, + menuSelectors.CATALOG.collections, + menuSelectors.CATALOG.products + ] + }, + productTypeAndAttribute: { + parent: configurationAsParent, + permissionSelectors: [ + CONFIGURATION_SELECTORS.attributes, + CONFIGURATION_SELECTORS.productTypes + ] + }, + settings: { + parent: configurationAsParent, + permissionSelectors: [ + CONFIGURATION_SELECTORS.taxes, + CONFIGURATION_SELECTORS.settings + ] + }, + shipping: { + parent: configurationAsParent, + permissionSelectors: [CONFIGURATION_SELECTORS.shipping] + }, + staff: { + parent: configurationAsParent, + permissionSelectors: [ + CONFIGURATION_SELECTORS.staffMembers, + CONFIGURATION_SELECTORS.permissionGroups + ] + }, + translations: { + permissionSelectors: [menuSelectors.LEFT_MENU_SELECTORS.translations] + }, + warehouse: { + parent: configurationAsParent, + permissionSelectors: [CONFIGURATION_SELECTORS.warehouse] + } +}; diff --git a/cypress/Data/permissionsUsers.js b/cypress/Data/permissionsUsers.js new file mode 100644 index 000000000..736d8d458 --- /dev/null +++ b/cypress/Data/permissionsUsers.js @@ -0,0 +1,63 @@ +import { PERMISSIONS } from "./permissions"; +import { ONE_PERMISSION_USERS, TEST_ADMIN_USER } from "./users"; + +export const PERMISSIONS_OPTIONS = { + all: { + user: TEST_ADMIN_USER, + permissions: Object.values(PERMISSIONS) + }, + app: { + user: ONE_PERMISSION_USERS.app, + permissions: [PERMISSIONS.app] + }, + customer: { + user: ONE_PERMISSION_USERS.user, + permissions: [PERMISSIONS.customer] + }, + discount: { + user: ONE_PERMISSION_USERS.discount, + permissions: [PERMISSIONS.discounts] + }, + giftCard: { + user: ONE_PERMISSION_USERS.giftCard + }, + order: { + user: ONE_PERMISSION_USERS.order, + permissions: [PERMISSIONS.order] + }, + page: { + user: ONE_PERMISSION_USERS.page, + permissions: [PERMISSIONS.page] + }, + pageTypeAndAttribute: { + user: ONE_PERMISSION_USERS.pageTypeAndAttribute + }, + plugin: { + user: ONE_PERMISSION_USERS.plugin, + permissions: [PERMISSIONS.plugin] + }, + product: { + user: ONE_PERMISSION_USERS.product, + permissions: [PERMISSIONS.product, PERMISSIONS.warehouse] + }, + productTypeAndAttribute: { + user: ONE_PERMISSION_USERS.productTypeAndAttribute, + permissions: [PERMISSIONS.productTypeAndAttribute] + }, + settings: { + user: ONE_PERMISSION_USERS.settings, + permissions: [PERMISSIONS.settings] + }, + shipping: { + user: ONE_PERMISSION_USERS.shipping, + permissions: [PERMISSIONS.shipping] + }, + staff: { + user: ONE_PERMISSION_USERS.staff, + permissions: [PERMISSIONS.staff] + }, + translations: { + user: ONE_PERMISSION_USERS.translations, + permissions: [PERMISSIONS.translations] + } +}; diff --git a/cypress/Data/users.js b/cypress/Data/users.js new file mode 100644 index 000000000..ec73ef704 --- /dev/null +++ b/cypress/Data/users.js @@ -0,0 +1,34 @@ +export const TEST_ADMIN_USER = { + email: Cypress.env("USER_NAME"), + password: Cypress.env("USER_PASSWORD"), + name: "Test", + lastName: "Test" +}; +export const USER_WITHOUT_NAME = { + email: Cypress.env("SECOND_USER_NAME"), + password: Cypress.env("USER_PASSWORD") +}; +export const ONE_PERMISSION_USERS = { + shipping: getOnePermissionUser("shipping.manager@example.com"), + giftCard: getOnePermissionUser("gift.card.manager@example.com"), + app: getOnePermissionUser("app.manager@example.com"), + settings: getOnePermissionUser("setting.manager@example.com"), + page: getOnePermissionUser("page.manager@example.com"), + order: getOnePermissionUser("order.manager@example.com"), + translations: getOnePermissionUser("translation.manager@example.com"), + menu: getOnePermissionUser("menu.manager@example.com"), + staff: getOnePermissionUser("staff.manager@example.com"), + user: getOnePermissionUser("user.manager@example.com"), + pageTypeAndAttribute: getOnePermissionUser( + "page.type.and.attribute.manager@example.com" + ), + productTypeAndAttribute: getOnePermissionUser( + "product.type.and.attribute.manager@example.com" + ), + discount: getOnePermissionUser("discount.manager@example.com"), + plugin: getOnePermissionUser("plugin.manager@example.com"), + product: getOnePermissionUser("product.manager@example.com") +}; +function getOnePermissionUser(email) { + return { email, password: Cypress.env("PERMISSIONS_USERS_PASSWORD") }; +} diff --git a/cypress/apiRequests/Checkout.js b/cypress/apiRequests/Checkout.js index 1e1ec147d..96bc4f7f4 100644 --- a/cypress/apiRequests/Checkout.js +++ b/cypress/apiRequests/Checkout.js @@ -1,18 +1,24 @@ -export function createCheckout( +import { getDefaultAddress } from "./utils/Utils"; +export function createCheckout({ channelSlug, email, - productQuantity, - variantsList -) { + productQuantity = 1, + variantsList, + address, + auth = "auth" +}) { const lines = variantsList.map( variant => `{quantity:${productQuantity} variantId:"${variant.id}"}` ); + const shippingAddress = getDefaultAddress(address, "shippingAddress"); + const mutation = `mutation{ checkoutCreate(input:{ channel:"${channelSlug}" email:"${email}" lines: [${lines.join()}] + ${shippingAddress} }){ checkoutErrors{ field @@ -24,7 +30,7 @@ export function createCheckout( } } }`; - return cy.sendRequestWithQuery(mutation); + return cy.sendRequestWithQuery(mutation, auth); } export function addShippingMethod(checkoutId, shippingMethodId) { const mutation = `mutation{ @@ -69,3 +75,24 @@ export function completeCheckout(checkoutId) { }`; return cy.sendRequestWithQuery(mutation); } + +export function addVoucher(checkoutId, voucherCode) { + const mutation = `mutation addVoucher{ + checkoutAddPromoCode(checkoutId:"${checkoutId}", + promoCode:"${voucherCode}" + ){ + checkoutErrors{ + field + message + } + checkout{ + totalPrice{ + gross{ + amount + } + } + } + } + }`; + return cy.sendRequestWithQuery(mutation); +} diff --git a/cypress/apiRequests/Customer.js b/cypress/apiRequests/Customer.js index 11ffc4c36..9fb0c3207 100644 --- a/cypress/apiRequests/Customer.js +++ b/cypress/apiRequests/Customer.js @@ -1,3 +1,4 @@ +import { getDefaultAddress } from "./utils/Utils"; export function createCustomer(email, customerName, address, isActive = false) { const mutation = ` mutation{ @@ -6,24 +7,8 @@ export function createCustomer(email, customerName, address, isActive = false) { lastName: "${customerName}" email: "${email}" isActive: ${isActive} - defaultBillingAddress: { - companyName: "${address.companyName}" - streetAddress1: "${address.streetAddress1}" - streetAddress2: "${address.streetAddress2}" - city: "${address.city}" - postalCode: "${address.postalCode}" - country: ${address.country} - phone: "${address.phone}" - } - defaultShippingAddress: { - companyName: "${address.companyName}" - streetAddress1: "${address.streetAddress1}" - streetAddress2: "${address.streetAddress2}" - city: "${address.city}" - postalCode: "${address.postalCode}" - country: ${address.country} - phone: "${address.phone}" - } + ${getDefaultAddress(address, "defaultBillingAddress")} + ${getDefaultAddress(address, "defaultShippingAddress")} }){ user{ id diff --git a/cypress/apiRequests/Sales.js b/cypress/apiRequests/Discounts/Sales.js similarity index 92% rename from cypress/apiRequests/Sales.js rename to cypress/apiRequests/Discounts/Sales.js index e409fb18f..e5b7913c2 100644 --- a/cypress/apiRequests/Sales.js +++ b/cypress/apiRequests/Discounts/Sales.js @@ -1,4 +1,4 @@ -import { getValueWithDefault } from "./utils/Utils"; +import { getValueWithDefault } from "../utils/Utils"; export function getSales(first, searchQuery) { const filter = getValueWithDefault( diff --git a/cypress/apiRequests/Discounts/Vouchers.js b/cypress/apiRequests/Discounts/Vouchers.js new file mode 100644 index 000000000..e9e99e800 --- /dev/null +++ b/cypress/apiRequests/Discounts/Vouchers.js @@ -0,0 +1,28 @@ +export function getVouchers(first, startsWith) { + const query = `query getVouchers{ + vouchers(first:${first}, filter:{ + search:"${startsWith}" + }){ + edges{ + node{ + id + code + } + } + } + }`; + return cy + .sendRequestWithQuery(query) + .then(resp => resp.body.data.vouchers.edges); +} +export function deleteVouchers(voucherId) { + const mutation = `mutation deleteVouchers{ + voucherDelete(id:"${voucherId}"){ + discountErrors{ + field + message + } + } + }`; + return cy.sendRequestWithQuery(mutation); +} diff --git a/cypress/apiRequests/Warehouse.js b/cypress/apiRequests/Warehouse.js index 2b7457ea8..4c31e3ac6 100644 --- a/cypress/apiRequests/Warehouse.js +++ b/cypress/apiRequests/Warehouse.js @@ -1,17 +1,12 @@ +import { getDefaultAddress } from "./utils/Utils"; + export function createWarehouse(name, shippingZone, address, slug = name) { const mutation = `mutation{ createWarehouse(input:{ name:"${name}" slug:"${slug}" shippingZones:"${shippingZone}" - address:{ - streetAddress1: "${address.streetAddress1}" - streetAddress2: "${address.streetAddress2}" - city: "${address.city}" - postalCode: "${address.postalCode}" - country: ${address.country} - phone: "${address.phone}" - } + ${getDefaultAddress(address, "address", false)} }){ warehouseErrors{ field diff --git a/cypress/apiRequests/utils/Utils.js b/cypress/apiRequests/utils/Utils.js index 33373f8d1..c848f889c 100644 --- a/cypress/apiRequests/utils/Utils.js +++ b/cypress/apiRequests/utils/Utils.js @@ -1,2 +1,21 @@ export const getValueWithDefault = (condition, value, defaultValue = "") => condition ? value : defaultValue; + +export function getDefaultAddress(address, addressType, withName = true) { + if (!address) { + return ""; + } + const defaultAddress = `city: "${address.city}" + country: ${address.country} + countryArea: "${address.countryArea}" + phone: "${address.phone}" + postalCode: "${address.postalCode}" + streetAddress1: "${address.streetAddress1}" + streetAddress2: "${address.streetAddress2}"`; + if (withName) { + defaultAddress.concat(`firstName: "Test" + lastName: "Test" + companyName: "${address.companyName}"`); + } + return `${addressType}:{${defaultAddress}}`; +} diff --git a/cypress/elements/account/left-menu/left-menu-selectors.js b/cypress/elements/account/left-menu/left-menu-selectors.js index 6181a5ab0..6d9b928a2 100644 --- a/cypress/elements/account/left-menu/left-menu-selectors.js +++ b/cypress/elements/account/left-menu/left-menu-selectors.js @@ -2,6 +2,22 @@ export const LEFT_MENU_SELECTORS = { catalog: "[data-test='menu-item-label'][data-test-id='catalogue']", configuration: "[data-test='menu-item-label'][data-test-id='configure']", home: "[data-test='menu-item-label'][data-test-id='home']", - orders: "[data-test='menu-item-label'][data-test-id=orders']", - products: "[data-test='submenu-item-label'][data-test-id='products']" + orders: "[data-test='menu-item-label'][data-test-id='orders']", + discounts: "[data-test='menu-item-label'][data-test-id='discounts']", + app: "[data-test='menu-item-label'][data-test-id='apps']", + translations: "[data-test='menu-item-label'][data-test-id='translations']", + customers: "[data-test='menu-item-label'][data-test-id='customers']" +}; +export const DISCOUNTS_MENU_SELECTORS = { + sales: "[data-test='submenu-item-label'][data-test-id='sales']", + vouchers: "[data-test='submenu-item-label'][data-test-id='vouchers']" +}; +export const ORDERS = { + orders: "[data-test='submenu-item-label'][data-test-id='orders']", + draftOrders: "[data-test='submenu-item-label'][data-test-id='order drafts']" +}; +export const CATALOG = { + products: "[data-test='submenu-item-label'][data-test-id='products']", + categories: "[data-test='submenu-item-label'][data-test-id='categories']", + collections: "[data-test='submenu-item-label'][data-test-id='collections']" }; diff --git a/cypress/elements/channels/menage-channel-availability.js b/cypress/elements/channels/menage-channel-availability.js index d0dd7d04c..f74bd8ef4 100644 --- a/cypress/elements/channels/menage-channel-availability.js +++ b/cypress/elements/channels/menage-channel-availability.js @@ -12,5 +12,6 @@ export const MENAGE_CHANNEL_AVAILABILITY = { radioButtonsValueTrue: "[value='true']", radioButtonsValueFalse: "[value='false']", visibleInListingsButton: "[name*='visibleInListings']", - allChannelsInput: "[name='allChannels']" + allChannelsInput: "[name='allChannels']", + dialog: "[role='dialog']" }; diff --git a/cypress/elements/configuration/configuration-selectors.js b/cypress/elements/configuration/configuration-selectors.js index a158e2cd8..8cb5ddbca 100644 --- a/cypress/elements/configuration/configuration-selectors.js +++ b/cypress/elements/configuration/configuration-selectors.js @@ -1,3 +1,15 @@ export const CONFIGURATION_SELECTORS = { - channels: "[data-testid='channels']" + channels: "[data-testid='channels']", + shipping: '[data-testid="shipping methods"]', + taxes: '[data-test-id="configurationMenuTaxes"]', + settings: '[data-test-id="configurationMenuSiteSettings"]', + pageTypes: '[data-test-id="configurationMenuPageTypes"]', + pages: '[data-test-id="configurationMenuPages"]', + navigation: '[data-test-id="configurationMenuNavigation"]', + staffMembers: '[data-test-id="configurationMenuStaff"]', + permissionGroups: '[data-test-id="configurationMenuPermissionGroups"]', + attributes: '[data-test-id="configurationMenuAttributes"]', + productTypes: '[data-test-id="configurationMenuProductTypes"]', + plugin: '[data-test-id="configurationPluginsPages"]', + warehouse: '[data-test-id="configurationMenuWarehouses"]' }; diff --git a/cypress/elements/discounts/vouchers.js b/cypress/elements/discounts/vouchers.js new file mode 100644 index 000000000..c14dff4ea --- /dev/null +++ b/cypress/elements/discounts/vouchers.js @@ -0,0 +1,9 @@ +export const VOUCHERS_SELECTORS = { + createVoucherButton: "[data-test-id='create-voucher']", + voucherCodeInput: "[name='code']", + discountRadioButtons: "[name='discountType']", + percentageDiscountRadioButton: "[name='discountType'][value='PERCENTAGE']", + fixedDiscountRadioButton: "[name='discountType'][value='FIXED']", + shippingDiscountRadioButton: "[name='discountType'][value='SHIPPING']", + discountValueInputs: "[name='value']" +}; diff --git a/cypress/elements/homePage/homePage-selectors.js b/cypress/elements/homePage/homePage-selectors.js index 221cb68e8..79afbfe93 100644 --- a/cypress/elements/homePage/homePage-selectors.js +++ b/cypress/elements/homePage/homePage-selectors.js @@ -5,5 +5,6 @@ export const HOMEPAGE_SELECTORS = { topProducts: "[data-test-id='top-products']", ordersReadyToFulfill: "[data-test-id='orders-to-fulfill']", paymentsWaitingForCapture: "[data-test-id='orders-to-capture']", - productsOutOfStock: "[data-test-id='products-out-of-stock']" + productsOutOfStock: "[data-test-id='products-out-of-stock']", + welcomeMessage: "[data-test='welcomeHeader']" }; diff --git a/cypress/elements/shared/button-selectors.js b/cypress/elements/shared/button-selectors.js index 66f60a439..a71e4c0ee 100644 --- a/cypress/elements/shared/button-selectors.js +++ b/cypress/elements/shared/button-selectors.js @@ -1,5 +1,6 @@ export const BUTTON_SELECTORS = { back: '[data-test="back"]', submit: '[data-test="submit"]', + confirm: '[data-test="button-bar-confirm"]', checkbox: "[type='checkbox']" }; diff --git a/cypress/elements/shared/sharedElements.js b/cypress/elements/shared/sharedElements.js new file mode 100644 index 000000000..17b4858b0 --- /dev/null +++ b/cypress/elements/shared/sharedElements.js @@ -0,0 +1,3 @@ +export const SHARED_ELEMENTS = { + header: "[data-test-id='page-header']" +}; diff --git a/cypress/integration/discounts/sales.js b/cypress/integration/discounts/sales.js index ab0c3f2a9..f516600ec 100644 --- a/cypress/integration/discounts/sales.js +++ b/cypress/integration/discounts/sales.js @@ -7,11 +7,11 @@ import { assignProducts, createSale, discountOptions -} from "../../steps/salesSteps"; +} from "../../steps/discounts/salesSteps"; import { urlList } from "../../url/urlList"; import * as channelsUtils from "../../utils/channelsUtils"; +import { deleteSalesStartsWith } from "../../utils/discounts/salesUtils"; import * as productsUtils from "../../utils/productsUtils"; -import { deleteSalesStartsWith } from "../../utils/salesUtils"; import { createShipping, deleteShippingStartsWith diff --git a/cypress/integration/discounts/vouchers.js b/cypress/integration/discounts/vouchers.js new file mode 100644 index 000000000..46000e1ca --- /dev/null +++ b/cypress/integration/discounts/vouchers.js @@ -0,0 +1,172 @@ +// +import faker from "faker"; + +import { + createVoucher, + discountOptions +} from "../../steps/discounts/vouchersSteps"; +import { urlList } from "../../url/urlList"; +import * as channelsUtils from "../../utils/channelsUtils"; +import { deleteVouchersStartsWith } from "../../utils/discounts/vouchersUtils"; +import { createCheckoutWithVoucher } from "../../utils/ordersUtils"; +import * as productsUtils from "../../utils/productsUtils"; +import { + createShipping, + deleteShippingStartsWith +} from "../../utils/shippingUtils"; + +describe("Vouchers discounts", () => { + const startsWith = "Cy-"; + const productPrice = 100; + const shippingPrice = 100; + + let defaultChannel; + let productType; + let attribute; + let category; + let shippingMethod; + let variants; + let address; + + before(() => { + cy.clearSessionData().loginUserViaRequest(); + channelsUtils.deleteChannelsStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + deleteVouchersStartsWith(startsWith); + + const name = `${startsWith}${faker.random.number()}`; + + productsUtils + .createTypeAttributeAndCategoryForProduct(name) + .then( + ({ + productType: productTypeResp, + attribute: attributeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; + + channelsUtils.getDefaultChannel(); + } + ) + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addresses => { + address = addresses.plAddress; + createShipping({ + channelId: defaultChannel.id, + name, + address, + price: shippingPrice + }); + }) + .then(({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => { + shippingMethod = shippingMethodResp; + productsUtils.createProductInChannel({ + name, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id, + price: productPrice + }); + }) + .then(({ variants: variantsResp }) => (variants = variantsResp)); + }); + + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + cy.visit(urlList.vouchers); + }); + + it("should create percentage voucher", () => { + const voucherCode = `${startsWith}${faker.random.number()}`; + const voucherValue = 50; + + createVoucher({ + voucherCode, + voucherValue, + discountOption: discountOptions.PERCENTAGE, + channelName: defaultChannel.name + }); + createCheckoutForCreatedVoucher(voucherCode) + .its("checkout.totalPrice.gross.amount") + .then(amount => { + const expectedAmount = + (productPrice * voucherValue) / 100 + shippingPrice; + expect(amount).to.be.eq(expectedAmount); + }); + }); + it("should create fixed price voucher", () => { + const voucherCode = `${startsWith}${faker.random.number()}`; + const voucherValue = 50; + + createVoucher({ + voucherCode, + voucherValue, + discountOption: discountOptions.FIXED, + channelName: defaultChannel.name + }); + createCheckoutForCreatedVoucher(voucherCode) + .its("checkout.totalPrice.gross.amount") + .then(amount => { + const expectedAmount = productPrice + shippingPrice - voucherValue; + expect(amount).to.be.eq(expectedAmount); + }); + }); + + // Test should pass after fixing - SALEOR-1629 bug + xit("should create free shipping voucher", () => { + const voucherCode = `${startsWith}${faker.random.number()}`; + + createVoucher({ + voucherCode, + discountOption: discountOptions.SHIPPING, + channelName: defaultChannel.name + }); + createCheckoutForCreatedVoucher(voucherCode) + .its("checkout.totalPrice.gross.amount") + .then(amount => { + const expectedAmount = productPrice; + expect(amount).to.be.eq(expectedAmount); + }); + }); + + it("should create voucher not available for selected channel", () => { + const randomName = `${startsWith}${faker.random.number()}`; + const voucherValue = 50; + + channelsUtils + .createChannel({ name: randomName }) + .then(channel => { + createVoucher({ + voucherCode: randomName, + voucherValue, + discountOption: discountOptions.PERCENTAGE, + channelName: channel.name + }); + createCheckoutForCreatedVoucher(randomName); + }) + .then(resp => { + const errorField = resp.checkoutErrors[0].field; + expect(errorField).to.be.eq("promoCode"); + }); + }); + + function createCheckoutForCreatedVoucher(voucherCode) { + return createCheckoutWithVoucher({ + channelSlug: defaultChannel.slug, + variantsList: variants, + address, + shippingMethodId: shippingMethod.id, + voucherCode, + auth: "token" + }); + } +}); diff --git a/cypress/integration/homePage/homePage.js b/cypress/integration/homePage/homePage.js new file mode 100644 index 000000000..26fd69ed4 --- /dev/null +++ b/cypress/integration/homePage/homePage.js @@ -0,0 +1,27 @@ +import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../Data/users"; +import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors"; +import { urlList } from "../../url/urlList"; + +describe("Displaying welcome message on home page", () => { + it("should display user name on home page", () => { + cy.loginUserViaRequest(); + cy.visit(urlList.homePage); + cy.get(HOMEPAGE_SELECTORS.welcomeMessage) + .invoke("text") + .then(text => { + expect(text).to.contains( + `${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}` + ); + }); + }); + + it("should display user email on home page", () => { + cy.loginUserViaRequest("auth", USER_WITHOUT_NAME); + cy.visit(urlList.homePage); + cy.get(HOMEPAGE_SELECTORS.welcomeMessage) + .invoke("text") + .then(text => { + expect(text).to.contains(`${USER_WITHOUT_NAME.email}`); + }); + }); +}); diff --git a/cypress/integration/homePage.js b/cypress/integration/homePage/homePageAnalitics.js similarity index 93% rename from cypress/integration/homePage.js rename to cypress/integration/homePage/homePageAnalitics.js index 73201d050..c9aca74fd 100644 --- a/cypress/integration/homePage.js +++ b/cypress/integration/homePage/homePageAnalitics.js @@ -3,18 +3,18 @@ import faker from "faker"; import { createCustomer, deleteCustomersStartsWith -} from "../apiRequests/Customer"; -import { HOMEPAGE_SELECTORS } from "../elements/homePage/homePage-selectors"; -import { changeChannel } from "../steps/homePageSteps"; -import { urlList } from "../url/urlList"; -import { getDefaultChannel } from "../utils/channelsUtils"; -import * as homePageUtils from "../utils/homePageUtils"; +} from "../../apiRequests/Customer"; +import { HOMEPAGE_SELECTORS } from "../../elements/homePage/homePage-selectors"; +import { changeChannel } from "../../steps/homePageSteps"; +import { urlList } from "../../url/urlList"; +import { getDefaultChannel } from "../../utils/channelsUtils"; +import * as homePageUtils from "../../utils/homePageUtils"; import { createReadyToFulfillOrder, createWaitingForCaptureOrder -} from "../utils/ordersUtils"; -import * as productsUtils from "../utils/productsUtils"; -import * as shippingUtils from "../utils/shippingUtils"; +} from "../../utils/ordersUtils"; +import * as productsUtils from "../../utils/productsUtils"; +import * as shippingUtils from "../../utils/shippingUtils"; // describe("Homepage analytics", () => { diff --git a/cypress/integration/navigation.js b/cypress/integration/navigation.js new file mode 100644 index 000000000..1da549182 --- /dev/null +++ b/cypress/integration/navigation.js @@ -0,0 +1,45 @@ +import { PERMISSIONS_OPTIONS } from "../Data/permissionsUsers"; +import * as permissionsSteps from "../steps/permissions"; + +describe("Navigation for users with different permissions", () => { + Object.keys(PERMISSIONS_OPTIONS).forEach(key => { + it(`should navigate as an user with ${key} permission`, () => { + const permissionOption = PERMISSIONS_OPTIONS[key]; + const permissions = permissionOption.permissions; + cy.clearSessionData(); + permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed( + permissionOption + ); + if (key === "all") { + return; + } + permissionsSteps + .getDisplayedSelectors() + .then(selectors => { + permissionsSteps.expectAllSelectorsPermitted(permissions, selectors); + }) + .then(() => { + if (!permissions) { + return; + } + permissions.forEach(permission => { + if (permission.parent) { + cy.get(permission.parent.parentMenuSelector) + .click() + .then(() => { + permissionsSteps.getDisplayedSelectors( + permission.parent.parentSelectors + ); + }) + .then(parentSelectors => { + permissionsSteps.expectAllSelectorsPermitted( + permissions, + parentSelectors + ); + }); + } + }); + }); + }); + }); +}); diff --git a/cypress/integration/products/products.js b/cypress/integration/products/products.js index f594d32d5..7988137f8 100644 --- a/cypress/integration/products/products.js +++ b/cypress/integration/products/products.js @@ -1,5 +1,4 @@ // -import { LEFT_MENU_SELECTORS } from "../../elements/account/left-menu/left-menu-selectors"; import { PRODUCTS_SELECTORS } from "../../elements/catalog/products/product-selectors"; import { urlList } from "../../url/urlList"; @@ -8,16 +7,6 @@ describe("Products", () => { cy.clearSessionData().loginUserViaRequest(); }); - it("should navigate to channels page", () => { - cy.visit(urlList.homePage) - .get(LEFT_MENU_SELECTORS.catalog) - .click() - .get(LEFT_MENU_SELECTORS.products) - .click() - .location("pathname") - .should("contain", "/products"); - }); - it("should add new visible product", () => { cy.visit(urlList.products) .get(PRODUCTS_SELECTORS.createProductBtn) diff --git a/cypress/steps/channelsSteps.js b/cypress/steps/channelsSteps.js index ec26e3834..e2a8fc2db 100644 --- a/cypress/steps/channelsSteps.js +++ b/cypress/steps/channelsSteps.js @@ -1,7 +1,9 @@ import { ADD_CHANNEL_FORM_SELECTORS } from "../elements/channels/add-channel-form-selectors"; import { CHANNEL_FORM_SELECTORS } from "../elements/channels/channel-form-selectors"; import { CHANNELS_SELECTORS } from "../elements/channels/channels-selectors"; +import { MENAGE_CHANNEL_AVAILABILITY } from "../elements/channels/menage-channel-availability"; import { HEADER_SELECTORS } from "../elements/header/header-selectors"; +import { BUTTON_SELECTORS } from "../elements/shared/button-selectors"; export function createChannelByView(name, currency, slug = name) { cy.get(CHANNELS_SELECTORS.createChannelButton) @@ -36,3 +38,15 @@ export function selectChannelInHeader(channelName) { .contains(channelName) .click(); } +export function selectChannelInDetailsPages(channelName) { + cy.get(MENAGE_CHANNEL_AVAILABILITY.availableManageButton) + .click() + .get(MENAGE_CHANNEL_AVAILABILITY.allChannelsInput) + .click() + .get(MENAGE_CHANNEL_AVAILABILITY.channelsAvailabilityForm) + .contains(channelName) + .click() + .get(MENAGE_CHANNEL_AVAILABILITY.dialog) + .find(BUTTON_SELECTORS.submit) + .click(); +} diff --git a/cypress/steps/salesSteps.js b/cypress/steps/discounts/salesSteps.js similarity index 60% rename from cypress/steps/salesSteps.js rename to cypress/steps/discounts/salesSteps.js index 2b00201fb..2d5a87791 100644 --- a/cypress/steps/salesSteps.js +++ b/cypress/steps/discounts/salesSteps.js @@ -1,8 +1,8 @@ -import { ASSIGN_PRODUCTS_SELECTORS } from "../elements/catalog/assign-products"; -import { MENAGE_CHANNEL_AVAILABILITY } from "../elements/channels/menage-channel-availability"; -import { SALES_SELECTORS } from "../elements/discounts/sales"; -import { BUTTON_SELECTORS } from "../elements/shared/button-selectors"; -import { formatDate } from "../support/formatDate"; +import { ASSIGN_PRODUCTS_SELECTORS } from "../../elements/catalog/assign-products"; +import { SALES_SELECTORS } from "../../elements/discounts/sales"; +import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; +import { formatDate } from "../../support/formatDate"; +import { selectChannelInDetailsPages } from "../channelsSteps"; export const discountOptions = { PERCENTAGE: SALES_SELECTORS.percentageOption, @@ -22,17 +22,9 @@ export function createSale({ .get(SALES_SELECTORS.nameInput) .type(saleName) .get(discountOption) - .click() - .get(MENAGE_CHANNEL_AVAILABILITY.availableManageButton) - .click() - .get(MENAGE_CHANNEL_AVAILABILITY.allChannelsInput) - .click() - .get(MENAGE_CHANNEL_AVAILABILITY.channelsAvailabilityForm) - .contains(channelName) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .get(SALES_SELECTORS.discountValue) + .click(); + selectChannelInDetailsPages(channelName); + cy.get(SALES_SELECTORS.discountValue) .type(discountValue) .get(SALES_SELECTORS.startDateInput) .type(todaysDate); diff --git a/cypress/steps/discounts/vouchersSteps.js b/cypress/steps/discounts/vouchersSteps.js new file mode 100644 index 000000000..518a3f8a4 --- /dev/null +++ b/cypress/steps/discounts/vouchersSteps.js @@ -0,0 +1,27 @@ +import { VOUCHERS_SELECTORS } from "../../elements/discounts/vouchers"; +import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; +import { selectChannelInDetailsPages } from "../channelsSteps"; + +export const discountOptions = { + PERCENTAGE: VOUCHERS_SELECTORS.percentageDiscountRadioButton, + FIXED: VOUCHERS_SELECTORS.fixedDiscountRadioButton, + SHIPPING: VOUCHERS_SELECTORS.shippingDiscountRadioButton +}; + +export function createVoucher({ + voucherCode, + voucherValue, + discountOption, + channelName +}) { + cy.get(VOUCHERS_SELECTORS.createVoucherButton).click(); + selectChannelInDetailsPages(channelName); + cy.get(VOUCHERS_SELECTORS.voucherCodeInput) + .type(voucherCode) + .get(discountOption) + .click(); + if (discountOption !== discountOptions.SHIPPING) { + cy.get(VOUCHERS_SELECTORS.discountValueInputs).type(voucherValue); + } + cy.get(BUTTON_SELECTORS.confirm).click(); +} diff --git a/cypress/steps/permissions.js b/cypress/steps/permissions.js new file mode 100644 index 000000000..e8de98b9c --- /dev/null +++ b/cypress/steps/permissions.js @@ -0,0 +1,77 @@ +import { LEFT_MENU_SELECTORS } from "../elements/account/left-menu/left-menu-selectors"; +import { SHARED_ELEMENTS } from "../elements/shared/sharedElements"; +import { urlList } from "../url/urlList"; + +/* eslint-disable no-unused-expressions */ + +export function navigateToAllAvailablePageAndCheckIfDisplayed({ + user, + permissions +}) { + cy.loginUserViaRequest("auth", user); + cy.visit(urlList.homePage); + if (!permissions) { + return; + } + return permissions.forEach(permission => + permission.permissionSelectors.forEach(permissionSelector => { + navigateToAvailablePageAndCheckIfDisplayed( + permission.parent, + permissionSelector + ); + }) + ); +} +function navigateToAvailablePageAndCheckIfDisplayed( + parent, + permissionSelector +) { + if (parent) { + cy.get(parent.parentMenuSelector).click(); + } + return cy + .get(permissionSelector) + .click() + .then(() => { + isElementDisplayed(); + }) + .then(isDisplayed => { + expect(isDisplayed).to.be.true; + }); +} +export function isElementDisplayed(element = SHARED_ELEMENTS.header) { + return cy.get("body").then(body => body.find(element).length > 0); +} +export function getDisplayedSelectors(selectors = LEFT_MENU_SELECTORS) { + const displayedSelectors = {}; + cy.wrap(displayedSelectors).as("displayedSelectors"); + + Object.values(selectors).forEach((value, i) => + isElementDisplayed(value).then(isDisplayed => { + if (isDisplayed) { + cy.wrap(value); + displayedSelectors["link" + i] = value; + cy.wrap(displayedSelectors).as("displayedSelectors"); + } + }) + ); + return cy.get("@displayedSelectors"); +} +export function expectAllSelectorsPermitted(permissions, selectors) { + Object.values(selectors).forEach(selector => { + const isSelectorPermitted = isPermitted(permissions, selector); + expect(isSelectorPermitted).to.be.true; + }); +} +function isPermitted(permissions, selector) { + let permittedSelectors = [LEFT_MENU_SELECTORS.home]; + permissions.forEach(permission => { + if (permission.parent) { + permittedSelectors.push(permission.parent.parentMenuSelector); + } + permittedSelectors = permittedSelectors.concat( + permission.permissionSelectors + ); + }); + return permittedSelectors.includes(selector); +} diff --git a/cypress/support/deleteElement/index.js b/cypress/support/deleteElement/index.js index 03ad58c8e..44d046684 100644 --- a/cypress/support/deleteElement/index.js +++ b/cypress/support/deleteElement/index.js @@ -1,17 +1,17 @@ Cypress.Commands.add( "handleDeleteElement", - (element, deleteFunction, startsWith) => { - if (element.node.name.includes(startsWith)) { + (element, deleteFunction, startsWith, name) => { + if (element.node[name].includes(startsWith)) { deleteFunction(element.node.id); } } ); Cypress.Commands.add( "deleteElementsStartsWith", - (deleteFunction, getFunction, startsWith, name) => { + (deleteFunction, getFunction, startsWith, name = "name") => { getFunction(100, startsWith).then(elements => { elements.forEach(element => { - cy.handleDeleteElement(element, deleteFunction, startsWith); + cy.handleDeleteElement(element, deleteFunction, startsWith, name); }); }); } diff --git a/cypress/support/user/index.js b/cypress/support/user/index.js index 33fcc4adc..a87f31502 100644 --- a/cypress/support/user/index.js +++ b/cypress/support/user/index.js @@ -1,3 +1,4 @@ +import { TEST_ADMIN_USER } from "../../Data/users"; import { LOGIN_SELECTORS } from "../../elements/account/login-selectors"; Cypress.Commands.add("loginUser", () => @@ -14,11 +15,11 @@ Cypress.Commands.add("loginInShop", () => { cy.loginUserViaRequest("token"); }); -Cypress.Commands.add("loginUserViaRequest", (authorization = "auth") => { - const mutation = `mutation TokenAuth{ - tokenCreate(email: "${Cypress.env("USER_NAME")}", password: "${Cypress.env( - "USER_PASSWORD" - )}") { +Cypress.Commands.add( + "loginUserViaRequest", + (authorization = "auth", user = TEST_ADMIN_USER) => { + const mutation = `mutation TokenAuth{ + tokenCreate(email: "${user.email}", password: "${user.password}") { token errors: accountErrors { code @@ -30,10 +31,11 @@ Cypress.Commands.add("loginUserViaRequest", (authorization = "auth") => { } } }`; - return cy.sendRequestWithQuery(mutation, authorization).then(resp => { - window.sessionStorage.setItem( - authorization, - resp.body.data.tokenCreate.token - ); - }); -}); + return cy.sendRequestWithQuery(mutation, authorization).then(resp => { + window.sessionStorage.setItem( + authorization, + resp.body.data.tokenCreate.token + ); + }); + } +); diff --git a/cypress/url/urlList.js b/cypress/url/urlList.js index f91d13c72..d107318da 100644 --- a/cypress/url/urlList.js +++ b/cypress/url/urlList.js @@ -8,6 +8,7 @@ export const urlList = { products: "products/", warehouses: "warehouses/", sales: "discounts/sales/", - collections: "collections/" + collections: "collections/", + vouchers: "discounts/vouchers/" }; export const productDetailsUrl = productId => `${urlList.products}${productId}`; diff --git a/cypress/utils/collectionsUtils.js b/cypress/utils/collectionsUtils.js index cfe3694b0..36f72a652 100644 --- a/cypress/utils/collectionsUtils.js +++ b/cypress/utils/collectionsUtils.js @@ -1,10 +1,5 @@ import { deleteCollection, getCollections } from "../apiRequests/Collections"; export function deleteCollectionsStartsWith(startsWith) { - cy.deleteElementsStartsWith( - deleteCollection, - getCollections, - startsWith, - "collection" - ); + cy.deleteElementsStartsWith(deleteCollection, getCollections, startsWith); } diff --git a/cypress/utils/discounts/salesUtils.js b/cypress/utils/discounts/salesUtils.js new file mode 100644 index 000000000..15620d37f --- /dev/null +++ b/cypress/utils/discounts/salesUtils.js @@ -0,0 +1,5 @@ +import { deleteSale, getSales } from "../../apiRequests/Discounts/Sales"; + +export function deleteSalesStartsWith(startsWith) { + cy.deleteElementsStartsWith(deleteSale, getSales, startsWith); +} diff --git a/cypress/utils/discounts/vouchersUtils.js b/cypress/utils/discounts/vouchersUtils.js new file mode 100644 index 000000000..083099965 --- /dev/null +++ b/cypress/utils/discounts/vouchersUtils.js @@ -0,0 +1,8 @@ +import { + deleteVouchers, + getVouchers +} from "../../apiRequests/Discounts/Vouchers"; + +export function deleteVouchersStartsWith(startsWith) { + cy.deleteElementsStartsWith(deleteVouchers, getVouchers, startsWith, "code"); +} diff --git a/cypress/utils/ordersUtils.js b/cypress/utils/ordersUtils.js index 17c50e3f7..1610d1ccd 100644 --- a/cypress/utils/ordersUtils.js +++ b/cypress/utils/ordersUtils.js @@ -8,7 +8,7 @@ export function createWaitingForCaptureOrder( shippingMethodId ) { let checkout; - return createCheckout(channelSlug, email, variantsList) + return createCheckout({ channelSlug, email, variantsList }) .then(checkoutResp => { checkout = checkoutResp; checkoutRequest.addShippingMethod(checkout.id, shippingMethodId); @@ -17,6 +17,27 @@ export function createWaitingForCaptureOrder( .then(() => checkoutRequest.completeCheckout(checkout.id)) .then(() => checkout); } +export function createCheckoutWithVoucher({ + channelSlug, + email = "email@example.com", + variantsList, + address, + shippingMethodId, + voucherCode, + auth +}) { + let checkout; + return createCheckout({ channelSlug, email, variantsList, address, auth }) + .then(checkoutResp => { + checkout = checkoutResp; + checkoutRequest.addShippingMethod(checkout.id, shippingMethodId); + }) + .then(() => { + checkoutRequest.addVoucher(checkout.id, voucherCode); + }) + .its("body.data.checkoutAddPromoCode"); +} + export function createReadyToFulfillOrder( customerId, shippingMethodId, @@ -60,9 +81,22 @@ export function createDraftOrder(customerId, shippingMethodId, channelId) { .createDraftOrder(customerId, shippingMethodId, channelId) .its("body.data.draftOrderCreate.order"); } -export function createCheckout(channelSlug, email, variantsList) { +export function createCheckout({ + channelSlug, + email, + variantsList, + address, + auth +}) { return checkoutRequest - .createCheckout(channelSlug, email, 1, variantsList) + .createCheckout({ + channelSlug, + email, + productQuantity: 1, + variantsList, + address, + auth + }) .its("body.data.checkoutCreate.checkout"); } export function addPayment(checkoutId) { diff --git a/cypress/utils/productsUtils.js b/cypress/utils/productsUtils.js index cadced175..8bf2e86e2 100644 --- a/cypress/utils/productsUtils.js +++ b/cypress/utils/productsUtils.js @@ -109,19 +109,16 @@ export function deleteProductsStartsWith(startsWith) { cy.deleteElementsStartsWith( productRequest.deleteProductType, productRequest.getProductTypes, - startsWith, - "productType" + startsWith ); cy.deleteElementsStartsWith( attributeRequest.deleteAttribute, attributeRequest.getAttributes, - startsWith, - "attributes" + startsWith ); cy.deleteElementsStartsWith( categoryRequest.deleteCategory, categoryRequest.getCategories, - startsWith, - "categories" + startsWith ); } diff --git a/cypress/utils/salesUtils.js b/cypress/utils/salesUtils.js deleted file mode 100644 index 6178380fe..000000000 --- a/cypress/utils/salesUtils.js +++ /dev/null @@ -1,5 +0,0 @@ -import { deleteSale, getSales } from "../apiRequests/Sales"; - -export function deleteSalesStartsWith(startsWith) { - cy.deleteElementsStartsWith(deleteSale, getSales, startsWith, "sales"); -} diff --git a/cypress/utils/shippingUtils.js b/cypress/utils/shippingUtils.js index d297e3f8d..734699c31 100644 --- a/cypress/utils/shippingUtils.js +++ b/cypress/utils/shippingUtils.js @@ -46,13 +46,11 @@ export function deleteShippingStartsWith(startsWith) { cy.deleteElementsStartsWith( shippingMethodRequest.deleteShippingZone, shippingMethodRequest.getShippingZones, - startsWith, - "shippingZONE" + startsWith ); cy.deleteElementsStartsWith( warehouseRequest.deleteWarehouse, warehouseRequest.getWarehouses, - startsWith, - "Warehouse" + startsWith ); } diff --git a/schema.graphql b/schema.graphql index 92afd0cfe..15a3ac194 100644 --- a/schema.graphql +++ b/schema.graphql @@ -479,6 +479,7 @@ input AttributeFilterInput { filterableInStorefront: Boolean filterableInDashboard: Boolean availableInGrid: Boolean + metadata: [MetadataInput] search: String ids: [ID] type: AttributeTypeEnum @@ -571,6 +572,7 @@ type AttributeValue implements Node { id: ID! name: String slug: String + value: String translation(languageCode: LanguageCodeEnum!): AttributeValueTranslation inputType: AttributeInputTypeEnum reference: ID @@ -592,6 +594,7 @@ type AttributeValueCreate { input AttributeValueCreateInput { name: String! + value: String } type AttributeValueDelete { @@ -717,6 +720,7 @@ type CategoryDelete { input CategoryFilterInput { search: String + metadata: [MetadataInput] ids: [ID] } @@ -1070,7 +1074,7 @@ type CollectionAddProducts { type CollectionBulkDelete { errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.") count: Int! - productErrors: [ProductError!]! + collectionErrors: [CollectionError!]! } type CollectionChannelListing implements Node { @@ -1155,6 +1159,7 @@ enum CollectionErrorCode { input CollectionFilterInput { published: CollectionPublished search: String + metadata: [MetadataInput] ids: [ID] channel: String } @@ -2405,6 +2410,7 @@ enum MenuErrorCode { input MenuFilterInput { search: String slug: [String] + metadata: [MetadataInput] } input MenuInput { @@ -2469,6 +2475,7 @@ type MenuItemDelete { input MenuItemFilterInput { search: String + metadata: [MetadataInput] } input MenuItemInput { @@ -3013,6 +3020,7 @@ input OrderDraftFilterInput { customer: String created: DateRangeInput search: String + metadata: [MetadataInput] channels: [ID] } @@ -3170,6 +3178,7 @@ input OrderFilterInput { customer: String created: DateRangeInput search: String + metadata: [MetadataInput] channels: [ID] } @@ -3494,6 +3503,7 @@ enum PageErrorCode { input PageFilterInput { search: String + metadata: [MetadataInput] } type PageInfo { @@ -3726,6 +3736,10 @@ enum PaymentErrorCode { NOT_SUPPORTED_GATEWAY } +input PaymentFilterInput { + checkouts: [ID] +} + type PaymentGateway { name: String! id: ID! @@ -3957,7 +3971,7 @@ type Product implements Node & ObjectWithMetadata { mediaById(id: ID): ProductMedia! imageById(id: ID): ProductImage @deprecated(reason: "Will be removed in Saleor 4.0. Use the `mediaById` field instead.") variants: [ProductVariant] - media: [ProductMedia] + media: [ProductMedia!] images: [ProductImage] @deprecated(reason: "Will be removed in Saleor 4.0. Use the `media` field instead.") collections: [Collection] translation(languageCode: LanguageCodeEnum!): ProductTranslation @@ -4127,6 +4141,7 @@ input ProductFilterInput { productType: ID stocks: ProductStockFilterInput search: String + metadata: [MetadataInput] price: PriceRangeInput minimalPrice: PriceRangeInput productTypes: [ID] @@ -4341,6 +4356,7 @@ input ProductTypeFilterInput { search: String configurable: ProductTypeConfigurable productType: ProductTypeEnum + metadata: [MetadataInput] ids: [ID] } @@ -4486,6 +4502,7 @@ type ProductVariantDelete { input ProductVariantFilterInput { search: String sku: [String] + metadata: [MetadataInput] } input ProductVariantInput { @@ -4590,7 +4607,7 @@ type Query { productVariants(ids: [ID], channel: String, filter: ProductVariantFilterInput, before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection reportProductSales(period: ReportingPeriod!, channel: String!, before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection payment(id: ID!): Payment - payments(before: String, after: String, first: Int, last: Int): PaymentCountableConnection + payments(filter: PaymentFilterInput, before: String, after: String, first: Int, last: Int): PaymentCountableConnection page(id: ID, slug: String): Page pages(sortBy: PageSortingInput, filter: PageFilterInput, before: String, after: String, first: Int, last: Int): PageCountableConnection pageType(id: ID!): PageType @@ -5359,23 +5376,11 @@ type Transaction implements Node { token: String! kind: TransactionKind! isSuccess: Boolean! - error: TransactionError + error: String + gatewayResponse: JSONString! amount: Money } -enum TransactionError { - TRANSACTIONERROR_INCORRECT_NUMBER - TRANSACTIONERROR_INVALID_NUMBER - TRANSACTIONERROR_INCORRECT_CVV - TRANSACTIONERROR_INVALID_CVV - TRANSACTIONERROR_INCORRECT_ZIP - TRANSACTIONERROR_INCORRECT_ADDRESS - TRANSACTIONERROR_INVALID_EXPIRY_DATE - TRANSACTIONERROR_EXPIRED - TRANSACTIONERROR_PROCESSING_ERROR - TRANSACTIONERROR_DECLINED -} - enum TransactionKind { EXTERNAL AUTH diff --git a/src/Baseline.tsx b/src/Baseline.tsx index db200dda8..7e4ca2185 100644 --- a/src/Baseline.tsx +++ b/src/Baseline.tsx @@ -1,9 +1,9 @@ import CssBaseline from "@material-ui/core/CssBaseline"; -import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; +import { createStyles, SaleorTheme, withStyles } from "@saleor/theme"; import React from "react"; -const styles = createStyles((theme: Theme) => ({ +const styles = createStyles((theme: SaleorTheme) => ({ "@global": { "@import": "url('https://rsms.me/inter/inter.css')", diff --git a/src/apps/components/AppDetailsSettingsPage/styles.ts b/src/apps/components/AppDetailsSettingsPage/styles.ts index cf6f42e4d..75cddc7bd 100644 --- a/src/apps/components/AppDetailsSettingsPage/styles.ts +++ b/src/apps/components/AppDetailsSettingsPage/styles.ts @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/components/AppInstallErrorPage/styles.ts b/src/apps/components/AppInstallErrorPage/styles.ts index 6232b920f..d19a783a1 100644 --- a/src/apps/components/AppInstallErrorPage/styles.ts +++ b/src/apps/components/AppInstallErrorPage/styles.ts @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/components/CustomAppDefaultToken/styles.ts b/src/apps/components/CustomAppDefaultToken/styles.ts index 1f63c79ef..47c87521b 100644 --- a/src/apps/components/CustomAppDefaultToken/styles.ts +++ b/src/apps/components/CustomAppDefaultToken/styles.ts @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/components/CustomAppTokens/styles.ts b/src/apps/components/CustomAppTokens/styles.ts index 42231fff0..583c09877 100644 --- a/src/apps/components/CustomAppTokens/styles.ts +++ b/src/apps/components/CustomAppTokens/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/components/DeactivatedText/styles.ts b/src/apps/components/DeactivatedText/styles.ts index 0c1e03ef2..863b6cdd0 100644 --- a/src/apps/components/DeactivatedText/styles.ts +++ b/src/apps/components/DeactivatedText/styles.ts @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/components/TokenCreateDialog/styles.ts b/src/apps/components/TokenCreateDialog/styles.ts index 4ba0e9333..b57ffa77a 100644 --- a/src/apps/components/TokenCreateDialog/styles.ts +++ b/src/apps/components/TokenCreateDialog/styles.ts @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/styles.ts b/src/apps/styles.ts index 9d6e83224..b4798ea6c 100644 --- a/src/apps/styles.ts +++ b/src/apps/styles.ts @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/apps/types/App.ts b/src/apps/types/App.ts index 833e8d218..6a39786a6 100644 --- a/src/apps/types/App.ts +++ b/src/apps/types/App.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppTypeEnum, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppActivate.ts b/src/apps/types/AppActivate.ts index d4bae0f7a..e4bfa8c82 100644 --- a/src/apps/types/AppActivate.ts +++ b/src/apps/types/AppActivate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppCreate.ts b/src/apps/types/AppCreate.ts index a3cb7cb0f..8eb7f4613 100644 --- a/src/apps/types/AppCreate.ts +++ b/src/apps/types/AppCreate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppInput, AppTypeEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppDeactivate.ts b/src/apps/types/AppDeactivate.ts index f391ecb2a..1b6468ffe 100644 --- a/src/apps/types/AppDeactivate.ts +++ b/src/apps/types/AppDeactivate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppDelete.ts b/src/apps/types/AppDelete.ts index af2a28456..862a0007d 100644 --- a/src/apps/types/AppDelete.ts +++ b/src/apps/types/AppDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppTypeEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppDeleteFailedInstallation.ts b/src/apps/types/AppDeleteFailedInstallation.ts index 70dd4860f..21c442aad 100644 --- a/src/apps/types/AppDeleteFailedInstallation.ts +++ b/src/apps/types/AppDeleteFailedInstallation.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { JobStatusEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppFetch.ts b/src/apps/types/AppFetch.ts index 3b09b98c4..d9e213975 100644 --- a/src/apps/types/AppFetch.ts +++ b/src/apps/types/AppFetch.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { PermissionEnum, AppErrorCode } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppInstall.ts b/src/apps/types/AppInstall.ts index 4952ab004..b97e16abf 100644 --- a/src/apps/types/AppInstall.ts +++ b/src/apps/types/AppInstall.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppInstallInput, JobStatusEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppRetryInstall.ts b/src/apps/types/AppRetryInstall.ts index 31b8dd049..53244caae 100644 --- a/src/apps/types/AppRetryInstall.ts +++ b/src/apps/types/AppRetryInstall.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { JobStatusEnum, AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppTokenCreate.ts b/src/apps/types/AppTokenCreate.ts index 008e74772..c673ab54b 100644 --- a/src/apps/types/AppTokenCreate.ts +++ b/src/apps/types/AppTokenCreate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppTokenInput, AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppTokenDelete.ts b/src/apps/types/AppTokenDelete.ts index 53bc8e02b..8e69c404e 100644 --- a/src/apps/types/AppTokenDelete.ts +++ b/src/apps/types/AppTokenDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppUpdate.ts b/src/apps/types/AppUpdate.ts index a27a4f3c3..446681c21 100644 --- a/src/apps/types/AppUpdate.ts +++ b/src/apps/types/AppUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppInput, AppTypeEnum, PermissionEnum, AppErrorCode } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppsInstallations.ts b/src/apps/types/AppsInstallations.ts index 93c0aff2d..27e34298c 100644 --- a/src/apps/types/AppsInstallations.ts +++ b/src/apps/types/AppsInstallations.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { JobStatusEnum } from "./../../types/globalTypes"; diff --git a/src/apps/types/AppsList.ts b/src/apps/types/AppsList.ts index 00a127bae..5c331faf1 100644 --- a/src/apps/types/AppsList.ts +++ b/src/apps/types/AppsList.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AppSortingInput, AppFilterInput, AppTypeEnum } from "./../../types/globalTypes"; diff --git a/src/attributes/components/AttributeDetails/AttributeDetails.tsx b/src/attributes/components/AttributeDetails/AttributeDetails.tsx index 83f204f0e..53c59fa88 100644 --- a/src/attributes/components/AttributeDetails/AttributeDetails.tsx +++ b/src/attributes/components/AttributeDetails/AttributeDetails.tsx @@ -1,6 +1,5 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import CardTitle from "@saleor/components/CardTitle"; import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; @@ -8,6 +7,7 @@ import FormSpacer from "@saleor/components/FormSpacer"; import SingleSelectField from "@saleor/components/SingleSelectField"; import { AttributeErrorFragment } from "@saleor/fragments/types/AttributeErrorFragment"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import { AttributeEntityTypeEnum, AttributeInputTypeEnum diff --git a/src/attributes/components/AttributeList/AttributeList.tsx b/src/attributes/components/AttributeList/AttributeList.tsx index 211c374ce..cf0b255ab 100644 --- a/src/attributes/components/AttributeList/AttributeList.tsx +++ b/src/attributes/components/AttributeList/AttributeList.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -12,6 +11,7 @@ import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { translateBoolean } from "@saleor/intl"; import { maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ListActions, ListProps, SortPage } from "@saleor/types"; import { getArrowDirection } from "@saleor/utils/sort"; import React from "react"; diff --git a/src/attributes/components/AttributeValues/AttributeValues.tsx b/src/attributes/components/AttributeValues/AttributeValues.tsx index 25292d894..b6eb1f071 100644 --- a/src/attributes/components/AttributeValues/AttributeValues.tsx +++ b/src/attributes/components/AttributeValues/AttributeValues.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableCell from "@material-ui/core/TableCell"; import TableHead from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; @@ -15,6 +14,7 @@ import { } from "@saleor/components/SortableTable"; import { AttributeDetailsFragment_values } from "@saleor/fragments/types/AttributeDetailsFragment"; import { maybe, renderCollection, stopPropagation } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ReorderAction } from "@saleor/types"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/attributes/types/AttributeBulkDelete.ts b/src/attributes/types/AttributeBulkDelete.ts index 590e75444..f4eefc0d0 100644 --- a/src/attributes/types/AttributeBulkDelete.ts +++ b/src/attributes/types/AttributeBulkDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeCreate.ts b/src/attributes/types/AttributeCreate.ts index 57cd97040..e27c3054b 100644 --- a/src/attributes/types/AttributeCreate.ts +++ b/src/attributes/types/AttributeCreate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeCreateInput, AttributeTypeEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum, AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeDelete.ts b/src/attributes/types/AttributeDelete.ts index 5142f59e3..ec813a270 100644 --- a/src/attributes/types/AttributeDelete.ts +++ b/src/attributes/types/AttributeDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeDetails.ts b/src/attributes/types/AttributeDetails.ts index 697cae1e8..32bfb334d 100644 --- a/src/attributes/types/AttributeDetails.ts +++ b/src/attributes/types/AttributeDetails.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeTypeEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeList.ts b/src/attributes/types/AttributeList.ts index 80ba7cd17..48674537d 100644 --- a/src/attributes/types/AttributeList.ts +++ b/src/attributes/types/AttributeList.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeFilterInput, AttributeSortingInput, AttributeTypeEnum } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeUpdate.ts b/src/attributes/types/AttributeUpdate.ts index cb382330d..9cdf5d4c2 100644 --- a/src/attributes/types/AttributeUpdate.ts +++ b/src/attributes/types/AttributeUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeUpdateInput, AttributeTypeEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum, AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeValueCreate.ts b/src/attributes/types/AttributeValueCreate.ts index 40ad076ee..ee850ebb9 100644 --- a/src/attributes/types/AttributeValueCreate.ts +++ b/src/attributes/types/AttributeValueCreate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeValueCreateInput, AttributeTypeEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum, AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeValueDelete.ts b/src/attributes/types/AttributeValueDelete.ts index 9894ac6df..cc6c1accf 100644 --- a/src/attributes/types/AttributeValueDelete.ts +++ b/src/attributes/types/AttributeValueDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeTypeEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum, AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeValueReorder.ts b/src/attributes/types/AttributeValueReorder.ts index deaf9229d..f5305e6c6 100644 --- a/src/attributes/types/AttributeValueReorder.ts +++ b/src/attributes/types/AttributeValueReorder.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ReorderInput, AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/attributes/types/AttributeValueUpdate.ts b/src/attributes/types/AttributeValueUpdate.ts index 9b57fa9cf..1e3de5352 100644 --- a/src/attributes/types/AttributeValueUpdate.ts +++ b/src/attributes/types/AttributeValueUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AttributeValueCreateInput, AttributeTypeEnum, AttributeInputTypeEnum, AttributeEntityTypeEnum, AttributeErrorCode } from "./../../types/globalTypes"; diff --git a/src/auth/components/Layout.tsx b/src/auth/components/Layout.tsx index e9d148b6a..44e86b53b 100644 --- a/src/auth/components/Layout.tsx +++ b/src/auth/components/Layout.tsx @@ -1,8 +1,8 @@ import backgroundArt from "@assets/images/login-background.svg"; import saleorDarkLogo from "@assets/images/logo-dark.svg"; import saleorLightLogo from "@assets/images/logo-light.svg"; -import { makeStyles } from "@material-ui/core/styles"; import useTheme from "@saleor/hooks/useTheme"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import SVG from "react-inlinesvg"; diff --git a/src/auth/components/LoginLoading/LoginLoading.tsx b/src/auth/components/LoginLoading/LoginLoading.tsx index 63ecfae8d..b30e04e18 100644 --- a/src/auth/components/LoginLoading/LoginLoading.tsx +++ b/src/auth/components/LoginLoading/LoginLoading.tsx @@ -1,5 +1,5 @@ import CircularProgress from "@material-ui/core/CircularProgress"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/auth/components/LoginPage/LoginPage.tsx b/src/auth/components/LoginPage/LoginPage.tsx index 1cda9ef13..17960d317 100644 --- a/src/auth/components/LoginPage/LoginPage.tsx +++ b/src/auth/components/LoginPage/LoginPage.tsx @@ -1,13 +1,13 @@ import Button from "@material-ui/core/Button"; import CircularProgress from "@material-ui/core/CircularProgress"; import Divider from "@material-ui/core/Divider"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import { AvailableExternalAuthentications_shop_availableExternalAuthentications } from "@saleor/auth/types/AvailableExternalAuthentications"; import { FormSpacer } from "@saleor/components/FormSpacer"; import { SubmitPromise } from "@saleor/hooks/useForm"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx index ba9966675..f11b70d24 100644 --- a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx +++ b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx @@ -1,10 +1,10 @@ import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import { SetPassword_setPassword_errors } from "@saleor/auth/types/SetPassword"; import Form from "@saleor/components/Form"; import FormSpacer from "@saleor/components/FormSpacer"; +import { makeStyles } from "@saleor/theme"; import getAccountErrorMessage from "@saleor/utils/errors/account"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx index 7502ec631..4d9252ca7 100644 --- a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx +++ b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx @@ -1,10 +1,10 @@ import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import Form from "@saleor/components/Form"; import FormSpacer from "@saleor/components/FormSpacer"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/auth/components/ResetPasswordSuccessPage/ResetPasswordSuccessPage.tsx b/src/auth/components/ResetPasswordSuccessPage/ResetPasswordSuccessPage.tsx index 5cc95cb26..b49ae56f2 100644 --- a/src/auth/components/ResetPasswordSuccessPage/ResetPasswordSuccessPage.tsx +++ b/src/auth/components/ResetPasswordSuccessPage/ResetPasswordSuccessPage.tsx @@ -1,7 +1,7 @@ import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import FormSpacer from "@saleor/components/FormSpacer"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/auth/types/AvailableExternalAuthentications.ts b/src/auth/types/AvailableExternalAuthentications.ts index 886830ab0..eecda7c0d 100644 --- a/src/auth/types/AvailableExternalAuthentications.ts +++ b/src/auth/types/AvailableExternalAuthentications.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/auth/types/ExternalAuthenticationUrl.ts b/src/auth/types/ExternalAuthenticationUrl.ts index 1fb2fd723..23f920d72 100644 --- a/src/auth/types/ExternalAuthenticationUrl.ts +++ b/src/auth/types/ExternalAuthenticationUrl.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/auth/types/ExternalObtainAccessTokens.ts b/src/auth/types/ExternalObtainAccessTokens.ts index 8497ab2b8..b75ea0660 100644 --- a/src/auth/types/ExternalObtainAccessTokens.ts +++ b/src/auth/types/ExternalObtainAccessTokens.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { PermissionEnum, AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/auth/types/ExternalRefreshToken.ts b/src/auth/types/ExternalRefreshToken.ts index 2c2822403..291f339c6 100644 --- a/src/auth/types/ExternalRefreshToken.ts +++ b/src/auth/types/ExternalRefreshToken.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/auth/types/ExternalVerifyToken.ts b/src/auth/types/ExternalVerifyToken.ts index 8e2851aed..7a7ee5d52 100644 --- a/src/auth/types/ExternalVerifyToken.ts +++ b/src/auth/types/ExternalVerifyToken.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/auth/types/RefreshToken.ts b/src/auth/types/RefreshToken.ts index f4efc60fd..b7af12a9b 100644 --- a/src/auth/types/RefreshToken.ts +++ b/src/auth/types/RefreshToken.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/auth/types/RequestPasswordReset.ts b/src/auth/types/RequestPasswordReset.ts index 87ba8684a..97701fd50 100644 --- a/src/auth/types/RequestPasswordReset.ts +++ b/src/auth/types/RequestPasswordReset.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/auth/types/SetPassword.ts b/src/auth/types/SetPassword.ts index 2a1d539c8..23881edeb 100644 --- a/src/auth/types/SetPassword.ts +++ b/src/auth/types/SetPassword.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AccountErrorCode, PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/auth/types/TokenAuth.ts b/src/auth/types/TokenAuth.ts index 07272b217..e0a4cf1cd 100644 --- a/src/auth/types/TokenAuth.ts +++ b/src/auth/types/TokenAuth.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/auth/types/VerifyToken.ts b/src/auth/types/VerifyToken.ts index 06934e963..060b470cc 100644 --- a/src/auth/types/VerifyToken.ts +++ b/src/auth/types/VerifyToken.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { PermissionEnum } from "./../../types/globalTypes"; diff --git a/src/categories/components/CategoryBackground/CategoryBackground.tsx b/src/categories/components/CategoryBackground/CategoryBackground.tsx index 849aa3bff..e9a4b66cd 100644 --- a/src/categories/components/CategoryBackground/CategoryBackground.tsx +++ b/src/categories/components/CategoryBackground/CategoryBackground.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import TextField from "@material-ui/core/TextField"; import CardTitle from "@saleor/components/CardTitle"; import Hr from "@saleor/components/Hr"; @@ -9,6 +8,7 @@ import ImageUpload from "@saleor/components/ImageUpload"; import MediaTile from "@saleor/components/MediaTile"; import Skeleton from "@saleor/components/Skeleton"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx b/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx index 9b1282d7e..43618a508 100644 --- a/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx +++ b/src/categories/components/CategoryDeleteDialog/CategoryDeleteDialog.tsx @@ -4,8 +4,8 @@ import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogContentText from "@material-ui/core/DialogContentText"; import DialogTitle from "@material-ui/core/DialogTitle"; -import { makeStyles } from "@material-ui/core/styles"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/categories/components/CategoryList/CategoryList.tsx b/src/categories/components/CategoryList/CategoryList.tsx index 6b4a55f2d..98ab10475 100644 --- a/src/categories/components/CategoryList/CategoryList.tsx +++ b/src/categories/components/CategoryList/CategoryList.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -12,6 +11,7 @@ import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { CategoryFragment } from "@saleor/fragments/types/CategoryFragment"; import { maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ListActions, ListProps, SortPage } from "@saleor/types"; import { getArrowDirection } from "@saleor/utils/sort"; import React from "react"; diff --git a/src/categories/components/CategoryProductList/CategoryProductList.tsx b/src/categories/components/CategoryProductList/CategoryProductList.tsx index 7fdcd6313..f1fa0c32a 100644 --- a/src/categories/components/CategoryProductList/CategoryProductList.tsx +++ b/src/categories/components/CategoryProductList/CategoryProductList.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -14,6 +13,7 @@ import TableCellAvatar, { import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ChannelProps, ListActions, ListProps } from "@saleor/types"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/categories/types/CategoryBulkDelete.ts b/src/categories/types/CategoryBulkDelete.ts index 9009acdcd..a48f804d2 100644 --- a/src/categories/types/CategoryBulkDelete.ts +++ b/src/categories/types/CategoryBulkDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ProductErrorCode } from "./../../types/globalTypes"; diff --git a/src/categories/types/CategoryCreate.ts b/src/categories/types/CategoryCreate.ts index b1d7643e8..822afaa4b 100644 --- a/src/categories/types/CategoryCreate.ts +++ b/src/categories/types/CategoryCreate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CategoryInput, ProductErrorCode } from "./../../types/globalTypes"; diff --git a/src/categories/types/CategoryDelete.ts b/src/categories/types/CategoryDelete.ts index 0b7fda57d..f227675bb 100644 --- a/src/categories/types/CategoryDelete.ts +++ b/src/categories/types/CategoryDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ProductErrorCode } from "./../../types/globalTypes"; diff --git a/src/categories/types/CategoryDetails.ts b/src/categories/types/CategoryDetails.ts index d4a4306a0..754339a8c 100644 --- a/src/categories/types/CategoryDetails.ts +++ b/src/categories/types/CategoryDetails.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/categories/types/CategoryUpdate.ts b/src/categories/types/CategoryUpdate.ts index f45c6ca68..a539007df 100644 --- a/src/categories/types/CategoryUpdate.ts +++ b/src/categories/types/CategoryUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CategoryInput, ProductErrorCode } from "./../../types/globalTypes"; diff --git a/src/categories/types/RootCategories.ts b/src/categories/types/RootCategories.ts index 5811b4f71..4aa272adc 100644 --- a/src/categories/types/RootCategories.ts +++ b/src/categories/types/RootCategories.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CategoryFilterInput, CategorySortingInput } from "./../../types/globalTypes"; diff --git a/src/channels/components/styles.ts b/src/channels/components/styles.ts index b58f28de2..20f4733ab 100644 --- a/src/channels/components/styles.ts +++ b/src/channels/components/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/channels/pages/ChannelsListPage/styles.ts b/src/channels/pages/ChannelsListPage/styles.ts index 1e8c98126..d7e7866f1 100644 --- a/src/channels/pages/ChannelsListPage/styles.ts +++ b/src/channels/pages/ChannelsListPage/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/channels/types/BaseChannels.ts b/src/channels/types/BaseChannels.ts index aa43e7ac1..774060e40 100644 --- a/src/channels/types/BaseChannels.ts +++ b/src/channels/types/BaseChannels.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/channels/types/Channel.ts b/src/channels/types/Channel.ts index e5614b134..eaebfe162 100644 --- a/src/channels/types/Channel.ts +++ b/src/channels/types/Channel.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/channels/types/ChannelActivate.ts b/src/channels/types/ChannelActivate.ts index 4de493d03..ec2c451fb 100644 --- a/src/channels/types/ChannelActivate.ts +++ b/src/channels/types/ChannelActivate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ChannelErrorCode } from "./../../types/globalTypes"; diff --git a/src/channels/types/ChannelCreate.ts b/src/channels/types/ChannelCreate.ts index 64ba7b111..bb6b70d1a 100644 --- a/src/channels/types/ChannelCreate.ts +++ b/src/channels/types/ChannelCreate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ChannelCreateInput, ChannelErrorCode } from "./../../types/globalTypes"; diff --git a/src/channels/types/ChannelDeactivate.ts b/src/channels/types/ChannelDeactivate.ts index d7f58e281..e99f790d7 100644 --- a/src/channels/types/ChannelDeactivate.ts +++ b/src/channels/types/ChannelDeactivate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ChannelErrorCode } from "./../../types/globalTypes"; diff --git a/src/channels/types/ChannelDelete.ts b/src/channels/types/ChannelDelete.ts index 6e52a7130..541ca5186 100644 --- a/src/channels/types/ChannelDelete.ts +++ b/src/channels/types/ChannelDelete.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ChannelDeleteInput, ChannelErrorCode } from "./../../types/globalTypes"; diff --git a/src/channels/types/ChannelUpdate.ts b/src/channels/types/ChannelUpdate.ts index 911ba7565..2380a32e9 100644 --- a/src/channels/types/ChannelUpdate.ts +++ b/src/channels/types/ChannelUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { ChannelUpdateInput, ChannelErrorCode } from "./../../types/globalTypes"; diff --git a/src/channels/types/Channels.ts b/src/channels/types/Channels.ts index 6b231deff..4a6c2418c 100644 --- a/src/channels/types/Channels.ts +++ b/src/channels/types/Channels.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/collections/components/CollectionImage/CollectionImage.tsx b/src/collections/components/CollectionImage/CollectionImage.tsx index 502acbaf9..251320f52 100644 --- a/src/collections/components/CollectionImage/CollectionImage.tsx +++ b/src/collections/components/CollectionImage/CollectionImage.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import CardTitle from "@saleor/components/CardTitle"; import Hr from "@saleor/components/Hr"; @@ -9,6 +8,7 @@ import ImageUpload from "@saleor/components/ImageUpload"; import MediaTile from "@saleor/components/MediaTile"; import Skeleton from "@saleor/components/Skeleton"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/collections/components/CollectionList/CollectionList.tsx b/src/collections/components/CollectionList/CollectionList.tsx index fd8cf3aea..ccb7a43d2 100644 --- a/src/collections/components/CollectionList/CollectionList.tsx +++ b/src/collections/components/CollectionList/CollectionList.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -12,6 +11,7 @@ import TableCellHeader from "@saleor/components/TableCellHeader"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ChannelProps, ListActions, ListProps, SortPage } from "@saleor/types"; import { getArrowDirection } from "@saleor/utils/sort"; import React from "react"; diff --git a/src/collections/components/CollectionProducts/CollectionProducts.tsx b/src/collections/components/CollectionProducts/CollectionProducts.tsx index 228474ef8..1118e013e 100644 --- a/src/collections/components/CollectionProducts/CollectionProducts.tsx +++ b/src/collections/components/CollectionProducts/CollectionProducts.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -17,6 +16,7 @@ import TableCellAvatar, { } from "@saleor/components/TableCellAvatar"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/collections/mutations.ts b/src/collections/mutations.ts index bbf5ba059..f88a0f7e2 100644 --- a/src/collections/mutations.ts +++ b/src/collections/mutations.ts @@ -8,8 +8,7 @@ import { } from "@saleor/fragments/collections"; import { collectionChannelListingErrorFragment, - collectionsErrorFragment, - productErrorFragment + collectionsErrorFragment } from "@saleor/fragments/errors"; import makeMutation from "@saleor/hooks/makeMutation"; import gql from "graphql-tag"; @@ -181,11 +180,11 @@ export const useUnassignCollectionProductMutation = makeMutation< >(unassignCollectionProduct); const collectionBulkDelete = gql` - ${productErrorFragment} + ${collectionsErrorFragment} mutation CollectionBulkDelete($ids: [ID]!) { collectionBulkDelete(ids: $ids) { - errors: productErrors { - ...ProductErrorFragment + errors: collectionErrors { + ...CollectionErrorFragment } } } diff --git a/src/collections/types/CollectionAssignProduct.ts b/src/collections/types/CollectionAssignProduct.ts index 9215a4d02..383b9030c 100644 --- a/src/collections/types/CollectionAssignProduct.ts +++ b/src/collections/types/CollectionAssignProduct.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionErrorCode } from "./../../types/globalTypes"; diff --git a/src/collections/types/CollectionBulkDelete.ts b/src/collections/types/CollectionBulkDelete.ts index 0214b943f..7a093ed40 100644 --- a/src/collections/types/CollectionBulkDelete.ts +++ b/src/collections/types/CollectionBulkDelete.ts @@ -1,16 +1,17 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. -import { ProductErrorCode } from "./../../types/globalTypes"; +import { CollectionErrorCode } from "./../../types/globalTypes"; // ==================================================== // GraphQL mutation operation: CollectionBulkDelete // ==================================================== export interface CollectionBulkDelete_collectionBulkDelete_errors { - __typename: "ProductError"; - code: ProductErrorCode; + __typename: "CollectionError"; + code: CollectionErrorCode; field: string | null; } diff --git a/src/collections/types/CollectionChannelListingUpdate.ts b/src/collections/types/CollectionChannelListingUpdate.ts index 18c064b81..aa2993e5d 100644 --- a/src/collections/types/CollectionChannelListingUpdate.ts +++ b/src/collections/types/CollectionChannelListingUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionChannelListingUpdateInput, ProductErrorCode } from "./../../types/globalTypes"; diff --git a/src/collections/types/CollectionDetails.ts b/src/collections/types/CollectionDetails.ts index 2b31df0ad..0804a66ca 100644 --- a/src/collections/types/CollectionDetails.ts +++ b/src/collections/types/CollectionDetails.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/collections/types/CollectionList.ts b/src/collections/types/CollectionList.ts index 6dabfda67..cb5ceca50 100644 --- a/src/collections/types/CollectionList.ts +++ b/src/collections/types/CollectionList.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionFilterInput, CollectionSortingInput } from "./../../types/globalTypes"; diff --git a/src/collections/types/CollectionUpdate.ts b/src/collections/types/CollectionUpdate.ts index 45218fa1b..3c619037a 100644 --- a/src/collections/types/CollectionUpdate.ts +++ b/src/collections/types/CollectionUpdate.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionInput, CollectionErrorCode } from "./../../types/globalTypes"; diff --git a/src/collections/types/CreateCollection.ts b/src/collections/types/CreateCollection.ts index 208bfbcef..54a086997 100644 --- a/src/collections/types/CreateCollection.ts +++ b/src/collections/types/CreateCollection.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionCreateInput, CollectionErrorCode } from "./../../types/globalTypes"; diff --git a/src/collections/types/RemoveCollection.ts b/src/collections/types/RemoveCollection.ts index 477b3a312..06463029e 100644 --- a/src/collections/types/RemoveCollection.ts +++ b/src/collections/types/RemoveCollection.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionErrorCode } from "./../../types/globalTypes"; diff --git a/src/collections/types/UnassignCollectionProduct.ts b/src/collections/types/UnassignCollectionProduct.ts index 538206d56..2b2eb161b 100644 --- a/src/collections/types/UnassignCollectionProduct.ts +++ b/src/collections/types/UnassignCollectionProduct.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CollectionErrorCode } from "./../../types/globalTypes"; diff --git a/src/components/Accordion/Accordion.tsx b/src/components/Accordion/Accordion.tsx index 59843aeae..da770eeca 100644 --- a/src/components/Accordion/Accordion.tsx +++ b/src/components/Accordion/Accordion.tsx @@ -1,8 +1,8 @@ import IconButton from "@material-ui/core/IconButton"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Typography from "@material-ui/core/Typography"; import AddIcon from "@material-ui/icons/Add"; import RemoveIcon from "@material-ui/icons/Remove"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/AccountPermissions/AccountPermissions.tsx b/src/components/AccountPermissions/AccountPermissions.tsx index 6a2a18562..6e66585ce 100644 --- a/src/components/AccountPermissions/AccountPermissions.tsx +++ b/src/components/AccountPermissions/AccountPermissions.tsx @@ -7,12 +7,12 @@ import { } from "@material-ui/core"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import CardTitle from "@saleor/components/CardTitle"; import Skeleton from "@saleor/components/Skeleton"; import useUser from "@saleor/hooks/useUser"; import { PermissionData } from "@saleor/permissionGroups/components/PermissionGroupDetailsPage/PermissionGroupDetailsPage"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { useIntl } from "react-intl"; diff --git a/src/components/ActionDialog/DialogButtons.tsx b/src/components/ActionDialog/DialogButtons.tsx index e7b5c20bd..0ee246412 100644 --- a/src/components/ActionDialog/DialogButtons.tsx +++ b/src/components/ActionDialog/DialogButtons.tsx @@ -1,7 +1,7 @@ import Button from "@material-ui/core/Button"; import DialogActions from "@material-ui/core/DialogActions"; -import { makeStyles } from "@material-ui/core/styles"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/components/AddressEdit/AddressEdit.tsx b/src/components/AddressEdit/AddressEdit.tsx index 136f5dfef..287881a41 100644 --- a/src/components/AddressEdit/AddressEdit.tsx +++ b/src/components/AddressEdit/AddressEdit.tsx @@ -1,9 +1,9 @@ -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import { AddressTypeInput } from "@saleor/customers/types"; import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragment"; import { OrderErrorFragment } from "@saleor/fragments/types/OrderErrorFragment"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import { getFormErrors } from "@saleor/utils/errors"; import getAccountErrorMessage from "@saleor/utils/errors/account"; import getOrderErrorMessage from "@saleor/utils/errors/order"; diff --git a/src/components/AppHeader/AppHeader.tsx b/src/components/AppHeader/AppHeader.tsx index 686deea8e..37271f291 100644 --- a/src/components/AppHeader/AppHeader.tsx +++ b/src/components/AppHeader/AppHeader.tsx @@ -1,7 +1,7 @@ import Portal from "@material-ui/core/Portal"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import ArrowBackIcon from "@material-ui/icons/ArrowBack"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import AppHeaderContext from "../AppLayout/AppHeaderContext"; diff --git a/src/components/AppLayout/AppChannelSelect.tsx b/src/components/AppLayout/AppChannelSelect.tsx index 0bdfeb5f3..6760b7fde 100644 --- a/src/components/AppLayout/AppChannelSelect.tsx +++ b/src/components/AppLayout/AppChannelSelect.tsx @@ -1,5 +1,5 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; import { ChannelFragment } from "@saleor/fragments/types/ChannelFragment"; +import { makeStyles } from "@saleor/theme"; import { ChannelProps } from "@saleor/types"; import { mapNodeToChoice } from "@saleor/utils/maps"; import React from "react"; diff --git a/src/components/AppLayout/AppLayout.tsx b/src/components/AppLayout/AppLayout.tsx index 11ee9ce45..ea1495d65 100644 --- a/src/components/AppLayout/AppLayout.tsx +++ b/src/components/AppLayout/AppLayout.tsx @@ -1,5 +1,4 @@ import LinearProgress from "@material-ui/core/LinearProgress"; -import { makeStyles, Theme } from "@material-ui/core/styles"; import useMediaQuery from "@material-ui/core/useMediaQuery"; import { createConfigurationMenu } from "@saleor/configuration"; import useAppState from "@saleor/hooks/useAppState"; @@ -7,6 +6,7 @@ import useNavigator from "@saleor/hooks/useNavigator"; import useTheme from "@saleor/hooks/useTheme"; import useUser from "@saleor/hooks/useUser"; import { staffMemberDetailsUrl } from "@saleor/staff/urls"; +import { makeStyles, SaleorTheme } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { useIntl } from "react-intl"; @@ -127,7 +127,9 @@ const AppLayout: React.FC = ({ children }) => { const [appState, dispatchAppState] = useAppState(); const { location } = useRouter(); const [isNavigatorVisible, setNavigatorVisibility] = React.useState(false); - const isMdUp = useMediaQuery((theme: Theme) => theme.breakpoints.up("md")); + const isMdUp = useMediaQuery((theme: SaleorTheme) => + theme.breakpoints.up("md") + ); const [docked, setDocked] = React.useState(true); const { availableChannels, diff --git a/src/components/AppLayout/MenuList.tsx b/src/components/AppLayout/MenuList.tsx index 05f6fa971..6ded8bc72 100644 --- a/src/components/AppLayout/MenuList.tsx +++ b/src/components/AppLayout/MenuList.tsx @@ -1,9 +1,9 @@ import configureIcon from "@assets/images/menu-configure-icon.svg"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import { User } from "@saleor/fragments/types/User"; import useTheme from "@saleor/hooks/useTheme"; import { sectionNames } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import SVG from "react-inlinesvg"; diff --git a/src/components/AppLayout/MenuNested.tsx b/src/components/AppLayout/MenuNested.tsx index 0a64b1892..26f88d3db 100644 --- a/src/components/AppLayout/MenuNested.tsx +++ b/src/components/AppLayout/MenuNested.tsx @@ -1,9 +1,9 @@ import menuArrowIcon from "@assets/images/menu-arrow-icon.svg"; import Hidden from "@material-ui/core/Hidden"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import useTheme from "@saleor/hooks/useTheme"; import { createHref } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import SVG from "react-inlinesvg"; diff --git a/src/components/AppLayout/ResponsiveDrawer.tsx b/src/components/AppLayout/ResponsiveDrawer.tsx deleted file mode 100644 index 49baa1e7f..000000000 --- a/src/components/AppLayout/ResponsiveDrawer.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import Drawer from "@material-ui/core/Drawer"; -import Hidden from "@material-ui/core/Hidden"; -import { makeStyles } from "@material-ui/core/styles"; -import React from "react"; - -import { - drawerWidth, - drawerWidthExpanded, - drawerWidthExpandedMobile -} from "./consts"; - -const useStyles = makeStyles( - theme => ({ - drawerDesktop: { - backgroundColor: theme.palette.background.paper, - border: "none", - height: "100vh", - overflow: "visible", - padding: 0, - position: "fixed" as "fixed", - transition: "width 0.3s ease", - width: drawerWidthExpanded - }, - drawerDesktopSmall: { - overflow: "visible", - transition: "width 0.2s ease", - width: drawerWidth - }, - drawerMobile: { - width: drawerWidthExpandedMobile - } - }), - { name: "ResponsiveDrawer" } -); - -interface ResponsiveDrawerProps { - children?: React.ReactNode; - open: boolean; - small: boolean; - onClose?(); -} - -const ResponsiveDrawer: React.FC = props => { - const { children, onClose, open, small } = props; - - const classes = useStyles(props); - - return ( - <> - - - {children} - - - - - {children} - - - - ); -}; -export default ResponsiveDrawer; diff --git a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx index b484d64c6..b511bb5e0 100644 --- a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx +++ b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx @@ -5,7 +5,6 @@ import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogContentText from "@material-ui/core/DialogContentText"; import DialogTitle from "@material-ui/core/DialogTitle"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableRow from "@material-ui/core/TableRow"; @@ -25,6 +24,7 @@ import useModalDialogOpen from "@saleor/hooks/useModalDialogOpen"; import useSearchQuery from "@saleor/hooks/useSearchQuery"; import { buttonMessages } from "@saleor/intl"; import { maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/AssignContainerDialog/AssignContainerDialog.tsx b/src/components/AssignContainerDialog/AssignContainerDialog.tsx index 23b3e29b4..474d0f06c 100644 --- a/src/components/AssignContainerDialog/AssignContainerDialog.tsx +++ b/src/components/AssignContainerDialog/AssignContainerDialog.tsx @@ -4,7 +4,6 @@ import Dialog from "@material-ui/core/Dialog"; import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogTitle from "@material-ui/core/DialogTitle"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableRow from "@material-ui/core/TableRow"; @@ -13,6 +12,7 @@ import ResponsiveTable from "@saleor/components/ResponsiveTable"; import useSearchQuery from "@saleor/hooks/useSearchQuery"; import { buttonMessages } from "@saleor/intl"; import useScrollableDialogStyle from "@saleor/styles/useScrollableDialogStyle"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps, Node } from "@saleor/types"; import React from "react"; import InfiniteScroll from "react-infinite-scroller"; diff --git a/src/components/AssignProductDialog/AssignProductDialog.tsx b/src/components/AssignProductDialog/AssignProductDialog.tsx index d6ac75be9..e51ae5ecf 100644 --- a/src/components/AssignProductDialog/AssignProductDialog.tsx +++ b/src/components/AssignProductDialog/AssignProductDialog.tsx @@ -4,7 +4,6 @@ import Dialog from "@material-ui/core/Dialog"; import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogTitle from "@material-ui/core/DialogTitle"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableRow from "@material-ui/core/TableRow"; @@ -20,6 +19,7 @@ import { buttonMessages } from "@saleor/intl"; import { maybe } from "@saleor/misc"; import { SearchProducts_search_edges_node } from "@saleor/searches/types/SearchProducts"; import useScrollableDialogStyle from "@saleor/styles/useScrollableDialogStyle"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import React from "react"; import InfiniteScroll from "react-infinite-scroller"; diff --git a/src/components/Attributes/Attributes.tsx b/src/components/Attributes/Attributes.tsx index aada001ec..2084e75d6 100644 --- a/src/components/Attributes/Attributes.tsx +++ b/src/components/Attributes/Attributes.tsx @@ -1,7 +1,6 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import IconButton from "@material-ui/core/IconButton"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Typography from "@material-ui/core/Typography"; import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown"; import { AttributeReference } from "@saleor/attributes/utils/data"; @@ -17,6 +16,7 @@ import { AttributeValueFragment } from "@saleor/fragments/types/AttributeValueFr import { PageErrorWithAttributesFragment } from "@saleor/fragments/types/PageErrorWithAttributesFragment"; import { ProductErrorWithAttributesFragment } from "@saleor/fragments/types/ProductErrorWithAttributesFragment"; import { FormsetAtomicData, FormsetChange } from "@saleor/hooks/useFormset"; +import { makeStyles } from "@saleor/theme"; import { ReorderEvent } from "@saleor/types"; import { AttributeEntityTypeEnum, diff --git a/src/components/Attributes/BasicAttributeRow.tsx b/src/components/Attributes/BasicAttributeRow.tsx index ee0bb61dc..6f2665ffe 100644 --- a/src/components/Attributes/BasicAttributeRow.tsx +++ b/src/components/Attributes/BasicAttributeRow.tsx @@ -1,6 +1,6 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import Grid from "@saleor/components/Grid"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/Attributes/ExtendedAttributeRow.tsx b/src/components/Attributes/ExtendedAttributeRow.tsx index 1bc9ac70b..531a59c0c 100644 --- a/src/components/Attributes/ExtendedAttributeRow.tsx +++ b/src/components/Attributes/ExtendedAttributeRow.tsx @@ -1,7 +1,7 @@ import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import Grid from "@saleor/components/Grid"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx b/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx index f8f0b165c..5f0f86c33 100644 --- a/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx +++ b/src/components/AutocompleteSelectMenu/AutocompleteSelectMenu.tsx @@ -1,10 +1,10 @@ import CircularProgress from "@material-ui/core/CircularProgress"; import MenuItem from "@material-ui/core/MenuItem"; import Paper from "@material-ui/core/Paper"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import ArrowBack from "@material-ui/icons/ArrowBack"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import Downshift from "downshift"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/CardMenu/CardMenu.tsx b/src/components/CardMenu/CardMenu.tsx index 647c9fec2..6aa33e671 100644 --- a/src/components/CardMenu/CardMenu.tsx +++ b/src/components/CardMenu/CardMenu.tsx @@ -5,8 +5,8 @@ import MenuItem from "@material-ui/core/MenuItem"; import MenuList from "@material-ui/core/MenuList"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; -import { makeStyles } from "@material-ui/core/styles"; import MoreVertIcon from "@material-ui/icons/MoreVert"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const ITEM_HEIGHT = 48; diff --git a/src/components/CardSpacer.tsx b/src/components/CardSpacer.tsx index 9b084a10c..ab3955efa 100644 --- a/src/components/CardSpacer.tsx +++ b/src/components/CardSpacer.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/CardTitle/CardTitle.tsx b/src/components/CardTitle/CardTitle.tsx index 15dd0f333..63e9ea7d0 100644 --- a/src/components/CardTitle/CardTitle.tsx +++ b/src/components/CardTitle/CardTitle.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ChannelsAvailability/styles.ts b/src/components/ChannelsAvailability/styles.ts index 31cc76f5a..07d7a268b 100644 --- a/src/components/ChannelsAvailability/styles.ts +++ b/src/components/ChannelsAvailability/styles.ts @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/components/ChannelsAvailabilityContent/styles.ts b/src/components/ChannelsAvailabilityContent/styles.ts index 4bb4d7d9b..67e4bef06 100644 --- a/src/components/ChannelsAvailabilityContent/styles.ts +++ b/src/components/ChannelsAvailabilityContent/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/components/ChannelsAvailabilityDropdown/styles.ts b/src/components/ChannelsAvailabilityDropdown/styles.ts index 4fd53e7e4..6fe419d13 100644 --- a/src/components/ChannelsAvailabilityDropdown/styles.ts +++ b/src/components/ChannelsAvailabilityDropdown/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/components/Chip/Chip.tsx b/src/components/Chip/Chip.tsx index 5198817da..c90ec80ce 100644 --- a/src/components/Chip/Chip.tsx +++ b/src/components/Chip/Chip.tsx @@ -1,7 +1,7 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import Typography from "@material-ui/core/Typography"; import CloseIcon from "@material-ui/icons/Close"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ColumnPicker/ColumnPicker.tsx b/src/components/ColumnPicker/ColumnPicker.tsx index d49a7144b..bb34ffa64 100644 --- a/src/components/ColumnPicker/ColumnPicker.tsx +++ b/src/components/ColumnPicker/ColumnPicker.tsx @@ -2,8 +2,8 @@ import ClickAwayListener from "@material-ui/core/ClickAwayListener"; import Grow from "@material-ui/core/Grow"; import Popper from "@material-ui/core/Popper"; import { fade } from "@material-ui/core/styles/colorManipulator"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import useStateFromProps from "@saleor/hooks/useStateFromProps"; +import { makeStyles } from "@saleor/theme"; import { toggle } from "@saleor/utils/lists"; import React from "react"; diff --git a/src/components/ColumnPicker/ColumnPickerButton.tsx b/src/components/ColumnPicker/ColumnPickerButton.tsx index b4778d0d9..a6c962b2f 100644 --- a/src/components/ColumnPicker/ColumnPickerButton.tsx +++ b/src/components/ColumnPicker/ColumnPickerButton.tsx @@ -1,7 +1,7 @@ import Button from "@material-ui/core/Button"; import { fade } from "@material-ui/core/styles/colorManipulator"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/ColumnPicker/ColumnPickerContent.tsx b/src/components/ColumnPicker/ColumnPickerContent.tsx index d4f5b4929..4f42c6b50 100644 --- a/src/components/ColumnPicker/ColumnPickerContent.tsx +++ b/src/components/ColumnPicker/ColumnPickerContent.tsx @@ -2,10 +2,10 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import CircularProgress from "@material-ui/core/CircularProgress"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Typography from "@material-ui/core/Typography"; import useElementScroll from "@saleor/hooks/useElementScroll"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import { isSelected } from "@saleor/utils/lists"; import classNames from "classnames"; diff --git a/src/components/CompanyAddressInput/CompanyAddressForm.tsx b/src/components/CompanyAddressInput/CompanyAddressForm.tsx index e43752424..0c24ec2e1 100644 --- a/src/components/CompanyAddressInput/CompanyAddressForm.tsx +++ b/src/components/CompanyAddressInput/CompanyAddressForm.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import FormSpacer from "@saleor/components/FormSpacer"; import Grid from "@saleor/components/Grid"; @@ -10,6 +9,7 @@ import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragme import { ShopErrorFragment } from "@saleor/fragments/types/ShopErrorFragment"; import { WarehouseErrorFragment } from "@saleor/fragments/types/WarehouseErrorFragment"; import { ChangeEvent } from "@saleor/hooks/useForm"; +import { makeStyles } from "@saleor/theme"; import { getFormErrors } from "@saleor/utils/errors"; import getAccountErrorMessage from "@saleor/utils/errors/account"; import getShopErrorMessage from "@saleor/utils/errors/shop"; diff --git a/src/components/CompanyAddressInput/CompanyAddressInput.tsx b/src/components/CompanyAddressInput/CompanyAddressInput.tsx index 4df8709ca..fecc51166 100644 --- a/src/components/CompanyAddressInput/CompanyAddressInput.tsx +++ b/src/components/CompanyAddressInput/CompanyAddressInput.tsx @@ -1,6 +1,6 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ConfirmButton/ConfirmButton.tsx b/src/components/ConfirmButton/ConfirmButton.tsx index 981131dbb..99f13eef0 100644 --- a/src/components/ConfirmButton/ConfirmButton.tsx +++ b/src/components/ConfirmButton/ConfirmButton.tsx @@ -1,14 +1,14 @@ import Button, { ButtonProps } from "@material-ui/core/Button"; import CircularProgress from "@material-ui/core/CircularProgress"; -import { - createStyles, - Theme, - WithStyles, - withStyles -} from "@material-ui/core/styles"; import CheckIcon from "@material-ui/icons/Check"; import { DEFAULT_NOTIFICATION_SHOW_TIME } from "@saleor/config"; import { buttonMessages } from "@saleor/intl"; +import { + createStyles, + SaleorTheme, + WithStyles, + withStyles +} from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; @@ -19,7 +19,7 @@ export type ConfirmButtonTransitionState = | "error" | "default"; -const styles = (theme: Theme) => +const styles = (theme: SaleorTheme) => createStyles({ error: { "&:hover": { diff --git a/src/components/Container.tsx b/src/components/Container.tsx index 3f4e5533b..19c9aaaaf 100644 --- a/src/components/Container.tsx +++ b/src/components/Container.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/CountryList/CountryList.tsx b/src/components/CountryList/CountryList.tsx index b217dbe7f..b7820f5ae 100644 --- a/src/components/CountryList/CountryList.tsx +++ b/src/components/CountryList/CountryList.tsx @@ -2,7 +2,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableRow from "@material-ui/core/TableRow"; @@ -12,6 +11,7 @@ import CardTitle from "@saleor/components/CardTitle"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import { CountryFragment } from "@saleor/fragments/types/CountryFragment"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/CreatorSteps/CreatorSteps.tsx b/src/components/CreatorSteps/CreatorSteps.tsx index d7be7c4a3..a35e35b76 100644 --- a/src/components/CreatorSteps/CreatorSteps.tsx +++ b/src/components/CreatorSteps/CreatorSteps.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/EditableTableCell/EditableTableCell.tsx b/src/components/EditableTableCell/EditableTableCell.tsx index 516df9499..3a2206a80 100644 --- a/src/components/EditableTableCell/EditableTableCell.tsx +++ b/src/components/EditableTableCell/EditableTableCell.tsx @@ -1,10 +1,10 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TableCell from "@material-ui/core/TableCell"; import TextField, { TextFieldProps } from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import useForm from "@saleor/hooks/useForm"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ErrorPage/ErrorPage.tsx b/src/components/ErrorPage/ErrorPage.tsx index b6447ba8b..cf0373516 100644 --- a/src/components/ErrorPage/ErrorPage.tsx +++ b/src/components/ErrorPage/ErrorPage.tsx @@ -1,7 +1,7 @@ import notFoundImage from "@assets/images/what.svg"; import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import SVG from "react-inlinesvg"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx b/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx index 8655c5e73..1bfd85d15 100644 --- a/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx +++ b/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ExternalLink/ExternalLink.tsx b/src/components/ExternalLink/ExternalLink.tsx index 53cbe8480..f7322edbb 100644 --- a/src/components/ExternalLink/ExternalLink.tsx +++ b/src/components/ExternalLink/ExternalLink.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography, { TypographyProps } from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/Filter/Filter.tsx b/src/components/Filter/Filter.tsx index b5dd8ad76..694ca6e89 100644 --- a/src/components/Filter/Filter.tsx +++ b/src/components/Filter/Filter.tsx @@ -2,9 +2,9 @@ import ButtonBase from "@material-ui/core/ButtonBase"; import ClickAwayListener from "@material-ui/core/ClickAwayListener"; import Grow from "@material-ui/core/Grow"; import Popper from "@material-ui/core/Popper"; -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/Filter/FilterAutocompleteField.tsx b/src/components/Filter/FilterAutocompleteField.tsx index 914ca1264..b561d59c2 100644 --- a/src/components/Filter/FilterAutocompleteField.tsx +++ b/src/components/Filter/FilterAutocompleteField.tsx @@ -1,7 +1,7 @@ import FormControlLabel from "@material-ui/core/FormControlLabel"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import { toggle } from "@saleor/utils/lists"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/Filter/FilterContent.tsx b/src/components/Filter/FilterContent.tsx index 7d8faf12c..c441184a1 100644 --- a/src/components/Filter/FilterContent.tsx +++ b/src/components/Filter/FilterContent.tsx @@ -4,10 +4,10 @@ import FormControlLabel from "@material-ui/core/FormControlLabel"; import Paper from "@material-ui/core/Paper"; import Radio from "@material-ui/core/Radio"; import { fade } from "@material-ui/core/styles/colorManipulator"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Typography from "@material-ui/core/Typography"; import useStateFromProps from "@saleor/hooks/useStateFromProps"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage, IntlShape, useIntl } from "react-intl"; diff --git a/src/components/Filter/FilterOptionField.tsx b/src/components/Filter/FilterOptionField.tsx index 7e208a631..bca691a73 100644 --- a/src/components/Filter/FilterOptionField.tsx +++ b/src/components/Filter/FilterOptionField.tsx @@ -1,6 +1,6 @@ import FormControlLabel from "@material-ui/core/FormControlLabel"; import Radio from "@material-ui/core/Radio"; -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; import { toggle } from "@saleor/utils/lists"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/FilterBar/FilterBar.tsx b/src/components/FilterBar/FilterBar.tsx index 2fc7dd187..1d85f1ac1 100644 --- a/src/components/FilterBar/FilterBar.tsx +++ b/src/components/FilterBar/FilterBar.tsx @@ -1,5 +1,5 @@ import Button from "@material-ui/core/Button"; -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/components/FormSpacer.tsx b/src/components/FormSpacer.tsx index b9027fdb3..c297265ef 100644 --- a/src/components/FormSpacer.tsx +++ b/src/components/FormSpacer.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/Grid/Grid.tsx b/src/components/Grid/Grid.tsx index aec58f63a..20e7fce83 100644 --- a/src/components/Grid/Grid.tsx +++ b/src/components/Grid/Grid.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/Hr.tsx b/src/components/Hr.tsx index f873a7f5f..21e879869 100644 --- a/src/components/Hr.tsx +++ b/src/components/Hr.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/IconButtonTableCell/IconButtonTableCell.tsx b/src/components/IconButtonTableCell/IconButtonTableCell.tsx index e135ee3e3..749e6d2fe 100644 --- a/src/components/IconButtonTableCell/IconButtonTableCell.tsx +++ b/src/components/IconButtonTableCell/IconButtonTableCell.tsx @@ -1,6 +1,6 @@ import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableCell from "@material-ui/core/TableCell"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ImageUpload/ImageUpload.tsx b/src/components/ImageUpload/ImageUpload.tsx index 65530d2fe..c5c7f2a03 100644 --- a/src/components/ImageUpload/ImageUpload.tsx +++ b/src/components/ImageUpload/ImageUpload.tsx @@ -1,6 +1,6 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/LanguageSwitch/LanguageSwitch.tsx b/src/components/LanguageSwitch/LanguageSwitch.tsx index f6214e818..0c53b9ab1 100644 --- a/src/components/LanguageSwitch/LanguageSwitch.tsx +++ b/src/components/LanguageSwitch/LanguageSwitch.tsx @@ -5,9 +5,9 @@ import MenuItem from "@material-ui/core/MenuItem"; import Menu from "@material-ui/core/MenuList"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import ArrowDropDown from "@material-ui/icons/ArrowDropDown"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 264386bcd..7fa855df0 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -1,11 +1,10 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography, { TypographyProps } from "@material-ui/core/Typography"; -import { ITheme } from "@saleor/theme"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; const useStyles = makeStyles( - (theme: ITheme) => ({ + theme => ({ primary: { color: theme.palette.textHighlighted.active }, diff --git a/src/components/LinkChoice/LinkChoice.tsx b/src/components/LinkChoice/LinkChoice.tsx index 3e1824929..9eb79ed0f 100644 --- a/src/components/LinkChoice/LinkChoice.tsx +++ b/src/components/LinkChoice/LinkChoice.tsx @@ -3,9 +3,9 @@ import MenuItem from "@material-ui/core/MenuItem"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; import { fade } from "@material-ui/core/styles/colorManipulator"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import { FormChange } from "@saleor/hooks/useForm"; import ArrowDropdown from "@saleor/icons/ArrowDropdown"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import { codes } from "keycode"; import React from "react"; diff --git a/src/components/ListField/ListField.tsx b/src/components/ListField/ListField.tsx index c0e89814c..e298e3519 100644 --- a/src/components/ListField/ListField.tsx +++ b/src/components/ListField/ListField.tsx @@ -1,11 +1,11 @@ import Button from "@material-ui/core/Button"; +import TextField, { StandardTextFieldProps } from "@material-ui/core/TextField"; import { createStyles, - Theme, + SaleorTheme, WithStyles, withStyles -} from "@material-ui/core/styles"; -import TextField, { StandardTextFieldProps } from "@material-ui/core/TextField"; +} from "@saleor/theme"; import React from "react"; import { FormattedMessage } from "react-intl"; @@ -16,7 +16,7 @@ interface ListFieldState { value: string; } -const styles = (theme: Theme) => +const styles = (theme: SaleorTheme) => createStyles({ chip: { marginBottom: theme.spacing(1) diff --git a/src/components/MediaTile/MediaTile.tsx b/src/components/MediaTile/MediaTile.tsx index 109242a9d..f242dd2b4 100644 --- a/src/components/MediaTile/MediaTile.tsx +++ b/src/components/MediaTile/MediaTile.tsx @@ -1,8 +1,8 @@ import CircularProgress from "@material-ui/core/CircularProgress"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import DeleteIcon from "@material-ui/icons/Delete"; import EditIcon from "@material-ui/icons/Edit"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/Metadata/styles.ts b/src/components/Metadata/styles.ts index ccb85b400..c45f08b12 100644 --- a/src/components/Metadata/styles.ts +++ b/src/components/Metadata/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; const useStyles = makeStyles( theme => { diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx index 2cee26776..f5930b3bc 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectField.tsx @@ -1,11 +1,11 @@ import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import CloseIcon from "@material-ui/icons/Close"; import Debounce, { DebounceProps } from "@saleor/components/Debounce"; import ArrowDropdownIcon from "@saleor/icons/ArrowDropdown"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import Downshift, { ControllerStateAndHelpers } from "downshift"; import { filter } from "fuzzaldrin"; diff --git a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx index a68f71221..9487ef55e 100644 --- a/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx +++ b/src/components/MultiAutocompleteSelectField/MultiAutocompleteSelectFieldContent.tsx @@ -2,13 +2,13 @@ import chevronDown from "@assets/images/ChevronDown.svg"; import CircularProgress from "@material-ui/core/CircularProgress"; import MenuItem from "@material-ui/core/MenuItem"; import Paper from "@material-ui/core/Paper"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import AddIcon from "@material-ui/icons/Add"; import Checkbox from "@saleor/components/Checkbox"; import useElementScroll, { isScrolledToBottom } from "@saleor/hooks/useElementScroll"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import classNames from "classnames"; import { GetItemPropsOptions } from "downshift"; diff --git a/src/components/MultiSelectField/MultiSelectField.tsx b/src/components/MultiSelectField/MultiSelectField.tsx index 6548ff0b9..49c43d583 100644 --- a/src/components/MultiSelectField/MultiSelectField.tsx +++ b/src/components/MultiSelectField/MultiSelectField.tsx @@ -4,7 +4,7 @@ import FormHelperText from "@material-ui/core/FormHelperText"; import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; import Select, { SelectProps } from "@material-ui/core/Select"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/Navigator/Navigator.tsx b/src/components/Navigator/Navigator.tsx index 203c39b5e..fd39dfc67 100644 --- a/src/components/Navigator/Navigator.tsx +++ b/src/components/Navigator/Navigator.tsx @@ -1,11 +1,11 @@ import Fade from "@material-ui/core/Fade"; import Modal from "@material-ui/core/Modal"; import Paper from "@material-ui/core/Paper"; -import makeStyles from "@material-ui/core/styles/makeStyles"; -import useTheme from "@material-ui/core/styles/useTheme"; import { APP_VERSION } from "@saleor/config"; import useLocalStorage from "@saleor/hooks/useLocalStorage"; import useNotifier from "@saleor/hooks/useNotifier"; +import { useTheme } from "@saleor/theme"; +import { makeStyles } from "@saleor/theme"; import Downshift from "downshift"; import hotkeys from "hotkeys-js"; import React from "react"; diff --git a/src/components/Navigator/NavigatorInput.tsx b/src/components/Navigator/NavigatorInput.tsx index 9dd9d57e3..6d63fa844 100644 --- a/src/components/Navigator/NavigatorInput.tsx +++ b/src/components/Navigator/NavigatorInput.tsx @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { useIntl } from "react-intl"; diff --git a/src/components/Navigator/NavigatorSection.tsx b/src/components/Navigator/NavigatorSection.tsx index 40cb73a67..c2e4037bd 100644 --- a/src/components/Navigator/NavigatorSection.tsx +++ b/src/components/Navigator/NavigatorSection.tsx @@ -1,6 +1,6 @@ import MenuItem from "@material-ui/core/MenuItem"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import { GetItemPropsOptions } from "downshift"; import React from "react"; diff --git a/src/components/Navigator/queries/types/CheckIfOrderExists.ts b/src/components/Navigator/queries/types/CheckIfOrderExists.ts index ef91ee35e..2f8b0d4f2 100644 --- a/src/components/Navigator/queries/types/CheckIfOrderExists.ts +++ b/src/components/Navigator/queries/types/CheckIfOrderExists.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { OrderStatus } from "./../../../../types/globalTypes"; diff --git a/src/components/Navigator/queries/types/SearchCatalog.ts b/src/components/Navigator/queries/types/SearchCatalog.ts index d1badceea..750568b3a 100644 --- a/src/components/Navigator/queries/types/SearchCatalog.ts +++ b/src/components/Navigator/queries/types/SearchCatalog.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/components/NavigatorButton/NavigatorButton.tsx b/src/components/NavigatorButton/NavigatorButton.tsx index 5e3c07341..014acc27e 100644 --- a/src/components/NavigatorButton/NavigatorButton.tsx +++ b/src/components/NavigatorButton/NavigatorButton.tsx @@ -3,7 +3,7 @@ import Grow from "@material-ui/core/Grow"; import IconButton, { IconButtonProps } from "@material-ui/core/IconButton"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import ReactSVG from "react-inlinesvg"; diff --git a/src/components/NotFoundPage/NotFoundPage.tsx b/src/components/NotFoundPage/NotFoundPage.tsx index 6de11eaa6..2ed765568 100644 --- a/src/components/NotFoundPage/NotFoundPage.tsx +++ b/src/components/NotFoundPage/NotFoundPage.tsx @@ -1,7 +1,7 @@ import notFoundImage from "@assets/images/not-found-404.svg"; import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import SVG from "react-inlinesvg"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/PageHeader/PageHeader.tsx b/src/components/PageHeader/PageHeader.tsx index 15ee9fd84..028642851 100644 --- a/src/components/PageHeader/PageHeader.tsx +++ b/src/components/PageHeader/PageHeader.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import ExtendedPageHeader from "../ExtendedPageHeader"; diff --git a/src/components/PhoneField/PhoneField.tsx b/src/components/PhoneField/PhoneField.tsx index efa90e8d7..5525d6209 100644 --- a/src/components/PhoneField/PhoneField.tsx +++ b/src/components/PhoneField/PhoneField.tsx @@ -1,6 +1,6 @@ -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import SingleSelectField from "@saleor/components/SingleSelectField"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/PriceField/PriceField.tsx b/src/components/PriceField/PriceField.tsx index ed70c88fa..3bb72e5e0 100644 --- a/src/components/PriceField/PriceField.tsx +++ b/src/components/PriceField/PriceField.tsx @@ -1,7 +1,7 @@ import { InputProps } from "@material-ui/core/Input"; import InputAdornment from "@material-ui/core/InputAdornment"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/RadioGroupField/RadioGroupField.tsx b/src/components/RadioGroupField/RadioGroupField.tsx index 0e00b9e29..0aa23339f 100644 --- a/src/components/RadioGroupField/RadioGroupField.tsx +++ b/src/components/RadioGroupField/RadioGroupField.tsx @@ -5,7 +5,7 @@ import FormLabel from "@material-ui/core/FormLabel"; import MenuItem from "@material-ui/core/MenuItem"; import Radio from "@material-ui/core/Radio"; import RadioGroup from "@material-ui/core/RadioGroup"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/RadioSwitchField/RadioSwitchField.tsx b/src/components/RadioSwitchField/RadioSwitchField.tsx index b0bf20725..ce76176e5 100644 --- a/src/components/RadioSwitchField/RadioSwitchField.tsx +++ b/src/components/RadioSwitchField/RadioSwitchField.tsx @@ -2,7 +2,7 @@ import FormControl from "@material-ui/core/FormControl"; import FormControlLabel from "@material-ui/core/FormControlLabel"; import Radio from "@material-ui/core/Radio"; import RadioGroup from "@material-ui/core/RadioGroup"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/ResponsiveTable/ResponsiveTable.tsx b/src/components/ResponsiveTable/ResponsiveTable.tsx index 8538ab6b1..ec01ecebb 100644 --- a/src/components/ResponsiveTable/ResponsiveTable.tsx +++ b/src/components/ResponsiveTable/ResponsiveTable.tsx @@ -1,5 +1,5 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; import Table from "@material-ui/core/Table"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/RichTextEditor/styles.ts b/src/components/RichTextEditor/styles.ts index 2436bf2da..5a7936aa6 100644 --- a/src/components/RichTextEditor/styles.ts +++ b/src/components/RichTextEditor/styles.ts @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; +import { makeStyles } from "@saleor/theme"; const useStyles = makeStyles( theme => { diff --git a/src/components/RowNumberSelect/RowNumberSelect.tsx b/src/components/RowNumberSelect/RowNumberSelect.tsx index 55e7a473f..e3187d27d 100644 --- a/src/components/RowNumberSelect/RowNumberSelect.tsx +++ b/src/components/RowNumberSelect/RowNumberSelect.tsx @@ -1,6 +1,6 @@ import MenuItem from "@material-ui/core/MenuItem"; import Select from "@material-ui/core/Select"; -import { makeStyles, useTheme } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage } from "react-intl"; @@ -45,8 +45,8 @@ const RowNumberSelect: React.FC = ({ settings, onChange }) => { - const theme = useTheme(); - const classes = useStyles({ theme }); + const classes = useStyles({}); + return (
diff --git a/src/components/SaveButtonBar/SaveButtonBar.tsx b/src/components/SaveButtonBar/SaveButtonBar.tsx index 279436b79..d843c4bc3 100644 --- a/src/components/SaveButtonBar/SaveButtonBar.tsx +++ b/src/components/SaveButtonBar/SaveButtonBar.tsx @@ -2,9 +2,9 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import Portal from "@material-ui/core/Portal"; -import { makeStyles } from "@material-ui/core/styles"; import useWindowScroll from "@saleor/hooks/useWindowScroll"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { useIntl } from "react-intl"; diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index 4493b62c1..741fce316 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,5 +1,5 @@ import Button from "@material-ui/core/Button"; -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; import { SearchPageProps, TabPageProps } from "@saleor/types"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/components/SearchBar/SearchInput.tsx b/src/components/SearchBar/SearchInput.tsx index ead6b46eb..c3d531d3e 100644 --- a/src/components/SearchBar/SearchInput.tsx +++ b/src/components/SearchBar/SearchInput.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { SearchPageProps } from "../../types"; diff --git a/src/components/SeoForm/SeoForm.tsx b/src/components/SeoForm/SeoForm.tsx index 6959d7aac..e7561dba0 100644 --- a/src/components/SeoForm/SeoForm.tsx +++ b/src/components/SeoForm/SeoForm.tsx @@ -1,12 +1,12 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import { CollectionErrorFragment } from "@saleor/fragments/types/CollectionErrorFragment"; import { PageErrorFragment } from "@saleor/fragments/types/PageErrorFragment"; import { ProductErrorFragment } from "@saleor/fragments/types/ProductErrorFragment"; +import { makeStyles } from "@saleor/theme"; import { getFieldError, getProductErrorMessage } from "@saleor/utils/errors"; import getPageErrorMessage from "@saleor/utils/errors/page"; import classNames from "classnames"; diff --git a/src/components/Shop/types/ShopInfo.ts b/src/components/Shop/types/ShopInfo.ts index ed0a6726d..89ee0ccdb 100644 --- a/src/components/Shop/types/ShopInfo.ts +++ b/src/components/Shop/types/ShopInfo.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { WeightUnitsEnum, LanguageCodeEnum, PermissionEnum } from "./../../../types/globalTypes"; diff --git a/src/components/SideBar/ExpandButton.tsx b/src/components/SideBar/ExpandButton.tsx index 379d6be95..1ae72717b 100644 --- a/src/components/SideBar/ExpandButton.tsx +++ b/src/components/SideBar/ExpandButton.tsx @@ -1,6 +1,6 @@ import { ButtonProps } from "@material-ui/core/Button"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import ArrowIcon from "@material-ui/icons/ArrowBack"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/SideBar/MenuItem.tsx b/src/components/SideBar/MenuItem.tsx index 77462c507..e38b7d371 100644 --- a/src/components/SideBar/MenuItem.tsx +++ b/src/components/SideBar/MenuItem.tsx @@ -2,9 +2,9 @@ import ClickAwayListener from "@material-ui/core/ClickAwayListener"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; import { fade } from "@material-ui/core/styles/colorManipulator"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Typography from "@material-ui/core/Typography"; import { UseNavigatorResult } from "@saleor/hooks/useNavigator"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import SVG from "react-inlinesvg"; diff --git a/src/components/SideBar/SideBar.tsx b/src/components/SideBar/SideBar.tsx index 77b4f3ee4..1505065f4 100644 --- a/src/components/SideBar/SideBar.tsx +++ b/src/components/SideBar/SideBar.tsx @@ -1,11 +1,11 @@ import logoLight from "@assets/images/logo-sidebar-light.svg"; import configurationIcon from "@assets/images/menu-configure-icon.svg"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import { configurationMenuUrl } from "@saleor/configuration"; import { User } from "@saleor/fragments/types/User"; import useLocalStorage from "@saleor/hooks/useLocalStorage"; import { UseNavigatorResult } from "@saleor/hooks/useNavigator"; import { sectionNames } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import SVG from "react-inlinesvg"; diff --git a/src/components/SideBarDrawer/styles.ts b/src/components/SideBarDrawer/styles.ts index 92cda2a00..af1164cce 100644 --- a/src/components/SideBarDrawer/styles.ts +++ b/src/components/SideBarDrawer/styles.ts @@ -1,4 +1,4 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; const useStyles = makeStyles( theme => ({ diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx index 90d97455c..ca9788019 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx @@ -1,7 +1,7 @@ import { InputProps } from "@material-ui/core/Input"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import { ExtendedFormHelperTextProps } from "@saleor/channels/components/ChannelForm/types"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import classNames from "classnames"; import Downshift, { ControllerStateAndHelpers } from "downshift"; diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx index 0b3999b88..3e9460bbf 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectFieldContent.tsx @@ -2,12 +2,12 @@ import chevronDown from "@assets/images/ChevronDown.svg"; import CircularProgress from "@material-ui/core/CircularProgress"; import MenuItem from "@material-ui/core/MenuItem"; import Paper from "@material-ui/core/Paper"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import Add from "@material-ui/icons/Add"; import useElementScroll, { isScrolledToBottom } from "@saleor/hooks/useElementScroll"; +import { makeStyles } from "@saleor/theme"; import { FetchMoreProps } from "@saleor/types"; import classNames from "classnames"; import { GetItemPropsOptions } from "downshift"; diff --git a/src/components/SingleSelectField/SingleSelectField.tsx b/src/components/SingleSelectField/SingleSelectField.tsx index 351b2bd55..0e35b054a 100644 --- a/src/components/SingleSelectField/SingleSelectField.tsx +++ b/src/components/SingleSelectField/SingleSelectField.tsx @@ -5,7 +5,7 @@ import InputLabel from "@material-ui/core/InputLabel"; import MenuItem from "@material-ui/core/MenuItem"; import OutlinedInput from "@material-ui/core/OutlinedInput"; import Select, { SelectProps } from "@material-ui/core/Select"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/Skeleton.tsx b/src/components/Skeleton.tsx index 4cefd2a04..0af6740d7 100644 --- a/src/components/Skeleton.tsx +++ b/src/components/Skeleton.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/SortableChip/SortableChip.tsx b/src/components/SortableChip/SortableChip.tsx index c78900d3c..bd987ed98 100644 --- a/src/components/SortableChip/SortableChip.tsx +++ b/src/components/SortableChip/SortableChip.tsx @@ -1,6 +1,6 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import CloseIcon from "@material-ui/icons/Close"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { SortableElement, SortableElementProps } from "react-sortable-hoc"; diff --git a/src/components/SortableChip/SortableHandle.tsx b/src/components/SortableChip/SortableHandle.tsx index 7bfad44d4..34786b38f 100644 --- a/src/components/SortableChip/SortableHandle.tsx +++ b/src/components/SortableChip/SortableHandle.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Draggable from "@saleor/icons/Draggable"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { SortableHandle as SortableHandleHoc } from "react-sortable-hoc"; diff --git a/src/components/SortableChipsField/SortableChipsField.tsx b/src/components/SortableChipsField/SortableChipsField.tsx index e580b082d..2f621f71e 100644 --- a/src/components/SortableChipsField/SortableChipsField.tsx +++ b/src/components/SortableChipsField/SortableChipsField.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import { ReorderAction } from "@saleor/types"; import React from "react"; import { SortableContainerProps } from "react-sortable-hoc"; diff --git a/src/components/SortableTable/SortableHandle.tsx b/src/components/SortableTable/SortableHandle.tsx index 40997efd8..bc3dcef78 100644 --- a/src/components/SortableTable/SortableHandle.tsx +++ b/src/components/SortableTable/SortableHandle.tsx @@ -1,6 +1,6 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; import TableCell from "@material-ui/core/TableCell"; import Draggable from "@saleor/icons/Draggable"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { SortableHandle as SortableHandleHoc } from "react-sortable-hoc"; diff --git a/src/components/SortableTable/SortableTableBody.tsx b/src/components/SortableTable/SortableTableBody.tsx index 4a8d715c8..19b12be81 100644 --- a/src/components/SortableTable/SortableTableBody.tsx +++ b/src/components/SortableTable/SortableTableBody.tsx @@ -1,5 +1,5 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; import TableBody, { TableBodyProps } from "@material-ui/core/TableBody"; +import { makeStyles } from "@saleor/theme"; import { ReorderAction } from "@saleor/types"; import React from "react"; import { SortableContainer } from "react-sortable-hoc"; diff --git a/src/components/SquareButton/SquareButton.tsx b/src/components/SquareButton/SquareButton.tsx index 5e69a2fd9..a66edc14b 100644 --- a/src/components/SquareButton/SquareButton.tsx +++ b/src/components/SquareButton/SquareButton.tsx @@ -1,5 +1,5 @@ import ButtonBase, { ButtonBaseProps } from "@material-ui/core/ButtonBase"; -import makeStyles from "@material-ui/core/styles/makeStyles"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/StatusChip/StatusChip.tsx b/src/components/StatusChip/StatusChip.tsx index 899c40ae8..599356837 100644 --- a/src/components/StatusChip/StatusChip.tsx +++ b/src/components/StatusChip/StatusChip.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/StatusLabel/StatusLabel.tsx b/src/components/StatusLabel/StatusLabel.tsx index 22f301ebb..83e7124db 100644 --- a/src/components/StatusLabel/StatusLabel.tsx +++ b/src/components/StatusLabel/StatusLabel.tsx @@ -1,7 +1,7 @@ import grey from "@material-ui/core/colors/grey"; import yellow from "@material-ui/core/colors/yellow"; -import { makeStyles } from "@material-ui/core/styles"; import Typography, { TypographyProps } from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/Tab/Tab.tsx b/src/components/Tab/Tab.tsx index b13d3cf56..6fb2fca0e 100644 --- a/src/components/Tab/Tab.tsx +++ b/src/components/Tab/Tab.tsx @@ -1,6 +1,6 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/Tab/TabContainer.tsx b/src/components/Tab/TabContainer.tsx index f4ed75019..7f541f9ed 100644 --- a/src/components/Tab/TabContainer.tsx +++ b/src/components/Tab/TabContainer.tsx @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React from "react"; export interface TabContainerProps { diff --git a/src/components/TableCellAvatar/TableCellAvatar.tsx b/src/components/TableCellAvatar/TableCellAvatar.tsx index 5e1a16294..39460d3df 100644 --- a/src/components/TableCellAvatar/TableCellAvatar.tsx +++ b/src/components/TableCellAvatar/TableCellAvatar.tsx @@ -1,7 +1,7 @@ import Avatar from "@material-ui/core/Avatar"; -import { makeStyles } from "@material-ui/core/styles"; import TableCell, { TableCellProps } from "@material-ui/core/TableCell"; import Cached from "@material-ui/icons/Cached"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/TableCellHeader/TableCellHeader.tsx b/src/components/TableCellHeader/TableCellHeader.tsx index 609bb49b1..aa46cf34c 100644 --- a/src/components/TableCellHeader/TableCellHeader.tsx +++ b/src/components/TableCellHeader/TableCellHeader.tsx @@ -1,5 +1,5 @@ -import makeStyles from "@material-ui/core/styles/makeStyles"; import TableCell, { TableCellProps } from "@material-ui/core/TableCell"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/TableFilter/FilterTab.tsx b/src/components/TableFilter/FilterTab.tsx index 21547a0ee..4e2b5283b 100644 --- a/src/components/TableFilter/FilterTab.tsx +++ b/src/components/TableFilter/FilterTab.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Tab from "@material-ui/core/Tab"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; diff --git a/src/components/TableFilter/FilterTabs.tsx b/src/components/TableFilter/FilterTabs.tsx index 66a2f9d75..fea3b21d1 100644 --- a/src/components/TableFilter/FilterTabs.tsx +++ b/src/components/TableFilter/FilterTabs.tsx @@ -1,5 +1,5 @@ -import { makeStyles } from "@material-ui/core/styles"; import Tabs from "@material-ui/core/Tabs"; +import { makeStyles } from "@saleor/theme"; import React from "react"; const useStyles = makeStyles( diff --git a/src/components/TableHead/TableHead.tsx b/src/components/TableHead/TableHead.tsx index da846e74e..340460843 100644 --- a/src/components/TableHead/TableHead.tsx +++ b/src/components/TableHead/TableHead.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import TableCell from "@material-ui/core/TableCell"; import MuiTableHead, { @@ -6,6 +5,7 @@ import MuiTableHead, { } from "@material-ui/core/TableHead"; import TableRow from "@material-ui/core/TableRow"; import Typography from "@material-ui/core/Typography"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; diff --git a/src/components/TablePagination/TablePagination.tsx b/src/components/TablePagination/TablePagination.tsx index af5f09e5c..82598f52b 100644 --- a/src/components/TablePagination/TablePagination.tsx +++ b/src/components/TablePagination/TablePagination.tsx @@ -1,9 +1,9 @@ import { IconButtonProps } from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableCell from "@material-ui/core/TableCell"; import Toolbar from "@material-ui/core/Toolbar"; import RowNumberSelect from "@saleor/components/RowNumberSelect"; import { maybe } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { ListSettings } from "../../types"; diff --git a/src/components/TablePagination/TablePaginationActions.tsx b/src/components/TablePagination/TablePaginationActions.tsx index 0fd037f77..43a7f7673 100644 --- a/src/components/TablePagination/TablePaginationActions.tsx +++ b/src/components/TablePagination/TablePaginationActions.tsx @@ -1,9 +1,9 @@ import IconButton from "@material-ui/core/IconButton"; -import { makeStyles, useTheme as useMuiTheme } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import ArrowLeft from "@material-ui/icons/ArrowLeft"; import ArrowRight from "@material-ui/icons/ArrowRight"; import useTheme from "@saleor/hooks/useTheme"; +import { makeStyles, useTheme as useSaleorTheme } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; @@ -76,7 +76,7 @@ export const TablePaginationActions: React.FC = pro const classes = useStyles(props); const { isDark } = useTheme(); - const { direction } = useMuiTheme(); + const { direction } = useSaleorTheme(); return (
diff --git a/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx b/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx index ef2d82f7d..abf8e6697 100644 --- a/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx +++ b/src/components/TextFieldWithChoice/TextFieldWithChoice.tsx @@ -4,10 +4,10 @@ import MenuItem from "@material-ui/core/MenuItem"; import Menu from "@material-ui/core/MenuList"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; -import { makeStyles } from "@material-ui/core/styles"; import TextField, { TextFieldProps } from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import DropdownIcon from "@material-ui/icons/ArrowDropDown"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import MenuToggle from "../MenuToggle"; diff --git a/src/components/Timeline/Timeline.tsx b/src/components/Timeline/Timeline.tsx index 128c9b7f7..674cc56f3 100644 --- a/src/components/Timeline/Timeline.tsx +++ b/src/components/Timeline/Timeline.tsx @@ -2,9 +2,9 @@ import Avatar from "@material-ui/core/Avatar"; import Button from "@material-ui/core/Button"; import CardContent from "@material-ui/core/CardContent"; import deepPurple from "@material-ui/core/colors/deepPurple"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import PersonIcon from "@material-ui/icons/Person"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/components/Timeline/TimelineEvent.tsx b/src/components/Timeline/TimelineEvent.tsx index 6182bccb9..112fccb2c 100644 --- a/src/components/Timeline/TimelineEvent.tsx +++ b/src/components/Timeline/TimelineEvent.tsx @@ -1,9 +1,9 @@ import ExpansionPanel from "@material-ui/core/ExpansionPanel"; import ExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; import ExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import TimelineEventHeader, { TitleElement } from "./TimelineEventHeader"; diff --git a/src/components/Timeline/TimelineEventHeader.tsx b/src/components/Timeline/TimelineEventHeader.tsx index 4520ef2d9..e1fc50cc1 100644 --- a/src/components/Timeline/TimelineEventHeader.tsx +++ b/src/components/Timeline/TimelineEventHeader.tsx @@ -1,6 +1,6 @@ -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import useNavigator from "@saleor/hooks/useNavigator"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { DateTime } from "../Date"; diff --git a/src/components/Timeline/TimelineNote.tsx b/src/components/Timeline/TimelineNote.tsx index 21e9bbe1f..507edfe32 100644 --- a/src/components/Timeline/TimelineNote.tsx +++ b/src/components/Timeline/TimelineNote.tsx @@ -2,9 +2,9 @@ import Avatar from "@material-ui/core/Avatar"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import * as colors from "@material-ui/core/colors"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import PersonIcon from "@material-ui/icons/Person"; +import { makeStyles } from "@saleor/theme"; import CRC from "crc-32"; import React from "react"; diff --git a/src/components/UserChip/UserChip.tsx b/src/components/UserChip/UserChip.tsx index 488cf3299..d148651ba 100644 --- a/src/components/UserChip/UserChip.tsx +++ b/src/components/UserChip/UserChip.tsx @@ -8,11 +8,11 @@ import MenuItem from "@material-ui/core/MenuItem"; import Menu from "@material-ui/core/MenuList"; import Paper from "@material-ui/core/Paper"; import Popper from "@material-ui/core/Popper"; -import makeStyles from "@material-ui/core/styles/makeStyles"; import Switch from "@material-ui/core/Switch"; import { User } from "@saleor/fragments/types/User"; import ArrowDropdown from "@saleor/icons/ArrowDropdown"; import { getUserInitials, getUserName } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import classNames from "classnames"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/components/VisibilityCard/DateVisibilitySelector.tsx b/src/components/VisibilityCard/DateVisibilitySelector.tsx index 47bd19336..583495d71 100644 --- a/src/components/VisibilityCard/DateVisibilitySelector.tsx +++ b/src/components/VisibilityCard/DateVisibilitySelector.tsx @@ -1,6 +1,6 @@ import closeIcon from "@assets/images/close-thin.svg"; import { Typography } from "@material-ui/core"; -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; import React, { useState } from "react"; import FormSpacer from "../FormSpacer"; diff --git a/src/components/VisibilityCard/VisibilityCard.tsx b/src/components/VisibilityCard/VisibilityCard.tsx index 95a163555..597425f87 100644 --- a/src/components/VisibilityCard/VisibilityCard.tsx +++ b/src/components/VisibilityCard/VisibilityCard.tsx @@ -1,6 +1,5 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import CardTitle from "@saleor/components/CardTitle"; @@ -9,6 +8,7 @@ import Hr from "@saleor/components/Hr"; import RadioSwitchField from "@saleor/components/RadioSwitchField"; import useDateLocalize from "@saleor/hooks/useDateLocalize"; import { ChangeEvent } from "@saleor/hooks/useForm"; +import { makeStyles } from "@saleor/theme"; import { UserError } from "@saleor/types"; import { getFieldError } from "@saleor/utils/errors"; import classNames from "classnames"; diff --git a/src/components/messages/styles.ts b/src/components/messages/styles.ts index d462a93b7..f880b399d 100644 --- a/src/components/messages/styles.ts +++ b/src/components/messages/styles.ts @@ -2,8 +2,8 @@ import errorIcon from "@assets/images/error-icon.svg"; import infoIcon from "@assets/images/info-icon.svg"; import successIcon from "@assets/images/success-icon.svg"; import warningIcon from "@assets/images/warning-icon.svg"; -import { makeStyles } from "@material-ui/core/styles"; import { darken } from "@material-ui/core/styles/colorManipulator"; +import { makeStyles } from "@saleor/theme"; const successColor = "#60DAA0"; const warningColor = "#FFB84E"; diff --git a/src/configuration/ConfigurationPage.tsx b/src/configuration/ConfigurationPage.tsx index 502b9568c..d55fdd67d 100644 --- a/src/configuration/ConfigurationPage.tsx +++ b/src/configuration/ConfigurationPage.tsx @@ -1,10 +1,10 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; import { IconProps } from "@material-ui/core/Icon"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import { User } from "@saleor/fragments/types/User"; import { sectionNames } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { useIntl } from "react-intl"; @@ -19,6 +19,7 @@ export interface MenuItem { permission: PermissionEnum; title: string; url?: string; + testId?: string; } export interface MenuSection { @@ -128,6 +129,7 @@ export const ConfigurationPage: React.FC = props => { key={itemIndex} data-test="settingsSubsection" data-testid={item.title.toLowerCase()} + data-test-id={item.testId} >
{item.icon}
diff --git a/src/configuration/index.tsx b/src/configuration/index.tsx index 60bc1582f..8eb051fc5 100644 --- a/src/configuration/index.tsx +++ b/src/configuration/index.tsx @@ -50,7 +50,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES, title: intl.formatMessage(sectionNames.attributes), - url: attributeListUrl() + url: attributeListUrl(), + testId: "configurationMenuAttributes" }, { description: intl.formatMessage({ @@ -60,7 +61,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES, title: intl.formatMessage(sectionNames.productTypes), - url: productTypeListUrl() + url: productTypeListUrl(), + testId: "configurationMenuProductTypes" } ] }, @@ -77,7 +79,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_SETTINGS, title: intl.formatMessage(sectionNames.taxes), - url: taxSection + url: taxSection, + testId: "configurationMenuTaxes" } ] }, @@ -94,7 +97,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_STAFF, title: intl.formatMessage(sectionNames.staff), - url: staffListUrl() + url: staffListUrl(), + testId: "configurationMenuStaff" }, { description: intl.formatMessage({ @@ -105,7 +109,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_STAFF, title: intl.formatMessage(sectionNames.permissionGroups), - url: permissionGroupListUrl() + url: permissionGroupListUrl(), + testId: "configurationMenuPermissionGroups" } ] }, @@ -122,7 +127,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_SHIPPING, title: intl.formatMessage(sectionNames.shipping), - url: shippingZonesListUrl() + url: shippingZonesListUrl(), + testId: "configurationMenuShipping" }, { description: intl.formatMessage({ @@ -132,7 +138,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_PRODUCTS, title: intl.formatMessage(sectionNames.warehouses), - url: warehouseSection + url: warehouseSection, + testId: "configurationMenuWarehouses" } ] }, @@ -149,7 +156,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_CHANNELS, title: intl.formatMessage(sectionNames.channels), - url: channelsListUrl() + url: channelsListUrl(), + testId: "configurationMenuChannels" } ] }, @@ -166,7 +174,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_PAGES, title: intl.formatMessage(sectionNames.pageTypes), - url: pageTypeListUrl() + url: pageTypeListUrl(), + testId: "configurationMenuPageTypes" }, { description: intl.formatMessage({ @@ -176,7 +185,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_PAGES, title: intl.formatMessage(sectionNames.pages), - url: pageListUrl() + url: pageListUrl(), + testId: "configurationMenuPages" } ] }, @@ -193,7 +203,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_MENUS, title: intl.formatMessage(sectionNames.navigation), - url: menuListUrl() + url: menuListUrl(), + testId: "configurationMenuNavigation" }, { description: intl.formatMessage({ @@ -203,7 +214,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { icon: , permission: PermissionEnum.MANAGE_SETTINGS, title: intl.formatMessage(sectionNames.siteSettings), - url: siteSettingsUrl() + url: siteSettingsUrl(), + testId: "configurationMenuSiteSettings" }, { description: intl.formatMessage({ @@ -219,7 +231,8 @@ export function createConfigurationMenu(intl: IntlShape): MenuSection[] { ), permission: PermissionEnum.MANAGE_PLUGINS, title: intl.formatMessage(sectionNames.plugins), - url: pluginListUrl() + url: pluginListUrl(), + testId: "configurationPluginsPages" } ] } diff --git a/src/containers/BackgroundTasks/types/CheckExportFileStatus.ts b/src/containers/BackgroundTasks/types/CheckExportFileStatus.ts index 210e7e474..7c4f6b581 100644 --- a/src/containers/BackgroundTasks/types/CheckExportFileStatus.ts +++ b/src/containers/BackgroundTasks/types/CheckExportFileStatus.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { JobStatusEnum } from "./../../../types/globalTypes"; diff --git a/src/containers/BackgroundTasks/types/CheckOrderInvoicesStatus.ts b/src/containers/BackgroundTasks/types/CheckOrderInvoicesStatus.ts index 848f69b04..502ceb521 100644 --- a/src/containers/BackgroundTasks/types/CheckOrderInvoicesStatus.ts +++ b/src/containers/BackgroundTasks/types/CheckOrderInvoicesStatus.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { JobStatusEnum } from "./../../../types/globalTypes"; diff --git a/src/customers/components/CustomerAddress/CustomerAddress.tsx b/src/customers/components/CustomerAddress/CustomerAddress.tsx index 5d0e8dddb..15fd0c145 100644 --- a/src/customers/components/CustomerAddress/CustomerAddress.tsx +++ b/src/customers/components/CustomerAddress/CustomerAddress.tsx @@ -1,10 +1,10 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import AddressFormatter from "@saleor/components/AddressFormatter"; import CardMenu from "@saleor/components/CardMenu"; import CardTitle from "@saleor/components/CardTitle"; import Skeleton from "@saleor/components/Skeleton"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { defineMessages, useIntl } from "react-intl"; diff --git a/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx b/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx index 3ca004fa4..f82f96fce 100644 --- a/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx +++ b/src/customers/components/CustomerAddressDialog/CustomerAddressDialog.tsx @@ -3,7 +3,6 @@ import Dialog from "@material-ui/core/Dialog"; import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogTitle from "@material-ui/core/DialogTitle"; -import { createStyles, WithStyles, withStyles } from "@material-ui/core/styles"; import AddressEdit from "@saleor/components/AddressEdit"; import ConfirmButton, { ConfirmButtonTransitionState @@ -14,6 +13,7 @@ import useAddressValidation from "@saleor/hooks/useAddressValidation"; import useModalDialogErrors from "@saleor/hooks/useModalDialogErrors"; import useStateFromProps from "@saleor/hooks/useStateFromProps"; import { buttonMessages } from "@saleor/intl"; +import { createStyles, WithStyles, withStyles } from "@saleor/theme"; import { AddressInput } from "@saleor/types/globalTypes"; import createSingleAutocompleteSelectHandler from "@saleor/utils/handlers/singleAutocompleteSelectChangeHandler"; import React from "react"; diff --git a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx index e77239552..fdbe09feb 100644 --- a/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx +++ b/src/customers/components/CustomerAddressListPage/CustomerAddressListPage.tsx @@ -1,10 +1,10 @@ import Button from "@material-ui/core/Button"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import AppHeader from "@saleor/components/AppHeader"; import Container from "@saleor/components/Container"; import PageHeader from "@saleor/components/PageHeader"; import { renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { defineMessages, useIntl } from "react-intl"; diff --git a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx index a82fbc172..e3c38c128 100644 --- a/src/customers/components/CustomerAddresses/CustomerAddresses.tsx +++ b/src/customers/components/CustomerAddresses/CustomerAddresses.tsx @@ -1,12 +1,12 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import AddressFormatter from "@saleor/components/AddressFormatter"; import CardTitle from "@saleor/components/CardTitle"; import { Hr } from "@saleor/components/Hr"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx b/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx index 710aa1d2c..686dbe8be 100644 --- a/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx +++ b/src/customers/components/CustomerCreateAddress/CustomerCreateAddress.tsx @@ -1,12 +1,12 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import AddressEdit from "@saleor/components/AddressEdit"; import CardTitle from "@saleor/components/CardTitle"; import { FormSpacer } from "@saleor/components/FormSpacer"; import { SingleAutocompleteChoiceType } from "@saleor/components/SingleAutocompleteSelectField"; import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragment"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx b/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx index 06fd2da43..9b48d9346 100644 --- a/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx +++ b/src/customers/components/CustomerCreateDetails/CustomerCreateDetails.tsx @@ -1,10 +1,10 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import CardTitle from "@saleor/components/CardTitle"; import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragment"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import { getFormErrors } from "@saleor/utils/errors"; import getAccountErrorMessage from "@saleor/utils/errors/account"; import React from "react"; diff --git a/src/customers/components/CustomerDetails/CustomerDetails.tsx b/src/customers/components/CustomerDetails/CustomerDetails.tsx index b916c6c19..5039626c8 100644 --- a/src/customers/components/CustomerDetails/CustomerDetails.tsx +++ b/src/customers/components/CustomerDetails/CustomerDetails.tsx @@ -1,6 +1,5 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import CardTitle from "@saleor/components/CardTitle"; @@ -8,6 +7,7 @@ import { ControlledCheckbox } from "@saleor/components/ControlledCheckbox"; import Skeleton from "@saleor/components/Skeleton"; import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragment"; import { maybe } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { getFormErrors } from "@saleor/utils/errors"; import getAccountErrorMessage from "@saleor/utils/errors/account"; import moment from "moment-timezone"; diff --git a/src/customers/components/CustomerInfo/CustomerInfo.tsx b/src/customers/components/CustomerInfo/CustomerInfo.tsx index c722f49d1..9dfdbd7f2 100644 --- a/src/customers/components/CustomerInfo/CustomerInfo.tsx +++ b/src/customers/components/CustomerInfo/CustomerInfo.tsx @@ -1,6 +1,5 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import TextField from "@material-ui/core/TextField"; import Typography from "@material-ui/core/Typography"; import CardTitle from "@saleor/components/CardTitle"; @@ -8,6 +7,7 @@ import Grid from "@saleor/components/Grid"; import Hr from "@saleor/components/Hr"; import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragment"; import { commonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import { getFormErrors } from "@saleor/utils/errors"; import getAccountErrorMessage from "@saleor/utils/errors/account"; import React from "react"; diff --git a/src/customers/components/CustomerList/CustomerList.tsx b/src/customers/components/CustomerList/CustomerList.tsx index 160bc7d7b..8b72865ac 100644 --- a/src/customers/components/CustomerList/CustomerList.tsx +++ b/src/customers/components/CustomerList/CustomerList.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -11,6 +10,7 @@ import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { CustomerListUrlSortField } from "@saleor/customers/urls"; import { getUserName, maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ListActions, ListProps, SortPage } from "@saleor/types"; import { getArrowDirection } from "@saleor/utils/sort"; import React from "react"; diff --git a/src/customers/components/CustomerOrders/CustomerOrders.tsx b/src/customers/components/CustomerOrders/CustomerOrders.tsx index cf9aac9c5..18bd339e9 100644 --- a/src/customers/components/CustomerOrders/CustomerOrders.tsx +++ b/src/customers/components/CustomerOrders/CustomerOrders.tsx @@ -1,6 +1,5 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableHead from "@material-ui/core/TableHead"; @@ -11,6 +10,7 @@ import Money from "@saleor/components/Money"; import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import StatusLabel from "@saleor/components/StatusLabel"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/customers/components/CustomerStats/CustomerStats.tsx b/src/customers/components/CustomerStats/CustomerStats.tsx index 2623a6c0f..bc92964fc 100644 --- a/src/customers/components/CustomerStats/CustomerStats.tsx +++ b/src/customers/components/CustomerStats/CustomerStats.tsx @@ -1,11 +1,11 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import Typography from "@material-ui/core/Typography"; import CardTitle from "@saleor/components/CardTitle"; import { DateTime } from "@saleor/components/Date"; import { Hr } from "@saleor/components/Hr"; import Skeleton from "@saleor/components/Skeleton"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/customers/types/BulkRemoveCustomers.ts b/src/customers/types/BulkRemoveCustomers.ts index 206900f35..ebaf85ab3 100644 --- a/src/customers/types/BulkRemoveCustomers.ts +++ b/src/customers/types/BulkRemoveCustomers.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/CreateCustomer.ts b/src/customers/types/CreateCustomer.ts index 6b75e5d8d..187a7a584 100644 --- a/src/customers/types/CreateCustomer.ts +++ b/src/customers/types/CreateCustomer.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { UserCreateInput, AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/CreateCustomerAddress.ts b/src/customers/types/CreateCustomerAddress.ts index 5ffafaee9..50a60f156 100644 --- a/src/customers/types/CreateCustomerAddress.ts +++ b/src/customers/types/CreateCustomerAddress.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AddressInput, AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/CustomerAddresses.ts b/src/customers/types/CustomerAddresses.ts index b95d46a28..7ba0921e6 100644 --- a/src/customers/types/CustomerAddresses.ts +++ b/src/customers/types/CustomerAddresses.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/customers/types/CustomerCreateData.ts b/src/customers/types/CustomerCreateData.ts index a6e641a56..f1c8afe26 100644 --- a/src/customers/types/CustomerCreateData.ts +++ b/src/customers/types/CustomerCreateData.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. // ==================================================== diff --git a/src/customers/types/CustomerDetails.ts b/src/customers/types/CustomerDetails.ts index 89532aa61..2645c09b9 100644 --- a/src/customers/types/CustomerDetails.ts +++ b/src/customers/types/CustomerDetails.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { PaymentChargeStatusEnum } from "./../../types/globalTypes"; diff --git a/src/customers/types/ListCustomers.ts b/src/customers/types/ListCustomers.ts index 29f19197f..f16acb87f 100644 --- a/src/customers/types/ListCustomers.ts +++ b/src/customers/types/ListCustomers.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CustomerFilterInput, UserSortingInput } from "./../../types/globalTypes"; diff --git a/src/customers/types/RemoveCustomer.ts b/src/customers/types/RemoveCustomer.ts index ceaddf38a..6217b2034 100644 --- a/src/customers/types/RemoveCustomer.ts +++ b/src/customers/types/RemoveCustomer.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/RemoveCustomerAddress.ts b/src/customers/types/RemoveCustomerAddress.ts index 4d1769f49..64833f9a9 100644 --- a/src/customers/types/RemoveCustomerAddress.ts +++ b/src/customers/types/RemoveCustomerAddress.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/SetCustomerDefaultAddress.ts b/src/customers/types/SetCustomerDefaultAddress.ts index af2058f60..c53179a61 100644 --- a/src/customers/types/SetCustomerDefaultAddress.ts +++ b/src/customers/types/SetCustomerDefaultAddress.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AddressTypeEnum, AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/UpdateCustomer.ts b/src/customers/types/UpdateCustomer.ts index 500a0c01c..c62a7f8b6 100644 --- a/src/customers/types/UpdateCustomer.ts +++ b/src/customers/types/UpdateCustomer.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { CustomerInput, AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/customers/types/UpdateCustomerAddress.ts b/src/customers/types/UpdateCustomerAddress.ts index e62b464a1..da56ad532 100644 --- a/src/customers/types/UpdateCustomerAddress.ts +++ b/src/customers/types/UpdateCustomerAddress.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +// @generated // This file was automatically generated and should not be edited. import { AddressInput, AccountErrorCode } from "./../../types/globalTypes"; diff --git a/src/discounts/components/DiscountCategories/DiscountCategories.tsx b/src/discounts/components/DiscountCategories/DiscountCategories.tsx index ddf81ad16..f10ec70f2 100644 --- a/src/discounts/components/DiscountCategories/DiscountCategories.tsx +++ b/src/discounts/components/DiscountCategories/DiscountCategories.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -13,6 +12,7 @@ import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/discounts/components/DiscountCollections/DiscountCollections.tsx b/src/discounts/components/DiscountCollections/DiscountCollections.tsx index 4d61dfd7b..255352651 100644 --- a/src/discounts/components/DiscountCollections/DiscountCollections.tsx +++ b/src/discounts/components/DiscountCollections/DiscountCollections.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -13,6 +12,7 @@ import ResponsiveTable from "@saleor/components/ResponsiveTable"; import Skeleton from "@saleor/components/Skeleton"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx index 9a12c61f3..dfcdcb125 100644 --- a/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx +++ b/src/discounts/components/DiscountCountrySelectDialog/DiscountCountrySelectDialog.tsx @@ -3,7 +3,6 @@ import Dialog from "@material-ui/core/Dialog"; import DialogActions from "@material-ui/core/DialogActions"; import DialogContent from "@material-ui/core/DialogContent"; import DialogTitle from "@material-ui/core/DialogTitle"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableRow from "@material-ui/core/TableRow"; @@ -20,6 +19,7 @@ import ResponsiveTable from "@saleor/components/ResponsiveTable"; // tslint:disable no-submodule-imports import { ShopInfo_shop_countries } from "@saleor/components/Shop/types/ShopInfo"; import { buttonMessages } from "@saleor/intl"; +import { makeStyles } from "@saleor/theme"; import { filter } from "fuzzaldrin"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/discounts/components/DiscountProducts/DiscountProducts.tsx b/src/discounts/components/DiscountProducts/DiscountProducts.tsx index 9e94099b9..3ac72f735 100644 --- a/src/discounts/components/DiscountProducts/DiscountProducts.tsx +++ b/src/discounts/components/DiscountProducts/DiscountProducts.tsx @@ -1,7 +1,6 @@ import Button from "@material-ui/core/Button"; import Card from "@material-ui/core/Card"; import IconButton from "@material-ui/core/IconButton"; -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -17,6 +16,7 @@ import TableCellAvatar, { } from "@saleor/components/TableCellAvatar"; import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; +import { makeStyles } from "@saleor/theme"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; diff --git a/src/discounts/components/SaleList/SaleList.tsx b/src/discounts/components/SaleList/SaleList.tsx index d2a1d7e43..8040121d4 100644 --- a/src/discounts/components/SaleList/SaleList.tsx +++ b/src/discounts/components/SaleList/SaleList.tsx @@ -1,4 +1,3 @@ -import { makeStyles } from "@material-ui/core/styles"; import TableBody from "@material-ui/core/TableBody"; import TableCell from "@material-ui/core/TableCell"; import TableFooter from "@material-ui/core/TableFooter"; @@ -14,6 +13,7 @@ import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { SaleListUrlSortField } from "@saleor/discounts/urls"; import { maybe, renderCollection } from "@saleor/misc"; +import { makeStyles } from "@saleor/theme"; import { ChannelProps, ListActions, ListProps, SortPage } from "@saleor/types"; import { SaleType } from "@saleor/types/globalTypes"; import { getArrowDirection } from "@saleor/utils/sort"; diff --git a/src/discounts/components/SaleType/SaleType.tsx b/src/discounts/components/SaleType/SaleType.tsx index ebec25615..8b4d9e634 100644 --- a/src/discounts/components/SaleType/SaleType.tsx +++ b/src/discounts/components/SaleType/SaleType.tsx @@ -1,11 +1,11 @@ import Card from "@material-ui/core/Card"; import CardContent from "@material-ui/core/CardContent"; -import { makeStyles } from "@material-ui/core/styles"; import CardTitle from "@saleor/components/CardTitle"; import RadioGroupField, { RadioGroupFieldChoice } from "@saleor/components/RadioGroupField"; import { FormChange } from "@saleor/hooks/useForm"; +import { makeStyles } from "@saleor/theme"; import { SaleType as SaleTypeEnum } from "@saleor/types/globalTypes"; import React from "react"; import { IntlShape, useIntl } from "react-intl"; diff --git a/src/discounts/components/SaleValue/styles.ts b/src/discounts/components/SaleValue/styles.ts index a9eaef751..2e1aef9a2 100644 --- a/src/discounts/components/SaleValue/styles.ts +++ b/src/discounts/components/SaleValue/styles.ts @@ -1,4 +1,4 @@ -import { makeStyles } from "@material-ui/core/styles"; +import { makeStyles } from "@saleor/theme"; export const useStyles = makeStyles( theme => ({ diff --git a/src/discounts/components/VoucherInfo/VoucherInfo.tsx b/src/discounts/components/VoucherInfo/VoucherInfo.tsx index e773d17a4..3e2dccf3e 100644 --- a/src/discounts/components/VoucherInfo/VoucherInfo.tsx +++ b/src/discounts/components/VoucherInfo/VoucherInfo.tsx @@ -46,7 +46,11 @@ const VoucherInfo = ({ title={intl.formatMessage(commonMessages.generalInformations)} toolbar={ variant === "create" && ( -