@mercurjs/admin 2.2.0-canary.20 → 2.2.0-canary.22
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-BNLH6QN5.js → add-campaign-promotions-2IOKLEMG.js} +3 -3
- package/dist/{adjust-inventory-2LHBQAWK.js → adjust-inventory-KNHM7QEV.js} +6 -6
- package/dist/{api-key-management-detail-R5QQPNOD.js → api-key-management-detail-ELMPBXEB.js} +7 -7
- package/dist/{attribute-create-JW7OXOK2.js → attribute-create-Q3IEGYRG.js} +6 -6
- package/dist/{attribute-detail-3Z6MTMJT.js → attribute-detail-SDYWELHS.js} +6 -6
- package/dist/{attribute-list-WRTXTFED.js → attribute-list-HW3R6764.js} +6 -6
- package/dist/{campaign-detail-ROTJ4SWD.js → campaign-detail-5WNSQVKG.js} +10 -10
- package/dist/{categories-metadata-EPKUI3R4.js → categories-metadata-INVMU224.js} +6 -6
- package/dist/{category-detail-ICACLNJ3.js → category-detail-ABK4MEZP.js} +6 -6
- package/dist/{category-products-V4H3B6ML.js → category-products-HTNBFHSW.js} +6 -6
- package/dist/{chunk-A7RM5JXC.js → chunk-2H3KXP53.js} +1 -1
- package/dist/{chunk-KZB7LCF2.js → chunk-3EQOAHVG.js} +1 -1
- package/dist/{chunk-VKOE5J66.js → chunk-3XOE4NV5.js} +11 -2
- package/dist/{chunk-7XBB24GO.js → chunk-3ZCBTIIC.js} +1 -1
- package/dist/{chunk-SNCZQATG.js → chunk-4GRFDNQQ.js} +2 -2
- package/dist/{chunk-4Q5JHL4V.js → chunk-4O7GPTNJ.js} +1 -1
- package/dist/{chunk-AGXO2H4E.js → chunk-5PWXUMCA.js} +1 -1
- package/dist/{chunk-2HMWS5UW.js → chunk-67RX3M6X.js} +154 -23
- package/dist/{chunk-2MYHGOPY.js → chunk-7IVRL4AF.js} +1 -1
- package/dist/{chunk-7VPJ4C6F.js → chunk-7PAVVX2P.js} +1 -1
- package/dist/{chunk-HR7TFO2X.js → chunk-A3IFGUDD.js} +3 -3
- package/dist/{chunk-CMHI2RPL.js → chunk-AKSUGT5I.js} +21 -0
- package/dist/{chunk-7JZVZ5EX.js → chunk-ARN66CDK.js} +1 -1
- package/dist/{chunk-JEJQKTZO.js → chunk-ASNNJIW7.js} +2 -2
- package/dist/{chunk-RXRDZ47F.js → chunk-BHJFT3ST.js} +3 -3
- package/dist/chunk-BN6OOLJA.js +358 -0
- package/dist/{chunk-WETV577Q.js → chunk-CPWOVYZE.js} +1 -1
- package/dist/{chunk-JQV7CXEC.js → chunk-EDDKIVMF.js} +17 -2
- package/dist/{chunk-2NA54XKC.js → chunk-FP6YPFKF.js} +80 -7
- package/dist/{chunk-SJKLYS3R.js → chunk-IO5S4RFO.js} +3 -3
- package/dist/{chunk-HI6L7DXI.js → chunk-K7EOVKKV.js} +1 -1
- package/dist/{chunk-FFNSWUDC.js → chunk-LNPJFQWA.js} +11 -4
- package/dist/{chunk-KXIA66EJ.js → chunk-PAEKCYFU.js} +7 -3
- package/dist/{chunk-EG45GIE3.js → chunk-PAGH4K4C.js} +47 -14
- package/dist/{chunk-MHVZVF6O.js → chunk-PT3DTHQK.js} +1 -1
- package/dist/{chunk-PRBE5CM3.js → chunk-QYDWMBEX.js} +31 -0
- package/dist/{chunk-Z3SUMFDT.js → chunk-R2UDZINP.js} +214 -38
- package/dist/{chunk-Z2UBJXTU.js → chunk-RDTFLHYO.js} +1 -1
- package/dist/{chunk-IER5BQNC.js → chunk-RXZZEPW3.js} +1 -1
- package/dist/{chunk-BGQ7H2KL.js → chunk-SMQM5N45.js} +2 -2
- package/dist/{chunk-PN5C4AND.js → chunk-STPSVH3T.js} +1 -1
- package/dist/{chunk-I5THQVYP.js → chunk-XIFE4VUR.js} +1 -1
- package/dist/{chunk-4VXYPZMT.js → chunk-Z7AXFQPD.js} +2 -2
- package/dist/{chunk-PWFZCT6H.js → chunk-ZIIZGCTQ.js} +1 -1
- package/dist/{collection-add-products-PBCIG33C.js → collection-add-products-CKF2VFVK.js} +6 -6
- package/dist/{collection-create-7G3MHBVQ.js → collection-create-UNGPKT7H.js} +83 -12
- package/dist/{collection-detail-3OLBOV24.js → collection-detail-36QTD3ZU.js} +9 -7
- package/dist/collection-icon-edit-V4SNBMD5.js +117 -0
- package/dist/{collection-list-S4ICG5T6.js → collection-list-UN7C36DU.js} +15 -12
- package/dist/collection-media-ESJUYVF7.js +654 -0
- package/dist/{collection-metadata-VUOECEP4.js → collection-metadata-6SD67JUV.js} +6 -6
- package/dist/{commission-rule-commission-edit-TA3H3EEN.js → commission-rule-commission-edit-EAOSJNA2.js} +3 -3
- package/dist/{commission-rule-create-O7Z25SC7.js → commission-rule-create-X3AYVCQG.js} +183 -67
- package/dist/{commission-rule-detail-I7LVSNAM.js → commission-rule-detail-EITJYZG5.js} +3 -3
- package/dist/{commission-rule-edit-YSHDTYZY.js → commission-rule-edit-FZLHYL4A.js} +2 -2
- package/dist/{commissions-list-OUGVPED6.js → commissions-list-TT2ITT75.js} +4 -3
- package/dist/{customer-create-RW63XPQ6.js → customer-create-HZXLOIZH.js} +1 -1
- package/dist/{customer-create-address-SZCOIGDP.js → customer-create-address-AEZNVQOG.js} +1 -1
- package/dist/{customer-detail-MT2R7DFI.js → customer-detail-3OQ7RSDN.js} +9 -13
- package/dist/{customer-edit-ZBIZ4FKT.js → customer-edit-MMRTWOAF.js} +1 -1
- package/dist/customer-edit-address-AEYX2LMP.js +302 -0
- package/dist/{customer-group-add-customers-SG7EU4D7.js → customer-group-add-customers-4OAYSXWK.js} +2 -2
- package/dist/{customer-group-create-LFGY5HR6.js → customer-group-create-25JT74S3.js} +1 -1
- package/dist/{customer-group-detail-MCAEXZYM.js → customer-group-detail-CH4UIK3X.js} +8 -8
- package/dist/{customer-group-edit-CXWQSMDZ.js → customer-group-edit-AAI47MUL.js} +1 -1
- package/dist/{customer-group-list-V4PW33M5.js → customer-group-list-777C2B57.js} +9 -9
- package/dist/{customer-group-metadata-J622TR4I.js → customer-group-metadata-ELFKJMYK.js} +6 -6
- package/dist/{customer-list-MB6WZFMA.js → customer-list-U7VFBV7E.js} +3 -3
- package/dist/{customer-metadata-SFS5VRK5.js → customer-metadata-4H6ADARR.js} +6 -6
- package/dist/{customers-add-customer-group-G6FIKKUP.js → customers-add-customer-group-AZ3ILZMA.js} +8 -8
- package/dist/{edit-inventory-item-OFPVTJ4I.js → edit-inventory-item-NL5WNNI3.js} +6 -6
- package/dist/{edit-inventory-item-attributes-Z37AFIYM.js → edit-inventory-item-attributes-2JEH72WW.js} +6 -6
- package/dist/{edit-rules-JG62MLUS.js → edit-rules-XYTK7DQ2.js} +6 -6
- package/dist/{global-commission-edit-LCD6JJUX.js → global-commission-edit-3CEVUAAP.js} +46 -29
- package/dist/index.js +163 -151
- package/dist/{inventory-create-3IM54ZO3.js → inventory-create-7RQSCNCQ.js} +6 -6
- package/dist/{inventory-detail-POKYZVLA.js → inventory-detail-W7BGKWKL.js} +6 -6
- package/dist/{inventory-metadata-XXYKRUNP.js → inventory-metadata-ZGLTDSQB.js} +6 -6
- package/dist/{inventory-stock-CXPPGARO.js → inventory-stock-US7LGBC4.js} +6 -6
- package/dist/{location-detail-PHT367V5.js → location-detail-GAINHCV5.js} +6 -6
- package/dist/{location-fulfillment-providers-EZOVLJWL.js → location-fulfillment-providers-6DFBFALS.js} +8 -8
- package/dist/{location-list-HVSRDHOW.js → location-list-QXIHD6NJ.js} +6 -6
- package/dist/{location-service-zone-shipping-option-create-VZBL7MK6.js → location-service-zone-shipping-option-create-AUNZVIGU.js} +6 -6
- package/dist/{login-LJMTSRAG.js → login-NFPUZDAL.js} +6 -6
- package/dist/{marketplace-detail-WINAJJDB.js → marketplace-detail-M7DWNMIH.js} +6 -6
- package/dist/{marketplace-metadata-CCUK2B4Q.js → marketplace-metadata-FYJ7TJLZ.js} +6 -6
- package/dist/{offers-5LSNWJ6B.js → offers-PYM6LQSX.js} +6 -6
- package/dist/{order-create-exchange-6IQJFYUK.js → order-create-exchange-4PWNGE6U.js} +6 -6
- package/dist/{order-create-refund-DUVGD54U.js → order-create-refund-A4AXOFZC.js} +6 -6
- package/dist/{order-detail-Y6SFV44C.js → order-detail-HPYAUA2N.js} +7 -7
- package/dist/{order-edit-billing-address-IW6UIARN.js → order-edit-billing-address-5XHAAGT7.js} +7 -7
- package/dist/{order-edit-email-D5XIYASI.js → order-edit-email-44O3ARQ4.js} +6 -6
- package/dist/{order-edit-shipping-address-4VJDVGKJ.js → order-edit-shipping-address-UI2AHBXW.js} +6 -6
- package/dist/{order-list-KWHMMX2M.js → order-list-IVXCYRGB.js} +4 -4
- package/dist/{order-metadata-QSTGFW66.js → order-metadata-3U5KT3MW.js} +6 -6
- package/dist/{order-request-transfer-GYBTSHU4.js → order-request-transfer-OM3BPIWZ.js} +6 -6
- package/dist/pages/index.d.ts +33 -9
- package/dist/pages/index.js +95 -94
- package/dist/{price-list-configuration-SNL2LNV2.js → price-list-configuration-6LD6DTEQ.js} +6 -5
- package/dist/{price-list-create-LPJWSOBP.js → price-list-create-SR24HYH3.js} +11 -11
- package/dist/{price-list-detail-7AUDNRSM.js → price-list-detail-QIMJQ6DD.js} +9 -9
- package/dist/{price-list-edit-BOEBNVGM.js → price-list-edit-MEM47NGY.js} +2 -2
- package/dist/{price-list-list-AX7ZW6LL.js → price-list-list-GIVZGIYW.js} +4 -4
- package/dist/{price-list-prices-add-5IOYBCXV.js → price-list-prices-add-VE5RTT5O.js} +7 -7
- package/dist/{price-list-prices-edit-DT2DLFTO.js → price-list-prices-edit-R52K4MBL.js} +7 -7
- package/dist/{product-add-existing-attributes-LNZK2LHX.js → product-add-existing-attributes-AC4643LI.js} +6 -6
- package/dist/{product-create-QYEZHBTC.js → product-create-LY3HDOLG.js} +9 -9
- package/dist/{product-detail-Q6YF7IYX.js → product-detail-77DV4TAW.js} +6 -6
- package/dist/{product-list-IDRT4WUK.js → product-list-4JGMM4AF.js} +6 -6
- package/dist/{product-media-6H34CVXJ.js → product-media-PWPVCTC2.js} +2 -2
- package/dist/{product-metadata-VJMZL753.js → product-metadata-H53ZIWBS.js} +6 -6
- package/dist/{product-tag-create-4FYE46PE.js → product-tag-create-4OT4PMCG.js} +6 -6
- package/dist/{product-tag-detail-WF34TUQR.js → product-tag-detail-NVTDW7BR.js} +15 -13
- package/dist/{product-tag-edit-HRWMMCUC.js → product-tag-edit-RXF6ZZ6E.js} +6 -6
- package/dist/{product-tag-list-PK43EMMH.js → product-tag-list-T6BDTH24.js} +15 -13
- package/dist/{product-tag-metadata-ONSEQTEW.js → product-tag-metadata-HN5QRCYY.js} +6 -6
- package/dist/{product-type-detail-J466AJUQ.js → product-type-detail-KOGHJIMG.js} +6 -6
- package/dist/{product-type-metadata-CXYKP2OF.js → product-type-metadata-QUCMB3ZJ.js} +6 -6
- package/dist/{product-variant-detail-FXQZLB7Q.js → product-variant-detail-6XBLXEXQ.js} +6 -6
- package/dist/{product-variant-edit-CYEISGII.js → product-variant-edit-3KAFS4OC.js} +6 -6
- package/dist/{product-variant-metadata-YQ2GKWW7.js → product-variant-metadata-N5H2VPGQ.js} +6 -6
- package/dist/{promotion-create-KNK57JWD.js → promotion-create-Y2XVWGAT.js} +6 -6
- package/dist/{promotion-detail-EUQ5LK2V.js → promotion-detail-ORDL76NG.js} +9 -9
- package/dist/{promotion-list-M5SAE7A3.js → promotion-list-NMD23NXJ.js} +4 -4
- package/dist/{refund-reason-create-ANAVZO2N.js → refund-reason-create-CIXYHBRC.js} +6 -6
- package/dist/{refund-reason-edit-HKEVJ6A5.js → refund-reason-edit-AXMEDPRT.js} +6 -6
- package/dist/{refund-reason-list-FBH43XVP.js → refund-reason-list-F56TJAGR.js} +13 -11
- package/dist/{region-metadata-XHT3A6D7.js → region-metadata-QGH7IBQU.js} +6 -6
- package/dist/{reservation-detail-T3VHDWP6.js → reservation-detail-7TL2OFEM.js} +6 -6
- package/dist/{reservation-metadata-4LVLM4UW.js → reservation-metadata-UXACXYO6.js} +6 -6
- package/dist/{reset-password-RF5J4RIU.js → reset-password-GA3NEKEX.js} +1 -1
- package/dist/{return-reason-list-4JWWSFOS.js → return-reason-list-EJ5DLDR2.js} +7 -5
- package/dist/{sales-channel-add-products-FNJQKCQQ.js → sales-channel-add-products-7ERGMGJ7.js} +6 -6
- package/dist/{sales-channel-detail-HXJAR6M4.js → sales-channel-detail-LWVBJCJQ.js} +6 -6
- package/dist/{sales-channel-list-YYIH254X.js → sales-channel-list-I72W2XTH.js} +6 -6
- package/dist/{sales-channel-metadata-YF5AV2XX.js → sales-channel-metadata-RD6QDHRW.js} +6 -6
- package/dist/{shipping-option-type-create-TOONS7EC.js → shipping-option-type-create-LXYYXNSQ.js} +6 -6
- package/dist/{shipping-option-type-detail-VXZ4UQQI.js → shipping-option-type-detail-2IQSQ5BQ.js} +6 -6
- package/dist/{shipping-option-type-edit-6WO2XRLE.js → shipping-option-type-edit-4XKXWCN3.js} +6 -6
- package/dist/{shipping-option-type-list-S7TW7Q3R.js → shipping-option-type-list-QA2TA7XQ.js} +6 -6
- package/dist/{shipping-profile-metadata-SVD3WK7H.js → shipping-profile-metadata-PVNYV7DY.js} +6 -6
- package/dist/{store-create-7A5OSRIV.js → store-create-F6W5CSH2.js} +6 -6
- package/dist/{store-details-LSGSI4QU.js → store-details-CSHIHCVO.js} +10 -10
- package/dist/{store-edit-TP5CQHV7.js → store-edit-QJXV27DI.js} +2 -2
- package/dist/{store-list-KQGPNQQ4.js → store-list-FGLLHZPD.js} +10 -10
- package/dist/{tax-region-create-JR7OHOJ5.js → tax-region-create-MS6G5YVE.js} +7 -7
- package/dist/{tax-region-detail-2E56T5C2.js → tax-region-detail-EU5U3SFN.js} +6 -6
- package/dist/{tax-region-edit-7SBQFGPY.js → tax-region-edit-XHO3ELVD.js} +6 -6
- package/dist/{tax-region-metadata-4NUEQV3N.js → tax-region-metadata-NYTCYO6D.js} +6 -6
- package/dist/{tax-region-province-detail-5Q5E5OP7.js → tax-region-province-detail-U4RULBEK.js} +6 -6
- package/dist/{tax-region-tax-override-create-S5S5JZEJ.js → tax-region-tax-override-create-5MIAKHY6.js} +15 -13
- package/dist/{tax-region-tax-override-edit-JBG3MRNC.js → tax-region-tax-override-edit-EHLIO56A.js} +15 -13
- package/dist/{user-metadata-2D552EAR.js → user-metadata-VCWUSKHV.js} +6 -6
- package/package.json +1 -1
- package/dist/{chunk-WTPWO7KS.js → chunk-KAAUSK5T.js} +3 -3
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileUpload,
|
|
3
|
+
formatFileSize
|
|
4
|
+
} from "./chunk-VSLHL2AZ.js";
|
|
5
|
+
import {
|
|
6
|
+
uploadFilesQuery
|
|
7
|
+
} from "./chunk-ZBWL72TB.js";
|
|
8
|
+
|
|
9
|
+
// src/pages/collections/common/components/collection-image-fields/types.ts
|
|
10
|
+
var COLLECTION_IMAGE_FORMATS = [
|
|
11
|
+
"image/jpeg",
|
|
12
|
+
"image/png",
|
|
13
|
+
"image/gif",
|
|
14
|
+
"image/webp",
|
|
15
|
+
"image/heic",
|
|
16
|
+
"image/svg+xml"
|
|
17
|
+
];
|
|
18
|
+
var getCollectionGallery = (images) => (images ?? []).filter((image) => !image.type).sort((a, b) => (a.rank ?? 0) - (b.rank ?? 0));
|
|
19
|
+
var getCollectionIcon = (images) => (images ?? []).find((image) => image.type === "icon") ?? null;
|
|
20
|
+
|
|
21
|
+
// src/pages/collections/common/components/collection-image-fields/collection-icon-input.tsx
|
|
22
|
+
import { XMark } from "@medusajs/icons";
|
|
23
|
+
import { IconButton, Text } from "@medusajs/ui";
|
|
24
|
+
import { useTranslation } from "react-i18next";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
var CollectionIconInput = ({
|
|
27
|
+
value,
|
|
28
|
+
onChange,
|
|
29
|
+
hasError
|
|
30
|
+
}) => {
|
|
31
|
+
const { t } = useTranslation();
|
|
32
|
+
const handleUploaded = (files) => {
|
|
33
|
+
const file = files[0];
|
|
34
|
+
if (file) {
|
|
35
|
+
onChange({ url: file.url, file: file.file });
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
if (value) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "bg-ui-bg-component shadow-elevation-card-rest flex items-center justify-between rounded-lg px-3 py-2",
|
|
43
|
+
"data-testid": "collection-icon-input-item",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "bg-ui-bg-base flex h-10 w-[30px] items-center justify-center overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
|
|
47
|
+
"img",
|
|
48
|
+
{
|
|
49
|
+
src: value.url,
|
|
50
|
+
alt: "",
|
|
51
|
+
className: "size-full object-contain object-center"
|
|
52
|
+
}
|
|
53
|
+
) }),
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
55
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: value.file?.name ?? value.url }),
|
|
56
|
+
value.file && /* @__PURE__ */ jsx(
|
|
57
|
+
Text,
|
|
58
|
+
{
|
|
59
|
+
size: "xsmall",
|
|
60
|
+
leading: "compact",
|
|
61
|
+
className: "text-ui-fg-subtle",
|
|
62
|
+
children: formatFileSize(value.file.size)
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
IconButton,
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
size: "small",
|
|
72
|
+
variant: "transparent",
|
|
73
|
+
onClick: () => onChange(null),
|
|
74
|
+
"data-testid": "collection-icon-input-delete",
|
|
75
|
+
children: /* @__PURE__ */ jsx(XMark, {})
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-2", "data-testid": "collection-icon-input", children: /* @__PURE__ */ jsx(
|
|
83
|
+
FileUpload,
|
|
84
|
+
{
|
|
85
|
+
label: t("collections.icon.upload.title"),
|
|
86
|
+
hint: t("collections.icon.upload.hint"),
|
|
87
|
+
multiple: false,
|
|
88
|
+
formats: COLLECTION_IMAGE_FORMATS,
|
|
89
|
+
hasError,
|
|
90
|
+
onUploaded: handleUploaded
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/pages/collections/common/components/collection-image-fields/collection-icon-tip.tsx
|
|
96
|
+
import { Text as Text2 } from "@medusajs/ui";
|
|
97
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
98
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
99
|
+
var CollectionIconTip = () => {
|
|
100
|
+
const { t } = useTranslation2();
|
|
101
|
+
return /* @__PURE__ */ jsxs2(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
className: "bg-ui-bg-component shadow-elevation-card-rest flex items-stretch gap-x-3 rounded-lg px-3 py-2",
|
|
105
|
+
"data-testid": "collection-icon-tip",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx2("div", { className: "bg-ui-border-strong w-[3px] shrink-0 self-stretch rounded-full" }),
|
|
108
|
+
/* @__PURE__ */ jsxs2(Text2, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
109
|
+
/* @__PURE__ */ jsx2("span", { className: "text-ui-fg-base font-medium", children: t("collections.icon.tip.label") }),
|
|
110
|
+
" ",
|
|
111
|
+
t("collections.icon.tip.text")
|
|
112
|
+
] })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// src/pages/collections/common/components/collection-image-fields/upload-collection-images.ts
|
|
119
|
+
var uploadCollectionImages = async ({
|
|
120
|
+
media,
|
|
121
|
+
icon
|
|
122
|
+
}) => {
|
|
123
|
+
const payload = {};
|
|
124
|
+
if (media !== void 0) {
|
|
125
|
+
payload.media = await Promise.all(
|
|
126
|
+
media.map(async (item, index) => {
|
|
127
|
+
let url = item.url;
|
|
128
|
+
if (item.file) {
|
|
129
|
+
const uploaded = await uploadFilesQuery([{ file: item.file }]);
|
|
130
|
+
url = uploaded.files?.[0]?.url ?? url;
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
url,
|
|
134
|
+
is_thumbnail: item.is_thumbnail,
|
|
135
|
+
is_banner: item.is_banner,
|
|
136
|
+
rank: index
|
|
137
|
+
};
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
if (icon !== void 0) {
|
|
142
|
+
if (!icon) {
|
|
143
|
+
payload.icon = null;
|
|
144
|
+
} else if (icon.file) {
|
|
145
|
+
const uploaded = await uploadFilesQuery([{ file: icon.file }]);
|
|
146
|
+
payload.icon = uploaded.files?.[0]?.url ?? icon.url;
|
|
147
|
+
} else {
|
|
148
|
+
payload.icon = icon.url;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return payload;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// src/pages/collections/common/components/collection-image-fields/collection-media-input.tsx
|
|
155
|
+
import {
|
|
156
|
+
EllipsisHorizontal,
|
|
157
|
+
FeaturedBadge,
|
|
158
|
+
InformationCircleSolid,
|
|
159
|
+
Photo,
|
|
160
|
+
ThumbnailBadge,
|
|
161
|
+
Trash,
|
|
162
|
+
XMark as XMark2
|
|
163
|
+
} from "@medusajs/icons";
|
|
164
|
+
import { DropdownMenu, IconButton as IconButton2, Text as Text3, Tooltip, clx } from "@medusajs/ui";
|
|
165
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
166
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
167
|
+
var CollectionMediaInput = ({
|
|
168
|
+
value,
|
|
169
|
+
onChange,
|
|
170
|
+
hasError
|
|
171
|
+
}) => {
|
|
172
|
+
const { t } = useTranslation3();
|
|
173
|
+
const handleUploaded = (files) => {
|
|
174
|
+
onChange([
|
|
175
|
+
...value,
|
|
176
|
+
...files.map((f) => ({
|
|
177
|
+
url: f.url,
|
|
178
|
+
file: f.file,
|
|
179
|
+
is_thumbnail: false,
|
|
180
|
+
is_banner: false,
|
|
181
|
+
field_id: f.id
|
|
182
|
+
}))
|
|
183
|
+
]);
|
|
184
|
+
};
|
|
185
|
+
const toggleRole = (index, role, on) => {
|
|
186
|
+
onChange(
|
|
187
|
+
value.map((item, i) => ({
|
|
188
|
+
...item,
|
|
189
|
+
[role]: i === index ? on : on ? false : item[role]
|
|
190
|
+
}))
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
const remove = (index) => {
|
|
194
|
+
onChange(value.filter((_, i) => i !== index));
|
|
195
|
+
};
|
|
196
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-2", "data-testid": "collection-media-input", children: [
|
|
197
|
+
/* @__PURE__ */ jsx3(
|
|
198
|
+
FileUpload,
|
|
199
|
+
{
|
|
200
|
+
label: t("collections.media.upload.title"),
|
|
201
|
+
hint: t("collections.media.upload.hint"),
|
|
202
|
+
formats: COLLECTION_IMAGE_FORMATS,
|
|
203
|
+
hasError,
|
|
204
|
+
onUploaded: handleUploaded
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
value.length > 0 && /* @__PURE__ */ jsx3(
|
|
208
|
+
"ul",
|
|
209
|
+
{
|
|
210
|
+
className: "flex flex-col gap-y-2",
|
|
211
|
+
"data-testid": "collection-media-input-list",
|
|
212
|
+
children: value.map((item, index) => /* @__PURE__ */ jsxs3(
|
|
213
|
+
"li",
|
|
214
|
+
{
|
|
215
|
+
className: "bg-ui-bg-component shadow-elevation-card-rest flex items-center justify-between rounded-lg px-3 py-2",
|
|
216
|
+
"data-testid": `collection-media-input-item-${index}`,
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-3", children: [
|
|
219
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-ui-bg-base flex h-10 w-[30px] items-center justify-center overflow-hidden rounded-md", children: item.url ? /* @__PURE__ */ jsx3(
|
|
220
|
+
"img",
|
|
221
|
+
{
|
|
222
|
+
src: item.url,
|
|
223
|
+
alt: "",
|
|
224
|
+
className: "size-full object-cover object-center"
|
|
225
|
+
}
|
|
226
|
+
) : /* @__PURE__ */ jsx3(Photo, { className: "text-ui-fg-muted" }) }),
|
|
227
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
|
|
228
|
+
/* @__PURE__ */ jsx3(Text3, { size: "small", leading: "compact", children: item.file?.name ?? item.url }),
|
|
229
|
+
/* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle flex items-center gap-x-1", children: [
|
|
230
|
+
item.is_thumbnail && /* @__PURE__ */ jsx3(ThumbnailBadge, { "data-testid": "collection-media-input-item-thumbnail-badge" }),
|
|
231
|
+
item.is_banner && /* @__PURE__ */ jsx3(
|
|
232
|
+
FeaturedBadge,
|
|
233
|
+
{
|
|
234
|
+
className: "text-ui-fg-interactive",
|
|
235
|
+
"data-testid": "collection-media-input-item-banner-badge"
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
item.file && /* @__PURE__ */ jsx3(
|
|
239
|
+
Text3,
|
|
240
|
+
{
|
|
241
|
+
size: "xsmall",
|
|
242
|
+
leading: "compact",
|
|
243
|
+
className: "text-ui-fg-subtle",
|
|
244
|
+
children: formatFileSize(item.file.size)
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] })
|
|
248
|
+
] })
|
|
249
|
+
] }),
|
|
250
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-1", children: [
|
|
251
|
+
/* @__PURE__ */ jsx3(
|
|
252
|
+
CollectionMediaItemMenu,
|
|
253
|
+
{
|
|
254
|
+
item,
|
|
255
|
+
onToggleThumbnail: () => toggleRole(index, "is_thumbnail", !item.is_thumbnail),
|
|
256
|
+
onToggleBanner: () => toggleRole(index, "is_banner", !item.is_banner),
|
|
257
|
+
onDelete: () => remove(index),
|
|
258
|
+
testId: `collection-media-input-item-menu-${index}`
|
|
259
|
+
}
|
|
260
|
+
),
|
|
261
|
+
/* @__PURE__ */ jsx3(
|
|
262
|
+
IconButton2,
|
|
263
|
+
{
|
|
264
|
+
type: "button",
|
|
265
|
+
size: "small",
|
|
266
|
+
variant: "transparent",
|
|
267
|
+
onClick: () => remove(index),
|
|
268
|
+
"data-testid": `collection-media-input-item-delete-${index}`,
|
|
269
|
+
children: /* @__PURE__ */ jsx3(XMark2, {})
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
] })
|
|
273
|
+
]
|
|
274
|
+
},
|
|
275
|
+
item.field_id ?? `${item.url}-${index}`
|
|
276
|
+
))
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
] });
|
|
280
|
+
};
|
|
281
|
+
var CollectionMediaItemMenu = ({
|
|
282
|
+
item,
|
|
283
|
+
onToggleThumbnail,
|
|
284
|
+
onToggleBanner,
|
|
285
|
+
onDelete,
|
|
286
|
+
testId
|
|
287
|
+
}) => {
|
|
288
|
+
const { t } = useTranslation3();
|
|
289
|
+
return /* @__PURE__ */ jsxs3(DropdownMenu, { children: [
|
|
290
|
+
/* @__PURE__ */ jsx3(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx3(IconButton2, { size: "small", variant: "transparent", "data-testid": testId, children: /* @__PURE__ */ jsx3(EllipsisHorizontal, {}) }) }),
|
|
291
|
+
/* @__PURE__ */ jsxs3(DropdownMenu.Content, { children: [
|
|
292
|
+
/* @__PURE__ */ jsx3(
|
|
293
|
+
MenuItemWithTooltip,
|
|
294
|
+
{
|
|
295
|
+
icon: /* @__PURE__ */ jsx3(ThumbnailBadge, {}),
|
|
296
|
+
label: item.is_thumbnail ? t("collections.media.actions.removeThumbnail") : t("collections.media.actions.setThumbnail"),
|
|
297
|
+
tooltip: t("collections.media.tooltips.thumbnail"),
|
|
298
|
+
onClick: onToggleThumbnail
|
|
299
|
+
}
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ jsx3(
|
|
302
|
+
MenuItemWithTooltip,
|
|
303
|
+
{
|
|
304
|
+
icon: /* @__PURE__ */ jsx3(FeaturedBadge, {}),
|
|
305
|
+
label: item.is_banner ? t("collections.media.actions.removeBanner") : t("collections.media.actions.setBanner"),
|
|
306
|
+
tooltip: t("collections.media.tooltips.banner"),
|
|
307
|
+
onClick: onToggleBanner
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ jsx3(DropdownMenu.Separator, {}),
|
|
311
|
+
/* @__PURE__ */ jsxs3(
|
|
312
|
+
DropdownMenu.Item,
|
|
313
|
+
{
|
|
314
|
+
className: "[&_svg]:text-ui-fg-subtle flex items-center gap-x-2",
|
|
315
|
+
onClick: onDelete,
|
|
316
|
+
children: [
|
|
317
|
+
/* @__PURE__ */ jsx3(Trash, {}),
|
|
318
|
+
/* @__PURE__ */ jsx3("span", { children: t("actions.delete") })
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
] })
|
|
323
|
+
] });
|
|
324
|
+
};
|
|
325
|
+
var MenuItemWithTooltip = ({
|
|
326
|
+
icon,
|
|
327
|
+
label,
|
|
328
|
+
tooltip,
|
|
329
|
+
onClick
|
|
330
|
+
}) => {
|
|
331
|
+
return /* @__PURE__ */ jsxs3(
|
|
332
|
+
DropdownMenu.Item,
|
|
333
|
+
{
|
|
334
|
+
className: clx(
|
|
335
|
+
"[&_svg]:text-ui-fg-subtle flex items-center gap-x-2",
|
|
336
|
+
"justify-between"
|
|
337
|
+
),
|
|
338
|
+
onClick,
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-2", children: [
|
|
341
|
+
icon,
|
|
342
|
+
/* @__PURE__ */ jsx3("span", { children: label })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ jsx3(Tooltip, { content: tooltip, children: /* @__PURE__ */ jsx3(InformationCircleSolid, { className: "text-ui-fg-muted" }) })
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export {
|
|
351
|
+
COLLECTION_IMAGE_FORMATS,
|
|
352
|
+
getCollectionGallery,
|
|
353
|
+
getCollectionIcon,
|
|
354
|
+
CollectionMediaInput,
|
|
355
|
+
CollectionIconInput,
|
|
356
|
+
CollectionIconTip,
|
|
357
|
+
uploadCollectionImages
|
|
358
|
+
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCollectionGallery
|
|
3
|
+
} from "./chunk-BN6OOLJA.js";
|
|
1
4
|
import {
|
|
2
5
|
TextCell
|
|
3
6
|
} from "./chunk-JHIMVLB2.js";
|
|
7
|
+
import {
|
|
8
|
+
Thumbnail
|
|
9
|
+
} from "./chunk-WIYFXWRI.js";
|
|
4
10
|
|
|
5
11
|
// src/hooks/table/columns/use-collection-table-columns.tsx
|
|
6
12
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
7
13
|
import { useMemo } from "react";
|
|
8
14
|
import { useTranslation } from "react-i18next";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
16
|
var columnHelper = createColumnHelper();
|
|
11
17
|
var useCollectionTableColumns = () => {
|
|
12
18
|
const { t } = useTranslation();
|
|
@@ -14,7 +20,16 @@ var useCollectionTableColumns = () => {
|
|
|
14
20
|
() => [
|
|
15
21
|
columnHelper.accessor("title", {
|
|
16
22
|
header: t("fields.title"),
|
|
17
|
-
cell: ({ getValue }) =>
|
|
23
|
+
cell: ({ getValue, row }) => {
|
|
24
|
+
const gallery = getCollectionGallery(
|
|
25
|
+
row.original.images
|
|
26
|
+
);
|
|
27
|
+
const thumbnailSrc = gallery.find((image) => image.is_thumbnail)?.url ?? gallery[0]?.url ?? null;
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex size-full items-center gap-x-3 overflow-hidden", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Thumbnail, { src: thumbnailSrc }),
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: getValue() })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
18
33
|
}),
|
|
19
34
|
columnHelper.accessor("handle", {
|
|
20
35
|
header: t("fields.handle"),
|
|
@@ -9694,6 +9694,57 @@ var en_default = {
|
|
|
9694
9694
|
successToast_one: "Product was successfully removed from the collection.",
|
|
9695
9695
|
successToast_other: "Products were successfully removed from the collection."
|
|
9696
9696
|
}
|
|
9697
|
+
},
|
|
9698
|
+
media: {
|
|
9699
|
+
label: "Media",
|
|
9700
|
+
thumbnail: "Thumbnail",
|
|
9701
|
+
banner: "Banner",
|
|
9702
|
+
galleryLabel: "Gallery",
|
|
9703
|
+
editHint: "Add media to the collection to showcase it on the storefront.",
|
|
9704
|
+
deleteWarning: "You are about to delete this image. This action cannot be undone.",
|
|
9705
|
+
empty: {
|
|
9706
|
+
header: "No media yet",
|
|
9707
|
+
description: "Add media to showcase it on the storefront."
|
|
9708
|
+
},
|
|
9709
|
+
upload: {
|
|
9710
|
+
title: "Upload images",
|
|
9711
|
+
hint: "Drag and drop images here or click to upload."
|
|
9712
|
+
},
|
|
9713
|
+
tooltips: {
|
|
9714
|
+
thumbnail: "Shown as the collection thumbnail on the homepage.",
|
|
9715
|
+
banner: "Shown as the collection banner in the collection listing."
|
|
9716
|
+
},
|
|
9717
|
+
actions: {
|
|
9718
|
+
setThumbnail: "Make thumbnail",
|
|
9719
|
+
removeThumbnail: "Remove thumbnail",
|
|
9720
|
+
setBanner: "Make banner",
|
|
9721
|
+
removeBanner: "Remove banner"
|
|
9722
|
+
},
|
|
9723
|
+
edit: {
|
|
9724
|
+
header: "Edit Media",
|
|
9725
|
+
description: "Upload images and choose the thumbnail and banner shown on the storefront.",
|
|
9726
|
+
successToast: "Collection media was successfully updated."
|
|
9727
|
+
}
|
|
9728
|
+
},
|
|
9729
|
+
icon: {
|
|
9730
|
+
label: "Icon",
|
|
9731
|
+
empty: {
|
|
9732
|
+
header: "No icon yet",
|
|
9733
|
+
description: "Add icon to showcase it near the collection label on the storefront."
|
|
9734
|
+
},
|
|
9735
|
+
tip: {
|
|
9736
|
+
label: "Tip:",
|
|
9737
|
+
text: "This icon will appear near the collection label on the storefront."
|
|
9738
|
+
},
|
|
9739
|
+
upload: {
|
|
9740
|
+
title: "Upload file",
|
|
9741
|
+
hint: "Drag and drop file here or click to upload."
|
|
9742
|
+
},
|
|
9743
|
+
edit: {
|
|
9744
|
+
header: "Edit Icon",
|
|
9745
|
+
description: "Upload a single icon shown near the collection label on the storefront.",
|
|
9746
|
+
successToast: "Collection icon was successfully updated."
|
|
9747
|
+
}
|
|
9697
9748
|
}
|
|
9698
9749
|
},
|
|
9699
9750
|
categories: {
|
|
@@ -9965,6 +10016,11 @@ var en_default = {
|
|
|
9965
10016
|
header: "Create Address",
|
|
9966
10017
|
hint: "Create a new address for the customer.",
|
|
9967
10018
|
successToast: "Address was successfully created."
|
|
10019
|
+
},
|
|
10020
|
+
edit: {
|
|
10021
|
+
header: "Edit Address",
|
|
10022
|
+
hint: "Edit the customer's address.",
|
|
10023
|
+
successToast: "Address was successfully updated."
|
|
9968
10024
|
}
|
|
9969
10025
|
}
|
|
9970
10026
|
},
|
|
@@ -12227,6 +12283,7 @@ var en_default = {
|
|
|
12227
12283
|
refundAmount: "Refund amount",
|
|
12228
12284
|
name: "Name",
|
|
12229
12285
|
note: "Note",
|
|
12286
|
+
owner: "Owner",
|
|
12230
12287
|
optional: "Optional",
|
|
12231
12288
|
selectPlaceholder: "Select",
|
|
12232
12289
|
default: "Default",
|
|
@@ -12616,15 +12673,20 @@ var en_default = {
|
|
|
12616
12673
|
header: "Create Commission Rule",
|
|
12617
12674
|
details: "Details",
|
|
12618
12675
|
commission: "Commission",
|
|
12619
|
-
successToast: "Commission rule created"
|
|
12676
|
+
successToast: "Commission rule was successfully created."
|
|
12620
12677
|
},
|
|
12621
12678
|
edit: {
|
|
12622
12679
|
header: "Edit Commission Rule",
|
|
12623
|
-
successToast: "Commission rule updated"
|
|
12680
|
+
successToast: "Commission rule was successfully updated."
|
|
12681
|
+
},
|
|
12682
|
+
commissionEdit: {
|
|
12683
|
+
header: "Edit Commission",
|
|
12684
|
+
successToast: "Commission was successfully updated."
|
|
12624
12685
|
},
|
|
12625
12686
|
delete: {
|
|
12626
|
-
|
|
12627
|
-
|
|
12687
|
+
title: "Delete commission rule",
|
|
12688
|
+
description: "You are about to delete commission rule {{name}}. This action cannot be undone.",
|
|
12689
|
+
successToast: "Commission rule was successfully deleted."
|
|
12628
12690
|
},
|
|
12629
12691
|
fields: {
|
|
12630
12692
|
code: "Code",
|
|
@@ -12641,7 +12703,9 @@ var en_default = {
|
|
|
12641
12703
|
type: {
|
|
12642
12704
|
label: "Type",
|
|
12643
12705
|
percentage: "Percentage",
|
|
12644
|
-
fixed: "Fixed"
|
|
12706
|
+
fixed: "Fixed",
|
|
12707
|
+
percentageHint: "Charge a percentage of the order total.",
|
|
12708
|
+
fixedHint: "Charge a fixed amount per order."
|
|
12645
12709
|
},
|
|
12646
12710
|
scopeType: {
|
|
12647
12711
|
label: "Type",
|
|
@@ -12649,7 +12713,12 @@ var en_default = {
|
|
|
12649
12713
|
productType: "Product Type",
|
|
12650
12714
|
category: "Category",
|
|
12651
12715
|
storeProductType: "Store + Product Type",
|
|
12652
|
-
storeCategory: "Store + Category"
|
|
12716
|
+
storeCategory: "Store + Category",
|
|
12717
|
+
storeHint: "Apply to specific stores.",
|
|
12718
|
+
productTypeHint: "Apply to specific product types.",
|
|
12719
|
+
categoryHint: "Apply to specific categories.",
|
|
12720
|
+
storeProductTypeHint: "Apply to product types within specific stores.",
|
|
12721
|
+
storeCategoryHint: "Apply to categories within specific stores."
|
|
12653
12722
|
}
|
|
12654
12723
|
},
|
|
12655
12724
|
global: {
|
|
@@ -12663,7 +12732,7 @@ var en_default = {
|
|
|
12663
12732
|
notIncluded: "Not included in commission",
|
|
12664
12733
|
edit: {
|
|
12665
12734
|
header: "Edit Global Commission",
|
|
12666
|
-
successToast: "Global commission updated"
|
|
12735
|
+
successToast: "Global commission was successfully updated."
|
|
12667
12736
|
}
|
|
12668
12737
|
},
|
|
12669
12738
|
rules: {
|
|
@@ -12674,6 +12743,10 @@ var en_default = {
|
|
|
12674
12743
|
type: "Type",
|
|
12675
12744
|
value: "Value",
|
|
12676
12745
|
status: "Status"
|
|
12746
|
+
},
|
|
12747
|
+
empty: {
|
|
12748
|
+
heading: "No commission rules yet",
|
|
12749
|
+
description: "Create a commission rule to override the global commission for specific stores, product types, or categories."
|
|
12677
12750
|
}
|
|
12678
12751
|
},
|
|
12679
12752
|
status: {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4F5GP7J7.js";
|
|
4
4
|
import {
|
|
5
5
|
useDeletePriceListAction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PT3DTHQK.js";
|
|
7
7
|
import {
|
|
8
8
|
getPriceListStatus
|
|
9
9
|
} from "./chunk-U5MJIHLY.js";
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
usePriceList,
|
|
31
31
|
usePriceListLinkProducts
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-RDTFLHYO.js";
|
|
33
33
|
import {
|
|
34
34
|
useCustomerGroups
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-QYDWMBEX.js";
|
|
36
36
|
import {
|
|
37
37
|
ActionMenu
|
|
38
38
|
} from "./chunk-BDGZ4EQO.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCustomerGroupTableFilters
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AKSUGT5I.js";
|
|
4
4
|
import {
|
|
5
5
|
useCustomerGroupTableQuery
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3XOE4NV5.js";
|
|
7
7
|
import {
|
|
8
8
|
_DataTable,
|
|
9
9
|
useDataTable
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
useCustomerGroups,
|
|
19
19
|
useDeleteCustomerGroupLazy
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QYDWMBEX.js";
|
|
21
21
|
import {
|
|
22
22
|
ActionMenu
|
|
23
23
|
} from "./chunk-BDGZ4EQO.js";
|
|
@@ -71,7 +71,7 @@ var CustomerGroupListDataTable = () => {
|
|
|
71
71
|
const { customer_groups, count, isPending, isError, error } = useCustomerGroups(
|
|
72
72
|
{
|
|
73
73
|
...searchParams,
|
|
74
|
-
fields: "id,name,created_at,updated_at,customers.id"
|
|
74
|
+
fields: "id,name,created_at,updated_at,customers.id,seller.id,seller.name"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
placeholderData: keepPreviousData
|
|
@@ -202,6 +202,13 @@ var useColumns = () => {
|
|
|
202
202
|
return /* @__PURE__ */ jsx("span", { children: row.original.customers?.length ?? 0 });
|
|
203
203
|
}
|
|
204
204
|
}),
|
|
205
|
+
columnHelper.display({
|
|
206
|
+
id: "owner",
|
|
207
|
+
header: t("fields.owner"),
|
|
208
|
+
cell: ({ row }) => {
|
|
209
|
+
return /* @__PURE__ */ jsx("span", { "data-testid": `customer-group-owner-${row.original.id}`, children: row.original.seller?.name ?? "-" });
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
205
212
|
columnHelper.accessor("created_at", {
|
|
206
213
|
header: t("fields.createdAt"),
|
|
207
214
|
cell: ({ row }) => {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-QG6PLWNH.js";
|
|
4
4
|
import {
|
|
5
5
|
useCustomerTableFilters
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XIFE4VUR.js";
|
|
7
7
|
import {
|
|
8
8
|
useCustomerTableQuery
|
|
9
9
|
} from "./chunk-PVZBDWLK.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
useCustomers,
|
|
20
20
|
useDeleteCustomerGroup,
|
|
21
21
|
useRemoveCustomersFromGroup
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QYDWMBEX.js";
|
|
23
23
|
import {
|
|
24
24
|
ActionMenu
|
|
25
25
|
} from "./chunk-BDGZ4EQO.js";
|
|
@@ -304,12 +304,16 @@ var CustomerGroupGeneralSection = ({
|
|
|
304
304
|
/* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", "data-testid": "customer-group-general-section-customers-row", children: [
|
|
305
305
|
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", "data-testid": "customer-group-general-section-customers-label", children: t("customers.domain") }),
|
|
306
306
|
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", "data-testid": "customer-group-general-section-customers-value", children: group.customers?.length || "-" })
|
|
307
|
+
] }),
|
|
308
|
+
/* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", "data-testid": "customer-group-general-section-owner-row", children: [
|
|
309
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", "data-testid": "customer-group-general-section-owner-label", children: t("fields.owner") }),
|
|
310
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", "data-testid": "customer-group-general-section-owner-value", children: group.seller?.name || "-" })
|
|
307
311
|
] })
|
|
308
312
|
] });
|
|
309
313
|
};
|
|
310
314
|
|
|
311
315
|
// src/pages/customer-groups/customer-group-detail/constants.ts
|
|
312
|
-
var CUSTOMER_GROUP_DETAIL_FIELDS = "+customers.id";
|
|
316
|
+
var CUSTOMER_GROUP_DETAIL_FIELDS = "+customers.id,+seller.id,+seller.name";
|
|
313
317
|
|
|
314
318
|
// src/pages/customer-groups/customer-group-detail/customer-group-detail.tsx
|
|
315
319
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|