@acmekit/dashboard 2.13.8 → 2.13.9

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.
Files changed (57) hide show
  1. package/dist/{api-key-management-create-D57V3NN2.mjs → api-key-management-create-VWUERPPB.mjs} +1 -1
  2. package/dist/{api-key-management-detail-QURSBB6T.mjs → api-key-management-detail-V4ENQHYY.mjs} +19 -20
  3. package/dist/{api-key-management-edit-GG5V77GY.mjs → api-key-management-edit-R44OHS7B.mjs} +1 -1
  4. package/dist/{api-key-management-list-PL64LD22.mjs → api-key-management-list-K2XPKF5E.mjs} +13 -13
  5. package/dist/app.js +2252 -2783
  6. package/dist/app.mjs +52 -205
  7. package/dist/{chunk-VBT5YZ4K.mjs → chunk-EFRMWHRX.mjs} +6 -51
  8. package/dist/{chunk-6SQCO25J.mjs → chunk-ST2YB7JN.mjs} +16 -7
  9. package/dist/{login-YURMNRCS.mjs → login-GNP3QIPI.mjs} +10 -11
  10. package/dist/{translation-list-H5X4DVCC.mjs → translation-list-CCEQJNED.mjs} +18 -24
  11. package/dist/{translations-edit-NPAUN2GZ.mjs → translations-edit-E57GVUFV.mjs} +27 -27
  12. package/dist/{user-invite-OREFWWYL.mjs → user-invite-E3FAAU3V.mjs} +11 -11
  13. package/dist/{chunk-YB52HEIR.mjs → user-metadata-5GQK75DT.mjs} +44 -6
  14. package/dist/{workflow-execution-detail-MWNM25TF.mjs → workflow-execution-detail-LZXCRVNC.mjs} +9 -10
  15. package/dist/{workflow-execution-list-IGYF44UH.mjs → workflow-execution-list-HQ3V6TML.mjs} +12 -12
  16. package/package.json +9 -9
  17. package/src/dashboard-app/routes/get-route.map.tsx +1 -14
  18. package/src/hooks/api/api-keys.tsx +0 -49
  19. package/src/hooks/api/index.ts +0 -1
  20. package/src/providers/keybind-provider/hooks.tsx +0 -145
  21. package/src/routes/translations/translation-list/translation-list.tsx +10 -21
  22. package/src/routes/translations/translations-edit/translations-edit.tsx +14 -11
  23. package/src/vite-env.d.ts +3 -1
  24. package/dist/chunk-OHAFITSB.mjs +0 -54
  25. package/dist/store-detail-SQKV5KBD.mjs +0 -109
  26. package/dist/store-edit-WGGIJMYJ.mjs +0 -97
  27. package/dist/store-metadata-CSBUGX6Z.mjs +0 -49
  28. package/dist/user-metadata-QHUX5SHZ.mjs +0 -51
  29. package/src/components/data-table/helpers/sales-channels/index.ts +0 -4
  30. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-columns.tsx +0 -61
  31. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-empty-state.tsx +0 -22
  32. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-filters.tsx +0 -33
  33. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-query.tsx +0 -30
  34. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +0 -206
  35. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/index.ts +0 -1
  36. package/src/routes/store/common/hooks/use-currencies-table-columns.tsx +0 -29
  37. package/src/routes/store/common/hooks/use-currencies-table-query.tsx +0 -21
  38. package/src/routes/store/common/hooks/use-locales-table-columns.tsx +0 -29
  39. package/src/routes/store/common/hooks/use-locales-table-query.tsx +0 -21
  40. package/src/routes/store/store-detail/components/store-general-section/index.ts +0 -1
  41. package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +0 -48
  42. package/src/routes/store/store-detail/index.ts +0 -2
  43. package/src/routes/store/store-detail/loader.ts +0 -18
  44. package/src/routes/store/store-detail/store-detail.tsx +0 -42
  45. package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +0 -83
  46. package/src/routes/store/store-edit/index.ts +0 -1
  47. package/src/routes/store/store-edit/store-edit.tsx +0 -25
  48. package/src/routes/store/store-metadata/index.ts +0 -1
  49. package/src/routes/store/store-metadata/store-metadata.tsx +0 -24
  50. package/dist/{chunk-7ZHDHEUH.mjs → chunk-YLPAZ2DP.mjs} +3 -3
  51. package/dist/{invite-BAFXQBLJ.mjs → invite-XGPZZBUP.mjs} +3 -3
  52. package/dist/{profile-detail-SJWODS2K.mjs → profile-detail-YX27F7N6.mjs} +8 -8
  53. package/dist/{profile-edit-HSGF4UXZ.mjs → profile-edit-2VRDU75O.mjs} +9 -9
  54. package/dist/{reset-password-RQ5M7HQC.mjs → reset-password-TWRNZO6Z.mjs} +1 -1
  55. package/dist/{user-detail-7SUQ35G7.mjs → user-detail-KUSRRVNX.mjs} +7 -7
  56. package/dist/{user-edit-KUZV37AH.mjs → user-edit-HTN3ZGCL.mjs} +4 -4
  57. package/dist/{user-list-OWUR75OP.mjs → user-list-KNJ5S3IM.mjs} +12 -12
