Skip to content

Commit

Permalink
Change caution message to use feature flag attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Sicker <boards@gmail.com>
  • Loading branch information
jvz committed Jul 23, 2019
1 parent 93cc7aa commit dd269c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
Expand Up @@ -35,7 +35,7 @@
<j:scope>
<j:set var="instance" value="${it}"/>
<j:set var="descriptor" value="${it.descriptor}"/>
<c:select field="value" default="${it.defaultValue}" includeUser="true"/>
<c:select field="value" default="${it.defaultValue}" includeUser="true" includeUserCaution="true"/>
</j:scope>
</div>
</f:entry>
Expand Down
33 changes: 22 additions & 11 deletions src/main/resources/lib/credentials/select.jelly
Expand Up @@ -45,6 +45,10 @@
<st:attribute name="includeUser">
If the user's scoped stores should be included
</st:attribute>
<st:attribute name="includeUserCaution">
Feature flag: show a checkbox and caution message for including user's scoped stores.
This is useful on forms controlled by other users.
</st:attribute>
<st:attribute name="context">
The context within which to look up the stores. (defaults to <code>it</code> (jelly) / <code>my</code> (groovy))
</st:attribute>
Expand Down Expand Up @@ -75,17 +79,24 @@
</j:if>
<div field-disabled="${paramValue?'true':null}"
class="credentials-select-content-select ${paramValue?'credentials-select-content-inactive':'credentials-select-content-active'}">
<!-- TODO: help links -->
<!-- TODO: update the build-with-parameters.png screenshot in documentation -->
<div class="include-user-credentials">
<label field-disabled="true">
<input type="checkbox" name="includeUser"/>
${%includeUserCredentials}
</label>
<div class="warning user-credentials-caution" style="display:none">
${%userCredentialsCaution}
</div>
</div>
<j:choose>
<j:when test="${includeUser and attrs.includeUserCaution}">
<!-- TODO: help links -->
<!-- TODO: update the build-with-parameters.png screenshot in documentation -->
<div class="include-user-credentials">
<label field-disabled="true">
<input type="checkbox" name="includeUser"/>
${%includeUserCredentials}
</label>
<div class="warning user-credentials-caution" style="display:none">
${%userCredentialsCaution}
</div>
</div>
</j:when>
<j:otherwise>
<input type="hidden" name="includeUser" value="${includeUser}"/>
</j:otherwise>
</j:choose>
<f:select clazz="${attrs.clazz} credentials-select" field="${attrs.field}"
default="${paramDefault?'':attrs.default}" value="${paramValue?(paramDefault?'':attrs.default):value}"
checkMethod="${attrs.checkMethod}"/>
Expand Down

0 comments on commit dd269c3

Please sign in to comment.