From 41aab25c8649ac38ea8495c15df00d71ea52b809 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Mon, 12 Jun 2023 21:09:47 +0200 Subject: [PATCH 01/11] wip --- src/apps/components/AppAvatar/AppAvatar.tsx | 51 +- .../AppInstallPage/AppInstallPage.tsx | 6 +- src/apps/components/AppPage/AppPage.tsx | 1 + src/apps/components/AppPage/AppPageNav.tsx | 17 +- src/apps/queries.ts | 5 + src/apps/types.ts | 1 - src/fragments/apps.ts | 20 + src/graphql/fragmentTypes.generated.ts | 1 + src/graphql/hooks.generated.ts | 10 + src/graphql/typePolicies.generated.ts | 156 +++++- src/graphql/types.generated.ts | 452 +++++++++++++++++- 11 files changed, 653 insertions(+), 67 deletions(-) diff --git a/src/apps/components/AppAvatar/AppAvatar.tsx b/src/apps/components/AppAvatar/AppAvatar.tsx index fb41c66a258..f4bbfefb187 100644 --- a/src/apps/components/AppAvatar/AppAvatar.tsx +++ b/src/apps/components/AppAvatar/AppAvatar.tsx @@ -2,39 +2,24 @@ import { AppLogo } from "@dashboard/apps/types"; import { Box, GenericAppIcon } from "@saleor/macaw-ui/next"; import React from "react"; -const avatarSize = 8; +const avatarSize = 12; export const AppAvatar: React.FC<{ logo?: AppLogo | undefined; -}> = ({ logo }) => { - if (logo?.source) { - return ( - - - - ); - } else { - return ( - - - - ); - } -}; +}> = ({ logo }) => ( + + {logo?.source ? ( + + ) : ( + + )} + +); diff --git a/src/apps/components/AppInstallPage/AppInstallPage.tsx b/src/apps/components/AppInstallPage/AppInstallPage.tsx index 069f00d9e1f..bedc7b6bff5 100644 --- a/src/apps/components/AppInstallPage/AppInstallPage.tsx +++ b/src/apps/components/AppInstallPage/AppInstallPage.tsx @@ -72,7 +72,11 @@ export const AppInstallPage: React.FC = ({
- + {data.brand?.logo.default ? ( // todo sizing + + ) : ( + + )}
)} diff --git a/src/apps/components/AppPage/AppPage.tsx b/src/apps/components/AppPage/AppPage.tsx index c8e29dd5630..9ed8d19b79b 100644 --- a/src/apps/components/AppPage/AppPage.tsx +++ b/src/apps/components/AppPage/AppPage.tsx @@ -30,6 +30,7 @@ export const AppPage: React.FC = ({ supportUrl={data?.supportUrl} homepageUrl={data?.homepageUrl} author={data?.author} + appLogoUrl={data?.brand?.logo.default} /> = ({ @@ -22,6 +24,7 @@ export const AppPageNav: React.FC = ({ homepageUrl, author, appId, + appLogoUrl, }) => { const location = useLocation(); const goBackLink = location.state?.from ?? AppUrls.resolveAppListUrl(); @@ -31,6 +34,16 @@ export const AppPageNav: React.FC = ({ navigate(AppUrls.resolveAppDetailsUrl(appId)); }; + const logo = useMemo( + (): AppLogo | undefined => + appLogoUrl + ? { + source: appLogoUrl, + } + : undefined, + [appLogoUrl], + ); + return ( = ({ - + {name} | FieldReadFunction, warehouse?: FieldPolicy | FieldReadFunction }; -export type AppKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'permissions' | 'created' | 'isActive' | 'name' | 'type' | 'tokens' | 'webhooks' | 'aboutApp' | 'dataPrivacy' | 'dataPrivacyUrl' | 'homepageUrl' | 'supportUrl' | 'configurationUrl' | 'appUrl' | 'manifestUrl' | 'version' | 'accessToken' | 'author' | 'extensions' | AppKeySpecifier)[]; +export type AppKeySpecifier = ('id' | 'privateMetadata' | 'privateMetafield' | 'privateMetafields' | 'metadata' | 'metafield' | 'metafields' | 'permissions' | 'created' | 'isActive' | 'name' | 'type' | 'tokens' | 'webhooks' | 'aboutApp' | 'dataPrivacy' | 'dataPrivacyUrl' | 'homepageUrl' | 'supportUrl' | 'configurationUrl' | 'appUrl' | 'manifestUrl' | 'version' | 'accessToken' | 'author' | 'extensions' | 'brand' | AppKeySpecifier)[]; export type AppFieldPolicy = { id?: FieldPolicy | FieldReadFunction, privateMetadata?: FieldPolicy | FieldReadFunction, @@ -185,7 +185,8 @@ export type AppFieldPolicy = { version?: FieldPolicy | FieldReadFunction, accessToken?: FieldPolicy | FieldReadFunction, author?: FieldPolicy | FieldReadFunction, - extensions?: FieldPolicy | FieldReadFunction + extensions?: FieldPolicy | FieldReadFunction, + brand?: FieldPolicy | FieldReadFunction }; export type AppActivateKeySpecifier = ('appErrors' | 'errors' | 'app' | AppActivateKeySpecifier)[]; export type AppActivateFieldPolicy = { @@ -193,6 +194,14 @@ export type AppActivateFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, app?: FieldPolicy | FieldReadFunction }; +export type AppBrandKeySpecifier = ('logo' | AppBrandKeySpecifier)[]; +export type AppBrandFieldPolicy = { + logo?: FieldPolicy | FieldReadFunction +}; +export type AppBrandLogoKeySpecifier = ('default' | AppBrandLogoKeySpecifier)[]; +export type AppBrandLogoFieldPolicy = { + default?: FieldPolicy | FieldReadFunction +}; export type AppCountableConnectionKeySpecifier = ('pageInfo' | 'edges' | 'totalCount' | AppCountableConnectionKeySpecifier)[]; export type AppCountableConnectionFieldPolicy = { pageInfo?: FieldPolicy | FieldReadFunction, @@ -278,7 +287,7 @@ export type AppInstallFieldPolicy = { errors?: FieldPolicy | FieldReadFunction, appInstallation?: FieldPolicy | FieldReadFunction }; -export type AppInstallationKeySpecifier = ('id' | 'status' | 'createdAt' | 'updatedAt' | 'message' | 'appName' | 'manifestUrl' | AppInstallationKeySpecifier)[]; +export type AppInstallationKeySpecifier = ('id' | 'status' | 'createdAt' | 'updatedAt' | 'message' | 'appName' | 'manifestUrl' | 'brand' | AppInstallationKeySpecifier)[]; export type AppInstallationFieldPolicy = { id?: FieldPolicy | FieldReadFunction, status?: FieldPolicy | FieldReadFunction, @@ -286,7 +295,8 @@ export type AppInstallationFieldPolicy = { updatedAt?: FieldPolicy | FieldReadFunction, message?: FieldPolicy | FieldReadFunction, appName?: FieldPolicy | FieldReadFunction, - manifestUrl?: FieldPolicy | FieldReadFunction + manifestUrl?: FieldPolicy | FieldReadFunction, + brand?: FieldPolicy | FieldReadFunction }; export type AppInstalledKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'app' | AppInstalledKeySpecifier)[]; export type AppInstalledFieldPolicy = { @@ -296,6 +306,14 @@ export type AppInstalledFieldPolicy = { recipient?: FieldPolicy | FieldReadFunction, app?: FieldPolicy | FieldReadFunction }; +export type AppManifestBrandKeySpecifier = ('logo' | AppManifestBrandKeySpecifier)[]; +export type AppManifestBrandFieldPolicy = { + logo?: FieldPolicy | FieldReadFunction +}; +export type AppManifestBrandLogoKeySpecifier = ('default' | AppManifestBrandLogoKeySpecifier)[]; +export type AppManifestBrandLogoFieldPolicy = { + default?: FieldPolicy | FieldReadFunction +}; export type AppManifestExtensionKeySpecifier = ('permissions' | 'label' | 'url' | 'mount' | 'target' | AppManifestExtensionKeySpecifier)[]; export type AppManifestExtensionFieldPolicy = { permissions?: FieldPolicy | FieldReadFunction, @@ -415,6 +433,23 @@ export type AttributeBulkDeleteFieldPolicy = { attributeErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; +export type AttributeBulkTranslateKeySpecifier = ('count' | 'results' | 'errors' | AttributeBulkTranslateKeySpecifier)[]; +export type AttributeBulkTranslateFieldPolicy = { + count?: FieldPolicy | FieldReadFunction, + results?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type AttributeBulkTranslateErrorKeySpecifier = ('path' | 'message' | 'code' | AttributeBulkTranslateErrorKeySpecifier)[]; +export type AttributeBulkTranslateErrorFieldPolicy = { + path?: FieldPolicy | FieldReadFunction, + message?: FieldPolicy | FieldReadFunction, + code?: FieldPolicy | FieldReadFunction +}; +export type AttributeBulkTranslateResultKeySpecifier = ('translation' | 'errors' | AttributeBulkTranslateResultKeySpecifier)[]; +export type AttributeBulkTranslateResultFieldPolicy = { + translation?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; export type AttributeCountableConnectionKeySpecifier = ('pageInfo' | 'edges' | 'totalCount' | AttributeCountableConnectionKeySpecifier)[]; export type AttributeCountableConnectionFieldPolicy = { pageInfo?: FieldPolicy | FieldReadFunction, @@ -522,6 +557,23 @@ export type AttributeValueBulkDeleteFieldPolicy = { attributeErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; +export type AttributeValueBulkTranslateKeySpecifier = ('count' | 'results' | 'errors' | AttributeValueBulkTranslateKeySpecifier)[]; +export type AttributeValueBulkTranslateFieldPolicy = { + count?: FieldPolicy | FieldReadFunction, + results?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type AttributeValueBulkTranslateErrorKeySpecifier = ('path' | 'message' | 'code' | AttributeValueBulkTranslateErrorKeySpecifier)[]; +export type AttributeValueBulkTranslateErrorFieldPolicy = { + path?: FieldPolicy | FieldReadFunction, + message?: FieldPolicy | FieldReadFunction, + code?: FieldPolicy | FieldReadFunction +}; +export type AttributeValueBulkTranslateResultKeySpecifier = ('translation' | 'errors' | AttributeValueBulkTranslateResultKeySpecifier)[]; +export type AttributeValueBulkTranslateResultFieldPolicy = { + translation?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; export type AttributeValueCountableConnectionKeySpecifier = ('pageInfo' | 'edges' | 'totalCount' | AttributeValueCountableConnectionKeySpecifier)[]; export type AttributeValueCountableConnectionFieldPolicy = { pageInfo?: FieldPolicy | FieldReadFunction, @@ -2153,7 +2205,7 @@ export type LimitsFieldPolicy = { staffUsers?: FieldPolicy | FieldReadFunction, warehouses?: FieldPolicy | FieldReadFunction }; -export type ManifestKeySpecifier = ('identifier' | 'version' | 'name' | 'about' | 'permissions' | 'appUrl' | 'configurationUrl' | 'tokenTargetUrl' | 'dataPrivacy' | 'dataPrivacyUrl' | 'homepageUrl' | 'supportUrl' | 'extensions' | 'webhooks' | 'audience' | 'requiredSaleorVersion' | 'author' | ManifestKeySpecifier)[]; +export type ManifestKeySpecifier = ('identifier' | 'version' | 'name' | 'about' | 'permissions' | 'appUrl' | 'configurationUrl' | 'tokenTargetUrl' | 'dataPrivacy' | 'dataPrivacyUrl' | 'homepageUrl' | 'supportUrl' | 'extensions' | 'webhooks' | 'audience' | 'requiredSaleorVersion' | 'author' | 'brand' | ManifestKeySpecifier)[]; export type ManifestFieldPolicy = { identifier?: FieldPolicy | FieldReadFunction, version?: FieldPolicy | FieldReadFunction, @@ -2171,7 +2223,8 @@ export type ManifestFieldPolicy = { webhooks?: FieldPolicy | FieldReadFunction, audience?: FieldPolicy | FieldReadFunction, requiredSaleorVersion?: FieldPolicy | FieldReadFunction, - author?: FieldPolicy | FieldReadFunction + author?: FieldPolicy | FieldReadFunction, + brand?: FieldPolicy | FieldReadFunction }; export type MarginKeySpecifier = ('start' | 'stop' | MarginKeySpecifier)[]; export type MarginFieldPolicy = { @@ -2381,7 +2434,7 @@ export type MoneyRangeFieldPolicy = { start?: FieldPolicy | FieldReadFunction, stop?: FieldPolicy | FieldReadFunction }; -export type MutationKeySpecifier = ('webhookCreate' | 'webhookDelete' | 'webhookUpdate' | 'eventDeliveryRetry' | 'webhookDryRun' | 'webhookTrigger' | 'createWarehouse' | 'updateWarehouse' | 'deleteWarehouse' | 'assignWarehouseShippingZone' | 'unassignWarehouseShippingZone' | 'taxClassCreate' | 'taxClassDelete' | 'taxClassUpdate' | 'taxConfigurationUpdate' | 'taxCountryConfigurationUpdate' | 'taxCountryConfigurationDelete' | 'taxExemptionManage' | 'stockBulkUpdate' | 'staffNotificationRecipientCreate' | 'staffNotificationRecipientUpdate' | 'staffNotificationRecipientDelete' | 'shopDomainUpdate' | 'shopSettingsUpdate' | 'shopFetchTaxRates' | 'shopSettingsTranslate' | 'shopAddressUpdate' | 'orderSettingsUpdate' | 'giftCardSettingsUpdate' | 'shippingMethodChannelListingUpdate' | 'shippingPriceCreate' | 'shippingPriceDelete' | 'shippingPriceBulkDelete' | 'shippingPriceUpdate' | 'shippingPriceTranslate' | 'shippingPriceExcludeProducts' | 'shippingPriceRemoveProductFromExclude' | 'shippingZoneCreate' | 'shippingZoneDelete' | 'shippingZoneBulkDelete' | 'shippingZoneUpdate' | 'productAttributeAssign' | 'productAttributeAssignmentUpdate' | 'productAttributeUnassign' | 'categoryCreate' | 'categoryDelete' | 'categoryBulkDelete' | 'categoryUpdate' | 'categoryTranslate' | 'collectionAddProducts' | 'collectionCreate' | 'collectionDelete' | 'collectionReorderProducts' | 'collectionBulkDelete' | 'collectionRemoveProducts' | 'collectionUpdate' | 'collectionTranslate' | 'collectionChannelListingUpdate' | 'productCreate' | 'productDelete' | 'productBulkCreate' | 'productBulkDelete' | 'productUpdate' | 'productTranslate' | 'productChannelListingUpdate' | 'productMediaCreate' | 'productVariantReorder' | 'productMediaDelete' | 'productMediaBulkDelete' | 'productMediaReorder' | 'productMediaUpdate' | 'productTypeCreate' | 'productTypeDelete' | 'productTypeBulkDelete' | 'productTypeUpdate' | 'productTypeReorderAttributes' | 'productReorderAttributeValues' | 'digitalContentCreate' | 'digitalContentDelete' | 'digitalContentUpdate' | 'digitalContentUrlCreate' | 'productVariantCreate' | 'productVariantDelete' | 'productVariantBulkCreate' | 'productVariantBulkUpdate' | 'productVariantBulkDelete' | 'productVariantStocksCreate' | 'productVariantStocksDelete' | 'productVariantStocksUpdate' | 'productVariantUpdate' | 'productVariantSetDefault' | 'productVariantTranslate' | 'productVariantChannelListingUpdate' | 'productVariantReorderAttributeValues' | 'productVariantPreorderDeactivate' | 'variantMediaAssign' | 'variantMediaUnassign' | 'paymentCapture' | 'paymentRefund' | 'paymentVoid' | 'paymentInitialize' | 'paymentCheckBalance' | 'transactionCreate' | 'transactionUpdate' | 'transactionRequestAction' | 'transactionEventReport' | 'paymentGatewayInitialize' | 'transactionInitialize' | 'transactionProcess' | 'pageCreate' | 'pageDelete' | 'pageBulkDelete' | 'pageBulkPublish' | 'pageUpdate' | 'pageTranslate' | 'pageTypeCreate' | 'pageTypeUpdate' | 'pageTypeDelete' | 'pageTypeBulkDelete' | 'pageAttributeAssign' | 'pageAttributeUnassign' | 'pageTypeReorderAttributes' | 'pageReorderAttributeValues' | 'draftOrderComplete' | 'draftOrderCreate' | 'draftOrderDelete' | 'draftOrderBulkDelete' | 'draftOrderLinesBulkDelete' | 'draftOrderUpdate' | 'orderAddNote' | 'orderCancel' | 'orderCapture' | 'orderConfirm' | 'orderFulfill' | 'orderFulfillmentCancel' | 'orderFulfillmentApprove' | 'orderFulfillmentUpdateTracking' | 'orderFulfillmentRefundProducts' | 'orderFulfillmentReturnProducts' | 'orderGrantRefundCreate' | 'orderGrantRefundUpdate' | 'orderLinesCreate' | 'orderLineDelete' | 'orderLineUpdate' | 'orderDiscountAdd' | 'orderDiscountUpdate' | 'orderDiscountDelete' | 'orderLineDiscountUpdate' | 'orderLineDiscountRemove' | 'orderMarkAsPaid' | 'orderRefund' | 'orderUpdate' | 'orderUpdateShipping' | 'orderVoid' | 'orderBulkCancel' | 'deleteMetadata' | 'deletePrivateMetadata' | 'updateMetadata' | 'updatePrivateMetadata' | 'assignNavigation' | 'menuCreate' | 'menuDelete' | 'menuBulkDelete' | 'menuUpdate' | 'menuItemCreate' | 'menuItemDelete' | 'menuItemBulkDelete' | 'menuItemUpdate' | 'menuItemTranslate' | 'menuItemMove' | 'invoiceRequest' | 'invoiceRequestDelete' | 'invoiceCreate' | 'invoiceDelete' | 'invoiceUpdate' | 'invoiceSendNotification' | 'giftCardActivate' | 'giftCardCreate' | 'giftCardDelete' | 'giftCardDeactivate' | 'giftCardUpdate' | 'giftCardResend' | 'giftCardAddNote' | 'giftCardBulkCreate' | 'giftCardBulkDelete' | 'giftCardBulkActivate' | 'giftCardBulkDeactivate' | 'pluginUpdate' | 'externalNotificationTrigger' | 'saleCreate' | 'saleDelete' | 'saleBulkDelete' | 'saleUpdate' | 'saleCataloguesAdd' | 'saleCataloguesRemove' | 'saleTranslate' | 'saleChannelListingUpdate' | 'voucherCreate' | 'voucherDelete' | 'voucherBulkDelete' | 'voucherUpdate' | 'voucherCataloguesAdd' | 'voucherCataloguesRemove' | 'voucherTranslate' | 'voucherChannelListingUpdate' | 'exportProducts' | 'exportGiftCards' | 'fileUpload' | 'checkoutAddPromoCode' | 'checkoutBillingAddressUpdate' | 'checkoutComplete' | 'checkoutCreate' | 'checkoutCreateFromOrder' | 'checkoutCustomerAttach' | 'checkoutCustomerDetach' | 'checkoutEmailUpdate' | 'checkoutLineDelete' | 'checkoutLinesDelete' | 'checkoutLinesAdd' | 'checkoutLinesUpdate' | 'checkoutRemovePromoCode' | 'checkoutPaymentCreate' | 'checkoutShippingAddressUpdate' | 'checkoutShippingMethodUpdate' | 'checkoutDeliveryMethodUpdate' | 'checkoutLanguageCodeUpdate' | 'orderCreateFromCheckout' | 'channelCreate' | 'channelUpdate' | 'channelDelete' | 'channelActivate' | 'channelDeactivate' | 'channelReorderWarehouses' | 'attributeCreate' | 'attributeDelete' | 'attributeUpdate' | 'attributeTranslate' | 'attributeBulkDelete' | 'attributeValueBulkDelete' | 'attributeValueCreate' | 'attributeValueDelete' | 'attributeValueUpdate' | 'attributeValueTranslate' | 'attributeReorderValues' | 'appCreate' | 'appUpdate' | 'appDelete' | 'appTokenCreate' | 'appTokenDelete' | 'appTokenVerify' | 'appInstall' | 'appRetryInstall' | 'appDeleteFailedInstallation' | 'appFetchManifest' | 'appActivate' | 'appDeactivate' | 'tokenCreate' | 'tokenRefresh' | 'tokenVerify' | 'tokensDeactivateAll' | 'externalAuthenticationUrl' | 'externalObtainAccessTokens' | 'externalRefresh' | 'externalLogout' | 'externalVerify' | 'requestPasswordReset' | 'confirmAccount' | 'setPassword' | 'passwordChange' | 'requestEmailChange' | 'confirmEmailChange' | 'accountAddressCreate' | 'accountAddressUpdate' | 'accountAddressDelete' | 'accountSetDefaultAddress' | 'accountRegister' | 'accountUpdate' | 'accountRequestDeletion' | 'accountDelete' | 'addressCreate' | 'addressUpdate' | 'addressDelete' | 'addressSetDefault' | 'customerCreate' | 'customerUpdate' | 'customerDelete' | 'customerBulkDelete' | 'customerBulkUpdate' | 'staffCreate' | 'staffUpdate' | 'staffDelete' | 'staffBulkDelete' | 'userAvatarUpdate' | 'userAvatarDelete' | 'userBulkSetActive' | 'permissionGroupCreate' | 'permissionGroupUpdate' | 'permissionGroupDelete' | MutationKeySpecifier)[]; +export type MutationKeySpecifier = ('webhookCreate' | 'webhookDelete' | 'webhookUpdate' | 'eventDeliveryRetry' | 'webhookDryRun' | 'webhookTrigger' | 'createWarehouse' | 'updateWarehouse' | 'deleteWarehouse' | 'assignWarehouseShippingZone' | 'unassignWarehouseShippingZone' | 'taxClassCreate' | 'taxClassDelete' | 'taxClassUpdate' | 'taxConfigurationUpdate' | 'taxCountryConfigurationUpdate' | 'taxCountryConfigurationDelete' | 'taxExemptionManage' | 'stockBulkUpdate' | 'staffNotificationRecipientCreate' | 'staffNotificationRecipientUpdate' | 'staffNotificationRecipientDelete' | 'shopDomainUpdate' | 'shopSettingsUpdate' | 'shopFetchTaxRates' | 'shopSettingsTranslate' | 'shopAddressUpdate' | 'orderSettingsUpdate' | 'giftCardSettingsUpdate' | 'shippingMethodChannelListingUpdate' | 'shippingPriceCreate' | 'shippingPriceDelete' | 'shippingPriceBulkDelete' | 'shippingPriceUpdate' | 'shippingPriceTranslate' | 'shippingPriceExcludeProducts' | 'shippingPriceRemoveProductFromExclude' | 'shippingZoneCreate' | 'shippingZoneDelete' | 'shippingZoneBulkDelete' | 'shippingZoneUpdate' | 'productAttributeAssign' | 'productAttributeAssignmentUpdate' | 'productAttributeUnassign' | 'categoryCreate' | 'categoryDelete' | 'categoryBulkDelete' | 'categoryUpdate' | 'categoryTranslate' | 'collectionAddProducts' | 'collectionCreate' | 'collectionDelete' | 'collectionReorderProducts' | 'collectionBulkDelete' | 'collectionRemoveProducts' | 'collectionUpdate' | 'collectionTranslate' | 'collectionChannelListingUpdate' | 'productCreate' | 'productDelete' | 'productBulkCreate' | 'productBulkDelete' | 'productUpdate' | 'productTranslate' | 'productChannelListingUpdate' | 'productMediaCreate' | 'productVariantReorder' | 'productMediaDelete' | 'productMediaBulkDelete' | 'productMediaReorder' | 'productMediaUpdate' | 'productTypeCreate' | 'productTypeDelete' | 'productTypeBulkDelete' | 'productTypeUpdate' | 'productTypeReorderAttributes' | 'productReorderAttributeValues' | 'digitalContentCreate' | 'digitalContentDelete' | 'digitalContentUpdate' | 'digitalContentUrlCreate' | 'productVariantCreate' | 'productVariantDelete' | 'productVariantBulkCreate' | 'productVariantBulkUpdate' | 'productVariantBulkDelete' | 'productVariantStocksCreate' | 'productVariantStocksDelete' | 'productVariantStocksUpdate' | 'productVariantUpdate' | 'productVariantSetDefault' | 'productVariantTranslate' | 'productVariantChannelListingUpdate' | 'productVariantReorderAttributeValues' | 'productVariantPreorderDeactivate' | 'variantMediaAssign' | 'variantMediaUnassign' | 'paymentCapture' | 'paymentRefund' | 'paymentVoid' | 'paymentInitialize' | 'paymentCheckBalance' | 'transactionCreate' | 'transactionUpdate' | 'transactionRequestAction' | 'transactionEventReport' | 'paymentGatewayInitialize' | 'transactionInitialize' | 'transactionProcess' | 'pageCreate' | 'pageDelete' | 'pageBulkDelete' | 'pageBulkPublish' | 'pageUpdate' | 'pageTranslate' | 'pageTypeCreate' | 'pageTypeUpdate' | 'pageTypeDelete' | 'pageTypeBulkDelete' | 'pageAttributeAssign' | 'pageAttributeUnassign' | 'pageTypeReorderAttributes' | 'pageReorderAttributeValues' | 'draftOrderComplete' | 'draftOrderCreate' | 'draftOrderDelete' | 'draftOrderBulkDelete' | 'draftOrderLinesBulkDelete' | 'draftOrderUpdate' | 'orderAddNote' | 'orderCancel' | 'orderCapture' | 'orderConfirm' | 'orderFulfill' | 'orderFulfillmentCancel' | 'orderFulfillmentApprove' | 'orderFulfillmentUpdateTracking' | 'orderFulfillmentRefundProducts' | 'orderFulfillmentReturnProducts' | 'orderGrantRefundCreate' | 'orderGrantRefundUpdate' | 'orderLinesCreate' | 'orderLineDelete' | 'orderLineUpdate' | 'orderDiscountAdd' | 'orderDiscountUpdate' | 'orderDiscountDelete' | 'orderLineDiscountUpdate' | 'orderLineDiscountRemove' | 'orderMarkAsPaid' | 'orderRefund' | 'orderUpdate' | 'orderUpdateShipping' | 'orderVoid' | 'orderBulkCancel' | 'orderBulkCreate' | 'deleteMetadata' | 'deletePrivateMetadata' | 'updateMetadata' | 'updatePrivateMetadata' | 'assignNavigation' | 'menuCreate' | 'menuDelete' | 'menuBulkDelete' | 'menuUpdate' | 'menuItemCreate' | 'menuItemDelete' | 'menuItemBulkDelete' | 'menuItemUpdate' | 'menuItemTranslate' | 'menuItemMove' | 'invoiceRequest' | 'invoiceRequestDelete' | 'invoiceCreate' | 'invoiceDelete' | 'invoiceUpdate' | 'invoiceSendNotification' | 'giftCardActivate' | 'giftCardCreate' | 'giftCardDelete' | 'giftCardDeactivate' | 'giftCardUpdate' | 'giftCardResend' | 'giftCardAddNote' | 'giftCardBulkCreate' | 'giftCardBulkDelete' | 'giftCardBulkActivate' | 'giftCardBulkDeactivate' | 'pluginUpdate' | 'externalNotificationTrigger' | 'saleCreate' | 'saleDelete' | 'saleBulkDelete' | 'saleUpdate' | 'saleCataloguesAdd' | 'saleCataloguesRemove' | 'saleTranslate' | 'saleChannelListingUpdate' | 'voucherCreate' | 'voucherDelete' | 'voucherBulkDelete' | 'voucherUpdate' | 'voucherCataloguesAdd' | 'voucherCataloguesRemove' | 'voucherTranslate' | 'voucherChannelListingUpdate' | 'exportProducts' | 'exportGiftCards' | 'fileUpload' | 'checkoutAddPromoCode' | 'checkoutBillingAddressUpdate' | 'checkoutComplete' | 'checkoutCreate' | 'checkoutCreateFromOrder' | 'checkoutCustomerAttach' | 'checkoutCustomerDetach' | 'checkoutEmailUpdate' | 'checkoutLineDelete' | 'checkoutLinesDelete' | 'checkoutLinesAdd' | 'checkoutLinesUpdate' | 'checkoutRemovePromoCode' | 'checkoutPaymentCreate' | 'checkoutShippingAddressUpdate' | 'checkoutShippingMethodUpdate' | 'checkoutDeliveryMethodUpdate' | 'checkoutLanguageCodeUpdate' | 'orderCreateFromCheckout' | 'channelCreate' | 'channelUpdate' | 'channelDelete' | 'channelActivate' | 'channelDeactivate' | 'channelReorderWarehouses' | 'attributeCreate' | 'attributeDelete' | 'attributeUpdate' | 'attributeTranslate' | 'attributeBulkTranslate' | 'attributeBulkDelete' | 'attributeValueBulkDelete' | 'attributeValueCreate' | 'attributeValueDelete' | 'attributeValueUpdate' | 'attributeValueBulkTranslate' | 'attributeValueTranslate' | 'attributeReorderValues' | 'appCreate' | 'appUpdate' | 'appDelete' | 'appTokenCreate' | 'appTokenDelete' | 'appTokenVerify' | 'appInstall' | 'appRetryInstall' | 'appDeleteFailedInstallation' | 'appFetchManifest' | 'appActivate' | 'appDeactivate' | 'tokenCreate' | 'tokenRefresh' | 'tokenVerify' | 'tokensDeactivateAll' | 'externalAuthenticationUrl' | 'externalObtainAccessTokens' | 'externalRefresh' | 'externalLogout' | 'externalVerify' | 'requestPasswordReset' | 'confirmAccount' | 'setPassword' | 'passwordChange' | 'requestEmailChange' | 'confirmEmailChange' | 'accountAddressCreate' | 'accountAddressUpdate' | 'accountAddressDelete' | 'accountSetDefaultAddress' | 'accountRegister' | 'accountUpdate' | 'accountRequestDeletion' | 'accountDelete' | 'addressCreate' | 'addressUpdate' | 'addressDelete' | 'addressSetDefault' | 'customerCreate' | 'customerUpdate' | 'customerDelete' | 'customerBulkDelete' | 'customerBulkUpdate' | 'staffCreate' | 'staffUpdate' | 'staffDelete' | 'staffBulkDelete' | 'userAvatarUpdate' | 'userAvatarDelete' | 'userBulkSetActive' | 'permissionGroupCreate' | 'permissionGroupUpdate' | 'permissionGroupDelete' | MutationKeySpecifier)[]; export type MutationFieldPolicy = { webhookCreate?: FieldPolicy | FieldReadFunction, webhookDelete?: FieldPolicy | FieldReadFunction, @@ -2538,6 +2591,7 @@ export type MutationFieldPolicy = { orderUpdateShipping?: FieldPolicy | FieldReadFunction, orderVoid?: FieldPolicy | FieldReadFunction, orderBulkCancel?: FieldPolicy | FieldReadFunction, + orderBulkCreate?: FieldPolicy | FieldReadFunction, deleteMetadata?: FieldPolicy | FieldReadFunction, deletePrivateMetadata?: FieldPolicy | FieldReadFunction, updateMetadata?: FieldPolicy | FieldReadFunction, @@ -2620,11 +2674,13 @@ export type MutationFieldPolicy = { attributeDelete?: FieldPolicy | FieldReadFunction, attributeUpdate?: FieldPolicy | FieldReadFunction, attributeTranslate?: FieldPolicy | FieldReadFunction, + attributeBulkTranslate?: FieldPolicy | FieldReadFunction, attributeBulkDelete?: FieldPolicy | FieldReadFunction, attributeValueBulkDelete?: FieldPolicy | FieldReadFunction, attributeValueCreate?: FieldPolicy | FieldReadFunction, attributeValueDelete?: FieldPolicy | FieldReadFunction, attributeValueUpdate?: FieldPolicy | FieldReadFunction, + attributeValueBulkTranslate?: FieldPolicy | FieldReadFunction, attributeValueTranslate?: FieldPolicy | FieldReadFunction, attributeReorderValues?: FieldPolicy | FieldReadFunction, appCreate?: FieldPolicy | FieldReadFunction, @@ -2791,6 +2847,31 @@ export type OrderBulkCancelFieldPolicy = { orderErrors?: FieldPolicy | FieldReadFunction, errors?: FieldPolicy | FieldReadFunction }; +export type OrderBulkCreateKeySpecifier = ('count' | 'results' | 'errors' | OrderBulkCreateKeySpecifier)[]; +export type OrderBulkCreateFieldPolicy = { + count?: FieldPolicy | FieldReadFunction, + results?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type OrderBulkCreateErrorKeySpecifier = ('path' | 'message' | 'code' | OrderBulkCreateErrorKeySpecifier)[]; +export type OrderBulkCreateErrorFieldPolicy = { + path?: FieldPolicy | FieldReadFunction, + message?: FieldPolicy | FieldReadFunction, + code?: FieldPolicy | FieldReadFunction +}; +export type OrderBulkCreateResultKeySpecifier = ('order' | 'errors' | OrderBulkCreateResultKeySpecifier)[]; +export type OrderBulkCreateResultFieldPolicy = { + order?: FieldPolicy | FieldReadFunction, + errors?: FieldPolicy | FieldReadFunction +}; +export type OrderBulkCreatedKeySpecifier = ('issuedAt' | 'version' | 'issuingPrincipal' | 'recipient' | 'orders' | OrderBulkCreatedKeySpecifier)[]; +export type OrderBulkCreatedFieldPolicy = { + issuedAt?: FieldPolicy | FieldReadFunction, + version?: FieldPolicy | FieldReadFunction, + issuingPrincipal?: FieldPolicy | FieldReadFunction, + recipient?: FieldPolicy | FieldReadFunction, + orders?: FieldPolicy | FieldReadFunction +}; export type OrderCancelKeySpecifier = ('order' | 'orderErrors' | 'errors' | OrderCancelKeySpecifier)[]; export type OrderCancelFieldPolicy = { order?: FieldPolicy | FieldReadFunction, @@ -3142,13 +3223,14 @@ export type OrderRefundedFieldPolicy = { recipient?: FieldPolicy | FieldReadFunction, order?: FieldPolicy | FieldReadFunction }; -export type OrderSettingsKeySpecifier = ('automaticallyConfirmAllNewOrders' | 'automaticallyFulfillNonShippableGiftCard' | 'expireOrdersAfter' | 'markAsPaidStrategy' | 'defaultTransactionFlowStrategy' | OrderSettingsKeySpecifier)[]; +export type OrderSettingsKeySpecifier = ('automaticallyConfirmAllNewOrders' | 'automaticallyFulfillNonShippableGiftCard' | 'expireOrdersAfter' | 'markAsPaidStrategy' | 'defaultTransactionFlowStrategy' | 'deleteExpiredOrdersAfter' | OrderSettingsKeySpecifier)[]; export type OrderSettingsFieldPolicy = { automaticallyConfirmAllNewOrders?: FieldPolicy | FieldReadFunction, automaticallyFulfillNonShippableGiftCard?: FieldPolicy | FieldReadFunction, expireOrdersAfter?: FieldPolicy | FieldReadFunction, markAsPaidStrategy?: FieldPolicy | FieldReadFunction, - defaultTransactionFlowStrategy?: FieldPolicy | FieldReadFunction + defaultTransactionFlowStrategy?: FieldPolicy | FieldReadFunction, + deleteExpiredOrdersAfter?: FieldPolicy | FieldReadFunction }; export type OrderSettingsErrorKeySpecifier = ('field' | 'message' | 'code' | OrderSettingsErrorKeySpecifier)[]; export type OrderSettingsErrorFieldPolicy = { @@ -6061,6 +6143,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | AppActivateKeySpecifier | (() => undefined | AppActivateKeySpecifier), fields?: AppActivateFieldPolicy, }, + AppBrand?: Omit & { + keyFields?: false | AppBrandKeySpecifier | (() => undefined | AppBrandKeySpecifier), + fields?: AppBrandFieldPolicy, + }, + AppBrandLogo?: Omit & { + keyFields?: false | AppBrandLogoKeySpecifier | (() => undefined | AppBrandLogoKeySpecifier), + fields?: AppBrandLogoFieldPolicy, + }, AppCountableConnection?: Omit & { keyFields?: false | AppCountableConnectionKeySpecifier | (() => undefined | AppCountableConnectionKeySpecifier), fields?: AppCountableConnectionFieldPolicy, @@ -6121,6 +6211,14 @@ export type StrictTypedTypePolicies = { keyFields?: false | AppInstalledKeySpecifier | (() => undefined | AppInstalledKeySpecifier), fields?: AppInstalledFieldPolicy, }, + AppManifestBrand?: Omit & { + keyFields?: false | AppManifestBrandKeySpecifier | (() => undefined | AppManifestBrandKeySpecifier), + fields?: AppManifestBrandFieldPolicy, + }, + AppManifestBrandLogo?: Omit & { + keyFields?: false | AppManifestBrandLogoKeySpecifier | (() => undefined | AppManifestBrandLogoKeySpecifier), + fields?: AppManifestBrandLogoFieldPolicy, + }, AppManifestExtension?: Omit & { keyFields?: false | AppManifestExtensionKeySpecifier | (() => undefined | AppManifestExtensionKeySpecifier), fields?: AppManifestExtensionFieldPolicy, @@ -6181,6 +6279,18 @@ export type StrictTypedTypePolicies = { keyFields?: false | AttributeBulkDeleteKeySpecifier | (() => undefined | AttributeBulkDeleteKeySpecifier), fields?: AttributeBulkDeleteFieldPolicy, }, + AttributeBulkTranslate?: Omit & { + keyFields?: false | AttributeBulkTranslateKeySpecifier | (() => undefined | AttributeBulkTranslateKeySpecifier), + fields?: AttributeBulkTranslateFieldPolicy, + }, + AttributeBulkTranslateError?: Omit & { + keyFields?: false | AttributeBulkTranslateErrorKeySpecifier | (() => undefined | AttributeBulkTranslateErrorKeySpecifier), + fields?: AttributeBulkTranslateErrorFieldPolicy, + }, + AttributeBulkTranslateResult?: Omit & { + keyFields?: false | AttributeBulkTranslateResultKeySpecifier | (() => undefined | AttributeBulkTranslateResultKeySpecifier), + fields?: AttributeBulkTranslateResultFieldPolicy, + }, AttributeCountableConnection?: Omit & { keyFields?: false | AttributeCountableConnectionKeySpecifier | (() => undefined | AttributeCountableConnectionKeySpecifier), fields?: AttributeCountableConnectionFieldPolicy, @@ -6241,6 +6351,18 @@ export type StrictTypedTypePolicies = { keyFields?: false | AttributeValueBulkDeleteKeySpecifier | (() => undefined | AttributeValueBulkDeleteKeySpecifier), fields?: AttributeValueBulkDeleteFieldPolicy, }, + AttributeValueBulkTranslate?: Omit & { + keyFields?: false | AttributeValueBulkTranslateKeySpecifier | (() => undefined | AttributeValueBulkTranslateKeySpecifier), + fields?: AttributeValueBulkTranslateFieldPolicy, + }, + AttributeValueBulkTranslateError?: Omit & { + keyFields?: false | AttributeValueBulkTranslateErrorKeySpecifier | (() => undefined | AttributeValueBulkTranslateErrorKeySpecifier), + fields?: AttributeValueBulkTranslateErrorFieldPolicy, + }, + AttributeValueBulkTranslateResult?: Omit & { + keyFields?: false | AttributeValueBulkTranslateResultKeySpecifier | (() => undefined | AttributeValueBulkTranslateResultKeySpecifier), + fields?: AttributeValueBulkTranslateResultFieldPolicy, + }, AttributeValueCountableConnection?: Omit & { keyFields?: false | AttributeValueCountableConnectionKeySpecifier | (() => undefined | AttributeValueCountableConnectionKeySpecifier), fields?: AttributeValueCountableConnectionFieldPolicy, @@ -7257,6 +7379,22 @@ export type StrictTypedTypePolicies = { keyFields?: false | OrderBulkCancelKeySpecifier | (() => undefined | OrderBulkCancelKeySpecifier), fields?: OrderBulkCancelFieldPolicy, }, + OrderBulkCreate?: Omit & { + keyFields?: false | OrderBulkCreateKeySpecifier | (() => undefined | OrderBulkCreateKeySpecifier), + fields?: OrderBulkCreateFieldPolicy, + }, + OrderBulkCreateError?: Omit & { + keyFields?: false | OrderBulkCreateErrorKeySpecifier | (() => undefined | OrderBulkCreateErrorKeySpecifier), + fields?: OrderBulkCreateErrorFieldPolicy, + }, + OrderBulkCreateResult?: Omit & { + keyFields?: false | OrderBulkCreateResultKeySpecifier | (() => undefined | OrderBulkCreateResultKeySpecifier), + fields?: OrderBulkCreateResultFieldPolicy, + }, + OrderBulkCreated?: Omit & { + keyFields?: false | OrderBulkCreatedKeySpecifier | (() => undefined | OrderBulkCreatedKeySpecifier), + fields?: OrderBulkCreatedFieldPolicy, + }, OrderCancel?: Omit & { keyFields?: false | OrderCancelKeySpecifier | (() => undefined | OrderCancelKeySpecifier), fields?: OrderCancelFieldPolicy, diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index 3eaca855bf5..55ff2f53bc1 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -23,6 +23,8 @@ export type Scalars = { * [iso8601](https://en.wikipedia.org/wiki/ISO_8601). */ DateTime: any; + /** The `Day` scalar type represents number of days by integer value. */ + Day: any; /** * Custom Decimal implementation. * @@ -307,6 +309,17 @@ export enum AreaUnitsEnum { SQ_INCH = 'SQ_INCH' } +export type AttributeBulkTranslateInput = { + /** Attribute ID. */ + id?: InputMaybe; + /** External reference of an attribute. */ + externalReference?: InputMaybe; + /** Translation language code. */ + languageCode: LanguageCodeEnum; + /** Translation fields. */ + translationFields: NameTranslationInput; +}; + export enum AttributeChoicesSortField { /** Sort attribute choice by name. */ NAME = 'NAME', @@ -481,6 +494,14 @@ export type AttributeSortingInput = { field: AttributeSortField; }; +/** An enumeration. */ +export enum AttributeTranslateErrorCode { + GRAPHQL_ERROR = 'GRAPHQL_ERROR', + INVALID = 'INVALID', + NOT_FOUND = 'NOT_FOUND', + REQUIRED = 'REQUIRED' +} + /** An enumeration. */ export enum AttributeTypeEnum { PRODUCT_TYPE = 'PRODUCT_TYPE', @@ -539,6 +560,17 @@ export type AttributeUpdateInput = { externalReference?: InputMaybe; }; +export type AttributeValueBulkTranslateInput = { + /** Attribute value ID. */ + id?: InputMaybe; + /** External reference of an attribute value. */ + externalReference?: InputMaybe; + /** Translation language code. */ + languageCode: LanguageCodeEnum; + /** Translation fields. */ + translationFields: AttributeValueTranslationInput; +}; + export type AttributeValueCreateInput = { /** Represent value of the attribute value (e.g. color values for swatch attributes). */ value?: InputMaybe; @@ -578,22 +610,28 @@ export type AttributeValueFilterInput = { export type AttributeValueInput = { /** ID of the selected attribute. */ id?: InputMaybe; + /** + * External ID of this attribute. + * + * Added in Saleor 3.14. + */ + externalReference?: InputMaybe; /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. This field will be removed in Saleor 4.0. */ values?: InputMaybe>; /** - * Attribute value ID. + * Attribute value ID or external reference. * * Added in Saleor 3.9. */ dropdown?: InputMaybe; /** - * Attribute value ID. + * Attribute value ID or external reference. * * Added in Saleor 3.9. */ swatch?: InputMaybe; /** - * List of attribute value IDs. + * List of attribute value IDs or external references. * * Added in Saleor 3.9. */ @@ -623,17 +661,35 @@ export type AttributeValueInput = { }; /** - * Represents attribute value. If no ID provided, value will be resolved. + * Represents attribute value. + * 1. If ID is provided, then attribute value will be resolved by ID. + * 2. If externalReference is provided, then attribute value will be resolved by external reference. + * 3. If value is provided, then attribute value will be resolved by value. If this attribute value doesn't exist, then it will be created. + * 4. If externalReference and value is provided then new attribute value will be created. * * Added in Saleor 3.9. */ export type AttributeValueSelectableTypeInput = { /** ID of an attribute value. */ id?: InputMaybe; + /** + * External reference of an attribute value. + * + * Added in Saleor 3.14. + */ + externalReference?: InputMaybe; /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. */ value?: InputMaybe; }; +/** An enumeration. */ +export enum AttributeValueTranslateErrorCode { + GRAPHQL_ERROR = 'GRAPHQL_ERROR', + INVALID = 'INVALID', + NOT_FOUND = 'NOT_FOUND', + REQUIRED = 'REQUIRED' +} + export type AttributeValueTranslationInput = { name?: InputMaybe; /** @@ -708,6 +764,12 @@ export type AttributeWhereInput = { export type BulkAttributeValueInput = { /** ID of the selected attribute. */ id?: InputMaybe; + /** + * External ID of this attribute. + * + * Added in Saleor 3.14. + */ + externalReference?: InputMaybe; /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created.This field will be removed in Saleor 4.0. */ values?: InputMaybe>; /** @@ -1733,6 +1795,29 @@ export type DateTimeRangeInput = { lte?: InputMaybe; }; +/** + * Define the filtering options for decimal fields. + * + * Added in Saleor 3.14. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ +export type DecimalFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; + /** The value in range. */ + range?: InputMaybe; +}; + +export type DecimalRangeInput = { + /** Decimal value greater than or equal to. */ + gte?: InputMaybe; + /** Decimal value less than or equal to. */ + lte?: InputMaybe; +}; + export type DigitalContentInput = { /** Use default digital content settings for this product. */ useDefaultSettings: Scalars['Boolean']; @@ -2266,6 +2351,26 @@ export type GiftCardUpdateInput = { balanceAmount?: InputMaybe; }; +/** + * Define the filtering options for foreign key fields. + * + * Added in Saleor 3.14. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ +export type GlobalIdFilterInput = { + /** The value equal to. */ + eq?: InputMaybe; + /** The value included in. */ + oneOf?: InputMaybe>; +}; + +/** Thumbnail formats for icon images. */ +export enum IconThumbnailFormatEnum { + ORIGINAL = 'ORIGINAL', + WEBP = 'WEBP' +} + export type IntRangeInput = { /** Value greater than or equal to. */ gte?: InputMaybe; @@ -3366,6 +3471,208 @@ export enum OrderAuthorizeStatusEnum { FULL = 'FULL' } +export type OrderBulkCreateDeliveryMethodInput = { + /** The ID of the warehouse. */ + warehouseId?: InputMaybe; + /** The name of the warehouse. */ + warehouseName?: InputMaybe; + /** The ID of the shipping method. */ + shippingMethodId?: InputMaybe; + /** The name of the shipping method. */ + shippingMethodName?: InputMaybe; + /** The price of the shipping. */ + shippingPrice?: InputMaybe; + /** Tax rate of the shipping. */ + shippingTaxRate?: InputMaybe; + /** The ID of the tax class. */ + shippingTaxClassId?: InputMaybe; + /** The name of the tax class. */ + shippingTaxClassName?: InputMaybe; + /** Metadata of the tax class. */ + shippingTaxClassMetadata?: InputMaybe>; + /** Private metadata of the tax class. */ + shippingTaxClassPrivateMetadata?: InputMaybe>; +}; + +/** An enumeration. */ +export enum OrderBulkCreateErrorCode { + GRAPHQL_ERROR = 'GRAPHQL_ERROR', + REQUIRED = 'REQUIRED', + INVALID = 'INVALID', + NOT_FOUND = 'NOT_FOUND', + UNIQUE = 'UNIQUE', + BULK_LIMIT = 'BULK_LIMIT', + TOO_MANY_IDENTIFIERS = 'TOO_MANY_IDENTIFIERS', + FUTURE_DATE = 'FUTURE_DATE', + INVALID_QUANTITY = 'INVALID_QUANTITY', + PRICE_ERROR = 'PRICE_ERROR', + NOTE_LENGTH = 'NOTE_LENGTH', + INSUFFICIENT_STOCK = 'INSUFFICIENT_STOCK', + NON_EXISTING_STOCK = 'NON_EXISTING_STOCK', + NO_RELATED_ORDER_LINE = 'NO_RELATED_ORDER_LINE', + NEGATIVE_INDEX = 'NEGATIVE_INDEX', + ORDER_LINE_FULFILLMENT_LINE_MISMATCH = 'ORDER_LINE_FULFILLMENT_LINE_MISMATCH', + METADATA_KEY_REQUIRED = 'METADATA_KEY_REQUIRED', + INCORRECT_CURRENCY = 'INCORRECT_CURRENCY' +} + +export type OrderBulkCreateFulfillmentInput = { + /** Fulfillment's tracking code. */ + trackingCode?: InputMaybe; + /** List of items informing how to fulfill the order. */ + lines?: InputMaybe>; +}; + +export type OrderBulkCreateFulfillmentLineInput = { + /** The ID of the product variant. */ + variantId?: InputMaybe; + /** The SKU of the product variant. */ + variantSku?: InputMaybe; + /** The external ID of the product variant. */ + variantExternalReference?: InputMaybe; + /** The number of line items to be fulfilled from given warehouse. */ + quantity: Scalars['Int']; + /** ID of the warehouse from which the item will be fulfilled. */ + warehouse: Scalars['ID']; + /** 0-based index of order line, which the fulfillment line refers to. */ + orderLineIndex: Scalars['Int']; +}; + +export type OrderBulkCreateInput = { + /** External ID of the order. */ + externalReference?: InputMaybe; + /** Slug of the channel associated with the order. */ + channel: Scalars['String']; + /** The date, when the order was inserted to Saleor database. */ + createdAt: Scalars['DateTime']; + /** Status of the order. */ + status?: InputMaybe; + /** Customer associated with the order. */ + user: OrderBulkCreateUserInput; + /** Tracking ID of the customer. */ + trackingClientId?: InputMaybe; + /** Billing address of the customer. */ + billingAddress: AddressInput; + /** Shipping address of the customer. */ + shippingAddress?: InputMaybe; + /** Currency code. */ + currency: Scalars['String']; + /** Metadata of the order. */ + metadata?: InputMaybe>; + /** Private metadata of the order. */ + privateMetadata?: InputMaybe>; + /** Note about customer. */ + customerNote?: InputMaybe; + /** Notes related to the order. */ + notes?: InputMaybe>; + /** Order language code. */ + languageCode: LanguageCodeEnum; + /** Determines whether checkout prices should include taxes, when displayed in a storefront. */ + displayGrossPrices?: InputMaybe; + /** Weight of the order in kg. */ + weight?: InputMaybe; + /** URL of a view, where users should be redirected to see the order details. */ + redirectUrl?: InputMaybe; + /** List of order lines. */ + lines: Array; + /** The delivery method selected for this order. */ + deliveryMethod?: InputMaybe; + /** List of gift card codes associated with the order. */ + giftCards?: InputMaybe>; + /** Code of a voucher associated with the order. */ + voucher?: InputMaybe; + /** List of discounts. */ + discounts?: InputMaybe>; + /** Fulfillments of the order. */ + fulfillments?: InputMaybe>; + /** Transactions related to the order. */ + transactions?: InputMaybe>; + /** Invoices related to the order. */ + invoices?: InputMaybe>; +}; + +export type OrderBulkCreateInvoiceInput = { + /** The date, when the invoice was created. */ + createdAt: Scalars['DateTime']; + /** Invoice number. */ + number?: InputMaybe; + /** URL of the invoice to download. */ + url?: InputMaybe; + /** Metadata of the invoice. */ + metadata?: InputMaybe>; + /** Private metadata of the invoice. */ + privateMetadata?: InputMaybe>; +}; + +export type OrderBulkCreateNoteInput = { + /** Note message. Max characters: 255. */ + message: Scalars['String']; + /** The date associated with the message. */ + date?: InputMaybe; + /** The user ID associated with the message. */ + userId?: InputMaybe; + /** The user email associated with the message. */ + userEmail?: InputMaybe; + /** The user external ID associated with the message. */ + userExternalReference?: InputMaybe; + /** The app ID associated with the message. */ + appId?: InputMaybe; +}; + +export type OrderBulkCreateOrderLineInput = { + /** The ID of the product variant. */ + variantId?: InputMaybe; + /** The SKU of the product variant. */ + variantSku?: InputMaybe; + /** The external ID of the product variant. */ + variantExternalReference?: InputMaybe; + /** The name of the product variant. */ + variantName?: InputMaybe; + /** The name of the product. */ + productName?: InputMaybe; + /** Translation of the product variant name. */ + translatedVariantName?: InputMaybe; + /** Translation of the product name. */ + translatedProductName?: InputMaybe; + /** The date, when the order line was created. */ + createdAt: Scalars['DateTime']; + /** Determines whether shipping of the order line items is required. */ + isShippingRequired: Scalars['Boolean']; + /** Gift card flag. */ + isGiftCard: Scalars['Boolean']; + /** Number of items in the order line */ + quantity: Scalars['Int']; + /** Price of the order line. */ + totalPrice: TaxedMoneyInput; + /** Price of the order line excluding applied discount. */ + undiscountedTotalPrice: TaxedMoneyInput; + /** The ID of the warehouse, where the line will be allocated. */ + warehouse: Scalars['ID']; + /** Metadata of the order line. */ + metadata?: InputMaybe>; + /** Private metadata of the order line. */ + privateMetadata?: InputMaybe>; + /** Tax rate of the order line. */ + taxRate?: InputMaybe; + /** The ID of the tax class. */ + taxClassId?: InputMaybe; + /** The name of the tax class. */ + taxClassName?: InputMaybe; + /** Metadata of the tax class. */ + taxClassMetadata?: InputMaybe>; + /** Private metadata of the tax class. */ + taxClassPrivateMetadata?: InputMaybe>; +}; + +export type OrderBulkCreateUserInput = { + /** Customer ID associated with the order. */ + id?: InputMaybe; + /** Customer email associated with the order. */ + email?: InputMaybe; + /** Customer external ID associated with the order. */ + externalReference?: InputMaybe; +}; + /** * Determine the current charge status for the order. * @@ -3525,10 +3832,10 @@ export enum OrderEventsEnum { PAYMENT_FAILED = 'PAYMENT_FAILED', TRANSACTION_EVENT = 'TRANSACTION_EVENT', TRANSACTION_CHARGE_REQUESTED = 'TRANSACTION_CHARGE_REQUESTED', - /** This field will be removed in Saleor 3.14 (Preview Feature). Use `TRANSACTION_CHARGE_REQUESTED` instead. */ + /** This field will be removed in Saleor 3.15 (Preview Feature). Use `TRANSACTION_CHARGE_REQUESTED` instead. */ TRANSACTION_CAPTURE_REQUESTED = 'TRANSACTION_CAPTURE_REQUESTED', TRANSACTION_REFUND_REQUESTED = 'TRANSACTION_REFUND_REQUESTED', - /** This field will be removed in Saleor 3.14 (Preview Feature). Use `TRANSACTION_CANCEL_REQUESTED` instead. */ + /** This field will be removed in Saleor 3.15 (Preview Feature). Use `TRANSACTION_CANCEL_REQUESTED` instead. */ TRANSACTION_VOID_REQUESTED = 'TRANSACTION_VOID_REQUESTED', TRANSACTION_CANCEL_REQUESTED = 'TRANSACTION_CANCEL_REQUESTED', TRANSACTION_MARK_AS_PAID_FAILED = 'TRANSACTION_MARK_AS_PAID_FAILED', @@ -3635,6 +3942,14 @@ export type OrderLineCreateInput = { * Added in Saleor 3.6. */ forceNewLine?: InputMaybe; + /** + * Custom price of the item.When the line with the same variant will be provided multiple times, the last price will be used. + * + * Added in Saleor 3.14. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ + price?: InputMaybe; }; export type OrderLineInput = { @@ -3646,7 +3961,8 @@ export type OrderLineInput = { export enum OrderOriginEnum { CHECKOUT = 'CHECKOUT', DRAFT = 'DRAFT', - REISSUE = 'REISSUE' + REISSUE = 'REISSUE', + BULK_CREATE = 'BULK_CREATE' } export type OrderRefundFulfillmentLineInput = { @@ -3723,6 +4039,14 @@ export type OrderSettingsInput = { * Note: this API is currently in Feature Preview and can be subject to changes at later point. */ expireOrdersAfter?: InputMaybe; + /** + * The time in days after expired orders will be deleted.Allowed range is from 1 to 120. + * + * Added in Saleor 3.14. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ + deleteExpiredOrdersAfter?: InputMaybe; /** * Determine what strategy will be used to mark the order as paid. Based on the chosen option, the proper object will be created and attached to the order when it's manually marked as paid. * `PAYMENT_FLOW` - [default option] creates the `Payment` object. @@ -4115,6 +4439,7 @@ export enum PermissionEnum { MANAGE_GIFT_CARD = 'MANAGE_GIFT_CARD', MANAGE_MENUS = 'MANAGE_MENUS', MANAGE_ORDERS = 'MANAGE_ORDERS', + MANAGE_ORDERS_IMPORT = 'MANAGE_ORDERS_IMPORT', MANAGE_PAGES = 'MANAGE_PAGES', MANAGE_PAGE_TYPES_AND_ATTRIBUTES = 'MANAGE_PAGE_TYPES_AND_ATTRIBUTES', HANDLE_PAYMENTS = 'HANDLE_PAYMENTS', @@ -5109,6 +5434,53 @@ export type ProductVariantStocksUpdateInput = { remove?: InputMaybe>; }; +export type ProductWhereInput = { + metadata?: InputMaybe>; + ids?: InputMaybe>; + /** Filter by product name. */ + name?: InputMaybe; + /** Filter by product slug. */ + slug?: InputMaybe; + /** Filter by product type. */ + productType?: InputMaybe; + /** Filter by product category. */ + category?: InputMaybe; + /** Filter by collection. */ + collection?: InputMaybe; + /** Filter by availability for purchase. */ + isAvailable?: InputMaybe; + /** Filter by public visibility. */ + isPublished?: InputMaybe; + /** Filter by visibility on the channel. */ + isVisibleInListing?: InputMaybe; + /** Filter by the publication date. */ + publishedFrom?: InputMaybe; + /** Filter by the date of availability for purchase. */ + availableFrom?: InputMaybe; + /** Filter by product with category assigned. */ + hasCategory?: InputMaybe; + /** Filter by product variant price. */ + price?: InputMaybe; + /** Filter by the lowest variant price after discounts. */ + minimalPrice?: InputMaybe; + /** Filter by attributes associated with the product. */ + attributes?: InputMaybe>; + /** Filter by variants having specific stock status. */ + stockAvailability?: InputMaybe; + /** Filter by stock of the product variant. */ + stocks?: InputMaybe; + /** Filter on whether product is a gift card or not. */ + giftCard?: InputMaybe; + /** Filter by product with preordered variants. */ + hasPreorderedVariants?: InputMaybe; + /** Filter by when was the most recent update. */ + updatedAt?: InputMaybe; + /** List of conditions that must be met. */ + AND?: InputMaybe>; + /** A list of conditions of which at least one must be met. */ + OR?: InputMaybe>; +}; + export type PublishableChannelListingInput = { /** ID of a channel. */ channelId: Scalars['ID']; @@ -5596,6 +5968,20 @@ export type StockUpdateInput = { quantity: Scalars['Int']; }; +/** + * Determine how stocks should be updated, while processing an order. + * + * SKIP - stocks are not checked and not updated. + * UPDATE - only do update, if there is enough stock. + * FORCE - force update, if there is not enough stock. + * + */ +export enum StockUpdatePolicyEnum { + SKIP = 'SKIP', + UPDATE = 'UPDATE', + FORCE = 'FORCE' +} + /** Enum representing the type of a payment storage in a gateway. */ export enum StorePaymentMethodEnum { /** On session storage type. The payment is stored only to be reused when the customer is present in the checkout flow. */ @@ -5751,6 +6137,13 @@ export enum TaxExemptionManageErrorCode { NOT_EDITABLE_ORDER = 'NOT_EDITABLE_ORDER' } +export type TaxedMoneyInput = { + /** Gross value of an item. */ + gross: Scalars['PositiveDecimal']; + /** Net value of an item. */ + net: Scalars['PositiveDecimal']; +}; + /** An enumeration. */ export enum ThumbnailFormatEnum { ORIGINAL = 'ORIGINAL', @@ -5805,13 +6198,13 @@ export type TransactionCreateInput = { /** * Status of the transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions. */ status?: InputMaybe; /** * Payment type used for this transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `name` and `message` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `name` and `message` instead. */ type?: InputMaybe; /** @@ -5829,7 +6222,7 @@ export type TransactionCreateInput = { /** * Reference of the transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `pspReference` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `pspReference` instead. */ reference?: InputMaybe; /** @@ -5849,7 +6242,7 @@ export type TransactionCreateInput = { /** * Amount voided by this transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `amountCanceled` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `amountCanceled` instead. */ amountVoided?: InputMaybe; /** @@ -5874,13 +6267,13 @@ export type TransactionEventInput = { /** * Current status of the payment transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Status will be calculated by Saleor. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Status will be calculated by Saleor. */ status?: InputMaybe; /** * Reference of the transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `pspReference` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `pspReference` instead. */ reference?: InputMaybe; /** @@ -5892,7 +6285,7 @@ export type TransactionEventInput = { /** * Name of the transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `message` instead. `name` field will be added to `message`. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `message` instead. `name` field will be added to `message`. */ name?: InputMaybe; /** @@ -6041,13 +6434,13 @@ export type TransactionUpdateInput = { /** * Status of the transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). The `status` is not needed. The amounts can be used to define the current status of transactions. */ status?: InputMaybe; /** * Payment type used for this transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `name` and `message` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `name` and `message` instead. */ type?: InputMaybe; /** @@ -6065,7 +6458,7 @@ export type TransactionUpdateInput = { /** * Reference of the transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `pspReference` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `pspReference` instead. */ reference?: InputMaybe; /** @@ -6085,7 +6478,7 @@ export type TransactionUpdateInput = { /** * Amount voided by this transaction. * - * DEPRECATED: this field will be removed in Saleor 3.14 (Preview Feature). Use `amountCanceled` instead. + * DEPRECATED: this field will be removed in Saleor 3.15 (Preview Feature). Use `amountCanceled` instead. */ amountVoided?: InputMaybe; /** @@ -6646,6 +7039,14 @@ export enum WebhookEventTypeAsyncEnum { * Added in Saleor 3.8. */ ORDER_METADATA_UPDATED = 'ORDER_METADATA_UPDATED', + /** + * Orders are imported. + * + * Added in Saleor 3.14. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ + ORDER_BULK_CREATED = 'ORDER_BULK_CREATED', /** A draft order is created. */ DRAFT_ORDER_CREATED = 'DRAFT_ORDER_CREATED', /** A draft order is updated. */ @@ -6977,6 +7378,14 @@ export enum WebhookEventTypeEnum { * Added in Saleor 3.8. */ ORDER_METADATA_UPDATED = 'ORDER_METADATA_UPDATED', + /** + * Orders are imported. + * + * Added in Saleor 3.14. + * + * Note: this API is currently in Feature Preview and can be subject to changes at later point. + */ + ORDER_BULK_CREATED = 'ORDER_BULK_CREATED', /** A draft order is created. */ DRAFT_ORDER_CREATED = 'DRAFT_ORDER_CREATED', /** A draft order is updated. */ @@ -7353,6 +7762,7 @@ export enum WebhookSampleEventTypeEnum { ORDER_EXPIRED = 'ORDER_EXPIRED', ORDER_FULFILLED = 'ORDER_FULFILLED', ORDER_METADATA_UPDATED = 'ORDER_METADATA_UPDATED', + ORDER_BULK_CREATED = 'ORDER_BULK_CREATED', DRAFT_ORDER_CREATED = 'DRAFT_ORDER_CREATED', DRAFT_ORDER_UPDATED = 'DRAFT_ORDER_UPDATED', DRAFT_ORDER_DELETED = 'DRAFT_ORDER_DELETED', @@ -7519,7 +7929,7 @@ export type AppFetchMutationVariables = Exact<{ }>; -export type AppFetchMutation = { __typename: 'Mutation', appFetchManifest: { __typename: 'AppFetchManifest', manifest: { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; +export type AppFetchMutation = { __typename: 'Mutation', appFetchManifest: { __typename: 'AppFetchManifest', manifest: { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, brand: { __typename: 'AppManifestBrand', logo: { __typename: 'AppManifestBrandLogo', default: string } } | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; export type AppInstallMutationVariables = Exact<{ input: AppInstallInput; @@ -7593,7 +8003,7 @@ export type AppQueryVariables = Exact<{ }>; -export type AppQuery = { __typename: 'Query', app: { __typename: 'App', aboutApp: string | null, author: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null }; +export type AppQuery = { __typename: 'Query', app: { __typename: 'App', aboutApp: string | null, author: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null }; export type ExtensionListQueryVariables = Exact<{ filter: AppExtensionFilterInput; @@ -8325,7 +8735,7 @@ export type FileUploadMutation = { __typename: 'Mutation', fileUpload: { __typen export type AddressFragment = { __typename: 'Address', city: string, cityArea: string, companyName: string, countryArea: string, firstName: string, id: string, lastName: string, phone: string | null, postalCode: string, streetAddress1: string, streetAddress2: string, country: { __typename: 'CountryDisplay', code: string, country: string } }; -export type AppManifestFragment = { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null }; +export type AppManifestFragment = { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, brand: { __typename: 'AppManifestBrand', logo: { __typename: 'AppManifestBrandLogo', default: string } } | null }; export type AppFragment = { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null }; From 5a888a5ada72f5d46137f4273126edd6f3990314 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Mon, 12 Jun 2023 21:18:05 +0200 Subject: [PATCH 02/11] implement logo in all contexts --- .../components/AppInstallPage/AppInstallPage.tsx | 4 ++-- src/apps/components/AppListPage/utils.test.ts | 4 ++++ .../InstalledAppList/InstalledAppList.tsx | 10 ++++++++-- src/graphql/hooks.generated.ts | 15 +++++++++++++++ src/graphql/types.generated.ts | 16 ++++++++-------- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/apps/components/AppInstallPage/AppInstallPage.tsx b/src/apps/components/AppInstallPage/AppInstallPage.tsx index bedc7b6bff5..ce88db388cb 100644 --- a/src/apps/components/AppInstallPage/AppInstallPage.tsx +++ b/src/apps/components/AppInstallPage/AppInstallPage.tsx @@ -72,8 +72,8 @@ export const AppInstallPage: React.FC = ({
- {data.brand?.logo.default ? ( // todo sizing - + {data?.brand?.logo.default ? ( // todo sizing + ) : ( )} diff --git a/src/apps/components/AppListPage/utils.test.ts b/src/apps/components/AppListPage/utils.test.ts index 6cc67656d3a..9b2e399a7ab 100644 --- a/src/apps/components/AppListPage/utils.test.ts +++ b/src/apps/components/AppListPage/utils.test.ts @@ -187,6 +187,7 @@ describe("App List verified installed apps util", () => { name: "Manage customers.", }, ], + brand: null, }, { __typename: "App", @@ -209,6 +210,7 @@ describe("App List verified installed apps util", () => { name: "Manage customers.", }, ], + brand: null, }, ]; const installableMarketplaceApps: GetV2SaleorAppsResponse.ReleasedSaleorApp[] = @@ -279,6 +281,7 @@ describe("App List verified installable marketplace apps util", () => { name: "Manage customers.", }, ], + brand: null, }, { __typename: "App", @@ -301,6 +304,7 @@ describe("App List verified installable marketplace apps util", () => { name: "Manage customers.", }, ], + brand: null, }, ]; const installableMarketplaceApps: GetV2SaleorAppsResponse.ReleasedSaleorApp[] = diff --git a/src/apps/components/InstalledAppList/InstalledAppList.tsx b/src/apps/components/InstalledAppList/InstalledAppList.tsx index 2fc43b7147d..d4b999a1440 100644 --- a/src/apps/components/InstalledAppList/InstalledAppList.tsx +++ b/src/apps/components/InstalledAppList/InstalledAppList.tsx @@ -27,7 +27,11 @@ const InstalledAppList: React.FC = ({ key={appInstallation.id} appInstallation={appInstallation} isExternal={isExternal} - logo={logo} + logo={ + appInstallation.brand?.logo.default + ? { source: appInstallation.brand.logo.default } + : logo + } /> ))} {appList.map(({ app, isExternal, logo }) => ( @@ -35,7 +39,9 @@ const InstalledAppList: React.FC = ({ key={app.id} app={app} isExternal={isExternal} - logo={logo} + logo={ + app.brand?.logo.default ? { source: app.brand?.logo.default } : logo + } /> ))} diff --git a/src/graphql/hooks.generated.ts b/src/graphql/hooks.generated.ts index 728b27294da..e073d129e89 100644 --- a/src/graphql/hooks.generated.ts +++ b/src/graphql/hooks.generated.ts @@ -54,6 +54,11 @@ export const AppFragmentDoc = gql` supportUrl version accessToken + brand { + logo { + default + } + } privateMetadata { key value @@ -79,6 +84,11 @@ export const AppInstallationFragmentDoc = gql` appName manifestUrl id + brand { + logo { + default + } + } } `; export const AppPermissionFragmentDoc = gql` @@ -96,6 +106,11 @@ export const AppListItemFragmentDoc = gql` appUrl manifestUrl version + brand { + logo { + default + } + } permissions { ...AppPermission } diff --git a/src/graphql/types.generated.ts b/src/graphql/types.generated.ts index 55ff2f53bc1..74d42069077 100644 --- a/src/graphql/types.generated.ts +++ b/src/graphql/types.generated.ts @@ -7908,14 +7908,14 @@ export type AppCreateMutationVariables = Exact<{ }>; -export type AppCreateMutation = { __typename: 'Mutation', appCreate: { __typename: 'AppCreate', authToken: string | null, app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; +export type AppCreateMutation = { __typename: 'Mutation', appCreate: { __typename: 'AppCreate', authToken: string | null, app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; export type AppDeleteMutationVariables = Exact<{ id: Scalars['ID']; }>; -export type AppDeleteMutation = { __typename: 'Mutation', appDelete: { __typename: 'AppDelete', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; +export type AppDeleteMutation = { __typename: 'Mutation', appDelete: { __typename: 'AppDelete', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', field: string | null, message: string | null, code: AppErrorCode, permissions: Array | null }> } | null }; export type AppDeleteFailedInstallationMutationVariables = Exact<{ id: Scalars['ID']; @@ -7951,7 +7951,7 @@ export type AppUpdateMutationVariables = Exact<{ }>; -export type AppUpdateMutation = { __typename: 'Mutation', appUpdate: { __typename: 'AppUpdate', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', message: string | null, permissions: Array | null, field: string | null, code: AppErrorCode }> } | null }; +export type AppUpdateMutation = { __typename: 'Mutation', appUpdate: { __typename: 'AppUpdate', app: { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null } | null, errors: Array<{ __typename: 'AppError', message: string | null, permissions: Array | null, field: string | null, code: AppErrorCode }> } | null }; export type AppTokenCreateMutationVariables = Exact<{ input: AppTokenInput; @@ -7991,12 +7991,12 @@ export type AppsListQueryVariables = Exact<{ }>; -export type AppsListQuery = { __typename: 'Query', apps: { __typename: 'AppCountableConnection', totalCount: number | null, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null, endCursor: string | null }, edges: Array<{ __typename: 'AppCountableEdge', node: { __typename: 'App', id: string, name: string | null, isActive: boolean | null, type: AppTypeEnum | null, appUrl: string | null, manifestUrl: string | null, version: string | null, permissions: Array<{ __typename: 'Permission', name: string, code: PermissionEnum }> | null } }> } | null }; +export type AppsListQuery = { __typename: 'Query', apps: { __typename: 'AppCountableConnection', totalCount: number | null, pageInfo: { __typename: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null, endCursor: string | null }, edges: Array<{ __typename: 'AppCountableEdge', node: { __typename: 'App', id: string, name: string | null, isActive: boolean | null, type: AppTypeEnum | null, appUrl: string | null, manifestUrl: string | null, version: string | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, permissions: Array<{ __typename: 'Permission', name: string, code: PermissionEnum }> | null } }> } | null }; export type AppsInstallationsQueryVariables = Exact<{ [key: string]: never; }>; -export type AppsInstallationsQuery = { __typename: 'Query', appsInstallations: Array<{ __typename: 'AppInstallation', status: JobStatusEnum, message: string | null, appName: string, manifestUrl: string, id: string }> }; +export type AppsInstallationsQuery = { __typename: 'Query', appsInstallations: Array<{ __typename: 'AppInstallation', status: JobStatusEnum, message: string | null, appName: string, manifestUrl: string, id: string, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null }> }; export type AppQueryVariables = Exact<{ id: Scalars['ID']; @@ -8737,11 +8737,11 @@ export type AddressFragment = { __typename: 'Address', city: string, cityArea: s export type AppManifestFragment = { __typename: 'Manifest', identifier: string, version: string, about: string | null, name: string, appUrl: string | null, configurationUrl: string | null, tokenTargetUrl: string | null, dataPrivacy: string | null, dataPrivacyUrl: string | null, homepageUrl: string | null, supportUrl: string | null, permissions: Array<{ __typename: 'Permission', code: PermissionEnum, name: string }> | null, brand: { __typename: 'AppManifestBrand', logo: { __typename: 'AppManifestBrandLogo', default: string } } | null }; -export type AppFragment = { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null }; +export type AppFragment = { __typename: 'App', id: string, name: string | null, created: any | null, isActive: boolean | null, type: AppTypeEnum | null, homepageUrl: string | null, appUrl: string | null, manifestUrl: string | null, configurationUrl: string | null, supportUrl: string | null, version: string | null, accessToken: string | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, privateMetadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, metadata: Array<{ __typename: 'MetadataItem', key: string, value: string }>, tokens: Array<{ __typename: 'AppToken', authToken: string | null, id: string, name: string | null }> | null, webhooks: Array<{ __typename: 'Webhook', id: string, name: string, isActive: boolean, app: { __typename: 'App', id: string, name: string | null } }> | null }; -export type AppInstallationFragment = { __typename: 'AppInstallation', status: JobStatusEnum, message: string | null, appName: string, manifestUrl: string, id: string }; +export type AppInstallationFragment = { __typename: 'AppInstallation', status: JobStatusEnum, message: string | null, appName: string, manifestUrl: string, id: string, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null }; -export type AppListItemFragment = { __typename: 'App', id: string, name: string | null, isActive: boolean | null, type: AppTypeEnum | null, appUrl: string | null, manifestUrl: string | null, version: string | null, permissions: Array<{ __typename: 'Permission', name: string, code: PermissionEnum }> | null }; +export type AppListItemFragment = { __typename: 'App', id: string, name: string | null, isActive: boolean | null, type: AppTypeEnum | null, appUrl: string | null, manifestUrl: string | null, version: string | null, brand: { __typename: 'AppBrand', logo: { __typename: 'AppBrandLogo', default: string } } | null, permissions: Array<{ __typename: 'Permission', name: string, code: PermissionEnum }> | null }; export type AppPermissionFragment = { __typename: 'Permission', name: string, code: PermissionEnum }; From 8f9a240dc82317301a80fffcfdf9ab0112f90731 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Mon, 12 Jun 2023 21:31:21 +0200 Subject: [PATCH 03/11] fix types --- src/apps/components/InstalledAppListRow/styles.ts | 8 ++++---- src/apps/components/NotInstalledAppListRow/styles.ts | 8 ++++---- src/apps/fixtures.ts | 7 +++++++ src/apps/utils.test.ts | 3 +++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/apps/components/InstalledAppListRow/styles.ts b/src/apps/components/InstalledAppListRow/styles.ts index 402e97e67e2..dc04ceacf12 100644 --- a/src/apps/components/InstalledAppListRow/styles.ts +++ b/src/apps/components/InstalledAppListRow/styles.ts @@ -8,13 +8,13 @@ export const useStyles = makeStyles( alignItems: "center", gap: theme.spacing(2), }, - logo: props => ({ - backgroundColor: props.logo?.color || theme.palette.grey[300], - color: props.logo?.color ? "#fff" : theme.palette.grey[600], + logo: { + backgroundColor: theme.palette.grey[300], + color: theme.palette.grey[600], padding: theme.spacing(1.2), borderRadius: theme.spacing(1), borderWidth: 0, - }), + }, name: { fontWeight: 600, }, diff --git a/src/apps/components/NotInstalledAppListRow/styles.ts b/src/apps/components/NotInstalledAppListRow/styles.ts index cddf50c8e1d..0af59eb5bf4 100644 --- a/src/apps/components/NotInstalledAppListRow/styles.ts +++ b/src/apps/components/NotInstalledAppListRow/styles.ts @@ -8,13 +8,13 @@ export const useStyles = makeStyles( alignItems: "center", gap: theme.spacing(2), }, - logo: props => ({ - backgroundColor: props.logo?.color || theme.palette.grey[300], - color: props.logo?.color ? "#fff" : theme.palette.grey[600], + logo: { + backgroundColor: theme.palette.grey[300], + color: theme.palette.grey[600], padding: theme.spacing(1.2), borderRadius: theme.spacing(1), borderWidth: 0, - }), + }, name: { fontWeight: 600, }, diff --git a/src/apps/fixtures.ts b/src/apps/fixtures.ts index d9aec8316cc..c2448646fd7 100644 --- a/src/apps/fixtures.ts +++ b/src/apps/fixtures.ts @@ -27,6 +27,7 @@ export const activeApp: AppListItemFragment = { name: "Manage customers.", }, ], + brand: null, }; export const inactiveApp: AppListItemFragment = { @@ -50,6 +51,7 @@ export const inactiveApp: AppListItemFragment = { name: "Manage customers.", }, ], + brand: null, }; export const installedAppsList: AppListItemFragment[] = [ @@ -64,6 +66,7 @@ export const failedAppInProgress: AppInstallationFragment = { manifestUrl: "https://www.released-example.com/manifest", message: "Failed to connect to app. Try later or contact with app support.", status: JobStatusEnum.FAILED, + brand: null, }; export const pendingAppInProgress: AppInstallationFragment = { @@ -73,6 +76,7 @@ export const pendingAppInProgress: AppInstallationFragment = { manifestUrl: "https://www.released-example.com/manifest", message: "Pending.", status: JobStatusEnum.PENDING, + brand: null, }; export const successAppInProgress: AppInstallationFragment = { @@ -82,6 +86,7 @@ export const successAppInProgress: AppInstallationFragment = { manifestUrl: "https://www.released-example.com/manifest", message: "Success.", status: JobStatusEnum.SUCCESS, + brand: null, }; export const appsInProgress: AppInstallationFragment[] = [ @@ -124,6 +129,7 @@ export const appDetails: NonNullable = { type: AppTypeEnum.THIRDPARTY, version: "1.0.0", webhooks: [], + brand: null, }; export const installApp: AppManifestFragment = { @@ -151,6 +157,7 @@ export const installApp: AppManifestFragment = { supportUrl: null, tokenTargetUrl: null, version: "1.0", + brand: null, }; export const appAvatar: AppAvatarFragment = { diff --git a/src/apps/utils.test.ts b/src/apps/utils.test.ts index acd680fa70f..59fb6809b12 100644 --- a/src/apps/utils.test.ts +++ b/src/apps/utils.test.ts @@ -134,6 +134,7 @@ describe("App utils app details", () => { status: JobStatusEnum.PENDING, message: "Test message", manifestUrl: "https://www.example.com/manifest", + brand: null, }; // Act @@ -200,6 +201,7 @@ describe("App utils app details", () => { status: JobStatusEnum.FAILED, message: "Test message", manifestUrl: "https://www.example.com/manifest", + brand: null, }; // Act @@ -249,6 +251,7 @@ describe("App utils app details", () => { status: JobStatusEnum.PENDING, message: "Test message", manifestUrl: releasedApp.manifestUrl as string, + brand: null, }; const appInstallationList: AppInstallationFragment[] = [ releasedAppInstallation, From 6d6e343c355d17ca743e4128eef3c9888b162358 Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Tue, 13 Jun 2023 10:00:29 +0200 Subject: [PATCH 04/11] Improve icons rendering --- src/apps/components/AppAvatar/AppAvatar.tsx | 40 ++++++++------ .../AppInstallPage/AppInstallPage.tsx | 53 +++++++++++++------ src/apps/components/AppInstallPage/styles.ts | 18 ------- src/apps/components/AppPage/AppPageNav.tsx | 2 +- 4 files changed, 60 insertions(+), 53 deletions(-) diff --git a/src/apps/components/AppAvatar/AppAvatar.tsx b/src/apps/components/AppAvatar/AppAvatar.tsx index f4bbfefb187..67bf1a1809a 100644 --- a/src/apps/components/AppAvatar/AppAvatar.tsx +++ b/src/apps/components/AppAvatar/AppAvatar.tsx @@ -2,24 +2,30 @@ import { AppLogo } from "@dashboard/apps/types"; import { Box, GenericAppIcon } from "@saleor/macaw-ui/next"; import React from "react"; -const avatarSize = 12; - export const AppAvatar: React.FC<{ logo?: AppLogo | undefined; -}> = ({ logo }) => ( - - {logo?.source ? ( + size?: 8 | 12; +}> = ({ logo, size = 8 }) => + logo ? ( + - ) : ( + + ) : ( + - )} - -); + + ); diff --git a/src/apps/components/AppInstallPage/AppInstallPage.tsx b/src/apps/components/AppInstallPage/AppInstallPage.tsx index ce88db388cb..4f7244349ae 100644 --- a/src/apps/components/AppInstallPage/AppInstallPage.tsx +++ b/src/apps/components/AppInstallPage/AppInstallPage.tsx @@ -1,5 +1,7 @@ -import saleorDarkLogoSmall from "@assets/images/logo-dark-small.svg"; import plusIcon from "@assets/images/plus-icon.svg"; +import saleorLogoDarkMode from "@assets/images/sidebar-deafult-logo-darkMode.png"; +import saleorLogoLightMode from "@assets/images/sidebar-default-logo.png"; +import { AppAvatar } from "@dashboard/apps/components/AppAvatar/AppAvatar"; import CardSpacer from "@dashboard/components/CardSpacer"; import CardTitle from "@dashboard/components/CardTitle"; import Hr from "@dashboard/components/Hr"; @@ -8,14 +10,14 @@ import Skeleton from "@dashboard/components/Skeleton"; import { AppFetchMutation, AppInstallMutation } from "@dashboard/graphql"; import { SubmitPromise } from "@dashboard/hooks/useForm"; import { buttonMessages } from "@dashboard/intl"; +import { useTheme } from "@dashboard/theme"; import { Card, CardContent, CircularProgress, Typography, } from "@material-ui/core"; -import { Box, Button, GenericAppIcon } from "@saleor/macaw-ui/next"; -import clsx from "clsx"; +import { Box, Button } from "@saleor/macaw-ui/next"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; @@ -39,6 +41,18 @@ export const AppInstallPage: React.FC = ({ }) => { const intl = useIntl(); const classes = useStyles(); + const { theme } = useTheme(); + + const getSaleorLogoUrl = () => { + switch (theme) { + case "defaultLight": + return saleorLogoLightMode; + case "defaultDark": + return saleorLogoDarkMode; + default: + throw new Error("Invalid theme mode, should not happen."); + } + }; const name = data?.name || ""; @@ -62,22 +76,27 @@ export const AppInstallPage: React.FC = ({ ) : (
-
- -
+ Saleor + -
- {data?.brand?.logo.default ? ( // todo sizing - - ) : ( - - )} -
+
)} diff --git a/src/apps/components/AppInstallPage/styles.ts b/src/apps/components/AppInstallPage/styles.ts index 5121d8f8d56..b4b798db148 100644 --- a/src/apps/components/AppInstallPage/styles.ts +++ b/src/apps/components/AppInstallPage/styles.ts @@ -29,17 +29,6 @@ export const useStyles = makeStyles( justifyContent: "center", position: "relative", }, - installIcon: { - alignItems: "center", - backgroundColor: theme.palette.divider, - border: `1px solid ${theme.palette.divider}`, - borderRadius: "50%", - display: "flex", - height: theme.spacing(9), - justifyContent: "center", - overflow: "hidden", - width: theme.spacing(9), - }, installPermissionTitle: { fontWeight: 500, }, @@ -51,13 +40,6 @@ export const useStyles = makeStyles( color: theme.palette.text.hint, marginTop: theme.spacing(1), }, - installSaleorIcon: { - backgroundColor: - theme.palette.type === "dark" - ? theme.palette.saleor.gray.default - : theme.palette.saleor.main[1], - border: "none", - }, installSpacer: { margin: theme.spacing(2, 0), }, diff --git a/src/apps/components/AppPage/AppPageNav.tsx b/src/apps/components/AppPage/AppPageNav.tsx index 94db7f98b34..3584242882e 100644 --- a/src/apps/components/AppPage/AppPageNav.tsx +++ b/src/apps/components/AppPage/AppPageNav.tsx @@ -55,7 +55,7 @@ export const AppPageNav: React.FC = ({ - + {name} Date: Wed, 14 Jun 2023 10:05:24 +0200 Subject: [PATCH 05/11] Reuse App Header in Manage App page --- src/apps/components/AppDetailsPage/Header.tsx | 20 +++---- .../AppDetailsPage/HeaderOptions.tsx | 11 ---- src/apps/components/AppPage/AppPage.tsx | 2 + src/apps/components/AppPage/AppPageNav.tsx | 54 ++++++++++--------- 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/apps/components/AppDetailsPage/Header.tsx b/src/apps/components/AppDetailsPage/Header.tsx index 5530443b504..a145d504554 100644 --- a/src/apps/components/AppDetailsPage/Header.tsx +++ b/src/apps/components/AppDetailsPage/Header.tsx @@ -1,9 +1,8 @@ +import { AppPageNav } from "@dashboard/apps/components/AppPage/AppPageNav"; import { AppUrls } from "@dashboard/apps/urls"; -import { TopNav } from "@dashboard/components/AppLayout/TopNav"; import { AppQuery } from "@dashboard/graphql"; import React from "react"; -import DeactivatedText from "../DeactivatedText"; import HeaderOptions from "./HeaderOptions"; interface HeaderProps { @@ -36,14 +35,17 @@ const Header: React.FC = ({ return ( <> - - {data?.name} {!data?.isActive && } - - } + + = ({ return (
- - - - = ({ }) => (