|
|
@ -179,52 +179,47 @@ skipStep["policy-platform"] = function (policyPayloadObj) {
|
|
|
|
$("#policy-profile-page-wizard-title").text("EDIT " + policy["platform"] + " POLICY - " + policy["name"]);
|
|
|
|
$("#policy-profile-page-wizard-title").text("EDIT " + policy["platform"] + " POLICY - " + policy["name"]);
|
|
|
|
|
|
|
|
|
|
|
|
var deviceType = policy["platform"];
|
|
|
|
var deviceType = policy["platform"];
|
|
|
|
var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
|
|
|
|
var policyOperations = $("#policy-operations");
|
|
|
|
'.policy-edit/templates/' + deviceType + '-policy-edit.hbs';
|
|
|
|
var policyEditTemplateSrc = $(policyOperations).data("template");
|
|
|
|
var policyOperationsScriptSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
|
|
|
|
var policyEditScriptSrc = $(policyOperations).data("script");
|
|
|
|
'.policy-edit/js/' + deviceType + '-policy-edit.js';
|
|
|
|
var policyEditStylesSrc = $(policyOperations).data("style");
|
|
|
|
var policyOperationsStylesSrc = context + '/public/cdmf.unit.device.type.' + deviceType +
|
|
|
|
var policyEditTemplateCacheKey = deviceType + '-policy-edit';
|
|
|
|
'.policy-edit/css/' + deviceType + '-policy-edit.css';
|
|
|
|
|
|
|
|
var policyOperationsTemplateCacheKey = deviceType + '-policy-operations';
|
|
|
|
if (policyEditTemplateSrc) {
|
|
|
|
|
|
|
|
if (policyEditScriptSrc) {
|
|
|
|
$.isResourceExists(policyOperationsTemplateSrc, function (status) {
|
|
|
|
var script = document.createElement('script');
|
|
|
|
if (status) {
|
|
|
|
script.type = 'text/javascript';
|
|
|
|
$.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) {
|
|
|
|
script.src = context + policyEditScriptSrc;
|
|
|
|
var content = template();
|
|
|
|
$(".wr-advance-operations").prepend(script);
|
|
|
|
$("#device-type-policy-operations").html(content).removeClass("hidden");
|
|
|
|
hasPolicyProfileScript = true;
|
|
|
|
$(".policy-platform").addClass("hidden");
|
|
|
|
|
|
|
|
$.isResourceExists(policyOperationsScriptSrc, function (status) {
|
|
|
|
|
|
|
|
if (status) {
|
|
|
|
|
|
|
|
hasPolicyProfileScript = true;
|
|
|
|
|
|
|
|
var script = document.createElement('script');
|
|
|
|
|
|
|
|
script.type = 'text/javascript';
|
|
|
|
|
|
|
|
script.src = policyOperationsScriptSrc;
|
|
|
|
|
|
|
|
$(".wr-advance-operations").prepend(script);
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
This method should be implemented in the relevant plugin side and should include the logic to
|
|
|
|
|
|
|
|
populate the policy profile in the plugin specific UI.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.isResourceExists(policyOperationsStylesSrc, function (status) {
|
|
|
|
|
|
|
|
if (status) {
|
|
|
|
|
|
|
|
var style = document.createElement('link');
|
|
|
|
|
|
|
|
style.type = 'text/css';
|
|
|
|
|
|
|
|
style.rel = 'stylesheet';
|
|
|
|
|
|
|
|
style.href = policyOperationsStylesSrc;
|
|
|
|
|
|
|
|
$(".wr-advance-operations").prepend(style);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#generic-policy-operations").removeClass("hidden");
|
|
|
|
hasPolicyProfileScript = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$(".wr-advance-operations-init").addClass("hidden");
|
|
|
|
$.template(policyEditTemplateCacheKey, context + policyEditTemplateSrc, function (template) {
|
|
|
|
});
|
|
|
|
var content = template();
|
|
|
|
|
|
|
|
$("#device-type-policy-operations").html(content).removeClass("hidden");
|
|
|
|
|
|
|
|
$(".policy-platform").addClass("hidden");
|
|
|
|
|
|
|
|
if (hasPolicyProfileScript) {
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
This method should be implemented in the relevant plugin side and should include the logic to
|
|
|
|
|
|
|
|
populate the policy profile in the plugin specific UI.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$("#generic-policy-operations").removeClass("hidden");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (policyEditStylesSrc) {
|
|
|
|
|
|
|
|
var style = document.createElement('link');
|
|
|
|
|
|
|
|
style.type = 'text/css';
|
|
|
|
|
|
|
|
style.rel = 'stylesheet';
|
|
|
|
|
|
|
|
style.href = context + policyEditStylesSrc;
|
|
|
|
|
|
|
|
$(".wr-advance-operations").prepend(style);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$(".wr-advance-operations-init").addClass("hidden");
|
|
|
|
|
|
|
|
|
|
|
|
if(!hasPolicyProfileScript) {
|
|
|
|
if (!hasPolicyProfileScript) {
|
|
|
|
populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
|
|
|
|
populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|