From 77ec1c4107466879f263f1ec08daf919faf89423 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Thu, 2 Mar 2017 20:27:46 +0530 Subject: [PATCH 1/2] fixed operation bar permission rendering issue --- .../app/modules/business-controllers/operation.js | 14 +++++++++++++- .../operation-bar.hbs | 5 ----- .../operation-bar.js | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/business-controllers/operation.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/business-controllers/operation.js index e96ffcdec1..58d0f5f2bc 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/business-controllers/operation.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/business-controllers/operation.js @@ -60,7 +60,19 @@ var operationModule = function () { feature["description"] = features[i].description; feature["deviceType"] = deviceType; feature["params"] = []; - var metaData = features[i].metadataEntries; + var featuresEntry = utility.getDeviceTypeConfig(deviceType)["deviceType"]["features"]; + if (featuresEntry) { + var featureEntry = featuresEntry[features[i].code]; + if (featureEntry) { + var permissionEntry = featureEntry["permission"]; + log.error(permissionEntry); + if (permissionEntry) { + feature["permission"] = permissionEntry + } + } + } + + var metaData = features[i].metadataEntries; if (metaData) { for (var j = 0; j < metaData.length; j++) { feature["params"].push(metaData[j].value); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs index 688302a90d..3a5a60956a 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/operation-bar.hbs @@ -113,11 +113,6 @@ {{/each}} -{{else}} -
-

- Operations Loading Failed!

-
{{/if}}