fix: update user level hierarchy
This commit is contained in:
parent
3285ccc4b3
commit
2b601d9740
|
|
@ -16,6 +16,12 @@ import {
|
||||||
UsersIcon,
|
UsersIcon,
|
||||||
WorkflowIcon,
|
WorkflowIcon,
|
||||||
} from "@/components/icons";
|
} from "@/components/icons";
|
||||||
|
import { ChevronDownIcon, ChevronUpIcon } from "@/components/icons";
|
||||||
|
import {
|
||||||
|
Collapsible,
|
||||||
|
CollapsibleContent,
|
||||||
|
CollapsibleTrigger,
|
||||||
|
} from "@/components/ui/collapsible";
|
||||||
import { ApprovalWorkflowForm } from "@/components/form/ApprovalWorkflowForm";
|
import { ApprovalWorkflowForm } from "@/components/form/ApprovalWorkflowForm";
|
||||||
import { UserLevelsForm } from "@/components/form/UserLevelsForm";
|
import { UserLevelsForm } from "@/components/form/UserLevelsForm";
|
||||||
import { useWorkflowModal } from "@/components/modals/WorkflowModalProvider";
|
import { useWorkflowModal } from "@/components/modals/WorkflowModalProvider";
|
||||||
|
|
@ -65,6 +71,7 @@ function TenantSettingsContentTable() {
|
||||||
const [isEditDialogOpen, setIsEditDialogOpen] = React.useState(false);
|
const [isEditDialogOpen, setIsEditDialogOpen] = React.useState(false);
|
||||||
const [editingUserLevel, setEditingUserLevel] =
|
const [editingUserLevel, setEditingUserLevel] =
|
||||||
React.useState<UserLevel | null>(null);
|
React.useState<UserLevel | null>(null);
|
||||||
|
const [isHierarchyExpanded, setIsHierarchyExpanded] = useState(false);
|
||||||
|
|
||||||
const handleEditUserLevel = (userLevel: UserLevel) => {
|
const handleEditUserLevel = (userLevel: UserLevel) => {
|
||||||
setEditingUserLevel(userLevel);
|
setEditingUserLevel(userLevel);
|
||||||
|
|
@ -703,12 +710,26 @@ function TenantSettingsContentTable() {
|
||||||
{/* User Levels Hierarchy */}
|
{/* User Levels Hierarchy */}
|
||||||
{userLevels.length > 0 && (
|
{userLevels.length > 0 && (
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>
|
<Collapsible
|
||||||
<CardTitle className="flex items-center gap-2">
|
open={isHierarchyExpanded}
|
||||||
|
onOpenChange={setIsHierarchyExpanded}
|
||||||
|
>
|
||||||
|
<CollapsibleTrigger asChild>
|
||||||
|
<CardHeader className="cursor-pointer hover:bg-gray-50 transition-colors">
|
||||||
|
<CardTitle className="flex items-center justify-between">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
<UsersIcon className="h-5 w-5" />
|
<UsersIcon className="h-5 w-5" />
|
||||||
User Levels Hierarchy
|
User Levels Hierarchy
|
||||||
|
</div>
|
||||||
|
{isHierarchyExpanded ? (
|
||||||
|
<ChevronUpIcon className="h-4 w-4" />
|
||||||
|
) : (
|
||||||
|
<ChevronDownIcon className="h-4 w-4" />
|
||||||
|
)}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
</CollapsibleTrigger>
|
||||||
|
<CollapsibleContent>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
{userLevels
|
{userLevels
|
||||||
|
|
@ -781,6 +802,8 @@ function TenantSettingsContentTable() {
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
</CollapsibleContent>
|
||||||
|
</Collapsible>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue