diff --git a/client/src/components/dynamic-groups/rule-editor.tsx b/client/src/components/dynamic-groups/rule-editor.tsx index 9b40567..0b33d8f 100644 --- a/client/src/components/dynamic-groups/rule-editor.tsx +++ b/client/src/components/dynamic-groups/rule-editor.tsx @@ -82,6 +82,7 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } createOUIfNotExists: boolean; createGroupForEachAttributeValue: boolean; createOUForEachAttributeValue: boolean; + autoAddRootDSE: boolean; enabled: boolean; variablePattern: string; connections: number[]; @@ -94,6 +95,7 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } createOUIfNotExists: rule?.createOUIfNotExists || false, createGroupForEachAttributeValue: rule?.createGroupForEachAttributeValue || false, createOUForEachAttributeValue: rule?.createOUForEachAttributeValue || false, + autoAddRootDSE: true, // Default to true for better user experience enabled: rule?.enabled ?? true, variablePattern: rule?.variablePattern || '', connections: rule?.connectionIds || [] @@ -167,10 +169,15 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } return domainParts.map(part => `DC=${part}`).join(','); }; - // Ensure OU path has rootDSE appended + // Ensure OU path has rootDSE appended if autoAddRootDSE is enabled const ensureRootDSE = (ouPath: string) => { if (!ouPath) return ''; + // If autoAddRootDSE is disabled, return the path as is + if (!formData.autoAddRootDSE) { + return ouPath; + } + // Check if the path already contains DC= if (ouPath.includes('DC=')) { return ouPath; @@ -474,6 +481,15 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } /> + +
+ handleToggleChange('autoAddRootDSE', checked)} + /> + +
@@ -636,6 +652,12 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } {formData.createOUIfNotExists ? 'Yes' : 'No'}
+
+
Auto-add root DSE:
+
+ {formData.autoAddRootDSE ? 'Yes' : 'No'} +
+
Create groups per attribute value: