feat: implement ActionBuilder page and AddPolicyEngine component for configuration management
This commit is contained in:
@@ -95,7 +95,7 @@ export default function ActionBuilderPage() {
|
|||||||
placeholder: '',
|
placeholder: '',
|
||||||
helpText: '',
|
helpText: '',
|
||||||
width: 'full',
|
width: 'full',
|
||||||
section: 'General Information',
|
section: '',
|
||||||
displayOrder: 1,
|
displayOrder: 1,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
validationJson: { min: undefined, max: undefined, regex: '' },
|
validationJson: { min: undefined, max: undefined, regex: '' },
|
||||||
@@ -387,7 +387,7 @@ export default function ActionBuilderPage() {
|
|||||||
placeholder: '',
|
placeholder: '',
|
||||||
helpText: '',
|
helpText: '',
|
||||||
width: 'full',
|
width: 'full',
|
||||||
section: 'General Information',
|
section: '',
|
||||||
displayOrder: fields.length + 1,
|
displayOrder: fields.length + 1,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
validationJson: { min: undefined, max: undefined, regex: '' },
|
validationJson: { min: undefined, max: undefined, regex: '' },
|
||||||
@@ -409,7 +409,7 @@ export default function ActionBuilderPage() {
|
|||||||
placeholder: f.placeholder || '',
|
placeholder: f.placeholder || '',
|
||||||
helpText: f.helpText || '',
|
helpText: f.helpText || '',
|
||||||
width: f.width || 'full',
|
width: f.width || 'full',
|
||||||
section: f.section || 'General Information',
|
section: f.section || '',
|
||||||
displayOrder: f.displayOrder || 1,
|
displayOrder: f.displayOrder || 1,
|
||||||
isActive: f.isActive !== false,
|
isActive: f.isActive !== false,
|
||||||
validationJson: f.validationJson || { min: undefined, max: undefined, regex: '' },
|
validationJson: f.validationJson || { min: undefined, max: undefined, regex: '' },
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ export default function AddPolicyEngine() {
|
|||||||
const initialFieldValues: Record<string, any> = {};
|
const initialFieldValues: Record<string, any> = {};
|
||||||
fields.forEach((f) => {
|
fields.forEach((f) => {
|
||||||
const defaultVal = f.defaultValue ?? (f as any).default_value ?? (f as any).defaultValueJson ?? (f as any).default_value_json;
|
const defaultVal = f.defaultValue ?? (f as any).default_value ?? (f as any).defaultValueJson ?? (f as any).default_value_json;
|
||||||
if (defaultVal !== undefined && defaultVal !== null && defaultVal !== '') {
|
if (defaultVal !== undefined && defaultVal !== null) {
|
||||||
initialFieldValues[f.fieldCode] = defaultVal;
|
initialFieldValues[f.fieldCode] = defaultVal;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1444,7 +1444,7 @@ export default function AddPolicyEngine() {
|
|||||||
(field as any).default_value_json;
|
(field as any).default_value_json;
|
||||||
|
|
||||||
const effectiveVal =
|
const effectiveVal =
|
||||||
rawVal !== undefined && rawVal !== null && rawVal !== ''
|
rawVal !== undefined && rawVal !== null
|
||||||
? rawVal
|
? rawVal
|
||||||
: defaultVal;
|
: defaultVal;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user