Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with plugin select value with multiOption #5302

Merged
merged 3 commits into from Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -679,7 +679,8 @@ class WorkflowController extends ControllerBase {
private Map cleanLineEndings(Map input){
def result = [:]
input.each {k,v->
result[k]=v.replaceAll(/\r?\n/,'\n')
if(v instanceof String)result[k]=v.replaceAll(/\r?\n/,'\n')
else if(v instanceof String[] || v instanceof Collection) result[k]=v.collect { it.replaceAll(/\r?\n/,'\n') }.join(",")
}
result
}
Expand Down
Expand Up @@ -162,15 +162,16 @@

<g:each in="${propSelectValues}" var="propval" status="n">
<div class="optionvaluemulti checkbox">
<g:checkBox name="${fieldname}" checked="${propval.value in defvalset}" value="${propval.value}" id="f_${fieldid}_p_${n}"/>
<label class="grid-row optionvaluemulti" for="f_${fieldid}_p_${n}">
${propval.label}
</label>
</div>
</g:each>
</div>
</div>
</g:elseif>
<g:set var="ischecked" value="${propval.value in defvalset ? 'checked="checked"' : ''}"/>
<input type="checkbox" id="${enc(attr:fieldname)}" name="${enc(attr:fieldname)}" ${ischecked} value="${enc(attr:propval.value)}"/>
<label class="grid-row optionvaluemulti" for="${enc(attr:fieldname)}">
${propval.label}
</label>
</div>
</g:each>
</div>
</div>
</g:elseif>
<g:else>
<g:set var="fieldid" value="${g.rkey()}"/>
<g:set var="hasStorageSelector" value="${prop.renderingOptions?.(StringRenderingConstants.SELECTION_ACCESSOR_KEY) in [StringRenderingConstants.SelectionAccessor.STORAGE_PATH,'STORAGE_PATH']}"/>
Expand Down
Expand Up @@ -156,9 +156,11 @@ class WorkflowControllerTests {
def inputValue2 = 'abc\ndef\n\nrbc\n'
def expectedValue2 = 'abc\ndef\n\nrbc\n'
def pluginConfig=[monkey: 'tree',
ape:['land','tree'],
multilineconfig: inputValue,
unixlines: inputValue2]
def expectedConfig=[monkey:'tree',
ape:'land,tree',
multilineconfig: expectedValue,
unixlines: expectedValue2]

Expand Down