From 8f9c1ba19e654b1e469a755ee72631040ec684d4 Mon Sep 17 00:00:00 2001 From: Wojciech Mista Date: Tue, 25 Jan 2022 13:44:19 +0100 Subject: [PATCH] Gift cards post mvp (#1632) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add error message to invalid expiryDate (#1518) * Add error message to invalid expiryDate * Add default messages * Replace filter with some * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Gift card customer page (#1520) * Add gift cards card to customer page (#1456) * WIP * WIP * Extract activate/deactivate logic to a hook * add optional side action * Add query for customer's gift cards * Add component for giftcard status chip * Graphql run types * Add gift card card to customer page * Fix status chip header * Revert style change * Unify status chip logic * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Add queries to refetch prop * Simplify gift card list component * Fix order status chip * Extract messages to separate file * Remove unused lines of code * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Change variable name * Fix formatted message * Check if giftcards exist before rendering collection * Add loading button to CardMenu component (#1476) * WIP * WIP * Add gift card card to customer page * Fix status chip header * Fix naming scheme * Add currentOpts to act/deactivate gift cards hook * Remove unused lines of code * Revert style change * Tests and messages * Fix card list rendering * Type fix * Code review fixes * Review changes * Scripts * Add loading animation to card menu buttons * Added default messages * Change conditional prop checking to filtering * Issue gift card in customer page (#1468) * WIP * WIP * Replace typed query with make query * Add customer details context to customer page * Add context to customer gift cards * Disable customer select when initial customer is present * Pass initial customer to create gift card form * Fixes after cherry-pick * Code cleanup * Remove getInitialData function * Remove unused package * Remove new line * Post-rebase fixes * Code cleanup & extract messages * Remove unused code * Create customer details hook * Minor fixes * Update default messages * Update gift card types * Type fixes * Change directory of useCustomerDetails hook * CR Fixes * Update tests * Make PageTitleWithStatusChip use ExtendedPageHeader * Update tests * Update hook name * Post-rebase fixes * Eslint fix * Fix scrollbar appearing in menu issue (#1539) * Change displayCode to last4CodeChars (#1573) * Add filtered redirect to gift card page from customer details (#1556) * Limit number of channel list items (#1607) * Add max height to single select field menu items container * Add storybook case * Update stories tests * Fix gift card product changing to preorder on save issue (#1583) * Variant preorder fix * Global threshold input should be optional * update snapshot * Add displaying logic gift cards list toolbar (#1617) * add displaying logic for gift card toolbar * Logic fix * Handle bulk export after creation (#1544) * Add gift bulk create (#1490) * Add gift card bulk create dialog WIP * Update schema, add gift card bulk create mutation and types * Add gift card bulk create modal and mutation * Fix types and update messages * Refactor gift card bulk create * Add closing gift card bulk create dialog after success * Change gift card list closeDialog prop name to onClose * Review fixes * Review fixes * Add gift card export (#1499) * wip * Add exporting gift cards * Update messages * Fix types * Review fixes * Review fixes * Refactor passing messages to export settings component * Refactor * Update messages * Handle export after bulk gift card creation * Add default messages * Create an util function to get correct input for export * Update component's name * Change modal's title * Update messages Co-authored-by: Magdalena Markusik * Gift Card List item number change doesn't refetch fix (#1643) * Fix number of rows change not refetching list * Add pagination reset * Update descriptions for gift card messages to be more descriptive (#1648) * Gift card history timeline (#1597) * Update queries and mutations * Allow title to be a react node * Show user name if it exists in data object * Update types * Refresh queries on note add * Add gift card history * type fix * Update messages * Fix timeline note * Add event fragment to form update result * Update types * Fix typo * Update messages * Disable input if gift card is expired * Remove unused imports * CR Fixes * Change messages location * Change message to include user in order * Allow adding notes to expired gift cards * Fix disabled input showing dropdown issue (#1636) * On click is disabled when component is disabled * update tests * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Gift card filter in product list view (#1621) * Add GiftCard or Normal filter in Product List View * Fix tests * Fix type check * Don't filter if query param is not in enum * Update messages * Update tests * Code cleanup * Add default messages * Pass intl rather than initialise it in util * Post-rebase fixes * Change product type details messages (#1642) * Update product type gift card options messages * update tests * Add sorting to gift card list (#1569) * Update queries and types for sorting * Add optional handleError method to makeQuery * Add sorting to gift card list * Sorting hook uses useGiftCardList hook * Convert to boolean * Add default sorting field * format fix * Add expiry error handling for issuing gift cards (#1634) * Add expiry error handling for issuing gift cards * Add expiry error message to gift card bulk issue * Update Gift Card tag queries to utilise multiple tags (#1685) * Change displayCode to last4CodeChars (#1573) * Update types * WIP * Update gift card forms to utilise multiple tags * Code cleanup * Update gift card event types * Fixes * Change column with no click handler behaviour * Remove an ability to sort by tags * Remove unused code * Update tests * Update timeline events * Update messages * change array reduce to join * Add Y scroll to dialog content * Bulk create Y scroll fix * Endless loading fix (#1732) * Order filtering for gift cards in Order List View (#1628) * Add gift card order filter * Add gift card filter card in orders view * Bump macaw version * Update messages * Update tests * Code review changes * update messages * Change info card message to use only one message * Fix order gift card filter * Wip * Extract dialog component outside of gift card create * Update component's name * Extract dialog component outside of export component to provider * Update tests * Various gift card bugs fixes (#1749) * Change currency to options field * Fix hover and font size * Fix gift card list width * Fix bulk delete dialog * Allow balance to be sorted only when currency is filtered * Sorting by balance after removing currency filter defualts to usedBy * Fix trash icon * Add filter dependency * Fix single deletion with bulk * Update tests * Refactor Links used in Gift Cards * Fix export dialog (#1791) Co-authored-by: Magdalena Markusik --- fragmentTypes.json | 3 + locale/defaultMessages.json | 417 ++- package-lock.json | 17 - schema.graphql | 2631 ++++++++++++++--- src/components/CardMenu/CardMenu.tsx | 75 +- src/components/CardMenu/messages.ts | 8 + src/components/CardTitle/CardTitle.tsx | 5 + .../CollectionWithDividers.tsx | 43 +- src/components/ControlledCheckbox.tsx | 2 +- .../ExtendedPageHeader/ExtendedPageHeader.tsx | 15 +- .../PageTitleWithStatusChip.tsx | 22 +- .../SingleAutocompleteSelectField.stories.tsx | 15 +- .../SingleAutocompleteSelectField.tsx | 2 +- .../SingleSelectField/SingleSelectField.tsx | 10 + src/components/SingleSelectField/consts.ts | 1 + .../TableCellHeader/TableCellHeader.tsx | 14 +- src/components/Timeline/Timeline.tsx | 5 +- src/components/Timeline/TimelineEvent.tsx | 2 +- .../Timeline/TimelineEventHeader.tsx | 2 +- src/components/Timeline/TimelineNote.tsx | 12 +- .../CustomerDetailsPage.tsx | 3 + src/customers/hooks/useCustomerDetails.ts | 8 + .../providers/CustomerDetailsProvider.tsx | 40 + src/customers/queries.ts | 3 +- src/customers/views/CustomerDetails.tsx | 141 +- .../views/CustomerDetailsContent.tsx | 150 + .../GiftCardBulkCreateDialog.tsx | 162 + .../GiftCardBulkCreateDialogForm.tsx | 151 + .../GiftCardBulkCreateDialog/index.tsx | 2 + .../GiftCardBulkCreateDialog/messages.ts | 16 + .../GiftCardBulkCreateDialog/mutations.ts | 26 + .../GiftCardBulkCreateDialog/types.ts | 58 + .../types/GiftCardBulkCreate.ts | 35 + .../GiftCardBulkCreateDialog/utils.ts | 64 + .../ContentWithProgress.tsx | 2 +- .../GiftCardBulkCreateSuccessDialog.tsx | 69 + .../GiftCardCreateDialogCodeContent.tsx | 2 +- ...og.tsx => GiftCardCreateDialogContent.tsx} | 58 +- .../GiftCardCreateDialogForm.tsx | 86 +- .../GiftCardCreateExpirySelect.tsx | 23 +- .../GiftCardCreateExpirySelect/messages.ts | 8 +- ...Input.tsx => GiftCardCreateMoneyInput.tsx} | 28 +- ...iftCardCreateRequiresActivationSection.tsx | 34 + .../GiftCardCustomerSelectField.tsx | 7 +- src/giftCards/GiftCardCreateDialog/index.tsx | 4 +- .../GiftCardCreateDialog/messages.ts | 52 +- src/giftCards/GiftCardCreateDialog/styles.ts | 9 +- src/giftCards/GiftCardCreateDialog/types.ts | 8 +- src/giftCards/GiftCardCreateDialog/utils.ts | 43 +- .../GiftCardExportDialogContent.tsx | 160 + .../GiftCardExportDialogContent/index.tsx | 2 + .../GiftCardExportDialogContent/messages.ts | 29 + .../GiftCardExportDialogContent/mutations.ts | 27 + .../types/ExportGiftCards.ts | 35 + .../GiftCardExportDialogContent/utils.ts | 27 + .../GiftCardExpirySettingsCard/messages.ts | 5 +- src/giftCards/GiftCardSettings/messages.ts | 2 +- .../GiftCardHistory/GiftCardHistory.tsx | 226 ++ .../hooks/useGiftCardHistoryEvents.ts | 14 + .../GiftCardHistory/messages.ts | 62 + .../GiftCardUpdate/GiftCardHistory/styles.ts | 14 + .../GiftCardResendCodeDialog.tsx | 11 +- .../GiftCardResendCodeDialog/messages.ts | 14 +- .../types/GiftCardResend.ts | 9 +- .../GiftCardUpdateBalanceDialog.tsx | 10 +- .../GiftCardUpdateBalanceDialog/messages.ts | 9 +- .../GiftCardUpdateDetailsCard.tsx | 12 +- .../GiftCardUpdateDetailsCard/messages.ts | 8 +- .../GiftCardUpdateExpirySelect/messages.ts | 6 +- .../GiftCardUpdateInfoCardContent.tsx | 14 +- .../GiftCardUpdateInfoCard/messages.ts | 16 +- .../GiftCardUpdate/GiftCardUpdatePage.tsx | 2 + .../GiftCardEnableDisableSection.tsx | 61 +- .../GiftCardUpdatePageHeader.tsx | 39 +- .../hooks/useGiftCardActivateToggle.ts | 95 + .../GiftCardUpdatePageHeader/messages.ts | 10 +- .../types/GiftCardActivate.ts | 9 +- .../types/GiftCardDeactivate.ts | 9 +- src/giftCards/GiftCardUpdate/messages.ts | 10 +- src/giftCards/GiftCardUpdate/mutations.ts | 35 +- .../GiftCardUpdateDialogsProvider.tsx | 12 +- .../GiftCardUpdateFormProvider.tsx | 49 +- src/giftCards/GiftCardUpdate/queries.ts | 51 +- .../GiftCardUpdate/types/GiftCardAddNote.ts | 173 ++ .../GiftCardUpdate/types/GiftCardData.ts | 9 +- .../GiftCardUpdate/types/GiftCardDetails.ts | 15 +- .../GiftCardUpdate/types/GiftCardEvent.ts | 73 + .../GiftCardUpdate/types/GiftCardUpdate.ts | 75 +- .../GiftCardsList/GiftCardListPage.tsx | 4 + .../GiftCardListSearchAndFilters.tsx | 8 +- .../GiftCardListSearchAndFilters/filters.ts | 19 +- .../GiftCardListSearchAndFilters/messages.ts | 8 +- .../GiftCardsListHeader.tsx | 26 +- .../GiftCardsListHeaderAlert.tsx | 16 - .../GiftCardsListHeaderAlertContent.tsx | 22 +- .../GiftCardsListOrderInfoCard.tsx | 25 + .../GiftCardsListOrderInfoCard/messages.ts | 9 + .../GiftCardsListTable/GiftCardsListTable.tsx | 216 +- .../BulkEnableDisableSection.tsx | 45 +- .../GiftCardsListTableHeader.tsx | 52 +- .../GiftCardsListTableHeader/messages.ts | 16 +- .../GiftCardsList/GiftCardsListTable/utils.ts | 13 + src/giftCards/GiftCardsList/messages.ts | 49 +- .../GiftCardListDialogsProvider.tsx | 57 +- .../hooks/useGiftCardListSort.ts | 14 + .../GiftCardListProvider.tsx | 51 +- .../hooks/useGiftCardList.ts | 10 +- .../providers/GiftCardListProvider/sort.ts | 23 + .../providers/GiftCardsListProvider.tsx | 98 - .../providers/hooks/useGiftCardList.ts | 37 - .../hooks/useGiftCardListBulkActions.ts | 32 - src/giftCards/GiftCardsList/queries.ts | 22 +- src/giftCards/GiftCardsList/sort.ts | 13 + src/giftCards/GiftCardsList/styles.ts | 2 +- src/giftCards/GiftCardsList/types.ts | 16 +- .../GiftCardsList/types/GiftCardList.ts | 13 +- .../GiftCardsList/types/GiftCardTotalCount.ts | 17 + .../CustomerGiftCardsCard.tsx | 123 + .../CustomerGiftCardsCardListItem.tsx | 124 + .../GiftCardCustomerCard/messages.ts | 24 + .../GiftCardCustomerCard/queries.ts | 34 + .../components/GiftCardCustomerCard/styles.ts | 32 + .../types/CustomerGiftCardList.ts | 44 + .../GiftCardDeleteDialogContent.tsx | 24 +- .../GiftCardListPageDeleteDialog.tsx | 27 +- .../GiftCardUpdatePageDeleteDialog.tsx | 10 +- .../GiftCardDeleteDialog/messages.ts | 10 +- .../GiftCardSendToCustomer.tsx | 6 +- .../GiftCardSendToCustomer/messages.ts | 8 +- .../GiftCardStatusChip/GiftCardStatusChip.tsx | 50 + .../GiftCardTagInput/GiftCardTagInput.tsx | 58 +- .../components/GiftCardTagInput/messages.ts | 2 +- .../types/SearchGiftCardTags.ts | 8 +- .../GiftCardTagInput/useGiftCardTagsSearch.ts | 6 +- .../components/GiftCardTagInput/utils.ts | 9 + .../components/TimePeriodField/messages.ts | 8 +- src/giftCards/index.tsx | 12 +- src/hooks/makeQuery.ts | 18 +- src/icons/Trash.tsx | 6 +- src/misc.ts | 4 + .../OrderDetailsPage/OrderDetailsPage.tsx | 9 +- src/orders/components/OrderHistory/Label.tsx | 2 +- .../components/OrderListPage/filters.ts | 42 +- .../OrderStatusChip.tsx} | 16 +- src/orders/urls.ts | 9 +- .../__snapshots__/filters.test.ts.snap | 6 +- src/orders/views/OrderList/filters.test.ts | 9 +- src/orders/views/OrderList/filters.ts | 24 +- .../ProductTypeDetails/ProductTypeDetails.tsx | 9 +- .../components/ProductTypeDetails/messages.ts | 12 +- ...gSettings.tsx => ExportDialogSettings.tsx} | 139 +- .../ProductExportDialog.tsx | 57 +- .../ProductExportDialog/messages.ts | 17 +- .../components/ProductExportDialog/types.ts | 21 + .../components/ProductListPage/filters.ts | 18 +- .../ProductStocks/ProductStocks.tsx | 1 - src/products/index.tsx | 3 +- src/products/urls.ts | 3 +- .../views/ProductList/ProductList.tsx | 4 + .../__snapshots__/filters.test.ts.snap | 3 +- src/products/views/ProductList/filters.ts | 14 + src/products/views/ProductList/fixtures.ts | 10 + src/products/views/ProductList/messages.ts | 12 + src/products/views/ProductList/utils.ts | 46 + .../views/ProductUpdate/handlers/utils.ts | 14 +- src/products/views/ProductVariantCreate.tsx | 2 +- .../__snapshots__/Stories.test.ts.snap | 1395 ++++++--- .../stories/components/SingleSelectField.tsx | 26 + .../stories/orders/OrderListPage.tsx | 5 + src/types/globalTypes.ts | 41 +- src/utils/handlers/dialogActionHandlers.ts | 5 - src/utils/maps.ts | 16 + 172 files changed, 7497 insertions(+), 2105 deletions(-) create mode 100644 src/components/CardMenu/messages.ts create mode 100644 src/components/SingleSelectField/consts.ts create mode 100644 src/customers/hooks/useCustomerDetails.ts create mode 100644 src/customers/providers/CustomerDetailsProvider.tsx create mode 100644 src/customers/views/CustomerDetailsContent.tsx create mode 100644 src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx create mode 100644 src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx create mode 100644 src/giftCards/GiftCardBulkCreateDialog/index.tsx create mode 100644 src/giftCards/GiftCardBulkCreateDialog/messages.ts create mode 100644 src/giftCards/GiftCardBulkCreateDialog/mutations.ts create mode 100644 src/giftCards/GiftCardBulkCreateDialog/types.ts create mode 100644 src/giftCards/GiftCardBulkCreateDialog/types/GiftCardBulkCreate.ts create mode 100644 src/giftCards/GiftCardBulkCreateDialog/utils.ts create mode 100644 src/giftCards/GiftCardCreateDialog/GiftCardBulkCreateSuccessDialog.tsx rename src/giftCards/GiftCardCreateDialog/{GiftCardCreateDialog.tsx => GiftCardCreateDialogContent.tsx} (68%) rename src/giftCards/GiftCardCreateDialog/{GiftCardCreateDialogMoneyInput.tsx => GiftCardCreateMoneyInput.tsx} (71%) create mode 100644 src/giftCards/GiftCardCreateDialog/GiftCardCreateRequiresActivationSection.tsx create mode 100644 src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx create mode 100644 src/giftCards/GiftCardExportDialogContent/index.tsx create mode 100644 src/giftCards/GiftCardExportDialogContent/messages.ts create mode 100644 src/giftCards/GiftCardExportDialogContent/mutations.ts create mode 100644 src/giftCards/GiftCardExportDialogContent/types/ExportGiftCards.ts create mode 100644 src/giftCards/GiftCardExportDialogContent/utils.ts create mode 100644 src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx create mode 100644 src/giftCards/GiftCardUpdate/GiftCardHistory/hooks/useGiftCardHistoryEvents.ts create mode 100644 src/giftCards/GiftCardUpdate/GiftCardHistory/messages.ts create mode 100644 src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts create mode 100644 src/giftCards/GiftCardUpdate/GiftCardUpdatePageHeader/hooks/useGiftCardActivateToggle.ts create mode 100644 src/giftCards/GiftCardUpdate/types/GiftCardAddNote.ts create mode 100644 src/giftCards/GiftCardUpdate/types/GiftCardEvent.ts create mode 100644 src/giftCards/GiftCardsList/GiftCardsListOrderInfoCard/GiftCardsListOrderInfoCard.tsx create mode 100644 src/giftCards/GiftCardsList/GiftCardsListOrderInfoCard/messages.ts create mode 100644 src/giftCards/GiftCardsList/GiftCardsListTable/utils.ts create mode 100644 src/giftCards/GiftCardsList/providers/GiftCardListDialogsProvider/hooks/useGiftCardListSort.ts create mode 100644 src/giftCards/GiftCardsList/providers/GiftCardListProvider/sort.ts delete mode 100644 src/giftCards/GiftCardsList/providers/GiftCardsListProvider.tsx delete mode 100644 src/giftCards/GiftCardsList/providers/hooks/useGiftCardList.ts delete mode 100644 src/giftCards/GiftCardsList/providers/hooks/useGiftCardListBulkActions.ts create mode 100644 src/giftCards/GiftCardsList/sort.ts create mode 100644 src/giftCards/GiftCardsList/types/GiftCardTotalCount.ts create mode 100644 src/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCard.tsx create mode 100644 src/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCardListItem.tsx create mode 100644 src/giftCards/components/GiftCardCustomerCard/messages.ts create mode 100644 src/giftCards/components/GiftCardCustomerCard/queries.ts create mode 100644 src/giftCards/components/GiftCardCustomerCard/styles.ts create mode 100644 src/giftCards/components/GiftCardCustomerCard/types/CustomerGiftCardList.ts create mode 100644 src/giftCards/components/GiftCardStatusChip/GiftCardStatusChip.tsx create mode 100644 src/giftCards/components/GiftCardTagInput/utils.ts rename src/orders/components/{OrderDetailsPage/Title.tsx => OrderStatusChip/OrderStatusChip.tsx} (53%) rename src/products/components/ProductExportDialog/{ProductExportDialogSettings.tsx => ExportDialogSettings.tsx} (51%) create mode 100644 src/products/components/ProductExportDialog/types.ts create mode 100644 src/products/views/ProductList/messages.ts create mode 100644 src/products/views/ProductList/utils.ts diff --git a/fragmentTypes.json b/fragmentTypes.json index 9142a7045..964e57f82 100644 --- a/fragmentTypes.json +++ b/fragmentTypes.json @@ -131,6 +131,9 @@ { "name": "GiftCardEvent" }, + { + "name": "GiftCardTag" + }, { "name": "Group" }, diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index d41afdcb8..dd8396de0 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -1966,6 +1966,10 @@ "context": "unassign multiple attributes from item", "string": "{counter,plural,one{Are you sure you want to unassign this attribute from {itemTypeName}?} other{Are you sure you want to unassign {attributeQuantity} attributes from {itemTypeName}?}}" }, + "src_dot_components_dot_CardMenu_dot_cardMenuItemLoading": { + "context": "menu item loading", + "string": "working..." + }, "src_dot_components_dot_ChannelsAvailabilityCard_dot_3326160357": { "context": "section header", "string": "Availability" @@ -3509,215 +3513,336 @@ "context": "gift cards section name", "string": "Gift Cards" }, + "src_dot_giftCards_dot_GiftCardBulkCreateDialog_dot_createdSuccessAlertDescription": { + "context": "bulk issue gift cards success alert description", + "string": "Requested {cardsAmount} were successfully issued" + }, + "src_dot_giftCards_dot_GiftCardBulkCreateDialog_dot_createdSuccessAlertTitle": { + "context": "bulk issue gift cards success alert title", + "string": "Gift Cards Issued" + }, + "src_dot_giftCards_dot_GiftCardBulkCreateDialog_dot_title": { + "context": "bulk issue gift cards dialog title", + "string": "Bulk Issue Gift Cards" + }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_GiftCardCreateExpirySelect_dot_expiryDateLabel": { - "context": "GiftCarUpdateDetailsExpirySection expiry date label", + "context": "expiry date label", "string": "Exact date" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_GiftCardCreateExpirySelect_dot_expiryOnLabel": { - "context": "GiftCarUpdateDetailsExpirySection expiry on label", + "context": "expires on label", "string": "Will expire on:" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_GiftCardCreateExpirySelect_dot_expiryPeriodLabel": { - "context": "GiftCarUpdateDetailsExpirySection expiry period label", + "context": "expires in label", "string": "Expires in" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_GiftCardCreateExpirySelect_dot_expirySelectedLabel": { - "context": "GiftCarUpdateDetailsExpirySection expiry selected label", + "context": "set expiry date selected label", "string": "Set gift card expiry date" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_amountLabel": { - "context": "GiftCardCreateDialog amount label", + "context": "money amount input label", "string": "Enter amount" }, + "src_dot_giftCards_dot_GiftCardCreateDialog_dot_bulkCreateExplanation": { + "context": "gift card bulk create modal bottom explanation", + "string": "After creation Saleor will create a list of gift card codes that you will be able to download. " + }, + "src_dot_giftCards_dot_GiftCardCreateDialog_dot_bulkCreateIssuedAccept": { + "context": "gift card bulk create success dialog accept button", + "string": "Ok" + }, + "src_dot_giftCards_dot_GiftCardCreateDialog_dot_bulkCreateIssuedExplanation": { + "context": "gift card bulk create success dialog content", + "string": "We have issued all of your requested gift cards. You can download the list of new gift cards using the button below." + }, + "src_dot_giftCards_dot_GiftCardCreateDialog_dot_bulkCreateIssuedExportToEmail": { + "context": "gift card bulk create success dialog export button", + "string": "Export To Email" + }, + "src_dot_giftCards_dot_GiftCardCreateDialog_dot_bulkCreateIssuedTitle": { + "context": "gift card bulk create success dialog title", + "string": "Bulk Issue Gift Cards" + }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_copiedToClipboardTitle": { - "context": "GiftCardCreateDialog copied to clipboard title", + "context": "copied to clipboard alert title", "string": "Copied to clipboard" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_copyCodeLabel": { - "context": "GiftCardCreateDialog copy code label", + "context": "copy code button label", "string": "Copy code" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_createdGiftCardLabel": { - "context": "GiftCardCreateDialog created gift card label", + "context": "created gift card code label", "string": "This is the code of a created gift card:" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_createdSuccessAlertTitle": { - "context": "GiftCardCreateDialog createdSuccessAlertTitle", + "context": "successfully created gift card alert title", "string": "Successfully created gift card" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_customerLabel": { - "context": "GiftCardCreateDialog customer label", + "context": "customer input label", "string": "Customer" }, + "src_dot_giftCards_dot_GiftCardCreateDialog_dot_giftCardsAmountLabel": { + "context": "issued cards amount label", + "string": "Cards Issued" + }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_issueButtonLabel": { - "context": "GiftCardCreateDialog issue button label", + "context": "issue gift card button label", "string": "Issue" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_noteLabel": { - "context": "GiftCardCreateDialog note label", + "context": "note input label", "string": "Note" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_noteSubtitle": { - "context": "GiftCardCreateDialog note subtitle", + "context": "note input subtitle", "string": "Why was this gift card issued. This note will not be shown to the customer. Note will be stored in gift card history" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_requiresActivationCaption": { - "context": "GiftCarUpdateDetailsExpirySection requires activation caption", + "context": "requires activation checkbox caption", "string": "All issued cards require activation by staff before use." }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_requiresActivationLabel": { - "context": "GiftCarUpdateDetailsExpirySection requires activation label", + "context": "requires activation checkbox label", "string": "Requires activation" }, "src_dot_giftCards_dot_GiftCardCreateDialog_dot_title": { - "context": "GiftCardCreateDialog title", + "context": "issue gift card dialog title", "string": "Issue gift card" }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_2086397658": { + "context": "export all items to csv file", + "string": "All gift cards ({number})" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_701638571": { + "context": "export selected items to csv file", + "string": "Selected giftCards ({number})" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_confirmButtonLabel": { + "context": "gift card export dialog confirm button label", + "string": "Export codes" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_exportNote": { + "context": "note on export gift cards", + "string": "Note: Only active and not used gift cards will be expored" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_exportTypeLabel": { + "context": "gift card export type label", + "string": "gift cards" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_successAlertDescription": { + "context": "gift card export success alert description", + "string": "We are currently exporting your gift card codes. As soon as your file is available it will be sent to your email address" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_successAlertTitle": { + "context": "gift card export csv success alert title", + "string": "Exporting CSV" + }, + "src_dot_giftCards_dot_GiftCardExportDialogContent_dot_title": { + "context": "gift card export dialog title", + "string": "Export Gift Card Codes" + }, "src_dot_giftCards_dot_GiftCardSettings_dot_GiftCardExpirySettingsCard_dot_expiryDateSectionDescription": { + "context": "expiry date selection info message", "string": "You can set gift cards to expire after a certain time after their purchase. Remember that in some countries, gift cards expiry is prohibited by law." }, "src_dot_giftCards_dot_GiftCardSettings_dot_GiftCardExpirySettingsCard_dot_expiryDateTitle": { - "context": "section header", + "context": "expiry date section header", "string": "Expiry date" }, "src_dot_giftCards_dot_GiftCardSettings_dot_title": { - "context": "header", + "context": "gift card settings header", "string": "Gift Cards Settings" }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardActivated": { + "context": "gift card history message", + "string": "Gift card was activated by {activatedBy}" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardBalanceReset": { + "context": "gift card history message", + "string": "Gift card balance was reset by {resetBy}" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardBought": { + "context": "gift card history message", + "string": "Gift card was bought in order {orderNumber}" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardDeactivated": { + "context": "gift card history message", + "string": "Gift card was deactivated by {deactivatedBy}" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardExpiryDateUpdate": { + "context": "gift card history message", + "string": "Gift card expiry date was updated by {expiryUpdatedBy}" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardIssued": { + "context": "dsc", + "string": "Gift card was issued by {issuedBy}" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardResent": { + "context": "gift card history message", + "string": "Gift card was resent" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardSentToCustomer": { + "context": "gift card history message", + "string": "Gift card was sent to customer" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardTagsUpdated": { + "context": "gift card history message", + "string": "Gift card tags were updated" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_giftCardUsedInOrder": { + "context": "gift card history message", + "string": "Gift card was used as a payment method on order {orderLink} by" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_historyHeaderTitle": { + "context": "section header title", + "string": "Gift Card Timeline" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_noteAddError": { + "context": "notifier message", + "string": "There was an error adding a note" + }, + "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardHistory_dot_noteAddedSuccessfully": { + "context": "notifier message", + "string": "Note was added sucessfully" + }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_consentCheckboxLabel": { - "context": "GiftCardResendCodeDialog consentCheckboxLabel", + "context": "consent to send gift card to different address checkbox label", "string": "Yes, I want to send gift card to different address" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_description": { - "context": "GiftCardResendCodeDialog description", + "context": "resend code to customer description", "string": "Gift Card Code will be resent to email provided during checkout. You can provide a different email address if you want to:" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_emailInputPlaceholder": { - "context": "GiftCardResendCodeDialog emailInputPlaceholder", + "context": "provided email input placeholder", "string": "Provided email address" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_sendToChannelSelectLabel": { - "context": "ChannelPickerSelectField sendToChannelLabel", + "context": "send to channel select label", "string": "Send to channel" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_submitButtonLabel": { - "context": "GiftCardResendCodeDialog submitButtonLabel", + "context": "resend button label", "string": "Resend" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_successResendAlertText": { - "context": "GiftCardResendCodeDialog successResendAlertText", + "context": "resent code success message", "string": "Successfully resent code to customer!" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardResendCodeDialog_dot_title": { - "context": "GiftCardResendCodeDialog title", + "context": "resend code to customer title", "string": "Resend code to customer" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateBalanceDialog_dot_changeButtonLabel": { - "context": "GiftCardUpdateDetailsCard set balance dialog change button label", + "context": "change button label", "string": "Change" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateBalanceDialog_dot_subtitle": { - "context": "GiftCardUpdateDetailsCard set balance dialog subtitle", + "context": "set balance dialog subtitle", "string": "What would you like to set cards balance to. When you change the balance both values will be changed" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateBalanceDialog_dot_title": { - "context": "GiftCardUpdateDetailsCard set balance button label", + "context": "set balance dialog title label", "string": "Set balance" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateBalanceDialog_dot_updatedSuccessAlertTitle": { - "context": "GiftCardUpdateDetailsCard update success alert title", + "context": "card update success alert title", "string": "Successfully updated card balance" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateDetailsCard_dot_cardBalanceLabel": { - "context": "GiftCardUpdateDetailsCard card balance label", + "context": "card balance label", "string": "Card Balance" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateDetailsCard_dot_setBalanceButtonLabel": { - "context": "GiftCardUpdateDetailsCard set balance button label", + "context": "set balance button label", "string": "set balance" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateDetailsCard_dot_tagInputLabel": { - "context": "GiftCardTagInput tag label", + "context": "tag label", "string": "Card Tag" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateDetailsCard_dot_title": { - "context": "GiftCardUpdateDetailsCard title", + "context": "details title", "string": "Details" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateExpirySelect_dot_expiredOnLabel": { - "context": "GiftCarUpdateDetailsExpirySection expired on label", + "context": "expired on label", "string": "Expired on {date}" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateExpirySelect_dot_expiryDateCheckboxLabel": { - "context": "GiftCarUpdateDetailsExpirySection expiry date checkbox label", + "context": "expiry date checkbox label", "string": "Gift card expires" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateExpirySelect_dot_expiryDateLabel": { - "context": "GiftCarUpdateDetailsExpirySection expiry date label", + "context": "expiration date label", "string": "Expiration date" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_boughtByLabel": { - "context": "GiftCardUpdateInfoCard bought by label", + "context": "bought by label", "string": "Bought by" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_creationLabel": { - "context": "GiftCardUpdateInfoCard creation label", + "context": "creation label", "string": "Creation" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_issuedByAppLabel": { - "context": "GiftCardUpdateInfoCard issued by app label", + "context": "issued by app label", "string": "Issued by app" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_issuedByLabel": { - "context": "GiftCardUpdateInfoCard issued by label", + "context": "issued by label", "string": "Issued by" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_orderNumberLabel": { - "context": "GiftCardUpdateInfoCard order number label", + "context": "order number label", "string": "Order number" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_productLabel": { - "context": "GiftCardUpdateInfoCard product label", + "context": "product label", "string": "Product bought to get gift card" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_title": { - "context": "GiftCardUpdateInfoCard title", + "context": "info card title", "string": "Card information" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdateInfoCard_dot_usedByLabel": { - "context": "GiftCardUpdateInfoCard used by label", + "context": "used by label", "string": "Used by" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdatePageHeader_dot_disabledStatusLabel": { - "context": "giftCardUpdatePageHeader disabled status label", + "context": "disabled status label", "string": "Disabled" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdatePageHeader_dot_expiredStatusLabel": { - "context": "giftCardUpdatePageHeader expired status label", + "context": "expired status label", "string": "Expired" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdatePageHeader_dot_resendButtonLabel": { - "context": "giftCardUpdatePageHeader resendButtonLabel", + "context": "resend code label", "string": "Resend code" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdatePageHeader_dot_successfullyDisabledTitle": { - "context": "GiftCardEnableDisableSection disable success", + "context": "success gift card disable message", "string": "Successfully disabled gift card" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_GiftCardUpdatePageHeader_dot_successfullyEnabledTitle": { - "context": "GiftCardEnableDisableSection enable success", + "context": "success gift card enable message", "string": "Successfully enabled gift card" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_notFound": { - "context": "giftCardErrorMessages not found", + "context": "gift card not found message", "string": "Couldn't find gift card" }, "src_dot_giftCards_dot_GiftCardUpdate_dot_title": { - "context": "GiftCardUpdateDetailsCard title", + "context": "title", "string": "Details" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_balanceAmount": { - "context": "Filter balance amount error", + "context": "balance amound missing error message", "string": "Balance amount is missing" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_balanceAmountLabel": { @@ -3725,7 +3850,7 @@ "string": "Amount" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_balanceCurrency": { - "context": "Filter balance currency error", + "context": "balance curreny missing error message", "string": "Balance currency is missing" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_currencyLabel": { @@ -3737,7 +3862,7 @@ "string": "Current balance" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_defaultTabLabel": { - "context": "gift card default tab label", + "context": "all gift cards label", "string": "All Gift Cards" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_disabledOptionLabel": { @@ -3757,7 +3882,7 @@ "string": "Product" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_searchPlaceholder": { - "context": "gift card search placeholder", + "context": "search gift card placeholder", "string": "Search Gift Cards, e.g {exampleGiftCardCode}" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardListSearchAndFilters_dot_statusLabel": { @@ -3772,136 +3897,172 @@ "context": "used by filter label", "string": "Used by" }, + "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListOrderInfoCard_dot_giftCardOrderInfoMessage": { + "context": "alert card message", + "string": "Gift cards will appear after their order is fullfilled. View Orders with Gift Cards" + }, + "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_deleteLabel": { + "context": "bulk delete label", + "string": "Delete" + }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_disableLabel": { - "context": "GiftCardEnableDisableSection enable label", + "context": "bulk disable label", "string": "Deactivate" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_enableLabel": { - "context": "GiftCardEnableDisableSection enable label", + "context": "bulk activate label", "string": "Activate" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_errorActivateAlertText": { - "context": "GiftCardEnableDisableSection error activate alert text", + "context": "error with activatation alert message", "string": "Error activating gift {count,plural,one{card} other{cards}}" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_errorDeactivateAlertText": { - "context": "GiftCardEnableDisableSection error activate alert text", + "context": "error with deactivatation alert message", "string": "Errors deactivating gift {count,plural,one{card} other{cards}}" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_successActivateAlertText": { - "context": "GiftCardEnableDisableSection success activate alert text", + "context": "success activate alert message", "string": "Successfully activated gift {count,plural,one{card} other{cards}}" }, "src_dot_giftCards_dot_GiftCardsList_dot_GiftCardsListTable_dot_GiftCardsListTableHeader_dot_successDeactivateAlertText": { - "context": "GiftCardEnableDisableSection success activate alert text", + "context": "success deactivate alert message", "string": "Successfully deactivated gift {count,plural,one{card} other{cards}}" }, "src_dot_giftCards_dot_GiftCardsList_dot_bulkIssue": { - "context": "GiftCardsListHeader menu item settings", + "context": "bulk issue menu item", "string": "Bulk Issue" }, "src_dot_giftCards_dot_GiftCardsList_dot_codeEndingWithLabel": { - "context": "GiftCardsListTable code ending with label", - "string": "Code ending with {displayCode}" + "context": "code ending with label", + "string": "Code ending with {last4CodeChars}" }, "src_dot_giftCards_dot_GiftCardsList_dot_createGiftCardProduct": { - "context": "GiftCardsListHeader alert", + "context": "create gift card product alert message", "string": "Create a gift card product" }, "src_dot_giftCards_dot_GiftCardsList_dot_createGiftCardProductType": { - "context": "GiftCardsListHeader alert", + "context": "create gift card product type alert message", "string": "Create a gift card product type" }, "src_dot_giftCards_dot_GiftCardsList_dot_exportCodes": { - "context": "GiftCardsListHeader menu item settings", + "context": "export card codes menu item", "string": "Export card codes" }, + "src_dot_giftCards_dot_GiftCardsList_dot_giftCardInvalidExpiryDateContent": { + "context": "invalid date in expirydate field content", + "string": "Gift Card with past expiration date cannot be created" + }, + "src_dot_giftCards_dot_GiftCardsList_dot_giftCardInvalidExpiryDateHeader": { + "context": "invalid date in expirydate field header", + "string": "Incorrect date entered" + }, "src_dot_giftCards_dot_GiftCardsList_dot_giftCardProduct": { - "context": "GiftCardsListHeader alert", + "context": "gift card product message", "string": "gift card product" }, "src_dot_giftCards_dot_GiftCardsList_dot_giftCardsTableColumnBalanceTitle": { - "context": "GiftCardsListTable column title balance", + "context": "column title balance", "string": "Balance" }, "src_dot_giftCards_dot_GiftCardsList_dot_giftCardsTableColumnCustomerTitle": { - "context": "GiftCardsListTable column title customer", + "context": "column title used by/customer", "string": "Used by" }, "src_dot_giftCards_dot_GiftCardsList_dot_giftCardsTableColumnGiftCardTitle": { - "context": "GiftCardsListTable column title gift card", + "context": "column title gift card", "string": "Gift Card" }, "src_dot_giftCards_dot_GiftCardsList_dot_giftCardsTableColumnProductTitle": { - "context": "GiftCardsListTable column title product", + "context": "column title product", "string": "Product" }, "src_dot_giftCards_dot_GiftCardsList_dot_giftCardsTableColumnTagTitle": { - "context": "GiftCardsListTable column title tag", + "context": "column title tag", "string": "Tag" }, "src_dot_giftCards_dot_GiftCardsList_dot_issueButtonLabel": { - "context": "GiftCardsListHeader issue button label", + "context": "issue card button label", "string": "Issue card" }, "src_dot_giftCards_dot_GiftCardsList_dot_noGiftCardsAlertTitle": { - "context": "GiftCardsListHeader alert", + "context": "no card defuned alert message", "string": "You haven’t defined a gift card product!" }, "src_dot_giftCards_dot_GiftCardsList_dot_noGiftCardsFound": { - "context": "GiftCardsListTable no cards found title", + "context": "no cards found title message", "string": "No gift cards found" }, "src_dot_giftCards_dot_GiftCardsList_dot_noGiftCardsProductTypes": { - "context": "GiftCardsListHeader alert", + "context": "no gift card product types alert message", "string": "{createGiftCardProductType} to start selling gift cards in your store." }, "src_dot_giftCards_dot_GiftCardsList_dot_noGiftCardsProducts": { - "context": "GiftCardsListHeader alert", + "context": "no gift card products alert message", "string": "{createGiftCardProduct} to start selling gift cards in your store." }, "src_dot_giftCards_dot_GiftCardsList_dot_noGiftCardsProductsAndProductTypes": { - "context": "GiftCardsListHeader alert", + "context": "no gift card products and types alert message", "string": "{createGiftCardProductType} and {giftCardProduct} to start selling gift cards in your store." }, "src_dot_giftCards_dot_GiftCardsList_dot_settings": { - "context": "GiftCardsListHeader menu item settings", + "context": "settings menu item", "string": "Settings" }, + "src_dot_giftCards_dot_components_dot_GiftCardCustomerCard_dot_customerGiftCardsAbsentSubtitle": { + "context": "customer gift cards card no cards subtitle", + "string": "There are no gift cards assigned to this customer" + }, + "src_dot_giftCards_dot_components_dot_GiftCardCustomerCard_dot_customerGiftCardsCardTitle": { + "context": "customer gift cards card title", + "string": "Gift Cards" + }, + "src_dot_giftCards_dot_components_dot_GiftCardCustomerCard_dot_customerGiftCardsIssueNewCardButton": { + "context": "customer gift cards card issue button", + "string": "Issue new card" + }, + "src_dot_giftCards_dot_components_dot_GiftCardCustomerCard_dot_customerGiftCardsPresentSubtitle": { + "context": "customer gift cards card subtitle", + "string": "Only five newest gift cards are shown here" + }, + "src_dot_giftCards_dot_components_dot_GiftCardCustomerCard_dot_customerGiftCardsViewAllButton": { + "context": "customer gift cards card view all button", + "string": "View All" + }, "src_dot_giftCards_dot_components_dot_GiftCardDeleteDialog_dot_consentLabel": { - "context": "GiftCardDeleteDialog consent label", + "context": "consent removal of gift cards with balance button label", "string": "{selectedItemsCount,plural,one{I am aware that I am removing a gift card with balance} other{I am aware that I am removing gift cards with balance}}" }, "src_dot_giftCards_dot_components_dot_GiftCardDeleteDialog_dot_defaultDescription": { - "context": "GiftCardDeleteDialog default description", + "context": "default gift card delete description", "string": "{selectedItemsCount,plural,one{Are you sure you want to delete this gift card?} other{Are you sure you want to delete {selectedItemsCount} giftCards?}}" }, "src_dot_giftCards_dot_components_dot_GiftCardDeleteDialog_dot_deleteSuccessAlertText": { - "context": "GiftCardDeleteDialog success alert text", + "context": "gift card removed success alert message", "string": "{selectedItemsCount,plural,one{Successfully deleted gift card} other{Successfully deleted gift cards}}" }, "src_dot_giftCards_dot_components_dot_GiftCardDeleteDialog_dot_title": { - "context": "GiftCardDeleteDialog single title", + "context": "single gift card title", "string": "{selectedItemsCount,plural,one{Delete Gift Card} other{Delete Gift Cards}}" }, "src_dot_giftCards_dot_components_dot_GiftCardDeleteDialog_dot_withBalanceDescription": { - "context": "GiftCardDeleteDialog with balance description", + "context": "delete gift cards with balance description", "string": "{selectedItemsCount,plural,one{The gift card you are about to delete has available balance. By deleting this card you may remove balance available to your customer.} other{You are about to delete gift cards with available balance. Are you sure you want to do that?}}" }, "src_dot_giftCards_dot_components_dot_GiftCardSendToCustomer_dot_channelSelectLabel": { - "context": "GiftCardCreateDialog channel select label", + "context": "channel select label", "string": "Channel" }, "src_dot_giftCards_dot_components_dot_GiftCardSendToCustomer_dot_customerChannelSubtitle": { - "context": "GiftCardCreateDialog customer channel subtitle", + "context": "selected customer channel subtitle", "string": "Customer will be sent the gift card code via this channels email address" }, "src_dot_giftCards_dot_components_dot_GiftCardSendToCustomer_dot_customerSubtitle": { - "context": "GiftCardCreateDialog customer subtitle", + "context": "selected customer gift card is sent to subtitle", "string": "Selected customer will be sent the generated gift card code. Someone else can redeem the gift card code. Gift card will be assigned to account which redeemed the code." }, "src_dot_giftCards_dot_components_dot_GiftCardSendToCustomer_dot_sendToCustomerSelectedLabel": { - "context": "GiftCardSendToCustomer send to customer selected label", + "context": "send to customer selected label", "string": "Send gift card to customer" }, "src_dot_giftCards_dot_components_dot_GiftCardSettingsExpirySelect_dot_setExpirationPeriodDescription": { @@ -3913,23 +4074,23 @@ "string": "Set gift card expiration period" }, "src_dot_giftCards_dot_components_dot_GiftCardTagInput_dot_placeholder": { - "context": "GiftCardTagInput tag placeholder", + "context": "input placeholder tag", "string": "Tag" }, "src_dot_giftCards_dot_components_dot_TimePeriodField_dot_dayLabel": { - "context": "TimePeriodTextWithSelectField day label", + "context": "days after label", "string": "days after issue" }, "src_dot_giftCards_dot_components_dot_TimePeriodField_dot_monthLabel": { - "context": "TimePeriodTextWithSelectField month label", + "context": "months after label", "string": "months after issue" }, "src_dot_giftCards_dot_components_dot_TimePeriodField_dot_weekLabel": { - "context": "TimePeriodTextWithSelectField day label", + "context": "weeks after label", "string": "weeks after issue" }, "src_dot_giftCards_dot_components_dot_TimePeriodField_dot_yearLabel": { - "context": "TimePeriodTextWithSelectField year label", + "context": "years after label", "string": "years after issue" }, "src_dot_home": { @@ -4659,6 +4820,18 @@ "context": "order", "string": "Customer" }, + "src_dot_orders_dot_components_dot_OrderListPage_dot_giftCard": { + "context": "order", + "string": "Gift Card" + }, + "src_dot_orders_dot_components_dot_OrderListPage_dot_giftCardOrdered": { + "context": "order", + "string": "Gift Card ordered" + }, + "src_dot_orders_dot_components_dot_OrderListPage_dot_giftCardPaid": { + "context": "order", + "string": "Paid with Gift Card" + }, "src_dot_orders_dot_components_dot_OrderListPage_dot_placed": { "context": "order", "string": "Created" @@ -5790,19 +5963,15 @@ }, "src_dot_productTypes_dot_components_dot_ProductTypeDetails_dot_optionGiftCardDescription": { "context": "option description", - "string": "This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process" + "string": "This product will act as a payment method" }, "src_dot_productTypes_dot_components_dot_ProductTypeDetails_dot_optionGiftCardTitle": { "context": "option", - "string": "Products of this type can be used as gift card/voucher" - }, - "src_dot_productTypes_dot_components_dot_ProductTypeDetails_dot_optionNormalDescription": { - "context": "option description", - "string": "This product type can be used to create shipping passes for your customers" + "string": "Gift card product type" }, "src_dot_productTypes_dot_components_dot_ProductTypeDetails_dot_optionNormalTitle": { "context": "option", - "string": "This is a normal product" + "string": "Regular product type" }, "src_dot_productTypes_dot_components_dot_ProductTypeDetails_dot_productTypeName": { "context": "label", @@ -5985,15 +6154,15 @@ "string": "SEO Information" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_2167661409": { - "context": "export selected products to csv file", + "context": "export selected items to csv file", "string": "Selected products ({number})" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_2318723509": { - "context": "export products to csv file, choice field label", + "context": "export items to csv file, choice field label", "string": "Export information for:" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_2355065897": { - "context": "export all products to csv file", + "context": "export all items to csv file", "string": "All products ({number})" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_2474350154": { @@ -6005,17 +6174,9 @@ "string": "Information exported" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_2693217446": { - "context": "export products as csv or spreadsheet file", + "context": "export items as csv or spreadsheet file", "string": "Export as:" }, - "src_dot_products_dot_components_dot_ProductExportDialog_dot_2883720012": { - "context": "export products to csv file, button", - "string": "export products" - }, - "src_dot_products_dot_components_dot_ProductExportDialog_dot_3012202273": { - "context": "export products to csv file, dialog header", - "string": "Export Information" - }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_3365843236": { "context": "product export to csv file, header", "string": "Export Settings" @@ -6025,7 +6186,7 @@ "string": "Select All" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_3518309850": { - "context": "export products as spreadsheet", + "context": "export items as spreadsheet", "string": "Spreadsheet for Excel, Numbers etc." }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_3599582104": { @@ -6039,7 +6200,7 @@ "string": "Inventory Information" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_4118932547": { - "context": "export products as csv file", + "context": "export items as csv file", "string": "Plain CSV file" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_472026385": { @@ -6051,13 +6212,25 @@ "string": "Search by attribute name" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_700651641": { - "context": "export filtered products to csv file", + "context": "export filtered items to csv file", "string": "Current search ({number})" }, "src_dot_products_dot_components_dot_ProductExportDialog_dot_734825715": { "context": "informations about product prices etc, header", "string": "Financial Information" }, + "src_dot_products_dot_components_dot_ProductExportDialog_dot_confirmButtonLabel": { + "context": "export products to csv file, button", + "string": "export products" + }, + "src_dot_products_dot_components_dot_ProductExportDialog_dot_productsLabel": { + "context": "products export type label", + "string": "products" + }, + "src_dot_products_dot_components_dot_ProductExportDialog_dot_title": { + "context": "export products to csv file, dialog header", + "string": "Export Information" + }, "src_dot_products_dot_components_dot_ProductExternalMediaDialog_dot_4146081479": { "context": "modal header", "string": "Media from the URL you supply will be shown in the media gallery. You will be able to define the order of the gallery." @@ -6104,6 +6277,10 @@ "context": "product is hidden", "string": "Hidden" }, + "src_dot_products_dot_components_dot_ProductListPage_dot_kind": { + "context": "product kind", + "string": "Product Kind" + }, "src_dot_products_dot_components_dot_ProductListPage_dot_outOfStock": { "context": "product status", "string": "Out Of Stock" @@ -6716,6 +6893,14 @@ "src_dot_products_dot_views_dot_ProductList_dot_44832327": { "string": "We are currently exporting your requested CSV. As soon as it is available it will be sent to your email address" }, + "src_dot_products_dot_views_dot_ProductList_dot_giftCardLabel": { + "context": "label", + "string": "Gift Card" + }, + "src_dot_products_dot_views_dot_ProductList_dot_normalLabel": { + "context": "label", + "string": "Normal" + }, "src_dot_products_dot_views_dot_ProductUpdate_dot_3423943948": { "string": "Manage Products Channel Availability" }, diff --git a/package-lock.json b/package-lock.json index da37105a0..b2b0ceb0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6413,23 +6413,6 @@ "requires": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" - }, - "dependencies": { - "@types/react": { - "version": "17.0.3", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.3.tgz", - "integrity": "sha512-wYOUxIgs2HZZ0ACNiIayItyluADNbONl7kt8lkLjVK8IitMH5QMyAh75Fwhmo37r1m7L2JaFj03sIfxBVDvRAg==", - "requires": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" - } - }, - "csstype": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.7.tgz", - "integrity": "sha512-KxnUB0ZMlnUWCsx2Z8MUsr6qV6ja1w9ArPErJaJaF8a5SOWoHLIszeCTKGRGRgtLgYrs1E8CHkNSP1VZTTPc9g==" - } } }, "@types/html-minifier-terser": { diff --git a/schema.graphql b/schema.graphql index b37333da8..f83b9bd85 100644 --- a/schema.graphql +++ b/schema.graphql @@ -5,27 +5,39 @@ schema { type AccountAddressCreate { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! address: Address } type AccountAddressDelete { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! address: Address } type AccountAddressUpdate { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! address: Address } type AccountDelete { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! user: User } @@ -83,7 +95,10 @@ input AccountInput { type AccountRegister { requiresConfirmation: Boolean - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! user: User } @@ -100,18 +115,27 @@ input AccountRegisterInput { } type AccountRequestDeletion { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type AccountSetDefaultAddress { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type AccountUpdate { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! user: User } @@ -135,14 +159,20 @@ type Address implements Node { type AddressCreate { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! address: Address } type AddressDelete { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! address: Address } @@ -163,7 +193,10 @@ input AddressInput { type AddressSetDefault { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -174,7 +207,10 @@ enum AddressTypeEnum { type AddressUpdate { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! address: Address } @@ -229,7 +265,10 @@ type App implements Node & ObjectWithMetadata { } type AppActivate { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! app: App } @@ -247,25 +286,37 @@ type AppCountableEdge { type AppCreate { authToken: String - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! app: App } type AppDeactivate { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! app: App } type AppDelete { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! app: App } type AppDeleteFailedInstallation { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! appInstallation: AppInstallation } @@ -338,7 +389,10 @@ enum AppExtensionViewEnum { type AppFetchManifest { manifest: Manifest - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! } @@ -354,7 +408,10 @@ input AppInput { } type AppInstall { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! appInstallation: AppInstallation } @@ -386,7 +443,10 @@ type AppManifestExtension { } type AppRetryInstall { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! appInstallation: AppInstallation } @@ -409,13 +469,19 @@ type AppToken implements Node { type AppTokenCreate { authToken: String - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! appToken: AppToken } type AppTokenDelete { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! appToken: AppToken } @@ -427,7 +493,10 @@ input AppTokenInput { type AppTokenVerify { valid: Boolean! - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! } @@ -437,7 +506,10 @@ enum AppTypeEnum { } type AppUpdate { - appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + appErrors: [AppError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AppError!]! app: App } @@ -453,7 +525,10 @@ enum AreaUnitsEnum { type AssignNavigation { menu: Menu - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! } @@ -464,6 +539,18 @@ type AssignedVariantAttribute { type Attribute implements Node & ObjectWithMetadata { id: ID! + productTypes( + before: String + after: String + first: Int + last: Int + ): ProductTypeCountableConnection! + productVariantTypes( + before: String + after: String + first: Int + last: Int + ): ProductTypeCountableConnection! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! inputType: AttributeInputTypeEnum @@ -472,7 +559,14 @@ type Attribute implements Node & ObjectWithMetadata { slug: String type: AttributeTypeEnum unit: MeasurementUnitsEnum - choices(sortBy: AttributeChoicesSortingInput, filter: AttributeValueFilterInput, before: String, after: String, first: Int, last: Int): AttributeValueCountableConnection + choices( + sortBy: AttributeChoicesSortingInput + filter: AttributeValueFilterInput + before: String + after: String + first: Int + last: Int + ): AttributeValueCountableConnection valueRequired: Boolean! visibleInStorefront: Boolean! filterableInStorefront: Boolean! @@ -481,13 +575,26 @@ type Attribute implements Node & ObjectWithMetadata { translation(languageCode: LanguageCodeEnum!): AttributeTranslation storefrontSearchPosition: Int! withChoices: Boolean! - productTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection! - productVariantTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection! + productTypes( + before: String + after: String + first: Int + last: Int + ): ProductTypeCountableConnection! + productVariantTypes( + before: String + after: String + first: Int + last: Int + ): ProductTypeCountableConnection! } type AttributeBulkDelete { count: Int! - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! } @@ -514,7 +621,10 @@ type AttributeCountableEdge { type AttributeCreate { attribute: Attribute - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! } @@ -536,7 +646,10 @@ input AttributeCreateInput { } type AttributeDelete { - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! attribute: Attribute } @@ -601,7 +714,10 @@ enum AttributeInputTypeEnum { type AttributeReorderValues { attribute: Attribute - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! } @@ -626,11 +742,17 @@ type AttributeTranslatableContent implements Node { id: ID! name: String! translation(languageCode: LanguageCodeEnum!): AttributeTranslation - attribute: Attribute @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + attribute: Attribute + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type AttributeTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! attribute: Attribute } @@ -648,7 +770,10 @@ enum AttributeTypeEnum { type AttributeUpdate { attribute: Attribute - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! } @@ -684,7 +809,10 @@ type AttributeValue implements Node { type AttributeValueBulkDelete { count: Int! - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! } @@ -701,7 +829,10 @@ type AttributeValueCountableEdge { type AttributeValueCreate { attribute: Attribute - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! attributeValue: AttributeValue } @@ -716,7 +847,10 @@ input AttributeValueCreateInput { type AttributeValueDelete { attribute: Attribute - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! attributeValue: AttributeValue } @@ -742,11 +876,17 @@ type AttributeValueTranslatableContent implements Node { name: String! richText: JSONString translation(languageCode: LanguageCodeEnum!): AttributeValueTranslation - attributeValue: AttributeValue @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + attributeValue: AttributeValue + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type AttributeValueTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! attributeValue: AttributeValue } @@ -765,7 +905,10 @@ input AttributeValueTranslationInput { type AttributeValueUpdate { attribute: Attribute - attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + attributeErrors: [AttributeError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AttributeError!]! attributeValue: AttributeValue } @@ -828,17 +971,39 @@ type Category implements Node & ObjectWithMetadata { level: Int! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") - ancestors(before: String, after: String, first: Int, last: Int): CategoryCountableConnection - products(channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection - children(before: String, after: String, first: Int, last: Int): CategoryCountableConnection + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) + ancestors( + before: String + after: String + first: Int + last: Int + ): CategoryCountableConnection + products( + channel: String + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection + children( + before: String + after: String + first: Int + last: Int + ): CategoryCountableConnection backgroundImage(size: Int): Image translation(languageCode: LanguageCodeEnum!): CategoryTranslation } type CategoryBulkDelete { count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -854,13 +1019,19 @@ type CategoryCountableEdge { } type CategoryCreate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! category: Category } type CategoryDelete { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! category: Category } @@ -898,13 +1069,22 @@ type CategoryTranslatableContent implements Node { seoDescription: String name: String! description: JSONString - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) translation(languageCode: LanguageCodeEnum!): CategoryTranslation - category: Category @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + category: Category + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type CategoryTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! category: Category } @@ -916,11 +1096,17 @@ type CategoryTranslation implements Node { name: String description: JSONString language: LanguageDisplay! - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) } type CategoryUpdate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! category: Category } @@ -937,12 +1123,18 @@ type Channel implements Node { type ChannelActivate { channel: Channel - channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + channelErrors: [ChannelError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ChannelError!]! } type ChannelCreate { - channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + channelErrors: [ChannelError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ChannelError!]! channel: Channel } @@ -958,12 +1150,18 @@ input ChannelCreateInput { type ChannelDeactivate { channel: Channel - channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + channelErrors: [ChannelError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ChannelError!]! } type ChannelDelete { - channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + channelErrors: [ChannelError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ChannelError!]! channel: Channel } @@ -992,7 +1190,10 @@ enum ChannelErrorCode { } type ChannelUpdate { - channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + channelErrors: [ChannelError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ChannelError!]! channel: Channel } @@ -1022,7 +1223,10 @@ type Checkout implements Node & ObjectWithMetadata { id: ID! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - availableShippingMethods: [ShippingMethod]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `shippingMethods` instead.") + availableShippingMethods: [ShippingMethod]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `shippingMethods` instead." + ) shippingMethods: [ShippingMethod]! availableCollectionPoints: [Warehouse!]! availablePaymentGateways: [PaymentGateway!]! @@ -1032,7 +1236,10 @@ type Checkout implements Node & ObjectWithMetadata { stockReservationExpires: DateTime lines: [CheckoutLine] shippingPrice: TaxedMoney - shippingMethod: ShippingMethod @deprecated(reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead.") + shippingMethod: ShippingMethod + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead." + ) deliveryMethod: DeliveryMethod subtotalPrice: TaxedMoney token: UUID! @@ -1042,13 +1249,19 @@ type Checkout implements Node & ObjectWithMetadata { type CheckoutAddPromoCode { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } type CheckoutBillingAddressUpdate { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1056,7 +1269,10 @@ type CheckoutComplete { order: Order confirmationNeeded: Boolean! confirmationData: JSONString - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1072,8 +1288,14 @@ type CheckoutCountableEdge { } type CheckoutCreate { - created: Boolean @deprecated(reason: "This field will be removed in Saleor 4.0. Always returns `True`.") - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + created: Boolean + @deprecated( + reason: "This field will be removed in Saleor 4.0. Always returns `True`." + ) + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! checkout: Checkout } @@ -1089,13 +1311,19 @@ input CheckoutCreateInput { type CheckoutCustomerAttach { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } type CheckoutCustomerDetach { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1106,7 +1334,10 @@ type CheckoutDeliveryMethodUpdate { type CheckoutEmailUpdate { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1158,7 +1389,10 @@ input CheckoutFilterInput { type CheckoutLanguageCodeUpdate { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1183,7 +1417,10 @@ type CheckoutLineCountableEdge { type CheckoutLineDelete { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1194,7 +1431,10 @@ input CheckoutLineInput { type CheckoutLinesAdd { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1205,32 +1445,47 @@ type CheckoutLinesDelete { type CheckoutLinesUpdate { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } type CheckoutPaymentCreate { checkout: Checkout payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + paymentErrors: [PaymentError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PaymentError!]! } type CheckoutRemovePromoCode { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } type CheckoutShippingAddressUpdate { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } type CheckoutShippingMethodUpdate { checkout: Checkout - checkoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + checkoutErrors: [CheckoutError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CheckoutError!]! } @@ -1260,8 +1515,18 @@ type Collection implements Node & ObjectWithMetadata { privateMetadata: [MetadataItem]! metadata: [MetadataItem]! channel: String - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") - products(filter: ProductFilterInput, sortBy: ProductOrder, before: String, after: String, first: Int, last: Int): ProductCountableConnection + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) + products( + filter: ProductFilterInput + sortBy: ProductOrder + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection backgroundImage(size: Int): Image translation(languageCode: LanguageCodeEnum!): CollectionTranslation channelListings: [CollectionChannelListing!] @@ -1269,13 +1534,19 @@ type Collection implements Node & ObjectWithMetadata { type CollectionAddProducts { collection: Collection - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! } type CollectionBulkDelete { count: Int! - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! } @@ -1297,7 +1568,10 @@ type CollectionChannelListingError { type CollectionChannelListingUpdate { collection: Collection - collectionChannelListingErrors: [CollectionChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionChannelListingErrors: [CollectionChannelListingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionChannelListingError!]! } @@ -1318,7 +1592,10 @@ type CollectionCountableEdge { } type CollectionCreate { - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! collection: Collection } @@ -1336,7 +1613,10 @@ input CollectionCreateInput { } type CollectionDelete { - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! collection: Collection } @@ -1384,13 +1664,19 @@ enum CollectionPublished { type CollectionRemoveProducts { collection: Collection - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! } type CollectionReorderProducts { collection: Collection - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! } @@ -1413,13 +1699,22 @@ type CollectionTranslatableContent implements Node { seoDescription: String name: String! description: JSONString - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) translation(languageCode: LanguageCodeEnum!): CollectionTranslation - collection: Collection @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + collection: Collection + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type CollectionTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! collection: Collection } @@ -1431,11 +1726,17 @@ type CollectionTranslation implements Node { name: String description: JSONString language: LanguageDisplay! - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) } type CollectionUpdate { - collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + collectionErrors: [CollectionError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [CollectionError!]! collection: Collection } @@ -1465,13 +1766,19 @@ enum ConfigurationTypeFieldEnum { type ConfirmAccount { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type ConfirmEmailChange { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -1739,7 +2046,10 @@ type CreateToken { refreshToken: String csrfToken: String user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -1753,18 +2063,27 @@ type CreditCard { type CustomerBulkDelete { count: Int! - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type CustomerCreate { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! user: User } type CustomerDelete { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! user: User } @@ -1817,7 +2136,10 @@ input CustomerInput { } type CustomerUpdate { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! user: User } @@ -1837,18 +2159,27 @@ input DateTimeRangeInput { } type DeactivateAllUserTokens { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type DeleteMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + metadataErrors: [MetadataError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MetadataError!]! item: ObjectWithMetadata } type DeletePrivateMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + metadataErrors: [MetadataError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MetadataError!]! item: ObjectWithMetadata } @@ -1882,13 +2213,19 @@ type DigitalContentCountableEdge { type DigitalContentCreate { variant: ProductVariant content: DigitalContent - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type DigitalContentDelete { variant: ProductVariant - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -1902,7 +2239,10 @@ input DigitalContentInput { type DigitalContentUpdate { variant: ProductVariant content: DigitalContent - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -1924,7 +2264,10 @@ type DigitalContentUrl implements Node { } type DigitalContentUrlCreate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! digitalContentUrl: DigitalContentUrl } @@ -1980,18 +2323,27 @@ type Domain { type DraftOrderBulkDelete { count: Int! - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type DraftOrderComplete { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type DraftOrderCreate { - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! order: Order } @@ -2011,7 +2363,10 @@ input DraftOrderCreateInput { } type DraftOrderDelete { - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! order: Order } @@ -2031,12 +2386,18 @@ input DraftOrderInput { type DraftOrderLinesBulkDelete { count: Int! - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type DraftOrderUpdate { - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! order: Order } @@ -2046,7 +2407,13 @@ type EventDelivery implements Node { createdAt: DateTime! status: EventDeliveryStatusEnum! eventType: WebhookEventTypeEnum! - attempts(sortBy: EventDeliveryAttemptSortingInput, before: String, after: String, first: Int, last: Int): EventDeliveryAttemptCountableConnection + attempts( + sortBy: EventDeliveryAttemptSortingInput + before: String + after: String + first: Int + last: Int + ): EventDeliveryAttemptCountableConnection payload: String } @@ -2190,6 +2557,18 @@ input ExportFileSortingInput { field: ExportFileSortField! } +type ExportGiftCards { + exportFile: ExportFile + errors: [ExportError!]! +} + +input ExportGiftCardsInput { + scope: ExportScope! + filter: GiftCardFilterInput + ids: [ID!] + fileType: FileTypesEnum! +} + input ExportInfoInput { attributes: [ID!] warehouses: [ID!] @@ -2199,7 +2578,10 @@ input ExportInfoInput { type ExportProducts { exportFile: ExportFile - exportErrors: [ExportError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + exportErrors: [ExportError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ExportError!]! } @@ -2224,13 +2606,19 @@ type ExternalAuthentication { type ExternalAuthenticationUrl { authenticationData: JSONString - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type ExternalLogout { logoutData: JSONString - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -2262,7 +2650,10 @@ type ExternalObtainAccessTokens { refreshToken: String csrfToken: String user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -2271,7 +2662,10 @@ type ExternalRefresh { refreshToken: String csrfToken: String user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -2279,7 +2673,10 @@ type ExternalVerify { user: User isValid: Boolean! verifyData: JSONString - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -2295,7 +2692,10 @@ enum FileTypesEnum { type FileUpload { uploadedFile: File - uploadErrors: [UploadError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + uploadErrors: [UploadError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [UploadError!]! } @@ -2315,14 +2715,20 @@ type Fulfillment implements Node & ObjectWithMetadata { type FulfillmentApprove { fulfillment: Fulfillment order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type FulfillmentCancel { fulfillment: Fulfillment order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -2339,7 +2745,10 @@ type FulfillmentLine implements Node { type FulfillmentRefundProducts { fulfillment: Fulfillment order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -2348,7 +2757,10 @@ type FulfillmentReturnProducts { replaceFulfillment: Fulfillment order: Order replaceOrder: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -2365,7 +2777,10 @@ enum FulfillmentStatus { type FulfillmentUpdateTracking { fulfillment: Fulfillment order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -2385,7 +2800,7 @@ type GiftCard implements Node & ObjectWithMetadata { code: String! isActive: Boolean! expiryDate: Date - tag: String + tags: [GiftCardTag!] created: DateTime! lastUsedOn: DateTime initialBalance: Money @@ -2393,7 +2808,7 @@ type GiftCard implements Node & ObjectWithMetadata { id: ID! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - displayCode: String! + last4CodeChars: String! createdBy: User usedBy: User createdByEmail: String @@ -2402,14 +2817,24 @@ type GiftCard implements Node & ObjectWithMetadata { product: Product events: [GiftCardEvent!]! boughtInChannel: String - user: User @deprecated(reason: "This field will be removed in Saleor 4.0. Use `createdBy` field instead.") - endDate: DateTime @deprecated(reason: "This field will be removed in Saleor 4.0. Use `expiryDate` field instead.") - startDate: DateTime @deprecated(reason: "This field will be removed in Saleor 4.0.") + user: User + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `createdBy` field instead." + ) + endDate: DateTime + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `expiryDate` field instead." + ) + startDate: DateTime + @deprecated(reason: "This field will be removed in Saleor 4.0.") } type GiftCardActivate { giftCard: GiftCard - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + giftCardErrors: [GiftCardError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [GiftCardError!]! } @@ -2428,6 +2853,20 @@ type GiftCardBulkActivate { errors: [GiftCardError!]! } +type GiftCardBulkCreate { + count: Int! + giftCards: [GiftCard!]! + errors: [GiftCardError!]! +} + +input GiftCardBulkCreateInput { + count: Int! + balance: PriceInput! + tags: [String!] + expiryDate: Date + isActive: Boolean! +} + type GiftCardBulkDeactivate { count: Int! errors: [GiftCardError!]! @@ -2444,19 +2883,37 @@ type GiftCardCountableConnection { totalCount: Int } +type GiftCardTagCountableConnection { + pageInfo: PageInfo! + edges: [GiftCardTagCountableEdge!]! + totalCount: Int +} + +type GiftCardTagCountableEdge { + node: GiftCardTag! + cursor: String! +} + +input GiftCardTagFilterInput { + search: String +} + type GiftCardCountableEdge { node: GiftCard! cursor: String! } type GiftCardCreate { - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + giftCardErrors: [GiftCardError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [GiftCardError!]! giftCard: GiftCard } input GiftCardCreateInput { - tag: String + addTags: [String!] expiryDate: Date startDate: Date endDate: Date @@ -2470,12 +2927,18 @@ input GiftCardCreateInput { type GiftCardDeactivate { giftCard: GiftCard - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + giftCardErrors: [GiftCardError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [GiftCardError!]! } type GiftCardDelete { - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + giftCardErrors: [GiftCardError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [GiftCardError!]! giftCard: GiftCard } @@ -2505,8 +2968,8 @@ type GiftCardEvent implements Node { email: String orderId: ID orderNumber: String - tag: String - oldTag: String + tags: [String!] + oldTags: [String!] balance: GiftCardEventBalance expiryDate: Date oldExpiryDate: Date @@ -2527,7 +2990,7 @@ enum GiftCardEventsEnum { DEACTIVATED BALANCE_RESET EXPIRY_DATE_UPDATED - TAG_UPDATED + TAGS_UPDATED SENT_TO_CUSTOMER RESENT NOTE_ADDED @@ -2537,7 +3000,6 @@ enum GiftCardEventsEnum { input GiftCardFilterInput { isActive: Boolean metadata: [MetadataFilter] - tag: String tags: [String] products: [ID] usedBy: [ID] @@ -2602,14 +3064,23 @@ input GiftCardSortingInput { field: GiftCardSortField! } +type GiftCardTag implements Node { + id: ID! + name: String! +} + type GiftCardUpdate { - giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + giftCardErrors: [GiftCardError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [GiftCardError!]! giftCard: GiftCard } input GiftCardUpdateInput { - tag: String + addTags: [String!] + removeTags: [String!] expiryDate: Date startDate: Date endDate: Date @@ -2659,7 +3130,10 @@ type Invoice implements ObjectWithMetadata & Job & Node { } type InvoiceCreate { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + invoiceErrors: [InvoiceError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [InvoiceError!]! invoice: Invoice } @@ -2670,7 +3144,10 @@ input InvoiceCreateInput { } type InvoiceDelete { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + invoiceErrors: [InvoiceError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [InvoiceError!]! invoice: Invoice } @@ -2694,25 +3171,37 @@ enum InvoiceErrorCode { type InvoiceRequest { order: Order - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + invoiceErrors: [InvoiceError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [InvoiceError!]! invoice: Invoice } type InvoiceRequestDelete { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + invoiceErrors: [InvoiceError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [InvoiceError!]! invoice: Invoice } type InvoiceSendNotification { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + invoiceErrors: [InvoiceError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [InvoiceError!]! invoice: Invoice } type InvoiceUpdate { - invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + invoiceErrors: [InvoiceError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [InvoiceError!]! invoice: Invoice } @@ -3598,7 +4087,10 @@ type Menu implements Node & ObjectWithMetadata { type MenuBulkDelete { count: Int! - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! } @@ -3614,7 +4106,10 @@ type MenuCountableEdge { } type MenuCreate { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! menu: Menu } @@ -3626,7 +4121,10 @@ input MenuCreateInput { } type MenuDelete { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! menu: Menu } @@ -3678,7 +4176,10 @@ type MenuItem implements Node & ObjectWithMetadata { type MenuItemBulkDelete { count: Int! - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! } @@ -3694,7 +4195,10 @@ type MenuItemCountableEdge { } type MenuItemCreate { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! menuItem: MenuItem } @@ -3710,7 +4214,10 @@ input MenuItemCreateInput { } type MenuItemDelete { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! menuItem: MenuItem } @@ -3730,7 +4237,10 @@ input MenuItemInput { type MenuItemMove { menu: Menu - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! } @@ -3749,11 +4259,17 @@ type MenuItemTranslatableContent implements Node { id: ID! name: String! translation(languageCode: LanguageCodeEnum!): MenuItemTranslation - menuItem: MenuItem @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + menuItem: MenuItem + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type MenuItemTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! menuItem: MenuItem } @@ -3765,7 +4281,10 @@ type MenuItemTranslation implements Node { } type MenuItemUpdate { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! menuItem: MenuItem } @@ -3785,7 +4304,10 @@ input MenuSortingInput { } type MenuUpdate { - menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + menuErrors: [MenuError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MenuError!]! menu: Menu } @@ -3846,137 +4368,309 @@ type Mutation { createWarehouse(input: WarehouseCreateInput!): WarehouseCreate updateWarehouse(id: ID!, input: WarehouseUpdateInput!): WarehouseUpdate deleteWarehouse(id: ID!): WarehouseDelete - assignWarehouseShippingZone(id: ID!, shippingZoneIds: [ID!]!): WarehouseShippingZoneAssign - unassignWarehouseShippingZone(id: ID!, shippingZoneIds: [ID!]!): WarehouseShippingZoneUnassign - staffNotificationRecipientCreate(input: StaffNotificationRecipientInput!): StaffNotificationRecipientCreate - staffNotificationRecipientUpdate(id: ID!, input: StaffNotificationRecipientInput!): StaffNotificationRecipientUpdate + assignWarehouseShippingZone( + id: ID! + shippingZoneIds: [ID!]! + ): WarehouseShippingZoneAssign + unassignWarehouseShippingZone( + id: ID! + shippingZoneIds: [ID!]! + ): WarehouseShippingZoneUnassign + staffNotificationRecipientCreate( + input: StaffNotificationRecipientInput! + ): StaffNotificationRecipientCreate + staffNotificationRecipientUpdate( + id: ID! + input: StaffNotificationRecipientInput! + ): StaffNotificationRecipientUpdate staffNotificationRecipientDelete(id: ID!): StaffNotificationRecipientDelete shopDomainUpdate(input: SiteDomainInput): ShopDomainUpdate shopSettingsUpdate(input: ShopSettingsInput!): ShopSettingsUpdate shopFetchTaxRates: ShopFetchTaxRates - shopSettingsTranslate(input: ShopSettingsTranslationInput!, languageCode: LanguageCodeEnum!): ShopSettingsTranslate + shopSettingsTranslate( + input: ShopSettingsTranslationInput! + languageCode: LanguageCodeEnum! + ): ShopSettingsTranslate shopAddressUpdate(input: AddressInput): ShopAddressUpdate orderSettingsUpdate(input: OrderSettingsUpdateInput!): OrderSettingsUpdate - giftCardSettingsUpdate(input: GiftCardSettingsUpdateInput!): GiftCardSettingsUpdate - shippingMethodChannelListingUpdate(id: ID!, input: ShippingMethodChannelListingInput!): ShippingMethodChannelListingUpdate + giftCardSettingsUpdate( + input: GiftCardSettingsUpdateInput! + ): GiftCardSettingsUpdate + shippingMethodChannelListingUpdate( + id: ID! + input: ShippingMethodChannelListingInput! + ): ShippingMethodChannelListingUpdate shippingPriceCreate(input: ShippingPriceInput!): ShippingPriceCreate shippingPriceDelete(id: ID!): ShippingPriceDelete shippingPriceBulkDelete(ids: [ID]!): ShippingPriceBulkDelete shippingPriceUpdate(id: ID!, input: ShippingPriceInput!): ShippingPriceUpdate - shippingPriceTranslate(id: ID!, input: ShippingPriceTranslationInput!, languageCode: LanguageCodeEnum!): ShippingPriceTranslate - shippingPriceExcludeProducts(id: ID!, input: ShippingPriceExcludeProductsInput!): ShippingPriceExcludeProducts - shippingPriceRemoveProductFromExclude(id: ID!, products: [ID]!): ShippingPriceRemoveProductFromExclude + shippingPriceTranslate( + id: ID! + input: ShippingPriceTranslationInput! + languageCode: LanguageCodeEnum! + ): ShippingPriceTranslate + shippingPriceExcludeProducts( + id: ID! + input: ShippingPriceExcludeProductsInput! + ): ShippingPriceExcludeProducts + shippingPriceRemoveProductFromExclude( + id: ID! + products: [ID]! + ): ShippingPriceRemoveProductFromExclude shippingZoneCreate(input: ShippingZoneCreateInput!): ShippingZoneCreate shippingZoneDelete(id: ID!): ShippingZoneDelete shippingZoneBulkDelete(ids: [ID]!): ShippingZoneBulkDelete - shippingZoneUpdate(id: ID!, input: ShippingZoneUpdateInput!): ShippingZoneUpdate - productAttributeAssign(operations: [ProductAttributeAssignInput]!, productTypeId: ID!): ProductAttributeAssign - productAttributeAssignmentUpdate(operations: [ProductAttributeAssignmentUpdateInput]!, productTypeId: ID!): ProductAttributeAssignmentUpdate - productAttributeUnassign(attributeIds: [ID]!, productTypeId: ID!): ProductAttributeUnassign + shippingZoneUpdate( + id: ID! + input: ShippingZoneUpdateInput! + ): ShippingZoneUpdate + productAttributeAssign( + operations: [ProductAttributeAssignInput]! + productTypeId: ID! + ): ProductAttributeAssign + productAttributeAssignmentUpdate( + operations: [ProductAttributeAssignmentUpdateInput]! + productTypeId: ID! + ): ProductAttributeAssignmentUpdate + productAttributeUnassign( + attributeIds: [ID]! + productTypeId: ID! + ): ProductAttributeUnassign categoryCreate(input: CategoryInput!, parent: ID): CategoryCreate categoryDelete(id: ID!): CategoryDelete categoryBulkDelete(ids: [ID]!): CategoryBulkDelete categoryUpdate(id: ID!, input: CategoryInput!): CategoryUpdate - categoryTranslate(id: ID!, input: TranslationInput!, languageCode: LanguageCodeEnum!): CategoryTranslate - collectionAddProducts(collectionId: ID!, products: [ID]!): CollectionAddProducts + categoryTranslate( + id: ID! + input: TranslationInput! + languageCode: LanguageCodeEnum! + ): CategoryTranslate + collectionAddProducts( + collectionId: ID! + products: [ID]! + ): CollectionAddProducts collectionCreate(input: CollectionCreateInput!): CollectionCreate collectionDelete(id: ID!): CollectionDelete - collectionReorderProducts(collectionId: ID!, moves: [MoveProductInput]!): CollectionReorderProducts + collectionReorderProducts( + collectionId: ID! + moves: [MoveProductInput]! + ): CollectionReorderProducts collectionBulkDelete(ids: [ID]!): CollectionBulkDelete - collectionRemoveProducts(collectionId: ID!, products: [ID]!): CollectionRemoveProducts + collectionRemoveProducts( + collectionId: ID! + products: [ID]! + ): CollectionRemoveProducts collectionUpdate(id: ID!, input: CollectionInput!): CollectionUpdate - collectionTranslate(id: ID!, input: TranslationInput!, languageCode: LanguageCodeEnum!): CollectionTranslate - collectionChannelListingUpdate(id: ID!, input: CollectionChannelListingUpdateInput!): CollectionChannelListingUpdate + collectionTranslate( + id: ID! + input: TranslationInput! + languageCode: LanguageCodeEnum! + ): CollectionTranslate + collectionChannelListingUpdate( + id: ID! + input: CollectionChannelListingUpdateInput! + ): CollectionChannelListingUpdate productCreate(input: ProductCreateInput!): ProductCreate productDelete(id: ID!): ProductDelete productBulkDelete(ids: [ID]!): ProductBulkDelete productUpdate(id: ID!, input: ProductInput!): ProductUpdate - productTranslate(id: ID!, input: TranslationInput!, languageCode: LanguageCodeEnum!): ProductTranslate - productChannelListingUpdate(id: ID!, input: ProductChannelListingUpdateInput!): ProductChannelListingUpdate + productTranslate( + id: ID! + input: TranslationInput! + languageCode: LanguageCodeEnum! + ): ProductTranslate + productChannelListingUpdate( + id: ID! + input: ProductChannelListingUpdateInput! + ): ProductChannelListingUpdate productMediaCreate(input: ProductMediaCreateInput!): ProductMediaCreate - productVariantReorder(moves: [ReorderInput]!, productId: ID!): ProductVariantReorder + productVariantReorder( + moves: [ReorderInput]! + productId: ID! + ): ProductVariantReorder productMediaDelete(id: ID!): ProductMediaDelete productMediaBulkDelete(ids: [ID]!): ProductMediaBulkDelete productMediaReorder(mediaIds: [ID]!, productId: ID!): ProductMediaReorder - productMediaUpdate(id: ID!, input: ProductMediaUpdateInput!): ProductMediaUpdate + productMediaUpdate( + id: ID! + input: ProductMediaUpdateInput! + ): ProductMediaUpdate productTypeCreate(input: ProductTypeInput!): ProductTypeCreate productTypeDelete(id: ID!): ProductTypeDelete productTypeBulkDelete(ids: [ID]!): ProductTypeBulkDelete productTypeUpdate(id: ID!, input: ProductTypeInput!): ProductTypeUpdate - productTypeReorderAttributes(moves: [ReorderInput]!, productTypeId: ID!, type: ProductAttributeType!): ProductTypeReorderAttributes - productReorderAttributeValues(attributeId: ID!, moves: [ReorderInput]!, productId: ID!): ProductReorderAttributeValues - digitalContentCreate(input: DigitalContentUploadInput!, variantId: ID!): DigitalContentCreate + productTypeReorderAttributes( + moves: [ReorderInput]! + productTypeId: ID! + type: ProductAttributeType! + ): ProductTypeReorderAttributes + productReorderAttributeValues( + attributeId: ID! + moves: [ReorderInput]! + productId: ID! + ): ProductReorderAttributeValues + digitalContentCreate( + input: DigitalContentUploadInput! + variantId: ID! + ): DigitalContentCreate digitalContentDelete(variantId: ID!): DigitalContentDelete - digitalContentUpdate(input: DigitalContentInput!, variantId: ID!): DigitalContentUpdate - digitalContentUrlCreate(input: DigitalContentUrlCreateInput!): DigitalContentUrlCreate + digitalContentUpdate( + input: DigitalContentInput! + variantId: ID! + ): DigitalContentUpdate + digitalContentUrlCreate( + input: DigitalContentUrlCreateInput! + ): DigitalContentUrlCreate productVariantCreate(input: ProductVariantCreateInput!): ProductVariantCreate productVariantDelete(id: ID!): ProductVariantDelete - productVariantBulkCreate(product: ID!, variants: [ProductVariantBulkCreateInput]!): ProductVariantBulkCreate + productVariantBulkCreate( + product: ID! + variants: [ProductVariantBulkCreateInput]! + ): ProductVariantBulkCreate productVariantBulkDelete(ids: [ID]!): ProductVariantBulkDelete - productVariantStocksCreate(stocks: [StockInput!]!, variantId: ID!): ProductVariantStocksCreate - productVariantStocksDelete(variantId: ID!, warehouseIds: [ID!]): ProductVariantStocksDelete - productVariantStocksUpdate(stocks: [StockInput!]!, variantId: ID!): ProductVariantStocksUpdate - productVariantUpdate(id: ID!, input: ProductVariantInput!): ProductVariantUpdate - productVariantSetDefault(productId: ID!, variantId: ID!): ProductVariantSetDefault - productVariantTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): ProductVariantTranslate - productVariantChannelListingUpdate(id: ID!, input: [ProductVariantChannelListingAddInput!]!): ProductVariantChannelListingUpdate - productVariantReorderAttributeValues(attributeId: ID!, moves: [ReorderInput]!, variantId: ID!): ProductVariantReorderAttributeValues + productVariantStocksCreate( + stocks: [StockInput!]! + variantId: ID! + ): ProductVariantStocksCreate + productVariantStocksDelete( + variantId: ID! + warehouseIds: [ID!] + ): ProductVariantStocksDelete + productVariantStocksUpdate( + stocks: [StockInput!]! + variantId: ID! + ): ProductVariantStocksUpdate + productVariantUpdate( + id: ID! + input: ProductVariantInput! + ): ProductVariantUpdate + productVariantSetDefault( + productId: ID! + variantId: ID! + ): ProductVariantSetDefault + productVariantTranslate( + id: ID! + input: NameTranslationInput! + languageCode: LanguageCodeEnum! + ): ProductVariantTranslate + productVariantChannelListingUpdate( + id: ID! + input: [ProductVariantChannelListingAddInput!]! + ): ProductVariantChannelListingUpdate + productVariantReorderAttributeValues( + attributeId: ID! + moves: [ReorderInput]! + variantId: ID! + ): ProductVariantReorderAttributeValues productVariantPreorderDeactivate(id: ID!): ProductVariantPreorderDeactivate variantMediaAssign(mediaId: ID!, variantId: ID!): VariantMediaAssign variantMediaUnassign(mediaId: ID!, variantId: ID!): VariantMediaUnassign paymentCapture(amount: PositiveDecimal, paymentId: ID!): PaymentCapture paymentRefund(amount: PositiveDecimal, paymentId: ID!): PaymentRefund paymentVoid(paymentId: ID!): PaymentVoid - paymentInitialize(channel: String, gateway: String!, paymentData: JSONString): PaymentInitialize + paymentInitialize( + channel: String + gateway: String! + paymentData: JSONString + ): PaymentInitialize paymentCheckBalance(input: PaymentCheckBalanceInput!): PaymentCheckBalance pageCreate(input: PageCreateInput!): PageCreate pageDelete(id: ID!): PageDelete pageBulkDelete(ids: [ID]!): PageBulkDelete pageBulkPublish(ids: [ID]!, isPublished: Boolean!): PageBulkPublish pageUpdate(id: ID!, input: PageInput!): PageUpdate - pageTranslate(id: ID!, input: PageTranslationInput!, languageCode: LanguageCodeEnum!): PageTranslate + pageTranslate( + id: ID! + input: PageTranslationInput! + languageCode: LanguageCodeEnum! + ): PageTranslate pageTypeCreate(input: PageTypeCreateInput!): PageTypeCreate pageTypeUpdate(id: ID, input: PageTypeUpdateInput!): PageTypeUpdate pageTypeDelete(id: ID!): PageTypeDelete pageTypeBulkDelete(ids: [ID!]!): PageTypeBulkDelete - pageAttributeAssign(attributeIds: [ID!]!, pageTypeId: ID!): PageAttributeAssign - pageAttributeUnassign(attributeIds: [ID!]!, pageTypeId: ID!): PageAttributeUnassign - pageTypeReorderAttributes(moves: [ReorderInput!]!, pageTypeId: ID!): PageTypeReorderAttributes - pageReorderAttributeValues(attributeId: ID!, moves: [ReorderInput]!, pageId: ID!): PageReorderAttributeValues + pageAttributeAssign( + attributeIds: [ID!]! + pageTypeId: ID! + ): PageAttributeAssign + pageAttributeUnassign( + attributeIds: [ID!]! + pageTypeId: ID! + ): PageAttributeUnassign + pageTypeReorderAttributes( + moves: [ReorderInput!]! + pageTypeId: ID! + ): PageTypeReorderAttributes + pageReorderAttributeValues( + attributeId: ID! + moves: [ReorderInput]! + pageId: ID! + ): PageReorderAttributeValues draftOrderComplete(id: ID!): DraftOrderComplete draftOrderCreate(input: DraftOrderCreateInput!): DraftOrderCreate draftOrderDelete(id: ID!): DraftOrderDelete draftOrderBulkDelete(ids: [ID]!): DraftOrderBulkDelete - draftOrderLinesBulkDelete(ids: [ID]!): DraftOrderLinesBulkDelete @deprecated(reason: "This field will be removed in Saleor 4.0.") + draftOrderLinesBulkDelete(ids: [ID]!): DraftOrderLinesBulkDelete + @deprecated(reason: "This field will be removed in Saleor 4.0.") draftOrderUpdate(id: ID!, input: DraftOrderInput!): DraftOrderUpdate orderAddNote(order: ID!, input: OrderAddNoteInput!): OrderAddNote orderCancel(id: ID!): OrderCancel orderCapture(amount: PositiveDecimal!, id: ID!): OrderCapture orderConfirm(id: ID!): OrderConfirm orderFulfill(input: OrderFulfillInput!, order: ID): OrderFulfill - orderFulfillmentCancel(id: ID!, input: FulfillmentCancelInput): FulfillmentCancel - orderFulfillmentApprove(allowStockToBeExceeded: Boolean = false, id: ID!, notifyCustomer: Boolean!): FulfillmentApprove - orderFulfillmentUpdateTracking(id: ID!, input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking - orderFulfillmentRefundProducts(input: OrderRefundProductsInput!, order: ID!): FulfillmentRefundProducts - orderFulfillmentReturnProducts(input: OrderReturnProductsInput!, order: ID!): FulfillmentReturnProducts + orderFulfillmentCancel( + id: ID! + input: FulfillmentCancelInput + ): FulfillmentCancel + orderFulfillmentApprove( + allowStockToBeExceeded: Boolean = false + id: ID! + notifyCustomer: Boolean! + ): FulfillmentApprove + orderFulfillmentUpdateTracking( + id: ID! + input: FulfillmentUpdateTrackingInput! + ): FulfillmentUpdateTracking + orderFulfillmentRefundProducts( + input: OrderRefundProductsInput! + order: ID! + ): FulfillmentRefundProducts + orderFulfillmentReturnProducts( + input: OrderReturnProductsInput! + order: ID! + ): FulfillmentReturnProducts orderLinesCreate(id: ID!, input: [OrderLineCreateInput]!): OrderLinesCreate orderLineDelete(id: ID!): OrderLineDelete orderLineUpdate(id: ID!, input: OrderLineInput!): OrderLineUpdate - orderDiscountAdd(input: OrderDiscountCommonInput!, orderId: ID!): OrderDiscountAdd - orderDiscountUpdate(discountId: ID!, input: OrderDiscountCommonInput!): OrderDiscountUpdate + orderDiscountAdd( + input: OrderDiscountCommonInput! + orderId: ID! + ): OrderDiscountAdd + orderDiscountUpdate( + discountId: ID! + input: OrderDiscountCommonInput! + ): OrderDiscountUpdate orderDiscountDelete(discountId: ID!): OrderDiscountDelete - orderLineDiscountUpdate(input: OrderDiscountCommonInput!, orderLineId: ID!): OrderLineDiscountUpdate + orderLineDiscountUpdate( + input: OrderDiscountCommonInput! + orderLineId: ID! + ): OrderLineDiscountUpdate orderLineDiscountRemove(orderLineId: ID!): OrderLineDiscountRemove orderMarkAsPaid(id: ID!, transactionReference: String): OrderMarkAsPaid orderRefund(amount: PositiveDecimal!, id: ID!): OrderRefund orderUpdate(id: ID!, input: OrderUpdateInput!): OrderUpdate - orderUpdateShipping(order: ID!, input: OrderUpdateShippingInput!): OrderUpdateShipping + orderUpdateShipping( + order: ID! + input: OrderUpdateShippingInput! + ): OrderUpdateShipping orderVoid(id: ID!): OrderVoid orderBulkCancel(ids: [ID]!): OrderBulkCancel deleteMetadata(id: ID!, keys: [String!]!): DeleteMetadata deletePrivateMetadata(id: ID!, keys: [String!]!): DeletePrivateMetadata updateMetadata(id: ID!, input: [MetadataInput!]!): UpdateMetadata - updatePrivateMetadata(id: ID!, input: [MetadataInput!]!): UpdatePrivateMetadata + updatePrivateMetadata( + id: ID! + input: [MetadataInput!]! + ): UpdatePrivateMetadata assignNavigation(menu: ID, navigationType: NavigationType!): AssignNavigation menuCreate(input: MenuCreateInput!): MenuCreate menuDelete(id: ID!): MenuDelete @@ -3986,7 +4680,11 @@ type Mutation { menuItemDelete(id: ID!): MenuItemDelete menuItemBulkDelete(ids: [ID]!): MenuItemBulkDelete menuItemUpdate(id: ID!, input: MenuItemInput!): MenuItemUpdate - menuItemTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): MenuItemTranslate + menuItemTranslate( + id: ID! + input: NameTranslationInput! + languageCode: LanguageCodeEnum! + ): MenuItemTranslate menuItemMove(menu: ID!, moves: [MenuItemMoveInput]!): MenuItemMove invoiceRequest(number: String, orderId: ID!): InvoiceRequest invoiceRequestDelete(id: ID!): InvoiceRequestDelete @@ -4001,46 +4699,133 @@ type Mutation { giftCardUpdate(id: ID!, input: GiftCardUpdateInput!): GiftCardUpdate giftCardResend(input: GiftCardResendInput!): GiftCardResend giftCardAddNote(id: ID!, input: GiftCardAddNoteInput!): GiftCardAddNote + giftCardBulkCreate(input: GiftCardBulkCreateInput!): GiftCardBulkCreate giftCardBulkDelete(ids: [ID]!): GiftCardBulkDelete giftCardBulkActivate(ids: [ID]!): GiftCardBulkActivate giftCardBulkDeactivate(ids: [ID]!): GiftCardBulkDeactivate pluginUpdate(channelId: ID, id: ID!, input: PluginUpdateInput!): PluginUpdate - externalNotificationTrigger(channel: String!, input: ExternalNotificationTriggerInput!, pluginId: String): ExternalNotificationTrigger + externalNotificationTrigger( + channel: String! + input: ExternalNotificationTriggerInput! + pluginId: String + ): ExternalNotificationTrigger saleCreate(input: SaleInput!): SaleCreate saleDelete(id: ID!): SaleDelete saleBulkDelete(ids: [ID]!): SaleBulkDelete saleUpdate(id: ID!, input: SaleInput!): SaleUpdate saleCataloguesAdd(id: ID!, input: CatalogueInput!): SaleAddCatalogues saleCataloguesRemove(id: ID!, input: CatalogueInput!): SaleRemoveCatalogues - saleTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): SaleTranslate - saleChannelListingUpdate(id: ID!, input: SaleChannelListingInput!): SaleChannelListingUpdate + saleTranslate( + id: ID! + input: NameTranslationInput! + languageCode: LanguageCodeEnum! + ): SaleTranslate + saleChannelListingUpdate( + id: ID! + input: SaleChannelListingInput! + ): SaleChannelListingUpdate voucherCreate(input: VoucherInput!): VoucherCreate voucherDelete(id: ID!): VoucherDelete voucherBulkDelete(ids: [ID]!): VoucherBulkDelete voucherUpdate(id: ID!, input: VoucherInput!): VoucherUpdate voucherCataloguesAdd(id: ID!, input: CatalogueInput!): VoucherAddCatalogues - voucherCataloguesRemove(id: ID!, input: CatalogueInput!): VoucherRemoveCatalogues - voucherTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): VoucherTranslate - voucherChannelListingUpdate(id: ID!, input: VoucherChannelListingInput!): VoucherChannelListingUpdate + voucherCataloguesRemove( + id: ID! + input: CatalogueInput! + ): VoucherRemoveCatalogues + voucherTranslate( + id: ID! + input: NameTranslationInput! + languageCode: LanguageCodeEnum! + ): VoucherTranslate + voucherChannelListingUpdate( + id: ID! + input: VoucherChannelListingInput! + ): VoucherChannelListingUpdate exportProducts(input: ExportProductsInput!): ExportProducts + exportGiftCards(input: ExportGiftCardsInput!): ExportGiftCards fileUpload(file: Upload!): FileUpload - checkoutAddPromoCode(checkoutId: ID, promoCode: String!, token: UUID): CheckoutAddPromoCode - checkoutBillingAddressUpdate(billingAddress: AddressInput!, checkoutId: ID, token: UUID): CheckoutBillingAddressUpdate - checkoutComplete(checkoutId: ID, paymentData: JSONString, redirectUrl: String, storeSource: Boolean = false, token: UUID): CheckoutComplete + checkoutAddPromoCode( + checkoutId: ID + promoCode: String! + token: UUID + ): CheckoutAddPromoCode + checkoutBillingAddressUpdate( + billingAddress: AddressInput! + checkoutId: ID + token: UUID + ): CheckoutBillingAddressUpdate + checkoutComplete( + checkoutId: ID + paymentData: JSONString + redirectUrl: String + storeSource: Boolean = false + token: UUID + ): CheckoutComplete checkoutCreate(input: CheckoutCreateInput!): CheckoutCreate - checkoutCustomerAttach(checkoutId: ID, customerId: ID, token: UUID): CheckoutCustomerAttach + checkoutCustomerAttach( + checkoutId: ID + customerId: ID + token: UUID + ): CheckoutCustomerAttach checkoutCustomerDetach(checkoutId: ID, token: UUID): CheckoutCustomerDetach - checkoutEmailUpdate(checkoutId: ID, email: String!, token: UUID): CheckoutEmailUpdate - checkoutLineDelete(checkoutId: ID, lineId: ID, token: UUID): CheckoutLineDelete @deprecated(reason: "DEPRECATED: Will be removed in Saleor 4.0. Use `checkoutLinesDelete` instead.") + checkoutEmailUpdate( + checkoutId: ID + email: String! + token: UUID + ): CheckoutEmailUpdate + checkoutLineDelete( + checkoutId: ID + lineId: ID + token: UUID + ): CheckoutLineDelete + @deprecated( + reason: "DEPRECATED: Will be removed in Saleor 4.0. Use `checkoutLinesDelete` instead." + ) checkoutLinesDelete(linesIds: [ID]!, token: UUID!): CheckoutLinesDelete - checkoutLinesAdd(checkoutId: ID, lines: [CheckoutLineInput]!, token: UUID): CheckoutLinesAdd - checkoutLinesUpdate(checkoutId: ID, lines: [CheckoutLineInput]!, token: UUID): CheckoutLinesUpdate - checkoutRemovePromoCode(checkoutId: ID, promoCode: String, promoCodeId: ID, token: UUID): CheckoutRemovePromoCode - checkoutPaymentCreate(checkoutId: ID, input: PaymentInput!, token: UUID): CheckoutPaymentCreate - checkoutShippingAddressUpdate(checkoutId: ID, shippingAddress: AddressInput!, token: UUID): CheckoutShippingAddressUpdate - checkoutShippingMethodUpdate(checkoutId: ID, shippingMethodId: ID!, token: UUID): CheckoutShippingMethodUpdate @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead.") - checkoutDeliveryMethodUpdate(deliveryMethodId: ID, token: UUID): CheckoutDeliveryMethodUpdate - checkoutLanguageCodeUpdate(checkoutId: ID, languageCode: LanguageCodeEnum!, token: UUID): CheckoutLanguageCodeUpdate + checkoutLinesAdd( + checkoutId: ID + lines: [CheckoutLineInput]! + token: UUID + ): CheckoutLinesAdd + checkoutLinesUpdate( + checkoutId: ID + lines: [CheckoutLineInput]! + token: UUID + ): CheckoutLinesUpdate + checkoutRemovePromoCode( + checkoutId: ID + promoCode: String + promoCodeId: ID + token: UUID + ): CheckoutRemovePromoCode + checkoutPaymentCreate( + checkoutId: ID + input: PaymentInput! + token: UUID + ): CheckoutPaymentCreate + checkoutShippingAddressUpdate( + checkoutId: ID + shippingAddress: AddressInput! + token: UUID + ): CheckoutShippingAddressUpdate + checkoutShippingMethodUpdate( + checkoutId: ID + shippingMethodId: ID! + token: UUID + ): CheckoutShippingMethodUpdate + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead." + ) + checkoutDeliveryMethodUpdate( + deliveryMethodId: ID + token: UUID + ): CheckoutDeliveryMethodUpdate + checkoutLanguageCodeUpdate( + checkoutId: ID + languageCode: LanguageCodeEnum! + token: UUID + ): CheckoutLanguageCodeUpdate channelCreate(input: ChannelCreateInput!): ChannelCreate channelUpdate(id: ID!, input: ChannelUpdateInput!): ChannelUpdate channelDelete(id: ID!, input: ChannelDeleteInput): ChannelDelete @@ -4049,14 +4834,31 @@ type Mutation { attributeCreate(input: AttributeCreateInput!): AttributeCreate attributeDelete(id: ID!): AttributeDelete attributeUpdate(id: ID!, input: AttributeUpdateInput!): AttributeUpdate - attributeTranslate(id: ID!, input: NameTranslationInput!, languageCode: LanguageCodeEnum!): AttributeTranslate + attributeTranslate( + id: ID! + input: NameTranslationInput! + languageCode: LanguageCodeEnum! + ): AttributeTranslate attributeBulkDelete(ids: [ID]!): AttributeBulkDelete attributeValueBulkDelete(ids: [ID]!): AttributeValueBulkDelete - attributeValueCreate(attribute: ID!, input: AttributeValueCreateInput!): AttributeValueCreate + attributeValueCreate( + attribute: ID! + input: AttributeValueCreateInput! + ): AttributeValueCreate attributeValueDelete(id: ID!): AttributeValueDelete - attributeValueUpdate(id: ID!, input: AttributeValueUpdateInput!): AttributeValueUpdate - attributeValueTranslate(id: ID!, input: AttributeValueTranslationInput!, languageCode: LanguageCodeEnum!): AttributeValueTranslate - attributeReorderValues(attributeId: ID!, moves: [ReorderInput]!): AttributeReorderValues + attributeValueUpdate( + id: ID! + input: AttributeValueUpdateInput! + ): AttributeValueUpdate + attributeValueTranslate( + id: ID! + input: AttributeValueTranslationInput! + languageCode: LanguageCodeEnum! + ): AttributeValueTranslate + attributeReorderValues( + attributeId: ID! + moves: [ReorderInput]! + ): AttributeReorderValues appCreate(input: AppInput!): AppCreate appUpdate(id: ID!, input: AppInput!): AppUpdate appDelete(id: ID!): AppDelete @@ -4064,7 +4866,10 @@ type Mutation { appTokenDelete(id: ID!): AppTokenDelete appTokenVerify(token: String!): AppTokenVerify appInstall(input: AppInstallInput!): AppInstall - appRetryInstall(activateAfterInstallation: Boolean = true, id: ID!): AppRetryInstall + appRetryInstall( + activateAfterInstallation: Boolean = true + id: ID! + ): AppRetryInstall appDeleteFailedInstallation(id: ID!): AppDeleteFailedInstallation appFetchManifest(manifestUrl: String!): AppFetchManifest appActivate(id: ID!): AppActivate @@ -4073,29 +4878,57 @@ type Mutation { tokenRefresh(csrfToken: String, refreshToken: String): RefreshToken tokenVerify(token: String!): VerifyToken tokensDeactivateAll: DeactivateAllUserTokens - externalAuthenticationUrl(input: JSONString!, pluginId: String!): ExternalAuthenticationUrl - externalObtainAccessTokens(input: JSONString!, pluginId: String!): ExternalObtainAccessTokens + externalAuthenticationUrl( + input: JSONString! + pluginId: String! + ): ExternalAuthenticationUrl + externalObtainAccessTokens( + input: JSONString! + pluginId: String! + ): ExternalObtainAccessTokens externalRefresh(input: JSONString!, pluginId: String!): ExternalRefresh externalLogout(input: JSONString!, pluginId: String!): ExternalLogout externalVerify(input: JSONString!, pluginId: String!): ExternalVerify - requestPasswordReset(channel: String, email: String!, redirectUrl: String!): RequestPasswordReset + requestPasswordReset( + channel: String + email: String! + redirectUrl: String! + ): RequestPasswordReset confirmAccount(email: String!, token: String!): ConfirmAccount setPassword(email: String!, password: String!, token: String!): SetPassword passwordChange(newPassword: String!, oldPassword: String!): PasswordChange - requestEmailChange(channel: String, newEmail: String!, password: String!, redirectUrl: String!): RequestEmailChange + requestEmailChange( + channel: String + newEmail: String! + password: String! + redirectUrl: String! + ): RequestEmailChange confirmEmailChange(channel: String, token: String!): ConfirmEmailChange - accountAddressCreate(input: AddressInput!, type: AddressTypeEnum): AccountAddressCreate + accountAddressCreate( + input: AddressInput! + type: AddressTypeEnum + ): AccountAddressCreate accountAddressUpdate(id: ID!, input: AddressInput!): AccountAddressUpdate accountAddressDelete(id: ID!): AccountAddressDelete - accountSetDefaultAddress(id: ID!, type: AddressTypeEnum!): AccountSetDefaultAddress + accountSetDefaultAddress( + id: ID! + type: AddressTypeEnum! + ): AccountSetDefaultAddress accountRegister(input: AccountRegisterInput!): AccountRegister accountUpdate(input: AccountInput!): AccountUpdate - accountRequestDeletion(channel: String, redirectUrl: String!): AccountRequestDeletion + accountRequestDeletion( + channel: String + redirectUrl: String! + ): AccountRequestDeletion accountDelete(token: String!): AccountDelete addressCreate(input: AddressInput!, userId: ID!): AddressCreate addressUpdate(id: ID!, input: AddressInput!): AddressUpdate addressDelete(id: ID!): AddressDelete - addressSetDefault(addressId: ID!, type: AddressTypeEnum!, userId: ID!): AddressSetDefault + addressSetDefault( + addressId: ID! + type: AddressTypeEnum! + userId: ID! + ): AddressSetDefault customerCreate(input: UserCreateInput!): CustomerCreate customerUpdate(id: ID!, input: CustomerInput!): CustomerUpdate customerDelete(id: ID!): CustomerDelete @@ -4107,8 +4940,13 @@ type Mutation { userAvatarUpdate(image: Upload!): UserAvatarUpdate userAvatarDelete: UserAvatarDelete userBulkSetActive(ids: [ID]!, isActive: Boolean!): UserBulkSetActive - permissionGroupCreate(input: PermissionGroupCreateInput!): PermissionGroupCreate - permissionGroupUpdate(id: ID!, input: PermissionGroupUpdateInput!): PermissionGroupUpdate + permissionGroupCreate( + input: PermissionGroupCreateInput! + ): PermissionGroupCreate + permissionGroupUpdate( + id: ID! + input: PermissionGroupUpdateInput! + ): PermissionGroupUpdate permissionGroupDelete(id: ID!): PermissionGroupDelete } @@ -4155,7 +4993,10 @@ type Order implements Node & ObjectWithMetadata { fulfillments: [Fulfillment]! lines: [OrderLine]! actions: [OrderAction]! - availableShippingMethods: [ShippingMethod] @deprecated(reason: "Use `shippingMethods`, this field will be removed in 4.0") + availableShippingMethods: [ShippingMethod] + @deprecated( + reason: "Use `shippingMethods`, this field will be removed in 4.0" + ) shippingMethods: [ShippingMethod] availableCollectionPoints: [Warehouse!]! invoices: [Invoice] @@ -4168,7 +5009,10 @@ type Order implements Node & ObjectWithMetadata { payments: [Payment] total: TaxedMoney! undiscountedTotal: TaxedMoney! - shippingMethod: ShippingMethod @deprecated(reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead.") + shippingMethod: ShippingMethod + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead." + ) subtotal: TaxedMoney! statusDisplay: String canFinalize: Boolean! @@ -4179,11 +5023,23 @@ type Order implements Node & ObjectWithMetadata { userEmail: String isShippingRequired: Boolean! deliveryMethod: DeliveryMethod - languageCode: String! @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `languageCodeEnum` field to fetch the language code. ") + languageCode: String! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `languageCodeEnum` field to fetch the language code. " + ) languageCodeEnum: LanguageCodeEnum! - discount: Money @deprecated(reason: "This field will be removed in Saleor 4.0. Use discounts field.") - discountName: String @deprecated(reason: "This field will be removed in Saleor 4.0. Use discounts field.") - translatedDiscountName: String @deprecated(reason: "This field will be removed in Saleor 4.0. Use discounts field. ") + discount: Money + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use discounts field." + ) + discountName: String + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use discounts field." + ) + translatedDiscountName: String + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use discounts field. " + ) discounts: [OrderDiscount!] errors: [OrderError!]! } @@ -4198,7 +5054,10 @@ enum OrderAction { type OrderAddNote { order: Order event: OrderEvent - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4208,25 +5067,37 @@ input OrderAddNoteInput { type OrderBulkCancel { count: Int! - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type OrderCancel { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type OrderCapture { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type OrderConfirm { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4259,7 +5130,10 @@ type OrderDiscount implements Node { type OrderDiscountAdd { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4271,7 +5145,10 @@ input OrderDiscountCommonInput { type OrderDiscountDelete { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4282,7 +5159,10 @@ enum OrderDiscountType { type OrderDiscountUpdate { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4460,12 +5340,17 @@ input OrderFilterInput { isClickAndCollect: Boolean isPreorder: Boolean ids: [ID] + giftCardUsed: Boolean + giftCardBought: Boolean } type OrderFulfill { fulfillments: [Fulfillment] order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4519,21 +5404,30 @@ input OrderLineCreateInput { type OrderLineDelete { order: Order orderLine: OrderLine - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type OrderLineDiscountRemove { orderLine: OrderLine order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type OrderLineDiscountUpdate { orderLine: OrderLine order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4543,7 +5437,10 @@ input OrderLineInput { type OrderLineUpdate { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! orderLine: OrderLine } @@ -4551,13 +5448,19 @@ type OrderLineUpdate { type OrderLinesCreate { order: Order orderLines: [OrderLine!] - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } type OrderMarkAsPaid { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4569,7 +5472,10 @@ enum OrderOriginEnum { type OrderRefund { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4627,7 +5533,10 @@ enum OrderSettingsErrorCode { type OrderSettingsUpdate { orderSettings: OrderSettings - orderSettingsErrors: [OrderSettingsError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderSettingsErrors: [OrderSettingsError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderSettingsError!]! } @@ -4671,7 +5580,10 @@ enum OrderStatusFilter { } type OrderUpdate { - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! order: Order } @@ -4684,7 +5596,10 @@ input OrderUpdateInput { type OrderUpdateShipping { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4694,7 +5609,10 @@ input OrderUpdateShippingInput { type OrderVoid { order: Order - orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + orderErrors: [OrderError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [OrderError!]! } @@ -4711,32 +5629,47 @@ type Page implements Node & ObjectWithMetadata { created: DateTime! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - contentJson: JSONString! @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `content` field instead.") + contentJson: JSONString! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `content` field instead." + ) translation(languageCode: LanguageCodeEnum!): PageTranslation attributes: [SelectedAttribute!]! } type PageAttributeAssign { pageType: PageType - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } type PageAttributeUnassign { pageType: PageType - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } type PageBulkDelete { count: Int! - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } type PageBulkPublish { count: Int! - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } @@ -4752,7 +5685,10 @@ type PageCountableEdge { } type PageCreate { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! page: Page } @@ -4769,7 +5705,10 @@ input PageCreateInput { } type PageDelete { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! page: Page } @@ -4818,7 +5757,10 @@ input PageInput { type PageReorderAttributeValues { page: Page - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } @@ -4841,14 +5783,23 @@ type PageTranslatableContent implements Node { seoDescription: String title: String! content: JSONString - contentJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `content` field instead.") + contentJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `content` field instead." + ) translation(languageCode: LanguageCodeEnum!): PageTranslation - page: Page @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + page: Page + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) attributeValues: [AttributeValueTranslatableContent!]! } type PageTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! page: PageTranslatableContent } @@ -4860,7 +5811,10 @@ type PageTranslation implements Node { title: String content: JSONString language: LanguageDisplay! - contentJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `content` field instead.") + contentJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `content` field instead." + ) } input PageTranslationInput { @@ -4877,13 +5831,22 @@ type PageType implements Node & ObjectWithMetadata { privateMetadata: [MetadataItem]! metadata: [MetadataItem]! attributes: [Attribute] - availableAttributes(filter: AttributeFilterInput, before: String, after: String, first: Int, last: Int): AttributeCountableConnection + availableAttributes( + filter: AttributeFilterInput + before: String + after: String + first: Int + last: Int + ): AttributeCountableConnection hasPages: Boolean } type PageTypeBulkDelete { count: Int! - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } @@ -4899,7 +5862,10 @@ type PageTypeCountableEdge { } type PageTypeCreate { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! pageType: PageType } @@ -4911,7 +5877,10 @@ input PageTypeCreateInput { } type PageTypeDelete { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! pageType: PageType } @@ -4922,7 +5891,10 @@ input PageTypeFilterInput { type PageTypeReorderAttributes { pageType: PageType - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! } @@ -4937,7 +5909,10 @@ input PageTypeSortingInput { } type PageTypeUpdate { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! pageType: PageType } @@ -4950,14 +5925,20 @@ input PageTypeUpdateInput { } type PageUpdate { - pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pageErrors: [PageError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PageError!]! page: Page } type PasswordChange { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -4986,7 +5967,10 @@ type Payment implements Node & ObjectWithMetadata { type PaymentCapture { payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + paymentErrors: [PaymentError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PaymentError!]! } @@ -5003,7 +5987,10 @@ enum PaymentChargeStatusEnum { type PaymentCheckBalance { data: JSONString - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + paymentErrors: [PaymentError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PaymentError!]! } @@ -5062,7 +6049,10 @@ type PaymentGateway { type PaymentInitialize { initializedPayment: PaymentInitialized - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + paymentErrors: [PaymentError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PaymentError!]! } @@ -5083,7 +6073,10 @@ input PaymentInput { type PaymentRefund { payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + paymentErrors: [PaymentError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PaymentError!]! } @@ -5096,7 +6089,10 @@ type PaymentSource { type PaymentVoid { payment: Payment - paymentErrors: [PaymentError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + paymentErrors: [PaymentError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PaymentError!]! } @@ -5128,7 +6124,10 @@ enum PermissionEnum { } type PermissionGroupCreate { - permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + permissionGroupErrors: [PermissionGroupError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PermissionGroupError!]! group: Group } @@ -5140,7 +6139,10 @@ input PermissionGroupCreateInput { } type PermissionGroupDelete { - permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + permissionGroupErrors: [PermissionGroupError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PermissionGroupError!]! group: Group } @@ -5178,7 +6180,10 @@ input PermissionGroupSortingInput { } type PermissionGroupUpdate { - permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + permissionGroupErrors: [PermissionGroupError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PermissionGroupError!]! group: Group } @@ -5259,7 +6264,10 @@ input PluginStatusInChannelsInput { type PluginUpdate { plugin: Plugin - pluginsErrors: [PluginError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + pluginsErrors: [PluginError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [PluginError!]! } @@ -5318,7 +6326,10 @@ type Product implements Node & ObjectWithMetadata { privateMetadata: [MetadataItem]! metadata: [MetadataItem]! channel: String - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) thumbnail(size: Int): Image pricing(address: AddressInput): ProductPricingInfo isAvailable(address: AddressInput): Boolean @@ -5326,10 +6337,16 @@ type Product implements Node & ObjectWithMetadata { attributes: [SelectedAttribute!]! channelListings: [ProductChannelListing!] mediaById(id: ID): ProductMedia - imageById(id: ID): ProductImage @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `mediaById` field instead.") + imageById(id: ID): ProductImage + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `mediaById` field instead." + ) variants: [ProductVariant] media: [ProductMedia!] - images: [ProductImage] @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `media` field instead.") + images: [ProductImage] + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `media` field instead." + ) collections: [Collection] translation(languageCode: LanguageCodeEnum!): ProductTranslation availableForPurchase: Date @@ -5338,7 +6355,10 @@ type Product implements Node & ObjectWithMetadata { type ProductAttributeAssign { productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5350,7 +6370,10 @@ input ProductAttributeAssignInput { type ProductAttributeAssignmentUpdate { productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5366,13 +6389,19 @@ enum ProductAttributeType { type ProductAttributeUnassign { productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type ProductBulkDelete { count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5413,7 +6442,10 @@ type ProductChannelListingError { type ProductChannelListingUpdate { product: Product - productChannelListingErrors: [ProductChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productChannelListingErrors: [ProductChannelListingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductChannelListingError!]! } @@ -5434,7 +6466,10 @@ type ProductCountableEdge { } type ProductCreate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! product: Product } @@ -5455,7 +6490,10 @@ input ProductCreateInput { } type ProductDelete { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! product: Product } @@ -5555,14 +6593,20 @@ type ProductMedia implements Node { type ProductMediaBulkDelete { count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type ProductMediaCreate { product: Product media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5576,14 +6620,20 @@ input ProductMediaCreateInput { type ProductMediaDelete { product: Product media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type ProductMediaReorder { product: Product media: [ProductMedia!] - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5595,7 +6645,10 @@ enum ProductMediaType { type ProductMediaUpdate { product: Product media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5634,7 +6687,10 @@ type ProductPricingInfo { type ProductReorderAttributeValues { product: Product - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5649,14 +6705,23 @@ type ProductTranslatableContent implements Node { seoDescription: String name: String! description: JSONString - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) translation(languageCode: LanguageCodeEnum!): ProductTranslation - product: Product @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + product: Product + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) attributeValues: [AttributeValueTranslatableContent!]! } type ProductTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! product: Product } @@ -5668,7 +6733,10 @@ type ProductTranslation implements Node { name: String description: JSONString language: LanguageDisplay! - descriptionJson: JSONString @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `description` field instead.") + descriptionJson: JSONString + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `description` field instead." + ) } type ProductType implements Node & ObjectWithMetadata { @@ -5682,17 +6750,40 @@ type ProductType implements Node & ObjectWithMetadata { privateMetadata: [MetadataItem]! metadata: [MetadataItem]! kind: ProductTypeKindEnum! - products(channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection @deprecated(reason: "This field will be removed in Saleor 4.0. Use the top-level `products` query with the `productTypes` filter.") + products( + channel: String + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the top-level `products` query with the `productTypes` filter." + ) taxType: TaxType - variantAttributes(variantSelection: VariantAttributeScope): [Attribute] @deprecated(reason: "This field will be removed in Saleor 4.0. Use `assignedVariantAttributes` instead.") - assignedVariantAttributes(variantSelection: VariantAttributeScope): [AssignedVariantAttribute] + variantAttributes(variantSelection: VariantAttributeScope): [Attribute] + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `assignedVariantAttributes` instead." + ) + assignedVariantAttributes( + variantSelection: VariantAttributeScope + ): [AssignedVariantAttribute] productAttributes: [Attribute] - availableAttributes(filter: AttributeFilterInput, before: String, after: String, first: Int, last: Int): AttributeCountableConnection + availableAttributes( + filter: AttributeFilterInput + before: String + after: String + first: Int + last: Int + ): AttributeCountableConnection } type ProductTypeBulkDelete { count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5713,13 +6804,19 @@ type ProductTypeCountableEdge { } type ProductTypeCreate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! productType: ProductType } type ProductTypeDelete { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! productType: ProductType } @@ -5758,7 +6855,10 @@ enum ProductTypeKindEnum { type ProductTypeReorderAttributes { productType: ProductType - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5774,13 +6874,19 @@ input ProductTypeSortingInput { } type ProductTypeUpdate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! productType: ProductType } type ProductUpdate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! product: Product } @@ -5802,7 +6908,10 @@ type ProductVariant implements Node & ObjectWithMetadata { margin: Int quantityOrdered: Int revenue(period: ReportingPeriod): TaxedMoney - images: [ProductImage] @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `media` field instead.") + images: [ProductImage] + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `media` field instead." + ) media: [ProductMedia!] translation(languageCode: LanguageCodeEnum!): ProductVariantTranslation digitalContent: DigitalContent @@ -5814,7 +6923,10 @@ type ProductVariant implements Node & ObjectWithMetadata { type ProductVariantBulkCreate { count: Int! productVariants: [ProductVariant!]! - bulkProductErrors: [BulkProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + bulkProductErrors: [BulkProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [BulkProductError!]! } @@ -5831,7 +6943,10 @@ input ProductVariantBulkCreateInput { type ProductVariantBulkDelete { count: Int! - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -5853,7 +6968,10 @@ input ProductVariantChannelListingAddInput { type ProductVariantChannelListingUpdate { variant: ProductVariant - productChannelListingErrors: [ProductChannelListingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productChannelListingErrors: [ProductChannelListingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductChannelListingError!]! } @@ -5869,7 +6987,10 @@ type ProductVariantCountableEdge { } type ProductVariantCreate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! productVariant: ProductVariant } @@ -5886,7 +7007,10 @@ input ProductVariantCreateInput { } type ProductVariantDelete { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! productVariant: ProductVariant } @@ -5914,37 +7038,55 @@ type ProductVariantPreorderDeactivate { type ProductVariantReorder { product: Product - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type ProductVariantReorderAttributeValues { productVariant: ProductVariant - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type ProductVariantSetDefault { product: Product - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type ProductVariantStocksCreate { productVariant: ProductVariant - bulkStockErrors: [BulkStockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + bulkStockErrors: [BulkStockError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [BulkStockError!]! } type ProductVariantStocksDelete { productVariant: ProductVariant - stockErrors: [StockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + stockErrors: [StockError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [StockError!]! } type ProductVariantStocksUpdate { productVariant: ProductVariant - bulkStockErrors: [BulkStockError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + bulkStockErrors: [BulkStockError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [BulkStockError!]! } @@ -5952,12 +7094,18 @@ type ProductVariantTranslatableContent implements Node { id: ID! name: String! translation(languageCode: LanguageCodeEnum!): ProductVariantTranslation - productVariant: ProductVariant @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + productVariant: ProductVariant + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) attributeValues: [AttributeValueTranslatableContent!]! } type ProductVariantTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! productVariant: ProductVariant } @@ -5969,7 +7117,10 @@ type ProductVariantTranslation implements Node { } type ProductVariantUpdate { - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! productVariant: ProductVariant } @@ -5982,79 +7133,321 @@ input PublishableChannelListingInput { type Query { webhook(id: ID!): Webhook - webhookEvents: [WebhookEvent] @deprecated(reason: "This field will be removed in Saleor 4.0. Use `WebhookEventTypeAsyncEnum` and `WebhookEventTypeSyncEnum` to get available event types.") + webhookEvents: [WebhookEvent] + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `WebhookEventTypeAsyncEnum` and `WebhookEventTypeSyncEnum` to get available event types." + ) webhookSamplePayload(eventType: WebhookSampleEventTypeEnum!): JSONString warehouse(id: ID!): Warehouse - warehouses(filter: WarehouseFilterInput, sortBy: WarehouseSortingInput, before: String, after: String, first: Int, last: Int): WarehouseCountableConnection - translations(kind: TranslatableKinds!, before: String, after: String, first: Int, last: Int): TranslatableItemConnection + warehouses( + filter: WarehouseFilterInput + sortBy: WarehouseSortingInput + before: String + after: String + first: Int + last: Int + ): WarehouseCountableConnection + translations( + kind: TranslatableKinds! + before: String + after: String + first: Int + last: Int + ): TranslatableItemConnection translation(id: ID!, kind: TranslatableKinds!): TranslatableItem stock(id: ID!): Stock - stocks(filter: StockFilterInput, before: String, after: String, first: Int, last: Int): StockCountableConnection + stocks( + filter: StockFilterInput + before: String + after: String + first: Int + last: Int + ): StockCountableConnection shop: Shop! orderSettings: OrderSettings giftCardSettings: GiftCardSettings! shippingZone(id: ID!, channel: String): ShippingZone - shippingZones(filter: ShippingZoneFilterInput, channel: String, before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection + shippingZones( + filter: ShippingZoneFilterInput + channel: String + before: String + after: String + first: Int + last: Int + ): ShippingZoneCountableConnection digitalContent(id: ID!): DigitalContent - digitalContents(before: String, after: String, first: Int, last: Int): DigitalContentCountableConnection - categories(filter: CategoryFilterInput, sortBy: CategorySortingInput, level: Int, before: String, after: String, first: Int, last: Int): CategoryCountableConnection + digitalContents( + before: String + after: String + first: Int + last: Int + ): DigitalContentCountableConnection + categories( + filter: CategoryFilterInput + sortBy: CategorySortingInput + level: Int + before: String + after: String + first: Int + last: Int + ): CategoryCountableConnection category(id: ID, slug: String): Category collection(id: ID, slug: String, channel: String): Collection - collections(filter: CollectionFilterInput, sortBy: CollectionSortingInput, channel: String, before: String, after: String, first: Int, last: Int): CollectionCountableConnection + collections( + filter: CollectionFilterInput + sortBy: CollectionSortingInput + channel: String + before: String + after: String + first: Int + last: Int + ): CollectionCountableConnection product(id: ID, slug: String, channel: String): Product - products(filter: ProductFilterInput, sortBy: ProductOrder, channel: String, before: String, after: String, first: Int, last: Int): ProductCountableConnection + products( + filter: ProductFilterInput + sortBy: ProductOrder + channel: String + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection productType(id: ID!): ProductType - productTypes(filter: ProductTypeFilterInput, sortBy: ProductTypeSortingInput, before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection + productTypes( + filter: ProductTypeFilterInput + sortBy: ProductTypeSortingInput + before: String + after: String + first: Int + last: Int + ): ProductTypeCountableConnection productVariant(id: ID, sku: String, channel: String): ProductVariant - productVariants(ids: [ID], channel: String, filter: ProductVariantFilterInput, before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection - reportProductSales(period: ReportingPeriod!, channel: String!, before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection + productVariants( + ids: [ID] + channel: String + filter: ProductVariantFilterInput + before: String + after: String + first: Int + last: Int + ): ProductVariantCountableConnection + reportProductSales( + period: ReportingPeriod! + channel: String! + before: String + after: String + first: Int + last: Int + ): ProductVariantCountableConnection payment(id: ID!): Payment - payments(filter: PaymentFilterInput, before: String, after: String, first: Int, last: Int): PaymentCountableConnection + payments( + filter: PaymentFilterInput + before: String + after: String + first: Int + last: Int + ): PaymentCountableConnection page(id: ID, slug: String): Page - pages(sortBy: PageSortingInput, filter: PageFilterInput, before: String, after: String, first: Int, last: Int): PageCountableConnection + pages( + sortBy: PageSortingInput + filter: PageFilterInput + before: String + after: String + first: Int + last: Int + ): PageCountableConnection pageType(id: ID!): PageType - pageTypes(sortBy: PageTypeSortingInput, filter: PageTypeFilterInput, before: String, after: String, first: Int, last: Int): PageTypeCountableConnection - homepageEvents(before: String, after: String, first: Int, last: Int): OrderEventCountableConnection + pageTypes( + sortBy: PageTypeSortingInput + filter: PageTypeFilterInput + before: String + after: String + first: Int + last: Int + ): PageTypeCountableConnection + homepageEvents( + before: String + after: String + first: Int + last: Int + ): OrderEventCountableConnection order(id: ID!): Order - orders(sortBy: OrderSortingInput, filter: OrderFilterInput, channel: String, before: String, after: String, first: Int, last: Int): OrderCountableConnection - draftOrders(sortBy: OrderSortingInput, filter: OrderDraftFilterInput, before: String, after: String, first: Int, last: Int): OrderCountableConnection + orders( + sortBy: OrderSortingInput + filter: OrderFilterInput + channel: String + before: String + after: String + first: Int + last: Int + ): OrderCountableConnection + draftOrders( + sortBy: OrderSortingInput + filter: OrderDraftFilterInput + before: String + after: String + first: Int + last: Int + ): OrderCountableConnection ordersTotal(period: ReportingPeriod, channel: String): TaxedMoney orderByToken(token: UUID!): Order menu(channel: String, id: ID, name: String, slug: String): Menu - menus(channel: String, sortBy: MenuSortingInput, filter: MenuFilterInput, before: String, after: String, first: Int, last: Int): MenuCountableConnection + menus( + channel: String + sortBy: MenuSortingInput + filter: MenuFilterInput + before: String + after: String + first: Int + last: Int + ): MenuCountableConnection menuItem(id: ID!, channel: String): MenuItem - menuItems(channel: String, sortBy: MenuItemSortingInput, filter: MenuItemFilterInput, before: String, after: String, first: Int, last: Int): MenuItemCountableConnection + menuItems( + channel: String + sortBy: MenuItemSortingInput + filter: MenuItemFilterInput + before: String + after: String + first: Int + last: Int + ): MenuItemCountableConnection giftCard(id: ID!): GiftCard - giftCards(sortBy: GiftCardSortingInput, filter: GiftCardFilterInput, before: String, after: String, first: Int, last: Int): GiftCardCountableConnection + giftCards( + sortBy: GiftCardSortingInput + filter: GiftCardFilterInput + before: String + after: String + first: Int + last: Int + ): GiftCardCountableConnection + giftCardTags( + filter: GiftCardTagFilterInput + before: String + after: String + first: Int + last: Int + ): GiftCardTagCountableConnection giftCardCurrencies: [String!]! plugin(id: ID!): Plugin - plugins(filter: PluginFilterInput, sortBy: PluginSortingInput, before: String, after: String, first: Int, last: Int): PluginCountableConnection + plugins( + filter: PluginFilterInput + sortBy: PluginSortingInput + before: String + after: String + first: Int + last: Int + ): PluginCountableConnection sale(id: ID!, channel: String): Sale - sales(filter: SaleFilterInput, sortBy: SaleSortingInput, query: String, channel: String, before: String, after: String, first: Int, last: Int): SaleCountableConnection + sales( + filter: SaleFilterInput + sortBy: SaleSortingInput + query: String + channel: String + before: String + after: String + first: Int + last: Int + ): SaleCountableConnection voucher(id: ID!, channel: String): Voucher - vouchers(filter: VoucherFilterInput, sortBy: VoucherSortingInput, query: String, channel: String, before: String, after: String, first: Int, last: Int): VoucherCountableConnection + vouchers( + filter: VoucherFilterInput + sortBy: VoucherSortingInput + query: String + channel: String + before: String + after: String + first: Int + last: Int + ): VoucherCountableConnection exportFile(id: ID!): ExportFile - exportFiles(filter: ExportFileFilterInput, sortBy: ExportFileSortingInput, before: String, after: String, first: Int, last: Int): ExportFileCountableConnection + exportFiles( + filter: ExportFileFilterInput + sortBy: ExportFileSortingInput + before: String + after: String + first: Int + last: Int + ): ExportFileCountableConnection taxTypes: [TaxType] checkout(token: UUID): Checkout - checkouts(sortBy: CheckoutSortingInput, filter: CheckoutFilterInput, channel: String, before: String, after: String, first: Int, last: Int): CheckoutCountableConnection - checkoutLines(before: String, after: String, first: Int, last: Int): CheckoutLineCountableConnection + checkouts( + sortBy: CheckoutSortingInput + filter: CheckoutFilterInput + channel: String + before: String + after: String + first: Int + last: Int + ): CheckoutCountableConnection + checkoutLines( + before: String + after: String + first: Int + last: Int + ): CheckoutLineCountableConnection channel(id: ID): Channel channels: [Channel!] - attributes(filter: AttributeFilterInput, sortBy: AttributeSortingInput, channel: String, before: String, after: String, first: Int, last: Int): AttributeCountableConnection + attributes( + filter: AttributeFilterInput + sortBy: AttributeSortingInput + channel: String + before: String + after: String + first: Int + last: Int + ): AttributeCountableConnection attribute(id: ID, slug: String): Attribute appsInstallations: [AppInstallation!]! - apps(filter: AppFilterInput, sortBy: AppSortingInput, before: String, after: String, first: Int, last: Int): AppCountableConnection + apps( + filter: AppFilterInput + sortBy: AppSortingInput + before: String + after: String + first: Int + last: Int + ): AppCountableConnection app(id: ID): App - appExtensions(filter: AppExtensionFilterInput, before: String, after: String, first: Int, last: Int): AppExtensionCountableConnection + appExtensions( + filter: AppExtensionFilterInput + before: String + after: String + first: Int + last: Int + ): AppExtensionCountableConnection appExtension(id: ID!): AppExtension - addressValidationRules(countryCode: CountryCode!, countryArea: String, city: String, cityArea: String): AddressValidationData + addressValidationRules( + countryCode: CountryCode! + countryArea: String + city: String + cityArea: String + ): AddressValidationData address(id: ID!): Address - customers(filter: CustomerFilterInput, sortBy: UserSortingInput, before: String, after: String, first: Int, last: Int): UserCountableConnection - permissionGroups(filter: PermissionGroupFilterInput, sortBy: PermissionGroupSortingInput, before: String, after: String, first: Int, last: Int): GroupCountableConnection + customers( + filter: CustomerFilterInput + sortBy: UserSortingInput + before: String + after: String + first: Int + last: Int + ): UserCountableConnection + permissionGroups( + filter: PermissionGroupFilterInput + sortBy: PermissionGroupSortingInput + before: String + after: String + first: Int + last: Int + ): GroupCountableConnection permissionGroup(id: ID!): Group me: User - staffUsers(filter: StaffUserInput, sortBy: UserSortingInput, before: String, after: String, first: Int, last: Int): UserCountableConnection + staffUsers( + filter: StaffUserInput + sortBy: UserSortingInput + before: String + after: String + first: Int + last: Int + ): UserCountableConnection user(id: ID, email: String): User _entities(representations: [_Any]): [_Entity] _service: _Service @@ -6068,7 +7461,10 @@ type ReducedRate { type RefreshToken { token: String user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -6084,12 +7480,18 @@ enum ReportingPeriod { type RequestEmailChange { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type RequestPasswordReset { - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -6101,10 +7503,30 @@ type Sale implements Node & ObjectWithMetadata { endDate: DateTime privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - categories(before: String, after: String, first: Int, last: Int): CategoryCountableConnection - collections(before: String, after: String, first: Int, last: Int): CollectionCountableConnection - products(before: String, after: String, first: Int, last: Int): ProductCountableConnection - variants(before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection + categories( + before: String + after: String + first: Int + last: Int + ): CategoryCountableConnection + collections( + before: String + after: String + first: Int + last: Int + ): CollectionCountableConnection + products( + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection + variants( + before: String + after: String + first: Int + last: Int + ): ProductVariantCountableConnection translation(languageCode: LanguageCodeEnum!): SaleTranslation channelListings: [SaleChannelListing!] discountValue: Float @@ -6113,13 +7535,19 @@ type Sale implements Node & ObjectWithMetadata { type SaleAddCatalogues { sale: Sale - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } type SaleBulkDelete { count: Int! - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } @@ -6142,7 +7570,10 @@ input SaleChannelListingInput { type SaleChannelListingUpdate { sale: Sale - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } @@ -6158,13 +7589,19 @@ type SaleCountableEdge { } type SaleCreate { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! sale: Sale } type SaleDelete { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! sale: Sale } @@ -6191,7 +7628,10 @@ input SaleInput { type SaleRemoveCatalogues { sale: Sale - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } @@ -6213,11 +7653,17 @@ type SaleTranslatableContent implements Node { id: ID! name: String! translation(languageCode: LanguageCodeEnum!): SaleTranslation - sale: Sale @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + sale: Sale + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type SaleTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! sale: Sale } @@ -6234,7 +7680,10 @@ enum SaleType { } type SaleUpdate { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! sale: Sale } @@ -6254,7 +7703,10 @@ type SetPassword { refreshToken: String csrfToken: String user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -6281,13 +7733,16 @@ type ShippingMethod implements Node & ObjectWithMetadata { id: ID! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - type: ShippingMethodTypeEnum @deprecated(reason: "This field will be removed in Saleor 4.0.") + type: ShippingMethodTypeEnum + @deprecated(reason: "This field will be removed in Saleor 4.0.") name: String! description: JSONString maximumDeliveryDays: Int minimumDeliveryDays: Int - maximumOrderWeight: Weight @deprecated(reason: "This field will be removed in Saleor 4.0.") - minimumOrderWeight: Weight @deprecated(reason: "This field will be removed in Saleor 4.0.") + maximumOrderWeight: Weight + @deprecated(reason: "This field will be removed in Saleor 4.0.") + minimumOrderWeight: Weight + @deprecated(reason: "This field will be removed in Saleor 4.0.") translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation price: Money! maximumOrderPrice: Money @@ -6318,7 +7773,10 @@ input ShippingMethodChannelListingInput { type ShippingMethodChannelListingUpdate { shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } @@ -6334,7 +7792,10 @@ type ShippingMethodTranslatableContent implements Node { name: String! description: JSONString translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation - shippingMethod: ShippingMethodType @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + shippingMethod: ShippingMethodType + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type ShippingMethodTranslation implements Node { @@ -6356,7 +7817,12 @@ type ShippingMethodType implements Node & ObjectWithMetadata { maximumOrderPrice: Money minimumOrderPrice: Money postalCodeRules: [ShippingMethodPostalCodeRule] - excludedProducts(before: String, after: String, first: Int, last: Int): ProductCountableConnection + excludedProducts( + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection minimumOrderWeight: Weight maximumOrderWeight: Weight maximumDeliveryDays: Int @@ -6375,27 +7841,39 @@ input ShippingPostalCodeRulesCreateInputRange { type ShippingPriceBulkDelete { count: Int! - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } type ShippingPriceCreate { shippingZone: ShippingZone shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } type ShippingPriceDelete { shippingMethod: ShippingMethodType shippingZone: ShippingZone - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } type ShippingPriceExcludeProducts { shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } @@ -6419,12 +7897,18 @@ input ShippingPriceInput { type ShippingPriceRemoveProductFromExclude { shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } type ShippingPriceTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! shippingMethod: ShippingMethodType } @@ -6437,7 +7921,10 @@ input ShippingPriceTranslationInput { type ShippingPriceUpdate { shippingZone: ShippingZone shippingMethod: ShippingMethodType - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } @@ -6457,7 +7944,10 @@ type ShippingZone implements Node & ObjectWithMetadata { type ShippingZoneBulkDelete { count: Int! - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! } @@ -6473,7 +7963,10 @@ type ShippingZoneCountableEdge { } type ShippingZoneCreate { - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! shippingZone: ShippingZone } @@ -6488,7 +7981,10 @@ input ShippingZoneCreateInput { } type ShippingZoneDelete { - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! shippingZone: ShippingZone } @@ -6499,7 +7995,10 @@ input ShippingZoneFilterInput { } type ShippingZoneUpdate { - shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shippingErrors: [ShippingError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShippingError!]! shippingZone: ShippingZone } @@ -6516,9 +8015,15 @@ input ShippingZoneUpdateInput { } type Shop { - availablePaymentGateways(currency: String, channel: String): [PaymentGateway!]! + availablePaymentGateways( + currency: String + channel: String + ): [PaymentGateway!]! availableExternalAuthentications: [ExternalAuthentication!]! - availableShippingMethods(channel: String!, address: AddressInput): [ShippingMethod] + availableShippingMethods( + channel: String! + address: AddressInput + ): [ShippingMethod] channelCurrencies: [String!]! countries(languageCode: LanguageCodeEnum): [CountryDisplay!]! defaultCountry: CountryDisplay @@ -6554,13 +8059,19 @@ type Shop { type ShopAddressUpdate { shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! } type ShopDomainUpdate { shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! } @@ -6582,7 +8093,10 @@ enum ShopErrorCode { type ShopFetchTaxRates { shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! } @@ -6609,7 +8123,10 @@ input ShopSettingsInput { type ShopSettingsTranslate { shop: Shop - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! } @@ -6620,7 +8137,10 @@ input ShopSettingsTranslationInput { type ShopSettingsUpdate { shop: Shop - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! } @@ -6638,12 +8158,18 @@ input SiteDomainInput { type StaffBulkDelete { count: Int! - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + staffErrors: [StaffError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [StaffError!]! } type StaffCreate { - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + staffErrors: [StaffError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [StaffError!]! user: User } @@ -6659,7 +8185,10 @@ input StaffCreateInput { } type StaffDelete { - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + staffErrors: [StaffError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [StaffError!]! user: User } @@ -6687,13 +8216,19 @@ type StaffNotificationRecipient implements Node { } type StaffNotificationRecipientCreate { - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! staffNotificationRecipient: StaffNotificationRecipient } type StaffNotificationRecipientDelete { - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! staffNotificationRecipient: StaffNotificationRecipient } @@ -6705,13 +8240,19 @@ input StaffNotificationRecipientInput { } type StaffNotificationRecipientUpdate { - shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + shopErrors: [ShopError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ShopError!]! staffNotificationRecipient: StaffNotificationRecipient } type StaffUpdate { - staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + staffErrors: [StaffError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [StaffError!]! user: User } @@ -6846,7 +8387,18 @@ enum TransactionKind { CANCEL } -union TranslatableItem = ProductTranslatableContent | CollectionTranslatableContent | CategoryTranslatableContent | AttributeTranslatableContent | AttributeValueTranslatableContent | ProductVariantTranslatableContent | PageTranslatableContent | ShippingMethodTranslatableContent | SaleTranslatableContent | VoucherTranslatableContent | MenuItemTranslatableContent +union TranslatableItem = + ProductTranslatableContent + | CollectionTranslatableContent + | CategoryTranslatableContent + | AttributeTranslatableContent + | AttributeValueTranslatableContent + | ProductVariantTranslatableContent + | PageTranslatableContent + | ShippingMethodTranslatableContent + | SaleTranslatableContent + | VoucherTranslatableContent + | MenuItemTranslatableContent type TranslatableItemConnection { pageInfo: PageInfo! @@ -6900,13 +8452,19 @@ input UpdateInvoiceInput { } type UpdateMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + metadataErrors: [MetadataError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MetadataError!]! item: ObjectWithMetadata } type UpdatePrivateMetadata { - metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + metadataErrors: [MetadataError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [MetadataError!]! item: ObjectWithMetadata } @@ -6938,10 +8496,23 @@ type User implements Node & ObjectWithMetadata { privateMetadata: [MetadataItem]! metadata: [MetadataItem]! addresses: [Address] - checkout: Checkout @deprecated(reason: "This field will be removed in Saleor 4.0. Use the `checkout_tokens` field to fetch the user checkouts.") + checkout: Checkout + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use the `checkout_tokens` field to fetch the user checkouts." + ) checkoutTokens(channel: String): [UUID!] - giftCards(before: String, after: String, first: Int, last: Int): GiftCardCountableConnection - orders(before: String, after: String, first: Int, last: Int): OrderCountableConnection + giftCards( + before: String + after: String + first: Int + last: Int + ): GiftCardCountableConnection + orders( + before: String + after: String + first: Int + last: Int + ): OrderCountableConnection userPermissions: [UserPermission] permissionGroups: [Group] editableGroups: [Group] @@ -6953,19 +8524,28 @@ type User implements Node & ObjectWithMetadata { type UserAvatarDelete { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type UserAvatarUpdate { user: User - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } type UserBulkSetActive { count: Int! - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -7026,14 +8606,20 @@ enum VariantAttributeScope { type VariantMediaAssign { productVariant: ProductVariant media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } type VariantMediaUnassign { productVariant: ProductVariant media: ProductMedia - productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + productErrors: [ProductError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [ProductError!]! } @@ -7050,7 +8636,10 @@ type VerifyToken { user: User isValid: Boolean! payload: GenericScalar - accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + accountErrors: [AccountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [AccountError!]! } @@ -7086,10 +8675,30 @@ type Voucher implements Node & ObjectWithMetadata { minCheckoutItemsQuantity: Int privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - categories(before: String, after: String, first: Int, last: Int): CategoryCountableConnection - collections(before: String, after: String, first: Int, last: Int): CollectionCountableConnection - products(before: String, after: String, first: Int, last: Int): ProductCountableConnection - variants(before: String, after: String, first: Int, last: Int): ProductVariantCountableConnection + categories( + before: String + after: String + first: Int + last: Int + ): CategoryCountableConnection + collections( + before: String + after: String + first: Int + last: Int + ): CollectionCountableConnection + products( + before: String + after: String + first: Int + last: Int + ): ProductCountableConnection + variants( + before: String + after: String + first: Int + last: Int + ): ProductVariantCountableConnection countries: [CountryDisplay] translation(languageCode: LanguageCodeEnum!): VoucherTranslation discountValue: Float @@ -7100,13 +8709,19 @@ type Voucher implements Node & ObjectWithMetadata { type VoucherAddCatalogues { voucher: Voucher - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } type VoucherBulkDelete { count: Int! - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } @@ -7131,7 +8746,10 @@ input VoucherChannelListingInput { type VoucherChannelListingUpdate { voucher: Voucher - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } @@ -7147,13 +8765,19 @@ type VoucherCountableEdge { } type VoucherCreate { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! voucher: Voucher } type VoucherDelete { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! voucher: Voucher } @@ -7194,7 +8818,10 @@ input VoucherInput { type VoucherRemoveCatalogues { voucher: Voucher - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! } @@ -7218,11 +8845,17 @@ type VoucherTranslatableContent implements Node { id: ID! name: String translation(languageCode: LanguageCodeEnum!): VoucherTranslation - voucher: Voucher @deprecated(reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries.") + voucher: Voucher + @deprecated( + reason: "This field will be removed in Saleor 4.0. Get model fields from the root level queries." + ) } type VoucherTranslate { - translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + translationErrors: [TranslationError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [TranslationError!]! voucher: Voucher } @@ -7240,7 +8873,10 @@ enum VoucherTypeEnum { } type VoucherUpdate { - discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + discountErrors: [DiscountError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [DiscountError!]! voucher: Voucher } @@ -7249,14 +8885,28 @@ type Warehouse implements Node & ObjectWithMetadata { id: ID! name: String! slug: String! + shippingZones( + before: String + after: String + first: Int + last: Int + ): ShippingZoneCountableConnection! address: Address! email: String! isPrivate: Boolean! privateMetadata: [MetadataItem]! metadata: [MetadataItem]! - companyName: String! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `Address.companyName` instead.") + companyName: String! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `Address.companyName` instead." + ) clickAndCollectOption: WarehouseClickAndCollectOptionEnum! - shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection! + shippingZones( + before: String + after: String + first: Int + last: Int + ): ShippingZoneCountableConnection! } enum WarehouseClickAndCollectOptionEnum { @@ -7277,7 +8927,10 @@ type WarehouseCountableEdge { } type WarehouseCreate { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + warehouseErrors: [WarehouseError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WarehouseError!]! warehouse: Warehouse } @@ -7291,7 +8944,10 @@ input WarehouseCreateInput { } type WarehouseDelete { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + warehouseErrors: [WarehouseError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WarehouseError!]! warehouse: Warehouse } @@ -7319,13 +8975,19 @@ input WarehouseFilterInput { } type WarehouseShippingZoneAssign { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + warehouseErrors: [WarehouseError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WarehouseError!]! warehouse: Warehouse } type WarehouseShippingZoneUnassign { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + warehouseErrors: [WarehouseError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WarehouseError!]! warehouse: Warehouse } @@ -7340,7 +9002,10 @@ input WarehouseSortingInput { } type WarehouseUpdate { - warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + warehouseErrors: [WarehouseError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WarehouseError!]! warehouse: Warehouse } @@ -7360,15 +9025,28 @@ type Webhook implements Node { isActive: Boolean! secretKey: String id: ID! - events: [WebhookEvent!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead.") + events: [WebhookEvent!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `asyncEvents` or `syncEvents` instead." + ) syncEvents: [WebhookEventSync!]! asyncEvents: [WebhookEventAsync!]! app: App! - eventDeliveries(sortBy: EventDeliverySortingInput, filter: EventDeliveryFilterInput, before: String, after: String, first: Int, last: Int): EventDeliveryCountableConnection + eventDeliveries( + sortBy: EventDeliverySortingInput + filter: EventDeliveryFilterInput + before: String + after: String + first: Int + last: Int + ): EventDeliveryCountableConnection } type WebhookCreate { - webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + webhookErrors: [WebhookError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WebhookError!]! webhook: Webhook } @@ -7385,7 +9063,10 @@ input WebhookCreateInput { } type WebhookDelete { - webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + webhookErrors: [WebhookError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WebhookError!]! webhook: Webhook } @@ -7564,7 +9245,10 @@ enum WebhookSampleEventTypeEnum { } type WebhookUpdate { - webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.") + webhookErrors: [WebhookError!]! + @deprecated( + reason: "This field will be removed in Saleor 4.0. Use `errors` field instead." + ) errors: [WebhookError!]! webhook: Webhook } @@ -7597,7 +9281,18 @@ enum WeightUnitsEnum { scalar _Any -union _Entity = App | Address | User | Group | ProductVariant | Product | ProductType | Collection | Category | ProductMedia | PageType +union _Entity = + App + | Address + | User + | Group + | ProductVariant + | Product + | ProductType + | Collection + | Category + | ProductMedia + | PageType type _Service { sdl: String diff --git a/src/components/CardMenu/CardMenu.tsx b/src/components/CardMenu/CardMenu.tsx index 21b100a2d..2075ef5b0 100644 --- a/src/components/CardMenu/CardMenu.tsx +++ b/src/components/CardMenu/CardMenu.tsx @@ -1,23 +1,32 @@ import { + CircularProgress, ClickAwayListener, Grow, IconButton, MenuItem, MenuList, Paper, - Popper + Popper, + Typography } from "@material-ui/core"; import MoreVertIcon from "@material-ui/icons/MoreVert"; import { makeStyles } from "@saleor/macaw-ui"; -import React from "react"; +import classNames from "classnames"; +import * as React from "react"; +import { useEffect, useRef, useState } from "react"; +import { FormattedMessage } from "react-intl"; + +import { cardMenuMessages as messages } from "./messages"; const ITEM_HEIGHT = 48; - export interface CardMenuItem { disabled?: boolean; label: string; testId?: string; onSelect: () => void; + loading?: boolean; + withLoading?: boolean; + hasError?: boolean; } export interface CardMenuProps { @@ -42,6 +51,14 @@ const useStyles = makeStyles( marginTop: theme.spacing(2), maxHeight: ITEM_HEIGHT * 4.5, overflowY: "scroll" + }, + loadingContent: { + width: "100%", + display: "grid", + gridTemplateColumns: "1fr 24px", + gap: theme.spacing(2), + alignItems: "center", + justifyContent: "flex-end" } }), { name: "CardMenu" } @@ -51,8 +68,8 @@ const CardMenu: React.FC = props => { const { className, disabled, menuItems, ...rest } = props; const classes = useStyles(props); - const anchorRef = React.useRef(null); - const [open, setOpen] = React.useState(false); + const anchorRef = useRef(null); + const [open, setOpen] = useState(false); const handleToggle = () => setOpen(prevOpen => !prevOpen); @@ -74,8 +91,8 @@ const CardMenu: React.FC = props => { } }; - const prevOpen = React.useRef(open); - React.useEffect(() => { + const prevOpen = useRef(open); + useEffect(() => { if (prevOpen.current === true && open === false) { anchorRef.current!.focus(); } @@ -83,11 +100,27 @@ const CardMenu: React.FC = props => { prevOpen.current = open; }, [open]); + useEffect(() => { + const hasAnyItemsLoadingOrWithError = menuItems + ?.filter(({ withLoading }) => withLoading) + ?.some(({ loading, hasError }) => loading || hasError); + + if (!hasAnyItemsLoadingOrWithError) { + setOpen(false); + } + }, [menuItems]); + const handleMenuClick = (index: number) => { - menuItems[index].onSelect(); - setOpen(false); + const selectedItem = menuItems[index]; + selectedItem.onSelect(); + + if (!selectedItem.withLoading) { + setOpen(false); + } }; + const isWithLoading = menuItems.some(({ withLoading }) => withLoading); + return (
= props => { {...TransitionProps} style={{ transformOrigin: - placement === "bottom" ? "right top" : "right bottom" + placement === "bottom" ? "right top" : "right bottom", + overflowY: "auto" }} > @@ -128,12 +162,29 @@ const CardMenu: React.FC = props => { {menuItems.map((menuItem, menuItemIndex) => ( handleMenuClick(menuItemIndex)} key={menuItem.label} data-test={menuItem.testId} > - {menuItem.label} +
+ {menuItem.loading ? ( + <> + + + + + + ) : ( + {menuItem.label} + )} +
))} diff --git a/src/components/CardMenu/messages.ts b/src/components/CardMenu/messages.ts new file mode 100644 index 000000000..3fc26f439 --- /dev/null +++ b/src/components/CardMenu/messages.ts @@ -0,0 +1,8 @@ +import { defineMessages } from "react-intl"; + +export const cardMenuMessages = defineMessages({ + cardMenuItemLoading: { + defaultMessage: "working...", + description: "menu item loading" + } +}); diff --git a/src/components/CardTitle/CardTitle.tsx b/src/components/CardTitle/CardTitle.tsx index 6f4cad33c..f2d77d9b1 100644 --- a/src/components/CardTitle/CardTitle.tsx +++ b/src/components/CardTitle/CardTitle.tsx @@ -27,6 +27,9 @@ const useStyles = makeStyles( fontWeight: 500, lineHeight: 1 }, + subtitle: { + fontWeight: 400 + }, toolbar: { marginRight: theme.spacing(-1) } @@ -39,6 +42,7 @@ interface CardTitleProps { className?: string; height?: "default" | "const"; title: string | React.ReactNode; + subtitle?: string | React.ReactNode; toolbar?: React.ReactNode; onClick?: (event: React.MouseEvent) => void; } @@ -49,6 +53,7 @@ const CardTitle: React.FC = props => { children, height, title, + subtitle, toolbar, onClick, ...rest diff --git a/src/components/CollectionWithDividers/CollectionWithDividers.tsx b/src/components/CollectionWithDividers/CollectionWithDividers.tsx index 2e4d09662..3fd6ab2af 100644 --- a/src/components/CollectionWithDividers/CollectionWithDividers.tsx +++ b/src/components/CollectionWithDividers/CollectionWithDividers.tsx @@ -1,10 +1,10 @@ import { Divider } from "@material-ui/core"; -import initial from "lodash/initial"; import React from "react"; interface CollectionWithDividersProps { DividerComponent?: React.FunctionComponent; renderEmpty?: (collection: T[]) => any; + withOuterDividers?: boolean; collection: T[]; renderItem: ( item: T | undefined, @@ -13,7 +13,25 @@ interface CollectionWithDividersProps { ) => any; } +const Wrapper: React.FC<{ + withOuterDividers?: boolean; + SelectedDivider?: React.FunctionComponent; +}> = ({ withOuterDividers, SelectedDivider, children }) => ( +
+ {withOuterDividers && SelectedDivider ? ( + <> + + {children} + + + ) : ( + <>{children} + )} +
+); + function CollectionWithDividers({ + withOuterDividers = false, collection, renderItem, DividerComponent, @@ -31,15 +49,20 @@ function CollectionWithDividers({ const SelectedDividerComponent = DividerComponent || Divider; - return initial( - collection.reduce( - (result, item, index) => [ - ...result, - renderItem(item, index, collection), - - ], - [] - ) + return ( + + <> + {collection.map((item, index) => ( + <> + {renderItem(item, index, collection)} + + + ))} + + ); } diff --git a/src/components/ControlledCheckbox.tsx b/src/components/ControlledCheckbox.tsx index d0fc09f83..9e40c468a 100644 --- a/src/components/ControlledCheckbox.tsx +++ b/src/components/ControlledCheckbox.tsx @@ -1,7 +1,7 @@ import { Checkbox, FormControlLabel } from "@material-ui/core"; import React from "react"; -interface ControlledCheckboxProps { +export interface ControlledCheckboxProps { className?: string; name: string; label?: React.ReactNode; diff --git a/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx b/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx index d601066df..6c4dacfd4 100644 --- a/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx +++ b/src/components/ExtendedPageHeader/ExtendedPageHeader.tsx @@ -54,6 +54,7 @@ const useStyles = makeStyles( interface ExtendedPageHeaderProps { children?: React.ReactNode; className?: string; + childrenWrapperClassName?: string; inline?: boolean; underline?: boolean; title?: React.ReactNode; @@ -61,7 +62,15 @@ interface ExtendedPageHeaderProps { } const ExtendedPageHeader: React.FC = props => { - const { children, className, inline, underline, title, testId } = props; + const { + children, + className, + childrenWrapperClassName, + inline, + underline, + title, + testId + } = props; const classes = useStyles(props); @@ -75,7 +84,9 @@ const ExtendedPageHeader: React.FC = props => { })} > {title} -
{children}
+
+ {children} +
{underline && (
diff --git a/src/components/PageTitleWithStatusChip/PageTitleWithStatusChip.tsx b/src/components/PageTitleWithStatusChip/PageTitleWithStatusChip.tsx index 8f0dd9a34..adbc0ac31 100644 --- a/src/components/PageTitleWithStatusChip/PageTitleWithStatusChip.tsx +++ b/src/components/PageTitleWithStatusChip/PageTitleWithStatusChip.tsx @@ -1,13 +1,10 @@ import HorizontalSpacer from "@saleor/apps/components/HorizontalSpacer"; -import StatusChip from "@saleor/components/StatusChip"; -import { StatusType } from "@saleor/components/StatusChip/types"; import { makeStyles } from "@saleor/macaw-ui"; import React from "react"; +import ExtendedPageHeader from "../ExtendedPageHeader"; export interface PageTitleWithStatusChipProps { title: string; - statusLabel: string; - statusType: StatusType; } const useStyles = makeStyles( @@ -22,17 +19,20 @@ const useStyles = makeStyles( const PageTitleWithStatusChip: React.FC = ({ title, - statusLabel, - statusType + children }) => { const classes = useStyles({}); return ( -
- {title} - - -
+ + <> + + {children} + + ); }; diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.stories.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.stories.tsx index 72ce287f2..b1f39f559 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.stories.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.stories.tsx @@ -31,7 +31,13 @@ const Story: React.FC> = ({ allowCustomValues, emptyOption, enableLoadMore, nakedInput }) => { +>> = ({ + allowCustomValues, + emptyOption, + enableLoadMore, + nakedInput, + disabled +}) => { const [displayValue, setDisplayValue] = React.useState(suggestions[0].label); return ( @@ -60,6 +66,7 @@ const Story: React.FC ); }} @@ -106,9 +113,13 @@ storiesOf("Generics / Select with autocomplete", module) )) .add("naked", () => ) + .add("naked and disabled", () => ) .add("interactive", () => ) .add("interactive with custom option", () => ( )) .add("interactive with empty option", () => ) - .add("interactive with load more", () => ); + .add("interactive with load more", () => ) + .add("disabled", () => ( + + )); diff --git a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx index f3ee4e6f7..6a854b2d6 100644 --- a/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx +++ b/src/components/SingleAutocompleteSelectField/SingleAutocompleteSelectField.tsx @@ -187,7 +187,7 @@ const SingleAutocompleteSelectFieldComponent: React.FC { if (fetchOnFocus) { fetchChoices(inputValue); diff --git a/src/components/SingleSelectField/SingleSelectField.tsx b/src/components/SingleSelectField/SingleSelectField.tsx index 6fa34ee57..20f0c6a4a 100644 --- a/src/components/SingleSelectField/SingleSelectField.tsx +++ b/src/components/SingleSelectField/SingleSelectField.tsx @@ -13,6 +13,8 @@ import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; +import { singleSelectFieldItemHeight } from "./consts"; + const useStyles = makeStyles( theme => ({ formControl: { @@ -26,6 +28,9 @@ const useStyles = makeStyles( }, noLabel: { padding: theme.spacing(2, 1.5) + }, + paper: { + maxHeight: `calc(${singleSelectFieldItemHeight}px * 10 + ${singleSelectFieldItemHeight}px * 0.5)` } }), { name: "SingleSelectField" } @@ -111,6 +116,11 @@ export const SingleSelectField: React.FC = props => { /> } {...selectProps} + MenuProps={{ + classes: { + paper: classes.paper + } + }} > {choices.length > 0 ? ( choices.map(choice => ( diff --git a/src/components/SingleSelectField/consts.ts b/src/components/SingleSelectField/consts.ts new file mode 100644 index 000000000..971a8267d --- /dev/null +++ b/src/components/SingleSelectField/consts.ts @@ -0,0 +1 @@ +export const singleSelectFieldItemHeight = "36"; diff --git a/src/components/TableCellHeader/TableCellHeader.tsx b/src/components/TableCellHeader/TableCellHeader.tsx index 9a68def78..7958b511c 100644 --- a/src/components/TableCellHeader/TableCellHeader.tsx +++ b/src/components/TableCellHeader/TableCellHeader.tsx @@ -25,7 +25,8 @@ const useStyles = makeStyles( }, label: { alignSelf: "center", - display: "inline-block" + display: "inline-block", + userSelect: "none" }, labelContainer: { "&:hover": { @@ -45,6 +46,9 @@ const useStyles = makeStyles( }, root: { cursor: "pointer" + }, + notSortable: { + cursor: "unset" } }), { name: "TableCellHeader" } @@ -69,6 +73,7 @@ const TableCellHeader: React.FC = props => { textAlign, disabled = false, onClick, + title, ...rest } = props; @@ -76,12 +81,15 @@ const TableCellHeader: React.FC = props => { { - if (!disabled) { + if (disabled || !onClick) { + e.preventDefault(); + } else { onClick(e); } }} className={classNames(classes.root, className, { - [classes.disabled]: disabled + [classes.disabled]: disabled, + [classes.notSortable]: !onClick })} >
void; onChange(event: React.ChangeEvent); @@ -80,7 +81,7 @@ export const Timeline: React.FC = props => { }; export const TimelineAddNote: React.FC = props => { - const { message, onChange, onSubmit, reset } = props; + const { message, onChange, onSubmit, reset, disabled } = props; const classes = useStyles(props); const intl = useIntl(); @@ -100,6 +101,7 @@ export const TimelineAddNote: React.FC = props => { = props => { className={classes.button} color="primary" onClick={e => submit(e)} + disabled={disabled} > = props => { const classes = useStyles(props); + const getUserTitleOrEmail = () => { + if (user?.firstName && user?.lastName) { + return `${user.firstName} ${user.lastName}`; + } + + return user?.email; + }; + return (
{user && ( @@ -85,7 +95,7 @@ export const TimelineNote: React.FC = props => { )}
- {user?.email} + {getUserTitleOrEmail()} diff --git a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx index 3f52167ab..f5412278e 100644 --- a/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx +++ b/src/customers/components/CustomerDetailsPage/CustomerDetailsPage.tsx @@ -8,6 +8,7 @@ import { MetadataFormData } from "@saleor/components/Metadata/types"; import PageHeader from "@saleor/components/PageHeader"; import Savebar from "@saleor/components/Savebar"; import { AccountErrorFragment } from "@saleor/fragments/types/AccountErrorFragment"; +import CustomerGiftCardsCard from "@saleor/giftCards/components/GiftCardCustomerCard/CustomerGiftCardsCard"; import { SubmitPromise } from "@saleor/hooks/useForm"; import { sectionNames } from "@saleor/intl"; import { Backlink } from "@saleor/macaw-ui"; @@ -117,6 +118,8 @@ const CustomerDetailsPage: React.FC = ({ /> + +
{ + const customerDetails = useContext(CustomerDetailsContext); + + return customerDetails; +}; diff --git a/src/customers/providers/CustomerDetailsProvider.tsx b/src/customers/providers/CustomerDetailsProvider.tsx new file mode 100644 index 000000000..13c82ce56 --- /dev/null +++ b/src/customers/providers/CustomerDetailsProvider.tsx @@ -0,0 +1,40 @@ +import React, { createContext } from "react"; + +import { useCustomerDetails } from "../queries"; +import { CustomerDetails } from "../types/CustomerDetails"; + +export interface CustomerDetailsProviderProps { + id: string; +} + +interface CustomerDetailsConsumerProps { + customer: CustomerDetails | null; + loading: boolean | null; +} + +export const CustomerDetailsContext = createContext< + CustomerDetailsConsumerProps +>(null); + +export const CustomerDetailsProvider: React.FC = ({ + children, + id +}) => { + const { data, loading } = useCustomerDetails({ + displayLoader: true, + variables: { + id + } + }); + + const providerValues: CustomerDetailsConsumerProps = { + customer: data, + loading + }; + + return ( + + {children} + + ); +}; diff --git a/src/customers/queries.ts b/src/customers/queries.ts index ea45c37a9..803d43081 100644 --- a/src/customers/queries.ts +++ b/src/customers/queries.ts @@ -90,7 +90,8 @@ const customerDetails = gql` } } `; -export const TypedCustomerDetailsQuery = TypedQuery< + +export const useCustomerDetails = makeQuery< CustomerDetails, CustomerDetailsVariables >(customerDetails); diff --git a/src/customers/views/CustomerDetails.tsx b/src/customers/views/CustomerDetails.tsx index a44f9e622..476d1cfcb 100644 --- a/src/customers/views/CustomerDetails.tsx +++ b/src/customers/views/CustomerDetails.tsx @@ -1,36 +1,18 @@ -import { DialogContentText } from "@material-ui/core"; -import ActionDialog from "@saleor/components/ActionDialog"; -import NotFoundPage from "@saleor/components/NotFoundPage"; -import { WindowTitle } from "@saleor/components/WindowTitle"; import useNavigator from "@saleor/hooks/useNavigator"; import useNotifier from "@saleor/hooks/useNotifier"; import { commonMessages } from "@saleor/intl"; -import { getStringOrPlaceholder } from "@saleor/misc"; -import createMetadataUpdateHandler from "@saleor/utils/handlers/metadataUpdateHandler"; -import { - useMetadataUpdate, - usePrivateMetadataUpdate -} from "@saleor/utils/metadata/updateMetadata"; import React from "react"; -import { FormattedMessage, useIntl } from "react-intl"; +import { useIntl } from "react-intl"; -import { orderListUrl, orderUrl } from "../../orders/urls"; -import CustomerDetailsPage, { - CustomerDetailsPageFormData -} from "../components/CustomerDetailsPage/CustomerDetailsPage"; import { TypedRemoveCustomerMutation, TypedUpdateCustomerMutation } from "../mutations"; -import { TypedCustomerDetailsQuery } from "../queries"; +import { CustomerDetailsProvider } from "../providers/CustomerDetailsProvider"; import { RemoveCustomer } from "../types/RemoveCustomer"; import { UpdateCustomer } from "../types/UpdateCustomer"; -import { - customerAddressesUrl, - customerListUrl, - customerUrl, - CustomerUrlQueryParams -} from "../urls"; +import { customerListUrl, CustomerUrlQueryParams } from "../urls"; +import { CustomerDetailsContent } from "./CustomerDetailsContent"; interface CustomerDetailsViewProps { id: string; @@ -75,109 +57,18 @@ export const CustomerDetailsView: React.FC = ({ {(removeCustomer, removeCustomerOpts) => ( {(updateCustomer, updateCustomerOpts) => ( - - {customerDetails => { - const user = customerDetails.data?.user; - - if (user === null) { - return ; - } - - const [updateMetadata] = useMetadataUpdate({}); - const [updatePrivateMetadata] = usePrivateMetadataUpdate({}); - - const updateData = async ( - data: CustomerDetailsPageFormData - ) => { - const result = await updateCustomer({ - variables: { - id, - input: { - email: data.email, - firstName: data.firstName, - isActive: data.isActive, - lastName: data.lastName, - note: data.note - } - } - }); - - return result.data.customerUpdate.errors; - }; - - const handleSubmit = createMetadataUpdateHandler( - user, - updateData, - variables => updateMetadata({ variables }), - variables => updatePrivateMetadata({ variables }) - ); - - return ( - <> - - - navigate(customerAddressesUrl(id)) - } - onBack={handleBack} - onRowClick={id => navigate(orderUrl(id))} - onSubmit={handleSubmit} - onDelete={() => - navigate( - customerUrl(id, { - action: "remove" - }) - ) - } - onViewAllOrdersClick={() => - navigate( - orderListUrl({ - customer: user?.email - }) - ) - } - /> - - navigate(customerUrl(id), { replace: true }) - } - onConfirm={() => removeCustomer()} - title={intl.formatMessage({ - defaultMessage: "Delete Customer", - description: "dialog header" - })} - variant="delete" - open={params.action === "remove"} - > - - - {getStringOrPlaceholder(user?.email)} - - ) - }} - /> - - - - ); - }} - + + + )} )} diff --git a/src/customers/views/CustomerDetailsContent.tsx b/src/customers/views/CustomerDetailsContent.tsx new file mode 100644 index 000000000..e0046af3f --- /dev/null +++ b/src/customers/views/CustomerDetailsContent.tsx @@ -0,0 +1,150 @@ +import { DialogContentText } from "@material-ui/core"; +import ActionDialog from "@saleor/components/ActionDialog"; +import NotFoundPage from "@saleor/components/NotFoundPage"; +import { WindowTitle } from "@saleor/components/WindowTitle"; +import { UseNavigatorResult } from "@saleor/hooks/useNavigator"; +import { getStringOrPlaceholder } from "@saleor/misc"; +import { MutationResultAdditionalProps } from "@saleor/types"; +import createMetadataUpdateHandler from "@saleor/utils/handlers/metadataUpdateHandler"; +import { + useMetadataUpdate, + usePrivateMetadataUpdate +} from "@saleor/utils/metadata/updateMetadata"; +import React, { useContext } from "react"; +import { MutationFunction, MutationResult } from "react-apollo"; +import { FormattedMessage, useIntl } from "react-intl"; + +import { orderListUrl, orderUrl } from "../../orders/urls"; +import CustomerDetailsPage, { + CustomerDetailsPageFormData +} from "../components/CustomerDetailsPage/CustomerDetailsPage"; +import { CustomerDetailsContext } from "../providers/CustomerDetailsProvider"; +import { + RemoveCustomer, + RemoveCustomerVariables +} from "../types/RemoveCustomer"; +import { + UpdateCustomer, + UpdateCustomerVariables +} from "../types/UpdateCustomer"; +import { + customerAddressesUrl, + customerUrl, + CustomerUrlQueryParams +} from "../urls"; + +export interface CustomerDetailsContentProps { + handleBack: () => void; + updateCustomer: MutationFunction; + removeCustomer: MutationFunction; + id: string; + updateCustomerOpts: MutationResult & + MutationResultAdditionalProps; + removeCustomerOpts: MutationResult & + MutationResultAdditionalProps; + navigate: UseNavigatorResult; + params: CustomerUrlQueryParams; +} + +export const CustomerDetailsContent: React.FC = ({ + handleBack, + updateCustomer, + id, + updateCustomerOpts, + removeCustomerOpts, + navigate, + removeCustomer, + params +}) => { + const customerDetails = useContext(CustomerDetailsContext); + const user = customerDetails?.customer?.user; + const customerDetailsLoading = customerDetails?.loading; + + const intl = useIntl(); + + if (user === null) { + return ; + } + + const [updateMetadata] = useMetadataUpdate({}); + const [updatePrivateMetadata] = usePrivateMetadataUpdate({}); + + const updateData = async (data: CustomerDetailsPageFormData) => { + const result = await updateCustomer({ + variables: { + id, + input: { + email: data.email, + firstName: data.firstName, + isActive: data.isActive, + lastName: data.lastName, + note: data.note + } + } + }); + + return result.data.customerUpdate.errors; + }; + + const handleSubmit = createMetadataUpdateHandler( + user, + updateData, + variables => updateMetadata({ variables }), + variables => updatePrivateMetadata({ variables }) + ); + + return ( + <> + + navigate(customerAddressesUrl(id))} + onBack={handleBack} + onRowClick={id => navigate(orderUrl(id))} + onSubmit={handleSubmit} + onDelete={() => + navigate( + customerUrl(id, { + action: "remove" + }) + ) + } + onViewAllOrdersClick={() => + navigate( + orderListUrl({ + customer: user?.email + }) + ) + } + /> + navigate(customerUrl(id), { replace: true })} + onConfirm={() => removeCustomer()} + title={intl.formatMessage({ + defaultMessage: "Delete Customer", + description: "dialog header" + })} + variant="delete" + open={params.action === "remove"} + > + + {getStringOrPlaceholder(user?.email)} + }} + /> + + + + ); +}; diff --git a/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx new file mode 100644 index 000000000..4413df8db --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialog.tsx @@ -0,0 +1,162 @@ +import { Dialog, DialogTitle } from "@material-ui/core"; +import { IMessage } from "@saleor/components/messages"; +import useCurrentDate from "@saleor/hooks/useCurrentDate"; +import useNotifier from "@saleor/hooks/useNotifier"; +import { DialogProps } from "@saleor/types"; +import { GiftCardBulkCreateInput } from "@saleor/types/globalTypes"; +import { getFormErrors } from "@saleor/utils/errors"; +import React, { useEffect, useState } from "react"; +import { useIntl } from "react-intl"; + +import ContentWithProgress from "../GiftCardCreateDialog/ContentWithProgress"; +import GiftCardBulkCreateSuccessDialog from "../GiftCardCreateDialog/GiftCardBulkCreateSuccessDialog"; +import { useChannelCurrencies } from "../GiftCardCreateDialog/queries"; +import { + getGiftCardCreateOnCompletedMessage, + getGiftCardExpiryInputData +} from "../GiftCardCreateDialog/utils"; +import { GIFT_CARD_LIST_QUERY } from "../GiftCardsList/types"; +import GiftCardBulkCreateDialogForm from "./GiftCardBulkCreateDialogForm"; +import { giftCardBulkCreateDialogMessages as messages } from "./messages"; +import { useGiftCardBulkCreateMutation } from "./mutations"; +import { + giftCardBulkCreateErrorKeys, + GiftCardBulkCreateFormData, + GiftCardBulkCreateFormErrors +} from "./types"; +import { GiftCardBulkCreate } from "./types/GiftCardBulkCreate"; +import { validateForm } from "./utils"; + +const GiftCardBulkCreateDialog: React.FC = ({ onClose, open }) => { + const intl = useIntl(); + const notify = useNotifier(); + const [formErrors, setFormErrors] = useState( + null + ); + const [issuedIds, setIssuedIds] = useState(null); + const [openIssueSuccessDialog, setOpenIssueSuccessDialog] = useState( + false + ); + + const onIssueSuccessDialogClose = () => setOpenIssueSuccessDialog(false); + + const { loading: loadingChannelCurrencies } = useChannelCurrencies({}); + + const onCompleted = (data: GiftCardBulkCreate) => { + const errors = data?.giftCardBulkCreate?.errors; + const cardsAmount = data?.giftCardBulkCreate?.giftCards?.length || 0; + + const giftCardsBulkIssueSuccessMessage: IMessage = { + status: "success", + title: intl.formatMessage(messages.createdSuccessAlertTitle), + text: intl.formatMessage(messages.createdSuccessAlertDescription, { + cardsAmount + }) + }; + + notify( + getGiftCardCreateOnCompletedMessage( + errors, + intl, + giftCardsBulkIssueSuccessMessage + ) + ); + + setFormErrors(getFormErrors(giftCardBulkCreateErrorKeys, errors)); + + if (!errors.length) { + setIssuedIds( + data?.giftCardBulkCreate?.giftCards?.map(giftCard => giftCard.id) + ); + setOpenIssueSuccessDialog(true); + onClose(); + } + }; + + const currentDate = useCurrentDate(); + + const getParsedSubmitInputData = ( + formData: GiftCardBulkCreateFormData + ): GiftCardBulkCreateInput => { + const { + balanceAmount, + balanceCurrency, + tags = [], + requiresActivation, + cardsAmount + } = formData; + + return { + count: cardsAmount, + tags, + balance: { + amount: balanceAmount, + currency: balanceCurrency + }, + expiryDate: getGiftCardExpiryInputData(formData, currentDate), + isActive: !requiresActivation + }; + }; + + const [ + bulkCreateGiftCard, + bulkCreateGiftCardOpts + ] = useGiftCardBulkCreateMutation({ + onCompleted, + refetchQueries: [GIFT_CARD_LIST_QUERY] + }); + + const handleSubmit = (data: GiftCardBulkCreateFormData) => { + const formErrors = validateForm(data); + + if (!!Object.keys(formErrors).length) { + setFormErrors(formErrors); + } else { + bulkCreateGiftCard({ + variables: { + input: getParsedSubmitInputData(data) + } + }); + } + }; + + const apiErrors = bulkCreateGiftCardOpts?.data?.giftCardBulkCreate?.errors; + + const handleSetSchemaErrors = () => { + if (apiErrors?.length) { + const formErrorsFromApi = getFormErrors( + giftCardBulkCreateErrorKeys, + apiErrors + ); + + setFormErrors(formErrorsFromApi); + } + }; + + useEffect(handleSetSchemaErrors, [apiErrors]); + + return ( + <> + + {intl.formatMessage(messages.title)} + + {!loadingChannelCurrencies && ( + + )} + + + + + ); +}; + +export default GiftCardBulkCreateDialog; diff --git a/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx new file mode 100644 index 000000000..92e25bbe4 --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/GiftCardBulkCreateDialogForm.tsx @@ -0,0 +1,151 @@ +import { + DialogContent, + Divider, + TextField, + Typography +} from "@material-ui/core"; +import VerticalSpacer from "@saleor/apps/components/VerticalSpacer"; +import DialogButtons from "@saleor/components/ActionDialog/DialogButtons"; +import CardSpacer from "@saleor/components/CardSpacer"; +import GiftCardTagInput from "@saleor/giftCards/components/GiftCardTagInput"; +import useForm from "@saleor/hooks/useForm"; +import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; +import { + GiftCardSettingsExpiryTypeEnum, + TimePeriodTypeEnum +} from "@saleor/types/globalTypes"; +import React from "react"; +import { useIntl } from "react-intl"; + +import GiftCardCreateExpirySelect from "../GiftCardCreateDialog/GiftCardCreateExpirySelect"; +import GiftCardCreateMoneyInput from "../GiftCardCreateDialog/GiftCardCreateMoneyInput"; +import GiftCardCreateRequiresActivationSection from "../GiftCardCreateDialog/GiftCardCreateRequiresActivationSection"; +import { giftCardCreateMessages as messages } from "../GiftCardCreateDialog/messages"; +import { useGiftCardCreateFormStyles as useStyles } from "../GiftCardCreateDialog/styles"; +import { useGiftCardSettingsQuery } from "../GiftCardSettings/queries"; +import { getGiftCardErrorMessage } from "../GiftCardUpdate/messages"; +import { + GiftCardBulkCreateFormCommonProps, + GiftCardBulkCreateFormData, + GiftCardBulkCreateFormErrors +} from "./types"; + +export const initialData: GiftCardBulkCreateFormData = { + tags: [], + balanceAmount: 1, + balanceCurrency: null, + expirySelected: false, + expiryType: "EXPIRY_PERIOD", + expiryDate: "", + expiryPeriodType: TimePeriodTypeEnum.MONTH, + expiryPeriodAmount: 12, + requiresActivation: true, + cardsAmount: 100 +}; + +interface GiftCardBulkCreateDialogFormProps { + opts: { status: ConfirmButtonTransitionState }; + formErrors: GiftCardBulkCreateFormErrors; + onSubmit: (data: GiftCardBulkCreateFormData) => void; + onClose: () => void; +} + +const GiftCardBulkCreateDialogForm: React.FC = ({ + onSubmit, + opts, + onClose, + formErrors = {} +}) => { + const intl = useIntl(); + const classes = useStyles({}); + + const { + data: settingsData, + loading: loadingSettings + } = useGiftCardSettingsQuery(); + + const getInitialExpirySettingsData = (): Partial => { + if (loadingSettings) { + return {}; + } + + const { expiryType, expiryPeriod } = settingsData?.giftCardSettings; + + if (expiryType === GiftCardSettingsExpiryTypeEnum.NEVER_EXPIRE) { + return {}; + } + + return { + expiryType, + expiryPeriodType: expiryPeriod?.type, + expiryPeriodAmount: expiryPeriod?.amount + }; + }; + + const { submit, toggleValue, change, data, set } = useForm( + { + ...initialData, + ...getInitialExpirySettingsData(), + balanceCurrency: "" + }, + onSubmit + ); + + const { tags, requiresActivation, cardsAmount } = data; + + const commonFormProps: GiftCardBulkCreateFormCommonProps = { + data, + errors: formErrors, + toggleValue, + change + }; + + return ( + <> + + + + + + + + + + + + + + + + + {intl.formatMessage(messages.bulkCreateExplanation)} + + + + + ); +}; + +export default GiftCardBulkCreateDialogForm; diff --git a/src/giftCards/GiftCardBulkCreateDialog/index.tsx b/src/giftCards/GiftCardBulkCreateDialog/index.tsx new file mode 100644 index 000000000..f47fef6df --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/index.tsx @@ -0,0 +1,2 @@ +export * from "./GiftCardBulkCreateDialog"; +export { default } from "./GiftCardBulkCreateDialog"; diff --git a/src/giftCards/GiftCardBulkCreateDialog/messages.ts b/src/giftCards/GiftCardBulkCreateDialog/messages.ts new file mode 100644 index 000000000..436e03e83 --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/messages.ts @@ -0,0 +1,16 @@ +import { defineMessages } from "react-intl"; + +export const giftCardBulkCreateDialogMessages = defineMessages({ + title: { + defaultMessage: "Bulk Issue Gift Cards", + description: "bulk issue gift cards dialog title" + }, + createdSuccessAlertTitle: { + defaultMessage: "Gift Cards Issued", + description: "bulk issue gift cards success alert title" + }, + createdSuccessAlertDescription: { + defaultMessage: "Requested {cardsAmount} were successfully issued", + description: "bulk issue gift cards success alert description" + } +}); diff --git a/src/giftCards/GiftCardBulkCreateDialog/mutations.ts b/src/giftCards/GiftCardBulkCreateDialog/mutations.ts new file mode 100644 index 000000000..5634a7db5 --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/mutations.ts @@ -0,0 +1,26 @@ +import makeMutation from "@saleor/hooks/makeMutation"; +import gql from "graphql-tag"; + +import { + GiftCardBulkCreate, + GiftCardBulkCreateVariables +} from "./types/GiftCardBulkCreate"; + +const giftCardBulkCreate = gql` + mutation GiftCardBulkCreate($input: GiftCardBulkCreateInput!) { + giftCardBulkCreate(input: $input) { + giftCards { + id + } + errors { + code + field + } + } + } +`; + +export const useGiftCardBulkCreateMutation = makeMutation< + GiftCardBulkCreate, + GiftCardBulkCreateVariables +>(giftCardBulkCreate); diff --git a/src/giftCards/GiftCardBulkCreateDialog/types.ts b/src/giftCards/GiftCardBulkCreateDialog/types.ts new file mode 100644 index 000000000..ece21f9be --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/types.ts @@ -0,0 +1,58 @@ +import { GiftCardError } from "@saleor/fragments/types/GiftCardError"; +import { FormChange } from "@saleor/hooks/useForm"; +import { TimePeriodTypeEnum } from "@saleor/types/globalTypes"; + +import { GiftCardExpiryType } from "../GiftCardCreateDialog/types"; + +export type GiftCardErrorKey = + | "tags" + | "expiryDate" + | "currency" + | "expiryPeriod" + | "amount" + | "balance" + | "count"; + +export const giftCardBulkCreateErrorKeys: GiftCardErrorKey[] = [ + "tags", + "expiryDate", + "currency", + "amount", + "balance", + "count" +]; + +export interface GiftCardBulkCreateFormData + extends GiftCardCreateCommonFormData { + cardsAmount: number; +} + +export type GiftCardBulkCreateFormError = Pick; + +export type GiftCardBulkCreateFormErrors = Partial< + Record +>; + +export interface GiftCardBulkCreateFormCommonProps { + change: FormChange; + toggleValue: FormChange; + errors: GiftCardBulkCreateFormErrors; + data: GiftCardBulkCreateFormData; +} + +export interface GiftCardCreateCommonFormData { + expirySelected: boolean; + expiryType: GiftCardExpiryType; + expiryPeriodType: TimePeriodTypeEnum; + expiryPeriodAmount: number; + requiresActivation: boolean; + tags: string[]; + balanceAmount: number; + balanceCurrency: string; + expiryDate: string; +} + +export interface GiftCardBulkCreateFormData + extends GiftCardCreateCommonFormData { + cardsAmount: number; +} diff --git a/src/giftCards/GiftCardBulkCreateDialog/types/GiftCardBulkCreate.ts b/src/giftCards/GiftCardBulkCreateDialog/types/GiftCardBulkCreate.ts new file mode 100644 index 000000000..dfa0785c9 --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/types/GiftCardBulkCreate.ts @@ -0,0 +1,35 @@ +/* tslint:disable */ +/* eslint-disable */ +// @generated +// This file was automatically generated and should not be edited. + +import { GiftCardBulkCreateInput, GiftCardErrorCode } from "./../../../types/globalTypes"; + +// ==================================================== +// GraphQL mutation operation: GiftCardBulkCreate +// ==================================================== + +export interface GiftCardBulkCreate_giftCardBulkCreate_giftCards { + __typename: "GiftCard"; + id: string; +} + +export interface GiftCardBulkCreate_giftCardBulkCreate_errors { + __typename: "GiftCardError"; + code: GiftCardErrorCode; + field: string | null; +} + +export interface GiftCardBulkCreate_giftCardBulkCreate { + __typename: "GiftCardBulkCreate"; + giftCards: GiftCardBulkCreate_giftCardBulkCreate_giftCards[]; + errors: GiftCardBulkCreate_giftCardBulkCreate_errors[]; +} + +export interface GiftCardBulkCreate { + giftCardBulkCreate: GiftCardBulkCreate_giftCardBulkCreate | null; +} + +export interface GiftCardBulkCreateVariables { + input: GiftCardBulkCreateInput; +} diff --git a/src/giftCards/GiftCardBulkCreateDialog/utils.ts b/src/giftCards/GiftCardBulkCreateDialog/utils.ts new file mode 100644 index 000000000..3e64d4d38 --- /dev/null +++ b/src/giftCards/GiftCardBulkCreateDialog/utils.ts @@ -0,0 +1,64 @@ +import { GiftCardError } from "@saleor/fragments/types/GiftCardError"; +import { GiftCardErrorCode } from "@saleor/types/globalTypes"; +import reduce from "lodash/reduce"; + +import { + GiftCardBulkCreateFormData, + GiftCardBulkCreateFormErrors +} from "./types"; + +export const validateField = ( + { + expiryDate, + expiryPeriodAmount, + expiryType, + expirySelected, + expiryPeriodType + }: GiftCardBulkCreateFormData, + value, + key: keyof GiftCardBulkCreateFormData +): Pick | null => { + const error = { code: GiftCardErrorCode.INVALID, field: key }; + const expiryDateSelected = expirySelected && expiryType === "EXPIRY_DATE"; + const expiryPeriodSelected = expirySelected && expiryType === "EXPIRY_PERIOD"; + + switch (key) { + case "cardsAmount": + case "tags": + case "balanceCurrency": + case "balanceAmount": + return !value ? error : null; + + case "expiryDate": + return expiryDateSelected && !expiryDate ? error : null; + + case "expiryPeriodAmount": + return expiryPeriodSelected && (!expiryPeriodType || !expiryPeriodAmount) + ? { ...error, field: "expiryDate" } + : null; + } +}; + +export const validateForm = ( + formData: GiftCardBulkCreateFormData +): GiftCardBulkCreateFormErrors => + reduce( + formData, + (resultErrors, value, key: keyof GiftCardBulkCreateFormData) => { + const correspondingKeys = { + cardsAmount: "count", + balanceCurrency: "balance", + balanceAmount: "balance", + expiryPeriodAmount: "expiryDate" + }; + + const formError = validateField(formData, value, key); + + if (!formError) { + return resultErrors; + } + + return { ...resultErrors, [correspondingKeys[key] || key]: formError }; + }, + {} + ); diff --git a/src/giftCards/GiftCardCreateDialog/ContentWithProgress.tsx b/src/giftCards/GiftCardCreateDialog/ContentWithProgress.tsx index c70fbbe20..d911e0d70 100644 --- a/src/giftCards/GiftCardCreateDialog/ContentWithProgress.tsx +++ b/src/giftCards/GiftCardCreateDialog/ContentWithProgress.tsx @@ -15,7 +15,7 @@ export const useStyles = makeStyles( justifyContent: "center", height: "100%", width: "100%", - padding: theme.spacing + padding: theme.spacing(3) } }), { name: "ContentWithProgress" } diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardBulkCreateSuccessDialog.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardBulkCreateSuccessDialog.tsx new file mode 100644 index 000000000..1f4aaa99a --- /dev/null +++ b/src/giftCards/GiftCardCreateDialog/GiftCardBulkCreateSuccessDialog.tsx @@ -0,0 +1,69 @@ +import { + Button, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + Typography +} from "@material-ui/core"; +import { DialogProps } from "@saleor/types"; +import React from "react"; +import { useState } from "react"; +import { FormattedMessage } from "react-intl"; +import { useIntl } from "react-intl"; + +import GiftCardExportDialogContent from "../GiftCardExportDialogContent"; +import { giftCardCreateMessages as messages } from "./messages"; + +interface GiftCardBulkCreateSuccessDialogProps extends DialogProps { + idsToExport: string[] | null; +} + +const GiftCardBulkCreateSuccessDialog: React.FC = ({ + open, + onClose, + idsToExport +}) => { + const intl = useIntl(); + const [openEmailExport, setOpenEmailExport] = useState(false); + + const onExportDialogClose = () => { + setOpenEmailExport(false); + onClose(); + }; + + return ( + <> + + + {intl.formatMessage(messages.bulkCreateIssuedTitle)} + + + + {intl.formatMessage(messages.bulkCreateIssuedExplanation)} + + + + + + + + + + + + ); +}; + +export default GiftCardBulkCreateSuccessDialog; diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogCodeContent.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogCodeContent.tsx index 54274cfc3..e25d607b0 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogCodeContent.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogCodeContent.tsx @@ -7,7 +7,7 @@ import { buttonMessages } from "@saleor/intl"; import React from "react"; import { useIntl } from "react-intl"; -import { giftCardCreateDialogMessages as messages } from "./messages"; +import { giftCardCreateMessages as messages } from "./messages"; import { useGiftCardCreateDialogCodeContentStyles as useStyles } from "./styles"; interface GiftCardCreateDialogCodeContentProps { diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialog.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx similarity index 68% rename from src/giftCards/GiftCardCreateDialog/GiftCardCreateDialog.tsx rename to src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx index afed21a2e..c48d97972 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialog.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogContent.tsx @@ -1,28 +1,36 @@ -import { Dialog, DialogTitle } from "@material-ui/core"; -import { IMessage } from "@saleor/components/messages"; +import { DialogTitle } from "@material-ui/core"; import useCurrentDate from "@saleor/hooks/useCurrentDate"; import useNotifier from "@saleor/hooks/useNotifier"; +import { DialogProps } from "@saleor/types"; import { GiftCardCreateInput } from "@saleor/types/globalTypes"; -import commonErrorMessages from "@saleor/utils/errors/common"; -import { DialogActionHandlersProps } from "@saleor/utils/handlers/dialogActionHandlers"; import React, { useState } from "react"; import { useIntl } from "react-intl"; -import { GIFT_CARD_LIST_QUERY } from "../GiftCardsList/types"; import ContentWithProgress from "./ContentWithProgress"; import GiftCardCreateDialogCodeContent from "./GiftCardCreateDialogCodeContent"; import GiftCardCreateDialogForm, { GiftCardCreateFormData } from "./GiftCardCreateDialogForm"; -import { giftCardCreateDialogMessages as messages } from "./messages"; +import { giftCardCreateMessages as messages } from "./messages"; import { useGiftCardCreateMutation } from "./mutations"; import { useChannelCurrencies } from "./queries"; +import { GiftCardCreateFormCustomer } from "./types"; import { GiftCardCreate } from "./types/GiftCardCreate"; -import { getGiftCardExpiryInputData } from "./utils"; +import { + getGiftCardCreateOnCompletedMessage, + getGiftCardExpiryInputData +} from "./utils"; -const GiftCardCreateDialog: React.FC = ({ - closeDialog, - open +interface GiftCardCreateDialogContentProps + extends Pick { + refetchQueries: string[]; + initialCustomer?: GiftCardCreateFormCustomer | null; +} + +const GiftCardCreateDialogContent: React.FC = ({ + onClose, + refetchQueries, + initialCustomer }) => { const intl = useIntl(); const notify = useNotifier(); @@ -34,17 +42,7 @@ const GiftCardCreateDialog: React.FC = ({ const onCompleted = (data: GiftCardCreate) => { const errors = data?.giftCardCreate?.errors; - const notifierData: IMessage = !!errors?.length - ? { - status: "error", - text: intl.formatMessage(commonErrorMessages.unknownError) - } - : { - status: "success", - text: intl.formatMessage(messages.createdSuccessAlertTitle) - }; - - notify(notifierData); + notify(getGiftCardCreateOnCompletedMessage(errors, intl)); if (!errors?.length) { setCardCode(data?.giftCardCreate?.giftCard?.code); @@ -60,7 +58,7 @@ const GiftCardCreateDialog: React.FC = ({ balanceAmount, balanceCurrency, note, - tag, + tags, sendToCustomerSelected, selectedCustomer, requiresActivation, @@ -69,7 +67,7 @@ const GiftCardCreateDialog: React.FC = ({ return { note: note || null, - tag: tag || null, + addTags: tags || null, userEmail: (sendToCustomerSelected && selectedCustomer.email) || null, channel: (sendToCustomerSelected && channelSlug) || null, balance: { @@ -83,7 +81,7 @@ const GiftCardCreateDialog: React.FC = ({ const [createGiftCard, createGiftCardOpts] = useGiftCardCreateMutation({ onCompleted, - refetchQueries: [GIFT_CARD_LIST_QUERY] + refetchQueries }); const handleSubmit = (data: GiftCardCreateFormData) => { @@ -95,14 +93,11 @@ const GiftCardCreateDialog: React.FC = ({ }; const handleClose = () => { - closeDialog(); - // dialog closing animation runs slower than prop change - // and we don't want to show the form for a split second - setTimeout(() => setCardCode(null), 0); + onClose(); }; return ( - + <> {intl.formatMessage(messages.title)} {!loadingChannelCurrencies && @@ -117,11 +112,12 @@ const GiftCardCreateDialog: React.FC = ({ onClose={handleClose} apiErrors={createGiftCardOpts?.data?.giftCardCreate?.errors} onSubmit={handleSubmit} + initialCustomer={initialCustomer} /> ))} - + ); }; -export default GiftCardCreateDialog; +export default GiftCardCreateDialogContent; diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx index e93ddb46f..979823f9f 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogForm.tsx @@ -1,13 +1,7 @@ -import { - DialogContent, - Divider, - TextField, - Typography -} from "@material-ui/core"; +import { DialogContent, Divider, TextField } from "@material-ui/core"; import VerticalSpacer from "@saleor/apps/components/VerticalSpacer"; import DialogButtons from "@saleor/components/ActionDialog/DialogButtons"; import CardSpacer from "@saleor/components/CardSpacer"; -import ControlledCheckbox from "@saleor/components/ControlledCheckbox"; import { GiftCardError } from "@saleor/fragments/types/GiftCardError"; import GiftCardTagInput from "@saleor/giftCards/components/GiftCardTagInput"; import useForm from "@saleor/hooks/useForm"; @@ -20,40 +14,30 @@ import { } from "@saleor/types/globalTypes"; import { getFormErrors } from "@saleor/utils/errors"; import React, { useState } from "react"; -import { FormattedMessage, useIntl } from "react-intl"; +import { useIntl } from "react-intl"; import GiftCardSendToCustomer from "../components/GiftCardSendToCustomer/GiftCardSendToCustomer"; +import { GiftCardCreateCommonFormData } from "../GiftCardBulkCreateDialog/types"; import { useGiftCardSettingsQuery } from "../GiftCardSettings/queries"; -import GiftCardCreateDialogMoneyInput from "./GiftCardCreateDialogMoneyInput"; import GiftCardCreateExpirySelect from "./GiftCardCreateExpirySelect"; -import { giftCardCreateDialogMessages as messages } from "./messages"; -import { useGiftCardCreateDialogFormStyles as useStyles } from "./styles"; +import GiftCardCreateMoneyInput from "./GiftCardCreateMoneyInput"; +import GiftCardCreateRequiresActivationSection from "./GiftCardCreateRequiresActivationSection"; +import { giftCardCreateMessages as messages } from "./messages"; +import { useGiftCardCreateFormStyles as useStyles } from "./styles"; import { GiftCardCreateFormCommonProps, - GiftCardCreateFormCustomer, - GiftCardExpiryType + GiftCardCreateFormCustomer } from "./types"; -export interface GiftCardCreateFormData { +export interface GiftCardCreateFormData extends GiftCardCreateCommonFormData { note: string; sendToCustomerSelected: boolean; selectedCustomer?: GiftCardCreateFormCustomer; channelSlug?: string; - expirySelected: boolean; - expiryType: GiftCardExpiryType; - expiryPeriodType: TimePeriodTypeEnum; - expiryPeriodAmount: number; - requiresActivation: boolean; - tag: string; - balanceAmount: number; - balanceCurrency: string; - expiryDate: string; } -const initialCustomer = { email: "", name: "" }; - export const initialData: GiftCardCreateFormData = { - tag: "", + tags: [], balanceAmount: 1, balanceCurrency: null, note: "", @@ -65,19 +49,22 @@ export const initialData: GiftCardCreateFormData = { expiryPeriodAmount: 12, requiresActivation: true }; - interface GiftCardCreateDialogFormProps { opts: { status: ConfirmButtonTransitionState }; apiErrors: GiftCardError[]; onSubmit: (data: GiftCardCreateFormData) => void; onClose: () => void; + initialCustomer?: GiftCardCreateFormCustomer | null; } +const defaultInitialCustomer = { email: "", name: "" }; + const GiftCardCreateDialogForm: React.FC = ({ onSubmit, opts, onClose, - apiErrors + apiErrors, + initialCustomer }) => { const intl = useIntl(); const classes = useStyles({}); @@ -89,7 +76,7 @@ const GiftCardCreateDialogForm: React.FC = ({ const [selectedCustomer, setSelectedCustomer] = useState< GiftCardCreateFormCustomer - >(initialCustomer); + >(initialCustomer || defaultInitialCustomer); const handleSubmit = (data: GiftCardCreateFormData) => onSubmit({ ...data, selectedCustomer }); @@ -112,23 +99,24 @@ const GiftCardCreateDialogForm: React.FC = ({ }; }; - const { submit, change, data, set } = useForm( + const { submit, change, toggleValue, data, set } = useForm( { ...initialData, ...getInitialExpirySettingsData(), balanceCurrency: "", - channelSlug: "" + channelSlug: "", + sendToCustomerSelected: !!initialCustomer }, handleSubmit ); const formErrors = getFormErrors( - ["tag", "expiryDate", "customer", "currency", "amount", "balance"], + ["tags", "expiryDate", "customer", "currency", "amount", "balance"], apiErrors ); const { - tag, + tags, sendToCustomerSelected, channelSlug, balanceAmount, @@ -153,19 +141,25 @@ const GiftCardCreateDialogForm: React.FC = ({ const commonFormProps: GiftCardCreateFormCommonProps = { data, errors: formErrors, + toggleValue, change }; return ( <> - - + + @@ -175,6 +169,7 @@ const GiftCardCreateDialogForm: React.FC = ({ sendToCustomerSelected={sendToCustomerSelected} selectedCustomer={selectedCustomer} setSelectedCustomer={setSelectedCustomer} + disabled={!!initialCustomer} /> @@ -192,18 +187,9 @@ const GiftCardCreateDialogForm: React.FC = ({ = ({ +interface GiftCardCreateExpirySelectProps { + errors: GiftCardBulkCreateFormErrors; + change: FormChange; + data: Pick< + GiftCardCreateCommonFormData, + | "expirySelected" + | "expiryPeriodType" + | "expiryPeriodAmount" + | "expiryType" + | "expiryDate" + >; +} + +const GiftCardCreateExpirySelect: React.FC = ({ errors, change, data: { diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateExpirySelect/messages.ts b/src/giftCards/GiftCardCreateDialog/GiftCardCreateExpirySelect/messages.ts index d8f496565..95a27ede6 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateExpirySelect/messages.ts +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateExpirySelect/messages.ts @@ -3,18 +3,18 @@ import { defineMessages } from "react-intl"; export const giftCardCreateExpirySelectMessages = defineMessages({ expirySelectedLabel: { defaultMessage: "Set gift card expiry date", - description: "GiftCarUpdateDetailsExpirySection expiry selected label" + description: "set expiry date selected label" }, expiryPeriodLabel: { defaultMessage: "Expires in", - description: "GiftCarUpdateDetailsExpirySection expiry period label" + description: "expires in label" }, expiryDateLabel: { defaultMessage: "Exact date", - description: "GiftCarUpdateDetailsExpirySection expiry date label" + description: "expiry date label" }, expiryOnLabel: { defaultMessage: "Will expire on:", - description: "GiftCarUpdateDetailsExpirySection expiry on label" + description: "expires on label" } }); diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogMoneyInput.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx similarity index 71% rename from src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogMoneyInput.tsx rename to src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx index 019683494..3bfbed36e 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCreateDialogMoneyInput.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCreateMoneyInput.tsx @@ -1,24 +1,28 @@ import TextWithSelectField from "@saleor/components/TextWithSelectField"; -import { ChangeEvent } from "@saleor/hooks/useForm"; +import { ChangeEvent, FormChange } from "@saleor/hooks/useForm"; import useLocalStorage from "@saleor/hooks/useLocalStorage"; import { mapSingleValueNodeToChoice } from "@saleor/utils/maps"; import * as React from "react"; import { useEffect } from "react"; import { useIntl } from "react-intl"; +import { + GiftCardBulkCreateFormErrors, + GiftCardCreateCommonFormData +} from "../GiftCardBulkCreateDialog/types"; import { getGiftCardErrorMessage } from "../GiftCardUpdate/messages"; -import { GiftCardCreateFormData } from "./GiftCardCreateDialogForm"; -import { giftCardCreateDialogMessages as messages } from "./messages"; +import { giftCardCreateMessages as messages } from "./messages"; import { useChannelCurrencies } from "./queries"; -import { useGiftCardCreateDialogFormStyles as useStyles } from "./styles"; -import { GiftCardCreateFormCommonProps } from "./types"; +import { useGiftCardCreateFormStyles as useStyles } from "./styles"; -interface GiftCardCreateDialogMoneyInputProps - extends GiftCardCreateFormCommonProps { - set: (data: Partial) => void; +interface GiftCardCreateMoneyInputProps { + change: FormChange; + errors: GiftCardBulkCreateFormErrors; + data: Pick; + set: (data: Partial) => void; } -const GiftCardCreateDialogMoneyInput: React.FC = ({ +const GiftCardCreateMoneyInput: React.FC = ({ errors, data: { balanceAmount, balanceCurrency }, change, @@ -32,7 +36,7 @@ const GiftCardCreateDialogMoneyInput: React.FC; + +const GiftCardCreateRequiresActivationSection: React.FC = ({ + checked, + onChange +}) => ( + + + + + + + } + checked={checked} + onChange={onChange} + /> +); + +export default GiftCardCreateRequiresActivationSection; diff --git a/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx b/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx index d1fa67dc3..8a0f2b749 100644 --- a/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx +++ b/src/giftCards/GiftCardCreateDialog/GiftCardCustomerSelectField.tsx @@ -7,17 +7,19 @@ import { mapEdgesToItems } from "@saleor/utils/maps"; import React from "react"; import { useIntl } from "react-intl"; -import { giftCardCreateDialogMessages as messages } from "./messages"; +import { giftCardCreateMessages as messages } from "./messages"; import { GiftCardCreateFormCustomer } from "./types"; export interface GiftCardCustomerSelectFieldProps { selectedCustomer: GiftCardCreateFormCustomer; setSelectedCustomer: (customer: GiftCardCreateFormCustomer) => void; + disabled?: boolean; } const GiftCardCustomerSelectField: React.FC = ({ selectedCustomer, - setSelectedCustomer + setSelectedCustomer, + disabled = false }) => { const intl = useIntl(); @@ -54,6 +56,7 @@ const GiftCardCustomerSelectField: React.FC = fetchChoices={search} onChange={handleSelect} onFetchMore={loadMore} + disabled={disabled} /> ); }; diff --git a/src/giftCards/GiftCardCreateDialog/index.tsx b/src/giftCards/GiftCardCreateDialog/index.tsx index 8773e4b76..d45f4b308 100644 --- a/src/giftCards/GiftCardCreateDialog/index.tsx +++ b/src/giftCards/GiftCardCreateDialog/index.tsx @@ -1,2 +1,2 @@ -export * from "./GiftCardCreateDialog"; -export { default } from "./GiftCardCreateDialog"; +export * from "./GiftCardCreateDialogContent"; +export { default } from "./GiftCardCreateDialogContent"; diff --git a/src/giftCards/GiftCardCreateDialog/messages.ts b/src/giftCards/GiftCardCreateDialog/messages.ts index d40c16e0f..29d3d0799 100644 --- a/src/giftCards/GiftCardCreateDialog/messages.ts +++ b/src/giftCards/GiftCardCreateDialog/messages.ts @@ -1,53 +1,79 @@ import { defineMessages } from "react-intl"; -export const giftCardCreateDialogMessages = defineMessages({ +export const giftCardCreateMessages = defineMessages({ title: { defaultMessage: "Issue gift card", - description: "GiftCardCreateDialog title" + description: "issue gift card dialog title" }, amountLabel: { defaultMessage: "Enter amount", - description: "GiftCardCreateDialog amount label" + description: "money amount input label" }, issueButtonLabel: { defaultMessage: "Issue", - description: "GiftCardCreateDialog issue button label" + description: "issue gift card button label" }, customerLabel: { defaultMessage: "Customer", - description: "GiftCardCreateDialog customer label" + description: "customer input label" }, noteLabel: { defaultMessage: "Note", - description: "GiftCardCreateDialog note label" + description: "note input label" }, noteSubtitle: { defaultMessage: "Why was this gift card issued. This note will not be shown to the customer. Note will be stored in gift card history", - description: "GiftCardCreateDialog note subtitle" + description: "note input subtitle" }, createdGiftCardLabel: { defaultMessage: "This is the code of a created gift card:", - description: "GiftCardCreateDialog created gift card label" + description: "created gift card code label" }, copyCodeLabel: { defaultMessage: "Copy code", - description: "GiftCardCreateDialog copy code label" + description: "copy code button label" }, copiedToClipboardTitle: { defaultMessage: "Copied to clipboard", - description: "GiftCardCreateDialog copied to clipboard title" + description: "copied to clipboard alert title" }, createdSuccessAlertTitle: { defaultMessage: "Successfully created gift card", - description: "GiftCardCreateDialog createdSuccessAlertTitle" + description: "successfully created gift card alert title" }, requiresActivationLabel: { defaultMessage: "Requires activation", - description: "GiftCarUpdateDetailsExpirySection requires activation label" + description: "requires activation checkbox label" }, requiresActivationCaption: { defaultMessage: "All issued cards require activation by staff before use.", - description: "GiftCarUpdateDetailsExpirySection requires activation caption" + description: "requires activation checkbox caption" + }, + giftCardsAmountLabel: { + defaultMessage: "Cards Issued", + description: "issued cards amount label" + }, + bulkCreateExplanation: { + defaultMessage: + "After creation Saleor will create a list of gift card codes that you will be able to download. ", + description: "gift card bulk create modal bottom explanation" + }, + bulkCreateIssuedTitle: { + defaultMessage: "Bulk Issue Gift Cards", + description: "gift card bulk create success dialog title" + }, + bulkCreateIssuedExplanation: { + defaultMessage: + "We have issued all of your requested gift cards. You can download the list of new gift cards using the button below.", + description: "gift card bulk create success dialog content" + }, + bulkCreateIssuedAccept: { + defaultMessage: "Ok", + description: "gift card bulk create success dialog accept button" + }, + bulkCreateIssuedExportToEmail: { + defaultMessage: "Export To Email", + description: "gift card bulk create success dialog export button" } }); diff --git a/src/giftCards/GiftCardCreateDialog/styles.ts b/src/giftCards/GiftCardCreateDialog/styles.ts index 187ed8243..53cb126f2 100644 --- a/src/giftCards/GiftCardCreateDialog/styles.ts +++ b/src/giftCards/GiftCardCreateDialog/styles.ts @@ -11,7 +11,7 @@ export const useGiftCardCreateDialogCodeContentStyles = makeStyles( { name: "GiftCardCreateDialogCodeContent" } ); -export const useGiftCardCreateDialogFormStyles = makeStyles( +export const useGiftCardCreateFormStyles = makeStyles( () => ({ noteField: { width: "100%" @@ -19,7 +19,12 @@ export const useGiftCardCreateDialogFormStyles = makeStyles( currencySelectField: { width: 100 }, - balanceContainer: { width: "100%" } + fullWidthContainer: { width: "100%" }, + dialogContent: { + minWidth: 550, + overflowY: "auto", + overflowX: "hidden" + } }), { name: "GiftCardCreateDialogForm" } ); diff --git a/src/giftCards/GiftCardCreateDialog/types.ts b/src/giftCards/GiftCardCreateDialog/types.ts index 1b3950ee3..c7b13711a 100644 --- a/src/giftCards/GiftCardCreateDialog/types.ts +++ b/src/giftCards/GiftCardCreateDialog/types.ts @@ -10,13 +10,17 @@ export interface GiftCardCreateFormCustomer { email: string; } -export type GiftCardCreateFormErrors = Record< - "tag" | "expiryDate" | "customer" | "currency" | "amount" | "balance", +export type GiftCardCreateCommonFormErrors = Record< + "tags" | "expiryDate" | "currency" | "amount" | "balance", GiftCardError >; +export type GiftCardCreateFormErrors = GiftCardCreateCommonFormErrors & + Record<"customer", GiftCardError>; + export interface GiftCardCreateFormCommonProps { change: FormChange; + toggleValue: FormChange; errors: GiftCardCreateFormErrors; data: GiftCardCreateFormData; } diff --git a/src/giftCards/GiftCardCreateDialog/utils.ts b/src/giftCards/GiftCardCreateDialog/utils.ts index 7cb98d267..3bb2f15ef 100644 --- a/src/giftCards/GiftCardCreateDialog/utils.ts +++ b/src/giftCards/GiftCardCreateDialog/utils.ts @@ -1,7 +1,13 @@ +import { IMessage } from "@saleor/components/messages"; import { TimePeriodTypeEnum } from "@saleor/types/globalTypes"; +import commonErrorMessages from "@saleor/utils/errors/common"; import moment from "moment-timezone"; +import { IntlShape } from "react-intl"; -import { GiftCardCreateFormData } from "./GiftCardCreateDialogForm"; +import { GiftCardCreateCommonFormData } from "../GiftCardBulkCreateDialog/types"; +import { giftCardUpdateFormMessages } from "../GiftCardsList/messages"; +import { giftCardCreateMessages as messages } from "./messages"; +import { GiftCardCreate_giftCardCreate_errors } from "./types/GiftCardCreate"; const addToCurrentDate = ( currentDate: number, @@ -28,6 +34,39 @@ export const getExpiryPeriodTerminationDate = ( } }; +export const getGiftCardExpiryError = (intl: IntlShape): IMessage => ({ + title: intl.formatMessage( + giftCardUpdateFormMessages.giftCardInvalidExpiryDateHeader + ), + text: intl.formatMessage( + giftCardUpdateFormMessages.giftCardInvalidExpiryDateContent + ), + status: "error" +}); + +export const getGiftCardCreateOnCompletedMessage = ( + errors: GiftCardCreate_giftCardCreate_errors[], + intl: IntlShape, + successMessage?: IMessage +): IMessage => { + const hasExpiryError = errors.some(error => error.field === "expiryDate"); + const successGiftCardMessage = successMessage || { + status: "success", + text: intl.formatMessage(messages.createdSuccessAlertTitle) + }; + + if (hasExpiryError) { + return getGiftCardExpiryError(intl); + } + + return !!errors?.length + ? { + status: "error", + text: intl.formatMessage(commonErrorMessages.unknownError) + } + : successGiftCardMessage; +}; + export const getGiftCardExpiryInputData = ( { expirySelected, @@ -35,7 +74,7 @@ export const getGiftCardExpiryInputData = ( expiryDate, expiryPeriodAmount, expiryPeriodType - }: GiftCardCreateFormData, + }: GiftCardCreateCommonFormData, currentDate: number ): string => { if (!expirySelected) { diff --git a/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx b/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx new file mode 100644 index 000000000..13707b22b --- /dev/null +++ b/src/giftCards/GiftCardExportDialogContent/GiftCardExportDialogContent.tsx @@ -0,0 +1,160 @@ +import { + DialogActions, + DialogContent, + DialogTitle, + Typography +} from "@material-ui/core"; +import ConfirmButton from "@saleor/components/ConfirmButton"; +import { Task } from "@saleor/containers/BackgroundTasks/types"; +import useBackgroundTask from "@saleor/hooks/useBackgroundTask"; +import useForm from "@saleor/hooks/useForm"; +import useNotifier from "@saleor/hooks/useNotifier"; +import ExportDialogSettings from "@saleor/products/components/ProductExportDialog/ExportDialogSettings"; +import { + ExportSettingsFormData, + exportSettingsInitialFormData, + exportSettingsInitialFormDataWithIds +} from "@saleor/products/components/ProductExportDialog/types"; +import { DialogProps } from "@saleor/types"; +import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; + +import ContentWithProgress from "../GiftCardCreateDialog/ContentWithProgress"; +import useGiftCardList from "../GiftCardsList/providers/GiftCardListProvider/hooks/useGiftCardList"; +import useGiftCardListBulkActions from "../GiftCardsList/providers/GiftCardListProvider/hooks/useGiftCardListBulkActions"; +import { useGiftCardTotalCountQuery } from "../GiftCardsList/queries"; +import { giftCardExportDialogMessages as messages } from "./messages"; +import { useGiftCardExportMutation } from "./mutations"; +import { ExportGiftCards } from "./types/ExportGiftCards"; +import { getExportGiftCardsInput } from "./utils"; + +const GiftCardExportDialog: React.FC & { + idsToExport?: string[] | null; +}> = ({ onClose, idsToExport }) => { + const intl = useIntl(); + const notify = useNotifier(); + const { queue } = useBackgroundTask(); + + const hasIdsToExport = !!idsToExport?.length; + + const { + loading: loadingGiftCardList, + totalCount: filteredGiftCardsCount + } = useGiftCardList(); + + const { listElements } = useGiftCardListBulkActions(); + + const selectedIds = idsToExport ?? listElements; + + const { + data: allGiftCardsCountData, + loading: loadingGiftCardCount + } = useGiftCardTotalCountQuery(); + + const loading = loadingGiftCardList || loadingGiftCardCount; + + const handleSubmitComplete = (data: ExportGiftCards) => { + const errors = data?.exportGiftCards?.errors; + + if (!errors.length) { + notify({ + text: intl.formatMessage(messages.successAlertDescription), + title: intl.formatMessage(messages.successAlertTitle) + }); + + queue(Task.EXPORT, { + id: data.exportGiftCards.exportFile.id + }); + + onClose(); + } + }; + + const [exportGiftCards, exportGiftCardsOpts] = useGiftCardExportMutation({ + onCompleted: handleSubmitComplete + }); + + const handleSubmit = (data: ExportSettingsFormData) => { + exportGiftCards({ + variables: { + input: getExportGiftCardsInput({ + data, + ids: selectedIds + }) + } + }); + }; + + const { data, change, submit } = useForm( + hasIdsToExport + ? exportSettingsInitialFormDataWithIds + : exportSettingsInitialFormData, + handleSubmit + ); + const allGiftCardsCount = allGiftCardsCountData?.giftCards?.totalCount; + + const exportScopeLabels = { + allItems: intl.formatMessage( + { + defaultMessage: "All gift cards ({number})", + description: "export all items to csv file" + }, + { + number: allGiftCardsCount || "..." + } + ), + selectedItems: intl.formatMessage( + { + defaultMessage: "Selected giftCards ({number})", + description: "export selected items to csv file" + }, + { + number: listElements.length + } + ) + }; + + return ( + <> + + + + + + {!loading && ( + <> + + + {intl.formatMessage(messages.exportNote)} + + + )} + + + + + + + + + ); +}; + +export default GiftCardExportDialog; diff --git a/src/giftCards/GiftCardExportDialogContent/index.tsx b/src/giftCards/GiftCardExportDialogContent/index.tsx new file mode 100644 index 000000000..f976d184c --- /dev/null +++ b/src/giftCards/GiftCardExportDialogContent/index.tsx @@ -0,0 +1,2 @@ +export * from "./GiftCardExportDialogContent"; +export { default } from "./GiftCardExportDialogContent"; diff --git a/src/giftCards/GiftCardExportDialogContent/messages.ts b/src/giftCards/GiftCardExportDialogContent/messages.ts new file mode 100644 index 000000000..e1c5ce1ad --- /dev/null +++ b/src/giftCards/GiftCardExportDialogContent/messages.ts @@ -0,0 +1,29 @@ +import { defineMessages } from "react-intl"; + +export const giftCardExportDialogMessages = defineMessages({ + title: { + defaultMessage: "Export Gift Card Codes", + description: "gift card export dialog title" + }, + exportTypeLabel: { + defaultMessage: "gift cards", + description: "gift card export type label" + }, + confirmButtonLabel: { + defaultMessage: "Export codes", + description: "gift card export dialog confirm button label" + }, + successAlertDescription: { + defaultMessage: + "We are currently exporting your gift card codes. As soon as your file is available it will be sent to your email address", + description: "gift card export success alert description" + }, + successAlertTitle: { + defaultMessage: "Exporting CSV", + description: "gift card export csv success alert title" + }, + exportNote: { + defaultMessage: "Note: Only active and not used gift cards will be expored", + description: "note on export gift cards" + } +}); diff --git a/src/giftCards/GiftCardExportDialogContent/mutations.ts b/src/giftCards/GiftCardExportDialogContent/mutations.ts new file mode 100644 index 000000000..39cf31802 --- /dev/null +++ b/src/giftCards/GiftCardExportDialogContent/mutations.ts @@ -0,0 +1,27 @@ +import { exportErrorFragment } from "@saleor/fragments/errors"; +import makeMutation from "@saleor/hooks/makeMutation"; +import gql from "graphql-tag"; + +import { + ExportGiftCards, + ExportGiftCardsVariables +} from "./types/ExportGiftCards"; + +const exportGiftCards = gql` + ${exportErrorFragment} + mutation ExportGiftCards($input: ExportGiftCardsInput!) { + exportGiftCards(input: $input) { + errors { + ...ExportErrorFragment + } + exportFile { + id + } + } + } +`; + +export const useGiftCardExportMutation = makeMutation< + ExportGiftCards, + ExportGiftCardsVariables +>(exportGiftCards); diff --git a/src/giftCards/GiftCardExportDialogContent/types/ExportGiftCards.ts b/src/giftCards/GiftCardExportDialogContent/types/ExportGiftCards.ts new file mode 100644 index 000000000..3323a9ae5 --- /dev/null +++ b/src/giftCards/GiftCardExportDialogContent/types/ExportGiftCards.ts @@ -0,0 +1,35 @@ +/* tslint:disable */ +/* eslint-disable */ +// @generated +// This file was automatically generated and should not be edited. + +import { ExportGiftCardsInput, ExportErrorCode } from "../../../types/globalTypes"; + +// ==================================================== +// GraphQL mutation operation: ExportGiftCards +// ==================================================== + +export interface ExportGiftCards_exportGiftCards_errors { + __typename: "ExportError"; + code: ExportErrorCode; + field: string | null; +} + +export interface ExportGiftCards_exportGiftCards_exportFile { + __typename: "ExportFile"; + id: string; +} + +export interface ExportGiftCards_exportGiftCards { + __typename: "ExportGiftCards"; + errors: ExportGiftCards_exportGiftCards_errors[]; + exportFile: ExportGiftCards_exportGiftCards_exportFile | null; +} + +export interface ExportGiftCards { + exportGiftCards: ExportGiftCards_exportGiftCards | null; +} + +export interface ExportGiftCardsVariables { + input: ExportGiftCardsInput; +} diff --git a/src/giftCards/GiftCardExportDialogContent/utils.ts b/src/giftCards/GiftCardExportDialogContent/utils.ts new file mode 100644 index 000000000..8aee64d94 --- /dev/null +++ b/src/giftCards/GiftCardExportDialogContent/utils.ts @@ -0,0 +1,27 @@ +import { ExportSettingsFormData } from "@saleor/products/components/ProductExportDialog/types"; +import { ExportScope } from "@saleor/types/globalTypes"; + +interface ExportGiftCardsInputProps { + ids: string[] | null; + data: ExportSettingsFormData; +} + +export const getExportGiftCardsInput = ({ + data, + ids +}: ExportGiftCardsInputProps) => { + const { scope, fileType } = data; + + if (scope === ExportScope.IDS) { + return { + fileType, + scope, + ids + }; + } + + return { + fileType, + scope + }; +}; diff --git a/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/messages.ts b/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/messages.ts index 22c8beb4e..55ac2da09 100644 --- a/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/messages.ts +++ b/src/giftCards/GiftCardSettings/GiftCardExpirySettingsCard/messages.ts @@ -3,10 +3,11 @@ import { defineMessages } from "react-intl"; export const giftCardExpirySettingsCard = defineMessages({ expiryDateSectionDescription: { defaultMessage: - "You can set gift cards to expire after a certain time after their purchase. Remember that in some countries, gift cards expiry is prohibited by law." + "You can set gift cards to expire after a certain time after their purchase. Remember that in some countries, gift cards expiry is prohibited by law.", + description: "expiry date selection info message" }, expiryDateTitle: { defaultMessage: "Expiry date", - description: "section header" + description: "expiry date section header" } }); diff --git a/src/giftCards/GiftCardSettings/messages.ts b/src/giftCards/GiftCardSettings/messages.ts index e94951375..e11ba49c1 100644 --- a/src/giftCards/GiftCardSettings/messages.ts +++ b/src/giftCards/GiftCardSettings/messages.ts @@ -5,7 +5,7 @@ import { defineMessages, IntlShape } from "react-intl"; export const giftCardSettingsPageMessages = defineMessages({ title: { defaultMessage: "Gift Cards Settings", - description: "header" + description: "gift card settings header" } }); diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx b/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx new file mode 100644 index 000000000..302564e9e --- /dev/null +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/GiftCardHistory.tsx @@ -0,0 +1,226 @@ +import { Typography } from "@material-ui/core"; +import { appPath } from "@saleor/apps/urls"; +import Form from "@saleor/components/Form"; +import Hr from "@saleor/components/Hr"; +import Link from "@saleor/components/Link"; +import Skeleton from "@saleor/components/Skeleton"; +import Timeline, { + TimelineAddNote, + TimelineEvent, + TimelineNote +} from "@saleor/components/Timeline"; +import { customerPath } from "@saleor/customers/urls"; +import useNotifier from "@saleor/hooks/useNotifier"; +import { orderPath } from "@saleor/orders/urls"; +import { staffMemberDetailsPath } from "@saleor/staff/urls"; +import { GiftCardEventsEnum } from "@saleor/types/globalTypes"; +import React from "react"; +import { FormattedMessage, useIntl } from "react-intl"; +import { IntlShape } from "react-intl"; + +import { useGiftCardTimelineNoteAddMutation } from "../mutations"; +import { GIFT_CARD_DETAILS_QUERY } from "../queries"; +import { GiftCardAddNote } from "../types/GiftCardAddNote"; +import { GiftCardDetails_giftCard_events } from "../types/GiftCardDetails"; +import useGiftCardHistoryEvents from "./hooks/useGiftCardHistoryEvents"; +import { + giftCardHistoryMessages as messages, + giftCardHistoryTimelineMessages as timelineMessages +} from "./messages"; +import useStyles from "./styles"; + +interface FormData { + message: string; +} + +const getEventMessage = ( + event: GiftCardDetails_giftCard_events, + intl: IntlShape +) => { + const getUserOrApp = () => { + if (event.user) { + const { firstName, lastName, email } = event.user; + + if (lastName === "" || firstName === "") { + return email; + } + + return `${firstName} ${lastName}`; + } + + if (event.app) { + return event.app.name; + } + }; + + const getUserOrAppLink = () => { + if (event.user) { + return customerPath(event.user.id); + } + + if (event.app) { + return appPath(event.app.id); + } + }; + + switch (event.type) { + case GiftCardEventsEnum.ACTIVATED: + return intl.formatMessage(timelineMessages.giftCardActivated, { + activatedBy: ( + + {getUserOrApp()} + + ) + }); + case GiftCardEventsEnum.BALANCE_RESET: + return intl.formatMessage(timelineMessages.giftCardBalanceReset, { + resetBy: ( + + {getUserOrApp()} + + ) + }); + case GiftCardEventsEnum.BOUGHT: + return intl.formatMessage(timelineMessages.giftCardBought, { + orderNumber: ( + #{event.orderNumber} + ) + }); + case GiftCardEventsEnum.DEACTIVATED: + return intl.formatMessage(timelineMessages.giftCardDeactivated, { + deactivatedBy: ( + + {getUserOrApp()} + + ) + }); + case GiftCardEventsEnum.EXPIRY_DATE_UPDATED: + return intl.formatMessage(timelineMessages.giftCardExpiryDateUpdate, { + expiryUpdatedBy: ( + + {getUserOrApp()} + + ) + }); + case GiftCardEventsEnum.ISSUED: + return intl.formatMessage(timelineMessages.giftCardIssued, { + issuedBy: ( + + {getUserOrApp()} + + ) + }); + case GiftCardEventsEnum.RESENT: + return intl.formatMessage(timelineMessages.giftCardResent); + case GiftCardEventsEnum.SENT_TO_CUSTOMER: + return intl.formatMessage(timelineMessages.giftCardSentToCustomer); + case GiftCardEventsEnum.TAGS_UPDATED: + return intl.formatMessage(timelineMessages.giftCardTagsUpdated); + case GiftCardEventsEnum.UPDATED: + return intl.formatMessage(timelineMessages.giftCardTagsUpdated); + case GiftCardEventsEnum.USED_IN_ORDER: + return intl.formatMessage(timelineMessages.giftCardUsedInOrder, { + orderLink: ( + #{event.orderNumber} + ), + buyer: content => + getUserOrApp() ? ( + {`${content} ${getUserOrApp()}`} + ) : null + }); + } +}; + +const GiftCardHistory: React.FC = () => { + const intl = useIntl(); + const notify = useNotifier(); + const { id, events } = useGiftCardHistoryEvents(); + const classes = useStyles(); + + const onTimelineNoteAddCompleted = ({ giftCardAddNote }: GiftCardAddNote) => { + const { errors } = giftCardAddNote; + + if (errors.length > 0) { + notify({ + status: "error", + text: intl.formatMessage(messages.noteAddError) + }); + } else { + notify({ + status: "success", + text: intl.formatMessage(messages.noteAddedSuccessfully) + }); + } + }; + + const [addTimelineNote, { loading }] = useGiftCardTimelineNoteAddMutation({ + refetchQueries: [GIFT_CARD_DETAILS_QUERY], + onCompleted: onTimelineNoteAddCompleted + }); + + const onNoteAdd = (data: FormData) => { + const { message } = data; + addTimelineNote({ variables: { id, input: { message } } }); + }; + + return ( +
+ + + +
+ + + {events && ( + <> +
+ {({ change, data, reset, submit }) => ( + + )} + + {events + .slice() + .reverse() + .map(event => { + const { id, message, type, date, user } = event; + + if (type === GiftCardEventsEnum.NOTE_ADDED) { + return ( + + ); + } + + return ( + + ); + })} + + )} +
+
+
+ ); +}; + +export default GiftCardHistory; diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/hooks/useGiftCardHistoryEvents.ts b/src/giftCards/GiftCardUpdate/GiftCardHistory/hooks/useGiftCardHistoryEvents.ts new file mode 100644 index 000000000..28f9a8068 --- /dev/null +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/hooks/useGiftCardHistoryEvents.ts @@ -0,0 +1,14 @@ +import { useContext } from "react"; + +import { GiftCardDetailsContext } from "../../providers/GiftCardDetailsProvider"; + +const useGiftCardHistoryEvents = () => { + const { giftCard } = useContext(GiftCardDetailsContext); + + return { + id: giftCard?.id, + events: giftCard?.events + }; +}; + +export default useGiftCardHistoryEvents; diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/messages.ts b/src/giftCards/GiftCardUpdate/GiftCardHistory/messages.ts new file mode 100644 index 000000000..36f5851a4 --- /dev/null +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/messages.ts @@ -0,0 +1,62 @@ +import { defineMessages } from "react-intl"; + +const giftCardHistoryMessages = defineMessages({ + noteAddedSuccessfully: { + defaultMessage: "Note was added sucessfully", + description: "notifier message" + }, + noteAddError: { + defaultMessage: "There was an error adding a note", + description: "notifier message" + }, + historyHeaderTitle: { + defaultMessage: "Gift Card Timeline", + description: "section header title" + } +}); + +const giftCardHistoryTimelineMessages = defineMessages({ + giftCardActivated: { + defaultMessage: "Gift card was activated by {activatedBy}", + description: "gift card history message" + }, + giftCardBalanceReset: { + defaultMessage: "Gift card balance was reset by {resetBy}", + description: "gift card history message" + }, + giftCardBought: { + defaultMessage: "Gift card was bought in order {orderNumber}", + description: "gift card history message" + }, + giftCardDeactivated: { + defaultMessage: "Gift card was deactivated by {deactivatedBy}", + description: "gift card history message" + }, + giftCardExpiryDateUpdate: { + defaultMessage: "Gift card expiry date was updated by {expiryUpdatedBy}", + description: "gift card history message" + }, + giftCardIssued: { + defaultMessage: "Gift card was issued by {issuedBy}", + description: "dsc" + }, + giftCardResent: { + defaultMessage: "Gift card was resent", + description: "gift card history message" + }, + giftCardSentToCustomer: { + defaultMessage: "Gift card was sent to customer", + description: "gift card history message" + }, + giftCardTagsUpdated: { + defaultMessage: "Gift card tags were updated", + description: "gift card history message" + }, + giftCardUsedInOrder: { + defaultMessage: + "Gift card was used as a payment method on order {orderLink} by", + description: "gift card history message" + } +}); + +export { giftCardHistoryMessages, giftCardHistoryTimelineMessages }; diff --git a/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts b/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts new file mode 100644 index 000000000..5c0124562 --- /dev/null +++ b/src/giftCards/GiftCardUpdate/GiftCardHistory/styles.ts @@ -0,0 +1,14 @@ +import { makeStyles } from "@saleor/macaw-ui"; + +const useStyles = makeStyles( + theme => ({ + header: { + fontWeight: 500, + marginBottom: theme.spacing(1) + }, + root: { marginTop: theme.spacing(4) } + }), + { name: "GiftCardHistory" } +); + +export default useStyles; diff --git a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx index 87465b616..04cb00fed 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/GiftCardResendCodeDialog.tsx @@ -9,8 +9,8 @@ import SingleAutocompleteSelectField from "@saleor/components/SingleAutocomplete import useForm from "@saleor/hooks/useForm"; import useNotifier from "@saleor/hooks/useNotifier"; import { getBySlug } from "@saleor/products/components/ProductVariantCreatorPage/utils"; +import { DialogProps } from "@saleor/types"; import commonErrorMessages from "@saleor/utils/errors/common"; -import { DialogActionHandlersProps } from "@saleor/utils/handlers/dialogActionHandlers"; import { mapSlugNodeToChoice } from "@saleor/utils/maps"; import React, { useEffect, useState } from "react"; import { useIntl } from "react-intl"; @@ -29,10 +29,7 @@ export interface GiftCardResendCodeFormData { channelSlug: string; } -const GiftCardResendCodeDialog: React.FC = ({ - open, - closeDialog -}) => { +const GiftCardResendCodeDialog: React.FC = ({ open, onClose }) => { const intl = useIntl(); const notify = useNotifier(); const classes = useStyles(); @@ -99,7 +96,7 @@ const GiftCardResendCodeDialog: React.FC = ({ notify(notifierData); if (!errors.length) { - closeDialog(); + onClose(); reset(); } }; @@ -128,7 +125,7 @@ const GiftCardResendCodeDialog: React.FC = ({ open={open} onConfirm={submit} confirmButtonLabel={intl.formatMessage(messages.submitButtonLabel)} - onClose={closeDialog} + onClose={onClose} title={intl.formatMessage(messages.title)} confirmButtonState={status} disabled={loading} diff --git a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/messages.ts b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/messages.ts index b66adfcbd..a4515f542 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/messages.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/messages.ts @@ -3,31 +3,31 @@ import { defineMessages } from "react-intl"; export const giftCardResendCodeDialogMessages = defineMessages({ title: { defaultMessage: "Resend code to customer", - description: "GiftCardResendCodeDialog title" + description: "resend code to customer title" }, description: { defaultMessage: "Gift Card Code will be resent to email provided during checkout. You can provide a different email address if you want to:", - description: "GiftCardResendCodeDialog description" + description: "resend code to customer description" }, consentCheckboxLabel: { defaultMessage: "Yes, I want to send gift card to different address", - description: "GiftCardResendCodeDialog consentCheckboxLabel" + description: "consent to send gift card to different address checkbox label" }, submitButtonLabel: { defaultMessage: "Resend", - description: "GiftCardResendCodeDialog submitButtonLabel" + description: "resend button label" }, emailInputPlaceholder: { defaultMessage: "Provided email address", - description: "GiftCardResendCodeDialog emailInputPlaceholder" + description: "provided email input placeholder" }, successResendAlertText: { defaultMessage: "Successfully resent code to customer!", - description: "GiftCardResendCodeDialog successResendAlertText" + description: "resent code success message" }, sendToChannelSelectLabel: { defaultMessage: "Send to channel", - description: "ChannelPickerSelectField sendToChannelLabel" + description: "send to channel select label" } }); diff --git a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/types/GiftCardResend.ts b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/types/GiftCardResend.ts index cf96b7826..748e74acd 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/types/GiftCardResend.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardResendCodeDialog/types/GiftCardResend.ts @@ -65,11 +65,16 @@ export interface GiftCardResend_giftCardResend_giftCard_currentBalance { currency: string; } +export interface GiftCardResend_giftCardResend_giftCard_tags { + __typename: "GiftCardTag"; + name: string; +} + export interface GiftCardResend_giftCardResend_giftCard { __typename: "GiftCard"; metadata: (GiftCardResend_giftCardResend_giftCard_metadata | null)[]; privateMetadata: (GiftCardResend_giftCardResend_giftCard_privateMetadata | null)[]; - displayCode: string; + last4CodeChars: string; boughtInChannel: string | null; createdBy: GiftCardResend_giftCardResend_giftCard_createdBy | null; product: GiftCardResend_giftCardResend_giftCard_product | null; @@ -84,7 +89,7 @@ export interface GiftCardResend_giftCardResend_giftCard { initialBalance: GiftCardResend_giftCardResend_giftCard_initialBalance | null; currentBalance: GiftCardResend_giftCardResend_giftCard_currentBalance | null; id: string; - tag: string | null; + tags: GiftCardResend_giftCardResend_giftCard_tags[] | null; } export interface GiftCardResend_giftCardResend { diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx index 84ee314c3..d18d79324 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/GiftCardUpdateBalanceDialog.tsx @@ -4,8 +4,8 @@ import CardSpacer from "@saleor/components/CardSpacer"; import { IMessage } from "@saleor/components/messages"; import useForm from "@saleor/hooks/useForm"; import useNotifier from "@saleor/hooks/useNotifier"; +import { DialogProps } from "@saleor/types"; import commonErrorMessages from "@saleor/utils/errors/common"; -import { DialogActionHandlersProps } from "@saleor/utils/handlers/dialogActionHandlers"; import React from "react"; import { useIntl } from "react-intl"; @@ -22,9 +22,9 @@ export interface GiftCardBalanceUpdateFormData { balanceAmount: number; } -const GiftCardUpdateBalanceDialog: React.FC = ({ +const GiftCardUpdateBalanceDialog: React.FC = ({ open, - closeDialog + onClose }) => { const intl = useIntl(); const classes = useStyles({}); @@ -57,7 +57,7 @@ const GiftCardUpdateBalanceDialog: React.FC = ({ notify(notifierData); if (!errors.length) { - closeDialog(); + onClose(); } }; @@ -103,7 +103,7 @@ const GiftCardUpdateBalanceDialog: React.FC = ({ open={open} onConfirm={submit} confirmButtonLabel={intl.formatMessage(messages.changeButtonLabel)} - onClose={closeDialog} + onClose={onClose} title={intl.formatMessage(messages.title)} confirmButtonState={status} disabled={loading || !hasChanged} diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/messages.ts b/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/messages.ts index c0df5a486..d208372cb 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/messages.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateBalanceDialog/messages.ts @@ -3,20 +3,19 @@ import { defineMessages } from "react-intl"; export const giftCardUpdateBalanceDialogMessages = defineMessages({ title: { defaultMessage: "Set balance", - description: "GiftCardUpdateDetailsCard set balance button label" + description: "set balance dialog title label" }, subtitle: { defaultMessage: "What would you like to set cards balance to. When you change the balance both values will be changed", - description: "GiftCardUpdateDetailsCard set balance dialog subtitle" + description: "set balance dialog subtitle" }, updatedSuccessAlertTitle: { defaultMessage: "Successfully updated card balance", - description: "GiftCardUpdateDetailsCard update success alert title" + description: "card update success alert title" }, changeButtonLabel: { defaultMessage: "Change", - description: - "GiftCardUpdateDetailsCard set balance dialog change button label" + description: "change button label" } }); diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsCard.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsCard.tsx index 0d787ae3b..1d499235c 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsCard.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/GiftCardUpdateDetailsCard.tsx @@ -26,8 +26,8 @@ const GiftCardUpdateDetailsCard: React.FC = () => { const { loading, giftCard } = useGiftCardDetails(); const { openSetBalanceDialog } = useGiftCardUpdateDialogs(); const { - change, - data: { tag }, + toggleValue, + data: { tags }, formErrors } = useGiftCardUpdateForm(); @@ -61,10 +61,10 @@ const GiftCardUpdateDetailsCard: React.FC = () => { diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/messages.ts b/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/messages.ts index 8e55b0e92..8ceebb069 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/messages.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateDetailsCard/messages.ts @@ -3,18 +3,18 @@ import { defineMessages } from "react-intl"; export const giftCardUpdateDetailsCardMessages = defineMessages({ title: { defaultMessage: "Details", - description: "GiftCardUpdateDetailsCard title" + description: "details title" }, setBalanceButtonLabel: { defaultMessage: "set balance", - description: "GiftCardUpdateDetailsCard set balance button label" + description: "set balance button label" }, cardBalanceLabel: { defaultMessage: "Card Balance", - description: "GiftCardUpdateDetailsCard card balance label" + description: "card balance label" }, tagInputLabel: { defaultMessage: "Card Tag", - description: "GiftCardTagInput tag label" + description: "tag label" } }); diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateExpirySelect/messages.ts b/src/giftCards/GiftCardUpdate/GiftCardUpdateExpirySelect/messages.ts index a6a6fd5d9..ff16a83ed 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateExpirySelect/messages.ts +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateExpirySelect/messages.ts @@ -3,14 +3,14 @@ import { defineMessages } from "react-intl"; export const giftCardExpirySelectMessages = defineMessages({ expiryDateCheckboxLabel: { defaultMessage: "Gift card expires", - description: "GiftCarUpdateDetailsExpirySection expiry date checkbox label" + description: "expiry date checkbox label" }, expiryDateLabel: { defaultMessage: "Expiration date", - description: "GiftCarUpdateDetailsExpirySection expiry date label" + description: "expiration date label" }, expiredOnLabel: { defaultMessage: "Expired on {date}", - description: "GiftCarUpdateDetailsExpirySection expired on label" + description: "expired on label" } }); diff --git a/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx b/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx index 4b89f459b..00cb18f94 100644 --- a/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx +++ b/src/giftCards/GiftCardUpdate/GiftCardUpdateInfoCard/GiftCardUpdateInfoCardContent.tsx @@ -4,7 +4,6 @@ import CardSpacer from "@saleor/components/CardSpacer"; import Link from "@saleor/components/Link"; import { customerUrl } from "@saleor/customers/urls"; import useDateLocalize from "@saleor/hooks/useDateLocalize"; -import useNavigator from "@saleor/hooks/useNavigator"; import { getFullName, getStringOrPlaceholder } from "@saleor/misc"; import Label from "@saleor/orders/components/OrderHistory/Label"; import { getOrderNumberLinkObject } from "@saleor/orders/components/OrderHistory/utils"; @@ -22,7 +21,6 @@ import { giftCardUpdateInfoCardMessages as messages } from "./messages"; const GiftCardUpdateInfoCardContent: React.FC = () => { const intl = useIntl(); const localizeDate = useDateLocalize(); - const navigate = useNavigator(); const { giftCard } = useGiftCardDetails(); @@ -122,7 +120,7 @@ const GiftCardUpdateInfoCardContent: React.FC = () => {
), value: option.type diff --git a/src/productTypes/components/ProductTypeDetails/messages.ts b/src/productTypes/components/ProductTypeDetails/messages.ts index 419370b23..bbfdfeb56 100644 --- a/src/productTypes/components/ProductTypeDetails/messages.ts +++ b/src/productTypes/components/ProductTypeDetails/messages.ts @@ -6,21 +6,15 @@ export const messages = defineMessages({ description: "label" }, optionNormalTitle: { - defaultMessage: "This is a normal product", + defaultMessage: "Regular product type", description: "option" }, - optionNormalDescription: { - defaultMessage: - "This product type can be used to create shipping passes for your customers", - description: "option description" - }, optionGiftCardTitle: { - defaultMessage: "Products of this type can be used as gift card/voucher", + defaultMessage: "Gift card product type", description: "option" }, optionGiftCardDescription: { - defaultMessage: - "This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process", + defaultMessage: "This product will act as a payment method", description: "option description" } }); diff --git a/src/products/components/ProductExportDialog/ProductExportDialogSettings.tsx b/src/products/components/ProductExportDialog/ExportDialogSettings.tsx similarity index 51% rename from src/products/components/ProductExportDialog/ProductExportDialogSettings.tsx rename to src/products/components/ProductExportDialog/ExportDialogSettings.tsx index 348d38460..d3a485274 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialogSettings.tsx +++ b/src/products/components/ProductExportDialog/ExportDialogSettings.tsx @@ -15,6 +15,8 @@ import getExportErrorMessage from "@saleor/utils/errors/export"; import React from "react"; import { useIntl } from "react-intl"; +import { ExportSettingsInput } from "./types"; + const useStyles = makeStyles( theme => ({ hr: { @@ -23,114 +25,112 @@ const useStyles = makeStyles( } }), { - name: "ProductExportDialogSettings" + name: "ExportDialogSettings" } ); -export type ProductQuantity = Record<"all" | "filter", number>; -export interface ProductExportDialogSettingsProps { - data: ExportProductsInput; - errors: ExportErrorFragment[]; - productQuantity: ProductQuantity; - selectedProducts: number; - onChange: (event: ChangeEvent) => void; +export type ExportItemsQuantity = Record<"all" | "filter", number>; + +export interface ExportScopeLabels { + allItems: string; + selectedItems: string; } -const formFields: Array = ["fileType", "scope"]; +export interface ExportDialogSettingsProps { + data: ExportSettingsInput; + errors: ExportErrorFragment[]; + itemsQuantity: ExportItemsQuantity; + selectedItems: number; + exportScopeLabels: ExportScopeLabels; + onChange: (event: ChangeEvent) => void; + allowScopeSelection?: boolean; +} -const ProductExportDialogSettings: React.FC = ({ +const formFields: Array = ["fileType", "scope"]; + +const ExportDialogSettings: React.FC = ({ data, errors, onChange, - productQuantity, - selectedProducts + selectedItems, + itemsQuantity, + exportScopeLabels, + allowScopeSelection = true }) => { const classes = useStyles({}); const intl = useIntl(); const formErrors = getFormErrors(formFields, errors); - const productsToExportChoices: Array> = [ - { - label: intl.formatMessage( - { - defaultMessage: "All products ({number})", - description: "export all products to csv file" - }, - { - number: productQuantity.all || "..." - } - ), - value: ExportScope.ALL - }, - { - disabled: selectedProducts === 0, - label: intl.formatMessage( - { - defaultMessage: "Selected products ({number})", - description: "export selected products to csv file" - }, - { - number: selectedProducts - } - ), - value: ExportScope.IDS - }, - { - label: intl.formatMessage( - { - defaultMessage: "Current search ({number})", - description: "export filtered products to csv file" - }, - { - number: productQuantity.filter || "..." - } - ), - value: ExportScope.FILTER - } - ]; - const productExportTypeChoices: Array> = [ { label: intl.formatMessage({ defaultMessage: "Spreadsheet for Excel, Numbers etc.", - description: "export products as spreadsheet" + description: "export items as spreadsheet" }), value: FileTypesEnum.XLSX }, { label: intl.formatMessage({ defaultMessage: "Plain CSV file", - description: "export products as csv file" + description: "export items as csv file" }), value: FileTypesEnum.CSV } ]; + const exportScopeChoices = [ + { + label: exportScopeLabels.allItems, + value: ExportScope.ALL + }, + { + disabled: selectedItems === 0, + label: exportScopeLabels.selectedItems, + value: ExportScope.IDS + }, + { + label: intl.formatMessage( + { + defaultMessage: "Current search ({number})", + description: "export filtered items to csv file" + }, + { + number: itemsQuantity.filter || "..." + } + ), + value: ExportScope.FILTER + } + ]; + return ( <> - -
+ {allowScopeSelection && ( + <> + +
+ + )} = ); }; -ProductExportDialogSettings.displayName = "ProductExportDialogSettings"; -export default ProductExportDialogSettings; +export default ExportDialogSettings; diff --git a/src/products/components/ProductExportDialog/ProductExportDialog.tsx b/src/products/components/ProductExportDialog/ProductExportDialog.tsx index 978c67ae9..dbd72b53d 100644 --- a/src/products/components/ProductExportDialog/ProductExportDialog.tsx +++ b/src/products/components/ProductExportDialog/ProductExportDialog.tsx @@ -20,11 +20,7 @@ import useWizard from "@saleor/hooks/useWizard"; import { buttonMessages } from "@saleor/intl"; import { SearchAttributes_search_edges_node } from "@saleor/searches/types/SearchAttributes"; import { DialogProps, FetchMoreProps } from "@saleor/types"; -import { - ExportProductsInput, - ExportScope, - FileTypesEnum -} from "@saleor/types/globalTypes"; +import { ExportProductsInput } from "@saleor/types/globalTypes"; import getExportErrorMessage from "@saleor/utils/errors/export"; import { toggle } from "@saleor/utils/lists"; import { mapNodeToChoice } from "@saleor/utils/maps"; @@ -32,13 +28,15 @@ import { WarehouseList_warehouses_edges_node } from "@saleor/warehouses/types/Wa import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; +import ExportDialogSettings, { + ExportItemsQuantity +} from "./ExportDialogSettings"; +import { productExportDialogMessages as messages } from "./messages"; import ProductExportDialogInfo, { attributeNamePrefix, warehouseNamePrefix } from "./ProductExportDialogInfo"; -import ProductExportDialogSettings, { - ProductQuantity -} from "./ProductExportDialogSettings"; +import { exportSettingsInitialFormData } from "./types"; export enum ProductExportStep { INFO, @@ -73,8 +71,7 @@ const initialForm: ExportProductsInput = { fields: [], warehouses: [] }, - fileType: FileTypesEnum.CSV, - scope: ExportScope.ALL + ...exportSettingsInitialFormData }; const ProductExportSteps = makeCreatorSteps(); @@ -84,7 +81,7 @@ export interface ProductExportDialogProps extends DialogProps, FetchMoreProps { channels: ChannelFragment[]; confirmButtonState: ConfirmButtonTransitionState; errors: ExportErrorFragment[]; - productQuantity: ProductQuantity; + productQuantity: ExportItemsQuantity; selectedProducts: number; warehouses: WarehouseList_warehouses_edges_node[]; onFetch: (query: string) => void; @@ -216,14 +213,32 @@ const ProductExportDialog: React.FC = ({ } }); + const exportScopeLabels = { + allItems: intl.formatMessage( + { + defaultMessage: "All products ({number})", + description: "export all items to csv file" + }, + { + number: productQuantity.all || "..." + } + ), + selectedItems: intl.formatMessage( + { + defaultMessage: "Selected products ({number})", + description: "export selected items to csv file" + }, + { + number: selectedProducts + } + ) + }; + return ( <> - + = ({ /> )} {step === ProductExportStep.SETTINGS && ( - )} @@ -298,10 +314,7 @@ const ProductExportDialog: React.FC = ({ data-test="submit" onClick={submit} > - + )} diff --git a/src/products/components/ProductExportDialog/messages.ts b/src/products/components/ProductExportDialog/messages.ts index de6ffc168..518b6df84 100644 --- a/src/products/components/ProductExportDialog/messages.ts +++ b/src/products/components/ProductExportDialog/messages.ts @@ -1,5 +1,20 @@ import { ProductFieldEnum } from "@saleor/types/globalTypes"; -import { useIntl } from "react-intl"; +import { defineMessages, useIntl } from "react-intl"; + +export const productExportDialogMessages = defineMessages({ + title: { + defaultMessage: "Export Information", + description: "export products to csv file, dialog header" + }, + confirmButtonLabel: { + defaultMessage: "export products", + description: "export products to csv file, button" + }, + productsLabel: { + defaultMessage: "products", + description: "products export type label" + } +}); function useProductExportFieldMessages() { const intl = useIntl(); diff --git a/src/products/components/ProductExportDialog/types.ts b/src/products/components/ProductExportDialog/types.ts new file mode 100644 index 000000000..2f465fbbd --- /dev/null +++ b/src/products/components/ProductExportDialog/types.ts @@ -0,0 +1,21 @@ +import { ExportScope, FileTypesEnum } from "@saleor/types/globalTypes"; + +export interface ExportSettingsInput { + scope: ExportScope; + fileType: FileTypesEnum; +} + +export interface ExportSettingsFormData { + fileType: FileTypesEnum; + scope: ExportScope; +} + +export const exportSettingsInitialFormData = { + fileType: FileTypesEnum.CSV, + scope: ExportScope.ALL +}; + +export const exportSettingsInitialFormDataWithIds = { + fileType: FileTypesEnum.CSV, + scope: ExportScope.IDS +}; diff --git a/src/products/components/ProductListPage/filters.ts b/src/products/components/ProductListPage/filters.ts index 03c5f4df7..9c6a39c2a 100644 --- a/src/products/components/ProductListPage/filters.ts +++ b/src/products/components/ProductListPage/filters.ts @@ -23,7 +23,8 @@ export enum ProductFilterKeys { price = "price", productType = "productType", stock = "stock", - channel = "channel" + channel = "channel", + productKind = "productKind" } export type AttributeFilterOpts = FilterOpts & { @@ -42,6 +43,7 @@ export interface ProductListFilterOpts { productType: FilterOpts & AutocompleteFilterOpts; stockStatus: FilterOpts; channel: FilterOpts & { choices: SingleAutocompleteChoiceType[] }; + productKind: FilterOpts & { choices: SingleAutocompleteChoiceType[] }; } const messages = defineMessages({ @@ -53,6 +55,10 @@ const messages = defineMessages({ defaultMessage: "Channel", description: "sales channel" }, + kind: { + defaultMessage: "Product Kind", + description: "product kind" + }, hidden: { defaultMessage: "Hidden", description: "product is hidden" @@ -118,6 +124,16 @@ export function createFilterStructure( ), active: opts.channel.active }, + { + ...createOptionsField( + ProductFilterKeys.productKind, + intl.formatMessage(messages.kind), + [opts.productKind.value], + false, + opts.productKind.choices + ), + active: opts.productKind.active + }, { ...createOptionsField( ProductFilterKeys.stock, diff --git a/src/products/components/ProductStocks/ProductStocks.tsx b/src/products/components/ProductStocks/ProductStocks.tsx index 367c2a87b..04afc7b3e 100644 --- a/src/products/components/ProductStocks/ProductStocks.tsx +++ b/src/products/components/ProductStocks/ProductStocks.tsx @@ -527,7 +527,6 @@ const ProductStocks: React.FC = ({ defaultMessage: "Global threshold" })} name="globalThreshold" - required onChange={onThresholdChange} value={data.globalThreshold ?? ""} className={classes.thresholdInput} diff --git a/src/products/index.tsx b/src/products/index.tsx index d9745575f..8a5f06ae4 100644 --- a/src/products/index.tsx +++ b/src/products/index.tsx @@ -39,7 +39,8 @@ const ProductList: React.FC> = ({ location }) => { categories: getArrayQueryParam(qs.categories), collections: getArrayQueryParam(qs.collections), ids: getArrayQueryParam(qs.ids), - productTypes: getArrayQueryParam(qs.productTypes) + productTypes: getArrayQueryParam(qs.productTypes), + productKind: qs.productKind }, ProductListUrlSortField ); diff --git a/src/products/urls.ts b/src/products/urls.ts index 518bced03..003cfb9d3 100644 --- a/src/products/urls.ts +++ b/src/products/urls.ts @@ -29,7 +29,8 @@ export enum ProductListUrlFiltersEnum { status = "status", stockStatus = "stockStatus", query = "query", - channel = "channel" + channel = "channel", + productKind = "productKind" } export enum ProductListUrlFiltersWithMultipleValues { categories = "categories", diff --git a/src/products/views/ProductList/ProductList.tsx b/src/products/views/ProductList/ProductList.tsx index 459cfd27f..0c621fa60 100644 --- a/src/products/views/ProductList/ProductList.tsx +++ b/src/products/views/ProductList/ProductList.tsx @@ -79,6 +79,7 @@ import { saveFilterTab } from "./filters"; import { canBeSorted, DEFAULT_SORT_KEY, getSortQueryVariables } from "./sort"; +import { getAvailableProductKinds, getProductKindOpts } from "./utils"; interface ProductListProps { params: ProductListUrlQueryParams; @@ -165,6 +166,7 @@ export const ProductList: React.FC = ({ params }) => { }, skip: params.action !== "export" }); + const availableProductKinds = getAvailableProductKinds(); const { availableChannels } = useAppChannel(false); const limitOpts = useShopLimitsQuery({ variables: { @@ -280,6 +282,7 @@ export const ProductList: React.FC = ({ params }) => { }) ); + const kindOpts = getProductKindOpts(availableProductKinds, intl); const paginationState = createPaginationState(settings.rowNumber, params); const channelOpts = availableChannels ? mapNodeToChoice(availableChannels, channel => channel.slug) @@ -347,6 +350,7 @@ export const ProductList: React.FC = ({ params }) => { initial: mapEdgesToItems(initialFilterProductTypes?.productTypes) || [], search: searchProductTypes }, + kindOpts, channelOpts ); diff --git a/src/products/views/ProductList/__snapshots__/filters.test.ts.snap b/src/products/views/ProductList/__snapshots__/filters.test.ts.snap index 941a8c9ab..be20d6c9e 100644 --- a/src/products/views/ProductList/__snapshots__/filters.test.ts.snap +++ b/src/products/views/ProductList/__snapshots__/filters.test.ts.snap @@ -61,6 +61,7 @@ Object { ], "priceFrom": "10", "priceTo": "20", + "productKind": "NORMAL", "productTypes": Array [ "UHJvZHVjdFR5cGU6MQ==", ], @@ -68,4 +69,4 @@ Object { } `; -exports[`Filtering URL params should not be empty if active filters are present 2`] = `"channel=default-channel&stockStatus=IN_STOCK&priceFrom=10&priceTo=20&categories%5B%5D=878752&collections%5B%5D=Q29sbGVjdGlvbjoc&productTypes%5B%5D=UHJvZHVjdFR5cGU6MQ%3D%3D&attributes%5Bauthor%5D%5B%5D=john-doe&attributes%5Bauthor%5D%5B%5D=false&attributes%5Bbox-size%5D%5B%5D=100g&attributes%5Bbox-size%5D%5B%5D=500g&attributes%5Bbrand%5D%5B%5D=saleor&attributes%5Bbrand%5D%5B%5D=false&attributes%5Bcandy-box-size%5D%5B%5D=100g&attributes%5Bcandy-box-size%5D%5B%5D=500g&attributes%5Bcoffee-genre%5D%5B%5D=arabica&attributes%5Bcoffee-genre%5D%5B%5D=false&attributes%5Bcollar%5D%5B%5D=round&attributes%5Bcollar%5D%5B%5D=polo&attributes%5Bcolor%5D%5B%5D=blue&attributes%5Bcolor%5D%5B%5D=false&attributes%5Bcover%5D%5B%5D=soft&attributes%5Bcover%5D%5B%5D=middle-soft&attributes%5Bflavor%5D%5B%5D=sour&attributes%5Bflavor%5D%5B%5D=false&attributes%5Blanguage%5D%5B%5D=english&attributes%5Blanguage%5D%5B%5D=false&attributes%5Bpublisher%5D%5B%5D=mirumee-press&attributes%5Bpublisher%5D%5B%5D=false&attributes%5Bsize%5D%5B%5D=xs&attributes%5Bsize%5D%5B%5D=m"`; +exports[`Filtering URL params should not be empty if active filters are present 2`] = `"channel=default-channel&productKind=NORMAL&stockStatus=IN_STOCK&priceFrom=10&priceTo=20&categories%5B%5D=878752&collections%5B%5D=Q29sbGVjdGlvbjoc&productTypes%5B%5D=UHJvZHVjdFR5cGU6MQ%3D%3D&attributes%5Bauthor%5D%5B%5D=john-doe&attributes%5Bauthor%5D%5B%5D=false&attributes%5Bbox-size%5D%5B%5D=100g&attributes%5Bbox-size%5D%5B%5D=500g&attributes%5Bbrand%5D%5B%5D=saleor&attributes%5Bbrand%5D%5B%5D=false&attributes%5Bcandy-box-size%5D%5B%5D=100g&attributes%5Bcandy-box-size%5D%5B%5D=500g&attributes%5Bcoffee-genre%5D%5B%5D=arabica&attributes%5Bcoffee-genre%5D%5B%5D=false&attributes%5Bcollar%5D%5B%5D=round&attributes%5Bcollar%5D%5B%5D=polo&attributes%5Bcolor%5D%5B%5D=blue&attributes%5Bcolor%5D%5B%5D=false&attributes%5Bcover%5D%5B%5D=soft&attributes%5Bcover%5D%5B%5D=middle-soft&attributes%5Bflavor%5D%5B%5D=sour&attributes%5Bflavor%5D%5B%5D=false&attributes%5Blanguage%5D%5B%5D=english&attributes%5Blanguage%5D%5B%5D=false&attributes%5Bpublisher%5D%5B%5D=mirumee-press&attributes%5Bpublisher%5D%5B%5D=false&attributes%5Bsize%5D%5B%5D=xs&attributes%5Bsize%5D%5B%5D=m"`; diff --git a/src/products/views/ProductList/filters.ts b/src/products/views/ProductList/filters.ts index 03c50c092..f83a2454e 100644 --- a/src/products/views/ProductList/filters.ts +++ b/src/products/views/ProductList/filters.ts @@ -56,6 +56,7 @@ import { ProductListUrlFiltersWithMultipleValues, ProductListUrlQueryParams } from "../../urls"; +import { getProductGiftCardFilterParam } from "./utils"; export const PRODUCT_FILTERS_KEY = "productFilters"; export function getFilterOpts( @@ -77,6 +78,7 @@ export function getFilterOpts( initial: InitialProductFilterProductTypes_productTypes_edges_node[]; search: UseSearchResult; }, + productKind: SingleAutocompleteChoiceType[], channels: SingleAutocompleteChoiceType[] ): ProductListFilterOpts { return { @@ -162,6 +164,11 @@ export function getFilterOpts( onSearchChange: collections.search.search, value: dedupeFilter(params.collections || []) }, + productKind: { + active: params?.productKind !== undefined, + choices: productKind, + value: params?.productKind + }, price: { active: maybe( () => @@ -313,6 +320,7 @@ export function getFilterVariables( productTypes: params.productTypes !== undefined ? params.productTypes : null, search: params.query, + giftCard: getProductGiftCardFilterParam(params.productKind), stockAvailability: params.stockStatus !== undefined ? findValueInEnum(params.stockStatus, StockAvailability) @@ -377,6 +385,12 @@ export function getFilterQueryParam( filter, ProductListUrlFiltersEnum.channel ); + + case ProductFilterKeys.productKind: + return getSingleValueQueryParam( + filter, + ProductListUrlFiltersEnum.productKind + ); } } diff --git a/src/products/views/ProductList/fixtures.ts b/src/products/views/ProductList/fixtures.ts index 4ed9fc7d9..c2fb7cb45 100644 --- a/src/products/views/ProductList/fixtures.ts +++ b/src/products/views/ProductList/fixtures.ts @@ -53,6 +53,16 @@ export const productListFilterOpts: ProductListFilterOpts = { } ] }, + productKind: { + active: false, + value: "NORMAL", + choices: [ + { + value: "NORMAL", + label: "Normal" + } + ] + }, collections: { ...fetchMoreProps, ...searchPageProps, diff --git a/src/products/views/ProductList/messages.ts b/src/products/views/ProductList/messages.ts new file mode 100644 index 000000000..d9cdbb0a9 --- /dev/null +++ b/src/products/views/ProductList/messages.ts @@ -0,0 +1,12 @@ +import { defineMessages } from "react-intl"; + +export const productKindMessages = defineMessages({ + giftCardLabel: { + defaultMessage: "Gift Card", + description: "label" + }, + normalLabel: { + defaultMessage: "Normal", + description: "label" + } +}); diff --git a/src/products/views/ProductList/utils.ts b/src/products/views/ProductList/utils.ts new file mode 100644 index 000000000..4b11e4ee9 --- /dev/null +++ b/src/products/views/ProductList/utils.ts @@ -0,0 +1,46 @@ +import { isInEnum } from "@saleor/misc"; +import { ProductTypeKindEnum } from "@saleor/types/globalTypes"; +import { IntlShape } from "react-intl"; + +import { productKindMessages as messages } from "./messages"; + +interface ProductKindChoice { + label: string; + value: ProductTypeKindEnum; +} + +export const getAvailableProductKinds = (): ProductKindChoice[] => + Object.keys(ProductTypeKindEnum).map(kind => ({ + label: kind, + value: kind as ProductTypeKindEnum + })); + +export const getProductKindOpts = ( + availableProducts: ProductKindChoice[], + intl: IntlShape +): ProductKindChoice[] => + availableProducts.map(kind => { + switch (kind.value) { + case ProductTypeKindEnum.GIFT_CARD: + return { + ...kind, + label: intl.formatMessage(messages.giftCardLabel) + }; + case ProductTypeKindEnum.NORMAL: + return { + ...kind, + label: intl.formatMessage(messages.normalLabel) + }; + } + }); + +export const getProductGiftCardFilterParam = (productKind?: string) => { + if ( + productKind === undefined || + !isInEnum(productKind, ProductTypeKindEnum) + ) { + return null; + } + + return productKind === ProductTypeKindEnum.GIFT_CARD; +}; diff --git a/src/products/views/ProductUpdate/handlers/utils.ts b/src/products/views/ProductUpdate/handlers/utils.ts index 1096a1841..fa92b28a8 100644 --- a/src/products/views/ProductUpdate/handlers/utils.ts +++ b/src/products/views/ProductUpdate/handlers/utils.ts @@ -37,12 +37,14 @@ export const getSimpleProductVariables = ( productVariantInput: { sku: data.sku, trackInventory: data.trackInventory, - preorder: { - globalThreshold: data.globalThreshold - ? parseInt(data.globalThreshold, 10) - : null, - endDate: data.preorderEndDateTime - } + preorder: data.isPreorder + ? { + globalThreshold: data.globalThreshold + ? parseInt(data.globalThreshold, 10) + : null, + endDate: data.preorderEndDateTime + } + : undefined }, updateStocks: data.updateStocks.map(mapFormsetStockToStockInput) }); diff --git a/src/products/views/ProductVariantCreate.tsx b/src/products/views/ProductVariantCreate.tsx index 5e010bcd0..3a1b7ebbf 100644 --- a/src/products/views/ProductVariantCreate.tsx +++ b/src/products/views/ProductVariantCreate.tsx @@ -128,7 +128,7 @@ export const ProductVariant: React.FC = ({ : null, endDate: formData.preorderEndDateTime || null } - : null + : undefined }, firstValues: 10 } diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index 55227b57c..ee43ffa78 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -2499,13 +2499,13 @@ exports[`Storyshots Channels / Channels with variants availability card default
2 variants
Visible since 07/30/2020
@@ -2866,13 +2866,13 @@ exports[`Storyshots Channels / Channels with variants availability card default
2 variants
Visible since 07/30/2020
@@ -13053,6 +13053,89 @@ exports[`Storyshots Generics / Select with autocomplete default 1`] = ` `; +exports[`Storyshots Generics / Select with autocomplete disabled 1`] = ` +
+
+
+
+
+
+ + +

+ Value: AF +

+
+
+
+
+
+
+`; + exports[`Storyshots Generics / Select with autocomplete interactive 1`] = `
`; +exports[`Storyshots Generics / Select with autocomplete naked and disabled 1`] = ` +
+
+
+
+
+ +
+
+
+
+
+`; + exports[`Storyshots Generics / Select with autocomplete no data 1`] = `
`; +exports[`Storyshots Generics / SingleSelectField with many values 1`] = ` +
+
+
+
+
+
+
+
+`; + exports[`Storyshots Generics / SingleSelectField with no value 1`] = `
Products refunded
@@ -17926,7 +18135,7 @@ exports[`Storyshots Orders / OrderHistory default 1`] = ` >
Cow's milk
@@ -17936,7 +18145,7 @@ exports[`Storyshots Orders / OrderHistory default 1`] = ` >
qty: 4
@@ -17953,7 +18162,7 @@ exports[`Storyshots Orders / OrderHistory default 1`] = ` >
Goat's milk
@@ -17963,7 +18172,7 @@ exports[`Storyshots Orders / OrderHistory default 1`] = ` >
qty: 4
@@ -17978,7 +18187,7 @@ exports[`Storyshots Orders / OrderHistory default 1`] = `
Transaction reference
@@ -49185,7 +49394,7 @@ exports[`Storyshots Views / Channels / Channels list default 1`] = ` class="MuiTableRow-root-id MuiTableRow-head-id" >
+
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -67503,6 +67763,57 @@ exports[`Storyshots Views / Customers / Customer details different addresses 1`]
+
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -68210,6 +68521,57 @@ exports[`Storyshots Views / Customers / Customer details form errors 1`] = `
+
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -68826,6 +69188,57 @@ exports[`Storyshots Views / Customers / Customer details loading 1`] = ` +
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -69512,6 +69925,57 @@ exports[`Storyshots Views / Customers / Customer details never logged 1`] = ` +
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -70198,6 +70662,57 @@ exports[`Storyshots Views / Customers / Customer details never placed order 1`] +
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -70862,6 +71377,57 @@ exports[`Storyshots Views / Customers / Customer details no address at all 1`] = +
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -71554,6 +72120,57 @@ exports[`Storyshots Views / Customers / Customer details no default billing addr +
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -72246,6 +72863,57 @@ exports[`Storyshots Views / Customers / Customer details no default shipping add +
+
+
+ + Gift Cards + +
+
+
+ There are no gift cards assigned to this customer +
+
+
+ + ‌ + +
+ +
+
@@ -104179,7 +104847,7 @@ exports[`Storyshots Views / Orders / Draft order list default 1`] = `
9
-
+
- Cancelled +
+ Cancelled +
@@ -111733,7 +112405,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = ` >
Products refunded
@@ -111750,7 +112422,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = ` >
Cow's milk
@@ -111760,7 +112432,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = ` >
qty: 4
@@ -111777,7 +112449,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = ` >
Goat's milk
@@ -111787,7 +112459,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = ` >
qty: 4
@@ -111802,7 +112474,7 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = `
Transaction reference
@@ -112124,19 +112796,23 @@ exports[`Storyshots Views / Orders / Order details default 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -113847,7 +114523,7 @@ exports[`Storyshots Views / Orders / Order details default 1`] = ` >
Products refunded
@@ -113864,7 +114540,7 @@ exports[`Storyshots Views / Orders / Order details default 1`] = ` >
Cow's milk
@@ -113874,7 +114550,7 @@ exports[`Storyshots Views / Orders / Order details default 1`] = ` >
qty: 4
@@ -113891,7 +114567,7 @@ exports[`Storyshots Views / Orders / Order details default 1`] = ` >
Goat's milk
@@ -113901,7 +114577,7 @@ exports[`Storyshots Views / Orders / Order details default 1`] = ` >
qty: 4
@@ -113916,7 +114592,7 @@ exports[`Storyshots Views / Orders / Order details default 1`] = `
Transaction reference
@@ -114270,19 +114946,23 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Fulfilled +
+ Fulfilled +
@@ -115993,7 +116673,7 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = ` >
Products refunded
@@ -116010,7 +116690,7 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = ` >
Cow's milk
@@ -116020,7 +116700,7 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = ` >
qty: 4
@@ -116037,7 +116717,7 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = ` >
Goat's milk
@@ -116047,7 +116727,7 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = ` >
qty: 4
@@ -116062,7 +116742,7 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = `
Transaction reference
@@ -116414,7 +117094,19 @@ exports[`Storyshots Views / Orders / Order details loading 1`] = ` >
+ > +
+
+
+
+
+
@@ -117012,19 +117704,23 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -118735,7 +119431,7 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = ` >
Products refunded
@@ -118752,7 +119448,7 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = ` >
Cow's milk
@@ -118762,7 +119458,7 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = ` >
qty: 4
@@ -118779,7 +119475,7 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = ` >
Goat's milk
@@ -118789,7 +119485,7 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = ` >
qty: 4
@@ -118804,7 +119500,7 @@ exports[`Storyshots Views / Orders / Order details no customer note 1`] = `
Transaction reference
@@ -119158,19 +119854,23 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -120879,7 +121579,7 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = ` >
Products refunded
@@ -120896,7 +121596,7 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = ` >
Cow's milk
@@ -120906,7 +121606,7 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = ` >
qty: 4
@@ -120923,7 +121623,7 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = ` >
Goat's milk
@@ -120933,7 +121633,7 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = ` >
qty: 4
@@ -120948,7 +121648,7 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = `
Transaction reference
@@ -121302,19 +122002,23 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -123025,7 +123729,7 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = ` >
Products refunded
@@ -123042,7 +123746,7 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = ` >
Cow's milk
@@ -123052,7 +123756,7 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = ` >
qty: 4
@@ -123069,7 +123773,7 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = ` >
Goat's milk
@@ -123079,7 +123783,7 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = ` >
qty: 4
@@ -123094,7 +123798,7 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = `
Transaction reference
@@ -123440,19 +124144,23 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -125163,7 +125871,7 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = ` >
Products refunded
@@ -125180,7 +125888,7 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = ` >
Cow's milk
@@ -125190,7 +125898,7 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = ` >
qty: 4
@@ -125207,7 +125915,7 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = ` >
Goat's milk
@@ -125217,7 +125925,7 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = ` >
qty: 4
@@ -125232,7 +125940,7 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = `
Transaction reference
@@ -125586,19 +126294,23 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -127309,7 +128021,7 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = ` >
Products refunded
@@ -127326,7 +128038,7 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = ` >
Cow's milk
@@ -127336,7 +128048,7 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = ` >
qty: 4
@@ -127353,7 +128065,7 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = ` >
Goat's milk
@@ -127363,7 +128075,7 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = ` >
qty: 4
@@ -127378,7 +128090,7 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = `
Transaction reference
@@ -127732,19 +128444,23 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -129455,7 +130171,7 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = ` >
Products refunded
@@ -129472,7 +130188,7 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = ` >
Cow's milk
@@ -129482,7 +130198,7 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = ` >
qty: 4
@@ -129499,7 +130215,7 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = ` >
Goat's milk
@@ -129509,7 +130225,7 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = ` >
qty: 4
@@ -129524,7 +130240,7 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = `
Transaction reference
@@ -129878,19 +130594,23 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -131601,7 +132321,7 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = ` >
Products refunded
@@ -131618,7 +132338,7 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = ` >
Cow's milk
@@ -131628,7 +132348,7 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = ` >
qty: 4
@@ -131645,7 +132365,7 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = ` >
Goat's milk
@@ -131655,7 +132375,7 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = ` >
qty: 4
@@ -131670,7 +132390,7 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = `
Transaction reference
@@ -132024,19 +132744,23 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -133747,7 +134471,7 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = ` >
Products refunded
@@ -133764,7 +134488,7 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = ` >
Cow's milk
@@ -133774,7 +134498,7 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = ` >
qty: 4
@@ -133791,7 +134515,7 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = ` >
Goat's milk
@@ -133801,7 +134525,7 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = ` >
qty: 4
@@ -133816,7 +134540,7 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = `
Transaction reference
@@ -134170,19 +134894,23 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Partially fulfilled +
+ Partially fulfilled +
@@ -135893,7 +136621,7 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = ` >
Products refunded
@@ -135910,7 +136638,7 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = ` >
Cow's milk
@@ -135920,7 +136648,7 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = ` >
qty: 4
@@ -135937,7 +136665,7 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = ` >
Goat's milk
@@ -135947,7 +136675,7 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = ` >
qty: 4
@@ -135962,7 +136690,7 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = `
Transaction reference
@@ -136316,19 +137044,23 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = ` class="MuiTypography-root-id PageHeader-title-id MuiTypography-h5-id" >
9
-
+
- Unfulfilled +
+ Unfulfilled +
@@ -138039,7 +138771,7 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = ` >
Products refunded
@@ -138056,7 +138788,7 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = ` >
Cow's milk
@@ -138066,7 +138798,7 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = ` >
qty: 4
@@ -138083,7 +138815,7 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = ` >
Goat's milk
@@ -138093,7 +138825,7 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = ` >
qty: 4
@@ -138108,7 +138840,7 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = `
Transaction reference
@@ -140976,7 +141708,7 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
-
+
- channel 1 +
+ channel 1 +
+
@@ -164630,19 +165367,24 @@ exports[`Storyshots Views / Plugins / Plugin details form errors 1`] = `
-
+
- channel 1 +
+ channel 1 +
+
@@ -164955,19 +165697,24 @@ exports[`Storyshots Views / Plugins / Plugin details not configurable 1`] = `
-
+
- channel 1 +
+ channel 1 +
+
@@ -165245,7 +165992,7 @@ exports[`Storyshots Views / Plugins / Plugin list default 1`] = `
@@ -165260,7 +166007,7 @@ exports[`Storyshots Views / Plugins / Plugin list default 1`] = `
@@ -165699,7 +166446,7 @@ exports[`Storyshots Views / Plugins / Plugin list loading 1`] = `
@@ -166030,7 +166777,7 @@ exports[`Storyshots Views / Plugins / Plugin list no data 1`] = `
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -166384,12 +167126,12 @@ exports[`Storyshots Views / Product types / Create product type default 1`] = `
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -166835,12 +167577,7 @@ exports[`Storyshots Views / Product types / Create product type form errors 1`]
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -166897,12 +167634,12 @@ exports[`Storyshots Views / Product types / Create product type form errors 1`]
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -167352,12 +168089,7 @@ exports[`Storyshots Views / Product types / Create product type loading 1`] = `
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -167416,12 +168148,12 @@ exports[`Storyshots Views / Product types / Create product type loading 1`] = `
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -167865,12 +168597,7 @@ exports[`Storyshots Views / Product types / Product type details default 1`] = `
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -167927,12 +168654,12 @@ exports[`Storyshots Views / Product types / Product type details default 1`] = `
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -169018,12 +169745,7 @@ exports[`Storyshots Views / Product types / Product type details form errors 1`]
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -169080,12 +169802,12 @@ exports[`Storyshots Views / Product types / Product type details form errors 1`]
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -170175,12 +170897,7 @@ exports[`Storyshots Views / Product types / Product type details loading 1`] = `
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -170239,12 +170956,12 @@ exports[`Storyshots Views / Product types / Product type details loading 1`] = `
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -170870,12 +171587,7 @@ exports[`Storyshots Views / Product types / Product type details no attributes 1
- This is a normal product -
-
- This product type can be used to create shipping passes for your customers + Regular product type
@@ -170932,12 +171644,12 @@ exports[`Storyshots Views / Product types / Product type details no attributes 1
- Products of this type can be used as gift card/voucher + Gift card product type
- This product type can be used to create voucher/gift card type products that user will be able to pay with during checkout process + This product will act as a payment method
@@ -195498,16 +196210,10 @@ exports[`Storyshots Views / Products / Product edit no stock and no variants 1`] class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -195529,13 +196234,13 @@ exports[`Storyshots Views / Products / Product edit no stock and no variants 1`] class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

@@ -197079,16 +197784,10 @@ exports[`Storyshots Views / Products / Product edit no stock, no variants and no class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -197110,13 +197808,13 @@ exports[`Storyshots Views / Products / Product edit no stock, no variants and no class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

@@ -198660,16 +199358,10 @@ exports[`Storyshots Views / Products / Product edit no variants 1`] = ` class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -198691,13 +199382,13 @@ exports[`Storyshots Views / Products / Product edit no variants 1`] = ` class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

@@ -204636,16 +205327,10 @@ exports[`Storyshots Views / Products / Product edit when product has no variants class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -204667,13 +205351,13 @@ exports[`Storyshots Views / Products / Product edit when product has no variants class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

@@ -222452,16 +223136,10 @@ exports[`Storyshots Views / Products / Product variant details attribute errors class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -222483,13 +223160,13 @@ exports[`Storyshots Views / Products / Product variant details attribute errors class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

@@ -224395,16 +225072,10 @@ exports[`Storyshots Views / Products / Product variant details no warehouses 1`] class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -224426,13 +225096,13 @@ exports[`Storyshots Views / Products / Product variant details no warehouses 1`] class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

@@ -226338,16 +227008,10 @@ exports[`Storyshots Views / Products / Product variant details when loaded data class="MuiFormControl-root-id MuiTextField-root-id ProductStocks-thresholdInput-id MuiFormControl-fullWidth-id" >
@@ -226369,13 +227032,13 @@ exports[`Storyshots Views / Products / Product variant details when loaded data class="PrivateNotchedOutline-legendLabelled-id PrivateNotchedOutline-legendNotched-id" > - Global threshold * + Global threshold

Threshold that cannot be exceeded even if per channel thresholds are still available

diff --git a/src/storybook/stories/components/SingleSelectField.tsx b/src/storybook/stories/components/SingleSelectField.tsx index 78ce636e9..d70a93f46 100644 --- a/src/storybook/stories/components/SingleSelectField.tsx +++ b/src/storybook/stories/components/SingleSelectField.tsx @@ -12,6 +12,25 @@ const choices = [ { label: "Accessories", value: "4" } ]; +const manyChoices = [ + { label: "Apparel", value: "1" }, + { label: "Groceries", value: "2" }, + { label: "Books", value: "3" }, + { label: "Accessories", value: "4" }, + { label: "Audiobooks", value: "5" }, + { label: "Bananas", value: "6" }, + { label: "Apples", value: "7" }, + { label: "Fridge", value: "8" }, + { label: "PCs", value: "9" }, + { label: "Music", value: "10" }, + { label: "Clothes", value: "11" }, + { label: "Smartphones", value: "12" }, + { label: "Keyboards", value: "13" }, + { label: "LEDs", value: "14" }, + { label: "Cars", value: "15" }, + { label: "Petrol", value: "16" } +]; + storiesOf("Generics / SingleSelectField", module) .addDecorator(CardDecorator) .addDecorator(Decorator) @@ -25,6 +44,13 @@ storiesOf("Generics / SingleSelectField", module) value={choices[0].value} /> )) + .add("with many values", () => ( + + )) .add("with label", () => ( > = [(action: TAction, newParams?: TParams) => void, () => void]; -export interface DialogActionHandlersProps { - closeDialog: () => void; - open: boolean; -} - function createDialogActionHandlers< TAction extends string, TParams extends Dialog & BulkAction & SingleAction diff --git a/src/utils/maps.ts b/src/utils/maps.ts index 495046ba3..7f11b0c3c 100644 --- a/src/utils/maps.ts +++ b/src/utils/maps.ts @@ -1,3 +1,4 @@ +import { MultiAutocompleteChoiceType } from "@saleor/components/MultiAutocompleteSelectField"; import { ShopInfo_shop_countries } from "@saleor/components/Shop/types/ShopInfo"; import { ChoiceValue, @@ -79,6 +80,21 @@ export function mapMetadataItemToInput(item: MetadataItem): MetadataInput { }; } +export function mapMultiValueNodeToChoice>( + nodes: T[] | string[], + key?: keyof T +): MultiAutocompleteChoiceType[] { + if (!nodes) { + return []; + } + + if ((nodes as string[]).every(node => typeof node === "string")) { + return (nodes as string[]).map(node => ({ label: node, value: node })); + } + + return (nodes as T[]).map(node => ({ label: node[key], value: node[key] })); +} + export function mapSingleValueNodeToChoice>( nodes: T[] | string[], key?: keyof T