|
|
@ -33,6 +33,8 @@ var clearInline = {};
|
|
|
|
|
|
|
|
|
|
|
|
var apiBasePath = "/api/device-mgt/v1.0";
|
|
|
|
var apiBasePath = "/api/device-mgt/v1.0";
|
|
|
|
var domain = $("#domain").val();
|
|
|
|
var domain = $("#domain").val();
|
|
|
|
|
|
|
|
var isCloud = $("#role-create-form").data("cloud");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var enableInlineError = function (inputField, errorMsg, errorSign) {
|
|
|
|
var enableInlineError = function (inputField, errorMsg, errorSign) {
|
|
|
|
var fieldIdentifier = "#" + inputField;
|
|
|
|
var fieldIdentifier = "#" + inputField;
|
|
|
@ -114,6 +116,8 @@ function formatRepoSelection (user) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
isCloud = $("#role-create-form").data("cloud");
|
|
|
|
|
|
|
|
|
|
|
|
var appContext = $("#app-context").data("app-context");
|
|
|
|
var appContext = $("#app-context").data("app-context");
|
|
|
|
$("#users").select2({
|
|
|
|
$("#users").select2({
|
|
|
|
multiple: true,
|
|
|
|
multiple: true,
|
|
|
@ -151,7 +155,9 @@ $(document).ready(function () {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cache: true
|
|
|
|
cache: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
|
|
|
escapeMarkup: function (markup) {
|
|
|
|
|
|
|
|
return markup;
|
|
|
|
|
|
|
|
}, // let our custom formatter work
|
|
|
|
minimumInputLength: 1,
|
|
|
|
minimumInputLength: 1,
|
|
|
|
templateResult: formatRepo, // omitted for brevity, see the source of this page
|
|
|
|
templateResult: formatRepo, // omitted for brevity, see the source of this page
|
|
|
|
templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
|
|
|
|
templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
|
|
|
@ -163,6 +169,7 @@ $(document).ready(function () {
|
|
|
|
* on Add Role page in WSO2 MDM Console.
|
|
|
|
* on Add Role page in WSO2 MDM Console.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$("button#add-role-btn").click(function () {
|
|
|
|
$("button#add-role-btn").click(function () {
|
|
|
|
|
|
|
|
|
|
|
|
var domain = $("#domain").val();
|
|
|
|
var domain = $("#domain").val();
|
|
|
|
var roleNameInput = $("input#roleName");
|
|
|
|
var roleNameInput = $("input#roleName");
|
|
|
|
var roleName = roleNameInput.val();
|
|
|
|
var roleName = roleNameInput.val();
|
|
|
@ -185,7 +192,11 @@ $(document).ready(function () {
|
|
|
|
$(errorMsgWrapper).removeClass("hidden");
|
|
|
|
$(errorMsgWrapper).removeClass("hidden");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
var addRoleFormData = {};
|
|
|
|
var addRoleFormData = {};
|
|
|
|
|
|
|
|
if (isCloud) {
|
|
|
|
|
|
|
|
addRoleFormData.roleName = "devicemgt" + roleName;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
addRoleFormData.roleName = roleName;
|
|
|
|
addRoleFormData.roleName = roleName;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (domain != "PRIMARY") {
|
|
|
|
if (domain != "PRIMARY") {
|
|
|
|
addRoleFormData.roleName = domain + "/" + roleName;
|
|
|
|
addRoleFormData.roleName = domain + "/" + roleName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|