From 625fb7d07ef07f617afe5254e275355724a13e28 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Tue, 12 Mar 2019 22:00:18 +0530 Subject: [PATCH] Allow webclips installation via enrollment app install policy --- .../devicemgt/app/modules/business-controllers/policy.js | 8 +++++++- .../cdmf.unit.policy.create/public/js/policy-create.js | 2 +- .../units/cdmf.unit.policy.edit/public/js/policy-edit.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js index c1be205a634..e36069f8025 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/policy.js @@ -223,7 +223,13 @@ policyModule = function () { appObjectToView = {}; appObjectToView["appName"] = appObjectFromRestEndpoint["name"]; appObjectToView["appId"] = appObjectFromRestEndpoint["id"]; - appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["package"]; + if ("webapp" === appObjectFromRestEndpoint["platform"]) { + appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["weburl"]; + appObjectToView["type"] = "Web Clip" + } else { + appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["package"]; + appObjectToView["type"] = "Mobile App" + } appObjectToView["version"] = appObjectFromRestEndpoint["version"]; appObjectToView["platform"] = appObjectFromRestEndpoint["platform"]; storeApps.push(appObjectToView); 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 8486e150317..ca52864f3f5 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 @@ -202,7 +202,7 @@ function getStoreApps(storeApps, deviceType) { var selectedApps = []; var i; for (i=0; i