@carlonicora/nextjs-jsonapi 1.0.6 → 1.1.0
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/{AbstractService-B2n_JdiC.d.mts → AbstractService-BsY6W3Ej.d.mts} +1 -1
- package/dist/{AbstractService-DtQTYovo.d.ts → AbstractService-wLid8dB0.d.ts} +1 -1
- package/dist/AuthComponent-hxOPs9o8.d.mts +11 -0
- package/dist/AuthComponent-hxOPs9o8.d.ts +11 -0
- package/dist/{BlockNoteEditor-BLVXQPXV.mjs → BlockNoteEditor-6TBRDBCF.mjs} +7 -7
- package/dist/{BlockNoteEditor-ZTDHULFT.js → BlockNoteEditor-BCPDRNLK.js} +17 -17
- package/dist/{BlockNoteEditor-ZTDHULFT.js.map → BlockNoteEditor-BCPDRNLK.js.map} +1 -1
- package/dist/{chunk-6GKHCVF6.js → chunk-32HM6MDD.js} +1 -1
- package/dist/chunk-32HM6MDD.js.map +1 -0
- package/dist/{chunk-A5DDIABK.js → chunk-EZK3H6EJ.js} +206 -206
- package/dist/{chunk-A5DDIABK.js.map → chunk-EZK3H6EJ.js.map} +1 -1
- package/dist/{chunk-WEC4YMOS.js → chunk-FPMPTR7S.js} +778 -590
- package/dist/chunk-FPMPTR7S.js.map +1 -0
- package/dist/{chunk-RZO2LOW4.js → chunk-FYRFMABS.js} +181 -183
- package/dist/chunk-FYRFMABS.js.map +1 -0
- package/dist/{chunk-DD3KISNB.mjs → chunk-HAG77QBV.mjs} +1 -1
- package/dist/chunk-HAG77QBV.mjs.map +1 -0
- package/dist/{chunk-2LM6LCJW.mjs → chunk-JLN6UWII.mjs} +41 -2
- package/dist/chunk-JLN6UWII.mjs.map +1 -0
- package/dist/{chunk-JC3WJK65.js → chunk-LJRD4SRV.js} +41 -2
- package/dist/chunk-LJRD4SRV.js.map +1 -0
- package/dist/{chunk-3APORDYP.mjs → chunk-LUHQILAI.mjs} +700 -512
- package/dist/chunk-LUHQILAI.mjs.map +1 -0
- package/dist/{chunk-7C5RAEBO.mjs → chunk-MA2L2PL2.mjs} +2 -4
- package/dist/chunk-MA2L2PL2.mjs.map +1 -0
- package/dist/{chunk-PYF2U6WG.mjs → chunk-NPPQNSXN.mjs} +11 -1
- package/dist/{chunk-PYF2U6WG.mjs.map → chunk-NPPQNSXN.mjs.map} +1 -1
- package/dist/{chunk-HMHGLXWC.js → chunk-WZJDLITG.js} +11 -1
- package/dist/chunk-WZJDLITG.js.map +1 -0
- package/dist/{chunk-IWFGEPAA.mjs → chunk-X53MF5ZN.mjs} +2 -2
- package/dist/client/index.d.mts +8 -4
- package/dist/client/index.d.ts +8 -4
- package/dist/client/index.js +9 -7
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +8 -6
- package/dist/components/index.d.mts +20 -3
- package/dist/components/index.d.ts +20 -3
- package/dist/components/index.js +13 -7
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +12 -6
- package/dist/{user.fields-CbdObSmS.d.mts → content.fields-cHPdM8GJ.d.mts} +10 -1
- package/dist/{user.fields-CbdObSmS.d.ts → content.fields-cHPdM8GJ.d.ts} +10 -1
- package/dist/{AuthComponent-m6Qp4Hz6.d.ts → content.interface-C_PGZMuy.d.ts} +1 -11
- package/dist/{AuthComponent-CPLvEerw.d.mts → content.interface-D_WS6CrB.d.mts} +1 -11
- package/dist/contexts/index.d.mts +2 -1
- package/dist/contexts/index.d.ts +2 -1
- package/dist/contexts/index.js +7 -7
- package/dist/contexts/index.mjs +6 -6
- package/dist/core/index.d.mts +6 -3
- package/dist/core/index.d.ts +6 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/index.d.mts +7 -17
- package/dist/features/index.d.ts +7 -17
- package/dist/features/index.js +4 -4
- package/dist/features/index.mjs +3 -3
- package/dist/hooks/index.d.mts +4 -4
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/index.mjs +6 -6
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/permissions/index.d.mts +3 -2
- package/dist/permissions/index.d.ts +3 -2
- package/dist/permissions/index.js +2 -2
- package/dist/permissions/index.mjs +1 -1
- package/dist/server/index.d.mts +2 -1
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.mjs +1 -1
- package/dist/shadcnui/index.js +5 -3
- package/dist/shadcnui/index.js.map +1 -1
- package/dist/shadcnui/index.mjs +4 -2
- package/dist/{types-BUAlgqqh.d.ts → types-B2QRyqyK.d.ts} +1 -1
- package/dist/{types-iVdVY7ba.d.mts → types-CgvNmxTd.d.mts} +1 -1
- package/dist/{types-Bl61ob-7.d.mts → types-t2PyXhDu.d.mts} +4 -0
- package/dist/{types-Bl61ob-7.d.ts → types-t2PyXhDu.d.ts} +4 -0
- package/dist/utils/index.d.mts +27 -3
- package/dist/utils/index.d.ts +27 -3
- package/dist/utils/index.js +16 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +15 -1
- package/package.json +1 -1
- package/src/client/index.ts +3 -1
- package/src/components/index.ts +1 -0
- package/src/core/registry/ModuleRegistry.ts +16 -1
- package/src/features/content/components/index.ts +1 -0
- package/src/features/content/components/lists/ContentsList.tsx +67 -0
- package/src/features/content/components/lists/ContentsListById.tsx +30 -0
- package/src/features/content/components/lists/RelevantContentsList.tsx +30 -0
- package/src/features/content/components/lists/index.ts +3 -0
- package/src/features/content/data/content.fields.ts +0 -2
- package/src/features/content/hooks/index.ts +1 -0
- package/src/features/content/hooks/useContentTableStructure.tsx +132 -0
- package/src/permissions/types.ts +3 -0
- package/src/utils/icons.tsx +40 -0
- package/src/utils/index.ts +1 -0
- package/dist/chunk-2LM6LCJW.mjs.map +0 -1
- package/dist/chunk-3APORDYP.mjs.map +0 -1
- package/dist/chunk-6GKHCVF6.js.map +0 -1
- package/dist/chunk-7C5RAEBO.mjs.map +0 -1
- package/dist/chunk-DD3KISNB.mjs.map +0 -1
- package/dist/chunk-HMHGLXWC.js.map +0 -1
- package/dist/chunk-JC3WJK65.js.map +0 -1
- package/dist/chunk-RZO2LOW4.js.map +0 -1
- package/dist/chunk-WEC4YMOS.js.map +0 -1
- /package/dist/{BlockNoteEditor-BLVXQPXV.mjs.map → BlockNoteEditor-6TBRDBCF.mjs.map} +0 -0
- /package/dist/{chunk-IWFGEPAA.mjs.map → chunk-X53MF5ZN.mjs.map} +0 -0
|
@@ -91,20 +91,25 @@
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
var _chunkA5DDIABKjs = require('./chunk-A5DDIABK.js');
|
|
95
94
|
|
|
96
95
|
|
|
97
|
-
var _chunkJC3WJK65js = require('./chunk-JC3WJK65.js');
|
|
98
96
|
|
|
97
|
+
var _chunkEZK3H6EJjs = require('./chunk-EZK3H6EJ.js');
|
|
99
98
|
|
|
100
99
|
|
|
101
100
|
|
|
101
|
+
var _chunkLJRD4SRVjs = require('./chunk-LJRD4SRV.js');
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
var _chunkFYRFMABSjs = require('./chunk-FYRFMABS.js');
|
|
108
113
|
|
|
109
114
|
|
|
110
115
|
|
|
@@ -127,10 +132,10 @@ var _chunk3FBCC4G3js = require('./chunk-3FBCC4G3.js');
|
|
|
127
132
|
|
|
128
133
|
|
|
129
134
|
|
|
130
|
-
var
|
|
135
|
+
var _chunkWZJDLITGjs = require('./chunk-WZJDLITG.js');
|
|
131
136
|
|
|
132
137
|
|
|
133
|
-
var
|
|
138
|
+
var _chunk32HM6MDDjs = require('./chunk-32HM6MDD.js');
|
|
134
139
|
|
|
135
140
|
|
|
136
141
|
var _chunk7QVYU63Ejs = require('./chunk-7QVYU63E.js');
|
|
@@ -250,7 +255,7 @@ function useDataListRetriever(params) {
|
|
|
250
255
|
const abortControllerRef = _react.useRef.call(void 0, null);
|
|
251
256
|
const isFetchingRef = _react.useRef.call(void 0, false);
|
|
252
257
|
const resolvedType = params.module;
|
|
253
|
-
const resolvedService =
|
|
258
|
+
const resolvedService = _chunkWZJDLITGjs.AbstractService;
|
|
254
259
|
const parsePageParams = _react.useCallback.call(void 0, (url) => {
|
|
255
260
|
if (!url) return null;
|
|
256
261
|
try {
|
|
@@ -1035,7 +1040,7 @@ function usePushNotifications() {
|
|
|
1035
1040
|
};
|
|
1036
1041
|
const subscriptionHash = btoa(JSON.stringify(plainSubscription));
|
|
1037
1042
|
if (lastRegisteredSubscription !== subscriptionHash) {
|
|
1038
|
-
await
|
|
1043
|
+
await _chunkFYRFMABSjs.PushService.register({ data: plainSubscription });
|
|
1039
1044
|
sessionStorage.setItem(sessionKey, subscriptionHash);
|
|
1040
1045
|
}
|
|
1041
1046
|
} catch (error) {
|
|
@@ -1118,7 +1123,7 @@ function useSocket({ token }) {
|
|
|
1118
1123
|
});
|
|
1119
1124
|
}, "handleMessage");
|
|
1120
1125
|
const handleNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => {
|
|
1121
|
-
const notification =
|
|
1126
|
+
const notification = _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.Notification, data);
|
|
1122
1127
|
if (notification) {
|
|
1123
1128
|
setSocketNotifications((prev) => {
|
|
1124
1129
|
const newNotifications = [...prev, notification];
|
|
@@ -1209,20 +1214,20 @@ var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1209
1214
|
if (!token && dehydratedUser) setDehydratedUser(null);
|
|
1210
1215
|
}, [dehydratedUser, setDehydratedUser]);
|
|
1211
1216
|
const matchUrlToModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
1212
|
-
const moduleKeys = Object.getOwnPropertyNames(
|
|
1217
|
+
const moduleKeys = Object.getOwnPropertyNames(_chunkWZJDLITGjs.Modules).filter(
|
|
1213
1218
|
(key) => key !== "prototype" && key !== "_factory" && key !== "length" && key !== "name"
|
|
1214
1219
|
);
|
|
1215
1220
|
const matchedModuleKey = moduleKeys.find((key) => {
|
|
1216
|
-
const descriptor2 = Object.getOwnPropertyDescriptor(
|
|
1221
|
+
const descriptor2 = Object.getOwnPropertyDescriptor(_chunkWZJDLITGjs.Modules, key);
|
|
1217
1222
|
if (!_optionalChain([descriptor2, 'optionalAccess', _36 => _36.get])) return false;
|
|
1218
|
-
const selectedModule = descriptor2.get.call(
|
|
1223
|
+
const selectedModule = descriptor2.get.call(_chunkWZJDLITGjs.Modules);
|
|
1219
1224
|
return path.toLowerCase().startsWith(_optionalChain([selectedModule, 'access', _37 => _37.pageUrl, 'optionalAccess', _38 => _38.toLowerCase, 'call', _39 => _39()]));
|
|
1220
1225
|
});
|
|
1221
1226
|
if (!matchedModuleKey) return void 0;
|
|
1222
|
-
const descriptor = Object.getOwnPropertyDescriptor(
|
|
1223
|
-
return _optionalChain([descriptor, 'optionalAccess', _40 => _40.get, 'optionalAccess', _41 => _41.call, 'call', _42 => _42(
|
|
1227
|
+
const descriptor = Object.getOwnPropertyDescriptor(_chunkWZJDLITGjs.Modules, matchedModuleKey);
|
|
1228
|
+
return _optionalChain([descriptor, 'optionalAccess', _40 => _40.get, 'optionalAccess', _41 => _41.call, 'call', _42 => _42(_chunkWZJDLITGjs.Modules)]);
|
|
1224
1229
|
}, "matchUrlToModule");
|
|
1225
|
-
const currentUser = dehydratedUser ?
|
|
1230
|
+
const currentUser = dehydratedUser ? _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.User, dehydratedUser) : null;
|
|
1226
1231
|
const company = _nullishCoalesce(_optionalChain([currentUser, 'optionalAccess', _43 => _43.company]), () => ( null));
|
|
1227
1232
|
const setUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (user) => {
|
|
1228
1233
|
if (user) setDehydratedUser(user.dehydrate());
|
|
@@ -1240,14 +1245,14 @@ var CurrentUserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1240
1245
|
function hasPermissionToModule(params) {
|
|
1241
1246
|
if (!currentUser) return false;
|
|
1242
1247
|
if (!!params.module.feature && !hasAccesToFeature(params.module.feature)) return false;
|
|
1243
|
-
return
|
|
1248
|
+
return _chunk32HM6MDDjs.checkPermissions.call(void 0, { module: params.module, action: params.action, data: params.data, user: currentUser });
|
|
1244
1249
|
}
|
|
1245
1250
|
_chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToModule, "hasPermissionToModule");
|
|
1246
1251
|
function hasPermissionToModules(params) {
|
|
1247
1252
|
if (!currentUser) return false;
|
|
1248
1253
|
if (!params.modules.every((module) => !module.feature || hasAccesToFeature(module.feature))) return false;
|
|
1249
1254
|
return params.modules.every(
|
|
1250
|
-
(module) =>
|
|
1255
|
+
(module) => _chunk32HM6MDDjs.checkPermissions.call(void 0, { module, action: params.action, data: params.data, user: currentUser })
|
|
1251
1256
|
);
|
|
1252
1257
|
}
|
|
1253
1258
|
_chunk7QVYU63Ejs.__name.call(void 0, hasPermissionToModules, "hasPermissionToModules");
|
|
@@ -1304,24 +1309,24 @@ function Breadcrumb2({ items }) {
|
|
|
1304
1309
|
const generateUrl = usePageUrlGenerator();
|
|
1305
1310
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1306
1311
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
1307
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1308
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1309
|
-
items.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1312
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Breadcrumb, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.BreadcrumbList, { children: [
|
|
1313
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbItem, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: generateUrl({ page: `/` }), children: t(`generic.home`) }) }),
|
|
1314
|
+
items.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbSeparator, {}),
|
|
1310
1315
|
items.length > ITEMS_TO_DISPLAY ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1311
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1312
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1313
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1314
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1315
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1316
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbItem, { children: items[0].href ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: items[0].href, children: items[0].name }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: items[0].name }) }),
|
|
1317
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbSeparator, {}),
|
|
1318
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbItem, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DropdownMenu, { open, onOpenChange: setOpen, children: [
|
|
1319
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuTrigger, { className: "flex items-center gap-1", "aria-label": "Toggle menu", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbEllipsis, { className: "h-4 w-4" }) }),
|
|
1320
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuContent, { align: "start", children: items.slice(1, -ITEMS_TO_DISPLAY + 1).map((item, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuItem, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: item.href ? item.href : "#", children: item.name }) }, index)) })
|
|
1316
1321
|
] }) }),
|
|
1317
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1322
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbSeparator, {}),
|
|
1318
1323
|
items.slice(-ITEMS_TO_DISPLAY + 1).map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
|
|
1319
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1320
|
-
index < items.slice(-ITEMS_TO_DISPLAY + 1).length - 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1324
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbItem, { children: item.href ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: item.href, children: item.name }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: item.name }) }),
|
|
1325
|
+
index < items.slice(-ITEMS_TO_DISPLAY + 1).length - 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbSeparator, {})
|
|
1321
1326
|
] }, index))
|
|
1322
1327
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: items.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
|
|
1323
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1324
|
-
index < items.length - 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1328
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbItem, { children: item.href ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: item.href, children: item.name }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: item.name }) }),
|
|
1329
|
+
index < items.length - 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.BreadcrumbSeparator, {})
|
|
1325
1330
|
] }, index)) })
|
|
1326
1331
|
] }) });
|
|
1327
1332
|
}
|
|
@@ -1338,7 +1343,7 @@ function ContentTitle({ type, element, functions, className }) {
|
|
|
1338
1343
|
setClientFunctions(functions);
|
|
1339
1344
|
}, [functions]);
|
|
1340
1345
|
if (!element) return null;
|
|
1341
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1346
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkLJRD4SRVjs.cn.call(void 0, `mb-4 flex w-full flex-col`, className), children: [
|
|
1342
1347
|
(type || isClient) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-center justify-between gap-x-4", children: [
|
|
1343
1348
|
type && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `text-muted-foreground text-xl font-light`, children: type }),
|
|
1344
1349
|
isClient && clientFunctions && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-row items-center justify-start", children: clientFunctions })
|
|
@@ -1368,7 +1373,7 @@ var useSharedContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () =
|
|
|
1368
1373
|
function Header({ children }) {
|
|
1369
1374
|
const { breadcrumbs } = useSharedContext();
|
|
1370
1375
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "header", { className: `sticky top-0 z-10 flex h-12 flex-col items-center justify-start gap-x-4 border-b`, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-sidebar flex h-12 w-full flex-row items-center justify-between pl-2 pr-4", children: [
|
|
1371
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1376
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SidebarTrigger, { "aria-label": "Toggle sidebar" }),
|
|
1372
1377
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-row items-center justify-start", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Breadcrumb2, { items: breadcrumbs }) }),
|
|
1373
1378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-64 flex-row items-center justify-end gap-x-4 whitespace-nowrap", children: children ? children : null })
|
|
1374
1379
|
] }) });
|
|
@@ -1384,7 +1389,7 @@ function ModeToggleSwitch() {
|
|
|
1384
1389
|
const handleToggle = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1385
1390
|
setTheme(theme === "light" ? "dark" : "light");
|
|
1386
1391
|
}, "handleToggle");
|
|
1387
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Switch, { checked: theme === "dark", onCheckedChange: handleToggle, className: "relative", children: theme === "dark" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MoonIcon, { className: "text-primary-foreground h-4 w-4" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SunIcon, { className: "text-primary h-4 w-4" }) }) });
|
|
1388
1393
|
}
|
|
1389
1394
|
_chunk7QVYU63Ejs.__name.call(void 0, ModeToggleSwitch, "ModeToggleSwitch");
|
|
1390
1395
|
|
|
@@ -1444,16 +1449,16 @@ _chunk7QVYU63Ejs.__name.call(void 0, PageSection, "PageSection");
|
|
|
1444
1449
|
function RecentPagesNavigator() {
|
|
1445
1450
|
const recentPages = _jotai.useAtomValue.call(void 0, _chunk3FBCC4G3js.recentPagesAtom);
|
|
1446
1451
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1447
|
-
const { state } =
|
|
1452
|
+
const { state } = _chunkEZK3H6EJjs.useSidebar.call(void 0, );
|
|
1448
1453
|
if (recentPages.length === 0) {
|
|
1449
1454
|
return null;
|
|
1450
1455
|
}
|
|
1451
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1452
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1453
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
-
recentPages.map((page, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1456
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DropdownMenu, { children: [
|
|
1457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full cursor-pointer items-center gap-2", children: state === "collapsed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.HistoryIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t(`generic.recent_pages`) }) }) }),
|
|
1458
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DropdownMenuContent, { align: "start", className: "w-96", children: [
|
|
1459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuLabel, { children: t(`generic.recent_pages`) }),
|
|
1460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuSeparator, {}),
|
|
1461
|
+
recentPages.map((page, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: page.url, className: "flex items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
1457
1462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "truncate text-sm", children: page.title }),
|
|
1458
1463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground text-xs font-normal", children: t(`types.${page.moduleType}`, { count: 1 }) })
|
|
1459
1464
|
] }) }) }, `${page.url}-${index}`))
|
|
@@ -1467,7 +1472,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, RecentPagesNavigator, "RecentPagesNavigator
|
|
|
1467
1472
|
function PageContainer({ children, testId, className }) {
|
|
1468
1473
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex h-full w-full flex-col`, "data-testid": testId, children: [
|
|
1469
1474
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Header, {}),
|
|
1470
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "main", { className:
|
|
1475
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "main", { className: _chunkLJRD4SRVjs.cn.call(void 0, `flex w-full flex-1 flex-col gap-y-4 pt-4 pl-4 pr-4`, className), children })
|
|
1471
1476
|
] });
|
|
1472
1477
|
}
|
|
1473
1478
|
_chunk7QVYU63Ejs.__name.call(void 0, PageContainer, "PageContainer");
|
|
@@ -1571,20 +1576,20 @@ function TabsContainer({
|
|
|
1571
1576
|
if (validTabs.length === 1) {
|
|
1572
1577
|
return validTabs[0].content;
|
|
1573
1578
|
}
|
|
1574
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1579
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tabs, { defaultValue, className: "w-full", children: [
|
|
1575
1580
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full items-center justify-between", children: [
|
|
1576
1581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1577
|
-
|
|
1582
|
+
_chunkEZK3H6EJjs.TabsList,
|
|
1578
1583
|
{
|
|
1579
|
-
className:
|
|
1584
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
1580
1585
|
`${style ? `my-4 flex w-full justify-start rounded-none border-b bg-transparent pb-0` : ``}`,
|
|
1581
1586
|
tabsListClassName
|
|
1582
1587
|
),
|
|
1583
1588
|
children: validTabs.map((tab) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1584
|
-
|
|
1589
|
+
_chunkEZK3H6EJjs.TabsTrigger,
|
|
1585
1590
|
{
|
|
1586
1591
|
value: tab.label,
|
|
1587
|
-
className:
|
|
1592
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
1588
1593
|
`${style ? `text-muted-foreground border-accent data-[state=active]:text-foreground hover:text-foreground cursor-pointer rounded-none bg-transparent pb-2 text-sm font-light hover:border-0 data-[state=active]:border-b data-[state=active]:font-medium data-[state=active]:shadow-none` : `text-primary text-xs`}`,
|
|
1589
1594
|
tabsTriggerClassName
|
|
1590
1595
|
),
|
|
@@ -1596,7 +1601,7 @@ function TabsContainer({
|
|
|
1596
1601
|
),
|
|
1597
1602
|
additionalComponent && additionalComponent
|
|
1598
1603
|
] }),
|
|
1599
|
-
scrollAreaClassName ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1604
|
+
scrollAreaClassName ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.ScrollArea, { className: scrollAreaClassName, children: validTabs.map((tab) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsContent, { value: tab.label, children: tab.content }, tab.label)) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: validTabs.map((tab) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsContent, { value: tab.label, children: tab.content }, tab.label)) })
|
|
1600
1605
|
] });
|
|
1601
1606
|
}
|
|
1602
1607
|
_chunk7QVYU63Ejs.__name.call(void 0, TabsContainer, "TabsContainer");
|
|
@@ -1604,7 +1609,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, TabsContainer, "TabsContainer");
|
|
|
1604
1609
|
// src/components/contents/AttributeElement.tsx
|
|
1605
1610
|
|
|
1606
1611
|
function AttributeElement({ inline, title, value, className }) {
|
|
1607
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1612
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkLJRD4SRVjs.cn.call(void 0, `flex ${inline === true ? "flex-row" : "flex-col"} my-1 justify-start`, className), children: [
|
|
1608
1613
|
title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `${inline === true ? "min-w-48 pr-4" : "w-full"} text-sm font-semibold`, children: title }),
|
|
1609
1614
|
value && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col text-sm", children: value })
|
|
1610
1615
|
] });
|
|
@@ -1627,7 +1632,7 @@ function UserDetails({ user }) {
|
|
|
1627
1632
|
const { title } = useSharedContext();
|
|
1628
1633
|
let roles = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
|
|
1629
1634
|
if (user.roles && user.roles.length > 0) {
|
|
1630
|
-
roles = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mb-4 w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-2", children: user.roles.map((role, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1635
|
+
roles = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mb-4 w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-2", children: user.roles.map((role, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: generateUrl({ page: _chunkWZJDLITGjs.Modules.Role, id: role.id }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Badge, { className: "mr-2", variant: `default`, children: t(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) }) }) }, role.id)) }) });
|
|
1631
1636
|
}
|
|
1632
1637
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-2", children: [
|
|
1633
1638
|
user.avatar && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative aspect-auto w-full max-w-md overflow-hidden rounded-lg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1641,7 +1646,7 @@ function UserDetails({ user }) {
|
|
|
1641
1646
|
}
|
|
1642
1647
|
) }),
|
|
1643
1648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ContentTitle, { type: title.type, element: title.element, functions: title.functions }),
|
|
1644
|
-
user.isDeleted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1649
|
+
user.isDeleted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Badge, { variant: "destructive", children: t(`foundations.user.errors.deleted`) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: !user.isActivated && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Badge, { variant: "destructive", children: t(`foundations.user.errors.inactive`) }) }) }),
|
|
1645
1650
|
roles,
|
|
1646
1651
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AttributeElement, { inline: true, title: t(`foundations.user.fields.title.label`), value: user.title }),
|
|
1647
1652
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AttributeElement, { inline: true, title: t(`generic.fields.email.label`), value: user.email }),
|
|
@@ -1664,31 +1669,31 @@ function UserAvatar({ user, className, showFull, showLink }) {
|
|
|
1664
1669
|
return _nullishCoalesce(initials, () => ( ""));
|
|
1665
1670
|
}, "getInitials");
|
|
1666
1671
|
const getAvatar = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1667
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1668
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1669
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1672
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Avatar, { className: `h-6 w-6 ${className}`, children: [
|
|
1673
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AvatarImage, { className: "object-cover", src: _optionalChain([user, 'optionalAccess', _47 => _47.avatar]) }),
|
|
1674
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AvatarFallback, { children: getInitials(user.name) })
|
|
1670
1675
|
] }) });
|
|
1671
1676
|
}, "getAvatar");
|
|
1672
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1673
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1677
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tooltip, { children: [
|
|
1678
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipTrigger, { asChild: true, children: showLink === false ? (
|
|
1674
1679
|
// If showLink is explicitly false, never show a link
|
|
1675
|
-
showFull ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1680
|
+
showFull ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkLJRD4SRVjs.cn.call(void 0, `mb-2 flex w-full flex-row items-center justify-start gap-x-2 text-sm`, className), children: [
|
|
1676
1681
|
getAvatar(),
|
|
1677
1682
|
user.name
|
|
1678
1683
|
] }) : getAvatar()
|
|
1679
1684
|
) : showFull ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1680
|
-
|
|
1685
|
+
_chunkEZK3H6EJjs.Link,
|
|
1681
1686
|
{
|
|
1682
|
-
href: generateUrl({ page:
|
|
1683
|
-
className:
|
|
1687
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: user.id }),
|
|
1688
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, `mb-2 flex w-full flex-row items-center justify-start gap-x-2 text-sm`, className),
|
|
1684
1689
|
onClick: (e) => e.stopPropagation(),
|
|
1685
1690
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center gap-x-2", children: [
|
|
1686
1691
|
getAvatar(),
|
|
1687
1692
|
user.name
|
|
1688
1693
|
] })
|
|
1689
1694
|
}
|
|
1690
|
-
) : showLink ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1691
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1695
|
+
) : showLink ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: user.id }), className, children: getAvatar() }) : getAvatar() }),
|
|
1696
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipContent, { children: user.name })
|
|
1692
1697
|
] });
|
|
1693
1698
|
}
|
|
1694
1699
|
_chunk7QVYU63Ejs.__name.call(void 0, UserAvatar, "UserAvatar");
|
|
@@ -1699,7 +1704,7 @@ function UserIndexDetails() {
|
|
|
1699
1704
|
const { user } = useUserContext();
|
|
1700
1705
|
const { currentUser } = useCurrentUserContext();
|
|
1701
1706
|
if (!user || !currentUser) return null;
|
|
1702
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-row gap-x-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1707
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-row gap-x-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Card, { className: "min-h-96 w-96 flex-shrink-0 self-start p-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { className: "flex h-full flex-col gap-y-4 p-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full justify-start gap-x-4", children: [
|
|
1703
1708
|
user.avatar && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user, className: "h-40 w-40" }),
|
|
1704
1709
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col justify-start gap-y-2", children: [
|
|
1705
1710
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-primary text-2xl font-semibold", children: user.name }),
|
|
@@ -1737,18 +1742,18 @@ _chunk7QVYU63Ejs.__name.call(void 0, UserIndexContainer, "UserIndexContainer");
|
|
|
1737
1742
|
function UsersListContainerInternal() {
|
|
1738
1743
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
1739
1744
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1740
|
-
if (!hasPermissionToModule({ module:
|
|
1745
|
+
if (!hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.User, action: "delete" /* Delete */ })) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyUsersList, {});
|
|
1741
1746
|
const tabs = [
|
|
1742
1747
|
{
|
|
1743
1748
|
label: t(`types.users`, { count: 2 }),
|
|
1744
1749
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyUsersList, {}),
|
|
1745
|
-
modules: [
|
|
1750
|
+
modules: [_chunkWZJDLITGjs.Modules.Company],
|
|
1746
1751
|
action: "read" /* Read */
|
|
1747
1752
|
},
|
|
1748
1753
|
{
|
|
1749
1754
|
label: t(`foundations.user.deleted`),
|
|
1750
1755
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyUsersList, { isDeleted: true }),
|
|
1751
|
-
modules: [
|
|
1756
|
+
modules: [_chunkWZJDLITGjs.Modules.Company],
|
|
1752
1757
|
action: "update" /* Update */
|
|
1753
1758
|
}
|
|
1754
1759
|
];
|
|
@@ -1766,9 +1771,9 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsersListContainer, "UsersListContainer");
|
|
|
1766
1771
|
function AdminUsersListInternal({ company }) {
|
|
1767
1772
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1768
1773
|
const data = useDataListRetriever({
|
|
1769
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1774
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.UserService.findManyForAmin(params), "retriever"),
|
|
1770
1775
|
retrieverParams: { companyId: company.id },
|
|
1771
|
-
module:
|
|
1776
|
+
module: _chunkWZJDLITGjs.Modules.User
|
|
1772
1777
|
});
|
|
1773
1778
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1774
1779
|
ContentListTable,
|
|
@@ -1776,7 +1781,7 @@ function AdminUsersListInternal({ company }) {
|
|
|
1776
1781
|
title: t(`types.users`, { count: 2 }),
|
|
1777
1782
|
data,
|
|
1778
1783
|
fields: ["name" /* name */, "email" /* email */, "createdAt" /* createdAt */],
|
|
1779
|
-
tableGeneratorType:
|
|
1784
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.User,
|
|
1780
1785
|
functions: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserEditor, { propagateChanges: data.refresh, adminCreated: true })
|
|
1781
1786
|
}
|
|
1782
1787
|
);
|
|
@@ -1798,9 +1803,9 @@ function CompanyUsersList({ isDeleted }) {
|
|
|
1798
1803
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1799
1804
|
const data = useDataListRetriever({
|
|
1800
1805
|
ready: !!company,
|
|
1801
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1806
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.UserService.findAllUsers(params), "retriever"),
|
|
1802
1807
|
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _48 => _48.id]), isDeleted },
|
|
1803
|
-
module:
|
|
1808
|
+
module: _chunkWZJDLITGjs.Modules.User
|
|
1804
1809
|
});
|
|
1805
1810
|
_react.useEffect.call(void 0, () => {
|
|
1806
1811
|
if (company) data.setReady(true);
|
|
@@ -1813,7 +1818,7 @@ function CompanyUsersList({ isDeleted }) {
|
|
|
1813
1818
|
{
|
|
1814
1819
|
data,
|
|
1815
1820
|
fields: ["name" /* name */, "email" /* email */],
|
|
1816
|
-
tableGeneratorType:
|
|
1821
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.User,
|
|
1817
1822
|
functions,
|
|
1818
1823
|
title: t(`types.users`, { count: 2 })
|
|
1819
1824
|
}
|
|
@@ -1827,18 +1832,18 @@ function ContributorsList({ content }) {
|
|
|
1827
1832
|
const generateUrl = usePageUrlGenerator();
|
|
1828
1833
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-center", children: [
|
|
1829
1834
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1830
|
-
|
|
1835
|
+
_chunkEZK3H6EJjs.Link,
|
|
1831
1836
|
{
|
|
1832
|
-
href: generateUrl({ page:
|
|
1837
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: content.author.id }),
|
|
1833
1838
|
onClick: (e) => e.stopPropagation(),
|
|
1834
1839
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user: content.author, className: "mr-1 h-6 w-6" })
|
|
1835
1840
|
},
|
|
1836
1841
|
content.author.id
|
|
1837
1842
|
),
|
|
1838
1843
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-row-reverse justify-end -space-x-1 space-x-reverse", children: content.editors.filter((editor) => editor.id !== content.author.id).map((editor) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1839
|
-
|
|
1844
|
+
_chunkEZK3H6EJjs.Link,
|
|
1840
1845
|
{
|
|
1841
|
-
href: generateUrl({ page:
|
|
1846
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: editor.id }),
|
|
1842
1847
|
onClick: (e) => e.stopPropagation(),
|
|
1843
1848
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user: editor, className: "h-5 w-5" })
|
|
1844
1849
|
},
|
|
@@ -1854,8 +1859,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, ContributorsList, "ContributorsList");
|
|
|
1854
1859
|
function RelevantUsersList({ id }) {
|
|
1855
1860
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1856
1861
|
const data = useDataListRetriever({
|
|
1857
|
-
module:
|
|
1858
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1862
|
+
module: _chunkWZJDLITGjs.Modules.User,
|
|
1863
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.UserService.findRelevant(params), "retriever"),
|
|
1859
1864
|
retrieverParams: { id }
|
|
1860
1865
|
});
|
|
1861
1866
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1863,7 +1868,7 @@ function RelevantUsersList({ id }) {
|
|
|
1863
1868
|
{
|
|
1864
1869
|
data,
|
|
1865
1870
|
fields: ["name" /* name */, "email" /* email */, "relevance" /* relevance */],
|
|
1866
|
-
tableGeneratorType:
|
|
1871
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.User,
|
|
1867
1872
|
title: t(`generic.relevant_users`)
|
|
1868
1873
|
}
|
|
1869
1874
|
);
|
|
@@ -1876,16 +1881,16 @@ _chunk7QVYU63Ejs.__name.call(void 0, RelevantUsersList, "RelevantUsersList");
|
|
|
1876
1881
|
function RoleUsersList({ role }) {
|
|
1877
1882
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1878
1883
|
const data = useDataListRetriever({
|
|
1879
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1884
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.UserService.findAllUsersByRole(params), "retriever"),
|
|
1880
1885
|
retrieverParams: { roleId: role.id },
|
|
1881
|
-
module:
|
|
1886
|
+
module: _chunkWZJDLITGjs.Modules.User
|
|
1882
1887
|
});
|
|
1883
1888
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1884
1889
|
ContentListTable,
|
|
1885
1890
|
{
|
|
1886
1891
|
data,
|
|
1887
1892
|
fields: ["name" /* name */, "email" /* email */],
|
|
1888
|
-
tableGeneratorType:
|
|
1893
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.User,
|
|
1889
1894
|
title: t(`types.users`, { count: 2 })
|
|
1890
1895
|
}
|
|
1891
1896
|
);
|
|
@@ -1900,7 +1905,7 @@ function UserListInAdd({ data, existingUsers, setSelectedUser, setLevelOpen }) {
|
|
|
1900
1905
|
(user) => existingUsers && !existingUsers.find((existingUser) => existingUser.id === user.id)
|
|
1901
1906
|
).map((user) => {
|
|
1902
1907
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, React4.default.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1903
|
-
|
|
1908
|
+
_chunkEZK3H6EJjs.CommandItem,
|
|
1904
1909
|
{
|
|
1905
1910
|
className: "cursor-pointer",
|
|
1906
1911
|
onClick: (e) => {
|
|
@@ -1935,7 +1940,7 @@ function UsersList({ data, optionComponents, removeFunction, hideOptions, showRe
|
|
|
1935
1940
|
{
|
|
1936
1941
|
data,
|
|
1937
1942
|
fields: ["name" /* name */, "email" /* email */],
|
|
1938
|
-
tableGeneratorType:
|
|
1943
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.User,
|
|
1939
1944
|
title: t(`types.users`, { count: 2 })
|
|
1940
1945
|
}
|
|
1941
1946
|
);
|
|
@@ -1948,8 +1953,8 @@ _chunk7QVYU63Ejs.__name.call(void 0, UsersList, "UsersList");
|
|
|
1948
1953
|
function UsersListByContentIds({ contentIds }) {
|
|
1949
1954
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1950
1955
|
const data = useDataListRetriever({
|
|
1951
|
-
module:
|
|
1952
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
1956
|
+
module: _chunkWZJDLITGjs.Modules.User,
|
|
1957
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.UserService.findManyByContentIds(params), "retriever"),
|
|
1953
1958
|
retrieverParams: { contentIds }
|
|
1954
1959
|
});
|
|
1955
1960
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1957,7 +1962,7 @@ function UsersListByContentIds({ contentIds }) {
|
|
|
1957
1962
|
{
|
|
1958
1963
|
data,
|
|
1959
1964
|
fields: ["name" /* name */, "email" /* email */],
|
|
1960
|
-
tableGeneratorType:
|
|
1965
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.User,
|
|
1961
1966
|
title: t(`generic.relevant_users`)
|
|
1962
1967
|
}
|
|
1963
1968
|
);
|
|
@@ -1979,7 +1984,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, AllowedUsersDetails, "AllowedUsersDetails")
|
|
|
1979
1984
|
var _dynamic = require('next/dynamic'); var _dynamic2 = _interopRequireDefault(_dynamic);
|
|
1980
1985
|
|
|
1981
1986
|
|
|
1982
|
-
var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-
|
|
1987
|
+
var BlockNoteEditor = _dynamic2.default.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./BlockNoteEditor-BCPDRNLK.js"))), {
|
|
1983
1988
|
ssr: false
|
|
1984
1989
|
});
|
|
1985
1990
|
var BlockNoteEditorContainer = React4.default.memo(/* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function EditorContainer(props) {
|
|
@@ -1991,26 +1996,26 @@ var BlockNoteEditorContainer = React4.default.memo(/* @__PURE__ */ _chunk7QVYU63
|
|
|
1991
1996
|
|
|
1992
1997
|
function ErrorDetails({ title, message, code }) {
|
|
1993
1998
|
if (code === 403)
|
|
1994
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-xl max-w-xl", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1995
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1996
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1999
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-xl max-w-xl", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Card, { className: "w-full", children: [
|
|
2000
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { children: [
|
|
2001
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-foreground flex flex-col items-center gap-y-4 pb-10 text-4xl", children: [
|
|
1997
2002
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
1998
2003
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: "Unauthorised" })
|
|
1999
2004
|
] }),
|
|
2000
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2005
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-lg", children: "We are sorry, but you are not allowed to access this content." })
|
|
2001
2006
|
] }),
|
|
2002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2007
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, {})
|
|
2003
2008
|
] }) });
|
|
2004
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-xl max-w-xl", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2005
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2006
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2009
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-xl max-w-xl", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Card, { className: "w-full", children: [
|
|
2010
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { children: [
|
|
2011
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-foreground flex flex-col items-center gap-y-4 pb-10 text-center text-4xl", children: [
|
|
2007
2012
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
2008
2013
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: code }),
|
|
2009
2014
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: title })
|
|
2010
2015
|
] }),
|
|
2011
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2016
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-lg", children: message })
|
|
2012
2017
|
] }),
|
|
2013
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2018
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, {})
|
|
2014
2019
|
] }) });
|
|
2015
2020
|
}
|
|
2016
2021
|
_chunk7QVYU63Ejs.__name.call(void 0, ErrorDetails, "ErrorDetails");
|
|
@@ -2038,7 +2043,7 @@ function CommonAssociationTrigger({
|
|
|
2038
2043
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2039
2044
|
if (hasDestination)
|
|
2040
2045
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hover:text-accent cursor-pointer", onClick: onTrigger, children: "Join" });
|
|
2041
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2046
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { variant: `outline`, size: `sm`, onClick: onTrigger, children: t(`generic.association.label`, {
|
|
2042
2047
|
source: sourceType,
|
|
2043
2048
|
destination: destinationType
|
|
2044
2049
|
}) });
|
|
@@ -2068,29 +2073,29 @@ function CommonAssociationCommandDialog({
|
|
|
2068
2073
|
_react.useEffect.call(void 0, () => {
|
|
2069
2074
|
if (show) updateSearchTerm(searchTerm);
|
|
2070
2075
|
}, [show, searchTerm]);
|
|
2071
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2072
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2076
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CommandDialog, { open: show, onOpenChange: setShow, children: [
|
|
2077
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogHeader, { className: "flex flex-col items-start p-4 pb-0", children: [
|
|
2078
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: t(`generic.association.label`, {
|
|
2074
2079
|
source,
|
|
2075
2080
|
destination
|
|
2076
2081
|
}) }),
|
|
2077
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { children: t(`generic.association.description`, {
|
|
2078
2083
|
source,
|
|
2079
2084
|
destination,
|
|
2080
2085
|
destination_name: destinationName
|
|
2081
2086
|
}) })
|
|
2082
2087
|
] }),
|
|
2083
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2088
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Command, { shouldFilter: false, className: "p-4", children: [
|
|
2084
2089
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2085
|
-
|
|
2090
|
+
_chunkEZK3H6EJjs.CommandInput,
|
|
2086
2091
|
{
|
|
2087
2092
|
placeholder: t(`generic.search.placeholder`, { type: source }),
|
|
2088
2093
|
value: searchTerm,
|
|
2089
2094
|
onValueChange: setSearchTerm
|
|
2090
2095
|
}
|
|
2091
2096
|
),
|
|
2092
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2093
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2097
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-y-auto overflow-x-hidden", children: [
|
|
2098
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CommandEmpty, { children: t(`generic.search.no_results`, { type: source }) }),
|
|
2094
2099
|
children
|
|
2095
2100
|
] })
|
|
2096
2101
|
] })
|
|
@@ -2152,17 +2157,17 @@ function CommonDeleter({ deleteFunction, redirectTo, type, forceShow }) {
|
|
|
2152
2157
|
}
|
|
2153
2158
|
setIsDeleting(false);
|
|
2154
2159
|
}, "handleDelete");
|
|
2155
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2156
|
-
forceShow ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2157
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2158
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2159
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2160
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2160
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AlertDialog, { open, onOpenChange: setOpen, children: [
|
|
2161
|
+
forceShow ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", variant: "ghost", className: "text-muted-foreground hover:text-destructive", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Trash2Icon, {}) }) }),
|
|
2162
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AlertDialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
2163
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AlertDialogHeader, { children: [
|
|
2164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AlertDialogTitle, { children: t(`generic.delete.title`, { type: t(`types.${type}`, { count: 1 }) }) }),
|
|
2165
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AlertDialogDescription, { children: t(`generic.delete.subtitle`, { type: t(`types.${type}`, { count: 1 }) }) })
|
|
2161
2166
|
] }),
|
|
2162
2167
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-destructive p-4 text-sm", children: t(`generic.delete.description`, { type: t(`types.${type}`, { count: 1 }) }) }),
|
|
2163
2168
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end", children: [
|
|
2164
2169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2165
|
-
|
|
2170
|
+
_chunkEZK3H6EJjs.Button,
|
|
2166
2171
|
{
|
|
2167
2172
|
className: "mr-2",
|
|
2168
2173
|
variant: "outline",
|
|
@@ -2173,7 +2178,7 @@ function CommonDeleter({ deleteFunction, redirectTo, type, forceShow }) {
|
|
|
2173
2178
|
}
|
|
2174
2179
|
),
|
|
2175
2180
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2176
|
-
|
|
2181
|
+
_chunkEZK3H6EJjs.Button,
|
|
2177
2182
|
{
|
|
2178
2183
|
type: "submit",
|
|
2179
2184
|
onClick: (e) => {
|
|
@@ -2201,7 +2206,7 @@ function CommonEditorButtons({ isEdit, form, disabled, setOpen }) {
|
|
|
2201
2206
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2202
2207
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end", children: [
|
|
2203
2208
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2204
|
-
|
|
2209
|
+
_chunkEZK3H6EJjs.Button,
|
|
2205
2210
|
{
|
|
2206
2211
|
className: "mr-2",
|
|
2207
2212
|
variant: "outline",
|
|
@@ -2211,7 +2216,7 @@ function CommonEditorButtons({ isEdit, form, disabled, setOpen }) {
|
|
|
2211
2216
|
children: t(`generic.buttons.cancel`)
|
|
2212
2217
|
}
|
|
2213
2218
|
),
|
|
2214
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2219
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { type: "submit", disabled: form.formState.isSubmitting || disabled, "data-testid": `modal-button-create`, children: isEdit ? t(`generic.buttons.confirm_update`) : t(`generic.buttons.confirm_create`) })
|
|
2215
2220
|
] });
|
|
2216
2221
|
}
|
|
2217
2222
|
_chunk7QVYU63Ejs.__name.call(void 0, CommonEditorButtons, "CommonEditorButtons");
|
|
@@ -2221,11 +2226,11 @@ _chunk7QVYU63Ejs.__name.call(void 0, CommonEditorButtons, "CommonEditorButtons")
|
|
|
2221
2226
|
|
|
2222
2227
|
function CommonEditorHeader({ type, name }) {
|
|
2223
2228
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2224
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2225
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2229
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogHeader, { children: [
|
|
2230
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: name ? t(`generic.edit.update.title`, {
|
|
2226
2231
|
type
|
|
2227
2232
|
}) : t(`generic.edit.create.title`, { type }) }),
|
|
2228
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { children: name ? t(`generic.edit.update.description`, {
|
|
2229
2234
|
type,
|
|
2230
2235
|
name
|
|
2231
2236
|
}) : t(`generic.edit.create.description`, {
|
|
@@ -2241,7 +2246,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, CommonEditorHeader, "CommonEditorHeader");
|
|
|
2241
2246
|
|
|
2242
2247
|
function CommonEditorTrigger({ isEdit, edit, create }) {
|
|
2243
2248
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
2244
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2249
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTrigger, { asChild: true, children: isEdit ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", variant: `ghost`, className: "text-muted-foreground", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PencilIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", variant: `outline`, children: create ? create : t(`generic.buttons.create`) }) });
|
|
2245
2250
|
}
|
|
2246
2251
|
_chunk7QVYU63Ejs.__name.call(void 0, CommonEditorTrigger, "CommonEditorTrigger");
|
|
2247
2252
|
|
|
@@ -2320,12 +2325,12 @@ var DatePickerPopover = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
2320
2325
|
onSelect(void 0);
|
|
2321
2326
|
setInputValue("");
|
|
2322
2327
|
}, "handleClear");
|
|
2323
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2324
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2325
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2328
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
2329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverTrigger, { asChild: true, children }),
|
|
2330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverContent, { className: _chunkLJRD4SRVjs.cn.call(void 0, "w-auto p-0", className), align, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-3", children: [
|
|
2326
2331
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative mb-3", children: [
|
|
2327
2332
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2328
|
-
|
|
2333
|
+
_chunkEZK3H6EJjs.Input,
|
|
2329
2334
|
{
|
|
2330
2335
|
value: inputValue,
|
|
2331
2336
|
onChange: (e) => handleInputChange(e.target.value),
|
|
@@ -2357,7 +2362,7 @@ var DatePickerPopover = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
2357
2362
|
] }),
|
|
2358
2363
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-3 flex gap-2", children: [
|
|
2359
2364
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2360
|
-
|
|
2365
|
+
_chunkEZK3H6EJjs.Select,
|
|
2361
2366
|
{
|
|
2362
2367
|
value: displayMonth.getMonth().toString(),
|
|
2363
2368
|
onValueChange: (value2) => {
|
|
@@ -2366,13 +2371,13 @@ var DatePickerPopover = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
2366
2371
|
setDisplayMonth(newDate);
|
|
2367
2372
|
},
|
|
2368
2373
|
children: [
|
|
2369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2370
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2374
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { className: "w-[130px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, {}) }),
|
|
2375
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: monthNames.map((month, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: index.toString(), children: month }, index)) })
|
|
2371
2376
|
]
|
|
2372
2377
|
}
|
|
2373
2378
|
),
|
|
2374
2379
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2375
|
-
|
|
2380
|
+
_chunkEZK3H6EJjs.Select,
|
|
2376
2381
|
{
|
|
2377
2382
|
value: displayMonth.getFullYear().toString(),
|
|
2378
2383
|
onValueChange: (value2) => {
|
|
@@ -2381,14 +2386,14 @@ var DatePickerPopover = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({
|
|
|
2381
2386
|
setDisplayMonth(newDate);
|
|
2382
2387
|
},
|
|
2383
2388
|
children: [
|
|
2384
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2389
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, {}) }),
|
|
2390
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: yearOptions.reverse().map((year) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: year.toString(), children: year }, year)) })
|
|
2386
2391
|
]
|
|
2387
2392
|
}
|
|
2388
2393
|
)
|
|
2389
2394
|
] }),
|
|
2390
2395
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2391
|
-
|
|
2396
|
+
_chunkEZK3H6EJjs.Calendar,
|
|
2392
2397
|
{
|
|
2393
2398
|
mode: "single",
|
|
2394
2399
|
selected: value,
|
|
@@ -2436,13 +2441,13 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
2436
2441
|
setDate(range);
|
|
2437
2442
|
}
|
|
2438
2443
|
}, "handleSelect");
|
|
2439
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
2440
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2441
|
-
|
|
2444
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkLJRD4SRVjs.cn.call(void 0, "grid gap-2"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Popover, { open, onOpenChange: setOpen, children: [
|
|
2445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2446
|
+
_chunkEZK3H6EJjs.Button,
|
|
2442
2447
|
{
|
|
2443
2448
|
id: "date",
|
|
2444
2449
|
variant: "outline",
|
|
2445
|
-
className:
|
|
2450
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, "w-[300px] justify-start text-left font-normal", !date && "text-muted-foreground"),
|
|
2446
2451
|
children: [
|
|
2447
2452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.CalendarIcon, {}),
|
|
2448
2453
|
_optionalChain([date, 'optionalAccess', _61 => _61.from]) ? date.to ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
@@ -2453,9 +2458,9 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
2453
2458
|
]
|
|
2454
2459
|
}
|
|
2455
2460
|
) }),
|
|
2456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2461
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2 p-2", children: [
|
|
2457
2462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2458
|
-
|
|
2463
|
+
_chunkEZK3H6EJjs.Calendar,
|
|
2459
2464
|
{
|
|
2460
2465
|
mode: "range",
|
|
2461
2466
|
defaultMonth: _nullishCoalesce(_optionalChain([date, 'optionalAccess', _62 => _62.from]), () => ( (showPreviousMonth ? new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() - 1, 1) : void 0))),
|
|
@@ -2465,7 +2470,7 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
|
|
|
2465
2470
|
}
|
|
2466
2471
|
),
|
|
2467
2472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2468
|
-
|
|
2473
|
+
_chunkEZK3H6EJjs.Button,
|
|
2469
2474
|
{
|
|
2470
2475
|
variant: "secondary",
|
|
2471
2476
|
type: "button",
|
|
@@ -2635,7 +2640,7 @@ var FileUploader = _react.forwardRef.call(void 0,
|
|
|
2635
2640
|
ref,
|
|
2636
2641
|
tabIndex: 0,
|
|
2637
2642
|
onKeyDownCapture: handleKeyDown,
|
|
2638
|
-
className:
|
|
2643
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
2639
2644
|
"grid w-full overflow-hidden focus:outline-none",
|
|
2640
2645
|
className,
|
|
2641
2646
|
// Original className from props
|
|
@@ -2659,12 +2664,12 @@ var FileUploaderContent = _react.forwardRef.call(void 0,
|
|
|
2659
2664
|
({ children, className, ...props }, ref) => {
|
|
2660
2665
|
const { orientation } = useFileUpload();
|
|
2661
2666
|
const containerRef = _react.useRef.call(void 0, null);
|
|
2662
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
2667
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkLJRD4SRVjs.cn.call(void 0, "w-full px-1"), ref: containerRef, "aria-description": "content file holder", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2663
2668
|
"div",
|
|
2664
2669
|
{
|
|
2665
2670
|
...props,
|
|
2666
2671
|
ref,
|
|
2667
|
-
className:
|
|
2672
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
2668
2673
|
"flex gap-1 rounded-xl",
|
|
2669
2674
|
orientation === "horizontal" ? "flex-raw flex-wrap" : "flex-col",
|
|
2670
2675
|
className
|
|
@@ -2684,8 +2689,8 @@ var FileUploaderItem = _react.forwardRef.call(void 0,
|
|
|
2684
2689
|
"div",
|
|
2685
2690
|
{
|
|
2686
2691
|
ref,
|
|
2687
|
-
className:
|
|
2688
|
-
|
|
2692
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
2693
|
+
_chunkEZK3H6EJjs.buttonVariants.call(void 0, { variant: "ghost" }),
|
|
2689
2694
|
"relative h-6 cursor-pointer justify-between p-1",
|
|
2690
2695
|
className,
|
|
2691
2696
|
isSelected ? "bg-muted" : ""
|
|
@@ -2697,7 +2702,7 @@ var FileUploaderItem = _react.forwardRef.call(void 0,
|
|
|
2697
2702
|
"button",
|
|
2698
2703
|
{
|
|
2699
2704
|
type: "button",
|
|
2700
|
-
className:
|
|
2705
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, "absolute", direction === "rtl" ? "top-1 left-1" : "top-1 right-1"),
|
|
2701
2706
|
onClick: () => removeFileFromSet(index),
|
|
2702
2707
|
children: [
|
|
2703
2708
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: t(`generic.remove_item`, { index }) }),
|
|
@@ -2721,12 +2726,12 @@ var FileInput = _react.forwardRef.call(void 0,
|
|
|
2721
2726
|
{
|
|
2722
2727
|
ref,
|
|
2723
2728
|
...props,
|
|
2724
|
-
className:
|
|
2729
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, `relative w-full ${isLOF ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`, className),
|
|
2725
2730
|
children: [
|
|
2726
2731
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2727
2732
|
"div",
|
|
2728
2733
|
{
|
|
2729
|
-
className:
|
|
2734
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
2730
2735
|
"w-full rounded-lg duration-300 ease-in-out",
|
|
2731
2736
|
// Simpler border logic: if parent is drag-active, it controls the border.
|
|
2732
2737
|
// Otherwise, FileInput can show its own accept/reject/default border.
|
|
@@ -2743,7 +2748,7 @@ var FileInput = _react.forwardRef.call(void 0,
|
|
|
2743
2748
|
}
|
|
2744
2749
|
),
|
|
2745
2750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2746
|
-
|
|
2751
|
+
_chunkEZK3H6EJjs.Input,
|
|
2747
2752
|
{
|
|
2748
2753
|
ref: dropzoneState.inputRef,
|
|
2749
2754
|
disabled: isLOF,
|
|
@@ -2762,30 +2767,30 @@ FileInput.displayName = "FileInput";
|
|
|
2762
2767
|
|
|
2763
2768
|
function FormCheckbox({ form, id, name, labelBefore, description, isRequired }) {
|
|
2764
2769
|
const simpleLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
2765
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2770
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { htmlFor: id, className: `font-normal ${labelBefore ? "" : "ml-3"}`, children: name });
|
|
2766
2771
|
}, "simpleLabel");
|
|
2767
2772
|
const label = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
2768
2773
|
if (description) return simpleLabel();
|
|
2769
2774
|
else
|
|
2770
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2772
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2775
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tooltip, { children: [
|
|
2776
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipTrigger, { asChild: true, children: simpleLabel() }),
|
|
2777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipContent, { children: description })
|
|
2773
2778
|
] });
|
|
2774
2779
|
}, "label");
|
|
2775
2780
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2776
|
-
|
|
2781
|
+
_chunkEZK3H6EJjs.FormField,
|
|
2777
2782
|
{
|
|
2778
2783
|
control: form.control,
|
|
2779
2784
|
name: id,
|
|
2780
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2781
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2785
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
2786
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-x-4", children: [
|
|
2782
2787
|
labelBefore && label(),
|
|
2783
2788
|
labelBefore && isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" }),
|
|
2784
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2789
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Checkbox, { id, defaultChecked: field.value, onCheckedChange: field.onChange }),
|
|
2785
2790
|
!labelBefore && label(),
|
|
2786
2791
|
!labelBefore && isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
2787
2792
|
] }) }),
|
|
2788
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2793
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
2789
2794
|
] })
|
|
2790
2795
|
}
|
|
2791
2796
|
) });
|
|
@@ -2802,17 +2807,17 @@ function FormContainerGeneric({
|
|
|
2802
2807
|
isRequired = false
|
|
2803
2808
|
}) {
|
|
2804
2809
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2805
|
-
|
|
2810
|
+
_chunkEZK3H6EJjs.FormField,
|
|
2806
2811
|
{
|
|
2807
2812
|
control: form.control,
|
|
2808
2813
|
name: id,
|
|
2809
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2810
|
-
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2814
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
2815
|
+
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "flex items-center", children: [
|
|
2811
2816
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: name }),
|
|
2812
2817
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
2813
2818
|
] }),
|
|
2814
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2815
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2819
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children }),
|
|
2820
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
2816
2821
|
] })
|
|
2817
2822
|
}
|
|
2818
2823
|
) });
|
|
@@ -2898,20 +2903,20 @@ function FormDate({
|
|
|
2898
2903
|
if (onChange) onChange(selectedDate);
|
|
2899
2904
|
}, "handleCalendarSelect");
|
|
2900
2905
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2901
|
-
|
|
2906
|
+
_chunkEZK3H6EJjs.FormField,
|
|
2902
2907
|
{
|
|
2903
2908
|
control: form.control,
|
|
2904
2909
|
name: id,
|
|
2905
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2906
|
-
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2910
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"} w-full`, children: [
|
|
2911
|
+
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "dlex items-center", children: [
|
|
2907
2912
|
name,
|
|
2908
2913
|
" ",
|
|
2909
2914
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
2910
2915
|
] }),
|
|
2911
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2916
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Popover, { open, onOpenChange: setOpen, modal: true, children: [
|
|
2912
2917
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative", children: [
|
|
2913
2918
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2914
|
-
|
|
2919
|
+
_chunkEZK3H6EJjs.Input,
|
|
2915
2920
|
{
|
|
2916
2921
|
value: inputValue,
|
|
2917
2922
|
onChange: (e) => handleInputChange(e.target.value, field),
|
|
@@ -2920,7 +2925,7 @@ function FormDate({
|
|
|
2920
2925
|
}
|
|
2921
2926
|
),
|
|
2922
2927
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "absolute right-1 top-1/2 flex -translate-y-1/2 items-center space-x-1", children: [
|
|
2923
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2924
2929
|
"button",
|
|
2925
2930
|
{
|
|
2926
2931
|
type: "button",
|
|
@@ -2943,10 +2948,10 @@ function FormDate({
|
|
|
2943
2948
|
)
|
|
2944
2949
|
] })
|
|
2945
2950
|
] }),
|
|
2946
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2951
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-3", children: [
|
|
2947
2952
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-3 flex gap-2", children: [
|
|
2948
2953
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2949
|
-
|
|
2954
|
+
_chunkEZK3H6EJjs.Select,
|
|
2950
2955
|
{
|
|
2951
2956
|
value: displayMonth.getMonth().toString(),
|
|
2952
2957
|
onValueChange: (value) => {
|
|
@@ -2955,13 +2960,13 @@ function FormDate({
|
|
|
2955
2960
|
setDisplayMonth(newDate);
|
|
2956
2961
|
},
|
|
2957
2962
|
children: [
|
|
2958
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2959
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2963
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { className: "w-[130px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, {}) }),
|
|
2964
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: monthNames.map((month, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: index.toString(), children: month }, index)) })
|
|
2960
2965
|
]
|
|
2961
2966
|
}
|
|
2962
2967
|
),
|
|
2963
2968
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2964
|
-
|
|
2969
|
+
_chunkEZK3H6EJjs.Select,
|
|
2965
2970
|
{
|
|
2966
2971
|
value: displayMonth.getFullYear().toString(),
|
|
2967
2972
|
onValueChange: (value) => {
|
|
@@ -2970,14 +2975,14 @@ function FormDate({
|
|
|
2970
2975
|
setDisplayMonth(newDate);
|
|
2971
2976
|
},
|
|
2972
2977
|
children: [
|
|
2973
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2974
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2978
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { className: "w-[80px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, {}) }),
|
|
2979
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: yearOptions.reverse().map((year) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: year.toString(), children: year }, year)) })
|
|
2975
2980
|
]
|
|
2976
2981
|
}
|
|
2977
2982
|
)
|
|
2978
2983
|
] }),
|
|
2979
2984
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2980
|
-
|
|
2985
|
+
_chunkEZK3H6EJjs.Calendar,
|
|
2981
2986
|
{
|
|
2982
2987
|
mode: "single",
|
|
2983
2988
|
selected: field.value,
|
|
@@ -2994,7 +2999,7 @@ function FormDate({
|
|
|
2994
2999
|
)
|
|
2995
3000
|
] }) })
|
|
2996
3001
|
] }) }) }),
|
|
2997
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3002
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
2998
3003
|
] })
|
|
2999
3004
|
}
|
|
3000
3005
|
) });
|
|
@@ -3059,19 +3064,19 @@ function FormDateTime({
|
|
|
3059
3064
|
}
|
|
3060
3065
|
}, "handleTimeChange");
|
|
3061
3066
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3062
|
-
|
|
3067
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3063
3068
|
{
|
|
3064
3069
|
control: form.control,
|
|
3065
3070
|
name: id,
|
|
3066
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3067
|
-
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3068
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3071
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"} w-full`, children: [
|
|
3072
|
+
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { children: name }),
|
|
3073
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative flex flex-row", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Popover, { open, onOpenChange: setOpen, modal: true, children: [
|
|
3069
3074
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-between", children: [
|
|
3070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3071
|
-
|
|
3075
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3076
|
+
_chunkEZK3H6EJjs.Button,
|
|
3072
3077
|
{
|
|
3073
3078
|
variant: "outline",
|
|
3074
|
-
className:
|
|
3079
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, "w-full pl-3 text-left font-normal", !field.value && "text-muted-foreground"),
|
|
3075
3080
|
children: [
|
|
3076
3081
|
field.value ? formatDateTime(field.value) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: t(`generic.pick_date_time`) }),
|
|
3077
3082
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Calendar, { className: "ml-auto h-4 w-4 opacity-50" })
|
|
@@ -3089,9 +3094,9 @@ function FormDateTime({
|
|
|
3089
3094
|
}
|
|
3090
3095
|
)
|
|
3091
3096
|
] }),
|
|
3092
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3097
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverContent, { className: "w-auto p-4", align: "start", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col space-y-4", children: [
|
|
3093
3098
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3094
|
-
|
|
3099
|
+
_chunkEZK3H6EJjs.Calendar,
|
|
3095
3100
|
{
|
|
3096
3101
|
mode: "single",
|
|
3097
3102
|
selected: field.value,
|
|
@@ -3116,9 +3121,9 @@ function FormDateTime({
|
|
|
3116
3121
|
),
|
|
3117
3122
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-end justify-center space-x-4", children: [
|
|
3118
3123
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col space-y-2", children: [
|
|
3119
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Label, { htmlFor: "hours-select", children: t(`generic.hours`) }),
|
|
3120
3125
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3121
|
-
|
|
3126
|
+
_chunkEZK3H6EJjs.Select,
|
|
3122
3127
|
{
|
|
3123
3128
|
value: String(field.value ? new Date(field.value).getHours() : selectedHours),
|
|
3124
3129
|
onValueChange: (value) => {
|
|
@@ -3130,17 +3135,17 @@ function FormDateTime({
|
|
|
3130
3135
|
);
|
|
3131
3136
|
},
|
|
3132
3137
|
children: [
|
|
3133
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3134
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3138
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { id: "hours-select", className: "w-[70px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, { placeholder: "Hour" }) }),
|
|
3139
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: hoursOptions.map((option) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: String(option.value), children: option.label }, option.value)) })
|
|
3135
3140
|
]
|
|
3136
3141
|
}
|
|
3137
3142
|
)
|
|
3138
3143
|
] }),
|
|
3139
3144
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mb-[9px] text-xl", children: ":" }),
|
|
3140
3145
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col space-y-2", children: [
|
|
3141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3146
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Label, { htmlFor: "minutes-select", children: t(`generic.minutes`) }),
|
|
3142
3147
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3143
|
-
|
|
3148
|
+
_chunkEZK3H6EJjs.Select,
|
|
3144
3149
|
{
|
|
3145
3150
|
value: String(
|
|
3146
3151
|
field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
|
|
@@ -3151,15 +3156,15 @@ function FormDateTime({
|
|
|
3151
3156
|
handleTimeChange(field.value ? new Date(field.value).getHours() : selectedHours, minutes);
|
|
3152
3157
|
},
|
|
3153
3158
|
children: [
|
|
3154
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3159
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { id: "minutes-select", className: "w-[70px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, { placeholder: "Min" }) }),
|
|
3160
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: minutesOptions.map((option) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: String(option.value), children: option.label }, option.value)) })
|
|
3156
3161
|
]
|
|
3157
3162
|
}
|
|
3158
3163
|
)
|
|
3159
3164
|
] })
|
|
3160
3165
|
] }),
|
|
3161
3166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3162
|
-
|
|
3167
|
+
_chunkEZK3H6EJjs.Button,
|
|
3163
3168
|
{
|
|
3164
3169
|
className: "mt-2",
|
|
3165
3170
|
onClick: () => {
|
|
@@ -3170,7 +3175,7 @@ function FormDateTime({
|
|
|
3170
3175
|
)
|
|
3171
3176
|
] }) })
|
|
3172
3177
|
] }) }) }),
|
|
3173
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3178
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3174
3179
|
] })
|
|
3175
3180
|
}
|
|
3176
3181
|
) });
|
|
@@ -3196,7 +3201,7 @@ function FormInput({
|
|
|
3196
3201
|
}) {
|
|
3197
3202
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3198
3203
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3199
|
-
|
|
3204
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3200
3205
|
{
|
|
3201
3206
|
control: form.control,
|
|
3202
3207
|
name: id,
|
|
@@ -3221,15 +3226,15 @@ function FormInput({
|
|
|
3221
3226
|
if (onBlur) await onBlur();
|
|
3222
3227
|
field.onBlur();
|
|
3223
3228
|
}, "handleBlur");
|
|
3224
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3225
|
-
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3229
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
3230
|
+
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "flex items-center", children: [
|
|
3226
3231
|
name,
|
|
3227
3232
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
3228
3233
|
] }),
|
|
3229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative", children: [
|
|
3230
3235
|
type === "currency" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground absolute top-0 left-0 pt-2 pl-3", children: "\u20AC" }),
|
|
3231
3236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3232
|
-
|
|
3237
|
+
_chunkEZK3H6EJjs.Input,
|
|
3233
3238
|
{
|
|
3234
3239
|
"data-testid": testId,
|
|
3235
3240
|
...field,
|
|
@@ -3253,7 +3258,7 @@ function FormInput({
|
|
|
3253
3258
|
}
|
|
3254
3259
|
)
|
|
3255
3260
|
] }) }),
|
|
3256
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3261
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, { "data-testid": testId ? `${testId}-error` : void 0 })
|
|
3257
3262
|
] });
|
|
3258
3263
|
}
|
|
3259
3264
|
}
|
|
@@ -3271,9 +3276,9 @@ var PasswordInput = React4.forwardRef(({ className, type, ...props }, ref) => {
|
|
|
3271
3276
|
const disabled = props.value === "" || props.value === void 0 || props.disabled;
|
|
3272
3277
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
3273
3278
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative", children: [
|
|
3274
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3279
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Input, { type: showPassword ? "text" : "password", className: _chunkLJRD4SRVjs.cn.call(void 0, "", className), ref, ...props }),
|
|
3275
3280
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3276
|
-
|
|
3281
|
+
_chunkEZK3H6EJjs.Button,
|
|
3277
3282
|
{
|
|
3278
3283
|
type: "button",
|
|
3279
3284
|
variant: "ghost",
|
|
@@ -3312,16 +3317,16 @@ function FormPassword({
|
|
|
3312
3317
|
isRequired
|
|
3313
3318
|
}) {
|
|
3314
3319
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3315
|
-
|
|
3320
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3316
3321
|
{
|
|
3317
3322
|
control: form.control,
|
|
3318
3323
|
name: id,
|
|
3319
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3320
|
-
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3324
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
3325
|
+
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { children: [
|
|
3321
3326
|
name,
|
|
3322
3327
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
3323
3328
|
] }),
|
|
3324
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3325
3330
|
PasswordInput,
|
|
3326
3331
|
{
|
|
3327
3332
|
...field,
|
|
@@ -3332,7 +3337,7 @@ function FormPassword({
|
|
|
3332
3337
|
"data-testid": testId
|
|
3333
3338
|
}
|
|
3334
3339
|
) }),
|
|
3335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, { "data-testid": testId ? `${testId}-error` : void 0 })
|
|
3336
3341
|
] })
|
|
3337
3342
|
}
|
|
3338
3343
|
) });
|
|
@@ -3463,43 +3468,43 @@ function FormPlaceAutocomplete({
|
|
|
3463
3468
|
}, []);
|
|
3464
3469
|
if (loadError) {
|
|
3465
3470
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3466
|
-
|
|
3471
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3467
3472
|
{
|
|
3468
3473
|
control: form.control,
|
|
3469
3474
|
name: id,
|
|
3470
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3471
|
-
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3475
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
3476
|
+
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "flex items-center", children: [
|
|
3472
3477
|
name,
|
|
3473
3478
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
3474
3479
|
] }),
|
|
3475
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3476
|
-
|
|
3480
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3481
|
+
_chunkEZK3H6EJjs.Input,
|
|
3477
3482
|
{
|
|
3478
3483
|
...field,
|
|
3479
3484
|
placeholder,
|
|
3480
3485
|
disabled,
|
|
3481
3486
|
"data-testid": testId,
|
|
3482
|
-
className:
|
|
3487
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, "w-full", className)
|
|
3483
3488
|
}
|
|
3484
3489
|
) }),
|
|
3485
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3490
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3486
3491
|
] })
|
|
3487
3492
|
}
|
|
3488
3493
|
) });
|
|
3489
3494
|
}
|
|
3490
3495
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", ref: containerRef, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3491
|
-
|
|
3496
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3492
3497
|
{
|
|
3493
3498
|
control: form.control,
|
|
3494
3499
|
name: id,
|
|
3495
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3496
|
-
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3500
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
3501
|
+
name && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "flex items-center", children: [
|
|
3497
3502
|
name,
|
|
3498
3503
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
3499
3504
|
] }),
|
|
3500
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3505
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative", children: [
|
|
3501
3506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3502
|
-
|
|
3507
|
+
_chunkEZK3H6EJjs.Input,
|
|
3503
3508
|
{
|
|
3504
3509
|
value: inputValue,
|
|
3505
3510
|
onChange: (e) => handleInputChange(e.target.value),
|
|
@@ -3512,7 +3517,7 @@ function FormPlaceAutocomplete({
|
|
|
3512
3517
|
placeholder,
|
|
3513
3518
|
disabled: disabled || !apiKey,
|
|
3514
3519
|
"data-testid": testId,
|
|
3515
|
-
className:
|
|
3520
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, "w-full", className)
|
|
3516
3521
|
}
|
|
3517
3522
|
),
|
|
3518
3523
|
isLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-primary h-4 w-4 animate-spin rounded-full border-2 border-t-transparent" }) }),
|
|
@@ -3529,7 +3534,7 @@ function FormPlaceAutocomplete({
|
|
|
3529
3534
|
suggestion.place_id || index
|
|
3530
3535
|
)) })
|
|
3531
3536
|
] }) }),
|
|
3532
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3537
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3533
3538
|
] })
|
|
3534
3539
|
}
|
|
3535
3540
|
) });
|
|
@@ -3550,14 +3555,14 @@ function FormSelect({
|
|
|
3550
3555
|
testId
|
|
3551
3556
|
}) {
|
|
3552
3557
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-full flex-col`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3553
|
-
|
|
3558
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3554
3559
|
{
|
|
3555
3560
|
control: form.control,
|
|
3556
3561
|
name: id,
|
|
3557
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3558
|
-
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3562
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `flex w-full ${useRows ? `flex-row items-center justify-between gap-x-4` : `flex-col`}`, children: [
|
|
3563
|
+
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: `${useRows ? `min-w-28` : ``}`, children: name }),
|
|
3559
3564
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3560
|
-
|
|
3565
|
+
_chunkEZK3H6EJjs.Select,
|
|
3561
3566
|
{
|
|
3562
3567
|
onValueChange: (e) => {
|
|
3563
3568
|
field.onChange(e);
|
|
@@ -3566,12 +3571,12 @@ function FormSelect({
|
|
|
3566
3571
|
defaultValue: field.value,
|
|
3567
3572
|
"data-testid": testId,
|
|
3568
3573
|
children: [
|
|
3569
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3570
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3574
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { className: "w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectTrigger, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectValue, { placeholder }) }) }),
|
|
3575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectContent, { children: values.map((type) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.SelectItem, { value: type.id, children: type.text }, type.id)) })
|
|
3571
3576
|
]
|
|
3572
3577
|
}
|
|
3573
3578
|
),
|
|
3574
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3579
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3575
3580
|
] })
|
|
3576
3581
|
}
|
|
3577
3582
|
) });
|
|
@@ -3590,16 +3595,16 @@ function FormSlider({
|
|
|
3590
3595
|
}) {
|
|
3591
3596
|
const value = _reacthookform.useWatch.call(void 0, { control: form.control, name: id });
|
|
3592
3597
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3593
|
-
|
|
3598
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3594
3599
|
{
|
|
3595
3600
|
control: form.control,
|
|
3596
3601
|
name: id,
|
|
3597
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3598
|
-
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3599
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3602
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
3603
|
+
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { children: name }),
|
|
3604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
3600
3605
|
showPercentage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mb-2 flex w-full justify-center text-xs", children: `${value}%` }),
|
|
3601
3606
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3602
|
-
|
|
3607
|
+
_chunkEZK3H6EJjs.Slider,
|
|
3603
3608
|
{
|
|
3604
3609
|
onValueChange: (value2) => form.setValue(id, value2[0]),
|
|
3605
3610
|
value: [value],
|
|
@@ -3609,7 +3614,7 @@ function FormSlider({
|
|
|
3609
3614
|
}
|
|
3610
3615
|
)
|
|
3611
3616
|
] }) }),
|
|
3612
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3617
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3613
3618
|
] })
|
|
3614
3619
|
}
|
|
3615
3620
|
) });
|
|
@@ -3620,16 +3625,16 @@ _chunk7QVYU63Ejs.__name.call(void 0, FormSlider, "FormSlider");
|
|
|
3620
3625
|
|
|
3621
3626
|
function FormSwitch({ form, id, name, disabled }) {
|
|
3622
3627
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3623
|
-
|
|
3628
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3624
3629
|
{
|
|
3625
3630
|
control: form.control,
|
|
3626
3631
|
name: id,
|
|
3627
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3628
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3629
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3630
|
-
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3632
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
3633
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row gap-x-4", children: [
|
|
3634
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Switch, { checked: field.value, onCheckedChange: field.onChange }),
|
|
3635
|
+
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { children: name })
|
|
3631
3636
|
] }) }),
|
|
3632
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3633
3638
|
] })
|
|
3634
3639
|
}
|
|
3635
3640
|
) });
|
|
@@ -3647,23 +3652,23 @@ function FormTextarea({
|
|
|
3647
3652
|
testId
|
|
3648
3653
|
}) {
|
|
3649
3654
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3650
|
-
|
|
3655
|
+
_chunkEZK3H6EJjs.FormField,
|
|
3651
3656
|
{
|
|
3652
3657
|
control: form.control,
|
|
3653
3658
|
name: id,
|
|
3654
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3655
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3656
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3657
|
-
|
|
3659
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: "mb-5", children: [
|
|
3660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { children: name }),
|
|
3661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3662
|
+
_chunkEZK3H6EJjs.Textarea,
|
|
3658
3663
|
{
|
|
3659
3664
|
...field,
|
|
3660
|
-
className:
|
|
3665
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0, "min-h-96 w-full", className),
|
|
3661
3666
|
disabled: form.formState.isSubmitting,
|
|
3662
3667
|
placeholder,
|
|
3663
3668
|
"data-testid": testId
|
|
3664
3669
|
}
|
|
3665
3670
|
) }),
|
|
3666
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, { "data-testid": testId ? `${testId}-error` : void 0 })
|
|
3667
3672
|
] })
|
|
3668
3673
|
}
|
|
3669
3674
|
) });
|
|
@@ -3745,12 +3750,12 @@ function FormFeatures({
|
|
|
3745
3750
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
3746
3751
|
name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "mb-5 font-semibold", children: name }),
|
|
3747
3752
|
features.map((feature) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3748
|
-
|
|
3753
|
+
_chunkEZK3H6EJjs.Accordion,
|
|
3749
3754
|
{
|
|
3750
3755
|
type: "single",
|
|
3751
3756
|
collapsible: true,
|
|
3752
3757
|
className: `w-full p-0`,
|
|
3753
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3758
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AccordionItem, { value: feature.id, className: "p-0", children: [
|
|
3754
3759
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3755
3760
|
"div",
|
|
3756
3761
|
{
|
|
@@ -3758,7 +3763,7 @@ function FormFeatures({
|
|
|
3758
3763
|
children: [
|
|
3759
3764
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center", onClick: (e) => e.stopPropagation(), children: [
|
|
3760
3765
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3761
|
-
|
|
3766
|
+
_chunkEZK3H6EJjs.Checkbox,
|
|
3762
3767
|
{
|
|
3763
3768
|
id: feature.id,
|
|
3764
3769
|
checked: isFeatureChecked(feature),
|
|
@@ -3767,20 +3772,20 @@ function FormFeatures({
|
|
|
3767
3772
|
}
|
|
3768
3773
|
}
|
|
3769
3774
|
),
|
|
3770
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { htmlFor: feature.id, className: "ml-3 cursor-pointer font-normal", children: feature.name })
|
|
3771
3776
|
] }),
|
|
3772
|
-
feature.modules.filter((module) => !module.isCore).length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3777
|
+
feature.modules.filter((module) => !module.isCore).length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AccordionTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full" }) })
|
|
3773
3778
|
]
|
|
3774
3779
|
}
|
|
3775
3780
|
),
|
|
3776
|
-
feature.modules.filter((module) => !module.isCore).length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3781
|
+
feature.modules.filter((module) => !module.isCore).length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AccordionContent, { className: "pl-6", children: feature.modules.filter((module) => !module.isCore).sort((a, b) => a.name.localeCompare(b.name)).map((module) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3777
3782
|
"div",
|
|
3778
3783
|
{
|
|
3779
3784
|
className: "flex items-center border-t py-2",
|
|
3780
3785
|
onClick: (e) => e.stopPropagation(),
|
|
3781
3786
|
children: [
|
|
3782
3787
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3783
|
-
|
|
3788
|
+
_chunkEZK3H6EJjs.Checkbox,
|
|
3784
3789
|
{
|
|
3785
3790
|
id: module.id,
|
|
3786
3791
|
checked: selectedModules.includes(module.id),
|
|
@@ -3789,7 +3794,7 @@ function FormFeatures({
|
|
|
3789
3794
|
}
|
|
3790
3795
|
}
|
|
3791
3796
|
),
|
|
3792
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3797
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { htmlFor: module.id, className: "ml-3 cursor-pointer font-normal", children: module.name })
|
|
3793
3798
|
]
|
|
3794
3799
|
},
|
|
3795
3800
|
module.id
|
|
@@ -3798,7 +3803,7 @@ function FormFeatures({
|
|
|
3798
3803
|
},
|
|
3799
3804
|
feature.id
|
|
3800
3805
|
)),
|
|
3801
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3806
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
3802
3807
|
] });
|
|
3803
3808
|
}
|
|
3804
3809
|
_chunk7QVYU63Ejs.__name.call(void 0, FormFeatures, "FormFeatures");
|
|
@@ -3828,14 +3833,14 @@ function PageContainerContentDetails({ items, section, module, id }) {
|
|
|
3828
3833
|
};
|
|
3829
3834
|
}, []);
|
|
3830
3835
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3831
|
-
|
|
3836
|
+
_chunkEZK3H6EJjs.Tabs,
|
|
3832
3837
|
{
|
|
3833
3838
|
defaultValue: section || items[0].title,
|
|
3834
3839
|
onValueChange: (a) => rewriteUrl({ page: module, id, childPage: a }),
|
|
3835
3840
|
children: [
|
|
3836
3841
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: sentinelRef, className: "h-0" }),
|
|
3837
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `bg-background sticky top-0 z-10 mb-2 pb-2 transition-shadow ${isScrolled ? "border-b" : ""}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3838
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pr-4", children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3842
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `bg-background sticky top-0 z-10 mb-2 pb-2 transition-shadow ${isScrolled ? "border-b" : ""}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsList, { children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsTrigger, { value: item.title, children: item.title }, item.title)) }) }),
|
|
3843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "pr-4", children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsContent, { value: item.title, children: item.content }, item.title)) })
|
|
3839
3844
|
]
|
|
3840
3845
|
}
|
|
3841
3846
|
);
|
|
@@ -3845,13 +3850,13 @@ _chunk7QVYU63Ejs.__name.call(void 0, PageContainerContentDetails, "PageContainer
|
|
|
3845
3850
|
// src/components/pages/PageContentContainer.tsx
|
|
3846
3851
|
|
|
3847
3852
|
function PageContentContainer({ details, footer, content }) {
|
|
3848
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-[calc(100vh-(--spacing(16)))] w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3849
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3853
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex h-[calc(100vh-(--spacing(16)))] w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.ResizablePanelGroup, { direction: "horizontal", className: "items-stretch", autoSaveId: "page-content-layout", children: [
|
|
3854
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.ResizablePanel, { id: "left-panel", defaultSize: 32, minSize: 20, maxSize: 40, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "@container flex h-full flex-col pr-4", children: [
|
|
3850
3855
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 overflow-y-auto", children: details }),
|
|
3851
3856
|
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-y-2 pt-2 pb-2", children: footer })
|
|
3852
3857
|
] }) }),
|
|
3853
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3854
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3858
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.ResizableHandle, { withHandle: true }),
|
|
3859
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.ResizablePanel, { id: "right-panel", className: "pl-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full overflow-y-auto", children: content }) })
|
|
3855
3860
|
] }) });
|
|
3856
3861
|
}
|
|
3857
3862
|
_chunk7QVYU63Ejs.__name.call(void 0, PageContentContainer, "PageContentContainer");
|
|
@@ -3889,7 +3894,7 @@ var cellId = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
|
3889
3894
|
accessorKey: params.name,
|
|
3890
3895
|
header: "",
|
|
3891
3896
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => params.toggleId ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3892
|
-
|
|
3897
|
+
_chunkEZK3H6EJjs.Checkbox,
|
|
3893
3898
|
{
|
|
3894
3899
|
checked: _optionalChain([params, 'access', _92 => _92.checkedIds, 'optionalAccess', _93 => _93.includes, 'call', _94 => _94(row.getValue(params.name))]) || false,
|
|
3895
3900
|
onCheckedChange: (value) => {
|
|
@@ -3911,7 +3916,7 @@ var cellLink = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
|
3911
3916
|
id: params.name,
|
|
3912
3917
|
accessorKey: params.name,
|
|
3913
3918
|
header: params.title,
|
|
3914
|
-
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3919
|
+
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: params.generateUrl(row.getValue(params.id)), children: row.getValue(params.name) }), "cell"),
|
|
3915
3920
|
enableSorting: false,
|
|
3916
3921
|
enableHiding: false
|
|
3917
3922
|
};
|
|
@@ -3924,7 +3929,7 @@ var cellUrl = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
|
3924
3929
|
id: params.name,
|
|
3925
3930
|
accessorKey: params.name,
|
|
3926
3931
|
header: params.title,
|
|
3927
|
-
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3932
|
+
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: row.getValue(params.name), children: row.getValue(params.name) }), "cell"),
|
|
3928
3933
|
enableSorting: false,
|
|
3929
3934
|
enableHiding: false
|
|
3930
3935
|
};
|
|
@@ -4165,14 +4170,14 @@ _chunk7QVYU63Ejs.__name.call(void 0, useJsonApiMutation, "useJsonApiMutation");
|
|
|
4165
4170
|
function useRehydration(classKey, data) {
|
|
4166
4171
|
return _react.useMemo.call(void 0, () => {
|
|
4167
4172
|
if (!data) return null;
|
|
4168
|
-
return
|
|
4173
|
+
return _chunkWZJDLITGjs.RehydrationFactory.rehydrate(classKey, data);
|
|
4169
4174
|
}, [classKey, data]);
|
|
4170
4175
|
}
|
|
4171
4176
|
_chunk7QVYU63Ejs.__name.call(void 0, useRehydration, "useRehydration");
|
|
4172
4177
|
function useRehydrationList(classKey, data) {
|
|
4173
4178
|
return _react.useMemo.call(void 0, () => {
|
|
4174
4179
|
if (!data || data.length === 0) return [];
|
|
4175
|
-
return
|
|
4180
|
+
return _chunkWZJDLITGjs.RehydrationFactory.rehydrateList(classKey, data);
|
|
4176
4181
|
}, [classKey, data]);
|
|
4177
4182
|
}
|
|
4178
4183
|
_chunk7QVYU63Ejs.__name.call(void 0, useRehydrationList, "useRehydrationList");
|
|
@@ -4210,13 +4215,13 @@ var useCompanyTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
4210
4215
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
4211
4216
|
const company = row.original.jsonApiData;
|
|
4212
4217
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4213
|
-
|
|
4218
|
+
_chunkEZK3H6EJjs.Link,
|
|
4214
4219
|
{
|
|
4215
4220
|
href: hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) ? generateUrl({
|
|
4216
4221
|
page: "/administration",
|
|
4217
|
-
id: _optionalChain([
|
|
4222
|
+
id: _optionalChain([_chunkWZJDLITGjs.Modules, 'access', _113 => _113.Company, 'access', _114 => _114.pageUrl, 'optionalAccess', _115 => _115.substring, 'call', _116 => _116(1)]),
|
|
4218
4223
|
childPage: company.id
|
|
4219
|
-
}) : generateUrl({ page:
|
|
4224
|
+
}) : generateUrl({ page: _chunkWZJDLITGjs.Modules.Company, id: company.id }),
|
|
4220
4225
|
children: row.getValue("name")
|
|
4221
4226
|
}
|
|
4222
4227
|
);
|
|
@@ -4266,7 +4271,7 @@ var useRoleTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
4266
4271
|
header: t(`foundations.role.fields.name.label`),
|
|
4267
4272
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
4268
4273
|
const role = row.original.jsonApiData;
|
|
4269
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4274
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: generateUrl({ page: _chunkWZJDLITGjs.Modules.Role, id: role.id }), children: row.getValue("name") });
|
|
4270
4275
|
}, "cell"),
|
|
4271
4276
|
enableSorting: false,
|
|
4272
4277
|
enableHiding: false
|
|
@@ -4303,7 +4308,7 @@ var useUserSearch = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
|
4303
4308
|
if (search === searchQueryRef.current && users.length > 0) return;
|
|
4304
4309
|
setIsLoading(true);
|
|
4305
4310
|
searchQueryRef.current = search;
|
|
4306
|
-
const fetchedUsers = await
|
|
4311
|
+
const fetchedUsers = await _chunkFYRFMABSjs.UserService.findMany({ search, fetchAll: true });
|
|
4307
4312
|
setUsers(fetchedUsers);
|
|
4308
4313
|
} catch (error) {
|
|
4309
4314
|
console.error("Failed to load users:", error);
|
|
@@ -4367,10 +4372,10 @@ var useUserTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
4367
4372
|
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
4368
4373
|
const user = row.original.jsonApiData;
|
|
4369
4374
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4370
|
-
|
|
4375
|
+
_chunkEZK3H6EJjs.Link,
|
|
4371
4376
|
{
|
|
4372
|
-
href: generateUrl({ page:
|
|
4373
|
-
className:
|
|
4377
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: user.id }),
|
|
4378
|
+
className: _chunkLJRD4SRVjs.cn.call(void 0,
|
|
4374
4379
|
`flex items-center justify-start gap-2`,
|
|
4375
4380
|
user.isDeleted || !user.isActivated ? "text-muted-foreground italic" : ""
|
|
4376
4381
|
),
|
|
@@ -4433,6 +4438,110 @@ var useUserTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
4433
4438
|
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
4434
4439
|
}, "useUserTableStructure");
|
|
4435
4440
|
|
|
4441
|
+
// src/features/content/hooks/useContentTableStructure.tsx
|
|
4442
|
+
|
|
4443
|
+
|
|
4444
|
+
|
|
4445
|
+
var useContentTableStructure = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
4446
|
+
const t = _nextintl.useTranslations.call(void 0, );
|
|
4447
|
+
const generateUrl = usePageUrlGenerator();
|
|
4448
|
+
const tableData = _react.useMemo.call(void 0, () => {
|
|
4449
|
+
return params.data.map((content) => {
|
|
4450
|
+
const entry = {
|
|
4451
|
+
jsonApiData: content
|
|
4452
|
+
};
|
|
4453
|
+
entry["contentId" /* contentId */] = content.id;
|
|
4454
|
+
params.fields.forEach((field) => {
|
|
4455
|
+
entry[field] = content[field];
|
|
4456
|
+
});
|
|
4457
|
+
return entry;
|
|
4458
|
+
});
|
|
4459
|
+
}, [params.data, params.fields]);
|
|
4460
|
+
const fieldColumnMap = {
|
|
4461
|
+
["contentId" /* contentId */]: () => cellId({
|
|
4462
|
+
name: "contentId",
|
|
4463
|
+
checkedIds: params.checkedIds,
|
|
4464
|
+
toggleId: params.toggleId
|
|
4465
|
+
}),
|
|
4466
|
+
["name" /* name */]: () => ({
|
|
4467
|
+
id: "name",
|
|
4468
|
+
accessorKey: "name",
|
|
4469
|
+
header: t(`foundations.content.fields.name.label`),
|
|
4470
|
+
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
4471
|
+
const content = row.original.jsonApiData;
|
|
4472
|
+
const contentModule = content.contentType ? _chunkWZJDLITGjs.Modules.findByModelName(content.contentType) : void 0;
|
|
4473
|
+
const link = contentModule ? generateUrl({ page: contentModule, id: content.id }) : "#";
|
|
4474
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tooltip, { children: [
|
|
4475
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipTrigger, { className: "flex items-center justify-start space-x-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4476
|
+
contentModule && _chunkLJRD4SRVjs.getIconByModule.call(void 0, { module: contentModule, className: "h-4 w-4" }),
|
|
4477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: link, children: content.name })
|
|
4478
|
+
] }) }),
|
|
4479
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipContent, { children: content.tldr })
|
|
4480
|
+
] });
|
|
4481
|
+
}, "cell"),
|
|
4482
|
+
enableSorting: false,
|
|
4483
|
+
enableHiding: false
|
|
4484
|
+
}),
|
|
4485
|
+
["relevance" /* relevance */]: () => ({
|
|
4486
|
+
id: "relevance",
|
|
4487
|
+
accessorKey: "relevance",
|
|
4488
|
+
header: t(`generic.relevance`),
|
|
4489
|
+
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
4490
|
+
const content = row.original.jsonApiData;
|
|
4491
|
+
if (!content.relevance) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
|
|
4492
|
+
const response = `${content.relevance.toFixed(0)}%`;
|
|
4493
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative flex h-5 w-20 items-center justify-center overflow-hidden rounded border text-center", children: [
|
|
4494
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4495
|
+
"div",
|
|
4496
|
+
{
|
|
4497
|
+
className: `bg-accent absolute top-0 left-0 h-full opacity-${Math.round(content.relevance)}`,
|
|
4498
|
+
style: { width: `${content.relevance}%` }
|
|
4499
|
+
}
|
|
4500
|
+
),
|
|
4501
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4502
|
+
"span",
|
|
4503
|
+
{
|
|
4504
|
+
className: `relative text-xs ${content.relevance < 40 ? "text-muted-foreground" : "text-accent-foreground font-semibold"}`,
|
|
4505
|
+
children: response
|
|
4506
|
+
}
|
|
4507
|
+
)
|
|
4508
|
+
] });
|
|
4509
|
+
}, "cell"),
|
|
4510
|
+
enableSorting: false,
|
|
4511
|
+
enableHiding: false
|
|
4512
|
+
}),
|
|
4513
|
+
["authors" /* authors */]: () => ({
|
|
4514
|
+
id: "authors",
|
|
4515
|
+
accessorKey: "authors",
|
|
4516
|
+
header: t(`generic.relationships.author.label`),
|
|
4517
|
+
cell: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ row }) => {
|
|
4518
|
+
const content = row.original.jsonApiData;
|
|
4519
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ContributorsList, { content });
|
|
4520
|
+
}, "cell"),
|
|
4521
|
+
enableSorting: false,
|
|
4522
|
+
enableHiding: false
|
|
4523
|
+
}),
|
|
4524
|
+
["createdAt" /* createdAt */]: () => cellDate({
|
|
4525
|
+
name: "createdAt",
|
|
4526
|
+
title: t(`generic.date.create`)
|
|
4527
|
+
}),
|
|
4528
|
+
["updatedAt" /* updatedAt */]: () => cellDate({
|
|
4529
|
+
name: "updatedAt",
|
|
4530
|
+
title: t(`generic.date.update`)
|
|
4531
|
+
})
|
|
4532
|
+
};
|
|
4533
|
+
const columns = _react.useMemo.call(void 0, () => {
|
|
4534
|
+
return params.fields.map((field) => {
|
|
4535
|
+
const localHandler = fieldColumnMap[field];
|
|
4536
|
+
if (localHandler) return localHandler();
|
|
4537
|
+
const customHandler = _optionalChain([params, 'access', _123 => _123.context, 'optionalAccess', _124 => _124.customCells, 'optionalAccess', _125 => _125[field]]);
|
|
4538
|
+
if (customHandler) return customHandler({ t });
|
|
4539
|
+
return void 0;
|
|
4540
|
+
}).filter((col) => col !== void 0);
|
|
4541
|
+
}, [params.fields, fieldColumnMap, t, generateUrl, _optionalChain([params, 'access', _126 => _126.context, 'optionalAccess', _127 => _127.customCells])]);
|
|
4542
|
+
return _react.useMemo.call(void 0, () => ({ data: tableData, columns }), [tableData, columns]);
|
|
4543
|
+
}, "useContentTableStructure");
|
|
4544
|
+
|
|
4436
4545
|
// src/client/index.ts
|
|
4437
4546
|
registerTableGenerator("roles", useRoleTableStructure);
|
|
4438
4547
|
registerTableGenerator("users", useUserTableStructure);
|
|
@@ -4476,7 +4585,7 @@ function ContentTableSearch({ data }) {
|
|
|
4476
4585
|
const handleSearchIconClick = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
4477
4586
|
if (!isExpanded) {
|
|
4478
4587
|
setIsFocused(true);
|
|
4479
|
-
setTimeout(() => _optionalChain([inputRef, 'access',
|
|
4588
|
+
setTimeout(() => _optionalChain([inputRef, 'access', _128 => _128.current, 'optionalAccess', _129 => _129.focus, 'call', _130 => _130()]), 50);
|
|
4480
4589
|
}
|
|
4481
4590
|
}, "handleSearchIconClick");
|
|
4482
4591
|
const handleBlur = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
@@ -4502,7 +4611,7 @@ function ContentTableSearch({ data }) {
|
|
|
4502
4611
|
}
|
|
4503
4612
|
),
|
|
4504
4613
|
isExpanded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4505
|
-
|
|
4614
|
+
_chunkEZK3H6EJjs.Input,
|
|
4506
4615
|
{
|
|
4507
4616
|
ref: inputRef,
|
|
4508
4617
|
onKeyDown: (e) => {
|
|
@@ -4539,7 +4648,7 @@ var EMPTY_ARRAY = [];
|
|
|
4539
4648
|
var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, function ContentListTable2(props) {
|
|
4540
4649
|
const { data, fields, checkedIds, toggleId, allowSearch, filters } = props;
|
|
4541
4650
|
const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
|
|
4542
|
-
data: _nullishCoalesce(_optionalChain([data, 'optionalAccess',
|
|
4651
|
+
data: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _131 => _131.data]), () => ( EMPTY_ARRAY)),
|
|
4543
4652
|
fields,
|
|
4544
4653
|
checkedIds,
|
|
4545
4654
|
toggleId,
|
|
@@ -4566,9 +4675,9 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
|
|
|
4566
4675
|
});
|
|
4567
4676
|
const rowModel = tableData ? table.getRowModel() : null;
|
|
4568
4677
|
const showFooter = !!(props.functions || data.next || data.previous);
|
|
4569
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-hidden rounded-md border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4570
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4571
|
-
props.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4678
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-hidden rounded-md border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Table, { children: [
|
|
4679
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.TableHeader, { className: "bg-muted font-semibold", children: [
|
|
4680
|
+
props.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableHead, { className: "bg-card text-primary p-4 text-left font-bold", colSpan: tableColumns.length, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full items-center justify-between gap-x-2", children: [
|
|
4572
4681
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full", children: props.title }),
|
|
4573
4682
|
(props.functions || props.filters || allowSearch) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4574
4683
|
props.functions,
|
|
@@ -4576,20 +4685,20 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
|
|
|
4576
4685
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ContentTableSearch, { data })
|
|
4577
4686
|
] })
|
|
4578
4687
|
] }) }) }),
|
|
4579
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4580
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4688
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableRow, { children: headerGroup.headers.map((header) => {
|
|
4689
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableHead, { children: header.isPlaceholder ? null : _reacttable.flexRender.call(void 0, header.column.columnDef.header, header.getContext()) }, header.id);
|
|
4581
4690
|
}) }, headerGroup.id))
|
|
4582
4691
|
] }),
|
|
4583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4584
|
-
showFooter && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4692
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableBody, { children: rowModel && _optionalChain([rowModel, 'access', _132 => _132.rows, 'optionalAccess', _133 => _133.length]) ? rowModel.rows.map((row) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableCell, { children: _reacttable.flexRender.call(void 0, cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
|
|
4693
|
+
showFooter && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableFooter, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableRow, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TableCell, { colSpan: tableColumns.length, className: "bg-card py-4 text-right", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-end space-x-2", children: [
|
|
4585
4694
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4586
|
-
|
|
4695
|
+
_chunkEZK3H6EJjs.Button,
|
|
4587
4696
|
{
|
|
4588
4697
|
variant: "outline",
|
|
4589
4698
|
size: "sm",
|
|
4590
4699
|
onClick: (e) => {
|
|
4591
4700
|
e.preventDefault();
|
|
4592
|
-
_optionalChain([data, 'access',
|
|
4701
|
+
_optionalChain([data, 'access', _134 => _134.previous, 'optionalCall', _135 => _135(true)]);
|
|
4593
4702
|
},
|
|
4594
4703
|
disabled: !data.previous,
|
|
4595
4704
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CaretLeftIcon, { className: "h-4 w-4" })
|
|
@@ -4601,13 +4710,13 @@ var ContentListTable = _react.memo.call(void 0, /* @__PURE__ */ _chunk7QVYU63Ejs
|
|
|
4601
4710
|
data.pageInfo.endItem
|
|
4602
4711
|
] }),
|
|
4603
4712
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4604
|
-
|
|
4713
|
+
_chunkEZK3H6EJjs.Button,
|
|
4605
4714
|
{
|
|
4606
4715
|
variant: "outline",
|
|
4607
4716
|
size: "sm",
|
|
4608
4717
|
onClick: (e) => {
|
|
4609
4718
|
e.preventDefault();
|
|
4610
|
-
_optionalChain([data, 'access',
|
|
4719
|
+
_optionalChain([data, 'access', _136 => _136.next, 'optionalCall', _137 => _137(true)]);
|
|
4611
4720
|
},
|
|
4612
4721
|
disabled: !data.next,
|
|
4613
4722
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CaretRightIcon, { className: "h-4 w-4" })
|
|
@@ -4668,22 +4777,22 @@ function Register() {
|
|
|
4668
4777
|
email: values.email,
|
|
4669
4778
|
password: values.password
|
|
4670
4779
|
};
|
|
4671
|
-
await
|
|
4780
|
+
await _chunkFYRFMABSjs.AuthService.register(payload);
|
|
4672
4781
|
setShowConfirmation(true);
|
|
4673
4782
|
} catch (e) {
|
|
4674
4783
|
errorToast({ error: e });
|
|
4675
4784
|
}
|
|
4676
4785
|
}, "onSubmit");
|
|
4677
4786
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4678
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4679
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4787
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { children: [
|
|
4788
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
4680
4789
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
4681
4790
|
t(`foundations.auth.register`)
|
|
4682
4791
|
] }),
|
|
4683
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4792
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: " " }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t(`foundations.auth.register_description`) }) })
|
|
4684
4793
|
] }),
|
|
4685
|
-
showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4686
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4794
|
+
showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: t("foundations.auth.register_confirmation") }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
4795
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: [
|
|
4687
4796
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4688
4797
|
FormInput,
|
|
4689
4798
|
{
|
|
@@ -4724,11 +4833,11 @@ function Register() {
|
|
|
4724
4833
|
placeholder: t(`foundations.user.fields.password.placeholder`)
|
|
4725
4834
|
}
|
|
4726
4835
|
),
|
|
4727
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4836
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", type: "submit", children: t(`foundations.auth.buttons.register`) })
|
|
4728
4837
|
] }),
|
|
4729
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4838
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardFooter, { className: "flex w-full flex-row justify-between", children: [
|
|
4730
4839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4731
|
-
|
|
4840
|
+
_chunkEZK3H6EJjs.Link,
|
|
4732
4841
|
{
|
|
4733
4842
|
href: "#",
|
|
4734
4843
|
className: "flex w-full justify-start",
|
|
@@ -4737,7 +4846,7 @@ function Register() {
|
|
|
4737
4846
|
}
|
|
4738
4847
|
),
|
|
4739
4848
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4740
|
-
|
|
4849
|
+
_chunkEZK3H6EJjs.Link,
|
|
4741
4850
|
{
|
|
4742
4851
|
href: "#",
|
|
4743
4852
|
className: "flex w-full justify-end",
|
|
@@ -4811,7 +4920,7 @@ function InnerAuthContainer() {
|
|
|
4811
4920
|
const { activeComponent } = useAuthContext();
|
|
4812
4921
|
if (activeComponent === null)
|
|
4813
4922
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-w-sm", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, className: "animate-spin-slow", priority: true }) });
|
|
4814
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4923
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Card, { className: "w-full max-w-md", children: activeComponent });
|
|
4815
4924
|
}
|
|
4816
4925
|
_chunk7QVYU63Ejs.__name.call(void 0, InnerAuthContainer, "InnerAuthContainer");
|
|
4817
4926
|
|
|
@@ -4823,16 +4932,16 @@ function LandingComponent() {
|
|
|
4823
4932
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
4824
4933
|
const { setComponentType } = useAuthContext();
|
|
4825
4934
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4826
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4827
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4935
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { className: "mb-4", "data-testid": "page-pre-login-container", children: [
|
|
4936
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center gap-y-8 pb-8 text-4xl", children: [
|
|
4828
4937
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
4829
4938
|
t(`generic.title`)
|
|
4830
4939
|
] }),
|
|
4831
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4940
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "flex w-full justify-center text-center text-sm", children: t(`generic.description`) })
|
|
4832
4941
|
] }),
|
|
4833
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4834
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4835
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4942
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardFooter, { className: "mt-4 flex w-full flex-col justify-between", children: [
|
|
4943
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: "#", className: "flex w-full justify-start", onClick: () => setComponentType(5 /* Register */), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", variant: `default`, children: t(`foundations.auth.buttons.register`) }) }),
|
|
4944
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: "#", className: "flex w-full justify-end", onClick: () => setComponentType(0 /* Login */), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", variant: `outline`, "data-testid": "page-login-button-initial-login", children: t(`foundations.auth.buttons.login`) }) })
|
|
4836
4945
|
] })
|
|
4837
4946
|
] });
|
|
4838
4947
|
}
|
|
@@ -4858,7 +4967,7 @@ function AcceptInvitation() {
|
|
|
4858
4967
|
const payload = {
|
|
4859
4968
|
code
|
|
4860
4969
|
};
|
|
4861
|
-
await
|
|
4970
|
+
await _chunkFYRFMABSjs.AuthService.validateCode(payload);
|
|
4862
4971
|
} catch (e) {
|
|
4863
4972
|
setError(e instanceof Error ? e.message : String(e));
|
|
4864
4973
|
errorToast({ title: t(`generic.errors.error`), error: e });
|
|
@@ -4891,12 +5000,12 @@ function AcceptInvitation() {
|
|
|
4891
5000
|
});
|
|
4892
5001
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
4893
5002
|
try {
|
|
4894
|
-
if (!_optionalChain([params, 'optionalAccess',
|
|
5003
|
+
if (!_optionalChain([params, 'optionalAccess', _138 => _138.code])) return;
|
|
4895
5004
|
const payload = {
|
|
4896
|
-
code: _optionalChain([params, 'optionalAccess',
|
|
5005
|
+
code: _optionalChain([params, 'optionalAccess', _139 => _139.code]),
|
|
4897
5006
|
password: values.password
|
|
4898
5007
|
};
|
|
4899
|
-
await
|
|
5008
|
+
await _chunkFYRFMABSjs.AuthService.acceptInvitation(payload);
|
|
4900
5009
|
setShowConfirmation(true);
|
|
4901
5010
|
_sonner.toast.success(t("foundations.auth.account_activated"), {
|
|
4902
5011
|
description: t("foundations.auth.account_activated_description")
|
|
@@ -4910,14 +5019,14 @@ function AcceptInvitation() {
|
|
|
4910
5019
|
}
|
|
4911
5020
|
}, "onSubmit");
|
|
4912
5021
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4913
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4914
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5022
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { children: [
|
|
5023
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
4915
5024
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
4916
5025
|
t("foundations.auth.accept_invitation")
|
|
4917
5026
|
] }),
|
|
4918
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5027
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t("foundations.auth.errors.activating_account") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t("foundations.auth.select_password") }) })
|
|
4919
5028
|
] }),
|
|
4920
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5029
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: t("foundations.auth.activation_description") }) : error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
4921
5030
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4922
5031
|
FormPassword,
|
|
4923
5032
|
{
|
|
@@ -4936,7 +5045,7 @@ function AcceptInvitation() {
|
|
|
4936
5045
|
placeholder: t(`foundations.auth.fields.retype_password.placeholder`)
|
|
4937
5046
|
}
|
|
4938
5047
|
),
|
|
4939
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5048
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", type: "submit", children: t("foundations.auth.accept_invitation") })
|
|
4940
5049
|
] }) }) })
|
|
4941
5050
|
] });
|
|
4942
5051
|
}
|
|
@@ -4959,7 +5068,7 @@ function ActivateAccount() {
|
|
|
4959
5068
|
const payload = {
|
|
4960
5069
|
activationCode: code
|
|
4961
5070
|
};
|
|
4962
|
-
await
|
|
5071
|
+
await _chunkFYRFMABSjs.AuthService.activate(payload);
|
|
4963
5072
|
setShowConfirmation(true);
|
|
4964
5073
|
setParams(void 0);
|
|
4965
5074
|
_sonner.toast.success(t("foundations.auth.account_activated"), {
|
|
@@ -4981,14 +5090,14 @@ function ActivateAccount() {
|
|
|
4981
5090
|
}
|
|
4982
5091
|
}, []);
|
|
4983
5092
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4984
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4985
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5093
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { children: [
|
|
5094
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
4986
5095
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
4987
5096
|
t("foundations.auth.accept_invitation")
|
|
4988
5097
|
] }),
|
|
4989
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5098
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t("foundations.auth.errors.activating_account") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: " " }) })
|
|
4990
5099
|
] }),
|
|
4991
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5100
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t("foundations.auth.activation_description") }) : error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: error }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t("foundations.auth.activation_wait") }) }) })
|
|
4992
5101
|
] });
|
|
4993
5102
|
}
|
|
4994
5103
|
_chunk7QVYU63Ejs.__name.call(void 0, ActivateAccount, "ActivateAccount");
|
|
@@ -5002,8 +5111,8 @@ function Cookies({ dehydratedAuth, page }) {
|
|
|
5002
5111
|
_react.useEffect.call(void 0, () => {
|
|
5003
5112
|
if (hasSaved) return;
|
|
5004
5113
|
async function saveTokenOnServer() {
|
|
5005
|
-
await
|
|
5006
|
-
const auth =
|
|
5114
|
+
await _chunkFYRFMABSjs.AuthService.saveToken({ dehydratedAuth });
|
|
5115
|
+
const auth = _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.Auth, dehydratedAuth);
|
|
5007
5116
|
setUser(auth.user);
|
|
5008
5117
|
setHasSaved(true);
|
|
5009
5118
|
if (page) {
|
|
@@ -5046,22 +5155,22 @@ function ForgotPassword() {
|
|
|
5046
5155
|
const payload = {
|
|
5047
5156
|
email: values.email
|
|
5048
5157
|
};
|
|
5049
|
-
await
|
|
5158
|
+
await _chunkFYRFMABSjs.AuthService.initialiseForgotPassword(payload);
|
|
5050
5159
|
setShowConfirmation(true);
|
|
5051
5160
|
} catch (e) {
|
|
5052
5161
|
errorToast({ error: e });
|
|
5053
5162
|
}
|
|
5054
5163
|
}, "onSubmit");
|
|
5055
5164
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
5056
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5057
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5165
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { "data-testid": "page-forgot-password-container", children: [
|
|
5166
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
5058
5167
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlows", width: 100, height: 100, priority: true }),
|
|
5059
5168
|
t("foundations.auth.forgot_password")
|
|
5060
5169
|
] }),
|
|
5061
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5170
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: " " }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t(`foundations.auth.add_email_to_reset`) }) })
|
|
5062
5171
|
] }),
|
|
5063
|
-
showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5064
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5172
|
+
showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: t(`foundations.auth.reset_confirmation`) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
5173
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: [
|
|
5065
5174
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5066
5175
|
FormInput,
|
|
5067
5176
|
{
|
|
@@ -5072,10 +5181,10 @@ function ForgotPassword() {
|
|
|
5072
5181
|
testId: "form-forgot-password-input-email"
|
|
5073
5182
|
}
|
|
5074
5183
|
),
|
|
5075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5184
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-forgot-password-button-reset", children: t(`foundations.auth.buttons.reset_password`) })
|
|
5076
5185
|
] }),
|
|
5077
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5078
|
-
|
|
5186
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardFooter, { className: "flex w-full flex-row justify-between", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5187
|
+
_chunkEZK3H6EJjs.Link,
|
|
5079
5188
|
{
|
|
5080
5189
|
href: "#",
|
|
5081
5190
|
className: "flex w-full justify-end",
|
|
@@ -5117,7 +5226,7 @@ function Login() {
|
|
|
5117
5226
|
});
|
|
5118
5227
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
5119
5228
|
try {
|
|
5120
|
-
const user = await
|
|
5229
|
+
const user = await _chunkFYRFMABSjs.AuthService.login({
|
|
5121
5230
|
email: values.email,
|
|
5122
5231
|
password: values.password
|
|
5123
5232
|
});
|
|
@@ -5131,15 +5240,15 @@ function Login() {
|
|
|
5131
5240
|
}
|
|
5132
5241
|
}, "onSubmit");
|
|
5133
5242
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
5134
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5135
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5243
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { "data-testid": "page-login-container", children: [
|
|
5244
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
5136
5245
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
5137
5246
|
t("foundations.auth.login")
|
|
5138
5247
|
] }),
|
|
5139
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5248
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-sm", children: t(`foundations.auth.login_description`) })
|
|
5140
5249
|
] }),
|
|
5141
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5142
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5250
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
5251
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: [
|
|
5143
5252
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5144
5253
|
FormInput,
|
|
5145
5254
|
{
|
|
@@ -5161,11 +5270,11 @@ function Login() {
|
|
|
5161
5270
|
testId: "form-login-input-password"
|
|
5162
5271
|
}
|
|
5163
5272
|
),
|
|
5164
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5273
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-login-button-submit", children: t(`foundations.auth.login`) })
|
|
5165
5274
|
] }),
|
|
5166
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5275
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardFooter, { className: "flex w-full flex-row justify-between", children: [
|
|
5167
5276
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5168
|
-
|
|
5277
|
+
_chunkEZK3H6EJjs.Link,
|
|
5169
5278
|
{
|
|
5170
5279
|
href: "#",
|
|
5171
5280
|
className: "flex w-full justify-start",
|
|
@@ -5174,7 +5283,7 @@ function Login() {
|
|
|
5174
5283
|
}
|
|
5175
5284
|
),
|
|
5176
5285
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5177
|
-
|
|
5286
|
+
_chunkEZK3H6EJjs.Link,
|
|
5178
5287
|
{
|
|
5179
5288
|
href: "#",
|
|
5180
5289
|
className: "flex w-full justify-end",
|
|
@@ -5196,7 +5305,7 @@ function Logout() {
|
|
|
5196
5305
|
const generateUrl = usePageUrlGenerator();
|
|
5197
5306
|
_react.useEffect.call(void 0, () => {
|
|
5198
5307
|
const logOut = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
5199
|
-
await
|
|
5308
|
+
await _chunkFYRFMABSjs.AuthService.logout();
|
|
5200
5309
|
window.location.href = generateUrl({ page: `/` });
|
|
5201
5310
|
}, "logOut");
|
|
5202
5311
|
logOut();
|
|
@@ -5211,20 +5320,20 @@ _chunk7QVYU63Ejs.__name.call(void 0, Logout, "Logout");
|
|
|
5211
5320
|
function RefreshUser() {
|
|
5212
5321
|
const { setUser } = useCurrentUserContext();
|
|
5213
5322
|
const loadFullUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
5214
|
-
const fullUser = await
|
|
5323
|
+
const fullUser = await _chunkFYRFMABSjs.UserService.findFullUser();
|
|
5215
5324
|
if (fullUser) {
|
|
5216
5325
|
setUser(fullUser);
|
|
5217
5326
|
const token = {
|
|
5218
5327
|
userId: fullUser.id,
|
|
5219
|
-
companyId: _optionalChain([fullUser, 'access',
|
|
5220
|
-
licenseExpirationDate: _optionalChain([fullUser, 'access',
|
|
5328
|
+
companyId: _optionalChain([fullUser, 'access', _140 => _140.company, 'optionalAccess', _141 => _141.id]),
|
|
5329
|
+
licenseExpirationDate: _optionalChain([fullUser, 'access', _142 => _142.company, 'optionalAccess', _143 => _143.licenseExpirationDate]),
|
|
5221
5330
|
roles: fullUser.roles.map((role) => role.id),
|
|
5222
|
-
features: _nullishCoalesce(_optionalChain([fullUser, 'access',
|
|
5331
|
+
features: _nullishCoalesce(_optionalChain([fullUser, 'access', _144 => _144.company, 'optionalAccess', _145 => _145.features, 'optionalAccess', _146 => _146.map, 'call', _147 => _147((feature) => feature.id)]), () => ( [])),
|
|
5223
5332
|
modules: fullUser.modules.map((module) => {
|
|
5224
5333
|
return { id: module.id, permissions: module.permissions };
|
|
5225
5334
|
})
|
|
5226
5335
|
};
|
|
5227
|
-
await _optionalChain([_chunkAYHKQWHHjs.getTokenHandler.call(void 0, ), 'optionalAccess',
|
|
5336
|
+
await _optionalChain([_chunkAYHKQWHHjs.getTokenHandler.call(void 0, ), 'optionalAccess', _148 => _148.updateToken, 'call', _149 => _149(token)]);
|
|
5228
5337
|
_cookiesnext.deleteCookie.call(void 0, "reloadData");
|
|
5229
5338
|
}
|
|
5230
5339
|
}, "loadFullUser");
|
|
@@ -5256,7 +5365,7 @@ function ResetPassword() {
|
|
|
5256
5365
|
const payload = {
|
|
5257
5366
|
code
|
|
5258
5367
|
};
|
|
5259
|
-
await
|
|
5368
|
+
await _chunkFYRFMABSjs.AuthService.validateCode(payload);
|
|
5260
5369
|
} catch (e) {
|
|
5261
5370
|
setError(e instanceof Error ? e.message : String(e));
|
|
5262
5371
|
errorToast({ title: t(`generic.errors.error`), error: e });
|
|
@@ -5289,12 +5398,12 @@ function ResetPassword() {
|
|
|
5289
5398
|
});
|
|
5290
5399
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
5291
5400
|
try {
|
|
5292
|
-
if (!_optionalChain([params, 'optionalAccess',
|
|
5401
|
+
if (!_optionalChain([params, 'optionalAccess', _150 => _150.code])) return;
|
|
5293
5402
|
const payload = {
|
|
5294
|
-
code: _optionalChain([params, 'optionalAccess',
|
|
5403
|
+
code: _optionalChain([params, 'optionalAccess', _151 => _151.code]),
|
|
5295
5404
|
password: values.password
|
|
5296
5405
|
};
|
|
5297
|
-
await
|
|
5406
|
+
await _chunkFYRFMABSjs.AuthService.resetPassword(payload);
|
|
5298
5407
|
setShowConfirmation(true);
|
|
5299
5408
|
_sonner.toast.success(t(`foundations.auth.reset_success`), {
|
|
5300
5409
|
description: t(`foundations.auth.reset_success_description`)
|
|
@@ -5308,17 +5417,17 @@ function ResetPassword() {
|
|
|
5308
5417
|
}
|
|
5309
5418
|
}, "onSubmit");
|
|
5310
5419
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
5311
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5312
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5420
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { children: [
|
|
5421
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
5313
5422
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _image2.default, { src: "/phlow-logo.webp", alt: "Phlow", width: 100, height: 100, priority: true }),
|
|
5314
5423
|
t(`foundations.auth.password_reset`)
|
|
5315
5424
|
] }),
|
|
5316
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5425
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t(`foundations.auth.errors.password_reset_error`) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: t(`foundations.auth.reset_password`) }) })
|
|
5317
5426
|
] }),
|
|
5318
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { children: showConfirmation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: t(`foundations.auth.reset_success_description`) }) : error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
5319
5428
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormPassword, { form, id: "password", name: "Password" }),
|
|
5320
5429
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormPassword, { form, id: "passwordRetype", name: "Retype Password" }),
|
|
5321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mt-4 w-full", type: "submit", children: t(`foundations.auth.buttons.reset_password`) })
|
|
5322
5431
|
] }) }) })
|
|
5323
5432
|
] });
|
|
5324
5433
|
}
|
|
@@ -5406,13 +5515,13 @@ function CompanyConfigurationSecurityForm({ form }) {
|
|
|
5406
5515
|
break;
|
|
5407
5516
|
}
|
|
5408
5517
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5409
|
-
|
|
5518
|
+
_chunkEZK3H6EJjs.FormField,
|
|
5410
5519
|
{
|
|
5411
5520
|
control: form.control,
|
|
5412
5521
|
name: currentField,
|
|
5413
|
-
render: ({ field: formField }) => type === "checkbox" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5415
|
-
|
|
5522
|
+
render: ({ field: formField }) => type === "checkbox" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: "flex items-start space-x-4", children: [
|
|
5523
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5524
|
+
_chunkEZK3H6EJjs.Checkbox,
|
|
5416
5525
|
{
|
|
5417
5526
|
id: currentField,
|
|
5418
5527
|
checked: formField.value,
|
|
@@ -5422,23 +5531,23 @@ function CompanyConfigurationSecurityForm({ form }) {
|
|
|
5422
5531
|
}
|
|
5423
5532
|
) }),
|
|
5424
5533
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-2", children: [
|
|
5425
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5534
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { htmlFor: currentField, children: [
|
|
5426
5535
|
label,
|
|
5427
5536
|
" ",
|
|
5428
5537
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive", children: "*" })
|
|
5429
5538
|
] }),
|
|
5430
5539
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: placeholder })
|
|
5431
5540
|
] }),
|
|
5432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5433
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5434
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5435
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5541
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, {}),
|
|
5542
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
5543
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { children: [
|
|
5544
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { children: [
|
|
5436
5545
|
label,
|
|
5437
5546
|
" ",
|
|
5438
5547
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive", children: "*" })
|
|
5439
5548
|
] }),
|
|
5440
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5441
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5549
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Input, { type, placeholder, ...formField }) }),
|
|
5550
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
5442
5551
|
] })
|
|
5443
5552
|
},
|
|
5444
5553
|
currentField
|
|
@@ -5457,8 +5566,8 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
5457
5566
|
const { setUser } = useCurrentUserContext();
|
|
5458
5567
|
const defaultValues = _react.useMemo.call(void 0, () => {
|
|
5459
5568
|
return {
|
|
5460
|
-
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access',
|
|
5461
|
-
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access',
|
|
5569
|
+
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _152 => _152.configurations, 'optionalAccess', _153 => _153.isManagedKnowledge]), () => ( false)),
|
|
5570
|
+
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _154 => _154.configurations, 'optionalAccess', _155 => _155.allowPublicBot]), () => ( false))
|
|
5462
5571
|
};
|
|
5463
5572
|
}, [company.configurations]);
|
|
5464
5573
|
const close = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
@@ -5477,8 +5586,8 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
5477
5586
|
_react.useEffect.call(void 0, () => {
|
|
5478
5587
|
if (open) {
|
|
5479
5588
|
form.reset({
|
|
5480
|
-
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access',
|
|
5481
|
-
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access',
|
|
5589
|
+
isManagedKnowledge: _nullishCoalesce(_optionalChain([company, 'access', _156 => _156.configurations, 'optionalAccess', _157 => _157.isManagedKnowledge]), () => ( false)),
|
|
5590
|
+
allowPublicBot: _nullishCoalesce(_optionalChain([company, 'access', _158 => _158.configurations, 'optionalAccess', _159 => _159.allowPublicBot]), () => ( false))
|
|
5482
5591
|
});
|
|
5483
5592
|
}
|
|
5484
5593
|
}, [company, open]);
|
|
@@ -5491,8 +5600,8 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
5491
5600
|
}
|
|
5492
5601
|
};
|
|
5493
5602
|
try {
|
|
5494
|
-
await
|
|
5495
|
-
const fullUser = await
|
|
5603
|
+
await _chunkFYRFMABSjs.CompanyService.updateConfigurations(payload);
|
|
5604
|
+
const fullUser = await _chunkFYRFMABSjs.UserService.findFullUser();
|
|
5496
5605
|
if (fullUser) {
|
|
5497
5606
|
setUser(fullUser);
|
|
5498
5607
|
}
|
|
@@ -5507,18 +5616,18 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
5507
5616
|
});
|
|
5508
5617
|
}
|
|
5509
5618
|
}, "onSubmit");
|
|
5510
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5511
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5512
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5513
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5514
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5515
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5619
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Dialog, { open, onOpenChange: setOpen, children: [
|
|
5620
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", variant: `ghost`, className: "cursor-pointer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Settings2Icon, { className: "h-3.5 w-3.5" }) }) }),
|
|
5621
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogContent, { className: `flex max-h-[70vh] max-w-4xl flex-col overflow-y-auto`, children: [
|
|
5622
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogHeader, { children: [
|
|
5623
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: t(`types.configurations`, { count: 2 }) }),
|
|
5624
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { className: "text-destructive", children: t(`features.configuration.warning_description`) })
|
|
5516
5625
|
] }),
|
|
5517
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5518
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex flex-row gap-x-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-full flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5519
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5520
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5521
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5626
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
5627
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex flex-row gap-x-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-full flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tabs, { defaultValue: process.env.NEXT_PUBLIC_PRIVATE_INSTALLATION ? "security" : "ai", children: [
|
|
5628
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsList, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsTrigger, { value: "security", children: "Privacy & Security" }) }),
|
|
5629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsContent, { value: "features", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: "Feature configuration will be implemented in future updates." }) }) }),
|
|
5630
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TabsContent, { value: "security", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyConfigurationSecurityForm, { form }) })
|
|
5522
5631
|
] }) }) }),
|
|
5523
5632
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorButtons, { form, setOpen, isEdit: true })
|
|
5524
5633
|
] }) })
|
|
@@ -5547,33 +5656,33 @@ function CompanyDeleterInternal({ company }) {
|
|
|
5547
5656
|
const handleDelete = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
5548
5657
|
setIsDeleting(true);
|
|
5549
5658
|
try {
|
|
5550
|
-
await
|
|
5659
|
+
await _chunkFYRFMABSjs.CompanyService.delete({ companyId: company.id });
|
|
5551
5660
|
router.push("/");
|
|
5552
5661
|
} catch (error) {
|
|
5553
5662
|
errorToast({ title: t(`generic.errors.delete`), error });
|
|
5554
5663
|
}
|
|
5555
5664
|
setIsDeleting(false);
|
|
5556
5665
|
}, "handleDelete");
|
|
5557
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5666
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AlertDialog, { open, onOpenChange: setOpen, children: [
|
|
5667
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AlertDialogTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", variant: "destructive", children: [
|
|
5559
5668
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Trash2Icon, { className: "mr-3 h-3.5 w-3.5" }),
|
|
5560
5669
|
t(`generic.buttons.delete`)
|
|
5561
5670
|
] }) }),
|
|
5562
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5563
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5564
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5565
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5671
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AlertDialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
5672
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.AlertDialogHeader, { children: [
|
|
5673
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AlertDialogTitle, { children: t(`generic.delete.title`, { type: t(`types.companies`, { count: 1 }) }) }),
|
|
5674
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AlertDialogDescription, { children: t(`generic.delete.subtitle`, { type: t(`types.companies`, { count: 1 }) }) })
|
|
5566
5675
|
] }),
|
|
5567
5676
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-destructive p-4 text-sm", children: t(`generic.delete.description`, { type: t(`types.companies`, { count: 1 }) }) }),
|
|
5568
5677
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-y-2", children: [
|
|
5569
5678
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: t(`generic.delete.confirmation`, { type: t(`types.companies`, { count: 1 }) }) }),
|
|
5570
5679
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
5571
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5680
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Label, { className: "flex items-center", children: [
|
|
5572
5681
|
t(`foundations.company.fields.name.label`),
|
|
5573
5682
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
5574
5683
|
] }),
|
|
5575
5684
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5576
|
-
|
|
5685
|
+
_chunkEZK3H6EJjs.Input,
|
|
5577
5686
|
{
|
|
5578
5687
|
className: `w-full`,
|
|
5579
5688
|
placeholder: t(`foundations.company.fields.name.placeholder`),
|
|
@@ -5584,7 +5693,7 @@ function CompanyDeleterInternal({ company }) {
|
|
|
5584
5693
|
] }),
|
|
5585
5694
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end", children: [
|
|
5586
5695
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5587
|
-
|
|
5696
|
+
_chunkEZK3H6EJjs.Button,
|
|
5588
5697
|
{
|
|
5589
5698
|
className: "mr-2",
|
|
5590
5699
|
variant: "outline",
|
|
@@ -5595,7 +5704,7 @@ function CompanyDeleterInternal({ company }) {
|
|
|
5595
5704
|
}
|
|
5596
5705
|
),
|
|
5597
5706
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5598
|
-
|
|
5707
|
+
_chunkEZK3H6EJjs.Button,
|
|
5599
5708
|
{
|
|
5600
5709
|
type: "submit",
|
|
5601
5710
|
onClick: (e) => {
|
|
@@ -5617,7 +5726,7 @@ function CompanyDeleterInternal({ company }) {
|
|
|
5617
5726
|
_chunk7QVYU63Ejs.__name.call(void 0, CompanyDeleterInternal, "CompanyDeleterInternal");
|
|
5618
5727
|
function CompanyDeleter({ company }) {
|
|
5619
5728
|
const { hasPermissionToModule, hasRole } = useCurrentUserContext();
|
|
5620
|
-
if (!hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) && !hasPermissionToModule({ module:
|
|
5729
|
+
if (!hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) && !hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.Company, action: "delete" /* Delete */ }))
|
|
5621
5730
|
return null;
|
|
5622
5731
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyDeleterInternal, { company });
|
|
5623
5732
|
}
|
|
@@ -5656,16 +5765,16 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5656
5765
|
const form = _reacthookform.useForm.call(void 0, {
|
|
5657
5766
|
resolver: _zod.zodResolver.call(void 0, formSchema),
|
|
5658
5767
|
defaultValues: {
|
|
5659
|
-
id: _optionalChain([company, 'optionalAccess',
|
|
5660
|
-
name: _optionalChain([company, 'optionalAccess',
|
|
5661
|
-
featureIds: _optionalChain([company, 'optionalAccess',
|
|
5662
|
-
moduleIds: _optionalChain([company, 'optionalAccess',
|
|
5663
|
-
logo: _optionalChain([company, 'optionalAccess',
|
|
5768
|
+
id: _optionalChain([company, 'optionalAccess', _160 => _160.id]) || _uuid.v4.call(void 0, ),
|
|
5769
|
+
name: _optionalChain([company, 'optionalAccess', _161 => _161.name]) || "",
|
|
5770
|
+
featureIds: _optionalChain([company, 'optionalAccess', _162 => _162.features, 'access', _163 => _163.map, 'call', _164 => _164((feature) => feature.id)]) || [],
|
|
5771
|
+
moduleIds: _optionalChain([company, 'optionalAccess', _165 => _165.modules, 'access', _166 => _166.map, 'call', _167 => _167((module) => module.id)]) || [],
|
|
5772
|
+
logo: _optionalChain([company, 'optionalAccess', _168 => _168.logo]) || ""
|
|
5664
5773
|
}
|
|
5665
5774
|
});
|
|
5666
5775
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
5667
5776
|
if (values.logo && contentType) {
|
|
5668
|
-
const s3 = await
|
|
5777
|
+
const s3 = await _chunkFYRFMABSjs.S3Service.getPreSignedUrl({
|
|
5669
5778
|
key: values.logo,
|
|
5670
5779
|
contentType,
|
|
5671
5780
|
isPublic: true
|
|
@@ -5677,16 +5786,16 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5677
5786
|
});
|
|
5678
5787
|
}
|
|
5679
5788
|
const payload = {
|
|
5680
|
-
id: _nullishCoalesce(_optionalChain([company, 'optionalAccess',
|
|
5789
|
+
id: _nullishCoalesce(_optionalChain([company, 'optionalAccess', _169 => _169.id]), () => ( _uuid.v4.call(void 0, ))),
|
|
5681
5790
|
name: values.name,
|
|
5682
5791
|
logo: files && contentType ? values.logo : void 0,
|
|
5683
5792
|
featureIds: values.featureIds,
|
|
5684
5793
|
moduleIds: values.moduleIds
|
|
5685
5794
|
};
|
|
5686
5795
|
try {
|
|
5687
|
-
const updatedCompany = company ? await
|
|
5796
|
+
const updatedCompany = company ? await _chunkFYRFMABSjs.CompanyService.update(payload) : await _chunkFYRFMABSjs.CompanyService.create(payload);
|
|
5688
5797
|
if (onRevalidate) {
|
|
5689
|
-
await onRevalidate(generateUrl({ page:
|
|
5798
|
+
await onRevalidate(generateUrl({ page: _chunkWZJDLITGjs.Modules.Company, id: updatedCompany.id, language: `[locale]` }));
|
|
5690
5799
|
}
|
|
5691
5800
|
if (company && propagateChanges) {
|
|
5692
5801
|
_cookiesnext.setCookie.call(void 0, "reloadData", "true", { path: "/" });
|
|
@@ -5704,7 +5813,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5704
5813
|
}, "onSubmit");
|
|
5705
5814
|
_react.useEffect.call(void 0, () => {
|
|
5706
5815
|
async function fetchFeatures() {
|
|
5707
|
-
const allfeatures = await
|
|
5816
|
+
const allfeatures = await _chunkFYRFMABSjs.FeatureService.findMany({});
|
|
5708
5817
|
if (hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator)) {
|
|
5709
5818
|
setFeatures(allfeatures);
|
|
5710
5819
|
} else {
|
|
@@ -5712,7 +5821,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5712
5821
|
}
|
|
5713
5822
|
}
|
|
5714
5823
|
_chunk7QVYU63Ejs.__name.call(void 0, fetchFeatures, "fetchFeatures");
|
|
5715
|
-
if (open && features.length === 0 && (hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access',
|
|
5824
|
+
if (open && features.length === 0 && (hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _170 => _170.env, 'access', _171 => _171.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _172 => _172.toLowerCase, 'call', _173 => _173()]) === "true"))
|
|
5716
5825
|
fetchFeatures();
|
|
5717
5826
|
}, [open, features]);
|
|
5718
5827
|
_react.useEffect.call(void 0, () => {
|
|
@@ -5746,22 +5855,22 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5746
5855
|
"application/images": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
|
5747
5856
|
}
|
|
5748
5857
|
};
|
|
5749
|
-
const canAccessFeatures = hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access',
|
|
5858
|
+
const canAccessFeatures = hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) || hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).CompanyAdministrator) && _optionalChain([process, 'access', _174 => _174.env, 'access', _175 => _175.NEXT_PUBLIC_PRIVATE_INSTALLATION, 'optionalAccess', _176 => _176.toLowerCase, 'call', _177 => _177()]) === "true";
|
|
5750
5859
|
const isAdministrator = hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator);
|
|
5751
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5860
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Dialog, { open, onOpenChange: setOpen, children: [
|
|
5752
5861
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorTrigger, { isEdit: !!company }),
|
|
5753
5862
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5754
|
-
|
|
5863
|
+
_chunkEZK3H6EJjs.DialogContent,
|
|
5755
5864
|
{
|
|
5756
5865
|
className: `flex max-h-[70vh] w-full ${isAdministrator || canAccessFeatures ? `max-w-5xl` : `max-w-4xl`} flex-col overflow-y-auto`,
|
|
5757
5866
|
children: [
|
|
5758
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.companies`, { count: 1 }), name: _optionalChain([company, 'optionalAccess',
|
|
5759
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5867
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.companies`, { count: 1 }), name: _optionalChain([company, 'optionalAccess', _178 => _178.name]) }),
|
|
5868
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
5760
5869
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full items-start justify-between gap-x-4", children: [
|
|
5761
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileUploader, { value: files, onValueChange: setFiles, dropzoneOptions: dropzone2, className: "w-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "text-neutral-300 outline-dashed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: file || _optionalChain([company, 'optionalAccess',
|
|
5870
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileUploader, { value: files, onValueChange: setFiles, dropzoneOptions: dropzone2, className: "w-full p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "text-neutral-300 outline-dashed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: file || _optionalChain([company, 'optionalAccess', _179 => _179.logo]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5762
5871
|
_image2.default,
|
|
5763
5872
|
{
|
|
5764
|
-
src: file ? URL.createObjectURL(file) : _optionalChain([company, 'optionalAccess',
|
|
5873
|
+
src: file ? URL.createObjectURL(file) : _optionalChain([company, 'optionalAccess', _180 => _180.logo]) || "",
|
|
5765
5874
|
alt: "Company Logo",
|
|
5766
5875
|
width: 200,
|
|
5767
5876
|
height: 200
|
|
@@ -5779,7 +5888,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
5779
5888
|
placeholder: t(`foundations.company.fields.name.placeholder`)
|
|
5780
5889
|
}
|
|
5781
5890
|
) }),
|
|
5782
|
-
canAccessFeatures && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5891
|
+
canAccessFeatures && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.ScrollArea, { className: "h-max", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5783
5892
|
FormFeatures,
|
|
5784
5893
|
{
|
|
5785
5894
|
form,
|
|
@@ -5818,9 +5927,9 @@ _chunk7QVYU63Ejs.__name.call(void 0, CompanyEditor, "CompanyEditor");
|
|
|
5818
5927
|
function CompaniesList() {
|
|
5819
5928
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
5820
5929
|
const data = useDataListRetriever({
|
|
5821
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
5930
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.CompanyService.findMany(params), "retriever"),
|
|
5822
5931
|
retrieverParams: {},
|
|
5823
|
-
module:
|
|
5932
|
+
module: _chunkWZJDLITGjs.Modules.Company
|
|
5824
5933
|
});
|
|
5825
5934
|
const functions = [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyEditor, {}, "create-account")];
|
|
5826
5935
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -5828,7 +5937,7 @@ function CompaniesList() {
|
|
|
5828
5937
|
{
|
|
5829
5938
|
data,
|
|
5830
5939
|
fields: ["name" /* name */, "createdAt" /* createdAt */],
|
|
5831
|
-
tableGeneratorType:
|
|
5940
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.Company,
|
|
5832
5941
|
functions,
|
|
5833
5942
|
title: t(`types.companies`, { count: 2 })
|
|
5834
5943
|
}
|
|
@@ -5836,6 +5945,81 @@ function CompaniesList() {
|
|
|
5836
5945
|
}
|
|
5837
5946
|
_chunk7QVYU63Ejs.__name.call(void 0, CompaniesList, "CompaniesList");
|
|
5838
5947
|
|
|
5948
|
+
// src/features/content/components/lists/ContentsList.tsx
|
|
5949
|
+
|
|
5950
|
+
|
|
5951
|
+
function ContentsList({ contentList }) {
|
|
5952
|
+
const t = _nextintl.useTranslations.call(void 0, );
|
|
5953
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-h-0 w-full flex-col overflow-y-auto", children: [
|
|
5954
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "text-xl font-semibold", children: t(`foundations.content.news`) }),
|
|
5955
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col", children: contentList.map((content) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ContentsListElement, { content }, content.id)) })
|
|
5956
|
+
] });
|
|
5957
|
+
}
|
|
5958
|
+
_chunk7QVYU63Ejs.__name.call(void 0, ContentsList, "ContentsList");
|
|
5959
|
+
function ContentsListElement({ content }) {
|
|
5960
|
+
const generateUrl = usePageUrlGenerator();
|
|
5961
|
+
const contentModule = content.contentType ? _chunkWZJDLITGjs.Modules.findByModelName(content.contentType) : void 0;
|
|
5962
|
+
const link = contentModule ? generateUrl({ page: contentModule, id: content.id }) : "#";
|
|
5963
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hover:bg-muted flex w-full flex-col gap-y-2 border-b p-2 py-4", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full justify-between gap-x-2", children: [
|
|
5964
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.HoverCard, { children: [
|
|
5965
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.HoverCardTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Link, { href: link, className: "flex w-full items-center justify-start gap-2 font-semibold", children: [
|
|
5966
|
+
contentModule && _chunkLJRD4SRVjs.getIconByModule.call(void 0, { module: contentModule, className: "h-4 w-4" }),
|
|
5967
|
+
content.name
|
|
5968
|
+
] }) }),
|
|
5969
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.HoverCardContent, { className: "flex max-h-96 w-96 flex-col gap-y-4 overflow-y-auto", children: [
|
|
5970
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: link, className: "font-semibold", children: content.name }),
|
|
5971
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-xs", children: content.abstract })
|
|
5972
|
+
] })
|
|
5973
|
+
] }),
|
|
5974
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ContributorsList, { content })
|
|
5975
|
+
] }) });
|
|
5976
|
+
}
|
|
5977
|
+
_chunk7QVYU63Ejs.__name.call(void 0, ContentsListElement, "ContentsListElement");
|
|
5978
|
+
|
|
5979
|
+
// src/features/content/components/lists/ContentsListById.tsx
|
|
5980
|
+
|
|
5981
|
+
|
|
5982
|
+
function ContentsListById({ contentIds }) {
|
|
5983
|
+
const t = _nextintl.useTranslations.call(void 0, );
|
|
5984
|
+
const data = useDataListRetriever({
|
|
5985
|
+
module: _chunkWZJDLITGjs.Modules.Content,
|
|
5986
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.ContentService.findMany(params), "retriever"),
|
|
5987
|
+
retrieverParams: { contentIds }
|
|
5988
|
+
});
|
|
5989
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5990
|
+
ContentListTable,
|
|
5991
|
+
{
|
|
5992
|
+
data,
|
|
5993
|
+
fields: ["name" /* name */, "authors" /* authors */, "updatedAt" /* updatedAt */],
|
|
5994
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.Content,
|
|
5995
|
+
title: t(`generic.relevant`)
|
|
5996
|
+
}
|
|
5997
|
+
);
|
|
5998
|
+
}
|
|
5999
|
+
_chunk7QVYU63Ejs.__name.call(void 0, ContentsListById, "ContentsListById");
|
|
6000
|
+
|
|
6001
|
+
// src/features/content/components/lists/RelevantContentsList.tsx
|
|
6002
|
+
|
|
6003
|
+
|
|
6004
|
+
function RelevantContentsList({ id }) {
|
|
6005
|
+
const t = _nextintl.useTranslations.call(void 0, );
|
|
6006
|
+
const data = useDataListRetriever({
|
|
6007
|
+
module: _chunkWZJDLITGjs.Modules.Content,
|
|
6008
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.ContentService.findRelevant(params), "retriever"),
|
|
6009
|
+
retrieverParams: { id }
|
|
6010
|
+
});
|
|
6011
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6012
|
+
ContentListTable,
|
|
6013
|
+
{
|
|
6014
|
+
data,
|
|
6015
|
+
fields: ["name" /* name */, "authors" /* authors */, "relevance" /* relevance */, "updatedAt" /* updatedAt */],
|
|
6016
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.Content,
|
|
6017
|
+
title: t(`generic.relevant`)
|
|
6018
|
+
}
|
|
6019
|
+
);
|
|
6020
|
+
}
|
|
6021
|
+
_chunk7QVYU63Ejs.__name.call(void 0, RelevantContentsList, "RelevantContentsList");
|
|
6022
|
+
|
|
5839
6023
|
// src/features/notification/components/common/NotificationErrorBoundary.tsx
|
|
5840
6024
|
|
|
5841
6025
|
|
|
@@ -5896,7 +6080,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
|
|
|
5896
6080
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
5897
6081
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`foundations.notification.${notification.notificationType}.description`, {
|
|
5898
6082
|
strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
|
|
5899
|
-
actor: _nullishCoalesce(_optionalChain([data, 'access',
|
|
6083
|
+
actor: _nullishCoalesce(_optionalChain([data, 'access', _181 => _181.actor, 'optionalAccess', _182 => _182.name]), () => ( "")),
|
|
5900
6084
|
title: data.title
|
|
5901
6085
|
}) }),
|
|
5902
6086
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
|
|
@@ -5924,14 +6108,14 @@ function NotificationMenuItem({ notification, closePopover }) {
|
|
|
5924
6108
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
5925
6109
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`foundations.notification.${notification.notificationType}.description`, {
|
|
5926
6110
|
strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
|
|
5927
|
-
actor: _nullishCoalesce(_optionalChain([data, 'access',
|
|
6111
|
+
actor: _nullishCoalesce(_optionalChain([data, 'access', _183 => _183.actor, 'optionalAccess', _184 => _184.name]), () => ( "")),
|
|
5928
6112
|
title: data.title
|
|
5929
6113
|
}) }),
|
|
5930
6114
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
|
|
5931
6115
|
] })
|
|
5932
6116
|
] });
|
|
5933
6117
|
if (!data.url) return response;
|
|
5934
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6118
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: data.url, onClick: closePopover, children: response });
|
|
5935
6119
|
}
|
|
5936
6120
|
_chunk7QVYU63Ejs.__name.call(void 0, NotificationMenuItem, "NotificationMenuItem");
|
|
5937
6121
|
|
|
@@ -5965,7 +6149,7 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
5965
6149
|
setIsLoading(true);
|
|
5966
6150
|
setError(null);
|
|
5967
6151
|
try {
|
|
5968
|
-
const fetchedNotifications = await
|
|
6152
|
+
const fetchedNotifications = await _chunkFYRFMABSjs.NotificationService.findMany({});
|
|
5969
6153
|
setNotifications(fetchedNotifications);
|
|
5970
6154
|
setLastLoaded(Date.now());
|
|
5971
6155
|
} catch (error2) {
|
|
@@ -5981,7 +6165,7 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
5981
6165
|
try {
|
|
5982
6166
|
const data = {
|
|
5983
6167
|
data: ids.map((id) => ({
|
|
5984
|
-
type:
|
|
6168
|
+
type: _chunkWZJDLITGjs.Modules.Notification.name,
|
|
5985
6169
|
id,
|
|
5986
6170
|
attributes: {
|
|
5987
6171
|
isRead: true
|
|
@@ -5990,8 +6174,8 @@ var NotificationContextProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(v
|
|
|
5990
6174
|
relationships: {}
|
|
5991
6175
|
}))
|
|
5992
6176
|
};
|
|
5993
|
-
await
|
|
5994
|
-
const allNotifications = await
|
|
6177
|
+
await _chunkFYRFMABSjs.NotificationService.markAsRead({ data });
|
|
6178
|
+
const allNotifications = await _chunkFYRFMABSjs.NotificationService.findMany({});
|
|
5995
6179
|
setNotifications(allNotifications);
|
|
5996
6180
|
setLastLoaded(Date.now());
|
|
5997
6181
|
} catch (error2) {
|
|
@@ -6058,39 +6242,39 @@ function NotificationsList({ archived }) {
|
|
|
6058
6242
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6059
6243
|
const generateUrl = usePageUrlGenerator();
|
|
6060
6244
|
const data = useDataListRetriever({
|
|
6061
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6245
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.NotificationService.findMany(params), "retriever"),
|
|
6062
6246
|
retrieverParams: { isArchived: archived },
|
|
6063
|
-
module:
|
|
6247
|
+
module: _chunkWZJDLITGjs.Modules.Notification
|
|
6064
6248
|
});
|
|
6065
6249
|
const archiveNotification = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (notification) => {
|
|
6066
|
-
await
|
|
6250
|
+
await _chunkFYRFMABSjs.NotificationService.archive({ id: notification.id });
|
|
6067
6251
|
data.removeElement(notification);
|
|
6068
6252
|
}, "archiveNotification");
|
|
6069
|
-
const LoadingSkeleton = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6253
|
+
const LoadingSkeleton = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { className: "p-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center", children: [
|
|
6254
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Skeleton, { className: "mr-4 h-8 w-8 rounded-full" }),
|
|
6071
6255
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 space-y-2", children: [
|
|
6072
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6073
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6256
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Skeleton, { className: "h-4 w-3/4" }),
|
|
6257
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Skeleton, { className: "h-3 w-1/2" })
|
|
6074
6258
|
] }),
|
|
6075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6259
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Skeleton, { className: "h-8 w-20" })
|
|
6076
6260
|
] }) }) }, i)) }), "LoadingSkeleton");
|
|
6077
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: data.isLoaded ? _optionalChain([data, 'access',
|
|
6261
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-4", children: data.isLoaded ? _optionalChain([data, 'access', _185 => _185.data, 'optionalAccess', _186 => _186.map, 'call', _187 => _187((notification) => {
|
|
6078
6262
|
const notificationData = generateNotificationData({ notification, generateUrl });
|
|
6079
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6080
|
-
notificationData.actor ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6263
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { className: "p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex w-full flex-row items-center p-2`, children: [
|
|
6264
|
+
notificationData.actor ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: notificationData.actor.id }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user: notificationData.actor, className: "h-8 w-8" }) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-14 max-w-14 px-2" }),
|
|
6081
6265
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col", children: [
|
|
6082
6266
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm", children: t.rich(`foundations.notification.${notification.notificationType}.description`, {
|
|
6083
6267
|
strong: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (chunks) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: chunks }), "strong"),
|
|
6084
|
-
actor: _nullishCoalesce(_optionalChain([notificationData, 'access',
|
|
6268
|
+
actor: _nullishCoalesce(_optionalChain([notificationData, 'access', _188 => _188.actor, 'optionalAccess', _189 => _189.name]), () => ( "")),
|
|
6085
6269
|
title: notificationData.title
|
|
6086
6270
|
}) }),
|
|
6087
6271
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
|
|
6088
6272
|
] }),
|
|
6089
6273
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-center", children: [
|
|
6090
|
-
notificationData.url ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6091
|
-
!archived && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6092
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6093
|
-
|
|
6274
|
+
notificationData.url ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Link, { href: notificationData.url, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { variant: `outline`, size: `sm`, onClick: (e) => e.stopPropagation(), children: t(`foundations.notification.${notification.notificationType}.buttons.action`) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {}),
|
|
6275
|
+
!archived && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tooltip, { children: [
|
|
6276
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6277
|
+
_chunkEZK3H6EJjs.Button,
|
|
6094
6278
|
{
|
|
6095
6279
|
variant: `link`,
|
|
6096
6280
|
onClick: (e) => {
|
|
@@ -6102,7 +6286,7 @@ function NotificationsList({ archived }) {
|
|
|
6102
6286
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArchiveIcon, { className: "h-4 w-4 cursor-pointer" })
|
|
6103
6287
|
}
|
|
6104
6288
|
) }),
|
|
6105
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6289
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipContent, { children: t(`foundations.notification.buttons.archive`) })
|
|
6106
6290
|
] })
|
|
6107
6291
|
] })
|
|
6108
6292
|
] }) }) }, notification.id);
|
|
@@ -6268,8 +6452,8 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
6268
6452
|
}
|
|
6269
6453
|
}, "handleOpenChange");
|
|
6270
6454
|
const unreadNotifications = newNotifications && unreadCount > 0;
|
|
6271
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6272
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6455
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Popover, { open: isOpen, onOpenChange: handleOpenChange, "data-testid": `sidebar-notification button`, children: [
|
|
6456
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.SidebarMenuButton, { className: "text-muted-foreground h-6", disabled: isLoading, children: [
|
|
6273
6457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6274
6458
|
_lucidereact.BellIcon,
|
|
6275
6459
|
{
|
|
@@ -6278,17 +6462,17 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
6278
6462
|
),
|
|
6279
6463
|
t(`types.notifications`, { count: 2 })
|
|
6280
6464
|
] }) }),
|
|
6281
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6282
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6283
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6465
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverContent, { className: "relative left-10 w-80 border-0 p-0 shadow-none", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Card, { children: [
|
|
6466
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CardHeader, { className: "p-4", children: [
|
|
6467
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardTitle, { children: t(`types.notifications`, { count: 2 }) }),
|
|
6284
6468
|
isLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground text-xs", children: "Loading..." }),
|
|
6285
6469
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-destructive text-xs", children: [
|
|
6286
6470
|
"Error: ",
|
|
6287
6471
|
error
|
|
6288
6472
|
] })
|
|
6289
6473
|
] }),
|
|
6290
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6291
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6474
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Separator, {}),
|
|
6475
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.ScrollArea, { className: "h-96", children: notifications.length > 0 ? notifications.map((notification) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: generateNotification(notification, () => setIsOpen(false)) }, notification.id)) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4 text-center text-sm text-gray-500", children: t(`foundations.notification.empty`, { count: 2 }) }) })
|
|
6292
6476
|
] }) })
|
|
6293
6477
|
] });
|
|
6294
6478
|
}
|
|
@@ -6315,18 +6499,18 @@ var RoleProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ child
|
|
|
6315
6499
|
const generateUrl = usePageUrlGenerator();
|
|
6316
6500
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6317
6501
|
const [role, setRole] = _react.useState.call(void 0,
|
|
6318
|
-
dehydratedRole ?
|
|
6502
|
+
dehydratedRole ? _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.Role, dehydratedRole) : void 0
|
|
6319
6503
|
);
|
|
6320
6504
|
const breadcrumb = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
6321
6505
|
const response = [];
|
|
6322
6506
|
response.push({
|
|
6323
6507
|
name: t(`types.roles`, { count: 2 }),
|
|
6324
|
-
href: generateUrl({ page:
|
|
6508
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.Role })
|
|
6325
6509
|
});
|
|
6326
6510
|
if (role)
|
|
6327
6511
|
response.push({
|
|
6328
6512
|
name: role.name,
|
|
6329
|
-
href: generateUrl({ page:
|
|
6513
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.Role, id: role.id })
|
|
6330
6514
|
});
|
|
6331
6515
|
return response;
|
|
6332
6516
|
}, "breadcrumb");
|
|
@@ -6367,7 +6551,7 @@ function RoleDetails() {
|
|
|
6367
6551
|
const { role } = useRoleContext();
|
|
6368
6552
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6369
6553
|
if (!role) return null;
|
|
6370
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6554
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Card, { className: "w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CardContent, { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AttributeElement, { title: t(`foundations.role.fields.description.label`), value: role.description }) }) });
|
|
6371
6555
|
}
|
|
6372
6556
|
_chunk7QVYU63Ejs.__name.call(void 0, RoleDetails, "RoleDetails");
|
|
6373
6557
|
|
|
@@ -6390,18 +6574,18 @@ function FormRoles({ form, id, name, roles }) {
|
|
|
6390
6574
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6391
6575
|
const { hasAccesToFeature } = useCurrentUserContext();
|
|
6392
6576
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6393
|
-
|
|
6577
|
+
_chunkEZK3H6EJjs.FormField,
|
|
6394
6578
|
{
|
|
6395
6579
|
control: form.control,
|
|
6396
6580
|
name: id,
|
|
6397
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6398
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6581
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${name ? "mb-5" : "mb-1"}`, children: [
|
|
6582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
6399
6583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-sm font-semibold", children: name }),
|
|
6400
6584
|
roles.filter((role) => role.isSelectable).sort((a, b) => a.name.localeCompare(b.name)).map((role) => {
|
|
6401
6585
|
if (role.requiredFeature && !hasAccesToFeature(role.requiredFeature.id)) return null;
|
|
6402
6586
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
6403
6587
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6404
|
-
|
|
6588
|
+
_chunkEZK3H6EJjs.Checkbox,
|
|
6405
6589
|
{
|
|
6406
6590
|
defaultChecked: field.value.some((roleId) => roleId === role.id),
|
|
6407
6591
|
onCheckedChange: (checked) => {
|
|
@@ -6416,14 +6600,14 @@ function FormRoles({ form, id, name, roles }) {
|
|
|
6416
6600
|
}
|
|
6417
6601
|
}
|
|
6418
6602
|
),
|
|
6419
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6421
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6603
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tooltip, { children: [
|
|
6604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "ml-3 font-normal", children: t(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) }) }) }),
|
|
6605
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipContent, { children: t(`foundations.role.roles_descriptions`, { role: role.id.replaceAll(`-`, ``) }) })
|
|
6422
6606
|
] })
|
|
6423
6607
|
] }, role.id);
|
|
6424
6608
|
})
|
|
6425
6609
|
] }) }),
|
|
6426
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6610
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
6427
6611
|
] })
|
|
6428
6612
|
}
|
|
6429
6613
|
) });
|
|
@@ -6440,7 +6624,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
6440
6624
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6441
6625
|
_react.useEffect.call(void 0, () => {
|
|
6442
6626
|
async function checkCompanyAdminDeletability() {
|
|
6443
|
-
const roleUsers = await
|
|
6627
|
+
const roleUsers = await _chunkFYRFMABSjs.UserService.findAllUsersByRole({
|
|
6444
6628
|
roleId: role.id
|
|
6445
6629
|
});
|
|
6446
6630
|
if (roleUsers.length > 1) setCanRemove(true);
|
|
@@ -6454,7 +6638,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
6454
6638
|
}, [role]);
|
|
6455
6639
|
const remove = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
6456
6640
|
try {
|
|
6457
|
-
await
|
|
6641
|
+
await _chunkFYRFMABSjs.RoleService.removeUserFromRole({
|
|
6458
6642
|
roleId: role.id,
|
|
6459
6643
|
userId: user.id
|
|
6460
6644
|
});
|
|
@@ -6465,9 +6649,9 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
6465
6649
|
}
|
|
6466
6650
|
}, "remove");
|
|
6467
6651
|
const roleName = t(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) });
|
|
6468
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6652
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Dialog, { open, onOpenChange: setOpen, children: [
|
|
6469
6653
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6470
|
-
|
|
6654
|
+
_chunkEZK3H6EJjs.DialogTrigger,
|
|
6471
6655
|
{
|
|
6472
6656
|
onClick: (e) => {
|
|
6473
6657
|
e.stopPropagation();
|
|
@@ -6477,17 +6661,17 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
6477
6661
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "hover:text-destructive cursor-pointer", children: t(`foundations.role.remove_user.title`) })
|
|
6478
6662
|
}
|
|
6479
6663
|
),
|
|
6480
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6481
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6482
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6483
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6664
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
6665
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogHeader, { children: [
|
|
6666
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: t(`foundations.role.remove_user.title`) }),
|
|
6667
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { children: canRemove ? t(`foundations.role.remove_user.subtitle_allowed`) : t(`foundations.role.remove_user.subtitle_not_allowed`) })
|
|
6484
6668
|
] }),
|
|
6485
6669
|
canRemove ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
6486
6670
|
t(`foundations.role.remove_user.description_allowed`, { role: roleName, user: user.name }),
|
|
6487
6671
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end", children: [
|
|
6488
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6672
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`generic.buttons.cancel`) }),
|
|
6489
6673
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6490
|
-
|
|
6674
|
+
_chunkEZK3H6EJjs.Button,
|
|
6491
6675
|
{
|
|
6492
6676
|
type: "submit",
|
|
6493
6677
|
onClick: (e) => {
|
|
@@ -6518,7 +6702,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
6518
6702
|
const [roles, setRoles] = _react.useState.call(void 0, []);
|
|
6519
6703
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6520
6704
|
const addUserToRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (role) => {
|
|
6521
|
-
await
|
|
6705
|
+
await _chunkFYRFMABSjs.RoleService.addUserToRole({
|
|
6522
6706
|
roleId: role.id,
|
|
6523
6707
|
userId: user.id
|
|
6524
6708
|
});
|
|
@@ -6542,7 +6726,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
6542
6726
|
const searchRoles = _react.useCallback.call(void 0,
|
|
6543
6727
|
async (term) => {
|
|
6544
6728
|
setRoles(
|
|
6545
|
-
await
|
|
6729
|
+
await _chunkFYRFMABSjs.RoleService.findAllRolesUserNotIn({
|
|
6546
6730
|
search: term,
|
|
6547
6731
|
userId: user.id
|
|
6548
6732
|
})
|
|
@@ -6558,26 +6742,26 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
6558
6742
|
if (open) searchRoles("");
|
|
6559
6743
|
}, [open]);
|
|
6560
6744
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
6561
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6745
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", onClick: () => setOpen(true), children: [
|
|
6562
6746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.PlusCircle, { className: "mr-3 h-3.5 w-3.5" }),
|
|
6563
6747
|
t(`generic.association.label`, {
|
|
6564
6748
|
source: t(`types.roles`, { count: 1 }),
|
|
6565
6749
|
destination: t(`types.users`, { count: 1 })
|
|
6566
6750
|
})
|
|
6567
6751
|
] }),
|
|
6568
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6569
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6752
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
6753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: t(`generic.association.label`, {
|
|
6570
6754
|
source: t(`types.roles`, { count: 1 }),
|
|
6571
6755
|
destination: t(`types.users`, { count: 1 })
|
|
6572
6756
|
}) }),
|
|
6573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { children: t(`generic.association.description`, {
|
|
6574
6758
|
source: t(`types.roles`, { count: 1 }),
|
|
6575
6759
|
destination: t(`types.users`, { count: 1 }),
|
|
6576
6760
|
destination_name: user.name
|
|
6577
6761
|
}) }),
|
|
6578
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6762
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Command, { shouldFilter: false, children: [
|
|
6579
6763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6580
|
-
|
|
6764
|
+
_chunkEZK3H6EJjs.CommandInput,
|
|
6581
6765
|
{
|
|
6582
6766
|
placeholder: t(`generic.search.placeholder`, { type: t(`types.roles`, { count: 1 }) }),
|
|
6583
6767
|
value: searchTerm,
|
|
@@ -6585,10 +6769,10 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
6585
6769
|
ref: inputRef
|
|
6586
6770
|
}
|
|
6587
6771
|
),
|
|
6588
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6589
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6772
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-x-hidden overflow-y-auto", children: [
|
|
6773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CommandEmpty, { children: t(`generic.search.no_results`, { type: t(`types.roles`, { count: 1 }) }) }),
|
|
6590
6774
|
roles.map((role) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6591
|
-
|
|
6775
|
+
_chunkEZK3H6EJjs.CommandItem,
|
|
6592
6776
|
{
|
|
6593
6777
|
className: "cursor-pointer",
|
|
6594
6778
|
onSelect: () => addUserToRole(role),
|
|
@@ -6610,16 +6794,16 @@ _chunk7QVYU63Ejs.__name.call(void 0, UserRoleAdd, "UserRoleAdd");
|
|
|
6610
6794
|
function RolesList() {
|
|
6611
6795
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6612
6796
|
const data = useDataListRetriever({
|
|
6613
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6797
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.RoleService.findAllRoles(params), "retriever"),
|
|
6614
6798
|
retrieverParams: {},
|
|
6615
|
-
module:
|
|
6799
|
+
module: _chunkWZJDLITGjs.Modules.Role
|
|
6616
6800
|
});
|
|
6617
6801
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6618
6802
|
ContentListTable,
|
|
6619
6803
|
{
|
|
6620
6804
|
data,
|
|
6621
6805
|
fields: ["name" /* name */, "description" /* description */],
|
|
6622
|
-
tableGeneratorType:
|
|
6806
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.Role,
|
|
6623
6807
|
title: t(`types.roles`, { count: 2 })
|
|
6624
6808
|
}
|
|
6625
6809
|
);
|
|
@@ -6632,16 +6816,16 @@ _chunk7QVYU63Ejs.__name.call(void 0, RolesList, "RolesList");
|
|
|
6632
6816
|
function UserRolesList({ user }) {
|
|
6633
6817
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6634
6818
|
const data = useDataListRetriever({
|
|
6635
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6819
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.RoleService.findAllRolesByUser(params), "retriever"),
|
|
6636
6820
|
retrieverParams: { userId: user.id },
|
|
6637
|
-
module:
|
|
6821
|
+
module: _chunkWZJDLITGjs.Modules.Role
|
|
6638
6822
|
});
|
|
6639
6823
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6640
6824
|
ContentListTable,
|
|
6641
6825
|
{
|
|
6642
6826
|
data,
|
|
6643
6827
|
fields: ["name" /* name */, "description" /* description */],
|
|
6644
|
-
tableGeneratorType:
|
|
6828
|
+
tableGeneratorType: _chunkWZJDLITGjs.Modules.Role,
|
|
6645
6829
|
title: t(`types.roles`, { count: 2 })
|
|
6646
6830
|
}
|
|
6647
6831
|
);
|
|
@@ -6658,7 +6842,7 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
6658
6842
|
const [existingUsers, setExistingUsers] = _react.useState.call(void 0, null);
|
|
6659
6843
|
_react.useEffect.call(void 0, () => {
|
|
6660
6844
|
const fetchExistingUsers = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
6661
|
-
setExistingUsers(await
|
|
6845
|
+
setExistingUsers(await _chunkFYRFMABSjs.UserService.findMany({ roleId: role.id, fetchAll: true }));
|
|
6662
6846
|
}, "fetchExistingUsers");
|
|
6663
6847
|
if (show) {
|
|
6664
6848
|
setExistingUsers(null);
|
|
@@ -6666,7 +6850,7 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
6666
6850
|
}
|
|
6667
6851
|
}, [show]);
|
|
6668
6852
|
const addUserToRole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (user) => {
|
|
6669
|
-
await
|
|
6853
|
+
await _chunkFYRFMABSjs.RoleService.addUserToRole({
|
|
6670
6854
|
roleId: role.id,
|
|
6671
6855
|
userId: user.id
|
|
6672
6856
|
});
|
|
@@ -6682,9 +6866,9 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
6682
6866
|
}, "addUserToRole");
|
|
6683
6867
|
const data = useDataListRetriever({
|
|
6684
6868
|
ready: !!company && show,
|
|
6685
|
-
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) =>
|
|
6686
|
-
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess',
|
|
6687
|
-
module:
|
|
6869
|
+
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => _chunkFYRFMABSjs.UserService.findAllUsers(params), "retriever"),
|
|
6870
|
+
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _190 => _190.id]) },
|
|
6871
|
+
module: _chunkWZJDLITGjs.Modules.User
|
|
6688
6872
|
});
|
|
6689
6873
|
_react.useEffect.call(void 0, () => {
|
|
6690
6874
|
if (!!company && show) {
|
|
@@ -6751,10 +6935,10 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
6751
6935
|
onValueChange: setFiles,
|
|
6752
6936
|
dropzoneOptions: dropzone2,
|
|
6753
6937
|
className: "h-40 w-40 rounded-full p-0",
|
|
6754
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "bg-muted text-muted-foreground flex h-full w-full flex-col items-center justify-center", children: !resetImage && (file || _optionalChain([user, 'optionalAccess',
|
|
6938
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FileInput, { className: "bg-muted text-muted-foreground flex h-full w-full flex-col items-center justify-center", children: !resetImage && (file || _optionalChain([user, 'optionalAccess', _191 => _191.avatar])) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6755
6939
|
_image2.default,
|
|
6756
6940
|
{
|
|
6757
|
-
src: file ? URL.createObjectURL(file) : _optionalChain([user, 'optionalAccess',
|
|
6941
|
+
src: file ? URL.createObjectURL(file) : _optionalChain([user, 'optionalAccess', _192 => _192.avatar]) || "",
|
|
6758
6942
|
alt: t(`generic.avatar`),
|
|
6759
6943
|
width: 200,
|
|
6760
6944
|
height: 200
|
|
@@ -6762,8 +6946,8 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
6762
6946
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UploadIcon, { className: "my-4 h-8 w-8" }) })
|
|
6763
6947
|
}
|
|
6764
6948
|
),
|
|
6765
|
-
!resetImage && (file || _optionalChain([user, 'optionalAccess',
|
|
6766
|
-
|
|
6949
|
+
!resetImage && (file || _optionalChain([user, 'optionalAccess', _193 => _193.avatar])) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6950
|
+
_chunkEZK3H6EJjs.Button,
|
|
6767
6951
|
{
|
|
6768
6952
|
className: "",
|
|
6769
6953
|
size: `sm`,
|
|
@@ -6790,7 +6974,7 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
|
|
|
6790
6974
|
const router = _chunkAYHKQWHHjs.useI18nRouter.call(void 0, );
|
|
6791
6975
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
6792
6976
|
let cId;
|
|
6793
|
-
if (_optionalChain([currentUser, 'optionalAccess',
|
|
6977
|
+
if (_optionalChain([currentUser, 'optionalAccess', _194 => _194.roles, 'access', _195 => _195.find, 'call', _196 => _196((role) => role.id === _chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator)]) && companyId) {
|
|
6794
6978
|
cId = companyId;
|
|
6795
6979
|
} else {
|
|
6796
6980
|
if (!company) return;
|
|
@@ -6800,8 +6984,8 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
|
|
|
6800
6984
|
CommonDeleter,
|
|
6801
6985
|
{
|
|
6802
6986
|
type: `users`,
|
|
6803
|
-
deleteFunction: () =>
|
|
6804
|
-
() => onDeleted ? onDeleted() : router.push(generateUrl({ page:
|
|
6987
|
+
deleteFunction: () => _chunkFYRFMABSjs.UserService.delete({ userId: user.id, companyId: cId }).then(
|
|
6988
|
+
() => onDeleted ? onDeleted() : router.push(generateUrl({ page: _chunkWZJDLITGjs.Modules.User }))
|
|
6805
6989
|
)
|
|
6806
6990
|
}
|
|
6807
6991
|
);
|
|
@@ -6809,7 +6993,7 @@ function UserDeleterInternal({ user, onDeleted, companyId }) {
|
|
|
6809
6993
|
_chunk7QVYU63Ejs.__name.call(void 0, UserDeleterInternal, "UserDeleterInternal");
|
|
6810
6994
|
function UserDeleter(props) {
|
|
6811
6995
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
6812
|
-
if (!hasPermissionToModule({ module:
|
|
6996
|
+
if (!hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.User, action: "delete" /* Delete */, data: props.user })) return null;
|
|
6813
6997
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserDeleterInternal, { ...props });
|
|
6814
6998
|
}
|
|
6815
6999
|
_chunk7QVYU63Ejs.__name.call(void 0, UserDeleter, "UserDeleter");
|
|
@@ -6858,22 +7042,22 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6858
7042
|
const form = _reacthookform.useForm.call(void 0, {
|
|
6859
7043
|
resolver: _zod.zodResolver.call(void 0, formSchema),
|
|
6860
7044
|
defaultValues: {
|
|
6861
|
-
id: _optionalChain([user, 'optionalAccess',
|
|
6862
|
-
name: _optionalChain([user, 'optionalAccess',
|
|
6863
|
-
title: _optionalChain([user, 'optionalAccess',
|
|
6864
|
-
bio: _optionalChain([user, 'optionalAccess',
|
|
6865
|
-
email: _optionalChain([user, 'optionalAccess',
|
|
6866
|
-
phone: _optionalChain([user, 'optionalAccess',
|
|
7045
|
+
id: _optionalChain([user, 'optionalAccess', _197 => _197.id]) || _uuid.v4.call(void 0, ),
|
|
7046
|
+
name: _optionalChain([user, 'optionalAccess', _198 => _198.name]) || "",
|
|
7047
|
+
title: _optionalChain([user, 'optionalAccess', _199 => _199.title]) || "",
|
|
7048
|
+
bio: _optionalChain([user, 'optionalAccess', _200 => _200.bio]) || "",
|
|
7049
|
+
email: _optionalChain([user, 'optionalAccess', _201 => _201.email]) || "",
|
|
7050
|
+
phone: _optionalChain([user, 'optionalAccess', _202 => _202.phone]) || "",
|
|
6867
7051
|
password: "",
|
|
6868
|
-
roleIds: _optionalChain([user, 'optionalAccess',
|
|
7052
|
+
roleIds: _optionalChain([user, 'optionalAccess', _203 => _203.roles, 'access', _204 => _204.map, 'call', _205 => _205((role) => role.id)]) || [],
|
|
6869
7053
|
sendInvitationEmail: false,
|
|
6870
|
-
avatar: _optionalChain([user, 'optionalAccess',
|
|
7054
|
+
avatar: _optionalChain([user, 'optionalAccess', _206 => _206.avatarUrl]) || ""
|
|
6871
7055
|
}
|
|
6872
7056
|
});
|
|
6873
7057
|
const onSubmit = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async (values) => {
|
|
6874
7058
|
if (!user) {
|
|
6875
7059
|
try {
|
|
6876
|
-
const existingUser = await
|
|
7060
|
+
const existingUser = await _chunkFYRFMABSjs.UserService.findByEmail({ email: values.email });
|
|
6877
7061
|
if (existingUser) {
|
|
6878
7062
|
form.setError("email", {
|
|
6879
7063
|
type: "manual",
|
|
@@ -6886,7 +7070,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6886
7070
|
}
|
|
6887
7071
|
}
|
|
6888
7072
|
if (values.avatar && contentType) {
|
|
6889
|
-
const s3 = await
|
|
7073
|
+
const s3 = await _chunkFYRFMABSjs.S3Service.getPreSignedUrl({
|
|
6890
7074
|
key: values.avatar,
|
|
6891
7075
|
contentType,
|
|
6892
7076
|
isPublic: true
|
|
@@ -6912,16 +7096,16 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6912
7096
|
adminCreated
|
|
6913
7097
|
};
|
|
6914
7098
|
try {
|
|
6915
|
-
const updatedUser = user ? await
|
|
6916
|
-
if (_optionalChain([currentUser, 'optionalAccess',
|
|
7099
|
+
const updatedUser = user ? await _chunkFYRFMABSjs.UserService.update(payload) : await _chunkFYRFMABSjs.UserService.create(payload);
|
|
7100
|
+
if (_optionalChain([currentUser, 'optionalAccess', _207 => _207.id]) === updatedUser.id) setUser(updatedUser);
|
|
6917
7101
|
if (onRevalidate) {
|
|
6918
|
-
await onRevalidate(generateUrl({ page:
|
|
7102
|
+
await onRevalidate(generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: updatedUser.id, language: `[locale]` }));
|
|
6919
7103
|
}
|
|
6920
7104
|
if (propagateChanges) {
|
|
6921
7105
|
propagateChanges(updatedUser);
|
|
6922
7106
|
setOpen(false);
|
|
6923
7107
|
} else {
|
|
6924
|
-
router.push(generateUrl({ page:
|
|
7108
|
+
router.push(generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: updatedUser.id }));
|
|
6925
7109
|
}
|
|
6926
7110
|
} catch (error) {
|
|
6927
7111
|
errorToast({ title: user ? t(`generic.errors.update`) : t(`generic.errors.create`), error });
|
|
@@ -6929,14 +7113,14 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6929
7113
|
}, "onSubmit");
|
|
6930
7114
|
_react.useEffect.call(void 0, () => {
|
|
6931
7115
|
async function fetchRoles() {
|
|
6932
|
-
const roles2 = await
|
|
7116
|
+
const roles2 = await _chunkFYRFMABSjs.RoleService.findAllRoles({});
|
|
6933
7117
|
const availableRoles = roles2.filter(
|
|
6934
|
-
(role) => role.id !== _chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess',
|
|
7118
|
+
(role) => role.id !== _chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator && (role.requiredFeature === void 0 || _optionalChain([company, 'optionalAccess', _208 => _208.features, 'access', _209 => _209.some, 'call', _210 => _210((feature) => feature.id === _optionalChain([role, 'access', _211 => _211.requiredFeature, 'optionalAccess', _212 => _212.id]))]))
|
|
6935
7119
|
);
|
|
6936
7120
|
setRoles(availableRoles);
|
|
6937
7121
|
}
|
|
6938
7122
|
_chunk7QVYU63Ejs.__name.call(void 0, fetchRoles, "fetchRoles");
|
|
6939
|
-
if (open && (company || _optionalChain([currentUser, 'optionalAccess',
|
|
7123
|
+
if (open && (company || _optionalChain([currentUser, 'optionalAccess', _213 => _213.roles, 'access', _214 => _214.find, 'call', _215 => _215((role) => role.id === _chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator)])) && roles.length === 0)
|
|
6940
7124
|
fetchRoles();
|
|
6941
7125
|
}, [company, open]);
|
|
6942
7126
|
_react.useEffect.call(void 0, () => {
|
|
@@ -6957,16 +7141,16 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6957
7141
|
setContentType(null);
|
|
6958
7142
|
}
|
|
6959
7143
|
}, [file]);
|
|
6960
|
-
const canChangeRoles = !(_optionalChain([currentUser, 'optionalAccess',
|
|
6961
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6962
|
-
trigger ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7144
|
+
const canChangeRoles = !(_optionalChain([currentUser, 'optionalAccess', _216 => _216.id]) === _optionalChain([user, 'optionalAccess', _217 => _217.id]) && hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator)) && (hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.User, action: "update" /* Update */ }) || hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator));
|
|
7145
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Dialog, { open, onOpenChange: setOpen, children: [
|
|
7146
|
+
trigger ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTrigger, { asChild: true, children: trigger }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorTrigger, { isEdit: !!user }),
|
|
6963
7147
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
6964
|
-
|
|
7148
|
+
_chunkEZK3H6EJjs.DialogContent,
|
|
6965
7149
|
{
|
|
6966
7150
|
className: `flex max-h-[70vh] ${canChangeRoles ? `max-w-[90vw]` : `max-w-3xl`} min-h-3xl max-h-[90vh] flex-col overflow-y-auto`,
|
|
6967
7151
|
children: [
|
|
6968
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.users`, { count: 1 }), name: _optionalChain([user, 'optionalAccess',
|
|
6969
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommonEditorHeader, { type: t(`types.users`, { count: 1 }), name: _optionalChain([user, 'optionalAccess', _218 => _218.name]) }),
|
|
7153
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
6970
7154
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `flex flex-row gap-x-4`, children: [
|
|
6971
7155
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `flex w-40 flex-col justify-start gap-y-2`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6972
7156
|
UserAvatarEditor,
|
|
@@ -7051,10 +7235,10 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7051
7235
|
] })
|
|
7052
7236
|
] }),
|
|
7053
7237
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end gap-x-4", children: [
|
|
7054
|
-
user && _optionalChain([currentUser, 'optionalAccess',
|
|
7238
|
+
user && _optionalChain([currentUser, 'optionalAccess', _219 => _219.roles, 'access', _220 => _220.find, 'call', _221 => _221((role) => role.id === _chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator)]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7055
7239
|
UserDeleter,
|
|
7056
7240
|
{
|
|
7057
|
-
companyId: _optionalChain([user, 'access',
|
|
7241
|
+
companyId: _optionalChain([user, 'access', _222 => _222.company, 'optionalAccess', _223 => _223.id]),
|
|
7058
7242
|
user,
|
|
7059
7243
|
onDeleted: () => {
|
|
7060
7244
|
setOpen(false);
|
|
@@ -7074,7 +7258,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, UserEditorInternal, "UserEditorInternal");
|
|
|
7074
7258
|
function UserEditor(props) {
|
|
7075
7259
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
7076
7260
|
if (!hasPermissionToModule({
|
|
7077
|
-
module:
|
|
7261
|
+
module: _chunkWZJDLITGjs.Modules.User,
|
|
7078
7262
|
action: props.user ? "update" /* Update */ : "create" /* Create */,
|
|
7079
7263
|
data: props.user
|
|
7080
7264
|
}))
|
|
@@ -7088,9 +7272,9 @@ _chunk7QVYU63Ejs.__name.call(void 0, UserEditor, "UserEditor");
|
|
|
7088
7272
|
|
|
7089
7273
|
|
|
7090
7274
|
function UserAvatarIcon({ className, url, name }) {
|
|
7091
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7092
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7093
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7275
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Avatar, { className: `${className || "h-4 w-4"}`, children: [
|
|
7276
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AvatarImage, { src: url }),
|
|
7277
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AvatarFallback, { children: name ? name.split(" ").map((n) => n.charAt(0).toUpperCase()).join("") : "U" })
|
|
7094
7278
|
] });
|
|
7095
7279
|
}
|
|
7096
7280
|
_chunk7QVYU63Ejs.__name.call(void 0, UserAvatarIcon, "UserAvatarIcon");
|
|
@@ -7113,10 +7297,10 @@ function UserMultiSelect({
|
|
|
7113
7297
|
const data = useDataListRetriever({
|
|
7114
7298
|
ready: !!company,
|
|
7115
7299
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
7116
|
-
return
|
|
7300
|
+
return _chunkFYRFMABSjs.UserService.findAllUsers(params);
|
|
7117
7301
|
}, "retriever"),
|
|
7118
|
-
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess',
|
|
7119
|
-
module:
|
|
7302
|
+
retrieverParams: { companyId: _optionalChain([company, 'optionalAccess', _224 => _224.id]) },
|
|
7303
|
+
module: _chunkWZJDLITGjs.Modules.User
|
|
7120
7304
|
});
|
|
7121
7305
|
_react.useEffect.call(void 0, () => {
|
|
7122
7306
|
if (company) data.setReady(true);
|
|
@@ -7142,7 +7326,7 @@ function UserMultiSelect({
|
|
|
7142
7326
|
_react.useEffect.call(void 0, () => {
|
|
7143
7327
|
if (data.data && data.data.length > 0) {
|
|
7144
7328
|
const users = data.data;
|
|
7145
|
-
const filteredUsers = users.filter((user) => user.id !== _optionalChain([currentUser, 'optionalAccess',
|
|
7329
|
+
const filteredUsers = users.filter((user) => user.id !== _optionalChain([currentUser, 'optionalAccess', _225 => _225.id]));
|
|
7146
7330
|
const options = filteredUsers.map((user) => ({
|
|
7147
7331
|
label: user.name,
|
|
7148
7332
|
value: user.id,
|
|
@@ -7173,7 +7357,7 @@ function UserMultiSelect({
|
|
|
7173
7357
|
return existingUser;
|
|
7174
7358
|
}
|
|
7175
7359
|
const option = userOptions.find((option2) => option2.value === id2);
|
|
7176
|
-
if (_optionalChain([option, 'optionalAccess',
|
|
7360
|
+
if (_optionalChain([option, 'optionalAccess', _226 => _226.userData])) {
|
|
7177
7361
|
return {
|
|
7178
7362
|
id: option.userData.id,
|
|
7179
7363
|
name: option.userData.name,
|
|
@@ -7184,23 +7368,23 @@ function UserMultiSelect({
|
|
|
7184
7368
|
});
|
|
7185
7369
|
form.setValue(id, updatedSelectedUsers);
|
|
7186
7370
|
if (onChange) {
|
|
7187
|
-
const fullSelectedUsers = selectedIds.map((id2) => _optionalChain([userOptions, 'access',
|
|
7371
|
+
const fullSelectedUsers = selectedIds.map((id2) => _optionalChain([userOptions, 'access', _227 => _227.find, 'call', _228 => _228((option) => option.value === id2), 'optionalAccess', _229 => _229.userData])).filter(Boolean);
|
|
7188
7372
|
onChange(fullSelectedUsers);
|
|
7189
7373
|
}
|
|
7190
7374
|
}, "handleValueChange");
|
|
7191
7375
|
const selectedUserIds = selectedUsers.map((user) => user.id);
|
|
7192
7376
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7193
|
-
|
|
7377
|
+
_chunkEZK3H6EJjs.FormField,
|
|
7194
7378
|
{
|
|
7195
7379
|
control: form.control,
|
|
7196
7380
|
name: id,
|
|
7197
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7198
|
-
label && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7381
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${label ? "mb-5" : "mb-1"}`, children: [
|
|
7382
|
+
label && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "flex items-center", children: [
|
|
7199
7383
|
label,
|
|
7200
7384
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
7201
7385
|
] }),
|
|
7202
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7203
|
-
|
|
7386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7387
|
+
_chunkEZK3H6EJjs.MultiSelect,
|
|
7204
7388
|
{
|
|
7205
7389
|
options: userOptions,
|
|
7206
7390
|
onValueChange: handleValueChange,
|
|
@@ -7210,7 +7394,7 @@ function UserMultiSelect({
|
|
|
7210
7394
|
animation: 0
|
|
7211
7395
|
}
|
|
7212
7396
|
) }),
|
|
7213
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
7214
7398
|
] })
|
|
7215
7399
|
}
|
|
7216
7400
|
) });
|
|
@@ -7227,28 +7411,28 @@ function UserReactivatorInterface({ user, propagateChanges }) {
|
|
|
7227
7411
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
7228
7412
|
const reactivateUser = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
7229
7413
|
try {
|
|
7230
|
-
const updatedUser = await
|
|
7414
|
+
const updatedUser = await _chunkFYRFMABSjs.UserService.reactivate({ userId: user.id });
|
|
7231
7415
|
setOpen(false);
|
|
7232
7416
|
propagateChanges(updatedUser);
|
|
7233
7417
|
} catch (error) {
|
|
7234
7418
|
errorToast({ title: t(`generic.errors.error`), error });
|
|
7235
7419
|
}
|
|
7236
7420
|
}, "reactivateUser");
|
|
7237
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7238
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7421
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Dialog, { open, onOpenChange: setOpen, children: [
|
|
7422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", children: [
|
|
7239
7423
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.UserCheckIcon, { className: "mr-3 h-3.5 w-3.5" }),
|
|
7240
7424
|
t(`foundations.user.buttons.reactivate`)
|
|
7241
7425
|
] }) }),
|
|
7242
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7243
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7244
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7426
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
7427
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogHeader, { children: [
|
|
7428
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: t(`foundations.user.reactivate.title`) }),
|
|
7429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { children: t(`foundations.user.reactivate.subtitle`) })
|
|
7246
7430
|
] }),
|
|
7247
7431
|
t(`foundations.user.reactivate.description`, { name: user.name }),
|
|
7248
7432
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end", children: [
|
|
7249
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7433
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`generic.buttons.cancel`) }),
|
|
7250
7434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7251
|
-
|
|
7435
|
+
_chunkEZK3H6EJjs.Button,
|
|
7252
7436
|
{
|
|
7253
7437
|
type: "submit",
|
|
7254
7438
|
onClick: (e) => {
|
|
@@ -7265,7 +7449,7 @@ function UserReactivatorInterface({ user, propagateChanges }) {
|
|
|
7265
7449
|
_chunk7QVYU63Ejs.__name.call(void 0, UserReactivatorInterface, "UserReactivatorInterface");
|
|
7266
7450
|
function UserReactivator(props) {
|
|
7267
7451
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
7268
|
-
if (!hasPermissionToModule({ module:
|
|
7452
|
+
if (!hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.User, action: "update" /* Update */, data: props.user })) return null;
|
|
7269
7453
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserReactivatorInterface, { ...props });
|
|
7270
7454
|
}
|
|
7271
7455
|
_chunk7QVYU63Ejs.__name.call(void 0, UserReactivator, "UserReactivator");
|
|
@@ -7281,7 +7465,7 @@ function UserResentInvitationEmailInternal({ user }) {
|
|
|
7281
7465
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
7282
7466
|
const sendInvitationEmail = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, async () => {
|
|
7283
7467
|
try {
|
|
7284
|
-
await
|
|
7468
|
+
await _chunkFYRFMABSjs.UserService.sendInvitation({ userId: user.id, companyId: user.company.id });
|
|
7285
7469
|
setOpen(false);
|
|
7286
7470
|
_sonner.toast.message(t(`foundations.user.resend_activation.email_sent`), {
|
|
7287
7471
|
description: t(`foundations.user.resend_activation.email_sent_description`, { email: user.email })
|
|
@@ -7290,21 +7474,21 @@ function UserResentInvitationEmailInternal({ user }) {
|
|
|
7290
7474
|
errorToast({ title: t(`generic.errors.error`), error });
|
|
7291
7475
|
}
|
|
7292
7476
|
}, "sendInvitationEmail");
|
|
7293
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7294
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7295
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7296
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7477
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Dialog, { open, onOpenChange: setOpen, children: [
|
|
7478
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Tooltip, { children: [
|
|
7479
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { size: "sm", variant: `ghost`, className: "text-muted-foreground", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MailIcon, {}) }) }) }),
|
|
7480
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.TooltipContent, { children: t(`foundations.user.buttons.resend_activation`) })
|
|
7297
7481
|
] }),
|
|
7298
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7299
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7300
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7301
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7482
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
7483
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.DialogHeader, { children: [
|
|
7484
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogTitle, { children: t(`foundations.user.resend_activation.title`) }),
|
|
7485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.DialogDescription, { children: t(`foundations.user.resend_activation.subtitle`) })
|
|
7302
7486
|
] }),
|
|
7303
7487
|
t(`foundations.user.resend_activation.description`, { email: user.email }),
|
|
7304
7488
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-end", children: [
|
|
7305
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7489
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`generic.buttons.cancel`) }),
|
|
7306
7490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7307
|
-
|
|
7491
|
+
_chunkEZK3H6EJjs.Button,
|
|
7308
7492
|
{
|
|
7309
7493
|
type: "submit",
|
|
7310
7494
|
onClick: (e) => {
|
|
@@ -7321,7 +7505,7 @@ function UserResentInvitationEmailInternal({ user }) {
|
|
|
7321
7505
|
_chunk7QVYU63Ejs.__name.call(void 0, UserResentInvitationEmailInternal, "UserResentInvitationEmailInternal");
|
|
7322
7506
|
function UserResentInvitationEmail(props) {
|
|
7323
7507
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
7324
|
-
if (!hasPermissionToModule({ module:
|
|
7508
|
+
if (!hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.User, action: "update" /* Update */, data: props.user })) return null;
|
|
7325
7509
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserResentInvitationEmailInternal, { ...props });
|
|
7326
7510
|
}
|
|
7327
7511
|
_chunk7QVYU63Ejs.__name.call(void 0, UserResentInvitationEmail, "UserResentInvitationEmail");
|
|
@@ -7339,10 +7523,10 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
7339
7523
|
const [isSearching, setIsSearching] = _react.useState.call(void 0, false);
|
|
7340
7524
|
const data = useDataListRetriever({
|
|
7341
7525
|
retriever: /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (params) => {
|
|
7342
|
-
return
|
|
7526
|
+
return _chunkFYRFMABSjs.UserService.findMany(params);
|
|
7343
7527
|
}, "retriever"),
|
|
7344
7528
|
retrieverParams: {},
|
|
7345
|
-
module:
|
|
7529
|
+
module: _chunkWZJDLITGjs.Modules.User
|
|
7346
7530
|
});
|
|
7347
7531
|
const search = _react.useCallback.call(void 0,
|
|
7348
7532
|
async (searchedTerm) => {
|
|
@@ -7376,23 +7560,23 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
7376
7560
|
}, 0);
|
|
7377
7561
|
}, "setUser");
|
|
7378
7562
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7379
|
-
|
|
7563
|
+
_chunkEZK3H6EJjs.FormField,
|
|
7380
7564
|
{
|
|
7381
7565
|
control: form.control,
|
|
7382
7566
|
name: id,
|
|
7383
|
-
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7384
|
-
label && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7567
|
+
render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormItem, { className: `${label ? "mb-5" : "mb-1"}`, children: [
|
|
7568
|
+
label && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.FormLabel, { className: "flex items-center", children: [
|
|
7385
7569
|
label,
|
|
7386
7570
|
isRequired && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
7387
7571
|
] }),
|
|
7388
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7572
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormControl, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Popover, { open, onOpenChange: setOpen, modal: true, children: [
|
|
7389
7573
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-between", children: [
|
|
7390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7391
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
7392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7393
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7574
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverTrigger, { className: "w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full flex-row items-center justify-start rounded-md", children: field.value ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-row items-center justify-start rounded-md border p-2", children: [
|
|
7575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Avatar, { className: `mr-2 h-6 w-6`, children: [
|
|
7576
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AvatarImage, { src: _optionalChain([field, 'access', _230 => _230.value, 'optionalAccess', _231 => _231.avatar]) }),
|
|
7577
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.AvatarFallback, { children: _optionalChain([field, 'access', _232 => _232.value, 'optionalAccess', _233 => _233.name]) ? _optionalChain([field, 'access', _234 => _234.value, 'optionalAccess', _235 => _235.name, 'access', _236 => _236.split, 'call', _237 => _237(" "), 'access', _238 => _238.map, 'call', _239 => _239((name) => name.charAt(0).toUpperCase())]) : "X" })
|
|
7394
7578
|
] }) }),
|
|
7395
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: _nullishCoalesce(_optionalChain([field, 'access',
|
|
7579
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: _nullishCoalesce(_optionalChain([field, 'access', _240 => _240.value, 'optionalAccess', _241 => _241.name]), () => ( "")) })
|
|
7396
7580
|
] }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-muted-foreground mr-7 flex h-10 w-full flex-row items-center justify-start rounded-md border p-2 text-sm", children: _nullishCoalesce(placeholder, () => ( t(`generic.search.placeholder`, { type: t(`types.users`, { count: 1 }) }))) }) }) }),
|
|
7397
7581
|
field.value && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7398
7582
|
_lucidereact.CircleX,
|
|
@@ -7402,11 +7586,11 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
7402
7586
|
}
|
|
7403
7587
|
)
|
|
7404
7588
|
] }),
|
|
7405
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7589
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.PopoverContent, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.Command, { shouldFilter: false, children: [
|
|
7406
7590
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "relative mb-2 w-full", children: [
|
|
7407
7591
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SearchIcon, { className: "text-muted-foreground absolute top-2.5 left-2.5 h-4 w-4" }),
|
|
7408
7592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7409
|
-
|
|
7593
|
+
_chunkEZK3H6EJjs.Input,
|
|
7410
7594
|
{
|
|
7411
7595
|
placeholder: t(`generic.search.placeholder`, { type: t(`types.users`, { count: 1 }) }),
|
|
7412
7596
|
type: "text",
|
|
@@ -7426,13 +7610,13 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
7426
7610
|
}
|
|
7427
7611
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {})
|
|
7428
7612
|
] }),
|
|
7429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7613
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.CommandList, { children: data.data && data.data.length > 0 && data.data.map((user) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkEZK3H6EJjs.CommandItem, { className: "cursor-pointer", onSelect: () => setUser(user), children: [
|
|
7430
7614
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, UserAvatar, { user, className: `mr-2 h-4 w-4` }),
|
|
7431
7615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "", children: user.name })
|
|
7432
7616
|
] }, user.id)) })
|
|
7433
7617
|
] }) })
|
|
7434
7618
|
] }) }),
|
|
7435
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEZK3H6EJjs.FormMessage, {})
|
|
7436
7620
|
] })
|
|
7437
7621
|
}
|
|
7438
7622
|
) });
|
|
@@ -7447,24 +7631,24 @@ var UserProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ child
|
|
|
7447
7631
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
7448
7632
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
7449
7633
|
const [user, setUser] = _react.useState.call(void 0,
|
|
7450
|
-
dehydratedUser ?
|
|
7634
|
+
dehydratedUser ? _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.User, dehydratedUser) : void 0
|
|
7451
7635
|
);
|
|
7452
7636
|
const breadcrumb = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
7453
7637
|
const response = [];
|
|
7454
|
-
if (hasPermissionToModule({ module:
|
|
7638
|
+
if (hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.User, action: "update" /* Update */ })) {
|
|
7455
7639
|
response.push({
|
|
7456
7640
|
name: t(`generic.settings`),
|
|
7457
7641
|
href: generateUrl({ page: `/settings` })
|
|
7458
7642
|
});
|
|
7459
7643
|
response.push({
|
|
7460
7644
|
name: t(`types.users`, { count: 2 }),
|
|
7461
|
-
href: generateUrl({ page: `/settings`, id:
|
|
7645
|
+
href: generateUrl({ page: `/settings`, id: _chunkWZJDLITGjs.Modules.User.pageUrl })
|
|
7462
7646
|
});
|
|
7463
7647
|
}
|
|
7464
7648
|
if (user)
|
|
7465
7649
|
response.push({
|
|
7466
7650
|
name: `${user.name}${user.isDeleted ? ` (${t(`foundations.user.deleted`)})` : ""}`,
|
|
7467
|
-
href: generateUrl({ page:
|
|
7651
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.User, id: user.id })
|
|
7468
7652
|
});
|
|
7469
7653
|
return response;
|
|
7470
7654
|
}, "breadcrumb");
|
|
@@ -7519,14 +7703,14 @@ var CompanyProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
7519
7703
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
7520
7704
|
const { hasPermissionToModule, hasRole } = useCurrentUserContext();
|
|
7521
7705
|
const [company, setCompany] = _react.useState.call(void 0,
|
|
7522
|
-
dehydratedCompany ?
|
|
7706
|
+
dehydratedCompany ? _chunkWZJDLITGjs.rehydrate.call(void 0, _chunkWZJDLITGjs.Modules.Company, dehydratedCompany) : void 0
|
|
7523
7707
|
);
|
|
7524
7708
|
const breadcrumb = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
7525
7709
|
const response = [];
|
|
7526
7710
|
if (company)
|
|
7527
7711
|
response.push({
|
|
7528
7712
|
name: company.name,
|
|
7529
|
-
href: generateUrl({ page:
|
|
7713
|
+
href: generateUrl({ page: _chunkWZJDLITGjs.Modules.Company })
|
|
7530
7714
|
});
|
|
7531
7715
|
return response;
|
|
7532
7716
|
}, "breadcrumb");
|
|
@@ -7536,9 +7720,9 @@ var CompanyProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, ({ ch
|
|
|
7536
7720
|
};
|
|
7537
7721
|
if (company) response.element = company.name;
|
|
7538
7722
|
const functions = [];
|
|
7539
|
-
if (company && hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) && hasPermissionToModule({ module:
|
|
7723
|
+
if (company && hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) && hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.Company, action: "delete" /* Delete */ }))
|
|
7540
7724
|
functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyDeleter, { company }, "companyDeleter"));
|
|
7541
|
-
if (hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) || hasPermissionToModule({ module:
|
|
7725
|
+
if (hasRole(_chunk4HCRAOS5js.getRoleId.call(void 0, ).Administrator) || hasPermissionToModule({ module: _chunkWZJDLITGjs.Modules.Company, action: "update" /* Update */ })) {
|
|
7542
7726
|
if (company) functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyConfigurationEditor, { company }, "companyConfigurationEditor"));
|
|
7543
7727
|
functions.push(/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompanyEditor, { company, propagateChanges: setCompany }, "companyEditor"));
|
|
7544
7728
|
}
|
|
@@ -7779,5 +7963,9 @@ var useSocketContext = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () =
|
|
|
7779
7963
|
|
|
7780
7964
|
|
|
7781
7965
|
|
|
7782
|
-
|
|
7783
|
-
|
|
7966
|
+
|
|
7967
|
+
|
|
7968
|
+
|
|
7969
|
+
|
|
7970
|
+
exports.TableGeneratorRegistry = TableGeneratorRegistry; exports.tableGeneratorRegistry = tableGeneratorRegistry; exports.usePageUrlGenerator = usePageUrlGenerator; exports.useUrlRewriter = useUrlRewriter; exports.useDataListRetriever = useDataListRetriever; exports.useDebounce = useDebounce; exports.registerTableGenerator = registerTableGenerator; exports.useTableGenerator = useTableGenerator; exports.useCustomD3Graph = useCustomD3Graph; exports.CurrentUserProvider = CurrentUserProvider; exports.useCurrentUserContext = useCurrentUserContext; exports.AddUserToRole = AddUserToRole; exports.UserAvatarEditor = UserAvatarEditor; exports.UserDeleter = UserDeleter; exports.UserEditor = UserEditor; exports.UserMultiSelect = UserMultiSelect; exports.UserReactivator = UserReactivator; exports.UserResentInvitationEmail = UserResentInvitationEmail; exports.UserAvatar = UserAvatar; exports.UserSelector = UserSelector; exports.UserProvider = UserProvider; exports.useUserContext = useUserContext; exports.UserDetails = UserDetails; exports.UserIndexDetails = UserIndexDetails; exports.UserContainer = UserContainer; exports.UserIndexContainer = UserIndexContainer; exports.UsersListContainer = UsersListContainer; exports.AdminUsersList = AdminUsersList; exports.CompanyUsersList = CompanyUsersList; exports.ContributorsList = ContributorsList; exports.RelevantUsersList = RelevantUsersList; exports.RoleUsersList = RoleUsersList; exports.UserListInAdd = UserListInAdd; exports.UsersList = UsersList; exports.UsersListByContentIds = UsersListByContentIds; exports.CompanyDetails = CompanyDetails; exports.AdminCompanyContainer = AdminCompanyContainer; exports.CompanyContainer = CompanyContainer; exports.CompanyConfigurationSecurityForm = CompanyConfigurationSecurityForm; exports.CompanyConfigurationEditor = CompanyConfigurationEditor; exports.CompanyDeleter = CompanyDeleter; exports.CompanyEditor = CompanyEditor; exports.CompaniesList = CompaniesList; exports.CompanyProvider = CompanyProvider; exports.useCompanyContext = useCompanyContext; exports.generateNotificationData = generateNotificationData; exports.NotificationToast = NotificationToast; exports.NotificationMenuItem = NotificationMenuItem; exports.NotificationContextProvider = NotificationContextProvider; exports.useNotificationContext = useNotificationContext; exports.RoleProvider = RoleProvider; exports.useRoleContext = useRoleContext; exports.SharedProvider = SharedProvider; exports.useSharedContext = useSharedContext; exports.CommonProvider = CommonProvider; exports.useCommonContext = useCommonContext; exports.SocketContext = SocketContext; exports.SocketProvider = SocketProvider; exports.useSocketContext = useSocketContext; exports.useNotificationSync = useNotificationSync; exports.usePageTracker = usePageTracker; exports.useSocket = useSocket; exports.Breadcrumb = Breadcrumb2; exports.ContentTitle = ContentTitle; exports.Header = Header; exports.ModeToggleSwitch = ModeToggleSwitch; exports.PageSection = PageSection; exports.RecentPagesNavigator = RecentPagesNavigator; exports.PageContainer = PageContainer; exports.ReactMarkdownContainer = ReactMarkdownContainer; exports.TabsContainer = TabsContainer; exports.AttributeElement = AttributeElement; exports.AllowedUsersDetails = AllowedUsersDetails; exports.ErrorDetails = ErrorDetails; exports.errorToast = errorToast; exports.BlockNoteEditorContainer = BlockNoteEditorContainer; exports.CommonAssociationTrigger = CommonAssociationTrigger; exports.CommonAssociationCommandDialog = CommonAssociationCommandDialog; exports.triggerAssociationToast = triggerAssociationToast; exports.CommonDeleter = CommonDeleter; exports.CommonEditorButtons = CommonEditorButtons; exports.CommonEditorHeader = CommonEditorHeader; exports.CommonEditorTrigger = CommonEditorTrigger; exports.DatePickerPopover = DatePickerPopover; exports.DateRangeSelector = DateRangeSelector; exports.useFileUpload = useFileUpload; exports.FileUploader = FileUploader; exports.FileUploaderContent = FileUploaderContent; exports.FileUploaderItem = FileUploaderItem; exports.FileInput = FileInput; exports.FormCheckbox = FormCheckbox; exports.FormContainerGeneric = FormContainerGeneric; exports.FormDate = FormDate; exports.FormDateTime = FormDateTime; exports.FormInput = FormInput; exports.PasswordInput = PasswordInput; exports.FormPassword = FormPassword; exports.FormPlaceAutocomplete = FormPlaceAutocomplete; exports.FormSelect = FormSelect; exports.FormSlider = FormSlider; exports.FormSwitch = FormSwitch; exports.FormTextarea = FormTextarea; exports.FormFeatures = FormFeatures; exports.PageContainerContentDetails = PageContainerContentDetails; exports.PageContentContainer = PageContentContainer; exports.cellComponent = cellComponent; exports.cellDate = cellDate; exports.cellId = cellId; exports.cellLink = cellLink; exports.cellUrl = cellUrl; exports.JsonApiContext = JsonApiContext; exports.useJsonApiConfig = useJsonApiConfig; exports.useJsonApiConfigOptional = useJsonApiConfigOptional; exports.JsonApiProvider = JsonApiProvider; exports.useJsonApiGet = useJsonApiGet; exports.useJsonApiMutation = useJsonApiMutation; exports.useRehydration = useRehydration; exports.useRehydrationList = useRehydrationList; exports.useRoleTableStructure = useRoleTableStructure; exports.useUserSearch = useUserSearch; exports.useUserTableStructure = useUserTableStructure; exports.useContentTableStructure = useContentTableStructure; exports.ContentTableSearch = ContentTableSearch; exports.ContentListTable = ContentListTable; exports.AuthContainer = AuthContainer; exports.LandingComponent = LandingComponent; exports.AcceptInvitation = AcceptInvitation; exports.ActivateAccount = ActivateAccount; exports.Cookies = Cookies; exports.ForgotPassword = ForgotPassword; exports.Login = Login; exports.Logout = Logout; exports.RefreshUser = RefreshUser; exports.ResetPassword = ResetPassword; exports.ContentsList = ContentsList; exports.ContentsListById = ContentsListById; exports.RelevantContentsList = RelevantContentsList; exports.NotificationErrorBoundary = NotificationErrorBoundary; exports.NotificationsList = NotificationsList; exports.NotificationsListContainer = NotificationsListContainer; exports.NotificationModal = NotificationModal; exports.PushNotificationProvider = PushNotificationProvider; exports.RoleDetails = RoleDetails; exports.RoleContainer = RoleContainer; exports.FormRoles = FormRoles; exports.RemoveUserFromRole = RemoveUserFromRole; exports.UserRoleAdd = UserRoleAdd; exports.RolesList = RolesList; exports.UserRolesList = UserRolesList;
|
|
7971
|
+
//# sourceMappingURL=chunk-FPMPTR7S.js.map
|