Merge branch 'master' of github.com:mirumee/saleor-dashboard into feature/unconfirmed-order-line-manipulation
This commit is contained in:
commit
779d93cfa3
713 changed files with 2303 additions and 1148 deletions
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -29,4 +29,4 @@ greatly reduce the amount of work needed to review your work. -->
|
|||
<!-- Do not remove this section. It is required to properly setup test instance.
|
||||
Modify API_URI if you want test instance to use custom backend. -->
|
||||
|
||||
API_URI=https://master.staging.saleor.cloud/graphql/
|
||||
API_URI=https://qa.staging.saleor.cloud/graphql/
|
2
.github/workflows/test-env-deploy.yml
vendored
2
.github/workflows/test-env-deploy.yml
vendored
|
@ -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: |
|
||||
|
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
90
cypress/Data/permissions.js
Normal file
90
cypress/Data/permissions.js
Normal file
|
@ -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]
|
||||
}
|
||||
};
|
63
cypress/Data/permissionsUsers.js
Normal file
63
cypress/Data/permissionsUsers.js
Normal file
|
@ -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]
|
||||
}
|
||||
};
|
34
cypress/Data/users.js
Normal file
34
cypress/Data/users.js
Normal file
|
@ -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") };
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { getValueWithDefault } from "./utils/Utils";
|
||||
import { getValueWithDefault } from "../utils/Utils";
|
||||
|
||||
export function getSales(first, searchQuery) {
|
||||
const filter = getValueWithDefault(
|
28
cypress/apiRequests/Discounts/Vouchers.js
Normal file
28
cypress/apiRequests/Discounts/Vouchers.js
Normal file
|
@ -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);
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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}}`;
|
||||
}
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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"]'
|
||||
};
|
||||
|
|
9
cypress/elements/discounts/vouchers.js
Normal file
9
cypress/elements/discounts/vouchers.js
Normal file
|
@ -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']"
|
||||
};
|
|
@ -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']"
|
||||
};
|
||||
|
|
|
@ -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']"
|
||||
};
|
||||
|
|
3
cypress/elements/shared/sharedElements.js
Normal file
3
cypress/elements/shared/sharedElements.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
export const SHARED_ELEMENTS = {
|
||||
header: "[data-test-id='page-header']"
|
||||
};
|
|
@ -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
|
||||
|
|
172
cypress/integration/discounts/vouchers.js
Normal file
172
cypress/integration/discounts/vouchers.js
Normal file
|
@ -0,0 +1,172 @@
|
|||
// <reference types="cypress" />
|
||||
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"
|
||||
});
|
||||
}
|
||||
});
|
27
cypress/integration/homePage/homePage.js
Normal file
27
cypress/integration/homePage/homePage.js
Normal file
|
@ -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}`);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -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";
|
||||
|
||||
// <reference types="cypress" />
|
||||
describe("Homepage analytics", () => {
|
45
cypress/integration/navigation.js
Normal file
45
cypress/integration/navigation.js
Normal file
|
@ -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
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,5 +1,4 @@
|
|||
// <reference types="cypress" />
|
||||
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)
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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);
|
27
cypress/steps/discounts/vouchersSteps.js
Normal file
27
cypress/steps/discounts/vouchersSteps.js
Normal file
|
@ -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();
|
||||
}
|
77
cypress/steps/permissions.js
Normal file
77
cypress/steps/permissions.js
Normal file
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
|
@ -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}`;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
5
cypress/utils/discounts/salesUtils.js
Normal file
5
cypress/utils/discounts/salesUtils.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { deleteSale, getSales } from "../../apiRequests/Discounts/Sales";
|
||||
|
||||
export function deleteSalesStartsWith(startsWith) {
|
||||
cy.deleteElementsStartsWith(deleteSale, getSales, startsWith);
|
||||
}
|
8
cypress/utils/discounts/vouchersUtils.js
Normal file
8
cypress/utils/discounts/vouchersUtils.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import {
|
||||
deleteVouchers,
|
||||
getVouchers
|
||||
} from "../../apiRequests/Discounts/Vouchers";
|
||||
|
||||
export function deleteVouchersStartsWith(startsWith) {
|
||||
cy.deleteElementsStartsWith(deleteVouchers, getVouchers, startsWith, "code");
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import { deleteSale, getSales } from "../apiRequests/Sales";
|
||||
|
||||
export function deleteSalesStartsWith(startsWith) {
|
||||
cy.deleteElementsStartsWith(deleteSale, getSales, startsWith, "sales");
|
||||
}
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')",
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { makeStyles } from "@saleor/theme";
|
||||
|
||||
export const useStyles = makeStyles(
|
||||
theme => ({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { makeStyles } from "@saleor/theme";
|
||||
|
||||
export const useStyles = makeStyles(
|
||||
theme => ({
|
||||
|
|
|
@ -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 => ({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import makeStyles from "@material-ui/core/styles/makeStyles";
|
||||
import { makeStyles } from "@saleor/theme";
|
||||
|
||||
export const useStyles = makeStyles(
|
||||
theme => ({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { makeStyles } from "@saleor/theme";
|
||||
|
||||
export const useStyles = makeStyles(
|
||||
theme => ({
|
||||
|
|
|
@ -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 => ({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import { makeStyles } from "@saleor/theme";
|
||||
|
||||
export const useStyles = makeStyles(
|
||||
theme => ({
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { JobStatusEnum } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AttributeErrorCode } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AttributeErrorCode } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AccountErrorCode } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { PermissionEnum } from "./../../types/globalTypes";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { AccountErrorCode } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { PermissionEnum } from "./../../types/globalTypes";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { PermissionEnum } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { ProductErrorCode } from "./../../types/globalTypes";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
import { ProductErrorCode } from "./../../types/globalTypes";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @generated
|
||||
// This file was automatically generated and should not be edited.
|
||||
|
||||
// ====================================================
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue