-
Unexpected error occurred!
+
Unexpected error occurred!
';
}
},
{
@@ -185,38 +185,38 @@ function loadGroups() {
var html = '';
if ($.hasPermission("VIEW_GROUP_DEVICES")) {
/*html += '
' +
- ''
- +
- 'Analytics';*/
+ + '/analytics" data-click-event="remove-form" class="btn padding-reduce-on-grid-view">' +
+ '
'
+ +
+ '
Analytics';*/
}
if (row.owner != "wso2.system.user") {
if ($.hasPermission("SHARE_GROUP")) {
html +=
- '
'
- +
- 'Share';
+ '
'
+ +
+ 'Share';
}
if ($.hasPermission("UPDATE_GROUP")) {
html +=
- '
' +
- 'Edit';
+ '
' +
+ 'Edit';
}
if ($.hasPermission("REMOVE_GROUP")) {
html +=
- '
'
- +
- 'Delete';
+ '
'
+ +
+ 'Delete';
}
}
return html;
@@ -251,21 +251,21 @@ function loadGroups() {
};
$('#group-grid').datatables_extended_serverside_paging(
- null,
- serviceURL,
- dataFilter,
- columns,
- fnCreatedRow,
- function (oSettings) {
- $(".icon .text").res_text(0.2);
- attachEvents();
- var thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable();
- thisTable.removeClass("table-selectable");
- },
- {
- "placeholder": "Search By Group Name",
- "searchKey": "name"
- }
+ null,
+ serviceURL,
+ dataFilter,
+ columns,
+ fnCreatedRow,
+ function (oSettings) {
+ $(".icon .text").res_text(0.2);
+ attachEvents();
+ var thisTable = $(this).closest('.dataTables_wrapper').find('.dataTable').dataTable();
+ thisTable.removeClass("table-selectable");
+ },
+ {
+ "placeholder": "Search By Group Name",
+ "searchKey": "name"
+ }
);
$(groupCheckbox).click(function () {
addGroupSelectedClass(this);
@@ -402,17 +402,16 @@ function attachEvents() {
var shareGroupNewRoleFromSelectionLink = $("a#share-group-new-role-from-selection");
shareGroupNewRoleFromSelectionLink.click(function () {
- var roles = [];
- $('.modal .roleCheckBoxes').each(
- function () {
- if ($(this).is(':checked')) {
- roles.push($(this).data('role-name'));
- }
- }
- );
- addNewRole(roles);
- // $(modalPopupContent).html($('#share-group-w3-modal-content').html());
- // createNewRole(roles);
+ var roles = $("#roles").val();
+ if (roles && roles.length >= 2) {
+ addNewRole(roles);
+ } else {
+ var errorMsgWrapper = "#notification-error-msg";
+ var errorMsg = "#notification-error-msg span";
+ $(errorMsg).text("To create a new role with the combination of roles, at least two roles should be" +
+ " selected.");
+ $(errorMsgWrapper).removeClass("hidden");
+ }
});
});
@@ -442,7 +441,7 @@ function attachEvents() {
};
invokerUtil.delete("/api/device-mgt/v1.0/groups/id/" + groupId,
- successCallback, function (message) {
+ successCallback, function (message) {
displayErrors(message);
});
});
@@ -487,7 +486,7 @@ function attachEvents() {
};
invokerUtil.put("/api/device-mgt/v1.0/groups/id/" + groupId, group,
- successCallback, function (message) {
+ successCallback, function (message) {
displayErrors(message);
});
});
@@ -517,7 +516,7 @@ function markAlreadySavedUsersRoles(groupId) {
};
invokerUtil.get("/api/device-mgt/v1.0/groups/id/" + groupId + "/roles",
- successCallback, function (message) {
+ successCallback, function (message) {
displayErrors(message);
});
}
@@ -534,9 +533,9 @@ function listAllRoles(groupId) {
html += '';
$("#rolesListing").html(html);
markAlreadySavedUsersRoles(groupId);
- $("select.select2[multiple=multiple]").select2({
- tags: false
- });
+ $("select.select2[multiple=multiple]").select2({tags: false}).on("select2:select", function () {
+ $("#notification-error-msg").addClass("hidden");
+ });
} else {
$("#rolesListing").html("No roles available");
}
@@ -546,7 +545,7 @@ function listAllRoles(groupId) {
};
invokerUtil.get("/api/device-mgt/v1.0/roles?offset=0&limit=100&user-store=all",
- successCallback, function (message) {
+ successCallback, function (message) {
displayErrors(message);
});
}
@@ -589,7 +588,7 @@ function updateGroupShare(groupId, roles) {
};
invokerUtil.post("/api/device-mgt/v1.0/groups/id/" + groupId + "/share",
- roles, successCallback, function (message) {
+ roles, successCallback, function (message) {
displayErrors(message);
});
}
@@ -600,7 +599,7 @@ function createNewCombinedRole(roleName, roleList) {
showPopup();
};
invokerUtil.post("/api/device-mgt/v1.0/roles/create-combined-role/" + roleName, roleList,
- successCallback, function (message) {
+ successCallback, function (message) {
displayErrors(message);
});
}
@@ -633,6 +632,9 @@ function displayErrors(jqXHR) {
});
} else {
$(modalPopupContent).html($('#group-unexpected-error-content').html());
+ if (jqXHR.responseText) {
+ $('#unexp-error-msg').html(jqXHR.responseText.replace(new RegExp("\"", 'g'), ""));
+ }
$("a#group-unexpected-error-link").click(function () {
hidePopup();
});
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js
index 7296b3ed89..e2a7182b6b 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js
@@ -164,6 +164,12 @@ skipStep["policy-platform"] = function (policyPayloadObj) {
$("#users-radio-btn").prop("checked", true);
$("#users-select-field").show();
$("#user-roles-select-field").hide();
+ $.each(currentlyEffected["users"], function (i, item) {
+ userInput.append($('