Merge "[ONEM-16360] Parameter Separator support"

This commit is contained in:
Zuul 2020-09-25 15:23:51 +00:00 committed by Gerrit Code Review
commit 9aa9808f22
5 changed files with 73 additions and 0 deletions

View File

@ -1113,6 +1113,36 @@ def git_parameter_param(registry, xml_parent, data):
helpers.convert_mapping_to_xml(pdef, data, mapping, fail_required=True)
def param_separator(registry, xml_parent, data):
"""yaml: parameter-separator
A parameter separator.
:arg str name: name of the separator (default "", the plugin will assign a randomly generated UUID if not specified)
:arg str separator-style: the style of the separator. Uses CSS. (default "")
:arg str section-header-text: the section header text of the separator (default "")
:arg str section-header-style: the section header style (CSS) of the separator. Uses CSS. (default "")
Example::
parameters:
- parameter-separator:
name: lorem
separator-style: FOO
section-header: bar
section-header-style: font-weight:bold;z-index:10000
"""
element_name = "jenkins.plugins.parameter__separator.ParameterSeparatorDefinition"
pdef = XML.SubElement(xml_parent, element_name)
XML.SubElement(pdef, "description") # To create empty description tag
mapping = [
("name", "name", ""),
("section-header", "sectionHeader", ""),
("section-header-style", "sectionHeaderStyle", ""),
("separator-style", "separatorStyle", ""),
]
helpers.convert_mapping_to_xml(pdef, data, mapping, fail_required=True)
class Parameters(jenkins_jobs.modules.base.Base):
sequence = 21

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<jenkins.plugins.parameter__separator.ParameterSeparatorDefinition>
<description/>
<name>separator-12345-a12b-1234-2345-abcde123123</name>
<sectionHeader>MISCELLANEOUS</sectionHeader>
<sectionHeaderStyle>font-weight:bold;margin-bottom:20px;</sectionHeaderStyle>
<separatorStyle>FOO</separatorStyle>
</jenkins.plugins.parameter__separator.ParameterSeparatorDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
</project>

View File

@ -0,0 +1,6 @@
parameters:
- parameter-separator:
name: separator-12345-a12b-1234-2345-abcde123123
separator-style: FOO
section-header: MISCELLANEOUS
section-header-style: font-weight:bold;margin-bottom:20px;

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<jenkins.plugins.parameter__separator.ParameterSeparatorDefinition>
<description/>
<name/>
<sectionHeader>MISCELLANEOUS</sectionHeader>
<sectionHeaderStyle>font-weight:bold;margin-bottom:20px;</sectionHeaderStyle>
<separatorStyle>FOO</separatorStyle>
</jenkins.plugins.parameter__separator.ParameterSeparatorDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
</project>

View File

@ -0,0 +1,5 @@
parameters:
- parameter-separator:
separator-style: FOO
section-header: MISCELLANEOUS
section-header-style: font-weight:bold;margin-bottom:20px;