Update schema (#1029)

* Update schema

* Update stories and changelog

* Update messages
This commit is contained in:
Dominik Żegleń 2021-03-31 15:11:58 +02:00 committed by GitHub
parent 6fdfcfe943
commit c1159861a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 335 additions and 13 deletions

View file

@ -27,6 +27,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Use default sort for search products list - #997 by @orzechdev
- Update CollectionBulkDelete error type - #1030 by @d-wysocki
- Remove mailing settings - #1027 by @dominik-zeglen
- Update schema to contain email plugin changes - #1029 by @dominik-zeglen
# 2.11.1

View file

@ -6829,6 +6829,10 @@
"context": "event",
"string": "Order updated"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_1616635110": {
"context": "event",
"string": "User notified"
},
"src_dot_webhooks_dot_components_dot_WebhookEvents_dot_2126893364": {
"context": "event",
"string": "Product variant updated"

View file

@ -74,6 +74,7 @@ input AccountInput {
lastName: String
defaultBillingAddress: AddressInput
defaultShippingAddress: AddressInput
languageCode: LanguageCodeEnum
}
type AccountRegister {
@ -87,6 +88,7 @@ input AccountRegisterInput {
email: String!
password: String!
redirectUrl: String
languageCode: LanguageCodeEnum
}
type AccountRequestDeletion {
@ -879,6 +881,7 @@ type Checkout implements Node & ObjectWithMetadata {
subtotalPrice: TaxedMoney
token: UUID!
totalPrice: TaxedMoney
languageCode: LanguageCodeEnum!
}
type CheckoutAddPromoCode {
@ -925,6 +928,7 @@ input CheckoutCreateInput {
email: String
shippingAddress: AddressInput
billingAddress: AddressInput
languageCode: LanguageCodeEnum
}
type CheckoutCustomerAttach {
@ -977,6 +981,12 @@ enum CheckoutErrorCode {
CHANNEL_INACTIVE
}
type CheckoutLanguageCodeUpdate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
checkout: Checkout
checkoutErrors: [CheckoutError!]!
}
type CheckoutLine implements Node {
id: ID!
variant: ProductVariant!
@ -1253,6 +1263,7 @@ input ConfigurationItemInput {
enum ConfigurationTypeFieldEnum {
STRING
MULTILINE
BOOLEAN
SECRET
PASSWORD
@ -1607,6 +1618,7 @@ input CustomerInput {
email: String
isActive: Boolean
note: String
languageCode: LanguageCodeEnum
}
type CustomerUpdate {
@ -2248,7 +2260,7 @@ type InvoiceRequestDelete {
invoice: Invoice
}
type InvoiceSendEmail {
type InvoiceSendNotification {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
invoiceErrors: [InvoiceError!]!
invoice: Invoice
@ -2757,7 +2769,7 @@ type Mutation {
invoiceCreate(input: InvoiceCreateInput!, orderId: ID!): InvoiceCreate
invoiceDelete(id: ID!): InvoiceDelete
invoiceUpdate(id: ID!, input: UpdateInvoiceInput!): InvoiceUpdate
invoiceSendEmail(id: ID!): InvoiceSendEmail
invoiceSendNotification(id: ID!): InvoiceSendNotification
giftCardActivate(id: ID!): GiftCardActivate
giftCardCreate(input: GiftCardCreateInput!): GiftCardCreate
giftCardDeactivate(id: ID!): GiftCardDeactivate
@ -2795,6 +2807,7 @@ type Mutation {
checkoutPaymentCreate(checkoutId: ID!, input: PaymentInput!): CheckoutPaymentCreate
checkoutShippingAddressUpdate(checkoutId: ID!, shippingAddress: AddressInput!): CheckoutShippingAddressUpdate
checkoutShippingMethodUpdate(checkoutId: ID, shippingMethodId: ID!): CheckoutShippingMethodUpdate
checkoutLanguageCodeUpdate(checkoutId: ID!, languageCode: LanguageCodeEnum!): CheckoutLanguageCodeUpdate
channelCreate(input: ChannelCreateInput!): ChannelCreate
channelUpdate(id: ID!, input: ChannelUpdateInput!): ChannelUpdate
channelDelete(id: ID!, input: ChannelDeleteInput): ChannelDelete
@ -2894,7 +2907,6 @@ type Order implements Node & ObjectWithMetadata {
created: DateTime!
status: OrderStatus!
user: User
languageCode: String!
trackingClientId: String!
billingAddress: Address
shippingAddress: Address
@ -2933,6 +2945,8 @@ type Order implements Node & ObjectWithMetadata {
totalBalance: Money!
userEmail: String
isShippingRequired: Boolean!
languageCode: String! @deprecated(reason: "Use the `languageCodeEnum` field to fetch the language code. This field will be removed in Saleor 4.0.")
languageCodeEnum: LanguageCodeEnum!
discount: Money @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.")
discountName: String @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.")
translatedDiscountName: String @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.")
@ -5497,6 +5511,7 @@ type User implements Node & ObjectWithMetadata {
avatar(size: Int): Image
events: [CustomerEvent]
storedPaymentSources: [PaymentSource]
languageCode: LanguageCodeEnum!
}
type UserAvatarDelete {
@ -5536,6 +5551,7 @@ input UserCreateInput {
email: String
isActive: Boolean
note: String
languageCode: LanguageCodeEnum
redirectUrl: String
}
@ -5950,6 +5966,7 @@ enum WebhookEventTypeEnum {
CHECKOUT_CREATED
CHECKOUT_UPDATED
FULFILLMENT_CREATED
NOTIFY_USER
PAGE_CREATED
PAGE_UPDATED
PAGE_DELETED
@ -5976,6 +5993,7 @@ enum WebhookSampleEventTypeEnum {
CHECKOUT_CREATED
CHECKOUT_UPDATED
FULFILLMENT_CREATED
NOTIFY_USER
PAGE_CREATED
PAGE_UPDATED
PAGE_DELETED

View file

@ -687,7 +687,7 @@ const invoiceEmailSendMutation = gql`
${invoiceErrorFragment}
${invoiceFragment}
mutation InvoiceEmailSend($id: ID!) {
invoiceSendEmail(id: $id) {
invoiceSendNotification(id: $id) {
errors: invoiceErrors {
...InvoiceErrorFragment
}

View file

@ -9,13 +9,13 @@ import { InvoiceErrorCode, JobStatusEnum } from "./../../types/globalTypes";
// GraphQL mutation operation: InvoiceEmailSend
// ====================================================
export interface InvoiceEmailSend_invoiceSendEmail_errors {
export interface InvoiceEmailSend_invoiceSendNotification_errors {
__typename: "InvoiceError";
code: InvoiceErrorCode;
field: string | null;
}
export interface InvoiceEmailSend_invoiceSendEmail_invoice {
export interface InvoiceEmailSend_invoiceSendNotification_invoice {
__typename: "Invoice";
id: string;
number: string | null;
@ -24,14 +24,14 @@ export interface InvoiceEmailSend_invoiceSendEmail_invoice {
status: JobStatusEnum;
}
export interface InvoiceEmailSend_invoiceSendEmail {
__typename: "InvoiceSendEmail";
errors: InvoiceEmailSend_invoiceSendEmail_errors[];
invoice: InvoiceEmailSend_invoiceSendEmail_invoice | null;
export interface InvoiceEmailSend_invoiceSendNotification {
__typename: "InvoiceSendNotification";
errors: InvoiceEmailSend_invoiceSendNotification_errors[];
invoice: InvoiceEmailSend_invoiceSendNotification_invoice | null;
}
export interface InvoiceEmailSend {
invoiceSendEmail: InvoiceEmailSend_invoiceSendEmail | null;
invoiceSendNotification: InvoiceEmailSend_invoiceSendNotification | null;
}
export interface InvoiceEmailSendVariables {

View file

@ -271,7 +271,7 @@ export const OrderDetailsMessages: React.FC<OrderDetailsMessages> = ({
}
};
const handleInvoiceSend = (data: InvoiceEmailSend) => {
const errs = data.invoiceSendEmail?.errors;
const errs = data.invoiceSendNotification?.errors;
if (errs.length === 0) {
pushMessage({
text: intl.formatMessage({

View file

@ -432,7 +432,7 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
<OrderInvoiceEmailSendDialog
confirmButtonState={orderInvoiceSend.opts.status}
errors={
orderInvoiceSend.opts.data?.invoiceSendEmail
orderInvoiceSend.opts.data?.invoiceSendNotification
.errors || []
}
open={params.action === "invoice-send"}

View file

@ -21681,6 +21681,47 @@ exports[`Storyshots Views / Apps / Webhooks / Create webhook default 1`] = `
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
@ -22973,6 +23014,47 @@ exports[`Storyshots Views / Apps / Webhooks / Create webhook form errors 1`] = `
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
@ -24281,6 +24363,49 @@ exports[`Storyshots Views / Apps / Webhooks / Create webhook loading 1`] = `
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id MuiFormControlLabel-disabled-id"
>
<span
aria-disabled="true"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id PrivateSwitchBase-disabled-id MuiCheckbox-disabled-id MuiIconButton-colorPrimary-id MuiIconButton-disabled-id MuiButtonBase-disabled-id"
tabindex="-1"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
disabled=""
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiFormControlLabel-disabled-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id MuiFormControlLabel-disabled-id"
@ -25612,6 +25737,47 @@ exports[`Storyshots Views / Apps / Webhooks / Webhook details default 1`] = `
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
@ -26910,6 +27076,47 @@ exports[`Storyshots Views / Apps / Webhooks / Webhook details form errors 1`] =
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
@ -28224,6 +28431,49 @@ exports[`Storyshots Views / Apps / Webhooks / Webhook details loading 1`] = `
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id MuiFormControlLabel-disabled-id"
>
<span
aria-disabled="true"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id PrivateSwitchBase-disabled-id MuiCheckbox-disabled-id MuiIconButton-colorPrimary-id MuiIconButton-disabled-id MuiButtonBase-disabled-id"
tabindex="-1"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
disabled=""
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiFormControlLabel-disabled-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id MuiFormControlLabel-disabled-id"
@ -29543,6 +29793,47 @@ exports[`Storyshots Views / Apps / Webhooks / Webhook details unnamed 1`] = `
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"
>
<span
aria-disabled="false"
class="MuiButtonBase-root-id MuiIconButton-root-id PrivateSwitchBase-root-id MuiCheckbox-root-id MuiCheckbox-colorPrimary-id MuiIconButton-colorPrimary-id"
>
<span
class="MuiIconButton-label-id"
>
<input
class="PrivateSwitchBase-input-id"
data-indeterminate="false"
name="NOTIFY_USER"
type="checkbox"
/>
<svg
aria-hidden="true"
class="MuiSvgIcon-root-id"
focusable="false"
viewBox="0 0 24 24"
>
<rect
fill="none"
height="14"
stroke="currentColor"
width="14"
x="5"
y="5"
/>
</svg>
</span>
</span>
<span
class="MuiTypography-root-id MuiFormControlLabel-label-id MuiTypography-body1-id"
>
User notified
</span>
</label>
</div>
<div>
<label
class="MuiFormControlLabel-root-id"

View file

@ -151,6 +151,7 @@ export enum CollectionSortField {
export enum ConfigurationTypeFieldEnum {
BOOLEAN = "BOOLEAN",
MULTILINE = "MULTILINE",
PASSWORD = "PASSWORD",
SECRET = "SECRET",
SECRETMULTILINE = "SECRETMULTILINE",
@ -999,6 +1000,7 @@ export enum WebhookEventTypeEnum {
INVOICE_DELETED = "INVOICE_DELETED",
INVOICE_REQUESTED = "INVOICE_REQUESTED",
INVOICE_SENT = "INVOICE_SENT",
NOTIFY_USER = "NOTIFY_USER",
ORDER_CANCELLED = "ORDER_CANCELLED",
ORDER_CONFIRMED = "ORDER_CONFIRMED",
ORDER_CREATED = "ORDER_CREATED",
@ -1247,6 +1249,7 @@ export interface CustomerInput {
email?: string | null;
isActive?: boolean | null;
note?: string | null;
languageCode?: LanguageCodeEnum | null;
}
export interface DateRangeInput {
@ -1866,6 +1869,7 @@ export interface UserCreateInput {
email?: string | null;
isActive?: boolean | null;
note?: string | null;
languageCode?: LanguageCodeEnum | null;
redirectUrl?: string | null;
}

View file

@ -143,6 +143,10 @@ const WebhookEvents: React.FC<WebhookEventsProps> = ({
[WebhookEventTypeEnum.PAGE_DELETED]: intl.formatMessage({
defaultMessage: "Page deleted",
description: "event"
}),
[WebhookEventTypeEnum.NOTIFY_USER]: intl.formatMessage({
defaultMessage: "User notified",
description: "event"
})
};