mirror of
https://github.com/freedbygrace/ActiveDirectoryManager.git
synced 2026-08-24 17:46:52 +00:00
Improve dynamic group rule editor to correctly handle 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/b6bb9e86-10d4-45d0-8f83-e336d9109dfa.jpg
This commit is contained in:
@@ -47,9 +47,25 @@ interface RuleEditorProps {
|
|||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extend the DynamicGroupRule type to include connectionIds for frontend use
|
// Define a custom type matching what the onSave function expects
|
||||||
interface ExtendedDynamicGroupRule extends DynamicGroupRule {
|
interface DynamicGroupRuleWithConnectionIds {
|
||||||
connectionIds?: number[];
|
id: number;
|
||||||
|
name: string;
|
||||||
|
description: string | null;
|
||||||
|
targetGroup: string;
|
||||||
|
enabled: boolean;
|
||||||
|
schedule: string;
|
||||||
|
createdAt: Date;
|
||||||
|
updatedAt: Date;
|
||||||
|
lastRun: Date | null;
|
||||||
|
lastRunStatus: string | null;
|
||||||
|
variablePattern: string | null;
|
||||||
|
useAdvancedScheduling: boolean;
|
||||||
|
createGroupIfNotExists: boolean;
|
||||||
|
createOUIfNotExists: boolean;
|
||||||
|
createGroupForEachAttributeValue: boolean;
|
||||||
|
createOUForEachAttributeValue: boolean;
|
||||||
|
connectionIds: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }) => {
|
export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }) => {
|
||||||
@@ -237,7 +253,7 @@ export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }
|
|||||||
|
|
||||||
const targetGroupDN = getTargetGroupDN();
|
const targetGroupDN = getTargetGroupDN();
|
||||||
|
|
||||||
const ruleData: ExtendedDynamicGroupRule = {
|
const ruleData: DynamicGroupRuleWithConnectionIds = {
|
||||||
id: rule?.id || 0, // Default to 0 for new records
|
id: rule?.id || 0, // Default to 0 for new records
|
||||||
name: formData.name,
|
name: formData.name,
|
||||||
description: formData.description || null,
|
description: formData.description || null,
|
||||||
@@ -252,7 +268,9 @@ export const RuleEditor: React.FC<RuleEditorProps> = ({ rule, onSave, onCancel }
|
|||||||
createGroupIfNotExists: formData.createGroupIfNotExists,
|
createGroupIfNotExists: formData.createGroupIfNotExists,
|
||||||
createOUIfNotExists: formData.createOUIfNotExists,
|
createOUIfNotExists: formData.createOUIfNotExists,
|
||||||
createGroupForEachAttributeValue: formData.createGroupForEachAttributeValue,
|
createGroupForEachAttributeValue: formData.createGroupForEachAttributeValue,
|
||||||
createOUForEachAttributeValue: formData.createOUForEachAttributeValue
|
createOUForEachAttributeValue: formData.createOUForEachAttributeValue,
|
||||||
|
schedule: rule?.schedule || "0 0 * * *", // Default: daily at midnight
|
||||||
|
useAdvancedScheduling: rule?.useAdvancedScheduling || false
|
||||||
};
|
};
|
||||||
|
|
||||||
onSave(ruleData, schedules);
|
onSave(ruleData, schedules);
|
||||||
|
|||||||
Reference in New Issue
Block a user