Drop deprecated fields (#1071)

* Drop deprecated fields

* Update changelog

* Update test recordings

* Fix e2e tests

* Fix product sorting (#1079)

* update stories

Co-authored-by: Karolina Rakoczy <rakoczy.karolina@gmail.com>
This commit is contained in:
Jakub Majorek 2021-04-26 09:49:55 +02:00 committed by GitHub
parent d48c0087e0
commit a83a245654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 1356 additions and 1251 deletions

View file

@ -40,6 +40,7 @@ All notable, unreleased changes to this project will be documented in this file.
- rich text field updates,
- multiselect empty chip upon creation of a product/variant,
- useFormset.setItemValue wrong updates,
- Drop deprecated fields - #1071 by @jwm0
# 2.11.1

View file

@ -8,9 +8,9 @@ export function getSalesForChannel(channelSlug, period) {
}`;
return cy.sendRequestWithQuery(query);
}
export function getOrdersForChannel(channelSlug, created) {
export function getOrdersForChannel(channelSlug, { gte, lte }) {
const query = `query{
orders(created: ${created}, channel:"${channelSlug}"){
orders(filter: { created: { gte: "${gte}", lte: "${lte}" } }, channel:"${channelSlug}"){
totalCount
}
}`;
@ -18,7 +18,7 @@ export function getOrdersForChannel(channelSlug, created) {
}
export function getOrdersWithStatus(status, channelSlug) {
const query = `query{
orders(status: ${status}, channel:"${channelSlug}"){
orders(filter: { status: ${status} }, channel:"${channelSlug}"){
totalCount
}
}`;
@ -26,7 +26,7 @@ export function getOrdersWithStatus(status, channelSlug) {
}
export function getProductsOutOfStock(channelSlug) {
const query = `query{
products(stockAvailability: OUT_OF_STOCK, channel:"${channelSlug}"){
products(filter: { stockAvailability: OUT_OF_STOCK, channel:"${channelSlug}" }){
totalCount
}
}`;

View file

@ -10,13 +10,18 @@ describe("Sorting products", () => {
cy.clearSessionData()
.loginUserViaRequest()
.visit(urlList.products);
cy.get(SHARED_ELEMENTS.header).should("be.visible");
if (sortBy !== "name") {
cy.get(PRODUCTS_LIST.tableHeaders[sortBy]).click();
cy.get(SHARED_ELEMENTS.progressBar).should("not.exist");
}
expectProductsSortedBy(sortBy);
cy.get(PRODUCTS_LIST.tableHeaders[sortBy]).click();
cy.get(SHARED_ELEMENTS.progressBar).should("not.exist");
cy.addAliasToGraphRequest("ProductList")
.get(PRODUCTS_LIST.tableHeaders[sortBy])
.click()
.get(SHARED_ELEMENTS.progressBar)
.should("not.exist")
.wait("@ProductList");
expectProductsSortedBy(sortBy, false);
});
});

View file

@ -1,4 +1,5 @@
import * as homePage from "../apiRequests/HomePage";
import { getDatePeriod } from "./misc";
export function getOrdersReadyToFulfill(channelSlug) {
return homePage
@ -21,7 +22,9 @@ export function getSalesAmount(channelSlug) {
.its("body.data.ordersTotal.gross.amount");
}
export function getTodaysOrders(channelSlug) {
const today = getDatePeriod(1);
return homePage
.getOrdersForChannel(channelSlug, "TODAY")
.getOrdersForChannel(channelSlug, today)
.its("body.data.orders.totalCount");
}

16
cypress/utils/misc.js Normal file
View file

@ -0,0 +1,16 @@
import moment from "moment-timezone";
export function getDatePeriod(days) {
if (days < 1) {
return {};
}
const end = moment().startOf("day");
const start = end.subtract(days - 1);
const format = "YYYY-MM-DD";
return {
gte: start.format(format),
lte: end.format(format)
};
}

View file

@ -14,10 +14,16 @@ export function getDisplayedColumnArray(columnName) {
.then(() => productsList);
}
export function expectProductsSortedBy(columnName, inAscOrder = true) {
getDisplayedColumnArray(columnName).then(productsArray => {
let sortedProductsArray = productsArray.slice();
let sortedProductsArray;
let productsArray;
getDisplayedColumnArray(columnName)
.then(productsArrayResp => {
productsArray = productsArrayResp;
sortedProductsArray = productsArray.slice();
if (columnName !== "price") {
sortedProductsArray.sort();
sortedProductsArray = sortedProductsArray.sort((a, b) =>
a.localeCompare(b, undefined, { ignorePunctuation: true })
);
if (!inAscOrder) {
sortedProductsArray.reverse();
}
@ -27,7 +33,11 @@ export function expectProductsSortedBy(columnName, inAscOrder = true) {
inAscOrder
);
}
expect(productsArray).to.be.deep.eq(sortedProductsArray);
})
.then(() => {
expect(
JSON.stringify(productsArray) === JSON.stringify(sortedProductsArray)
).to.be.eq(true);
});
}
function getSortedPriceColumn(productsArray, inAscOrder) {

View file

@ -484,14 +484,14 @@
"context": "dialog header",
"string": "Activate App"
},
"src_dot_apps_dot_components_dot_AppActivateDialog_dot_2449960665": {
"context": "activate app",
"string": "Are you sure you want to activate this app? Activating will start gathering events."
},
"src_dot_apps_dot_components_dot_AppActivateDialog_dot_3356885734": {
"context": "activate app",
"string": "Are you sure you want to activate {name}? Activating will start gathering events."
},
"src_dot_apps_dot_components_dot_AppActivateDialog_dot_3761045983": {
"context": "activate app",
"string": "Are you sure you want to activate this app? Activating will start gathering events"
},
"src_dot_apps_dot_components_dot_AppActivateDialog_dot_3865193889": {
"context": "button label",
"string": "Activate"
@ -504,12 +504,20 @@
"context": "dialog header",
"string": "Dectivate App"
},
"src_dot_apps_dot_components_dot_AppDeactivateDialog_dot_2955925498": {
"src_dot_apps_dot_components_dot_AppDeactivateDialog_dot_deactivateApp": {
"context": "deactivate app",
"string": "Are you sure you want to disable this app? Your data will be kept until you reactivate the app. You will be still billed for the app."
},
"src_dot_apps_dot_components_dot_AppDeactivateDialog_dot_329373780": {
"context": "deactivate app",
"src_dot_apps_dot_components_dot_AppDeactivateDialog_dot_deactivateLocalApp": {
"context": "deactivate local app",
"string": "Are you sure you want to disable this app? Your data will be kept until you reactivate the app."
},
"src_dot_apps_dot_components_dot_AppDeactivateDialog_dot_deactivateLocalNamedApp": {
"context": "deactivate local named app",
"string": "Are you sure you want to disable {name}? Your data will be kept until you reactivate the app."
},
"src_dot_apps_dot_components_dot_AppDeactivateDialog_dot_deactivateNamedApp": {
"context": "deactivate named app",
"string": "Are you sure you want to disable {name}? Your data will be kept until you reactivate the app. You will be still billed for the app."
},
"src_dot_apps_dot_components_dot_AppDeleteDialog_dot_1347203024": {
@ -656,10 +664,6 @@
"context": "header",
"string": "Create New App"
},
"src_dot_apps_dot_components_dot_CustomAppCreatePage_dot_570656367": {
"context": "checkbox label",
"string": "App is active"
},
"src_dot_apps_dot_components_dot_CustomAppDefaultToken_dot_1336855942": {
"string": "Generated Token"
},
@ -681,13 +685,17 @@
"context": "checkbox label",
"string": "Grant this app full access to the store"
},
"src_dot_apps_dot_components_dot_CustomAppDetailsPage_dot_1782042241": {
"context": "link",
"string": "Deactivate"
},
"src_dot_apps_dot_components_dot_CustomAppDetailsPage_dot_3076071936": {
"context": "card description",
"string": "Expand or restrict app permissions to access certain part of Saleor system."
},
"src_dot_apps_dot_components_dot_CustomAppDetailsPage_dot_570656367": {
"context": "checkbox label",
"string": "App is active"
"src_dot_apps_dot_components_dot_CustomAppDetailsPage_dot_3865193889": {
"context": "link",
"string": "Activate"
},
"src_dot_apps_dot_components_dot_CustomAppInformation_dot_2860466085": {
"context": "header",
@ -827,6 +835,14 @@
"context": "window title",
"string": "Create App"
},
"src_dot_apps_dot_views_dot_CustomAppDetails_dot_2021043385": {
"context": "snackbar text",
"string": "App activated"
},
"src_dot_apps_dot_views_dot_CustomAppDetails_dot_3791371350": {
"context": "snackbar text",
"string": "App deactivated"
},
"src_dot_attributes": {
"context": "attributes section name",
"string": "Attributes"
@ -3877,6 +3893,10 @@
"context": "vat included in order price",
"string": "VAT included"
},
"src_dot_orders_dot_components_dot_OrderPayment_dot_1934027242": {
"context": "voucher type order discount",
"string": "Voucher"
},
"src_dot_orders_dot_components_dot_OrderPayment_dot_2183023165": {
"context": "ordered products",
"string": "{quantity} items"
@ -3885,6 +3905,10 @@
"context": "order payment",
"string": "Captured amount"
},
"src_dot_orders_dot_components_dot_OrderPayment_dot_2392156856": {
"context": "staff added type order discount",
"string": "Staff added"
},
"src_dot_orders_dot_components_dot_OrderPayment_dot_2444197639": {
"context": "void payment, button",
"string": "Void"

View file

@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "a2b8a02f624e52cd2b73a831f65d9a52",
"_id": "4062f0ffdf1fab89a50cd1b667a889ef",
"_order": 0,
"cache": {},
"request": {
"bodySize": 598,
"bodySize": 583,
"cookies": [],
"headers": [
{
@ -28,7 +28,7 @@
{
"_fromType": "array",
"name": "content-length",
"value": "598"
"value": "583"
},
{
"_fromType": "array",
@ -50,13 +50,13 @@
"value": "localhost:8000"
}
],
"headersSize": 254,
"headersSize": 281,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "[{\"operationName\":\"TokenAuth\",\"variables\":{\"email\":\"admin@example.com\",\"password\":\"admin\"},\"query\":\"fragment User on User {\\n id\\n email\\n firstName\\n lastName\\n isStaff\\n userPermissions {\\n code\\n name\\n __typename\\n }\\n avatar {\\n url\\n __typename\\n }\\n __typename\\n}\\n\\nmutation TokenAuth($email: String!, $password: String!) {\\n tokenCreate(email: $email, password: $password) {\\n errors: accountErrors {\\n field\\n message\\n __typename\\n }\\n csrfToken\\n token\\n user {\\n ...User\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}]"
"text": "[{\"operationName\":\"TokenAuth\",\"variables\":{\"email\":\"admin@example.com\",\"password\":\"admin\"},\"query\":\"fragment User on User {\\n id\\n email\\n firstName\\n lastName\\n isStaff\\n userPermissions {\\n code\\n name\\n __typename\\n }\\n avatar {\\n url\\n __typename\\n }\\n __typename\\n}\\n\\nmutation TokenAuth($email: String!, $password: String!) {\\n tokenCreate(email: $email, password: $password) {\\n errors {\\n field\\n message\\n __typename\\n }\\n csrfToken\\n token\\n user {\\n ...User\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}]"
},
"queryString": [],
"url": "http://localhost:8000/graphql/"
@ -113,8 +113,8 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2021-01-14T13:55:44.094Z",
"time": 392,
"startedDateTime": "2021-04-22T11:07:20.652Z",
"time": 758,
"timings": {
"blocked": -1,
"connect": -1,
@ -122,7 +122,7 @@
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 392
"wait": 758
}
}
],

View file

@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "d94d7821dc951e48c410d691d7eccdef",
"_id": "6fed086670e88883223acb33bab4ff31",
"_order": 0,
"cache": {},
"request": {
"bodySize": 614,
"bodySize": 599,
"cookies": [],
"headers": [
{
@ -28,7 +28,7 @@
{
"_fromType": "array",
"name": "content-length",
"value": "614"
"value": "599"
},
{
"_fromType": "array",
@ -50,13 +50,13 @@
"value": "localhost:8000"
}
],
"headersSize": 254,
"headersSize": 281,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "[{\"operationName\":\"TokenAuth\",\"variables\":{\"email\":\"admin@example.com\",\"password\":\"NotAValidPassword123!\"},\"query\":\"fragment User on User {\\n id\\n email\\n firstName\\n lastName\\n isStaff\\n userPermissions {\\n code\\n name\\n __typename\\n }\\n avatar {\\n url\\n __typename\\n }\\n __typename\\n}\\n\\nmutation TokenAuth($email: String!, $password: String!) {\\n tokenCreate(email: $email, password: $password) {\\n errors: accountErrors {\\n field\\n message\\n __typename\\n }\\n csrfToken\\n token\\n user {\\n ...User\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}]"
"text": "[{\"operationName\":\"TokenAuth\",\"variables\":{\"email\":\"admin@example.com\",\"password\":\"NotAValidPassword123!\"},\"query\":\"fragment User on User {\\n id\\n email\\n firstName\\n lastName\\n isStaff\\n userPermissions {\\n code\\n name\\n __typename\\n }\\n avatar {\\n url\\n __typename\\n }\\n __typename\\n}\\n\\nmutation TokenAuth($email: String!, $password: String!) {\\n tokenCreate(email: $email, password: $password) {\\n errors {\\n field\\n message\\n __typename\\n }\\n csrfToken\\n token\\n user {\\n ...User\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}]"
},
"queryString": [],
"url": "http://localhost:8000/graphql/"
@ -66,7 +66,7 @@
"content": {
"mimeType": "application/json",
"size": 214,
"text": "[{\"data\": {\"tokenCreate\": {\"errors\": [{\"field\": \"email\", \"message\": \"Please, enter valid credentials\", \"__typename\": \"AccountError\"}], \"csrfToken\": null, \"token\": null, \"user\": null, \"__typename\": \"CreateToken\"}}}]"
"text": "[{\"data\": {\"tokenCreate\": {\"errors\": [{\"field\": \"email\", \"message\": \"Please, enter valid credentials\", \"__typename\": \"Error\"}], \"csrfToken\": null, \"token\": null, \"user\": null, \"__typename\": \"CreateToken\"}}}]"
},
"cookies": [],
"headers": [
@ -101,8 +101,8 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2021-01-14T13:55:44.521Z",
"time": 1183,
"startedDateTime": "2021-04-22T11:09:20.963Z",
"time": 555,
"timings": {
"blocked": -1,
"connect": -1,
@ -110,7 +110,7 @@
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 1183
"wait": 555
}
}
],

View file

@ -8,11 +8,11 @@
},
"entries": [
{
"_id": "0b09ec35ecae5b17a2ccda062b1d6ef5",
"_id": "8948f5cbe2259e56b6dd03f068fbfa4d",
"_order": 0,
"cache": {},
"request": {
"bodySize": 602,
"bodySize": 587,
"cookies": [],
"headers": [
{
@ -28,7 +28,7 @@
{
"_fromType": "array",
"name": "content-length",
"value": "602"
"value": "587"
},
{
"_fromType": "array",
@ -50,13 +50,13 @@
"value": "localhost:8000"
}
],
"headersSize": 254,
"headersSize": 281,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "[{\"operationName\":\"TokenAuth\",\"variables\":{\"email\":\"client@example.com\",\"password\":\"password\"},\"query\":\"fragment User on User {\\n id\\n email\\n firstName\\n lastName\\n isStaff\\n userPermissions {\\n code\\n name\\n __typename\\n }\\n avatar {\\n url\\n __typename\\n }\\n __typename\\n}\\n\\nmutation TokenAuth($email: String!, $password: String!) {\\n tokenCreate(email: $email, password: $password) {\\n errors: accountErrors {\\n field\\n message\\n __typename\\n }\\n csrfToken\\n token\\n user {\\n ...User\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}]"
"text": "[{\"operationName\":\"TokenAuth\",\"variables\":{\"email\":\"client@example.com\",\"password\":\"password\"},\"query\":\"fragment User on User {\\n id\\n email\\n firstName\\n lastName\\n isStaff\\n userPermissions {\\n code\\n name\\n __typename\\n }\\n avatar {\\n url\\n __typename\\n }\\n __typename\\n}\\n\\nmutation TokenAuth($email: String!, $password: String!) {\\n tokenCreate(email: $email, password: $password) {\\n errors {\\n field\\n message\\n __typename\\n }\\n csrfToken\\n token\\n user {\\n ...User\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}]"
},
"queryString": [],
"url": "http://localhost:8000/graphql/"
@ -113,8 +113,8 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2021-01-19T14:28:37.164Z",
"time": 468,
"startedDateTime": "2021-04-22T11:09:21.540Z",
"time": 382,
"timings": {
"blocked": -1,
"connect": -1,
@ -122,7 +122,7 @@
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 468
"wait": 382
}
}
],

File diff suppressed because it is too large Load diff

View file

@ -41,7 +41,7 @@ const AppActivateDialog: React.FC<AppActivateDialogProps> = ({
<DialogContentText>
{["", null].includes(name) ? (
<FormattedMessage
defaultMessage="Are you sure you want to activate this app? Activating will start gathering events"
defaultMessage="Are you sure you want to activate this app? Activating will start gathering events."
description="activate app"
/>
) : (

View file

@ -5,10 +5,13 @@ import { getStringOrPlaceholder } from "@saleor/misc";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import msgs from "./messages";
export interface AppDeactivateDialogProps {
confirmButtonState: ConfirmButtonTransitionState;
open: boolean;
name: string;
thirdParty?: boolean;
onClose: () => void;
onConfirm: () => void;
}
@ -17,6 +20,7 @@ const AppDeactivateDialog: React.FC<AppDeactivateDialogProps> = ({
confirmButtonState,
open,
name,
thirdParty = true,
onClose,
onConfirm
}) => {
@ -41,13 +45,13 @@ const AppDeactivateDialog: React.FC<AppDeactivateDialogProps> = ({
<DialogContentText>
{["", null].includes(name) ? (
<FormattedMessage
defaultMessage="Are you sure you want to disable this app? Your data will be kept until you reactivate the app. You will be still billed for the app."
description="deactivate app"
{...(thirdParty ? msgs.deactivateApp : msgs.deactivateLocalApp)}
/>
) : (
<FormattedMessage
defaultMessage="Are you sure you want to disable {name}? Your data will be kept until you reactivate the app. You will be still billed for the app."
description="deactivate app"
{...(thirdParty
? msgs.deactivateNamedApp
: msgs.deactivateLocalNamedApp)}
values={{
name: <strong>{getStringOrPlaceholder(name)}</strong>
}}

View file

@ -0,0 +1,24 @@
import { defineMessages } from "react-intl";
export default defineMessages({
deactivateApp: {
defaultMessage:
"Are you sure you want to disable this app? Your data will be kept until you reactivate the app. You will be still billed for the app.",
description: "deactivate app"
},
deactivateNamedApp: {
defaultMessage:
"Are you sure you want to disable {name}? Your data will be kept until you reactivate the app. You will be still billed for the app.",
description: "deactivate named app"
},
deactivateLocalApp: {
defaultMessage:
"Are you sure you want to disable this app? Your data will be kept until you reactivate the app.",
description: "deactivate local app"
},
deactivateLocalNamedApp: {
defaultMessage:
"Are you sure you want to disable {name}? Your data will be kept until you reactivate the app.",
description: "deactivate local named app"
}
});

View file

@ -1,7 +1,5 @@
import AccountPermissions from "@saleor/components/AccountPermissions";
import AppHeader from "@saleor/components/AppHeader";
import AppStatus from "@saleor/components/AppStatus";
import CardSpacer from "@saleor/components/CardSpacer";
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
import Container from "@saleor/components/Container";
import Form from "@saleor/components/Form";
@ -21,7 +19,6 @@ import CustomAppInformation from "../CustomAppInformation";
export interface CustomAppCreatePageFormData {
hasFullAccess: boolean;
isActive: boolean;
name: string;
permissions: PermissionEnum[];
}
@ -47,7 +44,6 @@ const CustomAppCreatePage: React.FC<CustomAppCreatePageProps> = props => {
const initialForm: CustomAppCreatePageFormData = {
hasFullAccess: false,
isActive: false,
name: "",
permissions: []
};
@ -94,16 +90,6 @@ const CustomAppCreatePage: React.FC<CustomAppCreatePageProps> = props => {
description: "card description"
})}
/>
<CardSpacer />
<AppStatus
data={data}
disabled={disabled}
label={intl.formatMessage({
defaultMessage: "App is active",
description: "checkbox label"
})}
onChange={change}
/>
</Grid>
<SaveButtonBar
disabled={disabled || !hasChanged}

View file

@ -1,6 +1,6 @@
import Button from "@material-ui/core/Button";
import AccountPermissions from "@saleor/components/AccountPermissions";
import AppHeader from "@saleor/components/AppHeader";
import AppStatus from "@saleor/components/AppStatus";
import CardSpacer from "@saleor/components/CardSpacer";
import { ConfirmButtonTransitionState } from "@saleor/components/ConfirmButton";
import Container from "@saleor/components/Container";
@ -17,8 +17,10 @@ import { getFormErrors } from "@saleor/utils/errors";
import getAppErrorMessage from "@saleor/utils/errors/app";
import WebhooksList from "@saleor/webhooks/components/WebhooksList";
import React from "react";
import { useIntl } from "react-intl";
import { FormattedMessage, useIntl } from "react-intl";
import activateIcon from "../../../../assets/images/activate-icon.svg";
import { useStyles } from "../../styles";
import { AppUpdate_appUpdate_app } from "../../types/AppUpdate";
import CustomAppDefaultToken from "../CustomAppDefaultToken";
import CustomAppInformation from "../CustomAppInformation";
@ -47,6 +49,8 @@ export interface CustomAppDetailsPageProps {
onWebhookCreate: () => void;
onWebhookRemove: (id: string) => void;
navigateToWebhookDetails: (id: string) => () => void;
onAppActivateOpen: () => void;
onAppDeactivateOpen: () => void;
}
const CustomAppDetailsPage: React.FC<CustomAppDetailsPageProps> = props => {
@ -66,9 +70,12 @@ const CustomAppDetailsPage: React.FC<CustomAppDetailsPageProps> = props => {
onTokenDelete,
onSubmit,
onWebhookCreate,
onWebhookRemove
onWebhookRemove,
onAppActivateOpen,
onAppDeactivateOpen
} = props;
const intl = useIntl();
const classes = useStyles({});
const webhooks = app?.webhooks;
@ -94,7 +101,28 @@ const CustomAppDetailsPage: React.FC<CustomAppDetailsPageProps> = props => {
<AppHeader onBack={onBack}>
{intl.formatMessage(sectionNames.apps)}
</AppHeader>
<PageHeader title={app?.name} />
<PageHeader title={app?.name}>
<Button
variant="text"
color="primary"
className={classes.activateButton}
disableFocusRipple
onClick={data.isActive ? onAppDeactivateOpen : onAppActivateOpen}
>
<img src={activateIcon} alt="" />
{data?.isActive ? (
<FormattedMessage
defaultMessage="Deactivate"
description="link"
/>
) : (
<FormattedMessage
defaultMessage="Activate"
description="link"
/>
)}
</Button>
</PageHeader>
<Grid>
<div>
{token && (
@ -146,16 +174,6 @@ const CustomAppDetailsPage: React.FC<CustomAppDetailsPageProps> = props => {
description: "card description"
})}
/>
<CardSpacer />
<AppStatus
data={data}
disabled={disabled}
label={intl.formatMessage({
defaultMessage: "App is active",
description: "checkbox label"
})}
onChange={change}
/>
</div>
</Grid>
<SaveButtonBar

View file

@ -38,7 +38,7 @@ export const appCreateMutation = gql`
app {
...AppFragment
}
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -54,7 +54,7 @@ export const appDeleteMutation = gql`
app {
...AppFragment
}
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -71,7 +71,7 @@ export const appDeleteFailedInstallationMutation = gql`
appName
message
}
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -99,7 +99,7 @@ export const appFetchMutation = gql`
name
}
}
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -116,7 +116,7 @@ export const appInstallMutation = gql`
appName
manifestUrl
}
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -133,29 +133,7 @@ export const appRetryInstallMutation = gql`
appName
manifestUrl
}
errors: appErrors {
...AppErrorFragment
}
}
}
`;
export const appActivateMutation = gql`
${appErrorFragment}
mutation AppActivate($id: ID!) {
appActivate(id: $id) {
errors: appErrors {
...AppErrorFragment
}
}
}
`;
export const appDeactivateMutation = gql`
${appErrorFragment}
mutation AppDeactivate($id: ID!) {
appDeactivate(id: $id) {
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -175,7 +153,7 @@ export const appUpdateMutation = gql`
name
}
}
errors: appErrors {
errors {
...AppErrorFragment
message
permissions
@ -194,7 +172,7 @@ export const appTokenCreateMutation = gql`
id
}
authToken
errors: appErrors {
errors {
...AppErrorFragment
}
}
@ -210,7 +188,29 @@ export const appTokenDeleteMutation = gql`
authToken
id
}
errors: appErrors {
errors {
...AppErrorFragment
}
}
}
`;
export const appActivateMutation = gql`
${appErrorFragment}
mutation AppActivate($id: ID!) {
appActivate(id: $id) {
errors {
...AppErrorFragment
}
}
}
`;
export const appDeactivateMutation = gql`
${appErrorFragment}
mutation AppDeactivate($id: ID!) {
appDeactivate(id: $id) {
errors {
...AppErrorFragment
}
}

View file

@ -198,6 +198,11 @@ export const useStyles = makeStyles(
flex: 1,
fontWeight: 500,
lineHeight: 1
},
activateButton: {
"& img": {
marginRight: theme.spacing(1)
}
}
}),
{ name: "AppList" }

