aq-fe-framework 0.1.713 → 0.1.715

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.
@@ -1,3 +1,15 @@
1
+ import {
2
+ baseAxios_default,
3
+ createBaseApi,
4
+ useConfig,
5
+ useEditableRows,
6
+ useMyDevice,
7
+ useMyReactMutation,
8
+ useMyReactQuery,
9
+ useMyRouter,
10
+ useQ_AQ_GetAQModule,
11
+ useQ_SkillCenter_GetAll
12
+ } from "./chunk-G4GAKTUO.mjs";
1
13
  import {
2
14
  createGenericStore,
3
15
  useStore_Permission
@@ -17,6 +29,9 @@ import {
17
29
  utils_mantineReactTable_sortColumnsByKeyOrder,
18
30
  utils_pdf_download
19
31
  } from "./chunk-2B2FKBKX.mjs";
32
+ import {
33
+ utils_notification_show
34
+ } from "./chunk-7ZCOFATU.mjs";
20
35
  import {
21
36
  baseColumns
22
37
  } from "./chunk-7PUDC2WF.mjs";
@@ -31,21 +46,6 @@ import {
31
46
  import {
32
47
  enum_daysOfWeek
33
48
  } from "./chunk-K6S7R6LU.mjs";
34
- import {
35
- baseAxios_default,
36
- createBaseApi,
37
- useConfig,
38
- useEditableRows,
39
- useMyDevice,
40
- useMyReactMutation,
41
- useMyReactQuery,
42
- useMyRouter,
43
- useQ_AQ_GetAQModule,
44
- useQ_SkillCenter_GetAll
45
- } from "./chunk-G4GAKTUO.mjs";
46
- import {
47
- utils_notification_show
48
- } from "./chunk-7ZCOFATU.mjs";
49
49
  import {
50
50
  __objRest,
51
51
  __spreadProps,
@@ -9346,7 +9346,7 @@ function Permission_ViewCheckMenuPermission({
9346
9346
  import { Grid as Grid3, Stack as Stack4 } from "@mantine/core";
9347
9347
  import { useState as useState13 } from "react";
9348
9348
  import { jsx as jsx86, jsxs as jsxs45 } from "react/jsx-runtime";
9349
- function Feat_accessControl({ menuData }) {
9349
+ function Feat_accessControl({ menuData: menuData2 }) {
9350
9350
  const accountIdState = useState13();
9351
9351
  const memuPermissionState = useState13();
9352
9352
  return /* @__PURE__ */ jsxs45(Grid3, { children: [
@@ -9365,7 +9365,7 @@ function Feat_accessControl({ menuData }) {
9365
9365
  roleOrUserId: parseInt(accountIdState[0]),
9366
9366
  value: memuPermissionState[0],
9367
9367
  onChange: memuPermissionState[1],
9368
- menuDataRoot: menuData
9368
+ menuDataRoot: menuData2
9369
9369
  }
9370
9370
  ),
9371
9371
  /* @__PURE__ */ jsx86(
@@ -9450,7 +9450,7 @@ function Adapter_RoleTable(_a) {
9450
9450
  import { Grid as Grid4, Stack as Stack5 } from "@mantine/core";
9451
9451
  import { useState as useState14 } from "react";
9452
9452
  import { jsx as jsx89, jsxs as jsxs46 } from "react/jsx-runtime";
9453
- function Feat_accessControlLevel({ menuData }) {
9453
+ function Feat_accessControlLevel({ menuData: menuData2 }) {
9454
9454
  const accountIdState = useState14();
9455
9455
  const memuPermissionState = useState14();
9456
9456
  return /* @__PURE__ */ jsxs46(Grid4, { children: [
@@ -9468,7 +9468,7 @@ function Feat_accessControlLevel({ menuData }) {
9468
9468
  roleOrUserId: parseInt(accountIdState[0]),
9469
9469
  value: memuPermissionState[0],
9470
9470
  onChange: memuPermissionState[1],
9471
- menuDataRoot: menuData
9471
+ menuDataRoot: menuData2
9472
9472
  }
9473
9473
  ),
9474
9474
  /* @__PURE__ */ jsx89(
@@ -14442,7 +14442,7 @@ function Usecase_PageContentTable(_a) {
14442
14442
  // src/modules-features/admin/core/pageContent/Feat_PageContentTable.tsx
14443
14443
  import { useMemo as useMemo32 } from "react";
14444
14444
  import { jsx as jsx192 } from "react/jsx-runtime";
14445
- function Feat_PageContentTable({ menuData }) {
14445
+ function Feat_PageContentTable({ menuData: menuData2 }) {
14446
14446
  const query = useMyReactQuery({
14447
14447
  queryKey: ["pages"],
14448
14448
  axiosFn: () => service_page.getAll()
@@ -14457,13 +14457,13 @@ function Feat_PageContentTable({ menuData }) {
14457
14457
  query.data.forEach((item) => {
14458
14458
  labelMap.set(item.id, item);
14459
14459
  });
14460
- return extractLinkedMenuItems(menuData).map((item) => {
14460
+ return extractLinkedMenuItems(menuData2).map((item) => {
14461
14461
  if (labelMap.get(item.pageId) == void 0) return void 0;
14462
14462
  return __spreadProps(__spreadValues({}, labelMap.get(item.pageId)), {
14463
14463
  name: item.label
14464
14464
  });
14465
14465
  });
14466
- }, [query.data, menuData]).filter(Boolean);
14466
+ }, [query.data, menuData2]).filter(Boolean);
14467
14467
  return /* @__PURE__ */ jsx192(
14468
14468
  Usecase_PageContentTable,
14469
14469
  {
@@ -14513,7 +14513,7 @@ function F_pageContentConfig_Save({ menuValues }) {
14513
14513
 
14514
14514
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_ReadMenu.tsx
14515
14515
  import { jsx as jsx195, jsxs as jsxs109 } from "react/jsx-runtime";
14516
- function F_pageContentConfig_ReadMenu({ menuData }) {
14516
+ function F_pageContentConfig_ReadMenu({ menuData: menuData2 }) {
14517
14517
  const pageContentQuery = useMyReactQuery({
14518
14518
  queryKey: ["pageContents"],
14519
14519
  axiosFn: () => service_page.getAll()
@@ -14525,8 +14525,8 @@ function F_pageContentConfig_ReadMenu({ menuData }) {
14525
14525
  }));
14526
14526
  };
14527
14527
  const flattenMenu = useMemo33(
14528
- () => extractLinkedMenuItems(menuData || []),
14529
- [menuData]
14528
+ () => extractLinkedMenuItems(menuData2 || []),
14529
+ [menuData2]
14530
14530
  );
14531
14531
  const sortedPageContents = useMemo33(() => {
14532
14532
  if (!pageContentQuery.data) return [];
@@ -14609,8 +14609,8 @@ function F_pageContentConfig_ReadMenu({ menuData }) {
14609
14609
 
14610
14610
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig.tsx
14611
14611
  import { jsx as jsx196 } from "react/jsx-runtime";
14612
- function F_pageContentConfig({ menuData }) {
14613
- return /* @__PURE__ */ jsx196(F_pageContentConfig_ReadMenu, { menuData });
14612
+ function F_pageContentConfig({ menuData: menuData2 }) {
14613
+ return /* @__PURE__ */ jsx196(F_pageContentConfig_ReadMenu, { menuData: menuData2 });
14614
14614
  }
14615
14615
 
14616
14616
  // src/modules-features/admin/core/pageContentConfig/F_pageContentConfig_DeleteDescription.tsx
@@ -16355,6 +16355,43 @@ function Feat_Authenticate_Logout({ redirectURL = "/auth/login" }) {
16355
16355
  }, leftSection: /* @__PURE__ */ jsx234(IconLogout, {}), fullWidth: true, justify: "start", variant: "subtle", children: "\u0110\u0103ng xu\u1EA5t" });
16356
16356
  }
16357
16357
 
16358
+ // src/data/menuData.ts
16359
+ var menuData = [
16360
+ {
16361
+ label: "Qu\u1EA3n l\xED h\u1EC7 th\u1ED1ng",
16362
+ links: [
16363
+ { pageId: 1, name: "Account management", label: "Qu\u1EA3n l\xED t\xE0i kho\u1EA3n", link: "accountManagement" },
16364
+ { pageId: 100009, name: "Account group management", label: "Qu\u1EA3n l\xED nh\xF3m t\xE0i kho\u1EA3n", link: "roleManagement" },
16365
+ { pageId: 2, name: "Access control level", label: "Ph\xE2n quy\u1EC1n c\u1EA5p \u0111\u01A1n v\u1ECB", link: "accessControlLevel" },
16366
+ { pageId: 3, name: "Access control", label: "Ph\xE2n quy\u1EC1n s\u1EED d\u1EE5ng", link: "accessControl" },
16367
+ { pageId: 4, name: "Security regulations", label: "Quy \u0111\u1ECBnh an to\xE0n/ b\u1EA3o m\u1EADt th\xF4ng tin", link: "securityPolicyDocs" },
16368
+ { pageId: 5, name: "System updates", label: "Th\xF4ng tin x\xE2y d\u1EF1ng, c\u1EA3i ti\u1EBFn, b\u1EA3o tr\xEC h\u1EC7 th\u1ED1ng", link: "systemUpdateDocs" },
16369
+ { pageId: 6, name: "User guide", label: "T\xE0i li\u1EC7u h\u01B0\u1EDBng d\u1EABn s\u1EED d\u1EE5ng", link: "userGuideDocs" }
16370
+ ]
16371
+ },
16372
+ {
16373
+ label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh",
16374
+ links: [
16375
+ { pageId: 7, name: "Organizational regulations", label: "V\u0103n b\u1EA3n - Quy \u0111\u1ECBnh t\u1ED5 ch\u1EE9c", link: "organizationPolicyDocs" },
16376
+ { pageId: 8, name: "Workflow process", label: "Quy tr\xECnh x\u1EED l\xFD c\xF4ng vi\u1EC7c", link: "workflowProcessDocs" },
16377
+ { pageId: 9, name: "Form templates", label: "T\xE0i li\u1EC7u bi\u1EC3u m\u1EABu", link: "formTemplateDocs" }
16378
+ ]
16379
+ },
16380
+ {
16381
+ label: "Danh m\u1EE5c h\u1EC7 th\u1ED1ng",
16382
+ links: [
16383
+ { pageId: 100001, name: "Document categories", label: "Danh m\u1EE5c lo\u1EA1i v\u0103n b\u1EA3n", link: "documentCategories" },
16384
+ { pageId: 100011, name: "Code config", label: "Danh m\u1EE5c b\u1ED9 \u0111\u1EBFm", link: "codeFormula" },
16385
+ { pageId: 100002, name: "mailConfig", label: "Danh m\u1EE5c c\u1EA5u h\xECnh mail", link: "mailConfig" },
16386
+ { pageId: 100010, name: "Mail template", label: "M\u1EABu Mail th\xF4ng b\xE1o", link: "mailTemplate" },
16387
+ { pageId: 100003, name: "pageContentConfig", label: "Danh m\u1EE5c Page Content", link: "pageContent" },
16388
+ { pageId: 100006, name: "Department list", label: "Danh m\u1EE5c \u0111\u01A1n v\u1ECB", link: "departmentList" },
16389
+ { pageId: 100007, name: "Academic year", label: "Danh m\u1EE5c n\u0103m h\u1ECDc", link: "academicYear" },
16390
+ { pageId: 100004, name: "moduleConfig", label: "C\u1EA5u h\xECnh th\xF4ng tin ch\u1EE7 qu\u1EA3n", link: "moduleConfig" }
16391
+ ]
16392
+ }
16393
+ ];
16394
+
16358
16395
  // src/modules-features/authenticate/Feat_Authenticate_SSOHandler.tsx
16359
16396
  import { useSearchParams } from "next/navigation";
16360
16397
  import { useEffect as useEffect33, useState as useState27 } from "react";
@@ -16402,7 +16439,7 @@ function Feat_Authenticate_SSOHandler({
16402
16439
  }
16403
16440
  }, [config3.data]);
16404
16441
  async function loginSSO(studentCode2, token2) {
16405
- var _a;
16442
+ var _a, _b, _c;
16406
16443
  try {
16407
16444
  const body = new URLSearchParams();
16408
16445
  body.set("Authorization", `Bearer ${token2}`);
@@ -16419,7 +16456,10 @@ function Feat_Authenticate_SSOHandler({
16419
16456
  const data2 = await res.json();
16420
16457
  if ((data2 == null ? void 0 : data2.isSuccess) && ((_a = data2 == null ? void 0 : data2.data) == null ? void 0 : _a.token)) {
16421
16458
  manager.onLoginSuccessSaveStore({ data: data2.data });
16422
- onSuccessNavigateFollowRole(data2.data.roleIds || []);
16459
+ const firstPageIdCanView = (_c = (_b = data2.data.permissions) == null ? void 0 : _b.find((element) => element.isRead)) == null ? void 0 : _c.pageId;
16460
+ const flatmenu = extractLinkedMenuItems(menuData);
16461
+ const first = flatmenu.find((item) => item.pageId == firstPageIdCanView);
16462
+ onSuccessNavigateFollowRole(data2.data || [], first);
16423
16463
  } else {
16424
16464
  setMessError("\u0110\u0103ng nh\u1EADp kh\xF4ng th\xE0nh c\xF4ng");
16425
16465
  }
@@ -70,16 +70,16 @@ import {
70
70
  useHeaderMegaMenuStore,
71
71
  useS_ButtonImport,
72
72
  useStore_BasicAppShell
73
- } from "../chunk-3TKNSYEK.mjs";
73
+ } from "../chunk-MJL6G2SF.mjs";
74
+ import "../chunk-G4GAKTUO.mjs";
74
75
  import "../chunk-SUH3FFFV.mjs";
75
76
  import "../chunk-2B2FKBKX.mjs";
77
+ import "../chunk-7ZCOFATU.mjs";
78
+ import "../chunk-WZ6PXGGC.mjs";
76
79
  import "../chunk-7PUDC2WF.mjs";
77
80
  import "../chunk-EWDS5IOF.mjs";
78
81
  import "../chunk-IUTUR43V.mjs";
79
82
  import "../chunk-K6S7R6LU.mjs";
80
- import "../chunk-G4GAKTUO.mjs";
81
- import "../chunk-7ZCOFATU.mjs";
82
- import "../chunk-WZ6PXGGC.mjs";
83
83
  import "../chunk-FWCSY2DS.mjs";
84
84
  export {
85
85
  AQButtonCreateByImportFile,
@@ -25,16 +25,16 @@ import {
25
25
  MyStatsCard,
26
26
  MyTextInput2 as MyTextInput,
27
27
  MyWeeklySessionSchedulerPicker
28
- } from "../chunk-3TKNSYEK.mjs";
28
+ } from "../chunk-MJL6G2SF.mjs";
29
+ import "../chunk-G4GAKTUO.mjs";
29
30
  import "../chunk-SUH3FFFV.mjs";
30
31
  import "../chunk-2B2FKBKX.mjs";
32
+ import "../chunk-7ZCOFATU.mjs";
33
+ import "../chunk-WZ6PXGGC.mjs";
31
34
  import "../chunk-7PUDC2WF.mjs";
32
35
  import "../chunk-EWDS5IOF.mjs";
33
36
  import "../chunk-IUTUR43V.mjs";
34
37
  import "../chunk-K6S7R6LU.mjs";
35
- import "../chunk-G4GAKTUO.mjs";
36
- import "../chunk-7ZCOFATU.mjs";
37
- import "../chunk-WZ6PXGGC.mjs";
38
38
  import "../chunk-FWCSY2DS.mjs";
39
39
  export {
40
40
  DroppablePlaceholder,
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  MyModalDelete
3
- } from "../chunk-3TKNSYEK.mjs";
3
+ } from "../chunk-MJL6G2SF.mjs";
4
+ import {
5
+ useMyReactMutation
6
+ } from "../chunk-G4GAKTUO.mjs";
4
7
  import "../chunk-SUH3FFFV.mjs";
5
8
  import "../chunk-2B2FKBKX.mjs";
9
+ import "../chunk-7ZCOFATU.mjs";
10
+ import "../chunk-WZ6PXGGC.mjs";
6
11
  import "../chunk-7PUDC2WF.mjs";
7
12
  import "../chunk-EWDS5IOF.mjs";
8
13
  import "../chunk-IUTUR43V.mjs";
9
14
  import "../chunk-K6S7R6LU.mjs";
10
- import {
11
- useMyReactMutation
12
- } from "../chunk-G4GAKTUO.mjs";
13
- import "../chunk-7ZCOFATU.mjs";
14
- import "../chunk-WZ6PXGGC.mjs";
15
15
  import {
16
16
  __objRest,
17
17
  __spreadValues
@@ -963,8 +963,19 @@ interface I$1 {
963
963
  }
964
964
  declare function Feat_Authenticate_Logout({ redirectURL }: I$1): react_jsx_runtime.JSX.Element;
965
965
 
966
+ interface ISignInRes {
967
+ workingUnitId?: number;
968
+ userName?: string;
969
+ userId?: number;
970
+ userFullName?: string;
971
+ token?: string;
972
+ roleIds?: number[];
973
+ permissions?: IPagePermission[];
974
+ }
975
+
966
976
  interface Feat_Authenticate_SSOHandlerProps {
967
- onSuccessNavigateFollowRole: (rolesIds: number[]) => void;
977
+ onSuccessNavigateFollowRole: (data: ISignInRes, firstMenuPermission?: I_BasicAppShell_LinkItem) => void;
978
+ menuData?: I_BasicAppShell_LinkItem[];
968
979
  }
969
980
  declare function Feat_Authenticate_SSOHandler({ onSuccessNavigateFollowRole }: Feat_Authenticate_SSOHandlerProps): react_jsx_runtime.JSX.Element;
970
981
 
@@ -115,16 +115,16 @@ import {
115
115
  MailTemplateDeleteButton,
116
116
  useS_authenticate,
117
117
  useS_moduleConfig
118
- } from "../chunk-3TKNSYEK.mjs";
118
+ } from "../chunk-MJL6G2SF.mjs";
119
+ import "../chunk-G4GAKTUO.mjs";
119
120
  import "../chunk-SUH3FFFV.mjs";
120
121
  import "../chunk-2B2FKBKX.mjs";
122
+ import "../chunk-7ZCOFATU.mjs";
123
+ import "../chunk-WZ6PXGGC.mjs";
121
124
  import "../chunk-7PUDC2WF.mjs";
122
125
  import "../chunk-EWDS5IOF.mjs";
123
126
  import "../chunk-IUTUR43V.mjs";
124
127
  import "../chunk-K6S7R6LU.mjs";
125
- import "../chunk-G4GAKTUO.mjs";
126
- import "../chunk-7ZCOFATU.mjs";
127
- import "../chunk-WZ6PXGGC.mjs";
128
128
  import "../chunk-FWCSY2DS.mjs";
129
129
  export {
130
130
  AcademicYearsCreate,
@@ -37,15 +37,15 @@ import {
37
37
  utils_time_getHourMinuteFromString,
38
38
  utils_validator_validateCode
39
39
  } from "../chunk-2B2FKBKX.mjs";
40
+ import {
41
+ utils_notification_show
42
+ } from "../chunk-7ZCOFATU.mjs";
40
43
  import {
41
44
  U0DateToDDMMYYYString,
42
45
  utils_date_dateToDDMMYYYString,
43
46
  utils_date_formatToDateTimeStartEnd,
44
47
  utils_date_getHHmm
45
48
  } from "../chunk-EWDS5IOF.mjs";
46
- import {
47
- utils_notification_show
48
- } from "../chunk-7ZCOFATU.mjs";
49
49
  import "../chunk-FWCSY2DS.mjs";
50
50
  export {
51
51
  U0DateToDDMMYYYString,
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "types": "./dist/types/index.d.mts"
51
51
  }
52
52
  },
53
- "version": "0.1.713",
53
+ "version": "0.1.715",
54
54
  "private": false,
55
55
  "files": [
56
56
  "dist"