From b0d4283c17b6bfac17b0a14656a2385585dfd5c4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 26 Apr 2016 13:22:54 +1200 Subject: [PATCH] Allow form action props override in FormBuilder Also added bootstrapButtonStyle defaults --- admin/client/src/components/FormBuilder/FormBuilder.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/client/src/components/FormBuilder/FormBuilder.js b/admin/client/src/components/FormBuilder/FormBuilder.js index 12ef56d87..45e4aeea3 100644 --- a/admin/client/src/components/FormBuilder/FormBuilder.js +++ b/admin/client/src/components/FormBuilder/FormBuilder.js @@ -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;