@appcorp/fusion-storybook 0.2.2 → 0.2.4
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.
|
@@ -27,6 +27,7 @@ import { useDebounce } from "@react-pakistan/util-functions/hooks/use-debounce";
|
|
|
27
27
|
import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
|
|
28
28
|
import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
|
|
29
29
|
import { generateThemeToast, TOAST_VARIANT, } from "@appcorp/shadcn/lib/toast-utils";
|
|
30
|
+
import { USER_ROLE } from "../../type";
|
|
30
31
|
import { RBAC_API_ROUTES, pageLimit } from "./constants";
|
|
31
32
|
import { getCachedRoles, invalidateRolesCache } from "./cache";
|
|
32
33
|
import { roleFormValidation } from "./validate";
|
|
@@ -432,13 +433,13 @@ export const useRbacModule = () => {
|
|
|
432
433
|
order: 0,
|
|
433
434
|
},
|
|
434
435
|
{
|
|
435
|
-
enabled:
|
|
436
|
+
enabled: false,
|
|
436
437
|
handleOnClick: handleFilters,
|
|
437
438
|
label: t("actionsButtonFilters"),
|
|
438
439
|
order: 1,
|
|
439
440
|
},
|
|
440
441
|
{
|
|
441
|
-
enabled:
|
|
442
|
+
enabled: false,
|
|
442
443
|
handleOnClick: handleCreate,
|
|
443
444
|
label: t("actionsButtonAddItem"),
|
|
444
445
|
order: 2,
|
|
@@ -452,13 +453,13 @@ export const useRbacModule = () => {
|
|
|
452
453
|
order: 1,
|
|
453
454
|
},
|
|
454
455
|
{
|
|
455
|
-
enabled:
|
|
456
|
+
enabled: false,
|
|
456
457
|
handleOnClick: handleEdit,
|
|
457
458
|
label: t("actionsButtonEdit"),
|
|
458
459
|
order: 2,
|
|
459
460
|
},
|
|
460
461
|
{
|
|
461
|
-
enabled:
|
|
462
|
+
enabled: false,
|
|
462
463
|
handleOnClick: handleDelete,
|
|
463
464
|
label: t("actionsButtonDelete"),
|
|
464
465
|
order: 4,
|
|
@@ -478,7 +479,10 @@ export const useRbacModule = () => {
|
|
|
478
479
|
});
|
|
479
480
|
dispatch({
|
|
480
481
|
type: RBAC_ACTION_TYPES.SET_ITEMS,
|
|
481
|
-
payload: {
|
|
482
|
+
payload: {
|
|
483
|
+
items: items.filter((item) => item.userRole !== USER_ROLE.SUPER_ADMIN) || [],
|
|
484
|
+
count: count || 0,
|
|
485
|
+
},
|
|
482
486
|
});
|
|
483
487
|
}
|
|
484
488
|
catch (_a) {
|
|
@@ -79,8 +79,8 @@ const createRbacConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, draw
|
|
|
79
79
|
{ label: tableColumnHeaderId, width: "5%" },
|
|
80
80
|
{ label: tableColumnHeaderName, width: "25%" },
|
|
81
81
|
{ label: tableColumnHeaderDescription, width: "35%" },
|
|
82
|
-
{ label: tableColumnHeaderPermissions, width: "
|
|
83
|
-
{ label: tableColumnHeaderActions, width: "
|
|
82
|
+
{ label: tableColumnHeaderPermissions, width: "30%" },
|
|
83
|
+
{ label: tableColumnHeaderActions, width: "5%" },
|
|
84
84
|
],
|
|
85
85
|
tableDescription,
|
|
86
86
|
tableTitle,
|