From 049c6bcdae98a393ebfec797b19e5864515f97f2 Mon Sep 17 00:00:00 2001 From: kamidu Date: Mon, 18 Dec 2017 20:58:58 +0530 Subject: [PATCH] Enaled policy description on effective policy view --- .../public/js/view.js | 55 ++++++++----------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js index 27a1960b8f..bb11a38d26 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js @@ -81,40 +81,33 @@ var displayPolicy = function (policyPayloadObj) { var policyOperationsStylesSrc = context + '/public/cdmf.unit.device.type.' + deviceType + '.policy-view/css/' + deviceType + '-policy-view.css'; var policyOperationsTemplateCacheKey = deviceType + '-policy-operations'; - + $.isResourceExists(policyOperationsTemplateSrc, function (status) { - if (status) { - $.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) { - var content = template(); - $("#device-type-policy-operations").html(content).removeClass("hidden"); - $(".policy-platform").addClass("hidden"); - $.isResourceExists(policyOperationsScriptSrc, function (status) { - if (status) { - 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"]); - } - }); + $.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) { + var content = template(); + $("#device-type-policy-operations").html(content).removeClass("hidden"); + $(".policy-platform").addClass("hidden"); + $.isResourceExists(policyOperationsScriptSrc, function (status) { + 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) { + var style = document.createElement('link'); + style.type = 'text/css'; + style.rel = 'stylesheet'; + style.href = policyOperationsStylesSrc; + $(".wr-advance-operations").prepend(style); + }); - $.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 { - $("#generic-policy-operations").removeClass("hidden"); - } $(".wr-advance-operations-init").addClass("hidden"); }); };