View file

@ -27,7 +27,9 @@ export enum AppListUrlSortField {
export type CustomAppUrlDialog =
| "create-token"
| "remove-webhook"
| "remove-token";
| "remove-token"
| "app-activate"
| "app-deactivate";
export type CustomAppUrlQueryParams = Dialog<CustomAppUrlDialog> & SingleAction;
export const appsSection = "/apps/";

View file

@ -45,7 +45,6 @@ export const CustomAppCreate: React.FC<CustomAppCreateProps> = ({
createApp({
variables: {
input: {
isActive: data.isActive,
name: data.name,
permissions: data.hasFullAccess
? shop.permissions.map(permission => permission.code)

View file

@ -1,3 +1,5 @@
import AppActivateDialog from "@saleor/apps/components/AppActivateDialog";
import AppDeactivateDialog from "@saleor/apps/components/AppDeactivateDialog";
import TokenCreateDialog from "@saleor/apps/components/TokenCreateDialog";
import TokenDeleteDialog from "@saleor/apps/components/TokenDeleteDialog";
import NotFoundPage from "@saleor/components/NotFoundPage";
@ -8,6 +10,7 @@ import useNotifier from "@saleor/hooks/useNotifier";
import useShop from "@saleor/hooks/useShop";
import { commonMessages } from "@saleor/intl";
import { getStringOrPlaceholder } from "@saleor/misc";
import getAppErrorMessage from "@saleor/utils/errors/app";
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
import WebhookDeleteDialog from "@saleor/webhooks/components/WebhookDeleteDialog";
import { useWebhookDeleteMutation } from "@saleor/webhooks/mutations";
@ -20,6 +23,8 @@ import CustomAppDetailsPage, {
CustomAppDetailsPageFormData
} from "../../components/CustomAppDetailsPage";
import {
useAppActivateMutation,
useAppDeactivateMutation,
useAppTokenCreateMutation,
useAppTokenDeleteMutation,
useAppUpdateMutation
@ -64,6 +69,52 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
displayLoader: true,
variables: { id }
});
const [activateApp, activateAppResult] = useAppActivateMutation({
onCompleted: data => {
const errors = data?.appActivate?.errors;
if (errors?.length === 0) {
notify({
status: "success",
text: intl.formatMessage({
defaultMessage: "App activated",
description: "snackbar text"
})
});
refetch();
closeModal();
} else {
errors.forEach(error =>
notify({
status: "error",
text: getAppErrorMessage(error, intl)
})
);
}
}
});
const [deactivateApp, deactivateAppResult] = useAppDeactivateMutation({
onCompleted: data => {
const errors = data?.appDeactivate?.errors;
if (errors.length === 0) {
notify({
status: "success",
text: intl.formatMessage({
defaultMessage: "App deactivated",
description: "snackbar text"
})
});
refetch();
closeModal();
} else {
errors.forEach(error =>
notify({
status: "error",
text: getAppErrorMessage(error, intl)
})
);
}
}
});
const onWebhookDelete = (data: WebhookDelete) => {
if (data.webhookDelete.errors.length === 0) {
@ -135,7 +186,6 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
variables: {
id,
input: {
isActive: data.isActive,
name: data.name,
permissions: data.hasFullAccess
? shop.permissions.map(permission => permission.code)
@ -164,6 +214,13 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
}
});
const handleActivateConfirm = () => {
activateApp({ variables: { id } });
};
const handleDeactivateConfirm = () => {
deactivateApp({ variables: { id } });
};
const currentToken = data?.app?.tokens?.find(token => token.id === params.id);
return (
@ -191,6 +248,8 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
id
})
}
onAppActivateOpen={() => openModal("app-activate")}
onAppDeactivateOpen={() => openModal("app-deactivate")}
permissions={shop?.permissions}
app={data?.app}
saveButtonBarState={updateAppOpts.status}
@ -222,6 +281,21 @@ export const CustomAppDetails: React.FC<OrderListProps> = ({
onConfirm={handleRemoveWebhookConfirm}
open={params.action === "remove-webhook"}
/>
<AppActivateDialog
confirmButtonState={activateAppResult.status}
name={data?.app.name}
onClose={closeModal}
onConfirm={handleActivateConfirm}
open={params.action === "app-activate"}
/>
<AppDeactivateDialog
confirmButtonState={deactivateAppResult.status}
name={data?.app.name}
onClose={closeModal}
onConfirm={handleDeactivateConfirm}
thirdParty={false}
open={params.action === "app-deactivate"}
/>
</>
);
};

View file

@ -40,7 +40,7 @@ const attributeBulkDelete = gql`
${attributeErrorFragment}
mutation AttributeBulkDelete($ids: [ID!]!) {
attributeBulkDelete(ids: $ids) {
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -55,7 +55,7 @@ const attributeDelete = gql`
${attributeErrorFragment}
mutation AttributeDelete($id: ID!) {
attributeDelete(id: $id) {
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -74,7 +74,7 @@ export const attributeUpdateMutation = gql`
attribute {
...AttributeDetailsFragment
}
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -93,7 +93,7 @@ const attributeValueDelete = gql`
attribute {
...AttributeDetailsFragment
}
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -112,7 +112,7 @@ export const attributeValueUpdateMutation = gql`
attribute {
...AttributeDetailsFragment
}
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -131,7 +131,7 @@ export const attributeValueCreateMutation = gql`
attribute {
...AttributeDetailsFragment
}
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -150,7 +150,7 @@ export const attributeCreateMutation = gql`
attribute {
...AttributeDetailsFragment
}
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}
@ -171,7 +171,7 @@ const attributeValueReorderMutation = gql`
id
}
}
errors: attributeErrors {
errors {
...AttributeErrorFragment
}
}

View file

@ -110,7 +110,7 @@ export const mergeFileUploadErrors = (
uploadFilesResult: Array<MutationFetchResult<FileUpload>>
): UploadErrorFragment[] =>
uploadFilesResult.reduce((errors, uploadFileResult) => {
const uploadErrors = uploadFileResult?.data?.fileUpload?.uploadErrors;
const uploadErrors = uploadFileResult?.data?.fileUpload?.errors;
if (uploadErrors) {
return [...errors, ...uploadErrors];
}

View file

@ -13,7 +13,7 @@ export const tokenAuthMutation = gql`
${fragmentUser}
mutation TokenAuth($email: String!, $password: String!) {
tokenCreate(email: $email, password: $password) {
errors: accountErrors {
errors {
field
message
}
@ -50,7 +50,7 @@ export const requestPasswordReset = gql`
${accountErrorFragment}
mutation RequestPasswordReset($email: String!, $redirectUrl: String!) {
requestPasswordReset(email: $email, redirectUrl: $redirectUrl) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
}
@ -66,7 +66,7 @@ export const setPassword = gql`
${fragmentUser}
mutation SetPassword($email: String!, $password: String!, $token: String!) {
setPassword(email: $email, password: $password, token: $token) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
csrfToken
@ -88,7 +88,7 @@ export const externalAuthenticationUrlMutation = gql`
mutation ExternalAuthenticationUrl($pluginId: String!, $input: JSONString!) {
externalAuthenticationUrl(pluginId: $pluginId, input: $input) {
authenticationData
errors: accountErrors {
errors {
...AccountErrorFragment
}
}
@ -105,7 +105,7 @@ export const externalObtainAccessTokensMutation = gql`
user {
...User
}
errors: accountErrors {
errors {
...AccountErrorFragment
}
}

View file

@ -24,7 +24,7 @@ export const categoryDeleteMutation = gql`
${productErrorFragment}
mutation CategoryDelete($id: ID!) {
categoryDelete(id: $id) {
errors: productErrors {
errors {
...ProductErrorFragment
}
}
@ -43,7 +43,7 @@ export const categoryCreateMutation = gql`
category {
...CategoryDetailsFragment
}
errors: productErrors {
errors {
...ProductErrorFragment
}
}
@ -62,7 +62,7 @@ export const categoryUpdateMutation = gql`
category {
...CategoryDetailsFragment
}
errors: productErrors {
errors {
...ProductErrorFragment
}
}
@ -77,7 +77,7 @@ export const categoryBulkDeleteMutation = gql`
${productErrorFragment}
mutation CategoryBulkDelete($ids: [ID]!) {
categoryBulkDelete(ids: $ids) {
errors: productErrors {
errors {
...ProductErrorFragment
}
}

View file

@ -25,7 +25,7 @@ export const channelCreateMutation = gql`
channel {
...ChannelDetailsFragment
}
errors: channelErrors {
errors {
...ChannelErrorFragment
}
}
@ -40,7 +40,7 @@ export const channelUpdateMutation = gql`
channel {
...ChannelDetailsFragment
}
errors: channelErrors {
errors {
...ChannelErrorFragment
}
}
@ -51,7 +51,7 @@ export const channelDeleteMutation = gql`
${channelErrorFragment}
mutation ChannelDelete($id: ID!, $input: ChannelDeleteInput) {
channelDelete(id: $id, input: $input) {
errors: channelErrors {
errors {
...ChannelErrorFragment
}
}
@ -66,7 +66,7 @@ export const channelActivateMutation = gql`
channel {
...ChannelDetailsFragment
}
errors: channelErrors {
errors {
...ChannelErrorFragment
}
}
@ -81,7 +81,7 @@ export const channelDeactivateMutation = gql`
channel {
...ChannelDetailsFragment
}
errors: channelErrors {
errors {
...ChannelErrorFragment
}
}

View file

@ -46,7 +46,7 @@ const collectionUpdate = gql`
collection {
...CollectionDetailsFragment
}
errors: collectionErrors {
errors {
...CollectionErrorFragment
}
}
@ -85,7 +85,7 @@ const assignCollectionProduct = gql`
}
}
}
errors: collectionErrors {
errors {
...CollectionErrorFragment
}
}
@ -104,7 +104,7 @@ const createCollection = gql`
collection {
...CollectionDetailsFragment
}
errors: collectionErrors {
errors {
...CollectionErrorFragment
}
}
@ -119,7 +119,7 @@ const removeCollection = gql`
${collectionsErrorFragment}
mutation RemoveCollection($id: ID!) {
collectionDelete(id: $id) {
errors: collectionErrors {
errors {
...CollectionErrorFragment
}
}
@ -168,7 +168,7 @@ const unassignCollectionProduct = gql`
}
}
}
errors: collectionErrors {
errors {
...CollectionErrorFragment
}
}
@ -183,7 +183,7 @@ const collectionBulkDelete = gql`
${collectionsErrorFragment}
mutation CollectionBulkDelete($ids: [ID]!) {
collectionBulkDelete(ids: $ids) {
errors: collectionErrors {
errors {
...CollectionErrorFragment
}
}
@ -201,7 +201,7 @@ const collectionChannelListingUpdate = gql`
$input: CollectionChannelListingUpdateInput!
) {
collectionChannelListingUpdate(id: $id, input: $input) {
errors: collectionChannelListingErrors {
errors {
...CollectionChannelListingErrorFragment
}
}

View file

@ -45,7 +45,7 @@ const updateCustomer = gql`
${customerDetailsFragment}
mutation UpdateCustomer($id: ID!, $input: CustomerInput!) {
customerUpdate(id: $id, input: $input) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
user {
@ -63,7 +63,7 @@ const createCustomer = gql`
${accountErrorFragment}
mutation CreateCustomer($input: UserCreateInput!) {
customerCreate(input: $input) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
user {
@ -81,7 +81,7 @@ const removeCustomer = gql`
${accountErrorFragment}
mutation RemoveCustomer($id: ID!) {
customerDelete(id: $id) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
}
@ -101,7 +101,7 @@ const setCustomerDefaultAddress = gql`
$type: AddressTypeEnum!
) {
addressSetDefault(addressId: $addressId, userId: $userId, type: $type) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
user {
@ -121,7 +121,7 @@ const createCustomerAddress = gql`
${fragmentAddress}
mutation CreateCustomerAddress($id: ID!, $input: AddressInput!) {
addressCreate(userId: $id, input: $input) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
address {
@ -143,7 +143,7 @@ const updateCustomerAddress = gql`
${fragmentAddress}
mutation UpdateCustomerAddress($id: ID!, $input: AddressInput!) {
addressUpdate(id: $id, input: $input) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
address {
@ -162,7 +162,7 @@ const removeCustomerAddress = gql`
${customerAddressesFragment}
mutation RemoveCustomerAddress($id: ID!) {
addressDelete(id: $id) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
user {
@ -180,7 +180,7 @@ export const bulkRemoveCustomers = gql`
${accountErrorFragment}
mutation BulkRemoveCustomers($ids: [ID]!) {
customerBulkDelete(ids: $ids) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
}

View file

@ -53,7 +53,7 @@ const saleUpdate = gql`
${saleFragment}
mutation SaleUpdate($input: SaleInput!, $id: ID!) {
saleUpdate(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
sale {
@ -78,7 +78,7 @@ const saleCataloguesAdd = gql`
$last: Int
) {
saleCataloguesAdd(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
sale {
@ -104,7 +104,7 @@ const saleCataloguesRemove = gql`
$last: Int
) {
saleCataloguesRemove(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
sale {
@ -123,7 +123,7 @@ const saleCreate = gql`
${saleFragment}
mutation SaleCreate($input: SaleInput!) {
saleCreate(input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
sale {
@ -140,7 +140,7 @@ const saleDelete = gql`
${discountErrorFragment}
mutation SaleDelete($id: ID!) {
saleDelete(id: $id) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
}
@ -173,7 +173,7 @@ const saleChannelListingUpdate = gql`
$input: SaleChannelListingInput!
) {
saleChannelListingUpdate(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
sale {
@ -195,7 +195,7 @@ const voucherChannelListingUpdate = gql`
$input: VoucherChannelListingInput!
) {
voucherChannelListingUpdate(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
voucher {
@ -214,7 +214,7 @@ const voucherUpdate = gql`
${voucherFragment}
mutation VoucherUpdate($input: VoucherInput!, $id: ID!) {
voucherUpdate(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
voucher {
@ -240,7 +240,7 @@ const voucherCataloguesAdd = gql`
$last: Int
) {
voucherCataloguesAdd(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
voucher {
@ -266,7 +266,7 @@ const voucherCataloguesRemove = gql`
$last: Int
) {
voucherCataloguesRemove(id: $id, input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
voucher {
@ -285,7 +285,7 @@ const voucherCreate = gql`
${voucherFragment}
mutation VoucherCreate($input: VoucherInput!) {
voucherCreate(input: $input) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
voucher {
@ -303,7 +303,7 @@ const voucherDelete = gql`
${discountErrorFragment}
mutation VoucherDelete($id: ID!) {
voucherDelete(id: $id) {
errors: discountErrors {
errors {
...DiscountErrorFragment
}
}

View file

@ -8,7 +8,7 @@
// ====================================================
export interface SaleBulkDelete_saleBulkDelete_errors {
__typename: "Error";
__typename: "DiscountError";
field: string | null;
message: string | null;
}

View file

@ -8,7 +8,7 @@
// ====================================================
export interface VoucherBulkDelete_voucherBulkDelete_errors {
__typename: "Error";
__typename: "DiscountError";
field: string | null;
message: string | null;
}

View file

@ -13,7 +13,7 @@ const fileUploadMutation = gql`
uploadedFile {
...FileFragment
}
uploadErrors {
errors {
...UploadErrorFragment
}
}

View file

@ -15,7 +15,7 @@ export interface FileUpload_fileUpload_uploadedFile {
contentType: string | null;
}
export interface FileUpload_fileUpload_uploadErrors {
export interface FileUpload_fileUpload_errors {
__typename: "UploadError";
code: UploadErrorCode;
field: string | null;
@ -24,7 +24,7 @@ export interface FileUpload_fileUpload_uploadErrors {
export interface FileUpload_fileUpload {
__typename: "FileUpload";
uploadedFile: FileUpload_fileUpload_uploadedFile | null;
uploadErrors: FileUpload_fileUpload_uploadErrors[];
errors: FileUpload_fileUpload_errors[];
}
export interface FileUpload {

View file

@ -261,9 +261,6 @@ export const fragmentOrderDetails = gql`
...Money
}
}
discount {
...Money
}
invoices {
...InvoiceFragment
}

View file

@ -450,12 +450,6 @@ export interface OrderDetailsFragment_availableShippingMethods {
price: OrderDetailsFragment_availableShippingMethods_price | null;
}
export interface OrderDetailsFragment_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDetailsFragment_invoices {
__typename: "Invoice";
id: string;
@ -504,7 +498,6 @@ export interface OrderDetailsFragment {
user: OrderDetailsFragment_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDetailsFragment_availableShippingMethods | null)[] | null;
discount: OrderDetailsFragment_discount | null;
invoices: (OrderDetailsFragment_invoices | null)[] | null;
channel: OrderDetailsFragment_channel;
isPaid: boolean;

View file

@ -6,6 +6,7 @@ import { Home, HomeVariables } from "./types/Home";
const home = gql`
query Home(
$channel: String!
$datePeriod: DateRangeInput!
$PERMISSION_MANAGE_PRODUCTS: Boolean!
$PERMISSION_MANAGE_ORDERS: Boolean!
) {
@ -16,21 +17,24 @@ const home = gql`
currency
}
}
ordersToday: orders(created: TODAY, channel: $channel)
ordersToday: orders(filter: { created: $datePeriod }, channel: $channel)
@include(if: $PERMISSION_MANAGE_ORDERS) {
totalCount
}
ordersToFulfill: orders(status: READY_TO_FULFILL, channel: $channel)
@include(if: $PERMISSION_MANAGE_ORDERS) {
ordersToFulfill: orders(
filter: { status: READY_TO_FULFILL }
channel: $channel
) @include(if: $PERMISSION_MANAGE_ORDERS) {
totalCount
}
ordersToCapture: orders(status: READY_TO_CAPTURE, channel: $channel)
@include(if: $PERMISSION_MANAGE_ORDERS) {
ordersToCapture: orders(
filter: { status: READY_TO_CAPTURE }
channel: $channel
) @include(if: $PERMISSION_MANAGE_ORDERS) {
totalCount
}
productsOutOfStock: products(
stockAvailability: OUT_OF_STOCK
channel: $channel
filter: { stockAvailability: OUT_OF_STOCK, channel: $channel }
) {
totalCount
}

View file

@ -3,7 +3,7 @@
// @generated
// This file was automatically generated and should not be edited.
import { OrderEventsEmailsEnum, OrderEventsEnum } from "./../../types/globalTypes";
import { DateRangeInput, OrderEventsEmailsEnum, OrderEventsEnum } from "./../../types/globalTypes";
// ====================================================
// GraphQL query operation: Home
@ -137,6 +137,7 @@ export interface Home {
export interface HomeVariables {
channel: string;
datePeriod: DateRangeInput;
PERMISSION_MANAGE_PRODUCTS: boolean;
PERMISSION_MANAGE_ORDERS: boolean;
}

View file

@ -4,7 +4,7 @@ import useNavigator from "@saleor/hooks/useNavigator";
import useUser from "@saleor/hooks/useUser";
import React from "react";
import { getUserName } from "../../misc";
import { getDatePeriod, getUserName } from "../../misc";
import { orderListUrl } from "../../orders/urls";
import { productListUrl, productVariantEditUrl } from "../../products/urls";
import { OrderStatusFilter, StockAvailability } from "../../types/globalTypes";
@ -21,7 +21,7 @@ const HomeSection = () => {
const { data } = useHomePage({
displayLoader: true,
skip: noChannel,
variables: { channel: channel?.slug }
variables: { channel: channel?.slug, datePeriod: getDatePeriod(1) }
});
return (

View file

@ -15,6 +15,7 @@ import {
import {
AddressInput,
CountryCode,
DateRangeInput,
OrderStatus,
PaymentChargeStatusEnum
} from "./types/globalTypes";
@ -421,3 +422,18 @@ export function transformFormToAddress<T>(
export function getStringOrPlaceholder(s: string | undefined): string {
return s || "...";
}
export const getDatePeriod = (days: number): DateRangeInput => {
if (days < 1) {
return {};
}
const end = moment().startOf("day");
const start = end.subtract(days - 1);
const format = "YYYY-MM-DD";
return {
gte: start.format(format),
lte: end.format(format)
};
};

View file

@ -26,7 +26,7 @@ const menuCreate = gql`
${menuErrorFragment}
mutation MenuCreate($input: MenuCreateInput!) {
menuCreate(input: $input) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
menu {
@ -44,7 +44,7 @@ const menuBulkDelete = gql`
${menuErrorFragment}
mutation MenuBulkDelete($ids: [ID]!) {
menuBulkDelete(ids: $ids) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
}
@ -59,7 +59,7 @@ const menuDelete = gql`
${menuErrorFragment}
mutation MenuDelete($id: ID!) {
menuDelete(id: $id) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
}
@ -75,7 +75,7 @@ const menuItemCreate = gql`
${menuItemNestedFragment}
mutation MenuItemCreate($input: MenuItemCreateInput!) {
menuItemCreate(input: $input) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
menuItem {
@ -103,19 +103,19 @@ const menuUpdate = gql`
$removeIds: [ID]!
) {
menuUpdate(id: $id, input: { name: $name }) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
}
menuItemMove(menu: $id, moves: $moves) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
}
menuItemBulkDelete(ids: $removeIds) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
}
@ -131,7 +131,7 @@ const menuItemUpdate = gql`
${menuItemFragment}
mutation MenuItemUpdate($id: ID!, $input: MenuItemInput!) {
menuItemUpdate(id: $id, input: $input) {
errors: menuErrors {
errors {
...MenuErrorFragment
}
menuItem {

View file

@ -12,7 +12,11 @@ import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { maybe, transformPaymentStatus } from "../../../misc";
import { OrderAction, OrderStatus } from "../../../types/globalTypes";
import {
OrderAction,
OrderDiscountType,
OrderStatus
} from "../../../types/globalTypes";
import { OrderDetails_order } from "../../types/OrderDetails";
const useStyles = makeStyles(
@ -163,7 +167,7 @@ const OrderPayment: React.FC<OrderPaymentProps> = props => {
)}
</td>
</tr>
{order?.discount?.amount > 0 && (
{order?.discounts?.map(discount => (
<tr>
<td>
<FormattedMessage
@ -171,12 +175,24 @@ const OrderPayment: React.FC<OrderPaymentProps> = props => {
description="order discount"
/>
</td>
<td />
<td>
{discount.type === OrderDiscountType.MANUAL ? (
<FormattedMessage
defaultMessage="Staff added"
description="staff added type order discount"
/>
) : (
<FormattedMessage
defaultMessage="Voucher"
description="voucher type order discount"
/>
)}
</td>
<td className={classes.textRight}>
-<Money money={order.discount} />
-<Money money={discount.amount} />
</td>
</tr>
)}
))}
<tr className={classes.totalRow}>
<td>
<FormattedMessage

View file

@ -822,7 +822,6 @@ export const order = (placeholder: string): OrderDetails_order => ({
},
created: "2018-09-11T09:37:28.185874+00:00",
customerNote: "Lorem ipsum dolor sit amet",
discount: null,
discounts: [],
events: [
{
@ -1380,9 +1379,7 @@ export const draftOrder = (placeholder: string): OrderDetails_order => ({
},
created: "2018-09-20T23:23:39.811428+00:00",
customerNote: "Lorem ipsum dolor sit",
discount: null,
discounts: [],
events: [],
fulfillments: [],
id: "T3JkZXI6MjQ=",

View file

@ -113,7 +113,7 @@ const orderCancelMutation = gql`
${orderErrorFragment}
mutation OrderCancel($id: ID!) {
orderCancel(id: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -133,7 +133,7 @@ const orderDiscountAddMutation = gql`
${fragmentOrderDetails}
mutation OrderDiscountAdd($input: OrderDiscountCommonInput!, $orderId: ID!) {
orderDiscountAdd(input: $input, orderId: $orderId) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -153,7 +153,7 @@ const orderDiscountDeleteMutation = gql`
${fragmentOrderDetails}
mutation OrderDiscountDelete($discountId: ID!) {
orderDiscountDelete(discountId: $discountId) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -173,7 +173,7 @@ const orderLineDiscountRemoveMutation = gql`
${fragmentOrderDetails}
mutation OrderLineDiscountRemove($orderLineId: ID!) {
orderLineDiscountRemove(orderLineId: $orderLineId) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -196,7 +196,7 @@ const orderLineDiscountUpdateMutation = gql`
$orderLineId: ID!
) {
orderLineDiscountUpdate(input: $input, orderLineId: $orderLineId) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -219,7 +219,7 @@ const orderDiscountUpdateMutation = gql`
$discountId: ID!
) {
orderDiscountUpdate(input: $input, discountId: $discountId) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -241,7 +241,7 @@ const orderDraftCancelMutation = gql`
${orderErrorFragment}
mutation OrderDraftCancel($id: ID!) {
draftOrderDelete(id: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -259,7 +259,7 @@ const orderDraftBulkCancelMutation = gql`
${orderErrorFragment}
mutation OrderDraftBulkCancel($ids: [ID]!) {
draftOrderBulkDelete(ids: $ids) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
}
@ -271,7 +271,7 @@ export const orderConfirmMutation = gql`
${orderErrorFragment}
mutation OrderConfirm($id: ID!) {
orderConfirm(id: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -296,7 +296,7 @@ const orderDraftFinalizeMutation = gql`
${orderErrorFragment}
mutation OrderDraftFinalize($id: ID!) {
draftOrderComplete(id: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -313,7 +313,7 @@ const orderReturnCreateMutation = gql`
$input: OrderReturnProductsInput!
) {
orderFulfillmentReturnProducts(input: $input, order: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -341,7 +341,7 @@ const orderRefundMutation = gql`
${orderErrorFragment}
mutation OrderRefund($id: ID!, $amount: PositiveDecimal!) {
orderRefund(id: $id, amount: $amount) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -365,7 +365,7 @@ const orderFulfillmentRefundProductsMutation = gql`
$order: ID!
) {
orderFulfillmentRefundProducts(input: $input, order: $order) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
fulfillment {
@ -387,7 +387,7 @@ const orderVoidMutation = gql`
${orderErrorFragment}
mutation OrderVoid($id: ID!) {
orderVoid(id: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -406,7 +406,7 @@ const orderMarkAsPaidMutation = gql`
${orderErrorFragment}
mutation OrderMarkAsPaid($id: ID!, $transactionReference: String) {
orderMarkAsPaid(id: $id, transactionReference: $transactionReference) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -425,7 +425,7 @@ const orderCaptureMutation = gql`
${orderErrorFragment}
mutation OrderCapture($id: ID!, $amount: PositiveDecimal!) {
orderCapture(id: $id, amount: $amount) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -447,7 +447,7 @@ const orderFulfillmentUpdateTrackingMutation = gql`
$input: FulfillmentUpdateTrackingInput!
) {
orderFulfillmentUpdateTracking(id: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -466,7 +466,7 @@ const orderFulfillmentCancelMutation = gql`
${orderErrorFragment}
mutation OrderFulfillmentCancel($id: ID!, $input: FulfillmentCancelInput!) {
orderFulfillmentCancel(id: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -485,7 +485,7 @@ const orderAddNoteMutation = gql`
${orderErrorFragment}
mutation OrderAddNote($order: ID!, $input: OrderAddNoteInput!) {
orderAddNote(order: $order, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -507,7 +507,7 @@ const orderUpdateMutation = gql`
${orderErrorFragment}
mutation OrderUpdate($id: ID!, $input: OrderUpdateInput!) {
orderUpdate(id: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -526,7 +526,7 @@ const orderDraftUpdateMutation = gql`
${orderErrorFragment}
mutation OrderDraftUpdate($id: ID!, $input: DraftOrderInput!) {
draftOrderUpdate(id: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -548,7 +548,7 @@ const orderShippingMethodUpdateMutation = gql`
$input: OrderUpdateShippingInput!
) {
orderUpdateShipping(order: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -596,7 +596,7 @@ const orderDraftCreateMutation = gql`
${orderErrorFragment}
mutation OrderDraftCreate($input: DraftOrderCreateInput!) {
draftOrderCreate(input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -615,7 +615,7 @@ const orderLineDeleteMutation = gql`
${orderErrorFragment}
mutation OrderLineDelete($id: ID!) {
orderLineDelete(id: $id) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -634,7 +634,7 @@ const orderLinesAddMutation = gql`
${orderErrorFragment}
mutation OrderLinesAdd($id: ID!, $input: [OrderLineCreateInput]!) {
orderLinesCreate(id: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -653,7 +653,7 @@ const orderLineUpdateMutation = gql`
${orderErrorFragment}
mutation OrderLineUpdate($id: ID!, $input: OrderLineInput!) {
orderLineUpdate(id: $id, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
}
order {
@ -672,7 +672,7 @@ const fulfillOrder = gql`
${orderErrorFragment}
mutation FulfillOrder($orderId: ID!, $input: OrderFulfillInput!) {
orderFulfill(order: $orderId, input: $input) {
errors: orderErrors {
errors {
...OrderErrorFragment
warehouse
orderLine
@ -693,7 +693,7 @@ const invoiceRequestMutation = gql`
${invoiceFragment}
mutation InvoiceRequest($orderId: ID!) {
invoiceRequest(orderId: $orderId) {
errors: invoiceErrors {
errors {
...InvoiceErrorFragment
}
invoice {
@ -718,7 +718,7 @@ const invoiceEmailSendMutation = gql`
${invoiceFragment}
mutation InvoiceEmailSend($id: ID!) {
invoiceSendNotification(id: $id) {
errors: invoiceErrors {
errors {
...InvoiceErrorFragment
}
invoice {
@ -737,7 +737,7 @@ const orderSettingsUpdateMutation = gql`
${orderSettingsErrorFragment}
mutation OrderSettingsUpdate($input: OrderSettingsUpdateInput!) {
orderSettingsUpdate(input: $input) {
errors: orderSettingsErrors {
errors {
...OrderSettingsErrorFragment
}
orderSettings {

View file

@ -458,12 +458,6 @@ export interface FulfillOrder_orderFulfill_order_availableShippingMethods {
price: FulfillOrder_orderFulfill_order_availableShippingMethods_price | null;
}
export interface FulfillOrder_orderFulfill_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface FulfillOrder_orderFulfill_order_invoices {
__typename: "Invoice";
id: string;
@ -512,7 +506,6 @@ export interface FulfillOrder_orderFulfill_order {
user: FulfillOrder_orderFulfill_order_user | null;
userEmail: string | null;
availableShippingMethods: (FulfillOrder_orderFulfill_order_availableShippingMethods | null)[] | null;
discount: FulfillOrder_orderFulfill_order_discount | null;
invoices: (FulfillOrder_orderFulfill_order_invoices | null)[] | null;
channel: FulfillOrder_orderFulfill_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderCancel_orderCancel_order_availableShippingMethods {
price: OrderCancel_orderCancel_order_availableShippingMethods_price | null;
}
export interface OrderCancel_orderCancel_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderCancel_orderCancel_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderCancel_orderCancel_order {
user: OrderCancel_orderCancel_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderCancel_orderCancel_order_availableShippingMethods | null)[] | null;
discount: OrderCancel_orderCancel_order_discount | null;
invoices: (OrderCancel_orderCancel_order_invoices | null)[] | null;
channel: OrderCancel_orderCancel_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderCapture_orderCapture_order_availableShippingMethods {
price: OrderCapture_orderCapture_order_availableShippingMethods_price | null;
}
export interface OrderCapture_orderCapture_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderCapture_orderCapture_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderCapture_orderCapture_order {
user: OrderCapture_orderCapture_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderCapture_orderCapture_order_availableShippingMethods | null)[] | null;
discount: OrderCapture_orderCapture_order_discount | null;
invoices: (OrderCapture_orderCapture_order_invoices | null)[] | null;
channel: OrderCapture_orderCapture_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderConfirm_orderConfirm_order_availableShippingMethods {
price: OrderConfirm_orderConfirm_order_availableShippingMethods_price | null;
}
export interface OrderConfirm_orderConfirm_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderConfirm_orderConfirm_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderConfirm_orderConfirm_order {
user: OrderConfirm_orderConfirm_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderConfirm_orderConfirm_order_availableShippingMethods | null)[] | null;
discount: OrderConfirm_orderConfirm_order_discount | null;
invoices: (OrderConfirm_orderConfirm_order_invoices | null)[] | null;
channel: OrderConfirm_orderConfirm_order_channel;
isPaid: boolean;

View file

@ -450,12 +450,6 @@ export interface OrderDetails_order_availableShippingMethods {
price: OrderDetails_order_availableShippingMethods_price | null;
}
export interface OrderDetails_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDetails_order_invoices {
__typename: "Invoice";
id: string;
@ -504,7 +498,6 @@ export interface OrderDetails_order {
user: OrderDetails_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDetails_order_availableShippingMethods | null)[] | null;
discount: OrderDetails_order_discount | null;
invoices: (OrderDetails_order_invoices | null)[] | null;
channel: OrderDetails_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderDiscountAdd_orderDiscountAdd_order_availableShippingMethod
price: OrderDiscountAdd_orderDiscountAdd_order_availableShippingMethods_price | null;
}
export interface OrderDiscountAdd_orderDiscountAdd_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDiscountAdd_orderDiscountAdd_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderDiscountAdd_orderDiscountAdd_order {
user: OrderDiscountAdd_orderDiscountAdd_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDiscountAdd_orderDiscountAdd_order_availableShippingMethods | null)[] | null;
discount: OrderDiscountAdd_orderDiscountAdd_order_discount | null;
invoices: (OrderDiscountAdd_orderDiscountAdd_order_invoices | null)[] | null;
channel: OrderDiscountAdd_orderDiscountAdd_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderDiscountDelete_orderDiscountDelete_order_availableShipping
price: OrderDiscountDelete_orderDiscountDelete_order_availableShippingMethods_price | null;
}
export interface OrderDiscountDelete_orderDiscountDelete_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDiscountDelete_orderDiscountDelete_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderDiscountDelete_orderDiscountDelete_order {
user: OrderDiscountDelete_orderDiscountDelete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDiscountDelete_orderDiscountDelete_order_availableShippingMethods | null)[] | null;
discount: OrderDiscountDelete_orderDiscountDelete_order_discount | null;
invoices: (OrderDiscountDelete_orderDiscountDelete_order_invoices | null)[] | null;
channel: OrderDiscountDelete_orderDiscountDelete_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderDiscountUpdate_orderDiscountUpdate_order_availableShipping
price: OrderDiscountUpdate_orderDiscountUpdate_order_availableShippingMethods_price | null;
}
export interface OrderDiscountUpdate_orderDiscountUpdate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDiscountUpdate_orderDiscountUpdate_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderDiscountUpdate_orderDiscountUpdate_order {
user: OrderDiscountUpdate_orderDiscountUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDiscountUpdate_orderDiscountUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderDiscountUpdate_orderDiscountUpdate_order_discount | null;
invoices: (OrderDiscountUpdate_orderDiscountUpdate_order_invoices | null)[] | null;
channel: OrderDiscountUpdate_orderDiscountUpdate_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderDraftCancel_draftOrderDelete_order_availableShippingMethod
price: OrderDraftCancel_draftOrderDelete_order_availableShippingMethods_price | null;
}
export interface OrderDraftCancel_draftOrderDelete_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDraftCancel_draftOrderDelete_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderDraftCancel_draftOrderDelete_order {
user: OrderDraftCancel_draftOrderDelete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDraftCancel_draftOrderDelete_order_availableShippingMethods | null)[] | null;
discount: OrderDraftCancel_draftOrderDelete_order_discount | null;
invoices: (OrderDraftCancel_draftOrderDelete_order_invoices | null)[] | null;
channel: OrderDraftCancel_draftOrderDelete_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderDraftFinalize_draftOrderComplete_order_availableShippingMe
price: OrderDraftFinalize_draftOrderComplete_order_availableShippingMethods_price | null;
}
export interface OrderDraftFinalize_draftOrderComplete_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDraftFinalize_draftOrderComplete_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderDraftFinalize_draftOrderComplete_order {
user: OrderDraftFinalize_draftOrderComplete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDraftFinalize_draftOrderComplete_order_availableShippingMethods | null)[] | null;
discount: OrderDraftFinalize_draftOrderComplete_order_discount | null;
invoices: (OrderDraftFinalize_draftOrderComplete_order_invoices | null)[] | null;
channel: OrderDraftFinalize_draftOrderComplete_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderDraftUpdate_draftOrderUpdate_order_availableShippingMethod
price: OrderDraftUpdate_draftOrderUpdate_order_availableShippingMethods_price | null;
}
export interface OrderDraftUpdate_draftOrderUpdate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderDraftUpdate_draftOrderUpdate_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderDraftUpdate_draftOrderUpdate_order {
user: OrderDraftUpdate_draftOrderUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDraftUpdate_draftOrderUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderDraftUpdate_draftOrderUpdate_order_discount | null;
invoices: (OrderDraftUpdate_draftOrderUpdate_order_invoices | null)[] | null;
channel: OrderDraftUpdate_draftOrderUpdate_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_availableSh
price: OrderFulfillmentCancel_orderFulfillmentCancel_order_availableShippingMethods_price | null;
}
export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order {
user: OrderFulfillmentCancel_orderFulfillmentCancel_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderFulfillmentCancel_orderFulfillmentCancel_order_availableShippingMethods | null)[] | null;
discount: OrderFulfillmentCancel_orderFulfillmentCancel_order_discount | null;
invoices: (OrderFulfillmentCancel_orderFulfillmentCancel_order_invoices | null)[] | null;
channel: OrderFulfillmentCancel_orderFulfillmentCancel_order_channel;
isPaid: boolean;

View file

@ -551,12 +551,6 @@ export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_o
price: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_availableShippingMethods_price | null;
}
export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_invoices {
__typename: "Invoice";
id: string;
@ -605,7 +599,6 @@ export interface OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_o
user: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_availableShippingMethods | null)[] | null;
discount: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_discount | null;
invoices: (OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_invoices | null)[] | null;
channel: OrderFulfillmentRefundProducts_orderFulfillmentRefundProducts_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
price: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_availableShippingMethods_price | null;
}
export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
user: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_availableShippingMethods | null)[] | null;
discount: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_discount | null;
invoices: (OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_invoices | null)[] | null;
channel: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderLineDelete_orderLineDelete_order_availableShippingMethods
price: OrderLineDelete_orderLineDelete_order_availableShippingMethods_price | null;
}
export interface OrderLineDelete_orderLineDelete_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_orderLineDelete_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderLineDelete_orderLineDelete_order {
user: OrderLineDelete_orderLineDelete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineDelete_orderLineDelete_order_availableShippingMethods | null)[] | null;
discount: OrderLineDelete_orderLineDelete_order_discount | null;
invoices: (OrderLineDelete_orderLineDelete_order_invoices | null)[] | null;
channel: OrderLineDelete_orderLineDelete_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_available
price: OrderLineDiscountRemove_orderLineDiscountRemove_order_availableShippingMethods_price | null;
}
export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDiscountRemove_orderLineDiscountRemove_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderLineDiscountRemove_orderLineDiscountRemove_order {
user: OrderLineDiscountRemove_orderLineDiscountRemove_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineDiscountRemove_orderLineDiscountRemove_order_availableShippingMethods | null)[] | null;
discount: OrderLineDiscountRemove_orderLineDiscountRemove_order_discount | null;
invoices: (OrderLineDiscountRemove_orderLineDiscountRemove_order_invoices | null)[] | null;
channel: OrderLineDiscountRemove_orderLineDiscountRemove_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_available
price: OrderLineDiscountUpdate_orderLineDiscountUpdate_order_availableShippingMethods_price | null;
}
export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderLineDiscountUpdate_orderLineDiscountUpdate_order {
user: OrderLineDiscountUpdate_orderLineDiscountUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineDiscountUpdate_orderLineDiscountUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderLineDiscountUpdate_orderLineDiscountUpdate_order_discount | null;
invoices: (OrderLineDiscountUpdate_orderLineDiscountUpdate_order_invoices | null)[] | null;
channel: OrderLineDiscountUpdate_orderLineDiscountUpdate_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderLineUpdate_orderLineUpdate_order_availableShippingMethods
price: OrderLineUpdate_orderLineUpdate_order_availableShippingMethods_price | null;
}
export interface OrderLineUpdate_orderLineUpdate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_orderLineUpdate_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderLineUpdate_orderLineUpdate_order {
user: OrderLineUpdate_orderLineUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineUpdate_orderLineUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderLineUpdate_orderLineUpdate_order_discount | null;
invoices: (OrderLineUpdate_orderLineUpdate_order_invoices | null)[] | null;
channel: OrderLineUpdate_orderLineUpdate_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderLinesAdd_orderLinesCreate_order_availableShippingMethods {
price: OrderLinesAdd_orderLinesCreate_order_availableShippingMethods_price | null;
}
export interface OrderLinesAdd_orderLinesCreate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_orderLinesCreate_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderLinesAdd_orderLinesCreate_order {
user: OrderLinesAdd_orderLinesCreate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLinesAdd_orderLinesCreate_order_availableShippingMethods | null)[] | null;
discount: OrderLinesAdd_orderLinesCreate_order_discount | null;
invoices: (OrderLinesAdd_orderLinesCreate_order_invoices | null)[] | null;
channel: OrderLinesAdd_orderLinesCreate_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderMarkAsPaid_orderMarkAsPaid_order_availableShippingMethods
price: OrderMarkAsPaid_orderMarkAsPaid_order_availableShippingMethods_price | null;
}
export interface OrderMarkAsPaid_orderMarkAsPaid_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderMarkAsPaid_orderMarkAsPaid_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderMarkAsPaid_orderMarkAsPaid_order {
user: OrderMarkAsPaid_orderMarkAsPaid_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderMarkAsPaid_orderMarkAsPaid_order_availableShippingMethods | null)[] | null;
discount: OrderMarkAsPaid_orderMarkAsPaid_order_discount | null;
invoices: (OrderMarkAsPaid_orderMarkAsPaid_order_invoices | null)[] | null;
channel: OrderMarkAsPaid_orderMarkAsPaid_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderRefund_orderRefund_order_availableShippingMethods {
price: OrderRefund_orderRefund_order_availableShippingMethods_price | null;
}
export interface OrderRefund_orderRefund_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderRefund_orderRefund_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderRefund_orderRefund_order {
user: OrderRefund_orderRefund_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderRefund_orderRefund_order_availableShippingMethods | null)[] | null;
discount: OrderRefund_orderRefund_order_discount | null;
invoices: (OrderRefund_orderRefund_order_invoices | null)[] | null;
channel: OrderRefund_orderRefund_order_channel;
isPaid: boolean;

View file

@ -464,12 +464,6 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_user {
email: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_invoices {
__typename: "Invoice";
id: string;
@ -518,7 +512,6 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order {
undiscountedTotal: OrderShippingMethodUpdate_orderUpdateShipping_order_undiscountedTotal;
user: OrderShippingMethodUpdate_orderUpdateShipping_order_user | null;
userEmail: string | null;
discount: OrderShippingMethodUpdate_orderUpdateShipping_order_discount | null;
invoices: (OrderShippingMethodUpdate_orderUpdateShipping_order_invoices | null)[] | null;
channel: OrderShippingMethodUpdate_orderUpdateShipping_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderUpdate_orderUpdate_order_availableShippingMethods {
price: OrderUpdate_orderUpdate_order_availableShippingMethods_price | null;
}
export interface OrderUpdate_orderUpdate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderUpdate_orderUpdate_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderUpdate_orderUpdate_order {
user: OrderUpdate_orderUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderUpdate_orderUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderUpdate_orderUpdate_order_discount | null;
invoices: (OrderUpdate_orderUpdate_order_invoices | null)[] | null;
channel: OrderUpdate_orderUpdate_order_channel;
isPaid: boolean;

View file

@ -456,12 +456,6 @@ export interface OrderVoid_orderVoid_order_availableShippingMethods {
price: OrderVoid_orderVoid_order_availableShippingMethods_price | null;
}
export interface OrderVoid_orderVoid_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderVoid_orderVoid_order_invoices {
__typename: "Invoice";
id: string;
@ -510,7 +504,6 @@ export interface OrderVoid_orderVoid_order {
user: OrderVoid_orderVoid_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderVoid_orderVoid_order_availableShippingMethods | null)[] | null;
discount: OrderVoid_orderVoid_order_discount | null;
invoices: (OrderVoid_orderVoid_order_invoices | null)[] | null;
channel: OrderVoid_orderVoid_order_channel;
isPaid: boolean;

View file

@ -37,7 +37,7 @@ export const pageTypeUpdateMutation = gql`
${pageErrorFragment}
mutation PageTypeUpdate($id: ID!, $input: PageTypeUpdateInput!) {
pageTypeUpdate(id: $id, input: $input) {
errors: pageErrors {
errors {
...PageErrorFragment
}
pageType {
@ -56,7 +56,7 @@ export const pageTypeCreateMutation = gql`
${pageErrorFragment}
mutation PageTypeCreate($input: PageTypeCreateInput!) {
pageTypeCreate(input: $input) {
errors: pageErrors {
errors {
...PageErrorFragment
}
pageType {
@ -75,7 +75,7 @@ export const assignPageAttributeMutation = gql`
${pageErrorFragment}
mutation AssignPageAttribute($id: ID!, $ids: [ID!]!) {
pageAttributeAssign(pageTypeId: $id, attributeIds: $ids) {
errors: pageErrors {
errors {
...PageErrorFragment
}
pageType {
@ -94,7 +94,7 @@ export const unassignPageAttributeMutation = gql`
${pageErrorFragment}
mutation UnassignPageAttribute($id: ID!, $ids: [ID!]!) {
pageAttributeUnassign(pageTypeId: $id, attributeIds: $ids) {
errors: pageErrors {
errors {
...PageErrorFragment
}
pageType {
@ -111,7 +111,7 @@ export const useUnassignPageAttributeMutation = makeMutation<
export const pageTypeDeleteMutation = gql`
mutation PageTypeDelete($id: ID!) {
pageTypeDelete(id: $id) {
errors: pageErrors {
errors {
field
message
}
@ -129,7 +129,7 @@ export const usePageTypeDeleteMutation = makeMutation<
export const pageTypeBulkDeleteMutation = gql`
mutation PageTypeBulkDelete($ids: [ID!]!) {
pageTypeBulkDelete(ids: $ids) {
errors: pageErrors {
errors {
field
message
}
@ -146,7 +146,7 @@ export const pageTypeAttributeReorder = gql`
${pageErrorFragment}
mutation PageTypeAttributeReorder($move: ReorderInput!, $pageTypeId: ID!) {
pageTypeReorderAttributes(moves: [$move], pageTypeId: $pageTypeId) {
errors: pageErrors {
errors {
...PageErrorFragment
}
pageType {

View file

@ -24,7 +24,7 @@ const pageCreate = gql`
${pageErrorWithAttributesFragment}
mutation PageCreate($input: PageCreateInput!) {
pageCreate(input: $input) {
errors: pageErrors {
errors {
...PageErrorWithAttributesFragment
message
}
@ -43,7 +43,7 @@ const pageUpdate = gql`
${pageErrorWithAttributesFragment}
mutation PageUpdate($id: ID!, $input: PageInput!) {
pageUpdate(id: $id, input: $input) {
errors: pageErrors {
errors {
...PageErrorWithAttributesFragment
}
page {
@ -61,7 +61,7 @@ const pageRemove = gql`
${pageErrorFragment}
mutation PageRemove($id: ID!) {
pageDelete(id: $id) {
errors: pageErrors {
errors {
...PageErrorFragment
}
}

View file

@ -8,7 +8,7 @@
// ====================================================
export interface PageBulkPublish_pageBulkPublish_errors {
__typename: "Error";
__typename: "PageError";
field: string | null;
message: string | null;
}

View file

@ -8,7 +8,7 @@
// ====================================================
export interface PageBulkRemove_pageBulkDelete_errors {
__typename: "Error";
__typename: "PageError";
field: string | null;
message: string | null;
}

View file

@ -20,7 +20,7 @@ export const permissionGroupDelete = gql`
${permissionGroupErrorFragment}
mutation PermissionGroupDelete($id: ID!) {
permissionGroupDelete(id: $id) {
errors: permissionGroupErrors {
errors {
...PermissionGroupErrorFragment
}
}
@ -37,7 +37,7 @@ export const permissionGroupCreate = gql`
mutation PermissionGroupCreate($input: PermissionGroupCreateInput!) {
permissionGroupCreate(input: $input) {
errors: permissionGroupErrors {
errors {
...PermissionGroupErrorFragment
}
group {
@ -61,7 +61,7 @@ export const permissionGroupUpdate = gql`
$input: PermissionGroupUpdateInput!
) {
permissionGroupUpdate(id: $id, input: $input) {
errors: permissionGroupErrors {
errors {
...PermissionGroupErrorFragment
}
group {

View file

@ -10,7 +10,7 @@ const pluginUpdate = gql`
${pluginErrorFragment}
mutation PluginUpdate($id: ID!, $input: PluginUpdateInput!) {
pluginUpdate(id: $id, input: $input) {
errors: pluginsErrors {
errors {
...PluginErrorFragment
}
plugin {

View file

@ -91,7 +91,7 @@ export const assignProductAttributeMutation = gql`
$operations: [ProductAttributeAssignInput!]!
) {
productAttributeAssign(productTypeId: $id, operations: $operations) {
errors: productErrors {
errors {
field
message
}
@ -110,7 +110,7 @@ export const unassignProductAttributeMutation = gql`
${productTypeDetailsFragment}
mutation UnassignProductAttribute($id: ID!, $ids: [ID]!) {
productAttributeUnassign(productTypeId: $id, attributeIds: $ids) {
errors: productErrors {
errors {
field
message
}

View file

@ -10,7 +10,7 @@ import { ReorderInput, ProductAttributeType, AttributeTypeEnum, WeightUnitsEnum
// ====================================================
export interface ProductTypeAttributeReorder_productTypeReorderAttributes_errors {
__typename: "Error";
__typename: "ProductError";
field: string | null;
message: string | null;
}

View file

@ -8,7 +8,7 @@
// ====================================================
export interface ProductTypeBulkDelete_productTypeBulkDelete_errors {
__typename: "Error";
__typename: "ProductError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { ProductTypeInput, AttributeTypeEnum, WeightUnitsEnum } from "./../../ty
// ====================================================
export interface ProductTypeCreate_productTypeCreate_errors {
__typename: "Error";
__typename: "ProductError";
field: string | null;
message: string | null;
}

View file

@ -8,7 +8,7 @@
// ====================================================
export interface ProductTypeDelete_productTypeDelete_errors {
__typename: "Error";
__typename: "ProductError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { ProductTypeInput, AttributeTypeEnum, WeightUnitsEnum } from "./../../ty
// ====================================================
export interface ProductTypeUpdate_productTypeUpdate_errors {
__typename: "Error";
__typename: "ProductError";
field: string | null;
message: string | null;
}

View file

@ -313,11 +313,10 @@ export const ProductList: React.FC<ProductListProps> = props => {
<TableCellAvatar
className={classes.colName}
thumbnail={maybe(() => product.thumbnail.url)}
data-test="name"
>
{product?.productType ? (
<div className={classes.colNameWrapper}>
<span>{product.name}</span>
<span data-test="name">{product.name}</span>
{product?.productType && (
<Typography variant="caption">
{product.productType.hasVariants ? (

View file

@ -96,7 +96,7 @@ export const productMediaCreateMutation = gql`
mediaUrl: $mediaUrl
}
) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -114,7 +114,7 @@ export const productDeleteMutation = gql`
${productErrorFragment}
mutation ProductDelete($id: ID!) {
productDelete(id: $id) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -132,7 +132,7 @@ export const productMediaReorder = gql`
${productErrorFragment}
mutation ProductMediaReorder($productId: ID!, $mediaIds: [ID]!) {
productMediaReorder(productId: $productId, mediaIds: $mediaIds) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -157,7 +157,7 @@ const productVariantSetDefault = gql`
${productFragmentDetails}
mutation ProductVariantSetDefault($productId: ID!, $variantId: ID!) {
productVariantSetDefault(productId: $productId, variantId: $variantId) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -177,7 +177,7 @@ export const productUpdateMutation = gql`
${productFragmentDetails}
mutation ProductUpdate($id: ID!, $input: ProductInput!) {
productUpdate(id: $id, input: $input) {
errors: productErrors {
errors {
...ProductErrorWithAttributesFragment
}
product {
@ -207,7 +207,7 @@ export const simpleProductUpdateMutation = gql`
$updateStocks: [StockInput!]!
) {
productUpdate(id: $id, input: $input) {
errors: productErrors {
errors {
...ProductErrorWithAttributesFragment
}
product {
@ -215,7 +215,7 @@ export const simpleProductUpdateMutation = gql`
}
}
productVariantUpdate(id: $productVariantId, input: $productVariantInput) {
errors: productErrors {
errors {
...ProductErrorWithAttributesFragment
}
productVariant {
@ -226,7 +226,7 @@ export const simpleProductUpdateMutation = gql`
stocks: $addStocks
variantId: $productVariantId
) {
errors: bulkStockErrors {
errors {
...BulkStockErrorFragment
}
productVariant {
@ -237,7 +237,7 @@ export const simpleProductUpdateMutation = gql`
warehouseIds: $deleteStocks
variantId: $productVariantId
) {
errors: stockErrors {
errors {
...StockErrorFragment
}
productVariant {
@ -248,7 +248,7 @@ export const simpleProductUpdateMutation = gql`
stocks: $updateStocks
variantId: $productVariantId
) {
errors: bulkStockErrors {
errors {
...BulkStockErrorFragment
}
productVariant {
@ -267,7 +267,7 @@ export const productCreateMutation = gql`
${productFragmentDetails}
mutation ProductCreate($input: ProductCreateInput!) {
productCreate(input: $input) {
errors: productErrors {
errors {
...ProductErrorWithAttributesFragment
}
product {
@ -285,7 +285,7 @@ export const variantDeleteMutation = gql`
${productErrorFragment}
mutation VariantDelete($id: ID!) {
productVariantDelete(id: $id) {
errors: productErrors {
errors {
...ProductErrorFragment
}
productVariant {
@ -322,7 +322,7 @@ export const variantUpdateMutation = gql`
weight: $weight
}
) {
errors: productErrors {
errors {
...ProductErrorWithAttributesFragment
}
productVariant {
@ -330,7 +330,7 @@ export const variantUpdateMutation = gql`
}
}
productVariantStocksUpdate(stocks: $stocks, variantId: $id) {
errors: bulkStockErrors {
errors {
...BulkStockErrorFragment
}
productVariant {
@ -338,7 +338,7 @@ export const variantUpdateMutation = gql`
}
}
productVariantStocksCreate(stocks: $addStocks, variantId: $id) {
errors: bulkStockErrors {
errors {
...BulkStockErrorFragment
}
productVariant {
@ -349,7 +349,7 @@ export const variantUpdateMutation = gql`
}
}
productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) {
errors: stockErrors {
errors {
code
field
}
@ -372,7 +372,7 @@ export const variantCreateMutation = gql`
${productErrorWithAttributesFragment}
mutation VariantCreate($input: ProductVariantCreateInput!) {
productVariantCreate(input: $input) {
errors: productErrors {
errors {
...ProductErrorWithAttributesFragment
}
productVariant {
@ -390,7 +390,7 @@ export const productMediaDeleteMutation = gql`
${productErrorFragment}
mutation ProductMediaDelete($id: ID!) {
productMediaDelete(id: $id) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -412,7 +412,7 @@ export const productMediaUpdateMutation = gql`
${productFragmentDetails}
mutation ProductMediaUpdate($id: ID!, $alt: String!) {
productMediaUpdate(id: $id, input: { alt: $alt }) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -431,7 +431,7 @@ export const variantMediaAssignMutation = gql`
${productErrorFragment}
mutation VariantMediaAssign($variantId: ID!, $mediaId: ID!) {
variantMediaAssign(variantId: $variantId, mediaId: $mediaId) {
errors: productErrors {
errors {
...ProductErrorFragment
}
productVariant {
@ -450,7 +450,7 @@ export const variantMediaUnassignMutation = gql`
${productErrorFragment}
mutation VariantMediaUnassign($variantId: ID!, $mediaId: ID!) {
variantMediaUnassign(variantId: $variantId, mediaId: $mediaId) {
errors: productErrors {
errors {
...ProductErrorFragment
}
productVariant {
@ -468,7 +468,7 @@ export const productBulkDeleteMutation = gql`
${productErrorFragment}
mutation productBulkDelete($ids: [ID!]!) {
productBulkDelete(ids: $ids) {
errors: productErrors {
errors {
...ProductErrorFragment
}
}
@ -486,7 +486,7 @@ export const ProductVariantBulkCreateMutation = gql`
$inputs: [ProductVariantBulkCreateInput]!
) {
productVariantBulkCreate(product: $id, variants: $inputs) {
errors: bulkProductErrors {
errors {
...BulkProductErrorFragment
}
}
@ -501,7 +501,7 @@ export const ProductVariantBulkDeleteMutation = gql`
${productErrorFragment}
mutation ProductVariantBulkDelete($ids: [ID!]!) {
productVariantBulkDelete(ids: $ids) {
errors: productErrors {
errors {
...ProductErrorFragment
}
}
@ -520,7 +520,7 @@ export const productExportMutation = gql`
exportFile {
...ExportFileFragment
}
errors: exportErrors {
errors {
...ExportErrorFragment
}
}
@ -542,7 +542,7 @@ export const ProductChannelListingUpdateMutation = gql`
product {
...Product
}
errors: productChannelListingErrors {
errors {
...ProductChannelListingErrorFragment
}
}
@ -554,7 +554,7 @@ const productVariantReorder = gql`
${productFragmentDetails}
mutation ProductVariantReorder($move: ReorderInput!, $productId: ID!) {
productVariantReorder(moves: [$move], productId: $productId) {
errors: productErrors {
errors {
...ProductErrorFragment
}
product {
@ -583,7 +583,7 @@ export const ProductVariantChannelListingUpdateMutation = gql`
variant {
...ProductVariant
}
errors: productChannelListingErrors {
errors {
...ProductChannelListingErrorFragment
}
}

View file

@ -63,7 +63,7 @@ const deleteShippingZone = gql`
${shippingErrorFragment}
mutation DeleteShippingZone($id: ID!) {
shippingZoneDelete(id: $id) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
}
@ -78,7 +78,7 @@ const bulkDeleteShippingZone = gql`
${shippingErrorFragment}
mutation BulkDeleteShippingZone($ids: [ID]!) {
shippingZoneBulkDelete(ids: $ids) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
}
@ -112,7 +112,7 @@ const createShippingZone = gql`
${shippingErrorFragment}
mutation CreateShippingZone($input: ShippingZoneCreateInput!) {
shippingZoneCreate(input: $input) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
shippingZone {
@ -136,7 +136,7 @@ const updateShippingZone = gql`
${shippingErrorFragment}
mutation UpdateShippingZone($id: ID!, $input: ShippingZoneUpdateInput!) {
shippingZoneUpdate(id: $id, input: $input) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
shippingZone {
@ -160,7 +160,7 @@ const updateShippingRate = gql`
${shippingMethodFragment}
mutation UpdateShippingRate($id: ID!, $input: ShippingPriceInput!) {
shippingPriceUpdate(id: $id, input: $input) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
shippingMethod {
@ -180,7 +180,7 @@ const createShippingRate = gql`
${shippingZoneDetailsFragment}
mutation CreateShippingRate($input: ShippingPriceInput!) {
shippingPriceCreate(input: $input) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
shippingZone {
@ -202,7 +202,7 @@ const deleteShippingRate = gql`
${shippingZoneDetailsFragment}
mutation DeleteShippingRate($id: ID!) {
shippingPriceDelete(id: $id) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
shippingZone {
@ -220,7 +220,7 @@ const bulkDeleteShippingRate = gql`
${shippingErrorFragment}
mutation BulkDeleteShippingRate($ids: [ID]!) {
shippingPriceBulkDelete(ids: $ids) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
}
@ -242,7 +242,7 @@ export const shippingMethodChannelListingUpdate = gql`
shippingMethod {
...ShippingMethodFragment
}
errors: shippingErrors {
errors {
...ShippingChannelsErrorFragment
}
}
@ -261,7 +261,7 @@ export const shippingPriceExcludeProducts = gql`
$input: ShippingPriceExcludeProductsInput!
) {
shippingPriceExcludeProducts(id: $id, input: $input) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
}
@ -277,7 +277,7 @@ export const shippingPriceRemoveProductsFromExclude = gql`
${shippingErrorFragment}
mutation ShippingPriceRemoveProductFromExclude($id: ID!, $products: [ID]!) {
shippingPriceRemoveProductFromExclude(id: $id, products: $products) {
errors: shippingErrors {
errors {
...ShippingErrorFragment
}
}

View file

@ -10,7 +10,7 @@ import { WeightUnitsEnum } from "./../../types/globalTypes";
// ====================================================
export interface UpdateDefaultWeightUnit_shopSettingsUpdate_errors {
__typename: "Error";
__typename: "ShopError";
field: string | null;
message: string | null;
}

View file

@ -19,7 +19,7 @@ const shopSettingsUpdate = gql`
$addressInput: AddressInput
) {
shopSettingsUpdate(input: $shopSettingsInput) {
errors: shopErrors {
errors {
...ShopErrorFragment
}
shop {
@ -27,7 +27,7 @@ const shopSettingsUpdate = gql`
}
}
shopDomainUpdate(input: $shopDomainInput) {
errors: shopErrors {
errors {
...ShopErrorFragment
}
shop {
@ -38,7 +38,7 @@ const shopSettingsUpdate = gql`
}
}
shopAddressUpdate(input: $addressInput) {
errors: shopErrors {
errors {
...ShopErrorFragment
}
shop {

View file

@ -34,7 +34,7 @@ const staffMemberAddMutation = gql`
${staffMemberDetailsFragment}
mutation StaffMemberAdd($input: StaffCreateInput!) {
staffCreate(input: $input) {
errors: staffErrors {
errors {
...StaffErrorFragment
}
user {
@ -53,7 +53,7 @@ const staffMemberUpdateMutation = gql`
${staffMemberDetailsFragment}
mutation StaffMemberUpdate($id: ID!, $input: StaffUpdateInput!) {
staffUpdate(id: $id, input: $input) {
errors: staffErrors {
errors {
...StaffErrorFragment
}
user {
@ -71,7 +71,7 @@ const staffMemberDeleteMutation = gql`
${staffErrorFragment}
mutation StaffMemberDelete($id: ID!) {
staffDelete(id: $id) {
errors: staffErrors {
errors {
...StaffErrorFragment
}
}
@ -86,7 +86,7 @@ const staffAvatarUpdateMutation = gql`
${accountErrorFragment}
mutation StaffAvatarUpdate($image: Upload!) {
userAvatarUpdate(image: $image) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
user {
@ -107,7 +107,7 @@ const staffAvatarDeleteMutation = gql`
${accountErrorFragment}
mutation StaffAvatarDelete {
userAvatarDelete {
errors: accountErrors {
errors {
...AccountErrorFragment
}
user {
@ -128,7 +128,7 @@ const changeStaffPassword = gql`
${accountErrorFragment}
mutation ChangeStaffPassword($newPassword: String!, $oldPassword: String!) {
passwordChange(newPassword: $newPassword, oldPassword: $oldPassword) {
errors: accountErrors {
errors {
...AccountErrorFragment
}
}

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
// ====================================================
export interface FetchTaxes_shopFetchTaxRates_errors {
__typename: "Error";
__typename: "ShopError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { ShopSettingsInput } from "./../../types/globalTypes";
// ====================================================
export interface UpdateTaxSettings_shopSettingsUpdate_errors {
__typename: "Error";
__typename: "ShopError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { NameTranslationInput, LanguageCodeEnum } from "./../../types/globalType
// ====================================================
export interface UpdateAttributeTranslations_attributeTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { AttributeValueTranslationInput, LanguageCodeEnum } from "./../../types/
// ====================================================
export interface UpdateAttributeValueTranslations_attributeValueTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { TranslationInput, LanguageCodeEnum } from "./../../types/globalTypes";
// ====================================================
export interface UpdateCategoryTranslations_categoryTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { TranslationInput, LanguageCodeEnum } from "./../../types/globalTypes";
// ====================================================
export interface UpdateCollectionTranslations_collectionTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { PageTranslationInput, LanguageCodeEnum } from "./../../types/globalType
// ====================================================
export interface UpdatePageTranslations_pageTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { TranslationInput, LanguageCodeEnum } from "./../../types/globalTypes";
// ====================================================
export interface UpdateProductTranslations_productTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { NameTranslationInput, LanguageCodeEnum } from "./../../types/globalType
// ====================================================
export interface UpdateSaleTranslations_saleTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { ShippingPriceTranslationInput, LanguageCodeEnum } from "./../../types/g
// ====================================================
export interface UpdateShippingMethodTranslations_shippingPriceTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -10,7 +10,7 @@ import { NameTranslationInput, LanguageCodeEnum } from "./../../types/globalType
// ====================================================
export interface UpdateVoucherTranslations_voucherTranslate_errors {
__typename: "Error";
__typename: "TranslationError";
field: string | null;
message: string | null;
}

View file

@ -1049,7 +1049,6 @@ export interface AppFilterInput {
export interface AppInput {
name?: string | null;
isActive?: boolean | null;
permissions?: (PermissionEnum | null)[] | null;
}
@ -1104,7 +1103,6 @@ export interface AttributeFilterInput {
export interface AttributeInput {
slug: string;
value?: string | null;
values?: (string | null)[] | null;
}
@ -1623,7 +1621,6 @@ export interface ProductFilterInput {
hasCategory?: boolean | null;
attributes?: (AttributeInput | null)[] | null;
stockAvailability?: StockAvailability | null;
productType?: string | null;
stocks?: ProductStockFilterInput | null;
search?: string | null;
metadata?: (MetadataInput | null)[] | null;

View file

@ -21,12 +21,12 @@ const updateMetadata = gql`
$keysToDelete: [String!]!
) {
updateMetadata(id: $id, input: $input) {
errors: metadataErrors {
errors {
...MetadataErrorFragment
}
}
deleteMetadata(id: $id, keys: $keysToDelete) {
errors: metadataErrors {
errors {
...MetadataErrorFragment
}
item {
@ -52,12 +52,12 @@ const updatePrivateMetadata = gql`
$keysToDelete: [String!]!
) {
updatePrivateMetadata(id: $id, input: $input) {
errors: metadataErrors {
errors {
...MetadataErrorFragment
}
}
deletePrivateMetadata(id: $id, keys: $keysToDelete) {
errors: metadataErrors {
errors {
...MetadataErrorFragment
}
item {

View file

@ -20,7 +20,7 @@ const deleteWarehouse = gql`
${warehouseErrorFragment}
mutation WarehouseDelete($id: ID!) {
deleteWarehouse(id: $id) {
errors: warehouseErrors {
errors {
...WarehouseErrorFragment
}
}
@ -36,7 +36,7 @@ const createWarehouse = gql`
${warehouseErrorFragment}
mutation WarehouseCreate($input: WarehouseCreateInput!) {
createWarehouse(input: $input) {
errors: warehouseErrors {
errors {
...WarehouseErrorFragment
}
warehouse {
@ -55,7 +55,7 @@ const updateWarehouse = gql`
${warehouseErrorFragment}
mutation WarehouseUpdate($id: ID!, $input: WarehouseUpdateInput!) {
updateWarehouse(id: $id, input: $input) {
errors: warehouseErrors {
errors {
...WarehouseErrorFragment
}
warehouse {

Some files were not shown because too many files have changed in this diff Show more