@@ -32,6 +33,7 @@
{{/zone}}
+{{#zone "content"}}
@@ -193,7 +195,7 @@
{{/defineZone}}
-
+{{/zone}}
{{#zone "bottomJs"}}
{{js "js/device-view.js"}}
{{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}} |
-
+
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/jaggery.conf b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/jaggery.conf
index 8397121567..dec7a25f8c 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/jaggery.conf
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/jaggery.conf
@@ -50,6 +50,10 @@
{
"url": "/api/data-tables/invoker",
"path": "/api/data-tables-invoker-api.jag"
+ },
+ {
+ "url": "/api/operation/*",
+ "path": "/api/operation-api.jag"
}
]
}
\ No newline at end of file
| |