@appcorp/fusion-storybook 0.1.60 → 0.1.62
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.
|
@@ -78,40 +78,30 @@ export const { actionTypes: WORKSPACE_USER_ACTION_TYPES, config: workspaceUserMo
|
|
|
78
78
|
// ENHANCED WORKSPACE USER HOOK WITH API INTEGRATION
|
|
79
79
|
// ============================================================================
|
|
80
80
|
export const useWorkspaceUserModule = () => {
|
|
81
|
-
var _a;
|
|
82
81
|
const context = useWorkspaceUserContext();
|
|
83
82
|
const { state, dispatch } = context;
|
|
84
83
|
const t = useTranslations("workspaceUser");
|
|
85
84
|
const debouncedQuery = useDebounce(state.searchQuery, 800);
|
|
86
85
|
const workspace = getCachedWorkspaceSync();
|
|
87
|
-
const schoolId = ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "";
|
|
88
86
|
// ============================================================================
|
|
89
87
|
// API PARAMETERS
|
|
90
88
|
// ============================================================================
|
|
91
|
-
const listParams = useMemo(() => (Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit,
|
|
89
|
+
const listParams = useMemo(() => (Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit, workspaceId: state.workspaceId }, (debouncedQuery ? { searchQuery: debouncedQuery } : {})), (state.filterEnabled !== undefined
|
|
92
90
|
? { filterEnabled: String(state.filterEnabled) }
|
|
93
91
|
: {}))), [
|
|
94
92
|
state.currentPage,
|
|
95
93
|
state.filterEnabled,
|
|
96
94
|
state.pageLimit,
|
|
97
95
|
debouncedQuery,
|
|
98
|
-
|
|
96
|
+
state.workspaceId,
|
|
99
97
|
]);
|
|
100
98
|
const updateParams = useMemo(() => ({
|
|
101
99
|
enabled: state.enabled,
|
|
102
100
|
id: state.id,
|
|
103
101
|
roleId: state.roleId,
|
|
104
|
-
schoolId,
|
|
105
102
|
userId: state.userId,
|
|
106
103
|
workspaceId: state.workspaceId,
|
|
107
|
-
}), [
|
|
108
|
-
state.enabled,
|
|
109
|
-
state.id,
|
|
110
|
-
state.roleId,
|
|
111
|
-
state.userId,
|
|
112
|
-
state.workspaceId,
|
|
113
|
-
schoolId,
|
|
114
|
-
]);
|
|
104
|
+
}), [state.enabled, state.id, state.roleId, state.userId, state.workspaceId]);
|
|
115
105
|
const byIdParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
116
106
|
const deleteParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
117
107
|
// ============================================================================
|
|
@@ -319,14 +309,14 @@ export const useWorkspaceUserModule = () => {
|
|
|
319
309
|
// ============================================================================
|
|
320
310
|
const headerActions = useMemo(() => [
|
|
321
311
|
{
|
|
322
|
-
enabled:
|
|
312
|
+
enabled: false,
|
|
323
313
|
handleOnClick: handleFilters,
|
|
324
314
|
label: t("headerActionsFilters"),
|
|
325
315
|
order: 1,
|
|
326
316
|
icon: Filter,
|
|
327
317
|
},
|
|
328
318
|
{
|
|
329
|
-
enabled:
|
|
319
|
+
enabled: false,
|
|
330
320
|
handleOnClick: handleMoreActions,
|
|
331
321
|
label: t("headerActionsMoreActions"),
|
|
332
322
|
order: 2,
|
|
@@ -40,10 +40,10 @@ const createWorkspaceUserConfig = ({ cancelLabel, dispatch, drawerTitle, labelAc
|
|
|
40
40
|
tableColumns: [
|
|
41
41
|
{ label: labelId, width: "5%" },
|
|
42
42
|
{ label: labelUser, width: "30%" },
|
|
43
|
-
{ label: labelWorkspace, width: "
|
|
44
|
-
{ label: labelRole, width: "
|
|
43
|
+
{ label: labelWorkspace, width: "25%" },
|
|
44
|
+
{ label: labelRole, width: "20%" },
|
|
45
45
|
{ label: labelSystemRole, width: "15%" },
|
|
46
|
-
{ label: labelActions, width: "
|
|
46
|
+
{ label: labelActions, width: "5%" },
|
|
47
47
|
],
|
|
48
48
|
cancelLabel,
|
|
49
49
|
drawerTitle,
|