Adding policy create UI updates

revert-dabc3590
dilanua 9 years ago
parent 891f0964ba
commit aada09de10

@ -256,9 +256,10 @@
<a href="javascript:void(0)" <a href="javascript:void(0)"
class="wizard-stepper {{name}}-platform" class="wizard-stepper {{name}}-platform"
data-current="policy-platform" data-current="policy-platform"
data-next="policy-profile" data-platform="android" data-next="policy-profile" data-platform="{{name}}"
data-validate="false"> data-validate="false">
<img src="{{icon}}" width="50px" height="50px" /><br><br> <img src="{{icon}}" width="50px" height="50px" />
<br><br>
<b>{{label}}</b> <b>{{label}}</b>
</a> </a>
</li> </li>

@ -16,17 +16,20 @@
* under the License. * under the License.
*/ */
function onRequest(context) { function onRequest() {
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType"; var log = new Log("/app/units/mdm.unit.policy.create");
var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
var utility = require("/app/modules/utility.js").utility; var CONF_DEVICE_TYPE_KEY = "deviceType";
var CONF_DEVICE_TYPE_LABEL_KEY = "label";
var utility = require("/app/modules/utility.js")["utility"];
var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var types = {}; var viewModelData = {};
types["types"] = []; viewModelData["types"] = [];
var typesListResponse = userModule.getPlatforms(); var typesListResponse = userModule.getPlatforms();
var deviceTypes = typesListResponse["content"]["deviceTypes"]; var deviceTypes = typesListResponse["content"]["deviceTypes"];
if (typesListResponse["status"] == "success") { if (typesListResponse["status"] == "success") {
for (var i = 0; i < deviceTypes.length; i++) { for (var i = 0; i < deviceTypes.length; i++) {
var content = {}; var content = {};
@ -34,16 +37,25 @@ function onRequest(context) {
content["name"] = deviceType; content["name"] = deviceType;
var configs = utility.getDeviceTypeConfig(deviceType); var configs = utility.getDeviceTypeConfig(deviceType);
var deviceTypeLabel = deviceType; var deviceTypeLabel = deviceType;
if (configs && configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]) { if (configs && configs[CONF_DEVICE_TYPE_KEY][CONF_DEVICE_TYPE_LABEL_KEY]) {
deviceTypeLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]; deviceTypeLabel = configs[CONF_DEVICE_TYPE_KEY][CONF_DEVICE_TYPE_LABEL_KEY];
} }
var policyWizard = new File("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard")); var policyWizard = new File("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard"));
log.error("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard"));
if (policyWizard.isExists()) { if (policyWizard.isExists()) {
content["icon"] = utility.getDeviceThumb(deviceType); content["icon"] = utility.getDeviceThumb(deviceType);
content["label"] = deviceTypeLabel; content["label"] = deviceTypeLabel;
types["types"].push(content); viewModelData["types"].push(content);
} }
} }
} }
return types;
var result = userModule.getRolesByUserStore();
if (result["status"] == "success") {
viewModelData["roles"] = result["content"];
}
return viewModelData;
} }

@ -2521,9 +2521,9 @@ $(document).ready(function () {
}, },
data: function (params) { data: function (params) {
var postData = {}; var postData = {};
postData.actionMethod = "GET"; postData.requestMethod = "GET";
postData.actionUrl = "/api/device-mgt/v1.0/users/search/usernames?filter=" + params.term; postData.requestURL = "/api/device-mgt/v1.0/users/search/usernames?filter=" + params.term;
postData.actionPayload = null; postData.requestPayload = null;
return JSON.stringify(postData); return JSON.stringify(postData);
}, },
processResults: function (data) { processResults: function (data) {

Loading…
Cancel
Save