@mercurjs/admin 2.2.0-canary.35 → 2.2.0-canary.36
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/dist/{add-campaign-promotions-FBS4ELIA.js → add-campaign-promotions-OTLO4M5C.js} +3 -3
- package/dist/{campaign-detail-HMU2FMJL.js → campaign-detail-GZV2HK2G.js} +4 -4
- package/dist/{category-detail-PMNXMTV3.js → category-detail-AYVW7LRB.js} +2 -2
- package/dist/{category-products-YMPKVXV4.js → category-products-IF33PO5Y.js} +2 -2
- package/dist/{chunk-VTHMDGGJ.js → chunk-4X4MNAXL.js} +1 -1
- package/dist/{chunk-TJ5IONZX.js → chunk-5YWQDIVG.js} +2 -1
- package/dist/{chunk-IUOZZMSQ.js → chunk-BW5MMF6W.js} +1 -1
- package/dist/{chunk-JHL6ZNJW.js → chunk-CA4K6JDJ.js} +1 -1
- package/dist/{chunk-NDIVJLA3.js → chunk-DP3OBKUP.js} +35 -3
- package/dist/{chunk-LNOZHSZV.js → chunk-EMW5WXXR.js} +1 -1
- package/dist/chunk-FU3QYH6H.js +111 -0
- package/dist/{chunk-CBKKZYGU.js → chunk-GJB4UQZI.js} +1 -1
- package/dist/{chunk-TUPWRX62.js → chunk-GML7DINQ.js} +1 -1
- package/dist/{chunk-PVZBDWLK.js → chunk-GRH7C3QN.js} +1 -1
- package/dist/{chunk-CASK2IOQ.js → chunk-HMKXCYCJ.js} +29 -10
- package/dist/{chunk-HOUYHVRG.js → chunk-IHERG3JP.js} +10 -4
- package/dist/{chunk-ISSZIRBL.js → chunk-LRKN7IQH.js} +1 -1
- package/dist/{chunk-RHFFLVYG.js → chunk-MHCIHDGF.js} +1 -1
- package/dist/{chunk-23R7IMRV.js → chunk-MTOPGOKU.js} +1 -1
- package/dist/{chunk-SU444Q24.js → chunk-O53E5U52.js} +0 -21
- package/dist/{chunk-DPFGN6S6.js → chunk-OB5RWOGA.js} +1 -1
- package/dist/{chunk-4ZXFOBOB.js → chunk-OLAOEVZE.js} +1 -1
- package/dist/{chunk-JDMYGQRU.js → chunk-PPMWEQP3.js} +9 -113
- package/dist/{chunk-PH24SLKA.js → chunk-PQAQM6SB.js} +1 -1
- package/dist/{chunk-TFDRETCH.js → chunk-R6DVBI5F.js} +18 -22
- package/dist/{chunk-UULZCRTC.js → chunk-RZ43M34Q.js} +1 -1
- package/dist/{chunk-KW5DS5GL.js → chunk-TYXSRH47.js} +1 -1
- package/dist/{chunk-7WUQR3ZU.js → chunk-U725ING6.js} +1 -1
- package/dist/{chunk-C45OXCZW.js → chunk-YRGPQ2C4.js} +29 -2
- package/dist/{chunk-XBD7UZZX.js → chunk-ZMSQW2M3.js} +1 -1
- package/dist/{collection-add-products-E7YLYPY5.js → collection-add-products-2G37ZL2J.js} +1 -1
- package/dist/{collection-detail-M4ETYKBU.js → collection-detail-PMSYCWE3.js} +2 -2
- package/dist/{collection-list-RSFOKJBX.js → collection-list-EK2TBM3J.js} +1 -1
- package/dist/{customer-detail-QH4IXPIR.js → customer-detail-ZYJDB47Y.js} +2 -1
- package/dist/{customer-group-add-customers-EOS25HL4.js → customer-group-add-customers-GSEUGBTJ.js} +1 -1
- package/dist/{customer-group-detail-XQOG6SZY.js → customer-group-detail-5VSUJTR3.js} +2 -2
- package/dist/{customer-list-ELN5NIKN.js → customer-list-6PRFTWMO.js} +2 -2
- package/dist/{customers-add-customer-group-PJ24V5YA.js → customers-add-customer-group-56GS7TR7.js} +3 -2
- package/dist/index.js +52 -52
- package/dist/{order-edit-billing-address-RN32LNJH.js → order-edit-billing-address-WQYQSLDB.js} +1 -1
- package/dist/{order-list-ASX7QDPT.js → order-list-FFPY5OGR.js} +3 -2
- package/dist/pages/index.js +25 -24
- package/dist/{price-list-create-TDPYBF7D.js → price-list-create-QEDMB4A6.js} +2 -2
- package/dist/{price-list-detail-U5LPEFWH.js → price-list-detail-7ANY3XOC.js} +2 -2
- package/dist/{price-list-prices-add-J4GDJTQY.js → price-list-prices-add-GVOZDWKE.js} +2 -2
- package/dist/{product-create-OSG3NREE.js → product-create-STXNKMAV.js} +3 -3
- package/dist/{product-edit-attribute-RE6L525Z.js → product-edit-attribute-BSPIDAZJ.js} +4 -27
- package/dist/{product-list-PQ3UMA2U.js → product-list-SIQDX4AT.js} +2 -2
- package/dist/{product-media-7HLOXWZZ.js → product-media-JFLRNBPR.js} +2 -2
- package/dist/{product-organization-XHIT5HXK.js → product-organization-SGLOMAKK.js} +1 -1
- package/dist/{product-tag-detail-W3NUBZ6N.js → product-tag-detail-ZV7V7UW3.js} +3 -3
- package/dist/{product-tag-list-4KNHKDAV.js → product-tag-list-SZHBD5FA.js} +2 -2
- package/dist/{product-type-detail-GNCVQKQU.js → product-type-detail-WSHUE56F.js} +2 -2
- package/dist/{promotion-detail-7V235FES.js → promotion-detail-AWVF7JHY.js} +3 -3
- package/dist/{promotion-list-LKK3V2CK.js → promotion-list-INBZ3OG3.js} +4 -4
- package/dist/{refund-reason-list-AC3RCTYI.js → refund-reason-list-UCZC5ASP.js} +2 -2
- package/dist/{reset-password-R6KN32M2.js → reset-password-ZJW3AHYT.js} +1 -1
- package/dist/{return-reason-list-KRLDNVBC.js → return-reason-list-AJ4E3A56.js} +2 -2
- package/dist/{sales-channel-add-products-HFS7S4XB.js → sales-channel-add-products-LRANEISZ.js} +1 -1
- package/dist/{sales-channel-detail-SZVBKHKH.js → sales-channel-detail-5XXO3BXP.js} +2 -2
- package/dist/{store-details-5JNTBHRP.js → store-details-XNBFIWDL.js} +3 -3
- package/dist/{store-edit-KUNXCGSI.js → store-edit-6KKEQZRH.js} +2 -2
- package/dist/{store-list-ISPAQ4U3.js → store-list-RVZG3UD3.js} +1 -1
- package/dist/{tax-region-create-E63FR7XD.js → tax-region-create-GAXLHDV5.js} +1 -1
- package/dist/{tax-region-tax-override-create-K6EV53SE.js → tax-region-tax-override-create-XOBU6DOL.js} +3 -3
- package/dist/{tax-region-tax-override-edit-A5UDUAMZ.js → tax-region-tax-override-edit-PEQJFCOU.js} +3 -3
- package/package.json +6 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePromotionTableColumns,
|
|
3
3
|
usePromotionTableQuery
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PQAQM6SB.js";
|
|
5
5
|
import {
|
|
6
6
|
usePromotionTableFilters
|
|
7
7
|
} from "./chunk-S2WEYEQR.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-OB5RWOGA.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-IHERG3JP.js";
|
|
14
14
|
import "./chunk-TKGWSUEI.js";
|
|
15
15
|
import {
|
|
16
16
|
KeyboundForm
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAMPAIGN_DETAIL_FIELDS,
|
|
3
3
|
CampaignDetailPage
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MTOPGOKU.js";
|
|
5
|
+
import "./chunk-PQAQM6SB.js";
|
|
6
6
|
import "./chunk-S2WEYEQR.js";
|
|
7
7
|
import "./chunk-RK5N3XIX.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-OB5RWOGA.js";
|
|
9
9
|
import "./chunk-JHIMVLB2.js";
|
|
10
10
|
import "./chunk-FMFVTERD.js";
|
|
11
11
|
import "./chunk-DB6ANJBO.js";
|
|
12
12
|
import "./chunk-PHOCVOZ5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-IHERG3JP.js";
|
|
14
14
|
import "./chunk-IQPN4PZJ.js";
|
|
15
15
|
import "./chunk-E74OUNA3.js";
|
|
16
16
|
import "./chunk-FQERBIVS.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CategoryDetailPage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DP3OBKUP.js";
|
|
4
4
|
import "./chunk-7AV5EJJ5.js";
|
|
5
5
|
import "./chunk-CW3HYGS5.js";
|
|
6
6
|
import "./chunk-Y456KVIN.js";
|
|
7
7
|
import "./chunk-LECZPR6R.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-O53E5U52.js";
|
|
9
9
|
import "./chunk-WBSUHLO7.js";
|
|
10
10
|
import "./chunk-P4LTLPTK.js";
|
|
11
11
|
import "./chunk-FWPGOIFA.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useProductTableColumns
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O53E5U52.js";
|
|
4
4
|
import "./chunk-WBSUHLO7.js";
|
|
5
5
|
import {
|
|
6
6
|
useProductTableFilters
|
|
@@ -215,7 +215,7 @@ var EditCategoryProductsForm = ({
|
|
|
215
215
|
var columnHelper = createColumnHelper();
|
|
216
216
|
var useColumns = () => {
|
|
217
217
|
const { t } = useTranslation();
|
|
218
|
-
const base = useProductTableColumns()
|
|
218
|
+
const base = useProductTableColumns();
|
|
219
219
|
return useMemo(
|
|
220
220
|
() => [
|
|
221
221
|
columnHelper.display({
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-HGTPUAHD.js";
|
|
7
7
|
import {
|
|
8
8
|
useCustomerTableQuery
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GRH7C3QN.js";
|
|
10
10
|
import {
|
|
11
11
|
_DataTable,
|
|
12
12
|
useDataTable
|
|
@@ -98,6 +98,7 @@ var CustomerListDataTable = () => {
|
|
|
98
98
|
{ key: "created_at", label: t("fields.createdAt") },
|
|
99
99
|
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
100
100
|
],
|
|
101
|
+
defaultOrder: "-created_at",
|
|
101
102
|
isLoading,
|
|
102
103
|
navigateTo: (row) => row.original.id,
|
|
103
104
|
search: true,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-LECZPR6R.js";
|
|
17
17
|
import {
|
|
18
18
|
useProductTableColumns
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-O53E5U52.js";
|
|
20
20
|
import {
|
|
21
21
|
useProductTableFilters
|
|
22
22
|
} from "./chunk-P4LTLPTK.js";
|
|
@@ -381,6 +381,7 @@ var ChildrenDisplay = ({
|
|
|
381
381
|
// src/pages/categories/category-detail/components/category-product-section/category-product-section.tsx
|
|
382
382
|
import { ExclamationCircle, PlusMini } from "@medusajs/icons";
|
|
383
383
|
import {
|
|
384
|
+
Checkbox,
|
|
384
385
|
CommandBar,
|
|
385
386
|
Container as Container5,
|
|
386
387
|
Heading as Heading5,
|
|
@@ -389,7 +390,8 @@ import {
|
|
|
389
390
|
usePrompt
|
|
390
391
|
} from "@medusajs/ui";
|
|
391
392
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
392
|
-
import {
|
|
393
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
394
|
+
import { useMemo as useMemo2, useState as useState2 } from "react";
|
|
393
395
|
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
394
396
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
395
397
|
var PAGE_SIZE = 10;
|
|
@@ -409,7 +411,7 @@ var CategoryProductSection = ({
|
|
|
409
411
|
placeholderData: keepPreviousData
|
|
410
412
|
}
|
|
411
413
|
);
|
|
412
|
-
const columns =
|
|
414
|
+
const columns = useColumns();
|
|
413
415
|
const filters = useProductTableFilters(["categories"]);
|
|
414
416
|
const { table } = useDataTable({
|
|
415
417
|
data: products || [],
|
|
@@ -520,6 +522,36 @@ var CategoryProductSection = ({
|
|
|
520
522
|
] }) })
|
|
521
523
|
] });
|
|
522
524
|
};
|
|
525
|
+
var columnHelper = createColumnHelper();
|
|
526
|
+
var useColumns = () => {
|
|
527
|
+
const base = useProductTableColumns();
|
|
528
|
+
return useMemo2(
|
|
529
|
+
() => [
|
|
530
|
+
columnHelper.display({
|
|
531
|
+
id: "select",
|
|
532
|
+
header: ({ table }) => /* @__PURE__ */ jsx5(
|
|
533
|
+
Checkbox,
|
|
534
|
+
{
|
|
535
|
+
checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
|
|
536
|
+
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
537
|
+
"data-testid": "products-table-header-select-checkbox"
|
|
538
|
+
}
|
|
539
|
+
),
|
|
540
|
+
cell: ({ row }) => /* @__PURE__ */ jsx5(
|
|
541
|
+
Checkbox,
|
|
542
|
+
{
|
|
543
|
+
checked: row.getIsSelected(),
|
|
544
|
+
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
545
|
+
onClick: (e) => e.stopPropagation(),
|
|
546
|
+
"data-testid": `products-table-cell-${row.id}-select-checkbox`
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
}),
|
|
550
|
+
...base
|
|
551
|
+
],
|
|
552
|
+
[base]
|
|
553
|
+
);
|
|
554
|
+
};
|
|
523
555
|
|
|
524
556
|
// src/pages/categories/category-detail/category-detail.tsx
|
|
525
557
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useSellers
|
|
3
|
+
} from "./chunk-NS3GQ2J6.js";
|
|
4
|
+
import {
|
|
5
|
+
useCustomers
|
|
6
|
+
} from "./chunk-RGS5ZOY7.js";
|
|
7
|
+
import {
|
|
8
|
+
useSalesChannels
|
|
9
|
+
} from "./chunk-MW47LDBT.js";
|
|
10
|
+
|
|
11
|
+
// src/pages/orders/order-list/components/order-list-table/use-order-table-filters.tsx
|
|
12
|
+
import { useMemo } from "react";
|
|
13
|
+
import { useTranslation } from "react-i18next";
|
|
14
|
+
var useOrderGroupTableFilters = () => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const { customers } = useCustomers({
|
|
17
|
+
limit: 1e3,
|
|
18
|
+
fields: "id,first_name,last_name,email"
|
|
19
|
+
});
|
|
20
|
+
const { sellers } = useSellers({
|
|
21
|
+
limit: 1e3,
|
|
22
|
+
fields: "id,name"
|
|
23
|
+
});
|
|
24
|
+
const { sales_channels } = useSalesChannels({
|
|
25
|
+
limit: 1e3,
|
|
26
|
+
fields: "id,name"
|
|
27
|
+
});
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
const filters = [];
|
|
30
|
+
if (customers?.length) {
|
|
31
|
+
filters.push({
|
|
32
|
+
key: "customer_id",
|
|
33
|
+
label: t("fields.customer"),
|
|
34
|
+
type: "select",
|
|
35
|
+
multiple: true,
|
|
36
|
+
searchable: true,
|
|
37
|
+
options: customers.map((c) => ({
|
|
38
|
+
label: [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email,
|
|
39
|
+
value: c.id
|
|
40
|
+
}))
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (sellers?.length) {
|
|
44
|
+
filters.push({
|
|
45
|
+
key: "seller_id",
|
|
46
|
+
label: "Store",
|
|
47
|
+
type: "select",
|
|
48
|
+
multiple: true,
|
|
49
|
+
searchable: true,
|
|
50
|
+
options: sellers.map((s) => ({
|
|
51
|
+
label: s.name,
|
|
52
|
+
value: s.id
|
|
53
|
+
}))
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (sales_channels?.length) {
|
|
57
|
+
filters.push({
|
|
58
|
+
key: "sales_channel_id",
|
|
59
|
+
label: t("fields.salesChannel"),
|
|
60
|
+
type: "select",
|
|
61
|
+
multiple: true,
|
|
62
|
+
searchable: true,
|
|
63
|
+
options: sales_channels.map((s) => ({
|
|
64
|
+
label: s.name,
|
|
65
|
+
value: s.id
|
|
66
|
+
}))
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
filters.push({
|
|
70
|
+
key: "status",
|
|
71
|
+
label: t("fields.status"),
|
|
72
|
+
type: "select",
|
|
73
|
+
multiple: true,
|
|
74
|
+
options: [
|
|
75
|
+
{ label: "Pending", value: "pending" },
|
|
76
|
+
{ label: "Completed", value: "completed" },
|
|
77
|
+
{ label: "Canceled", value: "canceled" },
|
|
78
|
+
{ label: "Requires action", value: "requires_action" }
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
filters.push({
|
|
82
|
+
key: "request",
|
|
83
|
+
label: t("orders.filters.request.label"),
|
|
84
|
+
type: "select",
|
|
85
|
+
multiple: true,
|
|
86
|
+
options: [
|
|
87
|
+
{ label: t("orders.filters.request.edit"), value: "edit" },
|
|
88
|
+
{ label: t("orders.filters.request.return"), value: "return" },
|
|
89
|
+
{ label: t("orders.filters.request.exchange"), value: "exchange" },
|
|
90
|
+
{ label: t("orders.filters.request.claim"), value: "claim" }
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
filters.push(
|
|
94
|
+
{
|
|
95
|
+
key: "created_at",
|
|
96
|
+
label: t("fields.createdAt"),
|
|
97
|
+
type: "date"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "updated_at",
|
|
101
|
+
label: t("fields.updatedAt"),
|
|
102
|
+
type: "date"
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
return filters;
|
|
106
|
+
}, [customers, sellers, sales_channels, t]);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
useOrderGroupTableFilters
|
|
111
|
+
};
|
|
@@ -25,7 +25,7 @@ var useCustomerTableQuery = ({
|
|
|
25
25
|
offset: offset ? Number(offset) : 0,
|
|
26
26
|
groups: groups?.split(","),
|
|
27
27
|
has_account: has_account ? has_account === "true" : void 0,
|
|
28
|
-
order,
|
|
28
|
+
order: order ? order : "-created_at",
|
|
29
29
|
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
30
30
|
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
31
31
|
q
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
useCustomerGroupTableFilters
|
|
6
6
|
} from "./chunk-OI4DJXUL.js";
|
|
7
|
+
import {
|
|
8
|
+
useOrderGroupTableFilters
|
|
9
|
+
} from "./chunk-FU3QYH6H.js";
|
|
7
10
|
import {
|
|
8
11
|
useOrderTableQuery
|
|
9
12
|
} from "./chunk-QUHSHIAC.js";
|
|
@@ -131,8 +134,8 @@ var CustomerAddressSection = ({
|
|
|
131
134
|
"flex h-full flex-col overflow-hidden border-t p-6": true
|
|
132
135
|
}),
|
|
133
136
|
icon: null,
|
|
134
|
-
title: t2("
|
|
135
|
-
message: t2("
|
|
137
|
+
title: t2("customers.addresses.emptyTitle"),
|
|
138
|
+
message: t2("customers.addresses.emptyMessage")
|
|
136
139
|
}
|
|
137
140
|
) }),
|
|
138
141
|
addresses.map((address) => {
|
|
@@ -293,6 +296,7 @@ import { Link as Link2 } from "react-router-dom";
|
|
|
293
296
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
294
297
|
var PAGE_SIZE = 10;
|
|
295
298
|
var PREFIX = "cusgr";
|
|
299
|
+
var DEFAULT_ORDER = "-created_at";
|
|
296
300
|
var CustomerGroupSection = ({
|
|
297
301
|
customer
|
|
298
302
|
}) => {
|
|
@@ -305,6 +309,7 @@ var CustomerGroupSection = ({
|
|
|
305
309
|
const { customer_groups, count, isLoading, isError, error } = useCustomerGroups(
|
|
306
310
|
{
|
|
307
311
|
...searchParams,
|
|
312
|
+
order: searchParams.order || DEFAULT_ORDER,
|
|
308
313
|
fields: "+customers.id,+seller.id,+seller.name",
|
|
309
314
|
customers: { id: customer.id }
|
|
310
315
|
},
|
|
@@ -331,11 +336,12 @@ var CustomerGroupSection = ({
|
|
|
331
336
|
});
|
|
332
337
|
const handleRemove = async () => {
|
|
333
338
|
const customerGroupIds = Object.keys(rowSelection);
|
|
339
|
+
const selectedGroups = customer_groups?.filter((g) => customerGroupIds.includes(g.id)) ?? [];
|
|
340
|
+
const names = selectedGroups.map((g) => g.name);
|
|
341
|
+
const isSingle = selectedGroups.length === 1;
|
|
334
342
|
const res = await prompt({
|
|
335
|
-
title: t("
|
|
336
|
-
description: t("customers.groups.removeMany", {
|
|
337
|
-
groups: customer_groups?.filter((g) => customerGroupIds.includes(g.id)).map((g) => g.name).join(",")
|
|
338
|
-
}),
|
|
343
|
+
title: t("customers.groups.removeTitle"),
|
|
344
|
+
description: isSingle ? t("customers.groups.remove", { name: names[0] }) : t("customers.groups.removeMany", { groups: names.join(", ") }),
|
|
339
345
|
confirmText: t("actions.remove"),
|
|
340
346
|
cancelText: t("actions.cancel")
|
|
341
347
|
});
|
|
@@ -347,8 +353,8 @@ var CustomerGroupSection = ({
|
|
|
347
353
|
{
|
|
348
354
|
onSuccess: () => {
|
|
349
355
|
toast3.success(
|
|
350
|
-
t("customers.groups.removed.
|
|
351
|
-
groups:
|
|
356
|
+
isSingle ? t("customers.groups.removed.successOne", { groups: names[0] }) : t("customers.groups.removed.successMany", {
|
|
357
|
+
groups: names.join(", ")
|
|
352
358
|
})
|
|
353
359
|
);
|
|
354
360
|
},
|
|
@@ -384,6 +390,7 @@ var CustomerGroupSection = ({
|
|
|
384
390
|
{ key: "created_at", label: t("fields.createdAt") },
|
|
385
391
|
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
386
392
|
],
|
|
393
|
+
defaultOrder: DEFAULT_ORDER,
|
|
387
394
|
commands: [
|
|
388
395
|
{
|
|
389
396
|
action: handleRemove,
|
|
@@ -393,7 +400,9 @@ var CustomerGroupSection = ({
|
|
|
393
400
|
],
|
|
394
401
|
queryObject: raw,
|
|
395
402
|
noRecords: {
|
|
396
|
-
|
|
403
|
+
title: t("customers.groups.list.emptyTitle"),
|
|
404
|
+
message: t("customers.groups.list.noRecordsMessage"),
|
|
405
|
+
icon: null
|
|
397
406
|
}
|
|
398
407
|
}
|
|
399
408
|
)
|
|
@@ -408,7 +417,7 @@ var CustomerGroupRowActions = ({
|
|
|
408
417
|
const { mutateAsync } = useRemoveCustomersFromGroup(group.id);
|
|
409
418
|
const onRemove = async () => {
|
|
410
419
|
const res = await prompt({
|
|
411
|
-
title: t2("
|
|
420
|
+
title: t2("customers.groups.removeTitle"),
|
|
412
421
|
description: t2("customers.groups.remove", {
|
|
413
422
|
name: group.name
|
|
414
423
|
}),
|
|
@@ -419,6 +428,11 @@ var CustomerGroupRowActions = ({
|
|
|
419
428
|
return;
|
|
420
429
|
}
|
|
421
430
|
await mutateAsync([customerId], {
|
|
431
|
+
onSuccess: () => {
|
|
432
|
+
toast3.success(
|
|
433
|
+
t2("customers.groups.removed.successOne", { groups: group.name })
|
|
434
|
+
);
|
|
435
|
+
},
|
|
422
436
|
onError: (error) => {
|
|
423
437
|
toast3.error(error.message);
|
|
424
438
|
}
|
|
@@ -585,6 +599,9 @@ var CustomerOrderSection = ({
|
|
|
585
599
|
() => transformOrderGroups(order_groups ?? [], t2),
|
|
586
600
|
[order_groups, t2]
|
|
587
601
|
);
|
|
602
|
+
const filters = useOrderGroupTableFilters().filter(
|
|
603
|
+
(f) => f.key !== "customer_id"
|
|
604
|
+
);
|
|
588
605
|
const columns = useColumns2();
|
|
589
606
|
const { table } = useDataTable({
|
|
590
607
|
data: rows,
|
|
@@ -612,11 +629,13 @@ var CustomerOrderSection = ({
|
|
|
612
629
|
count,
|
|
613
630
|
isLoading,
|
|
614
631
|
pageSize: PAGE_SIZE2,
|
|
632
|
+
filters,
|
|
615
633
|
orderBy: [
|
|
616
634
|
{ key: "display_id", label: t2("orders.fields.displayId") },
|
|
617
635
|
{ key: "created_at", label: t2("fields.createdAt") },
|
|
618
636
|
{ key: "updated_at", label: t2("fields.updatedAt") }
|
|
619
637
|
],
|
|
638
|
+
defaultOrder: "-display_id",
|
|
620
639
|
search: true,
|
|
621
640
|
queryObject: raw,
|
|
622
641
|
prefix: PREFIX2
|
|
@@ -9973,20 +9973,24 @@ var en_default = {
|
|
|
9973
9973
|
},
|
|
9974
9974
|
groups: {
|
|
9975
9975
|
label: "Customer groups",
|
|
9976
|
-
|
|
9977
|
-
|
|
9976
|
+
removeTitle: "Remove customer",
|
|
9977
|
+
remove: "You are about to remove customer from {{name}} group. This action cannot be undone.",
|
|
9978
|
+
removeMany: "You are about to remove customer from {{groups}} groups. This action cannot be undone.",
|
|
9978
9979
|
alreadyAddedTooltip: "The customer is already in this customer group.",
|
|
9979
9980
|
list: {
|
|
9981
|
+
emptyTitle: "No customer groups yet",
|
|
9980
9982
|
noRecordsMessage: "This customer doesn't belong to any group."
|
|
9981
9983
|
},
|
|
9982
9984
|
add: {
|
|
9983
|
-
|
|
9985
|
+
successOne: "Customer was successfully added to {{groups}} group.",
|
|
9986
|
+
successMany: "Customer was successfully added to {{groups}} groups.",
|
|
9984
9987
|
list: {
|
|
9985
9988
|
noRecordsMessage: "Please create a customer group first."
|
|
9986
9989
|
}
|
|
9987
9990
|
},
|
|
9988
9991
|
removed: {
|
|
9989
|
-
|
|
9992
|
+
successOne: "Customer was successfully removed from {{groups}} group.",
|
|
9993
|
+
successMany: "Customer was successfully removed from {{groups}} groups.",
|
|
9990
9994
|
list: {
|
|
9991
9995
|
noRecordsMessage: "Please create a customer group first."
|
|
9992
9996
|
}
|
|
@@ -10012,6 +10016,8 @@ var en_default = {
|
|
|
10012
10016
|
hasAccount: "Has account",
|
|
10013
10017
|
addresses: {
|
|
10014
10018
|
title: "Addresses",
|
|
10019
|
+
emptyTitle: "No addresses yet",
|
|
10020
|
+
emptyMessage: "This customer doesn't have any addresses",
|
|
10015
10021
|
fields: {
|
|
10016
10022
|
addressName: "Address name",
|
|
10017
10023
|
address1: "Address 1",
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
} from "./chunk-PHOCVOZ5.js";
|
|
14
14
|
|
|
15
15
|
// src/hooks/table/columns/use-product-table-columns.tsx
|
|
16
|
-
import { Checkbox } from "@medusajs/ui";
|
|
17
16
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
18
17
|
import { useMemo } from "react";
|
|
19
18
|
|
|
@@ -52,26 +51,6 @@ var columnHelper = createColumnHelper();
|
|
|
52
51
|
var useProductTableColumns = () => {
|
|
53
52
|
return useMemo(
|
|
54
53
|
() => [
|
|
55
|
-
columnHelper.display({
|
|
56
|
-
id: "select",
|
|
57
|
-
header: ({ table }) => /* @__PURE__ */ jsx3(
|
|
58
|
-
Checkbox,
|
|
59
|
-
{
|
|
60
|
-
checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
|
|
61
|
-
onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value),
|
|
62
|
-
"data-testid": "products-table-header-select-checkbox"
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
cell: ({ row }) => /* @__PURE__ */ jsx3(
|
|
66
|
-
Checkbox,
|
|
67
|
-
{
|
|
68
|
-
checked: row.getIsSelected(),
|
|
69
|
-
onCheckedChange: (value) => row.toggleSelected(!!value),
|
|
70
|
-
onClick: (e) => e.stopPropagation(),
|
|
71
|
-
"data-testid": `products-table-cell-${row.id}-select-checkbox`
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
}),
|
|
75
54
|
columnHelper.display({
|
|
76
55
|
id: "product",
|
|
77
56
|
header: () => /* @__PURE__ */ jsx3(ProductHeader, {}),
|