From 5525c42eae9b754e5826d976fa580d2184d54c12 Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Wed, 23 Nov 2016 16:43:16 +0530 Subject: [PATCH 1/4] Removed Unneccsary title and added padding --- .../devicemgt/app/layouts/cdmf.layout.default.hbs | 12 +++++++----- .../cdmf.unit.ui.theme/public/css/custom-desktop.css | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.default.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.default.hbs index 0e6d17780d..cf5837c383 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.default.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.default.hbs @@ -50,15 +50,17 @@ under the License. --}} {{defineZone "header"}} - - {{defineZone "sidePanes"}}
- {{defineZone "contentTitle"}} + + + + {{!defineZone "contentTitle"}} +
{{defineZone "content"}} 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 34872f31a2..90ed8a2d2f 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 @@ -4615,7 +4615,7 @@ a.wr-side-panel-toggle-btn.selected { } .wr-hidden-operations-content .panel-body { - padding: 0px 20px 20px; + padding: 5px 20px 20px; background: #ffffff; } .wr-hidden-operations-content .panel-body hr{ From 03f965adf62a7cbb6c5215af44f52da613990470 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 25 Nov 2016 11:18:17 +0530 Subject: [PATCH 2/4] Decrease group listing page loading time with lazy roles listing --- .../app/pages/cdmf.page.groups/groups.hbs | 13 +------ .../app/pages/cdmf.page.groups/groups.js | 4 -- .../cdmf.page.groups/public/js/listing.js | 37 ++++++++++++++++++- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index ad4c096949..d77f18dc7a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -117,18 +117,7 @@

Select user roles to manage group sharing

-
-
- {{#each userRoles}} -
- -
- {{/each}} +

diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js index f432193231..0c04f9bb2d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.js @@ -23,10 +23,6 @@ function onRequest(context) { var groupPermissions = require("/app/pages/cdmf.page.groups/public/group-permissions.json"); var currentUser = session.get(constants.USER_SESSION_KEY); var page = {}; - var rolesResult = userModule.getRoles(); - if (rolesResult.status == "success") { - page.userRoles = rolesResult.content; - } if (currentUser) { page.permissions = userModule.getUIPermissions(); page.permissions.list = stringify(page.permissions); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index 1548ff4c71..04f044e11a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -372,7 +372,7 @@ function attachEvents() { $(modalPopupContent).html($('#share-group-w1-modal-content').html()); showPopup(); - markAlreadySavedUsersRoles(groupId); + listAllRoles(groupId); var shareGroupNextLink = $("a#share-group-next-link"); shareGroupNextLink.click(function () { var roles = []; @@ -512,6 +512,41 @@ function markAlreadySavedUsersRoles(groupId) { }); } +function listAllRoles(groupId) { + var successCallback = function (data, textStatus, xhr) { + data = JSON.parse(data); + if (xhr.status == 200) { + if (data.roles.length > 0) { + var html = "
"; + for (var i = 0; i < data.roles.length; i++) { + html += '
'; + $('.roleCheckBoxes').each( + function () { + if (data.roles[i] == $(this).data('role-name')) { + $(this).attr('checked', true); + } + } + ); + } + $("#rolesListing").html(html); + markAlreadySavedUsersRoles(groupId); + } else { + $("#rolesListing").html("No roles available"); + } + } else { + displayErrors(xhr); + } + }; + + invokerUtil.get("/api/device-mgt/v1.0/roles?offset=0&limit=100&user-store=all", + successCallback, function (message) { + displayErrors(message); + }); +} + function addNewRole(roles) { $(modalPopupContent).html($('#share-group-w3-modal-content').html()); $("a#share-group-w3-yes-link").click(function () { From 54bb91d4289e7efa93f37efe8e09498b0a6f68be Mon Sep 17 00:00:00 2001 From: Imesh Chandrasiri Date: Fri, 25 Nov 2016 11:19:14 +0530 Subject: [PATCH 3/4] IoT Build UI Fixes --- .../app/units/cdmf.unit.policy.view/view.hbs | 106 +++++++++--------- .../public/css/custom-desktop.css | 4 +- 2 files changed, 54 insertions(+), 56 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs index ea2b91a78c..a650c9e151 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs @@ -13,61 +13,59 @@
-
-
- Policy Overview -
- {{#defineZone "policy-detail-properties"}} - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Platform
Ownership
Action upon non-compliance
Status
Assigned Users
Assigned Roles
- {{/defineZone}} -
Description -
-
-
-
-
-
- Profile Information +
+ Policy Overview +
+ {{#defineZone "policy-detail-properties"}} + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Platform
Ownership
Action upon non-compliance
Status
Assigned Users
Assigned Roles
+ {{/defineZone}} +
Description +
+
+
+
+
+
+ Profile Information +
+
+ -
- -
-
-
- - Loading platform features . . . -
-
-
+
+
+
+ + Loading platform features . . . +
+
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 90ed8a2d2f..1a89379d3f 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 @@ -3522,7 +3522,7 @@ a.btn-operations { font-size: 13px; color: #fff; background: #11375B; - padding: 10px 24px; + padding: 5px 20px; display: inline-block; margin-right: 2px; text-decoration: none; @@ -4615,7 +4615,7 @@ a.wr-side-panel-toggle-btn.selected { } .wr-hidden-operations-content .panel-body { - padding: 5px 20px 20px; + padding: 0px 20px 20px; background: #ffffff; } .wr-hidden-operations-content .panel-body hr{ From 4789aafd28d9bc899f957eb874ceead155666a01 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 25 Nov 2016 12:28:48 +0530 Subject: [PATCH 4/4] Minor ui changes to the group listing --- .../devicemgt/app/pages/cdmf.page.groups/groups.hbs | 2 +- .../devicemgt/app/pages/cdmf.page.groups/public/js/listing.js | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs index d77f18dc7a..2c32a1227a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/groups.hbs @@ -133,7 +133,7 @@ {{/if}} - Next + Share
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js index 04f044e11a..439861e956 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js @@ -582,10 +582,6 @@ function togglePermissionAction(element) { function updateGroupShare(groupId, roles) { var successCallback = function (data) { $(modalPopupContent).html($('#share-group-200-content').html()); - setTimeout(function () { - hidePopup(); - location.reload(false); - }, 2000); }; invokerUtil.post("/api/device-mgt/v1.0/groups/id/" + groupId + "/share",