diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index ad21486735d..70ec598a59e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -1994,10 +1994,10 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv int tenantId = this.getTenantId(); switch (newStatus) { case ACTIVE: - updateEnrollment(deviceId, enrolmentInfo, tenantId); + isDeviceUpdated = updateEnrollment(deviceId, enrolmentInfo, tenantId); break; case INACTIVE: - updateEnrollment(deviceId, enrolmentInfo, tenantId); + isDeviceUpdated = updateEnrollment(deviceId, enrolmentInfo, tenantId); break; case REMOVED: isDeviceUpdated = disenrollDevice(deviceIdentifier); @@ -2010,12 +2010,16 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv private boolean updateEnrollment(int deviceId, EnrolmentInfo enrolmentInfo, int tenantId) throws DeviceManagementException { + boolean isUpdatedEnrollment = false; boolean isAutoCommit = true; try { DeviceManagementDAOFactory.openConnection(); isAutoCommit = DeviceManagementDAOFactory.getConnection().getAutoCommit(); DeviceManagementDAOFactory.getConnection().setAutoCommit(true); - enrollmentDAO.updateEnrollment(deviceId, enrolmentInfo, tenantId); + int updatedRows = enrollmentDAO.updateEnrollment(deviceId, enrolmentInfo, tenantId); + if (updatedRows > 0) { + isUpdatedEnrollment = true; + } } catch (SQLException e) { throw new DeviceManagementException("Error occurred while opening a connection to the data source", e); } catch (DeviceManagementDAOException e) { @@ -2029,7 +2033,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv } DeviceManagementDAOFactory.closeConnection(); } - return true; + return isUpdatedEnrollment; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index 4a75088a26a..c8c58fe396c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -202,4 +202,4 @@ "backendRestEndpoints": { "deviceMgt": "/api/device-mgt/v1.0" } -} \ No newline at end of file +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.details/details.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.details/details.js index 045f9ffecb0..cd1602cd5b8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.details/details.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.details/details.js @@ -18,8 +18,6 @@ function onRequest(context) { var log = new Log("detail.js"); - var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; - var permissions = userModule.getUIPermissions(); var device = context.unit.params.device; - return {"device": device, "permissions":permissions}; + return {"device": device}; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs index f1c54965ea4..c6cea1c6c11 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs @@ -53,25 +53,25 @@ {{#if permissions.CHANGE_DEVICE_STATUS}} {{#equal device.status "ACTIVE"}} - {{/equal}} {{#equal device.status "INACTIVE"}} - {{/equal}} {{#equal device.status "BLOCKED"}} - {{/equal}} {{#equal device.status "REMOVED"}} - {{/equal}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs index 252d7679ff9..903224be543 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/view.hbs @@ -15,6 +15,7 @@ specific language governing permissions and limitations under the License. }} +{{unit "cdmf.unit.lib.editable"}} {{#zone "content"}} {{#if deviceFound}} {{#if isAuthorized}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.editable/editable.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.editable/editable.json index 877ad82b4e1..3fb741b843a 100755 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.editable/editable.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.lib.editable/editable.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "index": 40 } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css index fbdb93719cf..d76b3d08580 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-desktop.css @@ -6609,4 +6609,11 @@ header.header-default { .tooltip-overflow-fix{ overflow: visible !important; + +.editable-input select{ + height: 35px !important; +} +.editable-submit, .editable-cancel{ + padding: 8px 15px !important; + line-height: 0px !important; }