Allow form action props override in FormBuilder

Also added bootstrapButtonStyle defaults
This commit is contained in:
Ingo Schommer 2016-04-26 13:22:54 +12:00
parent 78a385c16a
commit b0d4283c17

View File

@ -323,18 +323,19 @@ export class FormBuilderComponent extends SilverStripeComponent {
// Add sensible defaults for common actions.
switch (props.name) {
case 'action_save':
props = deepFreeze(Object.assign({}, props, {
props = deepFreeze(Object.assign({}, {
type: 'submit',
label: props.title,
icon: 'save',
}));
bootstrapButtonStyle: 'success',
}, props));
break;
case 'action_cancel':
props = deepFreeze(Object.assign({}, props, {
props = deepFreeze(Object.assign({}, {
type: 'button',
label: props.title,
icon: 'cancel',
}));
}, props));
break;
default:
break;