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