@@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom"
5
5
  import { TwoColumnPageSkeleton } from "../../../components/common/skeleton"
6
6
  import { TwoColumnPage } from "../../../components/layout/pages"
7
7
  import {
8
- useStore,
8
+ useLocales,
9
9
  useTranslationSettings,
10
10
  useTranslationStatistics,
11
11
  } from "../../../hooks/api"
@@ -26,7 +26,9 @@ export const TranslationList = () => {
26
26
  const { t } = useTranslation()
27
27
  const navigate = useNavigate()
28
28
 
29
- const { store, isPending, isError, error } = useStore()
29
+ const { locales: localesList, isPending, isError, error } = useLocales()
30
+ const supportedLocales =
31
+ localesList?.map((l) => ({ locale_code: l.code, locale: l.code })) ?? []
30
32
  const {
31
33
  translation_settings,
32
34
  isPending: isTranslationSettingsPending,
@@ -42,17 +44,12 @@ export const TranslationList = () => {
42
44
  error: translationStatisticsError,
43
45
  } = useTranslationStatistics(
44
46
  {
45
- locales:
46
- store?.supported_locales?.map(
47
- (suportedLocale) => suportedLocale.locale_code
48
- ) ?? [],
47
+ locales: supportedLocales.map((l) => l.locale_code),
49
48
  entity_types: Object.keys(translation_settings ?? {}),
50
49
  },
51
50
  {
52
51
  enabled:
53
- !!translation_settings &&
54
- !!store &&
55
- store.supported_locales?.length > 0,
52
+ !!translation_settings && supportedLocales.length > 0,
56
53
  }
57
54
  )
58
55
 
@@ -60,7 +57,7 @@ export const TranslationList = () => {
60
57
  throw error || translationSettingsError || translationStatisticsError
61
58
  }
62
59
 
63
- const hasLocales = (store?.supported_locales ?? []).length > 0
60
+ const hasLocales = supportedLocales.length > 0
64
61
 
65
62
  const translatableEntities: TranslatableEntity[] = useMemo(() => {
66
63
  if (!translation_settings) {
@@ -104,7 +101,7 @@ export const TranslationList = () => {
104
101
  }, [navigate])
105
102
 
106
103
  const isReady =
107
- !!store &&
104
+ !!localesList &&
108
105
  !isPending &&
109
106
  !isTranslationSettingsPending &&
110
107
  !!translation_settings &&
@@ -168,19 +165,11 @@ export const TranslationList = () => {
168
165
  </TwoColumnPage.Main>
169
166
  <TwoColumnPage.Sidebar>
170
167
  <ActiveLocalesSection
171
- locales={
172
- store?.supported_locales?.map(
173
- (suportedLocale) => suportedLocale.locale
174
- ) ?? []
175
- }
168
+ locales={supportedLocales.map((l) => l.locale)}
176
169
  ></ActiveLocalesSection>
177
170
  <TranslationsCompletionSection
178
171
  statistics={statistics ?? {}}
179
- locales={
180
- store?.supported_locales?.map(
181
- (supportedLocale) => supportedLocale.locale
182
- ) ?? []
183
- }
172
+ locales={supportedLocales.map((l) => l.locale)}
184
173
  />
185
174
  </TwoColumnPage.Sidebar>
186
175
  </TwoColumnPage>
@@ -3,8 +3,8 @@ import { useEffect } from "react"
3
3
  import { useNavigate, useSearchParams } from "react-router-dom"
4
4
  import { RouteFocusModal } from "../../../components/modals"
5
5
  import {
6
+ useLocales,
6
7
  useReferenceTranslations,
7
- useStore,
8
8
  useTranslationSettings,
9
9
  } from "../../../hooks/api"
10
10
  import { useFeatureFlag } from "../../../providers/feature-flag-provider"
@@ -46,11 +46,14 @@ export const TranslationsEdit = () => {
46
46
  placeholderData: keepPreviousData,
47
47
  })
48
48
  const {
49
- store,
50
- isPending: isStorePending,
51
- isError: isStoreError,
52
- error: storeError,
53
- } = useStore()
49
+ locales: localesList,
50
+ isPending: isLocalesPending,
51
+ isError: isLocalesError,
52
+ error: localesError,
53
+ } = useLocales()
54
+
55
+ const availableLocales =
56
+ localesList?.map((l) => ({ locale_code: l.code, locale: l.code })) ?? []
54
57
 
55
58
  const ready =
56
59
  !isPending &&
@@ -58,11 +61,11 @@ export const TranslationsEdit = () => {
58
61
  !!translation_settings &&
59
62
  !isTranslationSettingsPending &&
60
63
  !!references &&
61
- !isStorePending &&
62
- !!store
64
+ !isLocalesPending &&
65
+ !!localesList
63
66
 
64
- if (isError || isStoreError || isTranslationSettingsError) {
65
- throw error || storeError || translationSettingsError
67
+ if (isError || isLocalesError || isTranslationSettingsError) {
68
+ throw error || localesError || translationSettingsError
66
69
  }
67
70
 
68
71
  return (
@@ -72,7 +75,7 @@ export const TranslationsEdit = () => {
72
75
  translations={translations}
73
76
  references={references}
74
77
  entityType={reference!}
75
- availableLocales={store?.supported_locales ?? []}
78
+ availableLocales={availableLocales}
76
79
  translatableFields={translation_settings[reference!]?.fields ?? []}
77
80
  fetchNextPage={fetchNextPage}
78
81
  hasNextPage={hasNextPage}
package/src/vite-env.d.ts CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  interface ImportMetaEnv {
4
4
  readonly VITE_ACMEKIT_ADMIN_BACKEND_URL: string
5
+ readonly VITE_ACMEKIT_FRONTEND_URL: string
6
+ /** @deprecated Use VITE_ACMEKIT_FRONTEND_URL */
5
7
  readonly VITE_ACMEKIT_STOREFRONT_URL: string
6
8
  readonly VITE_ACMEKIT_V2: "true" | "false"
7
9
  }
@@ -14,7 +16,7 @@ interface ImportMeta {
14
16
  }
15
17
 
16
18
  declare const __BACKEND_URL__: string | undefined
17
- declare const __STOREFRONT_URL__: string | undefined
19
+ declare const __FRONTEND_URL__: string | undefined
18
20
  declare const __BASE__: string
19
21
  declare const __AUTH_TYPE__: "session" | "jwt" | undefined
20
22
  declare const __JWT_TOKEN_STORAGE_KEY__: string | undefined
@@ -1,54 +0,0 @@
1
- import {
2
- queryClient
3
- } from "./chunk-FXYH54JP.mjs";
4
- import {
5
- queryKeysFactory
6
- } from "./chunk-774WSTCC.mjs";
7
- import {
8
- sdk
9
- } from "./chunk-DTY37DDZ.mjs";
10
-
11
- // src/hooks/api/store.tsx
12
- import {
13
- useMutation,
14
- useQuery
15
- } from "@tanstack/react-query";
16
- import { FetchError } from "@acmekit/js-sdk";
17
- var STORE_QUERY_KEY = "store";
18
- var storeQueryKeys = queryKeysFactory(STORE_QUERY_KEY);
19
- async function retrieveActiveStore(query) {
20
- const response = await sdk.admin.store.list(query);
21
- const activeStore = response.stores?.[0];
22
- if (!activeStore) {
23
- throw new FetchError("No active store found", "Not Found", 404);
24
- }
25
- return { store: activeStore };
26
- }
27
- var useStore = (query, options) => {
28
- const { data, ...rest } = useQuery({
29
- queryFn: () => retrieveActiveStore(query),
30
- queryKey: storeQueryKeys.details(),
31
- ...options
32
- });
33
- return {
34
- ...data,
35
- ...rest
36
- };
37
- };
38
- var useUpdateStore = (id, options) => {
39
- return useMutation({
40
- mutationFn: (payload) => sdk.admin.store.update(id, payload),
41
- onSuccess: (data, variables, context) => {
42
- queryClient.invalidateQueries({ queryKey: storeQueryKeys.details() });
43
- options?.onSuccess?.(data, variables, context);
44
- },
45
- ...options
46
- });
47
- };
48
-
49
- export {
50
- storeQueryKeys,
51
- retrieveActiveStore,
52
- useStore,
53
- useUpdateStore
54
- };
@@ -1,109 +0,0 @@
1
- import {
2
- retrieveActiveStore,
3
- storeQueryKeys,
4
- useStore
5
- } from "./chunk-OHAFITSB.mjs";
6
- import {
7
- SingleColumnPage
8
- } from "./chunk-22YYMH6M.mjs";
9
- import {
10
- useExtension
11
- } from "./chunk-C5P5PL3E.mjs";
12
- import {
13
- SingleColumnPageSkeleton
14
- } from "./chunk-ITNQKZQQ.mjs";
15
- import {
16
- ActionMenu
17
- } from "./chunk-S3REQHPQ.mjs";
18
- import "./chunk-OAHCJFG3.mjs";
19
- import "./chunk-S4DMV3ZT.mjs";
20
- import {
21
- queryClient
22
- } from "./chunk-FXYH54JP.mjs";
23
- import "./chunk-774WSTCC.mjs";
24
- import "./chunk-DTY37DDZ.mjs";
25
- import "./chunk-QZ7TP4HQ.mjs";
26
-
27
- // src/routes/store/store-detail/loader.ts
28
- var storeDetailQuery = () => ({
29
- queryKey: storeQueryKeys.details(),
30
- queryFn: async () => retrieveActiveStore()
31
- });
32
- var storeLoader = async () => {
33
- const query = storeDetailQuery();
34
- return queryClient.getQueryData(query.queryKey) ?? await queryClient.fetchQuery(query);
35
- };
36
-
37
- // src/routes/store/store-detail/store-detail.tsx
38
- import { useLoaderData } from "react-router-dom";
39
-
40
- // src/routes/store/store-detail/components/store-general-section/store-general-section.tsx
41
- import { PencilSquare } from "@acmekit/icons";
42
- import { Container, Heading, Text } from "@acmekit/ui";
43
- import { useTranslation } from "react-i18next";
44
- import { jsx, jsxs } from "react/jsx-runtime";
45
- var StoreGeneralSection = ({ store }) => {
46
- const { t } = useTranslation();
47
- return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
48
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
49
- /* @__PURE__ */ jsxs("div", { children: [
50
- /* @__PURE__ */ jsx(Heading, { children: t("store.domain") }),
51
- /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", size: "small", children: t("store.manageYourStoresDetails") })
52
- ] }),
53
- /* @__PURE__ */ jsx(
54
- ActionMenu,
55
- {
56
- groups: [
57
- {
58
- actions: [
59
- {
60
- icon: /* @__PURE__ */ jsx(PencilSquare, {}),
61
- label: t("actions.edit"),
62
- to: "edit"
63
- }
64
- ]
65
- }
66
- ]
67
- }
68
- )
69
- ] }),
70
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
71
- /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.name") }),
72
- /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: store.name })
73
- ] })
74
- ] });
75
- };
76
-
77
- // src/routes/store/store-detail/store-detail.tsx
78
- import { jsx as jsx2 } from "react/jsx-runtime";
79
- var StoreDetail = () => {
80
- const initialData = useLoaderData();
81
- const { store, isPending, isError, error } = useStore(void 0, {
82
- initialData
83
- });
84
- const { getWidgets } = useExtension();
85
- if (isPending || !store) {
86
- return /* @__PURE__ */ jsx2(SingleColumnPageSkeleton, { sections: 1, showJSON: true, showMetadata: true });
87
- }
88
- if (isError) {
89
- throw error;
90
- }
91
- return /* @__PURE__ */ jsx2(
92
- SingleColumnPage,
93
- {
94
- widgets: {
95
- before: getWidgets("store.details.before"),
96
- after: getWidgets("store.details.after")
97
- },
98
- data: store,
99
- hasOutlet: true,
100
- showMetadata: true,
101
- showJSON: true,
102
- children: /* @__PURE__ */ jsx2(StoreGeneralSection, { store })
103
- }
104
- );
105
- };
106
- export {
107
- StoreDetail as Component,
108
- storeLoader as loader
109
- };
@@ -1,97 +0,0 @@
1
- import "./chunk-IUCDCPJU.mjs";
2
- import {
3
- useStore,
4
- useUpdateStore
5
- } from "./chunk-OHAFITSB.mjs";
6
- import {
7
- KeyboundForm,
8
- RouteDrawer,
9
- useRouteModal
10
- } from "./chunk-2U3RK3JG.mjs";
11
- import {
12
- Form
13
- } from "./chunk-ND3ODI36.mjs";
14
- import "./chunk-FXYH54JP.mjs";
15
- import "./chunk-774WSTCC.mjs";
16
- import "./chunk-DTY37DDZ.mjs";
17
- import "./chunk-QZ7TP4HQ.mjs";
18
-
19
- // src/routes/store/store-edit/store-edit.tsx
20
- import { Heading } from "@acmekit/ui";
21
- import { useTranslation as useTranslation2 } from "react-i18next";
22
-
23
- // src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx
24
- import { zodResolver } from "@hookform/resolvers/zod";
25
- import { Button, Input, toast } from "@acmekit/ui";
26
- import { useForm } from "react-hook-form";
27
- import { useTranslation } from "react-i18next";
28
- import { z } from "zod";
29
- import { jsx, jsxs } from "react/jsx-runtime";
30
- var EditStoreSchema = z.object({
31
- name: z.string().min(1)
32
- });
33
- var EditStoreForm = ({ store }) => {
34
- const { t } = useTranslation();
35
- const { handleSuccess } = useRouteModal();
36
- const form = useForm({
37
- defaultValues: {
38
- name: store.name
39
- },
40
- resolver: zodResolver(EditStoreSchema)
41
- });
42
- const { mutateAsync, isPending } = useUpdateStore(store.id);
43
- const handleSubmit = form.handleSubmit(async (values) => {
44
- await mutateAsync(values, {
45
- onSuccess: () => {
46
- toast.success(t("store.toast.update"));
47
- handleSuccess();
48
- },
49
- onError: (error) => {
50
- toast.error(error.message);
51
- }
52
- });
53
- });
54
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
55
- KeyboundForm,
56
- {
57
- onSubmit: handleSubmit,
58
- className: "flex h-full flex-col overflow-hidden",
59
- children: [
60
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-8", children: /* @__PURE__ */ jsx(
61
- Form.Field,
62
- {
63
- control: form.control,
64
- name: "name",
65
- render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
66
- /* @__PURE__ */ jsx(Form.Label, { children: t("fields.name") }),
67
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { placeholder: "ACME", ...field }) }),
68
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
69
- ] })
70
- }
71
- ) }) }),
72
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
73
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
74
- /* @__PURE__ */ jsx(Button, { size: "small", isLoading: isPending, type: "submit", children: t("actions.save") })
75
- ] }) })
76
- ]
77
- }
78
- ) });
79
- };
80
-
81
- // src/routes/store/store-edit/store-edit.tsx
82
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
83
- var StoreEdit = () => {
84
- const { t } = useTranslation2();
85
- const { store, isPending: isLoading, isError, error } = useStore();
86
- if (isError) {
87
- throw error;
88
- }
89
- const ready = !!store && !isLoading;
90
- return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
91
- /* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(Heading, { children: t("store.edit.header") }) }),
92
- ready && /* @__PURE__ */ jsx2(EditStoreForm, { store })
93
- ] });
94
- };
95
- export {
96
- StoreEdit as Component
97
- };
@@ -1,49 +0,0 @@
1
- import {
2
- MetadataForm
3
- } from "./chunk-YB52HEIR.mjs";
4
- import "./chunk-6SQCO25J.mjs";
5
- import "./chunk-ULSPL3DR.mjs";
6
- import "./chunk-GBFVWROS.mjs";
7
- import "./chunk-VBT5YZ4K.mjs";
8
- import "./chunk-LKWTBYYC.mjs";
9
- import "./chunk-IUCDCPJU.mjs";
10
- import {
11
- useStore,
12
- useUpdateStore
13
- } from "./chunk-OHAFITSB.mjs";
14
- import "./chunk-DN3MIYQH.mjs";
15
- import "./chunk-YRWSG3YM.mjs";
16
- import "./chunk-XIM7X4FB.mjs";
17
- import "./chunk-ITNQKZQQ.mjs";
18
- import {
19
- RouteDrawer
20
- } from "./chunk-2U3RK3JG.mjs";
21
- import "./chunk-ND3ODI36.mjs";
22
- import "./chunk-OAHCJFG3.mjs";
23
- import "./chunk-S4DMV3ZT.mjs";
24
- import "./chunk-FXYH54JP.mjs";
25
- import "./chunk-774WSTCC.mjs";
26
- import "./chunk-DTY37DDZ.mjs";
27
- import "./chunk-QZ7TP4HQ.mjs";
28
-
29
- // src/routes/store/store-metadata/store-metadata.tsx
30
- import { jsx } from "react/jsx-runtime";
31
- var StoreMetadata = () => {
32
- const { store, isPending, isError, error } = useStore();
33
- const { mutateAsync, isPending: isMutating } = useUpdateStore(store?.id);
34
- if (isError) {
35
- throw error;
36
- }
37
- return /* @__PURE__ */ jsx(RouteDrawer, { children: /* @__PURE__ */ jsx(
38
- MetadataForm,
39
- {
40
- isPending,
41
- isMutating,
42
- hook: mutateAsync,
43
- metadata: store?.metadata
44
- }
45
- ) });
46
- };
47
- export {
48
- StoreMetadata as Component
49
- };
@@ -1,51 +0,0 @@
1
- import {
2
- MetadataForm
3
- } from "./chunk-YB52HEIR.mjs";
4
- import "./chunk-6SQCO25J.mjs";
5
- import "./chunk-ULSPL3DR.mjs";
6
- import "./chunk-GBFVWROS.mjs";
7
- import "./chunk-VBT5YZ4K.mjs";
8
- import "./chunk-LKWTBYYC.mjs";
9
- import "./chunk-IUCDCPJU.mjs";
10
- import "./chunk-OHAFITSB.mjs";
11
- import "./chunk-DN3MIYQH.mjs";
12
- import {
13
- useUpdateUser,
14
- useUser
15
- } from "./chunk-YRWSG3YM.mjs";
16
- import "./chunk-XIM7X4FB.mjs";
17
- import "./chunk-ITNQKZQQ.mjs";
18
- import {
19
- RouteDrawer
20
- } from "./chunk-2U3RK3JG.mjs";
21
- import "./chunk-ND3ODI36.mjs";
22
- import "./chunk-OAHCJFG3.mjs";
23
- import "./chunk-S4DMV3ZT.mjs";
24
- import "./chunk-FXYH54JP.mjs";
25
- import "./chunk-774WSTCC.mjs";
26
- import "./chunk-DTY37DDZ.mjs";
27
- import "./chunk-QZ7TP4HQ.mjs";
28
-
29
- // src/routes/users/user-metadata/user-metadata.tsx
30
- import { useParams } from "react-router-dom";
31
- import { jsx } from "react/jsx-runtime";
32
- var UserMetadata = () => {
33
- const { id } = useParams();
34
- const { user, isPending, isError, error } = useUser(id);
35
- const { mutateAsync, isPending: isMutating } = useUpdateUser(id);
36
- if (isError) {
37
- throw error;
38
- }
39
- return /* @__PURE__ */ jsx(RouteDrawer, { children: /* @__PURE__ */ jsx(
40
- MetadataForm,
41
- {
42
- isPending,
43
- isMutating,
44
- hook: mutateAsync,
45
- metadata: user?.metadata
46
- }
47
- ) });
48
- };
49
- export {
50
- UserMetadata as Component
51
- };
@@ -1,4 +0,0 @@
1
- export * from "./use-sales-channel-table-columns"
2
- export * from "./use-sales-channel-table-empty-state"
3
- export * from "./use-sales-channel-table-filters"
4
- export * from "./use-sales-channel-table-query"
@@ -1,61 +0,0 @@
1
- import { HttpTypes } from "@acmekit/types"
2
- import { useMemo } from "react"
3
- import { useTranslation } from "react-i18next"
4
-
5
- import { createDataTableColumnHelper, Tooltip } from "@acmekit/ui"
6
- import { DataTableStatusCell } from "../../components/data-table-status-cell/data-table-status-cell"
7
- import { useDataTableDateColumns } from "../general/use-data-table-date-columns"
8
-
9
- const columnHelper = createDataTableColumnHelper<HttpTypes.AdminSalesChannel>()
10
-
11
- export const useSalesChannelTableColumns = () => {
12
- const { t } = useTranslation()
13
- const dateColumns = useDataTableDateColumns<HttpTypes.AdminSalesChannel>()
14
-
15
- return useMemo(
16
- () => [
17
- columnHelper.accessor("name", {
18
- header: () => t("fields.name"),
19
- enableSorting: true,
20
- sortLabel: t("fields.name"),
21
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
22
- sortDescLabel: t("filters.sorting.alphabeticallyDesc"),
23
- }),
24
- columnHelper.accessor("description", {
25
- header: () => t("fields.description"),
26
- cell: ({ getValue }) => {
27
- return (
28
- <Tooltip content={getValue()}>
29
- <div className="flex h-full w-full items-center overflow-hidden">
30
- <span className="truncate">{getValue()}</span>
31
- </div>
32
- </Tooltip>
33
- )
34
- },
35
- enableSorting: true,
36
- sortLabel: t("fields.description"),
37
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
38
- sortDescLabel: t("filters.sorting.alphabeticallyDesc"),
39
- maxSize: 250,
40
- minSize: 100,
41
- }),
42
- columnHelper.accessor("is_disabled", {
43
- header: () => t("fields.status"),
44
- enableSorting: true,
45
- sortLabel: t("fields.status"),
46
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
47
- sortDescLabel: t("filters.sorting.alphabeticallyDesc"),
48
- cell: ({ getValue }) => {
49
- const value = getValue()
50
- return (
51
- <DataTableStatusCell color={value ? "grey" : "green"}>
52
- {value ? t("general.disabled") : t("general.enabled")}
53
- </DataTableStatusCell>
54
- )
55
- },
56
- }),
57
- ...dateColumns,
58
- ],
59
- [t, dateColumns]
60
- )
61
- }
@@ -1,22 +0,0 @@
1
- import { DataTableEmptyStateProps } from "@acmekit/ui"
2
- import { useMemo } from "react"
3
- import { useTranslation } from "react-i18next"
4
-
5
- export const useSalesChannelTableEmptyState = (): DataTableEmptyStateProps => {
6
- const { t } = useTranslation()
7
-
8
- return useMemo(() => {
9
- const content: DataTableEmptyStateProps = {
10
- empty: {
11
- heading: t("salesChannels.list.empty.heading"),
12
- description: t("salesChannels.list.empty.description"),
13
- },
14
- filtered: {
15
- heading: t("salesChannels.list.filtered.heading"),
16
- description: t("salesChannels.list.filtered.description"),
17
- },
18
- }
19
-
20
- return content
21
- }, [t])
22
- }
@@ -1,33 +0,0 @@
1
- import { HttpTypes } from "@acmekit/types"
2
- import { createDataTableFilterHelper } from "@acmekit/ui"
3
- import { useMemo } from "react"
4
- import { useTranslation } from "react-i18next"
5
- import { useDataTableDateFilters } from "../general/use-data-table-date-filters"
6
-
7
- const filterHelper = createDataTableFilterHelper<HttpTypes.AdminSalesChannel>()
8
-
9
- export const useSalesChannelTableFilters = () => {
10
- const { t } = useTranslation()
11
- const dateFilters = useDataTableDateFilters()
12
-
13
- return useMemo(
14
- () => [
15
- filterHelper.accessor("is_disabled", {
16
- label: t("fields.status"),
17
- type: "radio",
18
- options: [
19
- {
20
- label: t("general.enabled"),
21
- value: "false",
22
- },
23
- {
24
- label: t("general.disabled"),
25
- value: "true",
26
- },
27
- ],
28
- }),
29
- ...dateFilters,
30
- ],
31
- [dateFilters, t]
32
- )
33
- }
@@ -1,30 +0,0 @@
1
- import { HttpTypes } from "@acmekit/types"
2
- import { useQueryParams } from "../../../../hooks/use-query-params"
3
-
4
- type UseSalesChannelTableQueryProps = {
5
- prefix?: string
6
- pageSize?: number
7
- }
8
-
9
- export const useSalesChannelTableQuery = ({
10
- prefix,
11
- pageSize = 20,
12
- }: UseSalesChannelTableQueryProps) => {
13
- const queryObject = useQueryParams(
14
- ["offset", "q", "order", "created_at", "updated_at", "is_disabled"],
15
- prefix
16
- )
17
-
18
- const { offset, created_at, updated_at, is_disabled, ...rest } = queryObject
19
-
20
- const searchParams: HttpTypes.AdminSalesChannelListParams = {
21
- limit: pageSize,
22
- offset: offset ? Number(offset) : 0,
23
- created_at: created_at ? JSON.parse(created_at) : undefined,
24
- updated_at: updated_at ? JSON.parse(updated_at) : undefined,
25
- is_disabled: is_disabled ? JSON.parse(is_disabled) : undefined,
26
- ...rest,
27
- }
28
-
29
- return searchParams
30
- }