From 3219ac21018d3178140a15ebcf0f0304a5dfbb87 Mon Sep 17 00:00:00 2001 From: kamidu Date: Fri, 12 Aug 2016 14:04:16 +0530 Subject: [PATCH 1/2] Fixing the notification listing ui --- .../listing.hbs | 53 ++++++++++--------- .../cdmf.unit.notification.listing/listing.js | 11 ++-- .../public/js/notification-listing.js | 4 +- .../public/templates/notification-listing.hbs | 8 +-- 4 files changed, 39 insertions(+), 37 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.hbs index 073d9cb3b2..694154c383 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.hbs @@ -15,47 +15,48 @@ specific language governing permissions and limitations under the License. }} - -
-
- -
-
- Device Notifications -
-
-
-
-
- +{{#zone "content"}} + +
+
+ +
+
+ Device Notifications +
+
+
+ -
-
- No unread messages +
+
+ No unread messages +
+
-
-
+{{/zone}} {{#zone "bottomJs"}} {{js "js/notification-listing.js"}} {{/zone}} \ 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.notification.listing/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.js index 0086ba8e3e..3512296bda 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/listing.js @@ -16,15 +16,16 @@ * under the License. */ -function onRequest(context){ +function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var constants = require("/app/modules/constants.js"); + var viewModel = {}; var permissions = []; - if(userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/notifications/list")){ + if (userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/notifications/list")) { permissions.push("LIST_NOTIFICATIONS"); } var currentUser = session.get(constants.USER_SESSION_KEY); - context.permissions = stringify(permissions); - context.currentUser = currentUser; - return context; + viewModel.permissions = stringify(permissions); + viewModel.currentUser = currentUser; + return viewModel; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/js/notification-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/js/notification-listing.js index 52fd96af33..f7f7db822f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/js/notification-listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/js/notification-listing.js @@ -91,8 +91,8 @@ function loadNotifications(){ var successCallback = function (data) { var viewModel = {}; data = JSON.parse(data); - viewModel.notifications = data; - if(data.length > 0){ + viewModel.notifications = data.notifications; + if(data.count > 0){ var content = template(viewModel); $("#ast-container").html(content); $('#unread-notifications').datatables_extended(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs index d59fc831db..418bef892b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.notification.listing/public/templates/notification-listing.hbs @@ -16,10 +16,10 @@ {{#each notifications}} {{#equal "NEW" status }} - + {{description}} - + @@ -54,10 +54,10 @@ {{#each notifications}} - + {{description}} - + From 0be419d6cc39ff592ae1d633242d36102b1e68e3 Mon Sep 17 00:00:00 2001 From: kamidu Date: Fri, 12 Aug 2016 17:41:27 +0530 Subject: [PATCH 2/2] Fix ui issues in device view section --- .../devicemgt/app/pages/cdmf.page.device.view/view.hbs | 2 +- .../devicemgt/app/units/cdmf.unit.device.view/view.hbs | 4 +++- .../src/main/resources/jaggeryapps/devicemgt/jaggery.conf | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.hbs index 2b6be8fd6d..1a58360409 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.view/view.hbs @@ -19,7 +19,6 @@ {{unit "cdmf.unit.lib.service-invoker-utility"}} {{unit "cdmf.unit.lib.handlebars"}} -{{unit deviceViewUnitName}} {{#zone "breadcrumbs"}}
  • @@ -40,6 +39,7 @@ {{/zone}} {{#zone "content"}} + {{unit deviceViewUnitName}} {{unit "cdmf.unit.lib.data-table"}} {{unit "cdmf.unit.device.operation-mod"}} {{unit "cdmf.unit.device.view"}} 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 3663b0c6e9..83b6f72333 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. }} + {{#zone "contentTitle"}}
    @@ -32,6 +33,7 @@
    {{/zone}} +{{#zone "content"}}
    @@ -193,7 +195,7 @@
    {{/defineZone}}
    - +{{/zone}} {{#zone "bottomJs"}} {{js "js/device-view.js"}}