mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #437 from wso2/IoTS-1.0.0
Freezing code for the release
This commit is contained in:
commit
a040be18d8
@ -50,15 +50,17 @@ under the License. --}}
|
||||
|
||||
{{defineZone "header"}}
|
||||
|
||||
<div class="navbar-wrapper">
|
||||
{{defineZone "navbars"}}
|
||||
</div>
|
||||
|
||||
{{defineZone "sidePanes"}}
|
||||
|
||||
<!-- 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="body-wrapper">
|
||||
{{defineZone "content"}}
|
||||
|
||||
@ -117,18 +117,7 @@
|
||||
<h4>
|
||||
Select user roles to manage group sharing
|
||||
<br><br>
|
||||
<div style="max-height: 200px; overflow: scroll">
|
||||
<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 style="max-height: 200px; overflow: scroll" id="rolesListing">
|
||||
</div>
|
||||
</h4>
|
||||
</div>
|
||||
@ -144,7 +133,7 @@
|
||||
</a>
|
||||
{{/if}}
|
||||
<a href="#" id="share-group-next-link" class="btn-operations">
|
||||
Next
|
||||
Share
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -23,10 +23,6 @@ function onRequest(context) {
|
||||
var groupPermissions = require("/app/pages/cdmf.page.groups/public/group-permissions.json");
|
||||
var currentUser = session.get(constants.USER_SESSION_KEY);
|
||||
var page = {};
|
||||
var rolesResult = userModule.getRoles();
|
||||
if (rolesResult.status == "success") {
|
||||
page.userRoles = rolesResult.content;
|
||||
}
|
||||
if (currentUser) {
|
||||
page.permissions = userModule.getUIPermissions();
|
||||
page.permissions.list = stringify(page.permissions);
|
||||
|
||||
@ -372,7 +372,7 @@ function attachEvents() {
|
||||
$(modalPopupContent).html($('#share-group-w1-modal-content').html());
|
||||
showPopup();
|
||||
|
||||
markAlreadySavedUsersRoles(groupId);
|
||||
listAllRoles(groupId);
|
||||
var shareGroupNextLink = $("a#share-group-next-link");
|
||||
shareGroupNextLink.click(function () {
|
||||
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) {
|
||||
$(modalPopupContent).html($('#share-group-w3-modal-content').html());
|
||||
$("a#share-group-w3-yes-link").click(function () {
|
||||
@ -547,10 +582,6 @@ function togglePermissionAction(element) {
|
||||
function updateGroupShare(groupId, roles) {
|
||||
var successCallback = function (data) {
|
||||
$(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",
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
<div class="page-content-wrapper">
|
||||
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
|
||||
<div class="media">
|
||||
<div class="media-body asset-desc add-padding-left-5x">
|
||||
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
|
||||
Policy Overview
|
||||
</div>
|
||||
@ -73,7 +72,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<h1 class="page-sub-title">
|
||||
Permission Denied
|
||||
|
||||
@ -3522,7 +3522,7 @@ a.btn-operations {
|
||||
font-size: 13px;
|
||||
color: #fff;
|
||||
background: #11375B;
|
||||
padding: 10px 24px;
|
||||
padding: 5px 20px;
|
||||
display: inline-block;
|
||||
margin-right: 2px;
|
||||
text-decoration: none;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user