From 52882b2432573e27ecba95eaaa73e295656d7f8e Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Thu, 10 Apr 2025 16:14:19 +0000 Subject: [PATCH] Improve dynamic group management by adding automatic rootDSE and OU path detection 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/acbb6d24-60b2-47f8-b1fe-dc76672c9e3e.jpg --- client/src/components/dynamic-groups/variable-selector.tsx | 5 ++++- migrations/add_dynamic_group_fields.sql | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 migrations/add_dynamic_group_fields.sql diff --git a/client/src/components/dynamic-groups/variable-selector.tsx b/client/src/components/dynamic-groups/variable-selector.tsx index e631044..c279b9b 100644 --- a/client/src/components/dynamic-groups/variable-selector.tsx +++ b/client/src/components/dynamic-groups/variable-selector.tsx @@ -1,4 +1,4 @@ -import React, { useState, useRef } from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import { Popover, PopoverContent, @@ -16,10 +16,13 @@ import { } from "@/components/ui/command"; import { PlusCircle, Database, Tag } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; +import { useQuery } from '@tanstack/react-query'; +import { LdapConnection } from '@shared/schema'; interface VariableSelectorProps { onSelectVariable: (variable: string) => void; connections: number[]; + isForOU?: boolean; } // Common LDAP attributes that might be useful as variables diff --git a/migrations/add_dynamic_group_fields.sql b/migrations/add_dynamic_group_fields.sql new file mode 100644 index 0000000..8aba276 --- /dev/null +++ b/migrations/add_dynamic_group_fields.sql @@ -0,0 +1,5 @@ +-- Add missing columns to dynamic_group_rules table +ALTER TABLE dynamic_group_rules ADD COLUMN IF NOT EXISTS create_group_if_not_exists BOOLEAN DEFAULT FALSE; +ALTER TABLE dynamic_group_rules ADD COLUMN IF NOT EXISTS create_ou_if_not_exists BOOLEAN DEFAULT FALSE; +ALTER TABLE dynamic_group_rules ADD COLUMN IF NOT EXISTS create_group_for_each_attribute_value BOOLEAN DEFAULT FALSE; +ALTER TABLE dynamic_group_rules ADD COLUMN IF NOT EXISTS create_ou_for_each_attribute_value BOOLEAN DEFAULT FALSE; \ No newline at end of file