@deenruv/admin-dashboard 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -0
- package/README.md +30 -0
- package/dist/@types/resources.js +51 -0
- package/dist/DeenruvAdminPanel.js +118 -0
- package/dist/DeenruvDeveloperIndicator.js +57 -0
- package/dist/components/Aexol.js +4 -0
- package/dist/components/BrandLogo.js +22 -0
- package/dist/components/CanLeaveRouteDialog.js +8 -0
- package/dist/components/DataTable.js +13 -0
- package/dist/components/DeleteDialog.js +6 -0
- package/dist/components/DuplicateEntry.js +46 -0
- package/dist/components/GlobalSearch.js +134 -0
- package/dist/components/History/AddEntryForm.js +29 -0
- package/dist/components/History/DeleteEntryDialog.js +25 -0
- package/dist/components/History/EditEntryDialog.js +32 -0
- package/dist/components/History/History.js +13 -0
- package/dist/components/History/ModifyHistoryInfo.js +6 -0
- package/dist/components/History/Timeline.js +53 -0
- package/dist/components/History/index.js +5 -0
- package/dist/components/Menu/ActiveAdmins.js +24 -0
- package/dist/components/Menu/ChannelSwitcher.js +20 -0
- package/dist/components/Menu/LanguagesDropdown.js +26 -0
- package/dist/components/Menu/Navigation.js +270 -0
- package/dist/components/Menu/NavigationFooter.js +12 -0
- package/dist/components/Menu/Notifications.js +90 -0
- package/dist/components/Menu/index.js +67 -0
- package/dist/components/index.js +6 -0
- package/dist/graphql/base.js +95 -0
- package/dist/graphql/collections.js +94 -0
- package/dist/graphql/draft_order.js +307 -0
- package/dist/graphql/orders.js +157 -0
- package/dist/graphql/products.js +230 -0
- package/dist/graphql/scalars.js +22 -0
- package/dist/i18.js +13 -0
- package/dist/index.css +161 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/locales/en/admins.json +57 -0
- package/dist/locales/en/assets.json +69 -0
- package/dist/locales/en/channels.json +66 -0
- package/dist/locales/en/collections.json +145 -0
- package/dist/locales/en/common.json +1127 -0
- package/dist/locales/en/countries.json +50 -0
- package/dist/locales/en/customerGroups.json +6 -0
- package/dist/locales/en/customers.json +109 -0
- package/dist/locales/en/dashboard.json +34 -0
- package/dist/locales/en/facets.json +78 -0
- package/dist/locales/en/globalSettings.json +15 -0
- package/dist/locales/en/index.js +52 -0
- package/dist/locales/en/orders.json +932 -0
- package/dist/locales/en/paymentMethods.json +59 -0
- package/dist/locales/en/permissions.json +94 -0
- package/dist/locales/en/products.json +194 -0
- package/dist/locales/en/promotions.json +65 -0
- package/dist/locales/en/roles.json +59 -0
- package/dist/locales/en/sellers.json +41 -0
- package/dist/locales/en/shippingMethods.json +84 -0
- package/dist/locales/en/stockLocations.json +40 -0
- package/dist/locales/en/system.json +41 -0
- package/dist/locales/en/table.json +201 -0
- package/dist/locales/en/taxCategories.json +47 -0
- package/dist/locales/en/taxRates.json +56 -0
- package/dist/locales/en/zones.json +47 -0
- package/dist/locales/index.js +2 -0
- package/dist/locales/pl/admins.json +57 -0
- package/dist/locales/pl/assets.json +69 -0
- package/dist/locales/pl/channels.json +66 -0
- package/dist/locales/pl/collections.json +145 -0
- package/dist/locales/pl/common.json +1128 -0
- package/dist/locales/pl/countries.json +50 -0
- package/dist/locales/pl/customerGroups.json +6 -0
- package/dist/locales/pl/customers.json +109 -0
- package/dist/locales/pl/dashboard.json +34 -0
- package/dist/locales/pl/facets.json +78 -0
- package/dist/locales/pl/globalSettings.json +15 -0
- package/dist/locales/pl/index.js +52 -0
- package/dist/locales/pl/orders.json +932 -0
- package/dist/locales/pl/paymentMethods.json +59 -0
- package/dist/locales/pl/permissions.json +94 -0
- package/dist/locales/pl/products.json +194 -0
- package/dist/locales/pl/promotions.json +65 -0
- package/dist/locales/pl/roles.json +59 -0
- package/dist/locales/pl/sellers.json +41 -0
- package/dist/locales/pl/shippingMethods.json +84 -0
- package/dist/locales/pl/stockLocations.json +40 -0
- package/dist/locales/pl/system.json +41 -0
- package/dist/locales/pl/table.json +201 -0
- package/dist/locales/pl/taxCategories.json +47 -0
- package/dist/locales/pl/taxRates.json +56 -0
- package/dist/locales/pl/zones.json +47 -0
- package/dist/notifications/OrderStatusNotification.js +47 -0
- package/dist/notifications/SystemStatusNotification.js +19 -0
- package/dist/pages/Custom404.js +5 -0
- package/dist/pages/LoginScreen.js +37 -0
- package/dist/pages/Root.js +252 -0
- package/dist/pages/admins/Detail.js +72 -0
- package/dist/pages/admins/List.js +56 -0
- package/dist/pages/admins/_components/AdminDetailView.js +34 -0
- package/dist/pages/admins/_components/RolesCard.js +31 -0
- package/dist/pages/admins/index.js +2 -0
- package/dist/pages/assets/List.js +82 -0
- package/dist/pages/assets/_components/Asset.js +114 -0
- package/dist/pages/assets/_components/AssetListView.js +29 -0
- package/dist/pages/assets/_components/EditAssetDialog.js +85 -0
- package/dist/pages/assets/_components/UploadAssetDialog.js +133 -0
- package/dist/pages/assets/_components/UploadProgress.js +20 -0
- package/dist/pages/assets/index.js +1 -0
- package/dist/pages/channels/Detail.js +149 -0
- package/dist/pages/channels/List.js +46 -0
- package/dist/pages/channels/_components/ChannelDetailView.js +51 -0
- package/dist/pages/channels/_components/DefaultsCard.js +25 -0
- package/dist/pages/channels/index.js +2 -0
- package/dist/pages/collections/Detail.js +61 -0
- package/dist/pages/collections/List.js +135 -0
- package/dist/pages/collections/_components/CollectionDetailView.js +52 -0
- package/dist/pages/collections/_components/CollectionProductVariantsDrawer.js +28 -0
- package/dist/pages/collections/_components/CombinationMode.js +6 -0
- package/dist/pages/collections/_components/ContentsCard.js +43 -0
- package/dist/pages/collections/_components/ContentsTable.js +102 -0
- package/dist/pages/collections/_components/DeleteCollectionsFromChannel.js +36 -0
- package/dist/pages/collections/_components/FacetsSelector.js +30 -0
- package/dist/pages/collections/_components/FiltersCard.js +101 -0
- package/dist/pages/collections/_components/MoveCollectionsToCollections.js +107 -0
- package/dist/pages/collections/_components/MoveEntityToChannels.js +115 -0
- package/dist/pages/collections/_components/PageHeader.js +11 -0
- package/dist/pages/collections/_components/SelectedCollectionsModal.js +22 -0
- package/dist/pages/collections/_components/VariantsSelector.js +43 -0
- package/dist/pages/collections/consts.js +7 -0
- package/dist/pages/collections/index.js +2 -0
- package/dist/pages/countries/Detail.js +57 -0
- package/dist/pages/countries/List.js +47 -0
- package/dist/pages/countries/_components/CountryDetailView.js +28 -0
- package/dist/pages/countries/index.js +2 -0
- package/dist/pages/customer-groups/Detail.js +76 -0
- package/dist/pages/customer-groups/List.js +41 -0
- package/dist/pages/customer-groups/_components/CustomerGroupsDetailView.js +21 -0
- package/dist/pages/customer-groups/index.js +2 -0
- package/dist/pages/customers/Detail.js +75 -0
- package/dist/pages/customers/List.js +60 -0
- package/dist/pages/customers/_components/Address.js +59 -0
- package/dist/pages/customers/_components/AddressDialog.js +56 -0
- package/dist/pages/customers/_components/AddressForm.js +77 -0
- package/dist/pages/customers/_components/AddressesCard.js +9 -0
- package/dist/pages/customers/_components/CustomerDetailSidebar.js +9 -0
- package/dist/pages/customers/_components/CustomerDetailView.js +41 -0
- package/dist/pages/customers/_components/CustomerGroupsCard.js +46 -0
- package/dist/pages/customers/_components/HistoryTab.js +65 -0
- package/dist/pages/customers/_components/OrdersTab.js +46 -0
- package/dist/pages/customers/_components/PersonalDataCard.js +6 -0
- package/dist/pages/customers/_components/VerifiedCard.js +6 -0
- package/dist/pages/customers/index.js +2 -0
- package/dist/pages/dashboard/Dashboard.js +10 -0
- package/dist/pages/dashboard/index.js +1 -0
- package/dist/pages/extensions/Extensions.js +74 -0
- package/dist/pages/extensions/index.js +1 -0
- package/dist/pages/facets/Detail.js +56 -0
- package/dist/pages/facets/List.js +48 -0
- package/dist/pages/facets/_components/AddFacetValueDialog.js +105 -0
- package/dist/pages/facets/_components/ColorSample.js +18 -0
- package/dist/pages/facets/_components/FacetDetailView.js +98 -0
- package/dist/pages/facets/index.js +2 -0
- package/dist/pages/global-settings/GlobalSettingsComponent.js +30 -0
- package/dist/pages/global-settings/index.js +71 -0
- package/dist/pages/index.js +25 -0
- package/dist/pages/orders/Detail.js +21 -0
- package/dist/pages/orders/List.js +132 -0
- package/dist/pages/orders/_components/AddPaymentDialog.js +50 -0
- package/dist/pages/orders/_components/AddressCard.js +260 -0
- package/dist/pages/orders/_components/CancelAndRefundDialog.js +29 -0
- package/dist/pages/orders/_components/ChangesRegister.js +68 -0
- package/dist/pages/orders/_components/ChangesRegisterTable.js +18 -0
- package/dist/pages/orders/_components/CouponCodesCard.js +85 -0
- package/dist/pages/orders/_components/CustomComponent.js +21 -0
- package/dist/pages/orders/_components/CustomerSelectCard.js +117 -0
- package/dist/pages/orders/_components/EditNoteButton.js +10 -0
- package/dist/pages/orders/_components/FulfillmentModal.js +85 -0
- package/dist/pages/orders/_components/LineItem.js +7 -0
- package/dist/pages/orders/_components/ManualOrderChangeModal.js +47 -0
- package/dist/pages/orders/_components/ModifyAcceptModal.js +22 -0
- package/dist/pages/orders/_components/ModifyingCard.js +77 -0
- package/dist/pages/orders/_components/OrderHistory.js +59 -0
- package/dist/pages/orders/_components/OrderLineActionModal/ActionQuantityPrice.js +58 -0
- package/dist/pages/orders/_components/OrderLineActionModal/index.js +7 -0
- package/dist/pages/orders/_components/OrderLineActionModal/types.js +1 -0
- package/dist/pages/orders/_components/OrderLineCustomFields.js +26 -0
- package/dist/pages/orders/_components/OrderSummary.js +10 -0
- package/dist/pages/orders/_components/PaymentMetadata.js +6 -0
- package/dist/pages/orders/_components/Payments.js +113 -0
- package/dist/pages/orders/_components/PossibleOrderStates.js +54 -0
- package/dist/pages/orders/_components/PriceChangedInfo.js +16 -0
- package/dist/pages/orders/_components/ProductsCard.js +308 -0
- package/dist/pages/orders/_components/ProductsTable.js +29 -0
- package/dist/pages/orders/_components/PromotionsList.js +73 -0
- package/dist/pages/orders/_components/RealizationCard.js +98 -0
- package/dist/pages/orders/_components/RefundCard.js +11 -0
- package/dist/pages/orders/_components/RefundPaymentCard.js +13 -0
- package/dist/pages/orders/_components/ShippingMethod.js +112 -0
- package/dist/pages/orders/_components/SpecialLineItem.js +7 -0
- package/dist/pages/orders/_components/SurchargeCard.js +99 -0
- package/dist/pages/orders/_components/SurchargeTable.js +8 -0
- package/dist/pages/orders/_components/TaxSummary.js +11 -0
- package/dist/pages/orders/_components/ToRealizationForm.js +64 -0
- package/dist/pages/orders/_components/TopActions.js +219 -0
- package/dist/pages/orders/_components/index.js +25 -0
- package/dist/pages/orders/index.js +2 -0
- package/dist/pages/payment-methods/Detail.js +67 -0
- package/dist/pages/payment-methods/List.js +41 -0
- package/dist/pages/payment-methods/_components/OptionsCard.js +60 -0
- package/dist/pages/payment-methods/_components/PaymentMethodDetailView.js +53 -0
- package/dist/pages/payment-methods/index.js +2 -0
- package/dist/pages/product-variants/Detail.js +4 -0
- package/dist/pages/product-variants/List.js +76 -0
- package/dist/pages/product-variants/index.js +2 -0
- package/dist/pages/products/Detail.js +75 -0
- package/dist/pages/products/List.js +79 -0
- package/dist/pages/products/_components/AddOptionGroupDialog.js +65 -0
- package/dist/pages/products/_components/AssetsCard.js +35 -0
- package/dist/pages/products/_components/BasicFieldsCard.js +6 -0
- package/dist/pages/products/_components/ChannelsCard.js +6 -0
- package/dist/pages/products/_components/CollectionsCard.js +6 -0
- package/dist/pages/products/_components/Container.js +4 -0
- package/dist/pages/products/_components/DiscountRatingCard.js +6 -0
- package/dist/pages/products/_components/FacetValuesCard.js +6 -0
- package/dist/pages/products/_components/ImagesCard.js +6 -0
- package/dist/pages/products/_components/OptionGroup.js +93 -0
- package/dist/pages/products/_components/OptionValueCard.js +59 -0
- package/dist/pages/products/_components/OptionsCard.js +38 -0
- package/dist/pages/products/_components/OptionsTab.js +40 -0
- package/dist/pages/products/_components/PriceCard.js +27 -0
- package/dist/pages/products/_components/ProductDetailSidebar.js +30 -0
- package/dist/pages/products/_components/ProductDetailView.js +54 -0
- package/dist/pages/products/_components/SettingsCard.js +6 -0
- package/dist/pages/products/_components/StockCard.js +40 -0
- package/dist/pages/products/_components/Variant.js +149 -0
- package/dist/pages/products/_components/VariantsTab.js +46 -0
- package/dist/pages/products/index.js +2 -0
- package/dist/pages/promotions/Detail.js +80 -0
- package/dist/pages/promotions/List.js +38 -0
- package/dist/pages/promotions/_components/ActionsCard.js +67 -0
- package/dist/pages/promotions/_components/BasicFieldsCard.js +6 -0
- package/dist/pages/promotions/_components/ConditionsCard.js +70 -0
- package/dist/pages/promotions/_components/CustomerGroupsSelector.js +25 -0
- package/dist/pages/promotions/_components/EnabledCard.js +6 -0
- package/dist/pages/promotions/_components/OptionsCard.js +6 -0
- package/dist/pages/promotions/_components/PromotionDetailSidebar.js +15 -0
- package/dist/pages/promotions/_components/PromotionDetailView.js +66 -0
- package/dist/pages/promotions/_components/PromotionFieldRender.js +4 -0
- package/dist/pages/promotions/index.js +2 -0
- package/dist/pages/roles/Detail.js +72 -0
- package/dist/pages/roles/List.js +70 -0
- package/dist/pages/roles/_components/PermissionsCard.js +7 -0
- package/dist/pages/roles/_components/PermissionsTable.js +42 -0
- package/dist/pages/roles/_components/RoleDetailView.js +49 -0
- package/dist/pages/roles/index.js +2 -0
- package/dist/pages/sellers/Detail.js +48 -0
- package/dist/pages/sellers/List.js +37 -0
- package/dist/pages/sellers/_components/SellerDetailView.js +20 -0
- package/dist/pages/sellers/index.js +2 -0
- package/dist/pages/shipping-methods/Detail.js +105 -0
- package/dist/pages/shipping-methods/List.js +40 -0
- package/dist/pages/shipping-methods/_components/CalculatorCard.js +79 -0
- package/dist/pages/shipping-methods/_components/CheckerCard.js +76 -0
- package/dist/pages/shipping-methods/_components/Lines.js +20 -0
- package/dist/pages/shipping-methods/_components/ShippingMethodDetailView.js +67 -0
- package/dist/pages/shipping-methods/_components/TestCard.js +62 -0
- package/dist/pages/shipping-methods/index.js +2 -0
- package/dist/pages/status/Status.js +6 -0
- package/dist/pages/status/_components/FilterToolbar.js +29 -0
- package/dist/pages/status/_components/Health.js +21 -0
- package/dist/pages/status/_components/JobResultPopover.js +8 -0
- package/dist/pages/status/_components/Jobs.js +199 -0
- package/dist/pages/status/_components/JsonExplorer.js +44 -0
- package/dist/pages/status/_components/JsonPopup.js +8 -0
- package/dist/pages/status/index.js +1 -0
- package/dist/pages/stock-locations/Detail.js +77 -0
- package/dist/pages/stock-locations/List.js +38 -0
- package/dist/pages/stock-locations/_components/StockLocationDetailView.js +22 -0
- package/dist/pages/stock-locations/index.js +2 -0
- package/dist/pages/tax-categories/Detail.js +85 -0
- package/dist/pages/tax-categories/List.js +46 -0
- package/dist/pages/tax-categories/_components/TaxCategoryDetailView.js +24 -0
- package/dist/pages/tax-categories/index.js +2 -0
- package/dist/pages/tax-rates/Detail.js +62 -0
- package/dist/pages/tax-rates/List.js +64 -0
- package/dist/pages/tax-rates/_components/TaxRateDetailView.js +64 -0
- package/dist/pages/tax-rates/index.js +2 -0
- package/dist/pages/zones/Detail.js +86 -0
- package/dist/pages/zones/List.js +52 -0
- package/dist/pages/zones/_components/ZoneDetailView.js +49 -0
- package/dist/pages/zones/index.js +2 -0
- package/dist/version.js +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo, useState } from 'react';
|
|
3
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbList, BreadcrumbSeparator, Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, ScrollArea, TooltipProvider, Routes, useSettings, useServer, usePluginStore, cn, dashToCamelCase, apiClient, useGlobalSearch, useTranslation, DropdownMenuGroup, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuPortal, DropdownMenuSubContent, createDialog, buildURL, } from '@deenruv/react-ui-devkit';
|
|
4
|
+
import { GripVertical, LogOutIcon, MenuIcon, Moon, Slash, Sun, SunMoon, RotateCwSquare, SearchIcon, } from 'lucide-react';
|
|
5
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
6
|
+
import { Navigation } from './Navigation.js';
|
|
7
|
+
import { NavLink, useMatches, useNavigate } from 'react-router-dom';
|
|
8
|
+
import { ChannelSwitcher } from './ChannelSwitcher.js';
|
|
9
|
+
import { BrandLogo } from "../BrandLogo.js";
|
|
10
|
+
import { LanguagesDropdown } from './LanguagesDropdown.js';
|
|
11
|
+
import { Notifications } from './Notifications.js';
|
|
12
|
+
import { NavigationFooter } from "./NavigationFooter.js";
|
|
13
|
+
const ResizablePanelGroup = ({ className, ...props }) => (_jsx(ResizablePrimitive.PanelGroup, { className: cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className), ...props }));
|
|
14
|
+
const ResizablePanel = ResizablePrimitive.Panel;
|
|
15
|
+
const ResizableHandle = ({ withHandle, className, ...props }) => (_jsx(ResizablePrimitive.PanelResizeHandle, { className: cn('bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90', className), ...props, children: withHandle && (_jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border", children: _jsx(GripVertical, { className: "size-2.5" }) })) }));
|
|
16
|
+
const removableCrumbs = ['draft', 'admin-ui'];
|
|
17
|
+
export const Menu = ({ children }) => {
|
|
18
|
+
const openGlobalSearch = useGlobalSearch((state) => state.open);
|
|
19
|
+
const linkPath = [];
|
|
20
|
+
const { t } = useTranslation('common');
|
|
21
|
+
const { topNavigationActionsMenu, topNavigationComponents } = usePluginStore();
|
|
22
|
+
const { logOut, theme, setTheme } = useSettings((p) => ({
|
|
23
|
+
logOut: p.logOut,
|
|
24
|
+
theme: p.theme,
|
|
25
|
+
setTheme: p.setTheme,
|
|
26
|
+
language: p.language,
|
|
27
|
+
setLanguage: p.setLanguage,
|
|
28
|
+
}));
|
|
29
|
+
const navigate = useNavigate();
|
|
30
|
+
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
31
|
+
const { activeAdministrator, setJobQueue } = useServer();
|
|
32
|
+
const rebuildSearchIndex = async () => {
|
|
33
|
+
await apiClient('mutation')({ reindex: { id: true, queueName: true, state: true } }).then(({ reindex: { queueName, state } }) => {
|
|
34
|
+
setJobQueue(queueName, state === 'RUNNING');
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const matches = useMatches();
|
|
38
|
+
const crumbs = useMemo(() => matches
|
|
39
|
+
.filter((match) => !!match.pathname)
|
|
40
|
+
.map((match) => match.pathname)
|
|
41
|
+
.flatMap((p) => p.split('/'))
|
|
42
|
+
.filter(Boolean)
|
|
43
|
+
.filter((crumb) => !removableCrumbs.includes(crumb)), [matches]);
|
|
44
|
+
return (_jsx("div", { className: "bg-muted/40 w-full border-r", children: _jsx("div", { className: "flex h-full max-h-screen flex-col gap-2", children: _jsx("div", { className: "flex-1", children: _jsx(TooltipProvider, { delayDuration: 100, children: _jsxs(ResizablePanelGroup, { onLayout: (sizes) => {
|
|
45
|
+
document.cookie = `react-resizable-panels:layout=${JSON.stringify(sizes)}`;
|
|
46
|
+
}, direction: "horizontal", className: "size-full", children: [_jsxs(ResizablePanel, { defaultSize: 18, collapsedSize: 4, collapsible: true, minSize: 10, maxSize: 20, onExpand: () => {
|
|
47
|
+
setIsCollapsed(false);
|
|
48
|
+
document.cookie = `react-resizable-panels:collapsed=${JSON.stringify(false)}`;
|
|
49
|
+
}, onCollapse: () => {
|
|
50
|
+
setIsCollapsed(true);
|
|
51
|
+
document.cookie = `react-resizable-panels:collapsed=${JSON.stringify(true)}`;
|
|
52
|
+
}, className: cn(isCollapsed && 'min-w-[50px] transition-all duration-300 ease-in-out'), children: [_jsx("div", { className: cn('flex h-[80px] flex-col items-center justify-center gap-4 border-b'), children: _jsx("div", { className: `flex h-full items-center justify-center ${!isCollapsed && 'w-full'} cursor-pointer p-4`, onClick: () => navigate(Routes.dashboard, { viewTransition: true }), children: _jsx(BrandLogo, { isCollapsed: isCollapsed }) }) }), _jsxs("div", { className: "flex h-[calc(100vh-80px)] flex-col justify-between", children: [_jsx(Navigation, { isCollapsed: isCollapsed }), _jsx(NavigationFooter, { isCollapsed: isCollapsed })] })] }), _jsx(ResizableHandle, { withHandle: true }), _jsxs(ResizablePanel, { children: [_jsxs("div", { className: "flex h-[70px] items-center border-b p-4 lg:h-[80px] lg:px-6", children: [_jsxs("div", { className: "flex flex-col items-start justify-center", children: [_jsx(Breadcrumb, { children: _jsx(BreadcrumbList, { children: crumbs.length ? (crumbs.map((c, i) => {
|
|
53
|
+
linkPath.push(c);
|
|
54
|
+
return (_jsxs(React.Fragment, { children: [_jsx(BreadcrumbItem, { children: _jsx(NavLink, { to: buildURL(linkPath), viewTransition: true, children: _jsx("p", { className: cn('text-md text-foreground font-bold capitalize'), children: i === 0 ? t('menu.' + dashToCamelCase(c)) : c }) }) }), i !== crumbs.length - 1 && (_jsx(BreadcrumbSeparator, { children: _jsx(Slash, { className: "text-muted-foreground" }) }))] }, c));
|
|
55
|
+
})) : (_jsx(BreadcrumbItem, { children: _jsx(NavLink, { to: Routes.dashboard, viewTransition: true, children: _jsx("p", { className: "text-foreground text-2xl font-bold", children: t('dashboard') }) }) })) }) }), _jsx("div", { className: "flex items-center gap-2" })] }), _jsxs("div", { className: "flex flex-1 items-center justify-end gap-2", children: [topNavigationComponents && topNavigationComponents.length > 0 ? (_jsx("div", { className: "flex items-center gap-2", children: topNavigationComponents.map(({ component: Component }, index) => (_jsx(Component, {}, index))) })) : null, _jsx(LanguagesDropdown, {}), _jsx(ChannelSwitcher, { className: "min-w-44" }), _jsx(Button, { onClick: openGlobalSearch, variant: "outline", size: "icon", className: "relative size-10", children: _jsx(SearchIcon, { className: "size-4" }) }), _jsx(Notifications, {}), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "icon", children: [theme === 'light' ? (_jsx(Sun, { className: "size-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" })) : theme === 'dark' ? (_jsx(Moon, { className: "absolute size-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })) : (_jsx(SunMoon, { className: "absolute size-[1.2rem] rotate-90 transition-all" })), _jsx("span", { className: "sr-only", children: t('toggleTheme') })] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuItem, { onClick: () => setTheme('light'), children: t('themeLight') }), _jsx(DropdownMenuItem, { onClick: () => setTheme('dark'), children: t('themeDark') }), _jsx(DropdownMenuItem, { onClick: () => setTheme('system'), children: t('themeSystem') })] })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", size: "icon", children: _jsx(MenuIcon, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { className: "z-[150] mr-6 min-w-40", children: [activeAdministrator?.emailAddress && (_jsxs(_Fragment, { children: [_jsxs(DropdownMenuLabel, { className: "flex items-center gap-2 px-3 py-2 font-medium ", children: [_jsx("div", { className: "flex size-5 items-center justify-center rounded-full bg-gray-100 text-xs text-gray-600", children: activeAdministrator.firstName.charAt(0).toUpperCase() }), _jsxs("div", { className: "truncate text-sm", children: [activeAdministrator.firstName, " ", activeAdministrator.lastName] })] }), _jsx(DropdownMenuSeparator, { className: "my-1" })] })), _jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-2 text-nowrap", onSelect: rebuildSearchIndex, children: [_jsx(RotateCwSquare, { className: "size-4" }), t('rebuildSerachIndex')] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuGroup, { children: _jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { children: t('fastLinks') }), _jsx(DropdownMenuPortal, { children: _jsxs(DropdownMenuSubContent, { children: [_jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-2 text-nowrap", onSelect: () => navigate(Routes.status, { viewTransition: true }), children: [_jsx(RotateCwSquare, { className: "size-4" }), t('systemStatus')] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-2 text-nowrap", onSelect: () => navigate(Routes.globalSettings, { viewTransition: true }), children: [_jsx(RotateCwSquare, { className: "size-4" }), t('globalSettings')] })] }) })] }) }), topNavigationActionsMenu?.length && topNavigationActionsMenu.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), topNavigationActionsMenu.map((action) => (_jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-2", onSelect: action.onClick, children: [action.icon && _jsx(action.icon, { className: "size-4" }), action.label] }, action.label)))] })) : null, _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-2 text-red-500", onSelect: async () => {
|
|
56
|
+
const result = await createDialog({
|
|
57
|
+
title: t('logOutConfirmation'),
|
|
58
|
+
description: t('logOutConfirmationDescription'),
|
|
59
|
+
buttons: [
|
|
60
|
+
{ label: t('cancel'), variant: 'secondary', returnValue: false },
|
|
61
|
+
{ label: t('logOut'), variant: 'destructive', returnValue: true },
|
|
62
|
+
],
|
|
63
|
+
});
|
|
64
|
+
if (result)
|
|
65
|
+
logOut();
|
|
66
|
+
}, children: [_jsx(LogOutIcon, { className: "size-4" }), t('logOut')] })] })] })] })] }), _jsx(ScrollArea, { className: "relative h-[calc(100vh-70px)] overflow-y-hidden lg:h-[calc(100vh-80px)]", children: children })] })] }) }) }) }) }));
|
|
67
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { productVariantTileSelector } from "./products";
|
|
2
|
+
import { Selector, SortOrder } from '@deenruv/admin-types';
|
|
3
|
+
export var ORDER_STATE;
|
|
4
|
+
(function (ORDER_STATE) {
|
|
5
|
+
ORDER_STATE["CREATED"] = "Created";
|
|
6
|
+
ORDER_STATE["DRAFT"] = "Draft";
|
|
7
|
+
ORDER_STATE["ADDING_ITEMS"] = "AddingItems";
|
|
8
|
+
ORDER_STATE["ARRANGING_PAYMENT"] = "ArrangingPayment";
|
|
9
|
+
ORDER_STATE["PAYMENT_AUTHORIZED"] = "PaymentAuthorized";
|
|
10
|
+
ORDER_STATE["PAYMENT_SETTLED"] = "PaymentSettled";
|
|
11
|
+
ORDER_STATE["PARTIALLY_SHIPPED"] = "PartiallyShipped";
|
|
12
|
+
ORDER_STATE["SHIPPED"] = "Shipped";
|
|
13
|
+
ORDER_STATE["PARTIALLY_DELIVERED"] = "PartiallyDelivered";
|
|
14
|
+
ORDER_STATE["DELIVERED"] = "Delivered";
|
|
15
|
+
ORDER_STATE["MODIFYING"] = "Modifying";
|
|
16
|
+
ORDER_STATE["ARRANGING_ADDITIONAL_PAYMENT"] = "ArrangingAdditionalPayment";
|
|
17
|
+
ORDER_STATE["CANCELLED"] = "Cancelled";
|
|
18
|
+
})(ORDER_STATE || (ORDER_STATE = {}));
|
|
19
|
+
export var PAYMENT_STATE;
|
|
20
|
+
(function (PAYMENT_STATE) {
|
|
21
|
+
PAYMENT_STATE["AUTHORIZED"] = "Authorized";
|
|
22
|
+
PAYMENT_STATE["SETTLED"] = "Settled";
|
|
23
|
+
PAYMENT_STATE["CANCELLED"] = "Cancelled";
|
|
24
|
+
})(PAYMENT_STATE || (PAYMENT_STATE = {}));
|
|
25
|
+
export var ORDER_TYPE;
|
|
26
|
+
(function (ORDER_TYPE) {
|
|
27
|
+
ORDER_TYPE["REGULAR"] = "Regular";
|
|
28
|
+
ORDER_TYPE["AGGREGATE"] = "Aggregate";
|
|
29
|
+
ORDER_TYPE["SELLER"] = "Seller";
|
|
30
|
+
})(ORDER_TYPE || (ORDER_TYPE = {}));
|
|
31
|
+
export const assetsSelector = Selector('Asset')({
|
|
32
|
+
id: true,
|
|
33
|
+
createdAt: true,
|
|
34
|
+
fileSize: true,
|
|
35
|
+
focalPoint: { x: true, y: true },
|
|
36
|
+
width: true,
|
|
37
|
+
height: true,
|
|
38
|
+
mimeType: true,
|
|
39
|
+
preview: true,
|
|
40
|
+
source: true,
|
|
41
|
+
name: true,
|
|
42
|
+
tags: { id: true, value: true },
|
|
43
|
+
type: true,
|
|
44
|
+
updatedAt: true,
|
|
45
|
+
});
|
|
46
|
+
export const AvailableCountriesSelector = Selector('Country')({
|
|
47
|
+
code: true,
|
|
48
|
+
name: true,
|
|
49
|
+
languageCode: true,
|
|
50
|
+
});
|
|
51
|
+
export const OrderAddressSelector = Selector('OrderAddress')({
|
|
52
|
+
fullName: true,
|
|
53
|
+
company: true,
|
|
54
|
+
streetLine1: true,
|
|
55
|
+
streetLine2: true,
|
|
56
|
+
city: true,
|
|
57
|
+
province: true,
|
|
58
|
+
postalCode: true,
|
|
59
|
+
phoneNumber: true,
|
|
60
|
+
});
|
|
61
|
+
export const ActiveAddressSelector = Selector('Address')({
|
|
62
|
+
...OrderAddressSelector,
|
|
63
|
+
id: true,
|
|
64
|
+
country: AvailableCountriesSelector,
|
|
65
|
+
defaultShippingAddress: true,
|
|
66
|
+
defaultBillingAddress: true,
|
|
67
|
+
});
|
|
68
|
+
export const CurrentUserSelector = Selector('CurrentUser')({
|
|
69
|
+
id: true,
|
|
70
|
+
identifier: true,
|
|
71
|
+
});
|
|
72
|
+
export const ActiveCustomerSelector = Selector('Customer')({
|
|
73
|
+
id: true,
|
|
74
|
+
lastName: true,
|
|
75
|
+
firstName: true,
|
|
76
|
+
emailAddress: true,
|
|
77
|
+
phoneNumber: true,
|
|
78
|
+
addresses: ActiveAddressSelector,
|
|
79
|
+
user: CurrentUserSelector,
|
|
80
|
+
});
|
|
81
|
+
export const homePageSlidersSelector = Selector('Collection')({
|
|
82
|
+
name: true,
|
|
83
|
+
slug: true,
|
|
84
|
+
parent: { slug: true },
|
|
85
|
+
productVariants: [
|
|
86
|
+
{ options: { take: 8, sort: { priceWithTax: SortOrder.DESC } } },
|
|
87
|
+
{
|
|
88
|
+
totalItems: true,
|
|
89
|
+
items: productVariantTileSelector,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
});
|
|
93
|
+
export const AdminSettingsSelector = Selector('GlobalSettings')({
|
|
94
|
+
availableLanguages: true,
|
|
95
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Selector } from '@deenruv/admin-types';
|
|
2
|
+
export const CollectionListSelector = Selector('Collection')({
|
|
3
|
+
id: true,
|
|
4
|
+
createdAt: true,
|
|
5
|
+
updatedAt: true,
|
|
6
|
+
position: true,
|
|
7
|
+
name: true,
|
|
8
|
+
breadcrumbs: { name: true, slug: true },
|
|
9
|
+
slug: true,
|
|
10
|
+
description: true,
|
|
11
|
+
isPrivate: true,
|
|
12
|
+
featuredAsset: { __typename: true, preview: true },
|
|
13
|
+
productVariants: [{}, { totalItems: true }],
|
|
14
|
+
parentId: true,
|
|
15
|
+
children: {
|
|
16
|
+
id: true,
|
|
17
|
+
createdAt: true,
|
|
18
|
+
updatedAt: true,
|
|
19
|
+
position: true,
|
|
20
|
+
name: true,
|
|
21
|
+
slug: true,
|
|
22
|
+
description: true,
|
|
23
|
+
isPrivate: true,
|
|
24
|
+
parentId: true,
|
|
25
|
+
featuredAsset: { __typename: true, preview: true },
|
|
26
|
+
productVariants: [{}, { totalItems: true }],
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const CollectionProductVariantsSelector = Selector('ProductVariant')({
|
|
30
|
+
featuredAsset: { preview: true },
|
|
31
|
+
id: true,
|
|
32
|
+
name: true,
|
|
33
|
+
// productId: true,
|
|
34
|
+
product: { name: true, id: true },
|
|
35
|
+
sku: true,
|
|
36
|
+
stockAllocated: true,
|
|
37
|
+
});
|
|
38
|
+
export const CollectionTileProductVariantSelector = Selector('ProductVariant')({
|
|
39
|
+
id: true,
|
|
40
|
+
featuredAsset: { preview: true },
|
|
41
|
+
priceWithTax: true,
|
|
42
|
+
currencyCode: true,
|
|
43
|
+
name: true,
|
|
44
|
+
product: { name: true, slug: true, featuredAsset: { preview: true } },
|
|
45
|
+
});
|
|
46
|
+
export const CollectionTileSelector = Selector('Collection')({
|
|
47
|
+
name: true,
|
|
48
|
+
id: true,
|
|
49
|
+
slug: true,
|
|
50
|
+
parentId: true,
|
|
51
|
+
parent: { slug: true },
|
|
52
|
+
description: true,
|
|
53
|
+
featuredAsset: {
|
|
54
|
+
preview: true,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
export const CollectionDetailsSelector = Selector('Collection')({
|
|
58
|
+
id: true,
|
|
59
|
+
translations: {
|
|
60
|
+
description: true,
|
|
61
|
+
name: true,
|
|
62
|
+
slug: true,
|
|
63
|
+
id: true,
|
|
64
|
+
languageCode: true,
|
|
65
|
+
},
|
|
66
|
+
assets: {
|
|
67
|
+
id: true,
|
|
68
|
+
},
|
|
69
|
+
filters: {
|
|
70
|
+
code: true,
|
|
71
|
+
args: {
|
|
72
|
+
name: true,
|
|
73
|
+
value: true,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
createdAt: true,
|
|
77
|
+
updatedAt: true,
|
|
78
|
+
name: true,
|
|
79
|
+
isPrivate: true,
|
|
80
|
+
slug: true,
|
|
81
|
+
description: true,
|
|
82
|
+
inheritFilters: true,
|
|
83
|
+
featuredAsset: {
|
|
84
|
+
id: true,
|
|
85
|
+
preview: true,
|
|
86
|
+
},
|
|
87
|
+
parent: { slug: true, name: true },
|
|
88
|
+
children: {
|
|
89
|
+
id: true,
|
|
90
|
+
name: true,
|
|
91
|
+
slug: true,
|
|
92
|
+
featuredAsset: { preview: true },
|
|
93
|
+
},
|
|
94
|
+
});
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { Selector } from '@deenruv/admin-types';
|
|
2
|
+
import { paymentSelector } from './orders.js';
|
|
3
|
+
import { OrderDetailSelector } from '@deenruv/react-ui-devkit';
|
|
4
|
+
export const eligibleShippingMethodsSelector = Selector('ShippingMethodQuote')({
|
|
5
|
+
id: true,
|
|
6
|
+
description: true,
|
|
7
|
+
name: true,
|
|
8
|
+
code: true,
|
|
9
|
+
price: true,
|
|
10
|
+
priceWithTax: true,
|
|
11
|
+
});
|
|
12
|
+
export const addressBaseSelector = Selector('Address')({
|
|
13
|
+
city: true,
|
|
14
|
+
company: true,
|
|
15
|
+
fullName: true,
|
|
16
|
+
phoneNumber: true,
|
|
17
|
+
postalCode: true,
|
|
18
|
+
province: true,
|
|
19
|
+
streetLine1: true,
|
|
20
|
+
streetLine2: true,
|
|
21
|
+
});
|
|
22
|
+
export const searchProductVariantSelector = Selector('SearchResult')({
|
|
23
|
+
sku: true,
|
|
24
|
+
productAsset: { id: true, preview: true, focalPoint: { x: true, y: true } },
|
|
25
|
+
currencyCode: true,
|
|
26
|
+
price: { __typename: true, '...on PriceRange': { max: true, min: true }, '...on SinglePrice': { value: true } },
|
|
27
|
+
priceWithTax: {
|
|
28
|
+
__typename: true,
|
|
29
|
+
'...on PriceRange': { max: true, min: true },
|
|
30
|
+
'...on SinglePrice': { value: true },
|
|
31
|
+
},
|
|
32
|
+
productName: true,
|
|
33
|
+
productVariantName: true,
|
|
34
|
+
productVariantId: true,
|
|
35
|
+
});
|
|
36
|
+
export const productVariantSelector = Selector('ProductVariant')({
|
|
37
|
+
id: true,
|
|
38
|
+
featuredAsset: { preview: true, id: true },
|
|
39
|
+
sku: true,
|
|
40
|
+
productId: true,
|
|
41
|
+
product: { name: true, id: true, slug: true, featuredAsset: { preview: true } },
|
|
42
|
+
currencyCode: true,
|
|
43
|
+
price: true,
|
|
44
|
+
priceWithTax: true,
|
|
45
|
+
name: true,
|
|
46
|
+
stockLevels: { stockOnHand: true },
|
|
47
|
+
});
|
|
48
|
+
export const draftOrderLineSelector = Selector('OrderLine')({
|
|
49
|
+
id: true,
|
|
50
|
+
quantity: true,
|
|
51
|
+
discountedLinePrice: true,
|
|
52
|
+
discountedLinePriceWithTax: true,
|
|
53
|
+
productVariant: productVariantSelector,
|
|
54
|
+
linePrice: true,
|
|
55
|
+
linePriceWithTax: true,
|
|
56
|
+
unitPrice: true,
|
|
57
|
+
unitPriceWithTax: true,
|
|
58
|
+
discountedUnitPrice: true,
|
|
59
|
+
discountedUnitPriceWithTax: true,
|
|
60
|
+
taxRate: true,
|
|
61
|
+
});
|
|
62
|
+
export const draftOrderSelector = Selector('Order')({
|
|
63
|
+
id: true,
|
|
64
|
+
createdAt: true,
|
|
65
|
+
updatedAt: true,
|
|
66
|
+
currencyCode: true,
|
|
67
|
+
code: true,
|
|
68
|
+
state: true,
|
|
69
|
+
total: true,
|
|
70
|
+
totalWithTax: true,
|
|
71
|
+
shipping: true,
|
|
72
|
+
nextStates: true,
|
|
73
|
+
subTotalWithTax: true,
|
|
74
|
+
surcharges: {
|
|
75
|
+
priceWithTax: true,
|
|
76
|
+
sku: true,
|
|
77
|
+
createdAt: true,
|
|
78
|
+
description: true,
|
|
79
|
+
price: true,
|
|
80
|
+
taxRate: true,
|
|
81
|
+
},
|
|
82
|
+
couponCodes: true,
|
|
83
|
+
excludedPromotionIds: true,
|
|
84
|
+
promotions: {
|
|
85
|
+
id: true,
|
|
86
|
+
name: true,
|
|
87
|
+
couponCode: true,
|
|
88
|
+
},
|
|
89
|
+
discounts: {
|
|
90
|
+
amount: true,
|
|
91
|
+
description: true,
|
|
92
|
+
adjustmentSource: true,
|
|
93
|
+
amountWithTax: true,
|
|
94
|
+
type: true,
|
|
95
|
+
},
|
|
96
|
+
modifications: { id: true, note: true },
|
|
97
|
+
fulfillments: {
|
|
98
|
+
id: true,
|
|
99
|
+
createdAt: true,
|
|
100
|
+
updatedAt: true,
|
|
101
|
+
method: true,
|
|
102
|
+
nextStates: true,
|
|
103
|
+
state: true,
|
|
104
|
+
summary: { fulfillmentId: true, orderLineId: true, quantity: true },
|
|
105
|
+
trackingCode: true,
|
|
106
|
+
},
|
|
107
|
+
taxSummary: {
|
|
108
|
+
description: true,
|
|
109
|
+
taxBase: true,
|
|
110
|
+
taxRate: true,
|
|
111
|
+
taxTotal: true,
|
|
112
|
+
},
|
|
113
|
+
shippingLines: {
|
|
114
|
+
id: true,
|
|
115
|
+
price: true,
|
|
116
|
+
priceWithTax: true,
|
|
117
|
+
discountedPrice: true,
|
|
118
|
+
discountedPriceWithTax: true,
|
|
119
|
+
shippingMethod: {
|
|
120
|
+
id: true,
|
|
121
|
+
name: true,
|
|
122
|
+
code: true,
|
|
123
|
+
fulfillmentHandlerCode: true,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
billingAddress: {
|
|
127
|
+
countryCode: true,
|
|
128
|
+
country: true,
|
|
129
|
+
...addressBaseSelector,
|
|
130
|
+
},
|
|
131
|
+
shippingAddress: {
|
|
132
|
+
countryCode: true,
|
|
133
|
+
country: true,
|
|
134
|
+
...addressBaseSelector,
|
|
135
|
+
},
|
|
136
|
+
customer: {
|
|
137
|
+
id: true,
|
|
138
|
+
title: true,
|
|
139
|
+
firstName: true,
|
|
140
|
+
lastName: true,
|
|
141
|
+
phoneNumber: true,
|
|
142
|
+
emailAddress: true,
|
|
143
|
+
addresses: {
|
|
144
|
+
id: true,
|
|
145
|
+
defaultBillingAddress: true,
|
|
146
|
+
defaultShippingAddress: true,
|
|
147
|
+
country: { code: true, name: true },
|
|
148
|
+
...addressBaseSelector,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
lines: draftOrderLineSelector,
|
|
152
|
+
payments: paymentSelector,
|
|
153
|
+
});
|
|
154
|
+
export const modifyOrderSelector = Selector('ModifyOrderResult')({
|
|
155
|
+
__typename: true,
|
|
156
|
+
'...on Order': draftOrderSelector,
|
|
157
|
+
'...on CouponCodeExpiredError': {
|
|
158
|
+
errorCode: true,
|
|
159
|
+
message: true,
|
|
160
|
+
},
|
|
161
|
+
'...on CouponCodeInvalidError': {
|
|
162
|
+
couponCode: true,
|
|
163
|
+
errorCode: true,
|
|
164
|
+
message: true,
|
|
165
|
+
},
|
|
166
|
+
'...on CouponCodeLimitError': {
|
|
167
|
+
couponCode: true,
|
|
168
|
+
limit: true,
|
|
169
|
+
errorCode: true,
|
|
170
|
+
message: true,
|
|
171
|
+
},
|
|
172
|
+
'...on InsufficientStockError': {
|
|
173
|
+
order: draftOrderSelector,
|
|
174
|
+
quantityAvailable: true,
|
|
175
|
+
errorCode: true,
|
|
176
|
+
message: true,
|
|
177
|
+
},
|
|
178
|
+
'...on NegativeQuantityError': {
|
|
179
|
+
errorCode: true,
|
|
180
|
+
message: true,
|
|
181
|
+
},
|
|
182
|
+
'...on NoChangesSpecifiedError': {
|
|
183
|
+
errorCode: true,
|
|
184
|
+
message: true,
|
|
185
|
+
},
|
|
186
|
+
'...on OrderLimitError': {
|
|
187
|
+
maxItems: true,
|
|
188
|
+
errorCode: true,
|
|
189
|
+
message: true,
|
|
190
|
+
},
|
|
191
|
+
'...on OrderModificationStateError': {
|
|
192
|
+
errorCode: true,
|
|
193
|
+
message: true,
|
|
194
|
+
},
|
|
195
|
+
'...on PaymentMethodMissingError': {
|
|
196
|
+
errorCode: true,
|
|
197
|
+
message: true,
|
|
198
|
+
},
|
|
199
|
+
'...on RefundPaymentIdMissingError': {
|
|
200
|
+
errorCode: true,
|
|
201
|
+
message: true,
|
|
202
|
+
},
|
|
203
|
+
'...on IneligibleShippingMethodError': {
|
|
204
|
+
errorCode: true,
|
|
205
|
+
message: true,
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
export const updateOrderItemsSelector = Selector('UpdateOrderItemsResult')({
|
|
209
|
+
__typename: true,
|
|
210
|
+
'...on Order': OrderDetailSelector,
|
|
211
|
+
'...on InsufficientStockError': {
|
|
212
|
+
errorCode: true,
|
|
213
|
+
message: true,
|
|
214
|
+
order: OrderDetailSelector,
|
|
215
|
+
quantityAvailable: true,
|
|
216
|
+
},
|
|
217
|
+
'...on NegativeQuantityError': {
|
|
218
|
+
errorCode: true,
|
|
219
|
+
message: true,
|
|
220
|
+
},
|
|
221
|
+
'...on OrderLimitError': {
|
|
222
|
+
errorCode: true,
|
|
223
|
+
message: true,
|
|
224
|
+
maxItems: true,
|
|
225
|
+
},
|
|
226
|
+
'...on OrderModificationError': {
|
|
227
|
+
errorCode: true,
|
|
228
|
+
message: true,
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
export const updatedDraftOrderSelector = Selector('UpdateOrderItemsResult')({
|
|
232
|
+
__typename: true,
|
|
233
|
+
'...on Order': OrderDetailSelector,
|
|
234
|
+
'...on InsufficientStockError': {
|
|
235
|
+
errorCode: true,
|
|
236
|
+
message: true,
|
|
237
|
+
order: OrderDetailSelector,
|
|
238
|
+
quantityAvailable: true,
|
|
239
|
+
},
|
|
240
|
+
'...on NegativeQuantityError': {
|
|
241
|
+
errorCode: true,
|
|
242
|
+
message: true,
|
|
243
|
+
},
|
|
244
|
+
'...on OrderLimitError': {
|
|
245
|
+
errorCode: true,
|
|
246
|
+
message: true,
|
|
247
|
+
maxItems: true,
|
|
248
|
+
},
|
|
249
|
+
'...on OrderModificationError': {
|
|
250
|
+
errorCode: true,
|
|
251
|
+
message: true,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
export const removeOrderItemsResultSelector = Selector('RemoveOrderItemsResult')({
|
|
255
|
+
__typename: true,
|
|
256
|
+
'...on Order': OrderDetailSelector,
|
|
257
|
+
'...on OrderModificationError': {
|
|
258
|
+
errorCode: true,
|
|
259
|
+
message: true,
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
export const orderHistoryEntrySelector = Selector('HistoryEntry')({
|
|
263
|
+
id: true,
|
|
264
|
+
administrator: { id: true, firstName: true, lastName: true },
|
|
265
|
+
isPublic: true,
|
|
266
|
+
type: true,
|
|
267
|
+
data: true,
|
|
268
|
+
createdAt: true,
|
|
269
|
+
updatedAt: true,
|
|
270
|
+
});
|
|
271
|
+
export const addFulfillmentToOrderResultSelector = Selector('AddFulfillmentToOrderResult')({
|
|
272
|
+
__typename: true,
|
|
273
|
+
'...on Fulfillment': {
|
|
274
|
+
id: true,
|
|
275
|
+
},
|
|
276
|
+
'...on CreateFulfillmentError': {
|
|
277
|
+
message: true,
|
|
278
|
+
errorCode: true,
|
|
279
|
+
fulfillmentHandlerError: true,
|
|
280
|
+
},
|
|
281
|
+
'...on EmptyOrderLineSelectionError': {
|
|
282
|
+
message: true,
|
|
283
|
+
errorCode: true,
|
|
284
|
+
},
|
|
285
|
+
'...on FulfillmentStateTransitionError': {
|
|
286
|
+
errorCode: true,
|
|
287
|
+
fromState: true,
|
|
288
|
+
message: true,
|
|
289
|
+
toState: true,
|
|
290
|
+
transitionError: true,
|
|
291
|
+
},
|
|
292
|
+
'...on InsufficientStockOnHandError': {
|
|
293
|
+
errorCode: true,
|
|
294
|
+
message: true,
|
|
295
|
+
productVariantId: true,
|
|
296
|
+
productVariantName: true,
|
|
297
|
+
stockOnHand: true,
|
|
298
|
+
},
|
|
299
|
+
'...on InvalidFulfillmentHandlerError': {
|
|
300
|
+
message: true,
|
|
301
|
+
errorCode: true,
|
|
302
|
+
},
|
|
303
|
+
'...on ItemsAlreadyFulfilledError': {
|
|
304
|
+
message: true,
|
|
305
|
+
errorCode: true,
|
|
306
|
+
},
|
|
307
|
+
});
|