aq-fe-framework 0.1.207 → 0.1.209

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.
@@ -399,6 +399,7 @@ function MyActionIconDelete(_a) {
399
399
  return;
400
400
  }
401
401
  queryClient.invalidateQueries();
402
+ loadingState[1](false);
402
403
  utils_notification_show({ crudType: "delete" });
403
404
  disc[1].close();
404
405
  },
@@ -66,7 +66,7 @@ import {
66
66
  useS_BasicAppShell,
67
67
  useS_ButtonImport,
68
68
  utils_layout_getItemsWithoutLinks
69
- } from "../chunk-6AI447P3.mjs";
69
+ } from "../chunk-P5ODJNRD.mjs";
70
70
  import "../chunk-YYVURSQD.mjs";
71
71
  import "../chunk-Y3YGC5IH.mjs";
72
72
  import "../chunk-5U2JSHSJ.mjs";
@@ -382,8 +382,15 @@ declare function F_core64229_Read({ emailModule }: {
382
382
  })[];
383
383
  }): react_jsx_runtime.JSX.Element | "Đang tải";
384
384
 
385
- declare function F_core71678(): react_jsx_runtime.JSX.Element;
385
+ interface IProps {
386
+ isRequireSkillCenter?: boolean;
387
+ }
388
+ declare function F_core71678({ isRequireSkillCenter }: IProps): react_jsx_runtime.JSX.Element;
386
389
 
390
+ interface IUserSkillCenters$1 extends IBaseEntity {
391
+ userId?: number;
392
+ skillCenterId?: number;
393
+ }
387
394
  interface IRoles extends IBaseEntity {
388
395
  }
