mirror of
https://github.com/freedbygrace/ActiveDirectoryManager.git
synced 2026-08-11 03:09:37 +00:00
Enhance dynamic group rule editor to include connection IDs.
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/9ce3225b-17f6-4b5a-bb49-abd356d361e0.jpg
This commit is contained in:
@@ -42,11 +42,16 @@ export interface Condition {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface RuleEditorProps {
|
interface RuleEditorProps {
|
||||||
rule?: DynamicGroupRule;
|
rule?: DynamicGroupRule & { connectionIds?: number[] };
|
||||||
onSave: (rule: DynamicGroupRule, schedules: ScheduleItem[]) => void;
|
onSave: (rule: DynamicGroupRule, schedules: ScheduleItem[]) => void;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extend the DynamicGroupRule type to include connectionIds for frontend use
|
||||||
|
interface ExtendedDynamicGroupRule extends DynamicGroupRule {
|
||||||
|
connectionIds?: number[];
|
||||||
|
}
|
||||||
|
|
||||||
export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }) => {
|
export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }) => {
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const [activeTab, setActiveTab] = useState('general');
|
const [activeTab, setActiveTab] = useState('general');
|
||||||
@@ -232,8 +237,8 @@ export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }
|
|||||||
|
|
||||||
const targetGroupDN = getTargetGroupDN();
|
const targetGroupDN = getTargetGroupDN();
|
||||||
|
|
||||||
const ruleData: DynamicGroupRule = {
|
const ruleData: ExtendedDynamicGroupRule = {
|
||||||
id: rule?.id,
|
id: rule?.id || 0, // Default to 0 for new records
|
||||||
name: formData.name,
|
name: formData.name,
|
||||||
description: formData.description || null,
|
description: formData.description || null,
|
||||||
targetGroup: targetGroupDN,
|
targetGroup: targetGroupDN,
|
||||||
|
|||||||
Reference in New Issue
Block a user