mirror of
https://github.com/freedbygrace/ActiveDirectoryManager.git
synced 2026-08-12 03:38:23 +00:00
Improve dynamic group condition builder drag-and-drop functionality.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/0afec5d6-14a7-4a75-a992-77626cc2d610.jpg
This commit is contained in:
@@ -325,7 +325,7 @@ const ConditionBuilder: React.FC<ConditionBuilderProps> = ({
|
|||||||
const originalIndex = conditions.findIndex(c => c === child);
|
const originalIndex = conditions.findIndex(c => c === child);
|
||||||
return child.isGroup
|
return child.isGroup
|
||||||
? renderConditionGroup(child, originalIndex, level + 1)
|
? renderConditionGroup(child, originalIndex, level + 1)
|
||||||
: renderCondition(child, originalIndex, level + 1);
|
: <SortableItem condition={child} index={originalIndex} level={level + 1} />;
|
||||||
})
|
})
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -394,8 +394,14 @@ const ConditionBuilder: React.FC<ConditionBuilderProps> = ({
|
|||||||
) => {
|
) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="grid grid-cols-12 gap-2 items-center mb-2 border border-transparent hover:border-border p-2 rounded-md"
|
className="grid grid-cols-13 gap-2 items-center mb-2 border border-transparent hover:border-border p-2 rounded-md"
|
||||||
>
|
>
|
||||||
|
<div
|
||||||
|
className="col-span-1 cursor-grab flex items-center justify-center"
|
||||||
|
{...listeners}
|
||||||
|
>
|
||||||
|
<Move className="h-4 w-4 text-muted-foreground" />
|
||||||
|
</div>
|
||||||
{index > 0 && !condition.isGroup && condition.parentId === conditions[index-1].parentId && (
|
{index > 0 && !condition.isGroup && condition.parentId === conditions[index-1].parentId && (
|
||||||
<div className="col-span-1">
|
<div className="col-span-1">
|
||||||
<Select
|
<Select
|
||||||
@@ -529,7 +535,7 @@ const ConditionBuilder: React.FC<ConditionBuilderProps> = ({
|
|||||||
condition.parentId === null || condition.parentId === undefined ? (
|
condition.parentId === null || condition.parentId === undefined ? (
|
||||||
condition.isGroup ?
|
condition.isGroup ?
|
||||||
renderConditionGroup(condition, index) :
|
renderConditionGroup(condition, index) :
|
||||||
renderCondition(condition, index)
|
<SortableItem condition={condition} index={index} />
|
||||||
) : null
|
) : null
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user