Skip to content
Snippets Groups Projects
Commit 2b95a8c5 authored by Dominik Wille's avatar Dominik Wille
Browse files

Issue #3479549 by onfire84, harlor: Add description field to static arguments

parent f54e2068
No related branches found
No related tags found
1 merge request!2Add description field to static arguments.
Pipeline #318236 failed
......@@ -44,6 +44,9 @@ spa_argument.plugin.static:
argument_name:
type: string
label: 'Argument name'
argument_description:
type: text
label: 'Argument description'
default_value:
type: text
label: Value
......
......@@ -44,7 +44,10 @@ class StaticSpaArgument extends SpaArgumentPluginBase implements ContainerFactor
* {@inheritdoc}
*/
public function defaultConfiguration() {
return parent::defaultConfiguration() + ['default_value' => ''];
return parent::defaultConfiguration() + [
'argument_description' => '',
'default_value' => '',
];
}
/**
......@@ -52,6 +55,12 @@ class StaticSpaArgument extends SpaArgumentPluginBase implements ContainerFactor
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
$form['argument_description'] = [
'#type' => 'textfield',
'#title' => $this->t('Argument description'),
'#description' => $this->t('Explain what this argument is doing for users who want to place this spa-block.'),
'#default_value' => $this->configuration['argument_description'],
];
$form['default_value'] = [
'#type' => 'textfield',
'#title' => $this->t('Default value'),
......@@ -76,6 +85,7 @@ class StaticSpaArgument extends SpaArgumentPluginBase implements ContainerFactor
'value' => [
'#type' => 'textfield',
'#title' => $this->t('The value for @name', ['@name' => $this->configuration['argument_name']]),
'#description' => $this->t($this->configuration['argument_description']),
'#default_value' => $this->getArgumentValue(),
],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment