From f3a43ab270c7a149815a707c3163301d96bd4132 Mon Sep 17 00:00:00 2001 From: kamidu Date: Mon, 3 Apr 2017 17:26:00 +0530 Subject: [PATCH 1/2] policy filtering or cloud --- .../app/units/cdmf.unit.policy.create/create.js | 10 ++++++---- .../cdmf.unit.policy.create/public/js/policy-create.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js index 1b945e5e7c..a5d7846d54 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js @@ -50,17 +50,17 @@ function onRequest(context) { var policyOperationsTemplateSrc = policyWizardSrc + "/public/templates/" + deviceType + "-policy-operations.hbs"; if (new File(policyOperationsTemplateSrc).isExists()) { content["template"] = "/public/cdmf.unit.device.type." + deviceType + - ".policy-wizard/templates/" + deviceType + "-policy-operations.hbs"; + ".policy-wizard/templates/" + deviceType + "-policy-operations.hbs"; } var policyOperationsScriptSrc = policyWizardSrc + "/public/js/" + deviceType + "-policy-operations.js"; if (new File(policyOperationsScriptSrc).isExists()) { content["script"] = "/public/cdmf.unit.device.type." + deviceType + - ".policy-wizard/js/" + deviceType + "-policy-operations.js";; + ".policy-wizard/js/" + deviceType + "-policy-operations.js";; } var policyOperationsStylesSrc = policyWizardSrc + "/public/css/" + deviceType + "-policy-operations.css"; if (new File(policyOperationsStylesSrc).isExists()) { content["style"] = "/public/cdmf.unit.device.type." + deviceType + - ".policy-wizard/css/" + deviceType + "-policy-operations.css";; + ".policy-wizard/css/" + deviceType + "-policy-operations.css";; } types["types"].push(content); } @@ -74,6 +74,8 @@ function onRequest(context) { types["roles"] = roles["content"]; } types["groups"] = groupModule.getGroups(); - + var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; + types["isCloud"] = devicemgtProps.isCloud; + return types; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js index 14d08a9969..303f338140 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js @@ -146,7 +146,7 @@ stepForwardFrom["policy-platform"] = function (actionButton) { if (policyOperationsTemplateSrc) { $.template(policyOperationsTemplateCacheKey, context + policyOperationsTemplateSrc, function (template) { - var content = template(); + var content = template({"iscloud" : $("#logged-in-user").data("iscloud")}); $("#device-type-policy-operations").html(content).removeClass("hidden"); $(".policy-platform").addClass("hidden"); }); From ba65a21e1caf970cbf9929046e2d3d9e86a98ee9 Mon Sep 17 00:00:00 2001 From: kamidu Date: Mon, 3 Apr 2017 18:55:24 +0530 Subject: [PATCH 2/2] removing cope policies from cloud --- .../devicemgt/app/units/cdmf.unit.policy.create/create.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs index e1d7585a38..95b7f33c54 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs @@ -1,7 +1,7 @@ {{#zone "content"}} {{#if isAuthorized}} + data-tenant-id="{{user.tenantId}}" data-iscloud="{{isCloud}}">
@@ -284,8 +284,8 @@
{{#unless types}} -

No compatible device types have been installed. - Install device types to add policies.

+

No compatible device types have been installed. + Install device types to add policies.

{{/unless}}