@medusajs/dashboard 3.0.0-preview-20251215060139 → 3.0.0-preview-20251215120148
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/app.js +7 -67
- package/dist/app.mjs +1 -1
- package/dist/{chunk-UWBENEHD.mjs → chunk-O25VJFFT.mjs} +9 -9
- package/dist/{product-attributes-4AEBLFIM.mjs → product-attributes-IK366KJL.mjs} +1 -1
- package/dist/{product-create-TGR3I2H2.mjs → product-create-FVSZOPCG.mjs} +1 -1
- package/dist/{product-detail-YLYXIRRB.mjs → product-detail-OSZGGWCD.mjs} +1 -1
- package/dist/{product-edit-ALZUODMD.mjs → product-edit-VEYRZRU6.mjs} +1 -1
- package/dist/{product-organization-KHZELN3F.mjs → product-organization-4VRPHKKN.mjs} +1 -1
- package/dist/{store-add-locales-XJJCEO6Q.mjs → store-add-locales-2K37PQHO.mjs} +1 -8
- package/dist/{store-detail-DNK76PXP.mjs → store-detail-ONATEVLY.mjs} +5 -18
- package/dist/{store-edit-EPAHLLKP.mjs → store-edit-FTLPT55E.mjs} +1 -42
- package/package.json +9 -9
- package/src/routes/store/store-add-locales/components/add-locales-form/add-locales-form.tsx +0 -9
- package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +0 -24
- package/src/routes/store/store-detail/components/store-locale-section/store-locale-section.tsx +1 -9
- package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +1 -45
package/dist/app.js
CHANGED
|
@@ -164318,16 +164318,13 @@ var init_store_general_section = __esm({
|
|
|
164318
164318
|
init_action_menu2();
|
|
164319
164319
|
init_api();
|
|
164320
164320
|
init_regions();
|
|
164321
|
-
init_feature_flag_provider();
|
|
164322
164321
|
import_jsx_runtime492 = require("react/jsx-runtime");
|
|
164323
164322
|
StoreGeneralSection = ({ store }) => {
|
|
164324
164323
|
const { t: t5 } = (0, import_react_i18next356.useTranslation)();
|
|
164325
|
-
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
164326
164324
|
const { region } = useRegion(store.default_region_id, void 0, {
|
|
164327
164325
|
enabled: !!store.default_region_id
|
|
164328
164326
|
});
|
|
164329
164327
|
const defaultCurrency = store.supported_currencies?.find((c) => c.is_default);
|
|
164330
|
-
const defaultLocale = store.supported_locales?.find((l) => l.is_default);
|
|
164331
164328
|
const { sales_channel } = useSalesChannel(store.default_sales_channel_id, {
|
|
164332
164329
|
enabled: !!store.default_sales_channel_id
|
|
164333
164330
|
});
|
|
@@ -164374,13 +164371,6 @@ var init_store_general_section = __esm({
|
|
|
164374
164371
|
/* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", children: defaultCurrency.currency?.name })
|
|
164375
164372
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", children: "-" })
|
|
164376
164373
|
] }),
|
|
164377
|
-
isTranslationsEnabled && /* @__PURE__ */ (0, import_jsx_runtime492.jsxs)("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
164378
|
-
/* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", weight: "plus", children: t5("store.defaultLocale") }),
|
|
164379
|
-
defaultLocale ? /* @__PURE__ */ (0, import_jsx_runtime492.jsxs)("div", { className: "flex items-center gap-x-2", children: [
|
|
164380
|
-
/* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Badge, { size: "2xsmall", children: defaultLocale.locale_code?.toUpperCase() }),
|
|
164381
|
-
/* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", children: defaultLocale.locale?.name })
|
|
164382
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", children: "-" })
|
|
164383
|
-
] }),
|
|
164384
164374
|
/* @__PURE__ */ (0, import_jsx_runtime492.jsxs)("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
164385
164375
|
/* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", weight: "plus", children: t5("store.defaultRegion") }),
|
|
164386
164376
|
/* @__PURE__ */ (0, import_jsx_runtime492.jsx)("div", { className: "flex items-center gap-x-2", children: region ? /* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Badge, { size: "2xsmall", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_react_router_dom170.Link, { to: `/settings/regions/${region.id}`, children: region.name }) }) : /* @__PURE__ */ (0, import_jsx_runtime492.jsx)(import_ui329.Text, { size: "small", leading: "compact", children: "-" }) })
|
|
@@ -164895,8 +164885,7 @@ var init_store_locale_section = __esm({
|
|
|
164895
164885
|
pageSize: PAGE_SIZE45,
|
|
164896
164886
|
meta: {
|
|
164897
164887
|
storeId: store.id,
|
|
164898
|
-
supportedLocales: store.supported_locales
|
|
164899
|
-
defaultLocaleCode: store.supported_locales?.find((l) => l.is_default)?.locale_code
|
|
164888
|
+
supportedLocales: store.supported_locales
|
|
164900
164889
|
}
|
|
164901
164890
|
});
|
|
164902
164891
|
const { mutateAsync } = useUpdateStore(store.id);
|
|
@@ -164992,8 +164981,7 @@ var init_store_locale_section = __esm({
|
|
|
164992
164981
|
LocaleActions = ({
|
|
164993
164982
|
storeId,
|
|
164994
164983
|
locale,
|
|
164995
|
-
supportedLocales
|
|
164996
|
-
defaultLocaleCode
|
|
164984
|
+
supportedLocales
|
|
164997
164985
|
}) => {
|
|
164998
164986
|
const { mutateAsync } = useUpdateStore(storeId);
|
|
164999
164987
|
const { t: t5 } = (0, import_react_i18next360.useTranslation)();
|
|
@@ -165037,8 +165025,7 @@ var init_store_locale_section = __esm({
|
|
|
165037
165025
|
{
|
|
165038
165026
|
icon: /* @__PURE__ */ (0, import_jsx_runtime496.jsx)(import_icons136.Trash, {}),
|
|
165039
165027
|
label: t5("actions.remove"),
|
|
165040
|
-
onClick: handleRemove
|
|
165041
|
-
disabled: locale.code === defaultLocaleCode
|
|
165028
|
+
onClick: handleRemove
|
|
165042
165029
|
}
|
|
165043
165030
|
]
|
|
165044
165031
|
}
|
|
@@ -165080,14 +165067,13 @@ var init_store_locale_section = __esm({
|
|
|
165080
165067
|
columnHelper62.display({
|
|
165081
165068
|
id: "actions",
|
|
165082
165069
|
cell: ({ row, table }) => {
|
|
165083
|
-
const { supportedLocales, storeId
|
|
165070
|
+
const { supportedLocales, storeId } = table.options.meta;
|
|
165084
165071
|
return /* @__PURE__ */ (0, import_jsx_runtime496.jsx)(
|
|
165085
165072
|
LocaleActions,
|
|
165086
165073
|
{
|
|
165087
165074
|
storeId,
|
|
165088
165075
|
locale: row.original,
|
|
165089
|
-
supportedLocales
|
|
165090
|
-
defaultLocaleCode
|
|
165076
|
+
supportedLocales
|
|
165091
165077
|
}
|
|
165092
165078
|
);
|
|
165093
165079
|
}
|
|
@@ -165189,26 +165175,22 @@ var init_edit_store_form = __esm({
|
|
|
165189
165175
|
init_use_combobox_data();
|
|
165190
165176
|
init_client2();
|
|
165191
165177
|
init_use_document_direction();
|
|
165192
|
-
init_feature_flag_provider();
|
|
165193
165178
|
import_jsx_runtime498 = require("react/jsx-runtime");
|
|
165194
165179
|
EditStoreSchema = import_zod103.z.object({
|
|
165195
165180
|
name: import_zod103.z.string().min(1),
|
|
165196
165181
|
default_currency_code: import_zod103.z.string().optional(),
|
|
165197
|
-
default_locale_code: import_zod103.z.string().optional(),
|
|
165198
165182
|
default_region_id: import_zod103.z.string().optional(),
|
|
165199
165183
|
default_sales_channel_id: import_zod103.z.string().optional(),
|
|
165200
165184
|
default_location_id: import_zod103.z.string().optional()
|
|
165201
165185
|
});
|
|
165202
165186
|
EditStoreForm = ({ store }) => {
|
|
165203
165187
|
const { t: t5 } = (0, import_react_i18next361.useTranslation)();
|
|
165204
|
-
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
165205
165188
|
const { handleSuccess } = useRouteModal();
|
|
165206
165189
|
const direction = useDocumentDirection();
|
|
165207
165190
|
const form = (0, import_react_hook_form100.useForm)({
|
|
165208
165191
|
defaultValues: {
|
|
165209
165192
|
name: store.name,
|
|
165210
165193
|
default_region_id: store.default_region_id || void 0,
|
|
165211
|
-
default_locale_code: store.supported_locales?.find((l) => l.is_default)?.locale_code || void 0,
|
|
165212
165194
|
default_currency_code: store.supported_currencies?.find((c) => c.is_default)?.currency_code || void 0,
|
|
165213
165195
|
default_sales_channel_id: store.default_sales_channel_id || void 0,
|
|
165214
165196
|
default_location_id: store.default_location_id || void 0
|
|
@@ -165235,13 +165217,9 @@ var init_edit_store_form = __esm({
|
|
|
165235
165217
|
defaultValue: store.default_location_id || void 0
|
|
165236
165218
|
});
|
|
165237
165219
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
165238
|
-
const { default_currency_code,
|
|
165220
|
+
const { default_currency_code, ...rest } = values;
|
|
165239
165221
|
const normalizedMutation = {
|
|
165240
165222
|
...rest,
|
|
165241
|
-
supported_locales: store.supported_locales?.map((l) => ({
|
|
165242
|
-
...l,
|
|
165243
|
-
is_default: l.locale_code === default_locale_code
|
|
165244
|
-
})),
|
|
165245
165223
|
supported_currencies: store.supported_currencies?.map((c) => ({
|
|
165246
165224
|
...c,
|
|
165247
165225
|
is_default: c.currency_code === default_currency_code
|
|
@@ -165307,37 +165285,6 @@ var init_edit_store_form = __esm({
|
|
|
165307
165285
|
}
|
|
165308
165286
|
}
|
|
165309
165287
|
),
|
|
165310
|
-
isTranslationsEnabled && /* @__PURE__ */ (0, import_jsx_runtime498.jsx)(
|
|
165311
|
-
Form.Field,
|
|
165312
|
-
{
|
|
165313
|
-
control: form.control,
|
|
165314
|
-
name: "default_locale_code",
|
|
165315
|
-
render: ({ field: { onChange, ...field } }) => {
|
|
165316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime498.jsxs)(Form.Item, { children: [
|
|
165317
|
-
/* @__PURE__ */ (0, import_jsx_runtime498.jsx)(Form.Label, { children: t5("store.defaultLocale") }),
|
|
165318
|
-
/* @__PURE__ */ (0, import_jsx_runtime498.jsx)(Form.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime498.jsxs)(
|
|
165319
|
-
import_ui332.Select,
|
|
165320
|
-
{
|
|
165321
|
-
dir: direction,
|
|
165322
|
-
...field,
|
|
165323
|
-
onValueChange: onChange,
|
|
165324
|
-
children: [
|
|
165325
|
-
/* @__PURE__ */ (0, import_jsx_runtime498.jsx)(import_ui332.Select.Trigger, { ref: field.ref, children: /* @__PURE__ */ (0, import_jsx_runtime498.jsx)(import_ui332.Select.Value, {}) }),
|
|
165326
|
-
/* @__PURE__ */ (0, import_jsx_runtime498.jsx)(import_ui332.Select.Content, { children: store.supported_locales?.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime498.jsx)(
|
|
165327
|
-
import_ui332.Select.Item,
|
|
165328
|
-
{
|
|
165329
|
-
value: locale.locale_code,
|
|
165330
|
-
children: locale.locale_code
|
|
165331
|
-
},
|
|
165332
|
-
locale.locale_code
|
|
165333
|
-
)) })
|
|
165334
|
-
]
|
|
165335
|
-
}
|
|
165336
|
-
) })
|
|
165337
|
-
] });
|
|
165338
|
-
}
|
|
165339
|
-
}
|
|
165340
|
-
),
|
|
165341
165288
|
/* @__PURE__ */ (0, import_jsx_runtime498.jsx)(
|
|
165342
165289
|
Form.Field,
|
|
165343
165290
|
{
|
|
@@ -165821,17 +165768,10 @@ var init_add_locales_form = __esm({
|
|
|
165821
165768
|
const locales2 = Array.from(
|
|
165822
165769
|
/* @__PURE__ */ new Set([...data.locales, ...preSelectedRows])
|
|
165823
165770
|
);
|
|
165824
|
-
let defaultLocale = store.supported_locales?.find(
|
|
165825
|
-
(l) => l.is_default
|
|
165826
|
-
)?.locale_code;
|
|
165827
|
-
if (!locales2.includes(defaultLocale ?? "")) {
|
|
165828
|
-
defaultLocale = locales2?.[0];
|
|
165829
|
-
}
|
|
165830
165771
|
await mutateAsync(
|
|
165831
165772
|
{
|
|
165832
165773
|
supported_locales: locales2.map((l) => ({
|
|
165833
|
-
locale_code: l
|
|
165834
|
-
is_default: l === defaultLocale
|
|
165774
|
+
locale_code: l
|
|
165835
165775
|
}))
|
|
165836
165776
|
},
|
|
165837
165777
|
{
|
package/dist/app.mjs
CHANGED
|
@@ -92551,7 +92551,7 @@ function getRouteMap({
|
|
|
92551
92551
|
children: [
|
|
92552
92552
|
{
|
|
92553
92553
|
path: "create",
|
|
92554
|
-
lazy: () => import("./product-create-
|
|
92554
|
+
lazy: () => import("./product-create-FVSZOPCG.mjs")
|
|
92555
92555
|
},
|
|
92556
92556
|
{
|
|
92557
92557
|
path: "import",
|
|
@@ -92567,7 +92567,7 @@ function getRouteMap({
|
|
|
92567
92567
|
path: ":id",
|
|
92568
92568
|
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
|
92569
92569
|
lazy: async () => {
|
|
92570
|
-
const { Breadcrumb, loader } = await import("./product-detail-
|
|
92570
|
+
const { Breadcrumb, loader } = await import("./product-detail-OSZGGWCD.mjs");
|
|
92571
92571
|
return {
|
|
92572
92572
|
Component: Outlet4,
|
|
92573
92573
|
loader,
|
|
@@ -92579,11 +92579,11 @@ function getRouteMap({
|
|
|
92579
92579
|
children: [
|
|
92580
92580
|
{
|
|
92581
92581
|
path: "",
|
|
92582
|
-
lazy: () => import("./product-detail-
|
|
92582
|
+
lazy: () => import("./product-detail-OSZGGWCD.mjs"),
|
|
92583
92583
|
children: [
|
|
92584
92584
|
{
|
|
92585
92585
|
path: "edit",
|
|
92586
|
-
lazy: () => import("./product-edit-
|
|
92586
|
+
lazy: () => import("./product-edit-VEYRZRU6.mjs")
|
|
92587
92587
|
},
|
|
92588
92588
|
{
|
|
92589
92589
|
path: "edit-variant",
|
|
@@ -92595,11 +92595,11 @@ function getRouteMap({
|
|
|
92595
92595
|
},
|
|
92596
92596
|
{
|
|
92597
92597
|
path: "attributes",
|
|
92598
|
-
lazy: () => import("./product-attributes-
|
|
92598
|
+
lazy: () => import("./product-attributes-IK366KJL.mjs")
|
|
92599
92599
|
},
|
|
92600
92600
|
{
|
|
92601
92601
|
path: "organization",
|
|
92602
|
-
lazy: () => import("./product-organization-
|
|
92602
|
+
lazy: () => import("./product-organization-4VRPHKKN.mjs")
|
|
92603
92603
|
},
|
|
92604
92604
|
{
|
|
92605
92605
|
path: "shipping-profile",
|
|
@@ -93296,14 +93296,14 @@ function getRouteMap({
|
|
|
93296
93296
|
{
|
|
93297
93297
|
path: "store",
|
|
93298
93298
|
errorElement: /* @__PURE__ */ jsx17(ErrorBoundary, {}),
|
|
93299
|
-
lazy: () => import("./store-detail-
|
|
93299
|
+
lazy: () => import("./store-detail-ONATEVLY.mjs"),
|
|
93300
93300
|
handle: {
|
|
93301
93301
|
breadcrumb: () => t("store.domain")
|
|
93302
93302
|
},
|
|
93303
93303
|
children: [
|
|
93304
93304
|
{
|
|
93305
93305
|
path: "edit",
|
|
93306
|
-
lazy: () => import("./store-edit-
|
|
93306
|
+
lazy: () => import("./store-edit-FTLPT55E.mjs")
|
|
93307
93307
|
},
|
|
93308
93308
|
{
|
|
93309
93309
|
path: "currencies",
|
|
@@ -93311,7 +93311,7 @@ function getRouteMap({
|
|
|
93311
93311
|
},
|
|
93312
93312
|
{
|
|
93313
93313
|
path: "locales",
|
|
93314
|
-
lazy: () => import("./store-add-locales-
|
|
93314
|
+
lazy: () => import("./store-add-locales-2K37PQHO.mjs")
|
|
93315
93315
|
},
|
|
93316
93316
|
{
|
|
93317
93317
|
path: "metadata/edit",
|
|
@@ -138,17 +138,10 @@ var AddLocalesForm = ({ store }) => {
|
|
|
138
138
|
const locales2 = Array.from(
|
|
139
139
|
/* @__PURE__ */ new Set([...data.locales, ...preSelectedRows])
|
|
140
140
|
);
|
|
141
|
-
let defaultLocale = store.supported_locales?.find(
|
|
142
|
-
(l) => l.is_default
|
|
143
|
-
)?.locale_code;
|
|
144
|
-
if (!locales2.includes(defaultLocale ?? "")) {
|
|
145
|
-
defaultLocale = locales2?.[0];
|
|
146
|
-
}
|
|
147
141
|
await mutateAsync(
|
|
148
142
|
{
|
|
149
143
|
supported_locales: locales2.map((l) => ({
|
|
150
|
-
locale_code: l
|
|
151
|
-
is_default: l === defaultLocale
|
|
144
|
+
locale_code: l
|
|
152
145
|
}))
|
|
153
146
|
},
|
|
154
147
|
{
|
|
@@ -111,12 +111,10 @@ import { Link } from "react-router-dom";
|
|
|
111
111
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
112
112
|
var StoreGeneralSection = ({ store }) => {
|
|
113
113
|
const { t } = useTranslation();
|
|
114
|
-
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
115
114
|
const { region } = useRegion(store.default_region_id, void 0, {
|
|
116
115
|
enabled: !!store.default_region_id
|
|
117
116
|
});
|
|
118
117
|
const defaultCurrency = store.supported_currencies?.find((c) => c.is_default);
|
|
119
|
-
const defaultLocale = store.supported_locales?.find((l) => l.is_default);
|
|
120
118
|
const { sales_channel } = useSalesChannel(store.default_sales_channel_id, {
|
|
121
119
|
enabled: !!store.default_sales_channel_id
|
|
122
120
|
});
|
|
@@ -163,13 +161,6 @@ var StoreGeneralSection = ({ store }) => {
|
|
|
163
161
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: defaultCurrency.currency?.name })
|
|
164
162
|
] }) : /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: "-" })
|
|
165
163
|
] }),
|
|
166
|
-
isTranslationsEnabled && /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
167
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("store.defaultLocale") }),
|
|
168
|
-
defaultLocale ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
169
|
-
/* @__PURE__ */ jsx(Badge, { size: "2xsmall", children: defaultLocale.locale_code?.toUpperCase() }),
|
|
170
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: defaultLocale.locale?.name })
|
|
171
|
-
] }) : /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: "-" })
|
|
172
|
-
] }),
|
|
173
164
|
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
174
165
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("store.defaultRegion") }),
|
|
175
166
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: region ? /* @__PURE__ */ jsx(Badge, { size: "2xsmall", asChild: true, children: /* @__PURE__ */ jsx(Link, { to: `/settings/regions/${region.id}`, children: region.name }) }) : /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: "-" }) })
|
|
@@ -550,8 +541,7 @@ var StoreLocaleSection = ({ store }) => {
|
|
|
550
541
|
pageSize: PAGE_SIZE2,
|
|
551
542
|
meta: {
|
|
552
543
|
storeId: store.id,
|
|
553
|
-
supportedLocales: store.supported_locales
|
|
554
|
-
defaultLocaleCode: store.supported_locales?.find((l) => l.is_default)?.locale_code
|
|
544
|
+
supportedLocales: store.supported_locales
|
|
555
545
|
}
|
|
556
546
|
});
|
|
557
547
|
const { mutateAsync } = useUpdateStore(store.id);
|
|
@@ -647,8 +637,7 @@ var StoreLocaleSection = ({ store }) => {
|
|
|
647
637
|
var LocaleActions = ({
|
|
648
638
|
storeId,
|
|
649
639
|
locale,
|
|
650
|
-
supportedLocales
|
|
651
|
-
defaultLocaleCode
|
|
640
|
+
supportedLocales
|
|
652
641
|
}) => {
|
|
653
642
|
const { mutateAsync } = useUpdateStore(storeId);
|
|
654
643
|
const { t } = useTranslation3();
|
|
@@ -692,8 +681,7 @@ var LocaleActions = ({
|
|
|
692
681
|
{
|
|
693
682
|
icon: /* @__PURE__ */ jsx3(Trash2, {}),
|
|
694
683
|
label: t("actions.remove"),
|
|
695
|
-
onClick: handleRemove
|
|
696
|
-
disabled: locale.code === defaultLocaleCode
|
|
684
|
+
onClick: handleRemove
|
|
697
685
|
}
|
|
698
686
|
]
|
|
699
687
|
}
|
|
@@ -735,14 +723,13 @@ var useColumns2 = () => {
|
|
|
735
723
|
columnHelper2.display({
|
|
736
724
|
id: "actions",
|
|
737
725
|
cell: ({ row, table }) => {
|
|
738
|
-
const { supportedLocales, storeId
|
|
726
|
+
const { supportedLocales, storeId } = table.options.meta;
|
|
739
727
|
return /* @__PURE__ */ jsx3(
|
|
740
728
|
LocaleActions,
|
|
741
729
|
{
|
|
742
730
|
storeId,
|
|
743
731
|
locale: row.original,
|
|
744
|
-
supportedLocales
|
|
745
|
-
defaultLocaleCode
|
|
732
|
+
supportedLocales
|
|
746
733
|
}
|
|
747
734
|
);
|
|
748
735
|
}
|
|
@@ -14,9 +14,6 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
useRouteModal
|
|
16
16
|
} from "./chunk-42OOM4DJ.mjs";
|
|
17
|
-
import {
|
|
18
|
-
useFeatureFlag
|
|
19
|
-
} from "./chunk-G4BWCU5P.mjs";
|
|
20
17
|
import {
|
|
21
18
|
useDocumentDirection
|
|
22
19
|
} from "./chunk-S4DMV3ZT.mjs";
|
|
@@ -49,21 +46,18 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
49
46
|
var EditStoreSchema = z.object({
|
|
50
47
|
name: z.string().min(1),
|
|
51
48
|
default_currency_code: z.string().optional(),
|
|
52
|
-
default_locale_code: z.string().optional(),
|
|
53
49
|
default_region_id: z.string().optional(),
|
|
54
50
|
default_sales_channel_id: z.string().optional(),
|
|
55
51
|
default_location_id: z.string().optional()
|
|
56
52
|
});
|
|
57
53
|
var EditStoreForm = ({ store }) => {
|
|
58
54
|
const { t } = useTranslation();
|
|
59
|
-
const isTranslationsEnabled = useFeatureFlag("translation");
|
|
60
55
|
const { handleSuccess } = useRouteModal();
|
|
61
56
|
const direction = useDocumentDirection();
|
|
62
57
|
const form = useForm({
|
|
63
58
|
defaultValues: {
|
|
64
59
|
name: store.name,
|
|
65
60
|
default_region_id: store.default_region_id || void 0,
|
|
66
|
-
default_locale_code: store.supported_locales?.find((l) => l.is_default)?.locale_code || void 0,
|
|
67
61
|
default_currency_code: store.supported_currencies?.find((c) => c.is_default)?.currency_code || void 0,
|
|
68
62
|
default_sales_channel_id: store.default_sales_channel_id || void 0,
|
|
69
63
|
default_location_id: store.default_location_id || void 0
|
|
@@ -90,13 +84,9 @@ var EditStoreForm = ({ store }) => {
|
|
|
90
84
|
defaultValue: store.default_location_id || void 0
|
|
91
85
|
});
|
|
92
86
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
93
|
-
const { default_currency_code,
|
|
87
|
+
const { default_currency_code, ...rest } = values;
|
|
94
88
|
const normalizedMutation = {
|
|
95
89
|
...rest,
|
|
96
|
-
supported_locales: store.supported_locales?.map((l) => ({
|
|
97
|
-
...l,
|
|
98
|
-
is_default: l.locale_code === default_locale_code
|
|
99
|
-
})),
|
|
100
90
|
supported_currencies: store.supported_currencies?.map((c) => ({
|
|
101
91
|
...c,
|
|
102
92
|
is_default: c.currency_code === default_currency_code
|
|
@@ -162,37 +152,6 @@ var EditStoreForm = ({ store }) => {
|
|
|
162
152
|
}
|
|
163
153
|
}
|
|
164
154
|
),
|
|
165
|
-
isTranslationsEnabled && /* @__PURE__ */ jsx(
|
|
166
|
-
Form.Field,
|
|
167
|
-
{
|
|
168
|
-
control: form.control,
|
|
169
|
-
name: "default_locale_code",
|
|
170
|
-
render: ({ field: { onChange, ...field } }) => {
|
|
171
|
-
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
172
|
-
/* @__PURE__ */ jsx(Form.Label, { children: t("store.defaultLocale") }),
|
|
173
|
-
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
|
|
174
|
-
Select,
|
|
175
|
-
{
|
|
176
|
-
dir: direction,
|
|
177
|
-
...field,
|
|
178
|
-
onValueChange: onChange,
|
|
179
|
-
children: [
|
|
180
|
-
/* @__PURE__ */ jsx(Select.Trigger, { ref: field.ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
|
|
181
|
-
/* @__PURE__ */ jsx(Select.Content, { children: store.supported_locales?.map((locale) => /* @__PURE__ */ jsx(
|
|
182
|
-
Select.Item,
|
|
183
|
-
{
|
|
184
|
-
value: locale.locale_code,
|
|
185
|
-
children: locale.locale_code
|
|
186
|
-
},
|
|
187
|
-
locale.locale_code
|
|
188
|
-
)) })
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
) })
|
|
192
|
-
] });
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
),
|
|
196
155
|
/* @__PURE__ */ jsx(
|
|
197
156
|
Form.Field,
|
|
198
157
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/dashboard",
|
|
3
|
-
"version": "3.0.0-preview-
|
|
3
|
+
"version": "3.0.0-preview-20251215120148",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
|
6
6
|
"dev": "../../../node_modules/.bin/vite",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
47
47
|
"@hookform/error-message": "^2.0.1",
|
|
48
48
|
"@hookform/resolvers": "3.4.2",
|
|
49
|
-
"@medusajs/admin-shared": "3.0.0-preview-
|
|
50
|
-
"@medusajs/icons": "3.0.0-preview-
|
|
51
|
-
"@medusajs/js-sdk": "3.0.0-preview-
|
|
52
|
-
"@medusajs/ui": "4.0.31-preview-
|
|
49
|
+
"@medusajs/admin-shared": "3.0.0-preview-20251215120148",
|
|
50
|
+
"@medusajs/icons": "3.0.0-preview-20251215120148",
|
|
51
|
+
"@medusajs/js-sdk": "3.0.0-preview-20251215120148",
|
|
52
|
+
"@medusajs/ui": "4.0.31-preview-20251215120148",
|
|
53
53
|
"@radix-ui/react-dialog": "1.1.4",
|
|
54
54
|
"@radix-ui/react-dismissable-layer": "1.1.4",
|
|
55
55
|
"@tanstack/react-query": "5.64.2",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"zod": "3.25.76"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@medusajs/admin-shared": "3.0.0-preview-
|
|
84
|
-
"@medusajs/admin-vite-plugin": "3.0.0-preview-
|
|
85
|
-
"@medusajs/types": "3.0.0-preview-
|
|
86
|
-
"@medusajs/ui-preset": "3.0.0-preview-
|
|
83
|
+
"@medusajs/admin-shared": "3.0.0-preview-20251215120148",
|
|
84
|
+
"@medusajs/admin-vite-plugin": "3.0.0-preview-20251215120148",
|
|
85
|
+
"@medusajs/types": "3.0.0-preview-20251215120148",
|
|
86
|
+
"@medusajs/ui-preset": "3.0.0-preview-20251215120148"
|
|
87
87
|
},
|
|
88
88
|
"packageManager": "yarn@3.2.1"
|
|
89
89
|
}
|
|
@@ -100,19 +100,10 @@ export const AddLocalesForm = ({ store }: AddLocalesFormProps) => {
|
|
|
100
100
|
new Set([...data.locales, ...preSelectedRows])
|
|
101
101
|
) as string[]
|
|
102
102
|
|
|
103
|
-
let defaultLocale = store.supported_locales?.find(
|
|
104
|
-
(l) => l.is_default
|
|
105
|
-
)?.locale_code
|
|
106
|
-
|
|
107
|
-
if (!locales.includes(defaultLocale ?? "")) {
|
|
108
|
-
defaultLocale = locales?.[0]
|
|
109
|
-
}
|
|
110
|
-
|
|
111
103
|
await mutateAsync(
|
|
112
104
|
{
|
|
113
105
|
supported_locales: locales.map((l) => ({
|
|
114
106
|
locale_code: l,
|
|
115
|
-
is_default: l === defaultLocale,
|
|
116
107
|
})),
|
|
117
108
|
},
|
|
118
109
|
{
|
package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import { Link } from "react-router-dom"
|
|
|
7
7
|
import { ActionMenu } from "../../../../../components/common/action-menu"
|
|
8
8
|
import { useSalesChannel, useStockLocation } from "../../../../../hooks/api"
|
|
9
9
|
import { useRegion } from "../../../../../hooks/api/regions"
|
|
10
|
-
import { useFeatureFlag } from "../../../../../providers/feature-flag-provider"
|
|
11
10
|
|
|
12
11
|
type StoreGeneralSectionProps = {
|
|
13
12
|
store: AdminStore
|
|
@@ -15,14 +14,12 @@ type StoreGeneralSectionProps = {
|
|
|
15
14
|
|
|
16
15
|
export const StoreGeneralSection = ({ store }: StoreGeneralSectionProps) => {
|
|
17
16
|
const { t } = useTranslation()
|
|
18
|
-
const isTranslationsEnabled = useFeatureFlag("translation")
|
|
19
17
|
|
|
20
18
|
const { region } = useRegion(store.default_region_id!, undefined, {
|
|
21
19
|
enabled: !!store.default_region_id,
|
|
22
20
|
})
|
|
23
21
|
|
|
24
22
|
const defaultCurrency = store.supported_currencies?.find((c) => c.is_default)
|
|
25
|
-
const defaultLocale = store.supported_locales?.find((l) => l.is_default)
|
|
26
23
|
|
|
27
24
|
const { sales_channel } = useSalesChannel(store.default_sales_channel_id!, {
|
|
28
25
|
enabled: !!store.default_sales_channel_id,
|
|
@@ -88,27 +85,6 @@ export const StoreGeneralSection = ({ store }: StoreGeneralSectionProps) => {
|
|
|
88
85
|
</Text>
|
|
89
86
|
)}
|
|
90
87
|
</div>
|
|
91
|
-
{isTranslationsEnabled && (
|
|
92
|
-
<div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
|
|
93
|
-
<Text size="small" leading="compact" weight="plus">
|
|
94
|
-
{t("store.defaultLocale")}
|
|
95
|
-
</Text>
|
|
96
|
-
{defaultLocale ? (
|
|
97
|
-
<div className="flex items-center gap-x-2">
|
|
98
|
-
<Badge size="2xsmall">
|
|
99
|
-
{defaultLocale.locale_code?.toUpperCase()}
|
|
100
|
-
</Badge>
|
|
101
|
-
<Text size="small" leading="compact">
|
|
102
|
-
{defaultLocale.locale?.name}
|
|
103
|
-
</Text>
|
|
104
|
-
</div>
|
|
105
|
-
) : (
|
|
106
|
-
<Text size="small" leading="compact">
|
|
107
|
-
-
|
|
108
|
-
</Text>
|
|
109
|
-
)}
|
|
110
|
-
</div>
|
|
111
|
-
)}
|
|
112
88
|
<div className="text-ui-fg-subtle grid grid-cols-2 px-6 py-4">
|
|
113
89
|
<Text size="small" leading="compact" weight="plus">
|
|
114
90
|
{t("store.defaultRegion")}
|
package/src/routes/store/store-detail/components/store-locale-section/store-locale-section.tsx
CHANGED
|
@@ -60,8 +60,6 @@ export const StoreLocaleSection = ({ store }: StoreLocaleSectionProps) => {
|
|
|
60
60
|
meta: {
|
|
61
61
|
storeId: store.id,
|
|
62
62
|
supportedLocales: store.supported_locales,
|
|
63
|
-
defaultLocaleCode: store.supported_locales?.find((l) => l.is_default)
|
|
64
|
-
?.locale_code,
|
|
65
63
|
},
|
|
66
64
|
})
|
|
67
65
|
|
|
@@ -165,12 +163,10 @@ const LocaleActions = ({
|
|
|
165
163
|
storeId,
|
|
166
164
|
locale,
|
|
167
165
|
supportedLocales,
|
|
168
|
-
defaultLocaleCode,
|
|
169
166
|
}: {
|
|
170
167
|
storeId: string
|
|
171
168
|
locale: HttpTypes.AdminLocale
|
|
172
169
|
supportedLocales: HttpTypes.AdminStoreLocale[]
|
|
173
|
-
defaultLocaleCode: string
|
|
174
170
|
}) => {
|
|
175
171
|
const { mutateAsync } = useUpdateStore(storeId)
|
|
176
172
|
const { t } = useTranslation()
|
|
@@ -218,7 +214,6 @@ const LocaleActions = ({
|
|
|
218
214
|
icon: <Trash />,
|
|
219
215
|
label: t("actions.remove"),
|
|
220
216
|
onClick: handleRemove,
|
|
221
|
-
disabled: locale.code === defaultLocaleCode,
|
|
222
217
|
},
|
|
223
218
|
],
|
|
224
219
|
},
|
|
@@ -267,9 +262,7 @@ const useColumns = () => {
|
|
|
267
262
|
columnHelper.display({
|
|
268
263
|
id: "actions",
|
|
269
264
|
cell: ({ row, table }) => {
|
|
270
|
-
const { supportedLocales, storeId
|
|
271
|
-
.meta as {
|
|
272
|
-
defaultLocaleCode: string
|
|
265
|
+
const { supportedLocales, storeId } = table.options.meta as {
|
|
273
266
|
supportedLocales: HttpTypes.AdminStoreLocale[]
|
|
274
267
|
storeId: string
|
|
275
268
|
}
|
|
@@ -279,7 +272,6 @@ const useColumns = () => {
|
|
|
279
272
|
storeId={storeId}
|
|
280
273
|
locale={row.original}
|
|
281
274
|
supportedLocales={supportedLocales}
|
|
282
|
-
defaultLocaleCode={defaultLocaleCode}
|
|
283
275
|
/>
|
|
284
276
|
)
|
|
285
277
|
},
|
|
@@ -13,7 +13,6 @@ import { useUpdateStore } from "../../../../../hooks/api/store"
|
|
|
13
13
|
import { useComboboxData } from "../../../../../hooks/use-combobox-data"
|
|
14
14
|
import { sdk } from "../../../../../lib/client"
|
|
15
15
|
import { useDocumentDirection } from "../../../../../hooks/use-document-direction"
|
|
16
|
-
import { useFeatureFlag } from "../../../../../providers/feature-flag-provider"
|
|
17
16
|
|
|
18
17
|
type EditStoreFormProps = {
|
|
19
18
|
store: HttpTypes.AdminStore
|
|
@@ -22,7 +21,6 @@ type EditStoreFormProps = {
|
|
|
22
21
|
const EditStoreSchema = z.object({
|
|
23
22
|
name: z.string().min(1),
|
|
24
23
|
default_currency_code: z.string().optional(),
|
|
25
|
-
default_locale_code: z.string().optional(),
|
|
26
24
|
default_region_id: z.string().optional(),
|
|
27
25
|
default_sales_channel_id: z.string().optional(),
|
|
28
26
|
default_location_id: z.string().optional(),
|
|
@@ -30,16 +28,12 @@ const EditStoreSchema = z.object({
|
|
|
30
28
|
|
|
31
29
|
export const EditStoreForm = ({ store }: EditStoreFormProps) => {
|
|
32
30
|
const { t } = useTranslation()
|
|
33
|
-
const isTranslationsEnabled = useFeatureFlag("translation")
|
|
34
31
|
const { handleSuccess } = useRouteModal()
|
|
35
32
|
const direction = useDocumentDirection()
|
|
36
33
|
const form = useForm<z.infer<typeof EditStoreSchema>>({
|
|
37
34
|
defaultValues: {
|
|
38
35
|
name: store.name,
|
|
39
36
|
default_region_id: store.default_region_id || undefined,
|
|
40
|
-
default_locale_code:
|
|
41
|
-
store.supported_locales?.find((l) => l.is_default)?.locale_code ||
|
|
42
|
-
undefined,
|
|
43
37
|
default_currency_code:
|
|
44
38
|
store.supported_currencies?.find((c) => c.is_default)?.currency_code ||
|
|
45
39
|
undefined,
|
|
@@ -79,14 +73,10 @@ export const EditStoreForm = ({ store }: EditStoreFormProps) => {
|
|
|
79
73
|
})
|
|
80
74
|
|
|
81
75
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
82
|
-
const { default_currency_code,
|
|
76
|
+
const { default_currency_code, ...rest } = values
|
|
83
77
|
|
|
84
78
|
const normalizedMutation: HttpTypes.AdminUpdateStore = {
|
|
85
79
|
...rest,
|
|
86
|
-
supported_locales: store.supported_locales?.map((l) => ({
|
|
87
|
-
...l,
|
|
88
|
-
is_default: l.locale_code === default_locale_code,
|
|
89
|
-
})),
|
|
90
80
|
supported_currencies: store.supported_currencies?.map((c) => ({
|
|
91
81
|
...c,
|
|
92
82
|
is_default: c.currency_code === default_currency_code,
|
|
@@ -156,40 +146,6 @@ export const EditStoreForm = ({ store }: EditStoreFormProps) => {
|
|
|
156
146
|
)
|
|
157
147
|
}}
|
|
158
148
|
/>
|
|
159
|
-
{isTranslationsEnabled && (
|
|
160
|
-
<Form.Field
|
|
161
|
-
control={form.control}
|
|
162
|
-
name="default_locale_code"
|
|
163
|
-
render={({ field: { onChange, ...field } }) => {
|
|
164
|
-
return (
|
|
165
|
-
<Form.Item>
|
|
166
|
-
<Form.Label>{t("store.defaultLocale")}</Form.Label>
|
|
167
|
-
<Form.Control>
|
|
168
|
-
<Select
|
|
169
|
-
dir={direction}
|
|
170
|
-
{...field}
|
|
171
|
-
onValueChange={onChange}
|
|
172
|
-
>
|
|
173
|
-
<Select.Trigger ref={field.ref}>
|
|
174
|
-
<Select.Value />
|
|
175
|
-
</Select.Trigger>
|
|
176
|
-
<Select.Content>
|
|
177
|
-
{store.supported_locales?.map((locale) => (
|
|
178
|
-
<Select.Item
|
|
179
|
-
key={locale.locale_code}
|
|
180
|
-
value={locale.locale_code}
|
|
181
|
-
>
|
|
182
|
-
{locale.locale_code}
|
|
183
|
-
</Select.Item>
|
|
184
|
-
))}
|
|
185
|
-
</Select.Content>
|
|
186
|
-
</Select>
|
|
187
|
-
</Form.Control>
|
|
188
|
-
</Form.Item>
|
|
189
|
-
)
|
|
190
|
-
}}
|
|
191
|
-
/>
|
|
192
|
-
)}
|
|
193
149
|
<Form.Field
|
|
194
150
|
control={form.control}
|
|
195
151
|
name="default_region_id"
|