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