From 6656f9e6f09761577d8f4a3d7ab85db63612478d Mon Sep 17 00:00:00 2001 From: charitha Date: Wed, 22 Mar 2017 15:04:21 +0530 Subject: [PATCH 1/3] Add support for hybrid device types which has emulation/virtual capabilities (cherry picked from commit 78b7037) --- .../listing.hbs | 6 +++--- .../cdmf.unit.device.types.listing/listing.js | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs index d40bb52ada..b51e7f0eb8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs @@ -67,11 +67,11 @@

- - our {{deviceTypeLabel}} device + our {{deviceTypeLabel}} device

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js index 1e1cefcb83..9b0cdacddb 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.js @@ -21,6 +21,7 @@ function onRequest(context) { var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType"; var DTYPE_CONF_DEVICE_CATEGORY = "category"; var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label"; + var DTYPE_CONF_VIRTUAL_DEVICE_TYPE_LABEL_KEY = "virtualLabel"; var viewModel = {}; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; @@ -54,6 +55,25 @@ function onRequest(context) { "deviceCategory": deviceCategory, "thumb": utility.getDeviceThumb(deviceType) }); + } else if (deviceCategory == 'hybrid') { + var virtualLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_VIRTUAL_DEVICE_TYPE_LABEL_KEY]; + if (!virtualLabel) { + virtualLabel = deviceTypeLabel; + } + virtualDeviceTypesList.push({ + "hasCustTemplate": false, + "deviceTypeLabel": virtualLabel, + "deviceTypeName": deviceType, + "deviceCategory": deviceCategory, + "thumb": utility.getDeviceThumb(deviceType) + }); + deviceTypesList.push({ + "hasCustTemplate": false, + "deviceTypeLabel": deviceTypeLabel, + "deviceTypeName": deviceType, + "deviceCategory": deviceCategory, + "thumb": utility.getDeviceThumb(deviceType) + }); } else { deviceTypesList.push({ "hasCustTemplate": false, From da69bc9fe53af79b056e08b86477edebe068c0a7 Mon Sep 17 00:00:00 2001 From: Madawa Soysa Date: Thu, 23 Mar 2017 11:06:52 +0530 Subject: [PATCH 2/3] Allowing configuration management in cloud environment --- .../app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs index 78aa84e001..1302e101db 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -87,7 +87,6 @@
  • Policy Management
  • {{/if}} - {{#unless isCloud}} {{#if permissions.TENANT_CONFIGURATION}}
  • Configuration Management
      @@ -99,9 +98,6 @@
  • {{/if}} - {{/unless}} - - {{/zone}} From d468ac07d083bf0917fb628e3fd32fe7e6f5d24d Mon Sep 17 00:00:00 2001 From: Harshan Liyanage Date: Thu, 23 Mar 2017 11:12:15 +0530 Subject: [PATCH 3/3] Revert "Allowing configuration management in cloud environment" --- .../app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs index 1302e101db..78aa84e001 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -87,6 +87,7 @@
  • Policy Management
  • {{/if}} + {{#unless isCloud}} {{#if permissions.TENANT_CONFIGURATION}}
  • Configuration Management
      @@ -98,6 +99,9 @@
  • {{/if}} + {{/unless}} + + {{/zone}}