mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #1243 from rasika/master
Hide 'Select All' option when there're only single mandatory claim.
This commit is contained in:
commit
ceb2ff5d9c
@ -31,12 +31,14 @@
|
|||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<form id="consentForm" method="POST" action="/commonauth">
|
<form id="consentForm" method="POST" action="/commonauth">
|
||||||
<p>By selecting following attributes I agree to share them with the above service provider.</p>
|
<p>By selecting following attributes I agree to share them with the above service provider.</p>
|
||||||
|
{{#unless singleMandatoryClaim}}
|
||||||
<div class="wr-input-control">
|
<div class="wr-input-control">
|
||||||
<label class="wr-input-control checkbox">
|
<label class="wr-input-control checkbox">
|
||||||
<input type="checkbox" name="consent_select_all" id="consent_select_all"/>
|
<input type="checkbox" name="consent_select_all" id="consent_select_all"/>
|
||||||
<span class="helper" title="Select All">Select All</span>
|
<span class="helper" title="Select All">Select All</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
{{/unless}}
|
||||||
<div class="wr-input-control">
|
<div class="wr-input-control">
|
||||||
{{#each mandatoryClaims}}
|
{{#each mandatoryClaims}}
|
||||||
<label class="wr-input-control checkbox">
|
<label class="wr-input-control checkbox">
|
||||||
|
|||||||
@ -4,11 +4,13 @@ function onRequest(context) {
|
|||||||
viewModel.appName = Encode.forHtml(request.getParameter("sp"));
|
viewModel.appName = Encode.forHtml(request.getParameter("sp"));
|
||||||
var mandatoryClaims = [];
|
var mandatoryClaims = [];
|
||||||
var requestedClaims = [];
|
var requestedClaims = [];
|
||||||
|
var singleMandatoryClaim = false;
|
||||||
|
|
||||||
var mandatoryClaimsList, requestedClaimsList;
|
var mandatoryClaimsList, requestedClaimsList;
|
||||||
var i, j, partOne, partTwo;
|
var i, j, partOne, partTwo;
|
||||||
if (request.getParameter("mandatoryClaims")) {
|
if (request.getParameter("mandatoryClaims")) {
|
||||||
mandatoryClaimsList = request.getParameter("mandatoryClaims").split(",");
|
mandatoryClaimsList = request.getParameter("mandatoryClaims").split(",");
|
||||||
|
singleMandatoryClaim = (mandatoryClaimsList.length === 1);
|
||||||
for (j = 0; j < mandatoryClaimsList.length; j++) {
|
for (j = 0; j < mandatoryClaimsList.length; j++) {
|
||||||
var mandatoryClaimsStr = mandatoryClaimsList[j];
|
var mandatoryClaimsStr = mandatoryClaimsList[j];
|
||||||
i = mandatoryClaimsStr.indexOf('_');
|
i = mandatoryClaimsStr.indexOf('_');
|
||||||
@ -33,6 +35,7 @@ function onRequest(context) {
|
|||||||
}
|
}
|
||||||
viewModel.mandatoryClaims = mandatoryClaims;
|
viewModel.mandatoryClaims = mandatoryClaims;
|
||||||
viewModel.requestedClaims = requestedClaims;
|
viewModel.requestedClaims = requestedClaims;
|
||||||
|
viewModel.singleMandatoryClaim = singleMandatoryClaim;
|
||||||
viewModel.sessionDataKey = Encode.forHtmlAttribute(request.getParameter("sessionDataKey"));
|
viewModel.sessionDataKey = Encode.forHtmlAttribute(request.getParameter("sessionDataKey"));
|
||||||
return viewModel;
|
return viewModel;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user