389
396
  interface I_core71678_Read extends IBaseEntity {
@@ -391,6 +398,7 @@ interface I_core71678_Read extends IBaseEntity {
391
398
  fullName?: string;
392
399
  email?: string;
393
400
  roles?: IRoles[];
401
+ userSkillCenters?: IUserSkillCenters$1[];
394
402
  }
395
403
  declare function F_core71678_Read(): react_jsx_runtime.JSX.Element | "Loading...";
396
404
 
@@ -25,7 +25,7 @@ import {
25
25
  useS_BasicAppShell,
26
26
  useS_authenticate,
27
27
  utils_layout_getItemsWithoutLinks
28
- } from "../chunk-6AI447P3.mjs";
28
+ } from "../chunk-P5ODJNRD.mjs";
29
29
  import {
30
30
  baseAxios_default,
31
31
  useQ_AQ_GetAQModule,
@@ -2457,6 +2457,9 @@ function F_core64229() {
2457
2457
  return /* @__PURE__ */ jsx46(F_core64229_Read, { emailModule: utils_converter_enumToSelectOptions(ENUM_EMAILCONFIG_MODULE) });
2458
2458
  }
2459
2459
 
2460
+ // src/modules-features/admin/core/core71678/F_core71678.tsx
2461
+ import { useEffect as useEffect7 } from "react";
2462
+
2460
2463
  // src/modules-features/admin/core/core71678/F_core71678_Read.tsx
2461
2464
  import { Button as Button2, Group as Group3 } from "@mantine/core";
2462
2465
  import { IconShield } from "@tabler/icons-react";
@@ -2572,10 +2575,22 @@ function F_core71678_ChangePermission({ user }) {
2572
2575
  // src/modules-features/admin/core/core71678/F_core71678_Create.tsx
2573
2576
  import { MultiSelect } from "@mantine/core";
2574
2577
  import { useForm as useForm16 } from "@mantine/form";
2578
+
2579
+ // src/modules-features/admin/core/core71678/useS_core71678.ts
2580
+ var useStore3 = createGenericStore({
2581
+ initialState: {}
2582
+ });
2583
+ function useS_core71678() {
2584
+ const store = useStore3();
2585
+ return __spreadValues({}, store);
2586
+ }
2587
+
2588
+ // src/modules-features/admin/core/core71678/F_core71678_Create.tsx
2575
2589
  import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
2576
2590
  var ENDPOINT2 = "/Account/create";
2577
2591
  function F_core71678_Create() {
2578
2592
  var _a, _b;
2593
+ const store = useS_core71678();
2579
2594
  const skillCenter_getAll_query = useQ_SkillCenter_GetAll();
2580
2595
  const form = useForm16({
2581
2596
  initialValues: {
@@ -2591,7 +2606,6 @@ function F_core71678_Create() {
2591
2606
  }
2592
2607
  });
2593
2608
  async function handleSubmit() {
2594
- const formValues = form.getValues();
2595
2609
  return await baseAxios_default.post(ENDPOINT2, __spreadProps(__spreadValues({}, form.getValues()), {
2596
2610
  passwordHash: "",
2597
2611
  id: 0,
@@ -2615,7 +2629,7 @@ function F_core71678_Create() {
2615
2629
  /* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "H\u1ECD v\xE0 t\xEAn" }, form.getInputProps("fullName"))),
2616
2630
  /* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "Email" }, form.getInputProps("email"))),
2617
2631
  /* @__PURE__ */ jsx48(MyTextInput, __spreadValues({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }, form.getInputProps("phoneNumber"))),
2618
- skillCenter_getAll_query.data && /* @__PURE__ */ jsx48(
2632
+ skillCenter_getAll_query.data && store.state.isRequireSkillCenter == true && /* @__PURE__ */ jsx48(
2619
2633
  MultiSelect,
2620
2634
  {
2621
2635
  label: "Trung t\xE2m k\u1EF9 n\u0103ng",
@@ -2667,6 +2681,7 @@ import { useState as useState5 } from "react";
2667
2681
  import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
2668
2682
  function F_core71678_Update({ user }) {
2669
2683
  var _a, _b, _c, _d;
2684
+ const store = useS_core71678();
2670
2685
  const skillCenter_getAll_query = useQ_SkillCenter_GetAll();
2671
2686
  const form = useForm17({
2672
2687
  initialValues: __spreadProps(__spreadValues({}, user), {
@@ -2677,7 +2692,6 @@ function F_core71678_Update({ user }) {
2677
2692
  (_b = user.userSkillCenters) != null ? _b : []
2678
2693
  );
2679
2694
  return /* @__PURE__ */ jsx50(MyActionIconUpdate, { form, onSubmit: async (values) => {
2680
- const formValues = form.getValues();
2681
2695
  return await baseAxios_default.post(
2682
2696
  "/Account/update",
2683
2697
  __spreadProps(__spreadValues({}, values), {
@@ -2696,7 +2710,7 @@ function F_core71678_Update({ user }) {
2696
2710
  /* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ label: "H\u1ECD v\xE0 t\xEAn" }, form.getInputProps("fullName"))),
2697
2711
  /* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ label: "Email" }, form.getInputProps("email"))),
2698
2712
  /* @__PURE__ */ jsx50(MyTextInput, __spreadValues({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i" }, form.getInputProps("phoneNumber"))),
2699
- skillCenter_getAll_query.data && /* @__PURE__ */ jsx50(
2713
+ skillCenter_getAll_query.data && store.state.isRequireSkillCenter == true && /* @__PURE__ */ jsx50(
2700
2714
  MultiSelect2,
2701
2715
  {
2702
2716
  label: "Trung t\xE2m k\u1EF9 n\u0103ng",
@@ -2741,20 +2755,23 @@ function F_core71678_Update({ user }) {
2741
2755
  import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
2742
2756
  var ENDPOINT4 = "/Account/GetAdminAccount";
2743
2757
  function F_core71678_Read() {
2758
+ var _a;
2759
+ const store = useS_core71678();
2744
2760
  const router = useRouter();
2745
2761
  const AllUserQuery = useQuery13({
2746
2762
  queryKey: ["F_core71678_Read"],
2747
2763
  queryFn: async () => {
2748
- var _a;
2764
+ var _a2;
2749
2765
  const result = await baseAxios_default.get(
2750
2766
  ENDPOINT4,
2751
2767
  { params: { page: 5, pageNumber: 1 } }
2752
2768
  );
2753
- return ((_a = result.data) == null ? void 0 : _a.data) || [];
2769
+ return ((_a2 = result.data) == null ? void 0 : _a2.data) || [];
2754
2770
  }
2755
2771
  });
2756
- const columns = useMemo11(
2757
- () => [
2772
+ const columns = useMemo11(() => {
2773
+ var _a2;
2774
+ const baseColumns = [
2758
2775
  {
2759
2776
  header: "T\xEAn t\xE0i kho\u1EA3n",
2760
2777
  accessorKey: "userName"
@@ -2771,9 +2788,18 @@ function F_core71678_Read() {
2771
2788
  header: "Quy\u1EC1n",
2772
2789
  accessorFn: (row) => /* @__PURE__ */ jsx51(F_core71678_ChangePermission, { user: row })
2773
2790
  }
2774
- ],
2775
- []
2776
- );
2791
+ ];
2792
+ if (((_a2 = store.state) == null ? void 0 : _a2.isRequireSkillCenter) === true) {
2793
+ baseColumns.splice(3, 0, {
2794
+ header: "Trung t\xE2m k\u1EF9 n\u0103ng",
2795
+ accessorFn: (row) => {
2796
+ var _a3;
2797
+ return (_a3 = row.userSkillCenters) == null ? void 0 : _a3.map((item) => item.name + ", ");
2798
+ }
2799
+ });
2800
+ }
2801
+ return baseColumns;
2802
+ }, [(_a = store.state) == null ? void 0 : _a.isRequireSkillCenter]);
2777
2803
  if (AllUserQuery.isLoading) return "Loading...";
2778
2804
  return /* @__PURE__ */ jsx51(
2779
2805
  MyDataTable,
@@ -2808,7 +2834,11 @@ function F_core71678_Read() {
2808
2834
 
2809
2835
  // src/modules-features/admin/core/core71678/F_core71678.tsx
2810
2836
  import { jsx as jsx52 } from "react/jsx-runtime";
2811
- function F_core71678() {
2837
+ function F_core71678({ isRequireSkillCenter = false }) {
2838
+ const store = useS_core71678();
2839
+ useEffect7(() => {
2840
+ store.setProperty("isRequireSkillCenter", isRequireSkillCenter);
2841
+ }, []);
2812
2842
  return /* @__PURE__ */ jsx52(F_core71678_Read, {});
2813
2843
  }
2814
2844
 
@@ -3030,7 +3060,7 @@ import { Grid as Grid4, Paper as Paper7, ScrollArea as ScrollArea4 } from "@mant
3030
3060
  // src/modules-features/admin/core/core83092/F_core83092_ReadUser.tsx
3031
3061
  import { Container as Container2 } from "@mantine/core";
3032
3062
  import { useQuery as useQuery15 } from "@tanstack/react-query";
3033
- import { useEffect as useEffect7, useMemo as useMemo13, useState as useState6 } from "react";
3063
+ import { useEffect as useEffect8, useMemo as useMemo13, useState as useState6 } from "react";
3034
3064
  import { jsx as jsx58 } from "react/jsx-runtime";
3035
3065
  function F_core83092_ReadUser() {
3036
3066
  const store = useS_core83092();
@@ -3054,11 +3084,11 @@ function F_core83092_ReadUser() {
3054
3084
  setRowSelection({ [rowId]: true });
3055
3085
  store.setProperty("roleId", parseInt(rowId));
3056
3086
  };
3057
- useEffect7(() => {
3087
+ useEffect8(() => {
3058
3088
  if (store.state.roleId == 0) return;
3059
3089
  setRowSelection({ [store.state.roleId]: true });
3060
3090
  }, [store.state.roleId]);
3061
- useEffect7(() => {
3091
+ useEffect8(() => {
3062
3092
  if (!query.data) return;
3063
3093
  store.setProperty("roleId", query.data[0].id);
3064
3094
  }, [query.data]);
@@ -3099,7 +3129,7 @@ function useQ_core83092_Account_GetAdminAccount() {
3099
3129
 
3100
3130
  // src/modules-features/admin/core/core83092/F_core83092_Save.tsx
3101
3131
  import { useMutation as useMutation4 } from "@tanstack/react-query";
3102
- import { useEffect as useEffect8, useState as useState7 } from "react";
3132
+ import { useEffect as useEffect9, useState as useState7 } from "react";
3103
3133
  import { jsx as jsx59 } from "react/jsx-runtime";
3104
3134
  function F_core83092_Save() {
3105
3135
  const store = useS_core83092();
@@ -3122,7 +3152,7 @@ function F_core83092_Save() {
3122
3152
  }
3123
3153
  });
3124
3154
  }
3125
- useEffect8(() => {
3155
+ useEffect9(() => {
3126
3156
  if (!store.state.rolePermissions || store.state.rolePermissions.length == 0) {
3127
3157
  disable[1](true);
3128
3158
  return;
@@ -3136,7 +3166,7 @@ function F_core83092_Save() {
3136
3166
  import { Checkbox as Checkbox2, Flex as Flex2, ScrollArea as ScrollArea3, Table as Table3, Text as Text2 } from "@mantine/core";
3137
3167
  import { IconEdit as IconEdit2, IconEyeUp as IconEyeUp2, IconFileExport as IconFileExport2, IconPlus as IconPlus2, IconPrinter as IconPrinter2, IconTrash as IconTrash2 } from "@tabler/icons-react";
3138
3168
  import { useQuery as useQuery16 } from "@tanstack/react-query";
3139
- import React3, { useEffect as useEffect9, useState as useState8 } from "react";
3169
+ import React3, { useEffect as useEffect10, useState as useState8 } from "react";
3140
3170
  import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
3141
3171
  var title2 = "Danh s\xE1ch ch\u1EE9c n\u0103ng";
3142
3172
  function F_core83092_ViewMenuPermissions({ menuData: menuData2 }) {
@@ -3144,10 +3174,10 @@ function F_core83092_ViewMenuPermissions({ menuData: menuData2 }) {
3144
3174
  const store = useS_core83092();
3145
3175
  const query = useGetUserPermission2({ menuData: menuData2 });
3146
3176
  const list = useState8([]);
3147
- useEffect9(() => {
3177
+ useEffect10(() => {
3148
3178
  list[1](groupToTwoLevels(menuData2));
3149
3179
  }, []);
3150
- useEffect9(() => {
3180
+ useEffect10(() => {
3151
3181
  if (!query.data) return;
3152
3182
  store.setProperty("rolePermissions", query.data);
3153
3183
  }, [query.data]);
@@ -3371,12 +3401,12 @@ function F_core83092({ menuData: menuData2 }) {
3371
3401
 
3372
3402
  // src/modules-features/authenticate/F_authenticate_SplashPage.tsx
3373
3403
  import { useRouter as useRouter2 } from "next/navigation";
3374
- import { useEffect as useEffect10 } from "react";
3404
+ import { useEffect as useEffect11 } from "react";
3375
3405
  import { jsx as jsx62 } from "react/jsx-runtime";
3376
3406
  function F_authenticate_SplashPage() {
3377
3407
  const router = useRouter2();
3378
3408
  const S_Authenticate = useS_authenticate();
3379
- useEffect10(() => {
3409
+ useEffect11(() => {
3380
3410
  if (S_Authenticate.state.token == "") {
3381
3411
  router.push("/authenticate/login");
3382
3412
  return;
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "types": "./dist/hooks/index.d.mts"
23
23
  }
24
24
  },
25
- "version": "0.1.207",
25
+ "version": "0.1.209",
26
26
  "private": false,
27
27
  "files": [
28
28
  "dist"