Merge pull request #437 from wso2/IoTS-1.0.0

Freezing code for the release
merge-requests/7/head
Charitha Goonetilleke 8 years ago committed by GitHub
commit a040be18d8

@ -50,15 +50,17 @@ under the License. --}}
{{defineZone "header"}} {{defineZone "header"}}
{{defineZone "sidePanes"}}
<!-- page-content-wrapper -->
<div class="page-content-wrapper">
<div class="navbar-wrapper"> <div class="navbar-wrapper">
{{defineZone "navbars"}} {{defineZone "navbars"}}
</div> </div>
{{defineZone "sidePanes"}} {{!defineZone "contentTitle"}}
<!-- page-content-wrapper -->
<div class="page-content-wrapper">
{{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,7 +13,6 @@
<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>
@ -73,7 +72,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{{else}} {{else}}
<h1 class="page-sub-title"> <h1 class="page-sub-title">
Permission Denied Permission Denied

@ -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