From 7cef031ca2fc20c6f9f4e8a3e2f61b55e22dd263 Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Thu, 10 Apr 2025 15:44:20 +0000 Subject: [PATCH] Enhance dynamic group rule editor with variable selection. 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/d4482634-dce5-40ce-a61e-aaaf3f0b2047.jpg --- .../components/dynamic-groups/rule-editor.tsx | 87 ++++------- .../dynamic-groups/variable-selector.tsx | 141 ++++++++++++++++++ 2 files changed, 172 insertions(+), 56 deletions(-) create mode 100644 client/src/components/dynamic-groups/variable-selector.tsx diff --git a/client/src/components/dynamic-groups/rule-editor.tsx b/client/src/components/dynamic-groups/rule-editor.tsx index 56317d3..3b0d984 100644 --- a/client/src/components/dynamic-groups/rule-editor.tsx +++ b/client/src/components/dynamic-groups/rule-editor.tsx @@ -24,6 +24,7 @@ import { import { DynamicGroupRule, LdapConnection } from '@shared/schema'; import CronJobBuilder, { ScheduleItem } from './cron-job-builder'; import ConditionBuilder from './condition-builder'; +import VariableSelector from './variable-selector'; import { useToast } from '@/hooks/use-toast'; import { queryClient, apiRequest } from '@/lib/queryClient'; import { useMutation, useQuery } from '@tanstack/react-query'; @@ -349,17 +350,30 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel }
CN= - +
+ +
+ { + const variableText = `{${variable}}`; + const currentValue = formData.targetGroupName || ''; + const newValue = currentValue + variableText; + setFormData({ ...formData, targetGroupName: newValue }); + }} + connections={formData.connections} + /> +
+

- Name of the group (can include variables) + Name of the group (can include variables like {'{attributeName}'})

@@ -387,51 +401,6 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } -
- -