Merge pull request #437 from wso2/IoTS-1.0.0

Freezing code for the release
4.x.x
Charitha Goonetilleke 8 years ago committed by GitHub
commit a040be18d8

@ -50,15 +50,17 @@ under the License. --}}
{{defineZone "header"}} {{defineZone "header"}}
<div class="navbar-wrapper">
{{defineZone "navbars"}}
</div>
{{defineZone "sidePanes"}} {{defineZone "sidePanes"}}
<!-- page-content-wrapper --> <!-- page-content-wrapper -->
<div class="page-content-wrapper"> <div class="page-content-wrapper">
{{defineZone "contentTitle"}}
<div class="navbar-wrapper">
{{defineZone "navbars"}}
</div>
{{!defineZone "contentTitle"}}
<div class="container-fluid "> <div class="container-fluid ">
<div class="body-wrapper"> <div class="body-wrapper">
{{defineZone "content"}} {{defineZone "content"}}

@ -117,18 +117,7 @@
<h4> <h4>
Select user roles to manage group sharing Select user roles to manage group sharing
<br><br> <br><br>
<div style="max-height: 200px; overflow: scroll"> <div style="max-height: 200px; overflow: scroll" id="rolesListing">
<br />
{{#each userRoles}}
<div class="wr-input-control">
<label class="wr-input-control checkbox">
<input class="roleCheckBoxes" type="checkbox"
data-role-name="{{this}}" />
<span class="helper"
title="{{this}}">{{this}}</span>
</label>
</div>
{{/each}}
</div> </div>
</h4> </h4>
</div> </div>
@ -144,7 +133,7 @@
</a> </a>
{{/if}} {{/if}}
<a href="#" id="share-group-next-link" class="btn-operations"> <a href="#" id="share-group-next-link" class="btn-operations">
Next Share
</a> </a>
</div> </div>
</div> </div>

@ -23,10 +23,6 @@ function onRequest(context) {
var groupPermissions = require("/app/pages/cdmf.page.groups/public/group-permissions.json"); var groupPermissions = require("/app/pages/cdmf.page.groups/public/group-permissions.json");
var currentUser = session.get(constants.USER_SESSION_KEY); var currentUser = session.get(constants.USER_SESSION_KEY);
var page = {}; var page = {};
var rolesResult = userModule.getRoles();
if (rolesResult.status == "success") {
page.userRoles = rolesResult.content;
}
if (currentUser) { if (currentUser) {
page.permissions = userModule.getUIPermissions(); page.permissions = userModule.getUIPermissions();
page.permissions.list = stringify(page.permissions); page.permissions.list = stringify(page.permissions);

@ -372,7 +372,7 @@ function attachEvents() {
$(modalPopupContent).html($('#share-group-w1-modal-content').html()); $(modalPopupContent).html($('#share-group-w1-modal-content').html());
showPopup(); showPopup();
markAlreadySavedUsersRoles(groupId); listAllRoles(groupId);
var shareGroupNextLink = $("a#share-group-next-link"); var shareGroupNextLink = $("a#share-group-next-link");
shareGroupNextLink.click(function () { shareGroupNextLink.click(function () {
var roles = []; var roles = [];
@ -512,6 +512,41 @@ function markAlreadySavedUsersRoles(groupId) {
}); });
} }
function listAllRoles(groupId) {
var successCallback = function (data, textStatus, xhr) {
data = JSON.parse(data);
if (xhr.status == 200) {
if (data.roles.length > 0) {
var html = "<br/>";
for (var i = 0; i < data.roles.length; i++) {
html += '<div class="wr-input-control"><label class="wr-input-control checkbox">' +
'<input class="roleCheckBoxes" type="checkbox" data-role-name="' + data.roles[i] + '" />' +
'<span class="helper" title="' + data.roles[i] + '">' + data.roles[i] +
'</span></label></div>';
$('.roleCheckBoxes').each(
function () {
if (data.roles[i] == $(this).data('role-name')) {
$(this).attr('checked', true);
}
}
);
}
$("#rolesListing").html(html);
markAlreadySavedUsersRoles(groupId);
} else {
$("#rolesListing").html("No roles available");
}
} else {
displayErrors(xhr);
}
};
invokerUtil.get("/api/device-mgt/v1.0/roles?offset=0&limit=100&user-store=all",
successCallback, function (message) {
displayErrors(message);
});
}
function addNewRole(roles) { function addNewRole(roles) {
$(modalPopupContent).html($('#share-group-w3-modal-content').html()); $(modalPopupContent).html($('#share-group-w3-modal-content').html());
$("a#share-group-w3-yes-link").click(function () { $("a#share-group-w3-yes-link").click(function () {
@ -547,10 +582,6 @@ function togglePermissionAction(element) {
function updateGroupShare(groupId, roles) { function updateGroupShare(groupId, roles) {
var successCallback = function (data) { var successCallback = function (data) {
$(modalPopupContent).html($('#share-group-200-content').html()); $(modalPopupContent).html($('#share-group-200-content').html());
setTimeout(function () {
hidePopup();
location.reload(false);
}, 2000);
}; };
invokerUtil.post("/api/device-mgt/v1.0/groups/id/" + groupId + "/share", invokerUtil.post("/api/device-mgt/v1.0/groups/id/" + groupId + "/share",

@ -13,61 +13,59 @@
<div class="page-content-wrapper"> <div class="page-content-wrapper">
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;"> <div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
<div class="media"> <div class="media">
<div class="media-body asset-desc add-padding-left-5x"> <div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px"> Policy Overview
Policy Overview </div>
</div> {{#defineZone "policy-detail-properties"}}
{{#defineZone "policy-detail-properties"}} <table class="table table-responsive table-striped" id="members">
<table class="table table-responsive table-striped" id="members"> <tbody>
<tbody> <tr role="row" class="even">
<tr role="row" class="even"> <td class="sorting_1" style="padding:10px 15px; width: 14%;">Platform</td>
<td class="sorting_1" style="padding:10px 15px; width: 14%;">Platform</td> <td id="policy-platform" style="padding:10px 15px;"></td>
<td id="policy-platform" style="padding:10px 15px;"></td> </tr>
</tr> <tr role="row" class="odd">
<tr role="row" class="odd"> <td class="sorting_1" style="padding:10px 15px;">Ownership</td>
<td class="sorting_1" style="padding:10px 15px;">Ownership</td> <td id="policy-assignment" style="padding:10px 15px;"></td>
<td id="policy-assignment" style="padding:10px 15px;"></td> </tr>
</tr> <tr role="row" class="even">
<tr role="row" class="even"> <td class="sorting_1" style="padding:10px 15px;">Action upon non-compliance</td>
<td class="sorting_1" style="padding:10px 15px;">Action upon non-compliance</td> <td id="policy-action" style="padding:10px 15px;"></td>
<td id="policy-action" style="padding:10px 15px;"></td> </tr>
</tr> <tr role="row" class="even">
<tr role="row" class="even"> <td class="sorting_1" style="padding:10px 15px;">Status</td>
<td class="sorting_1" style="padding:10px 15px;">Status</td> <td id="policy-status" style="padding:10px 15px;"></td>
<td id="policy-status" style="padding:10px 15px;"></td> </tr>
</tr> <tr role="row" id="users-row" class="even">
<tr role="row" id="users-row" class="even"> <td class="sorting_1" style="padding:10px 15px;">Assigned Users</td>
<td class="sorting_1" style="padding:10px 15px;">Assigned Users</td> <td id="policy-users" style="padding:10px 15px;"></td>
<td id="policy-users" style="padding:10px 15px;"></td> </tr>
</tr> <tr role="row" id="roles-row" class="even">
<tr role="row" id="roles-row" class="even"> <td class="sorting_1" style="padding:10px 15px;">Assigned Roles</td>
<td class="sorting_1" style="padding:10px 15px;">Assigned Roles</td> <td id="policy-roles" style="padding:10px 15px;"></td>
<td id="policy-roles" style="padding:10px 15px;"></td> </tr>
</tr> </tbody>
</tbody> </table>
</table> {{/defineZone}}
{{/defineZone}} <div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Description
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Description </div>
</div> <div class="add-margin-top-4x">
<div class="add-margin-top-4x"> <div id="policy-description" class="panel-title-description"></div>
<div id="policy-description" class="panel-title-description"></div> </div>
</div> <br>
<br> <div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px"> Profile Information
Profile Information </div>
<div class="add-margin-top-4x">
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="add-margin-top-4x"> <div class="wr-advance-operations">
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert"> <div class="wr-advance-operations-init">
<i class="icon fw fw-error"></i><span></span> <br>
</div> <i class="fw fw-settings fw-spin fw-2x"></i>
<div class="wr-advance-operations"> Loading platform features . . .
<div class="wr-advance-operations-init"> <br>
<br> <br>
<i class="fw fw-settings fw-spin fw-2x"></i>
Loading platform features . . .
<br>
<br>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -3522,7 +3522,7 @@ a.btn-operations {
font-size: 13px; font-size: 13px;
color: #fff; color: #fff;
background: #11375B; background: #11375B;
padding: 10px 24px; padding: 5px 20px;
display: inline-block; display: inline-block;
margin-right: 2px; margin-right: 2px;
text-decoration: none; text-decoration: none;

Loading…
Cancel
Save