Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spa
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
spa
Commits
2b95a8c5
Commit
2b95a8c5
authored
4 months ago
by
Dominik Wille
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3479549
by onfire84, harlor: Add description field to static arguments
parent
f54e2068
No related branches found
No related tags found
1 merge request
!2
Add description field to static arguments.
Pipeline
#318236
failed
4 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/schema/spa.schema.yml
+3
-0
3 additions, 0 deletions
config/schema/spa.schema.yml
src/Plugin/SpaArgument/StaticSpaArgument.php
+11
-1
11 additions, 1 deletion
src/Plugin/SpaArgument/StaticSpaArgument.php
with
14 additions
and
1 deletion
config/schema/spa.schema.yml
+
3
−
0
View file @
2b95a8c5
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/SpaArgument/StaticSpaArgument.php
+
11
−
1
View file @
2b95a8c5
...
...
@@ -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
(),
],
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment