diff --git a/docs/creating-manifest/visual-settings.md b/docs/creating-manifest/visual-settings.md index 5a688f9f..ffba8d1f 100644 --- a/docs/creating-manifest/visual-settings.md +++ b/docs/creating-manifest/visual-settings.md @@ -2918,6 +2918,222 @@ Here, the *main settings* form appears during installation process. ![settingCustom](/img/SettingsCustom.jpg) +## Custom Buttons and Custom Settings + +When creating the add-on, you can use specific options that allow to create custom buttons of different ***submitTypes*** in combination with custom settings. These options are: + + * `submitType` [string] - determines behavior of submit button. Default value: `apply`. Possible values: + * `none` - submit button is hidden + * `apply` - default green button for installation or configuration + * `support` - blue button to open hoster's configured support window (initial dialog stays open) + * `upgrade` - blue button Upgrade to Paid Account (initial dialog must be closed) + * `submitUnchanged` [boolean] - ability to submit unchanged values in configuration dialog. Default value: `false` + +For example: + +@@@ +```yaml +type: update +name: JE-59620 [CS:Visual Settings] - different submit button types + +targetNodes: any + +settings: + + default: + fields: + - type: text + caption: default + name: default + required: true + + none: + submitType: none + fields: + - type: text + caption: None + name: config1 + required: true + + apply: + submitType: apply + fields: + - type: text + caption: Apply + name: config2 + required: true + + support: + submitType: support + fields: + - type: text + caption: Support + name: config4 + required: true + + upgrade: + submitType: upgrade + fields: + - type: text + caption: Upgrade + name: config4 + required: true + + submitUnchanged: + submitType: apply + submitUnchanged: true + fields: + - type: text + caption: Apply + name: config3 + required: true + +buttons: + - caption: Test Submit Buttons + menu: + - caption: Default + settings: default + + - caption: None + settings: none + + - caption: Apply + settings: apply + action: test + + - caption: Support + settings: support + + - caption: Upgrade + settings: upgrade + + - caption: Submit Unchanged + settings: submitUnchanged + action: test + +actions: + test: + log: ${settings} +``` +```json +{ + "type": "update", + "name": "JE-59620 [CS:Visual Settings] - different submit button types", + "targetNodes": "any", + "settings": { + "default": { + "fields": [ + { + "type": "text", + "caption": "default", + "name": "default", + "required": true + } + ] + }, + "none": { + "submitType": "none", + "fields": [ + { + "type": "text", + "caption": "None", + "name": "config1", + "required": true + } + ] + }, + "apply": { + "submitType": "apply", + "fields": [ + { + "type": "text", + "caption": "Apply", + "name": "config2", + "required": true + } + ] + }, + "support": { + "submitType": "support", + "fields": [ + { + "type": "text", + "caption": "Support", + "name": "config4", + "required": true + } + ] + }, + "upgrade": { + "submitType": "upgrade", + "fields": [ + { + "type": "text", + "caption": "Upgrade", + "name": "config4", + "required": true + } + ] + }, + "submitUnchanged": { + "submitType": "apply", + "submitUnchanged": true, + "fields": [ + { + "type": "text", + "caption": "Apply", + "name": "config3", + "required": true + } + ] + } + }, + "buttons": [ + { + "caption": "Test Submit Buttons", + "menu": [ + { + "caption": "Default", + "settings": "default" + }, + { + "caption": "None", + "settings": "none" + }, + { + "caption": "Apply", + "settings": "apply", + "action": "test" + }, + { + "caption": "Support", + "settings": "support" + }, + { + "caption": "Upgrade", + "settings": "upgrade" + }, + { + "caption": "Submit Unchanged", + "settings": "submitUnchanged", + "action": "test" + } + ] + } + ], + "actions": { + "test": { + "log": "${settings}" + } + } +} +``` +@@! + +![settingCustom](/img/submit-types.png) + +Each button invokes the corresponding form according to the options shown above. + ## Success Text Customization It is possible to customize the *success* text that is displayed upon successful installation either at the Dashboard, or via email notification. diff --git a/theme/readthedocs/img/submit-types.png b/theme/readthedocs/img/submit-types.png new file mode 100644 index 00000000..ca83c7bd Binary files /dev/null and b/theme/readthedocs/img/submit-types.png differ