@acmekit/dashboard 2.13.7 → 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.
- package/dist/api-key-management-create-VWUERPPB.mjs +170 -0
- package/dist/api-key-management-detail-V4ENQHYY.mjs +306 -0
- package/dist/api-key-management-edit-R44OHS7B.mjs +106 -0
- package/dist/api-key-management-list-K2XPKF5E.mjs +400 -0
- package/dist/app.js +16765 -1370
- package/dist/app.mjs +786 -1030
- package/dist/chunk-22YYMH6M.mjs +382 -0
- package/dist/chunk-2U3RK3JG.mjs +474 -0
- package/dist/chunk-535OVBXR.mjs +226 -0
- package/dist/chunk-774WSTCC.mjs +19 -0
- package/dist/chunk-C76H5USB.mjs +16 -0
- package/dist/chunk-DFFLVEZ5.mjs +40 -0
- package/dist/chunk-DN3MIYQH.mjs +140 -0
- package/dist/chunk-DQCEH3X2.mjs +28 -0
- package/dist/chunk-DTY37DDZ.mjs +20 -0
- package/dist/chunk-EFRMWHRX.mjs +84 -0
- package/dist/chunk-FXYH54JP.mjs +16 -0
- package/dist/chunk-G22WWLPG.mjs +44 -0
- package/dist/chunk-G2VJOHHV.mjs +32 -0
- package/dist/chunk-GBFVWROS.mjs +58 -0
- package/dist/chunk-ITNQKZQQ.mjs +142 -0
- package/dist/chunk-IUCDCPJU.mjs +0 -0
- package/dist/chunk-LKWTBYYC.mjs +35 -0
- package/dist/{chunk-4VYJHIB3.mjs → chunk-ND3ODI36.mjs} +0 -72
- package/dist/chunk-OAHCJFG3.mjs +17 -0
- package/dist/chunk-RPAL6FHW.mjs +73 -0
- package/dist/{chunk-JSJZMTQG.mjs → chunk-RREPQMYC.mjs} +14 -41
- package/dist/chunk-S3REQHPQ.mjs +86 -0
- package/dist/chunk-S4DMV3ZT.mjs +35 -0
- package/dist/chunk-ST2YB7JN.mjs +74 -0
- package/dist/chunk-TCNCAWYD.mjs +9 -0
- package/dist/chunk-ULSPL3DR.mjs +126 -0
- package/dist/chunk-WILMJYUB.mjs +35 -0
- package/dist/chunk-XIM7X4FB.mjs +83 -0
- package/dist/chunk-YLPAZ2DP.mjs +1837 -0
- package/dist/chunk-YRWSG3YM.mjs +80 -0
- package/dist/{invite-S5USGDOZ.mjs → invite-XGPZZBUP.mjs} +15 -7
- package/dist/{login-AIMR26AL.mjs → login-GNP3QIPI.mjs} +25 -12
- package/dist/profile-detail-YX27F7N6.mjs +96 -0
- package/dist/profile-edit-2VRDU75O.mjs +173 -0
- package/dist/{reset-password-UQPRHMB3.mjs → reset-password-TWRNZO6Z.mjs} +7 -3
- package/dist/settings-3XWLL5LG.mjs +545 -0
- package/dist/translation-list-CCEQJNED.mjs +581 -0
- package/dist/translations-edit-E57GVUFV.mjs +5376 -0
- package/dist/user-detail-KUSRRVNX.mjs +169 -0
- package/dist/user-edit-HTN3ZGCL.mjs +114 -0
- package/dist/user-invite-E3FAAU3V.mjs +361 -0
- package/dist/user-list-KNJ5S3IM.mjs +1116 -0
- package/dist/user-metadata-5GQK75DT.mjs +425 -0
- package/dist/workflow-execution-detail-LZXCRVNC.mjs +819 -0
- package/dist/workflow-execution-list-HQ3V6TML.mjs +175 -0
- package/package.json +9 -9
- package/src/components/layout/settings-layout/settings-layout.tsx +8 -2
- package/src/dashboard-app/routes/get-route.map.tsx +1 -14
- package/src/hooks/api/api-keys.tsx +0 -49
- package/src/hooks/api/index.ts +0 -1
- package/src/providers/keybind-provider/hooks.tsx +0 -145
- package/src/routes/translations/translation-list/translation-list.tsx +10 -21
- package/src/routes/translations/translations-edit/translations-edit.tsx +14 -11
- package/src/vite-env.d.ts +3 -1
- package/dist/chunk-FBTP4AJM.mjs +0 -221
- package/dist/chunk-QYOO4QR6.mjs +0 -73
- package/src/components/data-table/helpers/sales-channels/index.ts +0 -4
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-columns.tsx +0 -61
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-empty-state.tsx +0 -22
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-filters.tsx +0 -33
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-query.tsx +0 -30
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +0 -206
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/index.ts +0 -1
- package/src/routes/store/common/hooks/use-currencies-table-columns.tsx +0 -29
- package/src/routes/store/common/hooks/use-currencies-table-query.tsx +0 -21
- package/src/routes/store/common/hooks/use-locales-table-columns.tsx +0 -29
- package/src/routes/store/common/hooks/use-locales-table-query.tsx +0 -21
- package/src/routes/store/store-detail/components/store-general-section/index.ts +0 -1
- package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +0 -48
- package/src/routes/store/store-detail/index.ts +0 -2
- package/src/routes/store/store-detail/loader.ts +0 -18
- package/src/routes/store/store-detail/store-detail.tsx +0 -42
- package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +0 -83
- package/src/routes/store/store-edit/index.ts +0 -1
- package/src/routes/store/store-edit/store-edit.tsx +0 -25
- package/src/routes/store/store-metadata/index.ts +0 -1
- package/src/routes/store/store-metadata/store-metadata.tsx +0 -24
|
@@ -0,0 +1,80 @@
|
|
|
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/users.tsx
|
|
12
|
+
import {
|
|
13
|
+
useMutation,
|
|
14
|
+
useQuery
|
|
15
|
+
} from "@tanstack/react-query";
|
|
16
|
+
var USERS_QUERY_KEY = "users";
|
|
17
|
+
var usersQueryKeys = {
|
|
18
|
+
...queryKeysFactory(USERS_QUERY_KEY),
|
|
19
|
+
me: () => [USERS_QUERY_KEY, "me"]
|
|
20
|
+
};
|
|
21
|
+
var useMe = (query, options) => {
|
|
22
|
+
const { data, ...rest } = useQuery({
|
|
23
|
+
queryFn: () => sdk.admin.user.me(query),
|
|
24
|
+
queryKey: usersQueryKeys.me(),
|
|
25
|
+
...options
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
...data,
|
|
29
|
+
...rest
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var useUser = (id, query, options) => {
|
|
33
|
+
const { data, ...rest } = useQuery({
|
|
34
|
+
queryFn: () => sdk.admin.user.retrieve(id, query),
|
|
35
|
+
queryKey: usersQueryKeys.detail(id),
|
|
36
|
+
...options
|
|
37
|
+
});
|
|
38
|
+
return { ...data, ...rest };
|
|
39
|
+
};
|
|
40
|
+
var useUsers = (query, options) => {
|
|
41
|
+
const { data, ...rest } = useQuery({
|
|
42
|
+
queryFn: () => sdk.admin.user.list(query),
|
|
43
|
+
queryKey: usersQueryKeys.list(query),
|
|
44
|
+
...options
|
|
45
|
+
});
|
|
46
|
+
return { ...data, ...rest };
|
|
47
|
+
};
|
|
48
|
+
var useUpdateUser = (id, query, options) => {
|
|
49
|
+
return useMutation({
|
|
50
|
+
mutationFn: (payload) => sdk.admin.user.update(id, payload, query),
|
|
51
|
+
onSuccess: (data, variables, context) => {
|
|
52
|
+
queryClient.invalidateQueries({ queryKey: usersQueryKeys.detail(id) });
|
|
53
|
+
queryClient.invalidateQueries({ queryKey: usersQueryKeys.lists() });
|
|
54
|
+
queryClient.invalidateQueries({ queryKey: usersQueryKeys.me() });
|
|
55
|
+
options?.onSuccess?.(data, variables, context);
|
|
56
|
+
},
|
|
57
|
+
...options
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
var useDeleteUser = (id, options) => {
|
|
61
|
+
return useMutation({
|
|
62
|
+
mutationFn: () => sdk.admin.user.delete(id),
|
|
63
|
+
onSuccess: (data, variables, context) => {
|
|
64
|
+
queryClient.invalidateQueries({ queryKey: usersQueryKeys.detail(id) });
|
|
65
|
+
queryClient.invalidateQueries({ queryKey: usersQueryKeys.lists() });
|
|
66
|
+
queryClient.invalidateQueries({ queryKey: usersQueryKeys.me() });
|
|
67
|
+
options?.onSuccess?.(data, variables, context);
|
|
68
|
+
},
|
|
69
|
+
...options
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
usersQueryKeys,
|
|
75
|
+
useMe,
|
|
76
|
+
useUser,
|
|
77
|
+
useUsers,
|
|
78
|
+
useUpdateUser,
|
|
79
|
+
useDeleteUser
|
|
80
|
+
};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isFetchError,
|
|
3
|
-
useAcceptInvite
|
|
4
|
-
} from "./chunk-QYOO4QR6.mjs";
|
|
5
1
|
import {
|
|
6
2
|
AvatarBox
|
|
7
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RREPQMYC.mjs";
|
|
4
|
+
import "./chunk-G2VJOHHV.mjs";
|
|
5
|
+
import {
|
|
6
|
+
isFetchError
|
|
7
|
+
} from "./chunk-TCNCAWYD.mjs";
|
|
8
8
|
import {
|
|
9
|
-
Form,
|
|
10
9
|
useSignUpWithEmailPass
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GBFVWROS.mjs";
|
|
11
|
+
import {
|
|
12
|
+
useAcceptInvite
|
|
13
|
+
} from "./chunk-XIM7X4FB.mjs";
|
|
14
|
+
import {
|
|
15
|
+
Form
|
|
16
|
+
} from "./chunk-ND3ODI36.mjs";
|
|
17
|
+
import "./chunk-FXYH54JP.mjs";
|
|
18
|
+
import "./chunk-774WSTCC.mjs";
|
|
19
|
+
import "./chunk-DTY37DDZ.mjs";
|
|
12
20
|
import "./chunk-QZ7TP4HQ.mjs";
|
|
13
21
|
|
|
14
22
|
// src/routes/invite/invite.tsx
|
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
AvatarBox
|
|
3
|
+
} from "./chunk-RREPQMYC.mjs";
|
|
4
|
+
import "./chunk-G2VJOHHV.mjs";
|
|
5
|
+
import {
|
|
6
|
+
isFetchError
|
|
7
|
+
} from "./chunk-TCNCAWYD.mjs";
|
|
5
8
|
import {
|
|
6
9
|
useExtension
|
|
7
10
|
} from "./chunk-C5P5PL3E.mjs";
|
|
8
11
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
AvatarBox
|
|
13
|
-
} from "./chunk-JSJZMTQG.mjs";
|
|
12
|
+
useCloudAuthEnabled,
|
|
13
|
+
useCreateCloudAuthUser
|
|
14
|
+
} from "./chunk-ST2YB7JN.mjs";
|
|
14
15
|
import {
|
|
15
|
-
Form,
|
|
16
|
-
sdk,
|
|
17
16
|
useSignInWithEmailPass
|
|
18
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GBFVWROS.mjs";
|
|
18
|
+
import "./chunk-EFRMWHRX.mjs";
|
|
19
|
+
import "./chunk-LKWTBYYC.mjs";
|
|
20
|
+
import "./chunk-ULSPL3DR.mjs";
|
|
21
|
+
import "./chunk-DN3MIYQH.mjs";
|
|
22
|
+
import "./chunk-XIM7X4FB.mjs";
|
|
23
|
+
import {
|
|
24
|
+
Form
|
|
25
|
+
} from "./chunk-ND3ODI36.mjs";
|
|
26
|
+
import "./chunk-YRWSG3YM.mjs";
|
|
27
|
+
import "./chunk-FXYH54JP.mjs";
|
|
28
|
+
import "./chunk-774WSTCC.mjs";
|
|
29
|
+
import {
|
|
30
|
+
sdk
|
|
31
|
+
} from "./chunk-DTY37DDZ.mjs";
|
|
19
32
|
import "./chunk-QZ7TP4HQ.mjs";
|
|
20
33
|
|
|
21
34
|
// src/routes/login/login.tsx
|
|
@@ -151,7 +164,7 @@ var Login = () => {
|
|
|
151
164
|
const location = useLocation();
|
|
152
165
|
const navigate = useNavigate2();
|
|
153
166
|
const { getWidgets } = useExtension();
|
|
154
|
-
const from = location.state?.from?.pathname || "/
|
|
167
|
+
const from = location.state?.from?.pathname || "/";
|
|
155
168
|
const form = useForm({
|
|
156
169
|
resolver: zodResolver(LoginSchema),
|
|
157
170
|
defaultValues: {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {
|
|
2
|
+
languages
|
|
3
|
+
} from "./chunk-535OVBXR.mjs";
|
|
4
|
+
import {
|
|
5
|
+
SingleColumnPage
|
|
6
|
+
} from "./chunk-22YYMH6M.mjs";
|
|
7
|
+
import {
|
|
8
|
+
useExtension
|
|
9
|
+
} from "./chunk-C5P5PL3E.mjs";
|
|
10
|
+
import {
|
|
11
|
+
ActionMenu
|
|
12
|
+
} from "./chunk-S3REQHPQ.mjs";
|
|
13
|
+
import {
|
|
14
|
+
SingleColumnPageSkeleton
|
|
15
|
+
} from "./chunk-ITNQKZQQ.mjs";
|
|
16
|
+
import "./chunk-OAHCJFG3.mjs";
|
|
17
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
18
|
+
import {
|
|
19
|
+
useMe
|
|
20
|
+
} from "./chunk-YRWSG3YM.mjs";
|
|
21
|
+
import "./chunk-FXYH54JP.mjs";
|
|
22
|
+
import "./chunk-774WSTCC.mjs";
|
|
23
|
+
import "./chunk-DTY37DDZ.mjs";
|
|
24
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
25
|
+
|
|
26
|
+
// src/routes/profile/profile-detail/components/profile-general-section/profile-general-section.tsx
|
|
27
|
+
import { PencilSquare } from "@acmekit/icons";
|
|
28
|
+
import { Container, Heading, Text } from "@acmekit/ui";
|
|
29
|
+
import { useTranslation } from "react-i18next";
|
|
30
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
+
var ProfileGeneralSection = ({ user }) => {
|
|
32
|
+
const { i18n, t } = useTranslation();
|
|
33
|
+
const name = [user.first_name, user.last_name].filter(Boolean).join(" ");
|
|
34
|
+
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Heading, { children: t("profile.domain") }),
|
|
38
|
+
/* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", size: "small", children: t("profile.manageYourProfileDetails") })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
ActionMenu,
|
|
42
|
+
{
|
|
43
|
+
groups: [
|
|
44
|
+
{
|
|
45
|
+
actions: [
|
|
46
|
+
{
|
|
47
|
+
label: t("actions.edit"),
|
|
48
|
+
to: "edit",
|
|
49
|
+
icon: /* @__PURE__ */ jsx(PencilSquare, {})
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.name") }),
|
|
59
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: name || "-" })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
62
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.email") }),
|
|
63
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: user.email })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("profile.fields.languageLabel") }),
|
|
67
|
+
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: languages.find((lang) => lang.code === i18n.language)?.display_name || "-" })
|
|
68
|
+
] })
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/routes/profile/profile-detail/profile-detail.tsx
|
|
73
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
74
|
+
var ProfileDetail = () => {
|
|
75
|
+
const { user, isPending: isLoading, isError, error } = useMe();
|
|
76
|
+
const { getWidgets } = useExtension();
|
|
77
|
+
if (isLoading || !user) {
|
|
78
|
+
return /* @__PURE__ */ jsx2(SingleColumnPageSkeleton, { sections: 1 });
|
|
79
|
+
}
|
|
80
|
+
if (isError) {
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsx2(
|
|
84
|
+
SingleColumnPage,
|
|
85
|
+
{
|
|
86
|
+
widgets: {
|
|
87
|
+
after: getWidgets("profile.details.after"),
|
|
88
|
+
before: getWidgets("profile.details.before")
|
|
89
|
+
},
|
|
90
|
+
children: /* @__PURE__ */ jsx2(ProfileGeneralSection, { user })
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
ProfileDetail as Component
|
|
96
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {
|
|
2
|
+
languages
|
|
3
|
+
} from "./chunk-535OVBXR.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useDocumentDirection
|
|
6
|
+
} from "./chunk-S4DMV3ZT.mjs";
|
|
7
|
+
import "./chunk-IUCDCPJU.mjs";
|
|
8
|
+
import {
|
|
9
|
+
KeyboundForm,
|
|
10
|
+
RouteDrawer,
|
|
11
|
+
useRouteModal
|
|
12
|
+
} from "./chunk-2U3RK3JG.mjs";
|
|
13
|
+
import {
|
|
14
|
+
Form
|
|
15
|
+
} from "./chunk-ND3ODI36.mjs";
|
|
16
|
+
import {
|
|
17
|
+
useMe,
|
|
18
|
+
useUpdateUser
|
|
19
|
+
} from "./chunk-YRWSG3YM.mjs";
|
|
20
|
+
import "./chunk-FXYH54JP.mjs";
|
|
21
|
+
import "./chunk-774WSTCC.mjs";
|
|
22
|
+
import "./chunk-DTY37DDZ.mjs";
|
|
23
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
24
|
+
|
|
25
|
+
// src/routes/profile/profile-edit/profile-edit.tsx
|
|
26
|
+
import { Heading } from "@acmekit/ui";
|
|
27
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
28
|
+
|
|
29
|
+
// src/routes/profile/profile-edit/components/edit-profile-form/edit-profile-form.tsx
|
|
30
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
31
|
+
import { Button, Input, Select, toast } from "@acmekit/ui";
|
|
32
|
+
import { useForm } from "react-hook-form";
|
|
33
|
+
import { useTranslation } from "react-i18next";
|
|
34
|
+
import * as zod from "zod";
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
var EditProfileSchema = zod.object({
|
|
37
|
+
first_name: zod.string().optional(),
|
|
38
|
+
last_name: zod.string().optional(),
|
|
39
|
+
language: zod.string()
|
|
40
|
+
// usage_insights: zod.boolean(),
|
|
41
|
+
});
|
|
42
|
+
var EditProfileForm = ({ user }) => {
|
|
43
|
+
const { t, i18n } = useTranslation();
|
|
44
|
+
const { handleSuccess } = useRouteModal();
|
|
45
|
+
const direction = useDocumentDirection();
|
|
46
|
+
const form = useForm({
|
|
47
|
+
defaultValues: {
|
|
48
|
+
first_name: user.first_name ?? "",
|
|
49
|
+
last_name: user.last_name ?? "",
|
|
50
|
+
language: i18n.language
|
|
51
|
+
// usage_insights: usageInsights,
|
|
52
|
+
},
|
|
53
|
+
resolver: zodResolver(EditProfileSchema)
|
|
54
|
+
});
|
|
55
|
+
const changeLanguage = async (code) => {
|
|
56
|
+
await i18n.changeLanguage(code);
|
|
57
|
+
};
|
|
58
|
+
const sortedLanguages = languages.sort(
|
|
59
|
+
(a, b) => a.display_name.localeCompare(b.display_name)
|
|
60
|
+
);
|
|
61
|
+
const { mutateAsync, isPending } = useUpdateUser(user.id);
|
|
62
|
+
const handleSubmit = form.handleSubmit(async (values) => {
|
|
63
|
+
await mutateAsync(
|
|
64
|
+
{
|
|
65
|
+
first_name: values.first_name,
|
|
66
|
+
last_name: values.last_name
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
onError: (error) => {
|
|
70
|
+
toast.error(error.message);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
await changeLanguage(values.language);
|
|
76
|
+
toast.success(t("profile.toast.edit"));
|
|
77
|
+
handleSuccess();
|
|
78
|
+
});
|
|
79
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { onSubmit: handleSubmit, className: "flex flex-1 flex-col", children: [
|
|
80
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-8", children: [
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
Form.Field,
|
|
84
|
+
{
|
|
85
|
+
control: form.control,
|
|
86
|
+
name: "first_name",
|
|
87
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
88
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.firstName") }),
|
|
89
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
90
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
91
|
+
] })
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
Form.Field,
|
|
96
|
+
{
|
|
97
|
+
control: form.control,
|
|
98
|
+
name: "last_name",
|
|
99
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.lastName") }),
|
|
101
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
103
|
+
] })
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
Form.Field,
|
|
109
|
+
{
|
|
110
|
+
control: form.control,
|
|
111
|
+
name: "language",
|
|
112
|
+
render: ({ field: { ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { className: "gap-y-4", children: [
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("profile.fields.languageLabel") }),
|
|
115
|
+
/* @__PURE__ */ jsx(Form.Hint, { children: t("profile.edit.languageHint") })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
|
|
119
|
+
Select,
|
|
120
|
+
{
|
|
121
|
+
dir: direction,
|
|
122
|
+
...field,
|
|
123
|
+
onValueChange: field.onChange,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Select.Trigger, { ref, className: "py-1 text-[13px]", children: /* @__PURE__ */ jsx(
|
|
126
|
+
Select.Value,
|
|
127
|
+
{
|
|
128
|
+
placeholder: t("profile.edit.languagePlaceholder"),
|
|
129
|
+
children: sortedLanguages.find(
|
|
130
|
+
(language) => language.code === field.value
|
|
131
|
+
)?.display_name
|
|
132
|
+
}
|
|
133
|
+
) }),
|
|
134
|
+
/* @__PURE__ */ jsx(Select.Content, { children: languages.map((language) => /* @__PURE__ */ jsx(
|
|
135
|
+
Select.Item,
|
|
136
|
+
{
|
|
137
|
+
value: language.code,
|
|
138
|
+
children: language.display_name
|
|
139
|
+
},
|
|
140
|
+
language.code
|
|
141
|
+
)) })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
) }),
|
|
145
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
146
|
+
] })
|
|
147
|
+
] })
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] }) }),
|
|
151
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
152
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
153
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
|
154
|
+
] }) })
|
|
155
|
+
] }) });
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/routes/profile/profile-edit/profile-edit.tsx
|
|
159
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
160
|
+
var ProfileEdit = () => {
|
|
161
|
+
const { user, isPending: isLoading, isError, error } = useMe();
|
|
162
|
+
const { t } = useTranslation2();
|
|
163
|
+
if (isError) {
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
167
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Header, { className: "capitalize", children: /* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("profile.edit.header") }) }) }),
|
|
168
|
+
!isLoading && user && /* @__PURE__ */ jsx2(EditProfileForm, { user })
|
|
169
|
+
] });
|
|
170
|
+
};
|
|
171
|
+
export {
|
|
172
|
+
ProfileEdit as Component
|
|
173
|
+
};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import "./chunk-RREPQMYC.mjs";
|
|
2
|
+
import "./chunk-G2VJOHHV.mjs";
|
|
1
3
|
import {
|
|
2
4
|
i18n
|
|
3
5
|
} from "./chunk-W3WS3HKB.mjs";
|
|
4
6
|
import "./chunk-C5P5PL3E.mjs";
|
|
5
|
-
import "./chunk-JSJZMTQG.mjs";
|
|
6
7
|
import {
|
|
7
|
-
Form,
|
|
8
8
|
useResetPasswordForEmailPass,
|
|
9
9
|
useUpdateProviderForEmailPass
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GBFVWROS.mjs";
|
|
11
|
+
import {
|
|
12
|
+
Form
|
|
13
|
+
} from "./chunk-ND3ODI36.mjs";
|
|
14
|
+
import "./chunk-DTY37DDZ.mjs";
|
|
11
15
|
import "./chunk-QZ7TP4HQ.mjs";
|
|
12
16
|
|
|
13
17
|
// src/routes/reset-password/reset-password.tsx
|