2 * ================================================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ================================================================================
\r
24 class notificationHistoryCtrl {
\r
25 constructor( $scope, $log,notificationService, confirmBoxService, $modal, ngDialog, $state) {
\r
27 var priorityItems={"1":"Normal","2":"Important"};
\r
28 $scope.priorityItems=priorityItems;
\r
29 $scope.externalNotification="External System";
\r
30 $scope.isLoadingTable = false;
\r
31 $scope.searchString = '';
\r
32 $scope.notificationHistory = [];
\r
33 let getNotificationHistory = () => {
\r
34 $scope.isLoadingTable = true;
\r
35 notificationService.getNotificationHistory().then(res => {
\r
36 $scope.notificationHistory = res.data;
\r
37 $scope.isLoadingTable = false;
\r
39 $log.error('notificationHistoryCtlr:notifSvc.getNotifHist failed: ', err);
\r
40 $scope.isLoadingTable = false;
\r
44 getNotificationHistory();
\r
46 $scope.showDetailedJsonMessage=function (selectedAdminNotification) {
\r
47 var messageObject=JSON.parse(selectedAdminNotification.msgDescription);
\r
49 html+='<p>'+'Message Source'+' : '+selectedAdminNotification.msgSource+'</p>';
\r
50 html+='<p>'+'Message Title'+' : '+selectedAdminNotification.msgHeader+'</p>';
\r
51 for(var field in messageObject){
\r
52 if(field=='eventDate'||field=='lastModifiedDate'){
\r
53 html+='<p>'+field+' : '+new Date(+messageObject[field])+'</p>';
\r
56 html+='<p>'+field+' : '+messageObject[field]+'</p>';
\r
61 var modalInstance = ngDialog.open({
\r
62 templateUrl: 'app/views/user-notifications-admin/user.notifications.Json.details.modal.page.html',
\r
63 controller: 'userNotificationCtrl',
\r
65 message: function () {
\r
81 notificationHistoryCtrl.$inject = ['$scope', '$log', 'notificationService', 'confirmBoxService', '$modal', 'ngDialog', '$state'];
\r
82 angular.module('ecompApp').controller('notificationHistoryCtrl', notificationHistoryCtrl);
\r