mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -30,6 +30,7 @@ import { ScrollArea } from "@/components/ui/scroll-area";
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
import { useUserGroups } from "@/contexts/AdminUserGroupContext";
|
import { useUserGroups } from "@/contexts/AdminUserGroupContext";
|
||||||
|
import { useUsers } from "@/contexts/AdminUserContext";
|
||||||
import { useDateFormat } from "@/hooks/useDateFormat";
|
import { useDateFormat } from "@/hooks/useDateFormat";
|
||||||
|
|
||||||
import { buildDataColumns, columnPinning } from "../../config/user_groups/view/columns.config";
|
import { buildDataColumns, columnPinning } from "../../config/user_groups/view/columns.config";
|
||||||
@@ -297,12 +298,16 @@ export default function ViewGroup() {
|
|||||||
loading,
|
loading,
|
||||||
fetchGroups,
|
fetchGroups,
|
||||||
fetchGroup,
|
fetchGroup,
|
||||||
fetchGroupFieldValues,
|
|
||||||
fetchUsersNotInGroup,
|
fetchUsersNotInGroup,
|
||||||
addUsersToGroup,
|
addUsersToGroup,
|
||||||
removeUsersFromGroup,
|
removeUsersFromGroup,
|
||||||
} = useUserGroups();
|
} = useUserGroups();
|
||||||
|
|
||||||
|
// Members belong to the Users model (full_name, DOB, occupation, createdBy…),
|
||||||
|
// not UserGroups — the group-level field-values endpoint doesn't know these
|
||||||
|
// fields at all, so filter picklists must come from the Users endpoint.
|
||||||
|
const { fetchUserFieldValues } = useUsers();
|
||||||
|
|
||||||
const isNoGroup = group?.group_code === 'NOGRP';
|
const isNoGroup = group?.group_code === 'NOGRP';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -332,7 +337,7 @@ export default function ViewGroup() {
|
|||||||
|
|
||||||
const toolbarActions = buildToolbarActions({
|
const toolbarActions = buildToolbarActions({
|
||||||
fetchGroup,
|
fetchGroup,
|
||||||
groupId,
|
gid: groupId,
|
||||||
pagination,
|
pagination,
|
||||||
exportConfig,
|
exportConfig,
|
||||||
onAddMember: () => setAddMemberOpen(true),
|
onAddMember: () => setAddMemberOpen(true),
|
||||||
@@ -475,7 +480,7 @@ export default function ViewGroup() {
|
|||||||
setPagination={setPagination}
|
setPagination={setPagination}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
onFetch={handleFetch}
|
onFetch={handleFetch}
|
||||||
onFetchFilterData={fetchGroupFieldValues}
|
onFetchFilterData={fetchUserFieldValues}
|
||||||
onRefsReady={handleRefsReady}
|
onRefsReady={handleRefsReady}
|
||||||
renderFilterSheet={({ open, onOpenChange, column, attr, data, loading }) => (
|
renderFilterSheet={({ open, onOpenChange, column, attr, data, loading }) => (
|
||||||
<FilterSheet
|
<FilterSheet
|
||||||
|
|||||||
Reference in New Issue
Block a user