diff options
author | Christopher Lott (Christopher) (cl778h) <clott@vm-ep-dev2.client.research.att.com> | 2017-06-12 09:49:00 -0400 |
---|---|---|
committer | Christopher Lott (cl778h) <clott@research.att.com> | 2017-06-12 13:42:43 -0400 |
commit | 627badaf69987c01811c477219fd943757a635f5 (patch) | |
tree | 97df9449a411d1ecf830cc76d8afd6f9b5677bda /ecomp-portal-FE-common/client/app/views/notification-history | |
parent | ba838f2e13f1e8050c75e68bd3733d56d8f416d5 (diff) |
[PORTAL-16 PORTAL-18] Widget ms; staging
Remove staging repositories from poms.
Add widget microservice code base.
Add portal unit tests.
Repair defects.
Normalize line endings.
Change-Id: Ia5e48da2a3141b352439ecd548cddf918f4df585
Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/notification-history')
2 files changed, 191 insertions, 183 deletions
diff --git a/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.controller.js b/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.controller.js index 609dba38..a5ea9041 100644 --- a/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.controller.js +++ b/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.controller.js @@ -1,83 +1,91 @@ -/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-'use strict';
-
-(function () {
-
- class notificationHistoryCtrl {
- constructor( $scope, $log,notificationService, confirmBoxService, $modal, ngDialog, $state) {
-
- var priorityItems={"1":"Normal","2":"Important"};
- $scope.priorityItems=priorityItems;
- $scope.externalNotification="External System";
- $scope.isLoadingTable = false;
- $scope.searchString = '';
- $scope.notificationHistory = [];
- let getNotificationHistory = () => {
- $scope.isLoadingTable = true;
- notificationService.getNotificationHistory().then(res => {
- $scope.notificationHistory = res.data;
- $scope.isLoadingTable = false;
- }).catch(err => {
- $log.error('notificationHistoryCtlr:notifSvc.getNotifHist failed: ', err);
- $scope.isLoadingTable = false;
- });
- }
-
- getNotificationHistory();
-
- $scope.showDetailedJsonMessage=function (selectedAdminNotification) {
- var messageObject=JSON.parse(selectedAdminNotification.msgDescription);
- var html="";
- html+='<p>'+'Message Source'+' : '+selectedAdminNotification.msgSource+'</p>';
- html+='<p>'+'Message Title'+' : '+selectedAdminNotification.msgHeader+'</p>';
- for(var field in messageObject){
- if(field=='eventDate'||field=='lastModifiedDate'){
- html+='<p>'+field+' : '+new Date(+messageObject[field])+'</p>';
-
- }else{
- html+='<p>'+field+' : '+messageObject[field]+'</p>';
-
- }
- }
-
- var modalInstance = ngDialog.open({
- templateUrl: 'app/views/user-notifications-admin/user.notifications.Json.details.modal.page.html',
- controller: 'userNotificationCtrl',
- resolve: {
- message: function () {
- var message = {
- title: '',
- text: html
-
- };
- return message;
- },
-
- }
- });
-
-
- };
- }
- }
- notificationHistoryCtrl.$inject = ['$scope', '$log', 'notificationService', 'confirmBoxService', '$modal', 'ngDialog', '$state'];
- angular.module('ecompApp').controller('notificationHistoryCtrl', notificationHistoryCtrl);
-})();
+/*- + * ================================================================================ + * ECOMP Portal + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +'use strict'; + +(function () { + + class notificationHistoryCtrl { + constructor( $scope, $log,notificationService, confirmBoxService, $modal, ngDialog, $state) { + + var priorityItems={"1":"Normal","2":"Important"}; + $scope.priorityItems=priorityItems; + $scope.externalNotification="External System"; + $scope.isLoadingTable = false; + $scope.searchString = ''; + $scope.notificationHistory = []; + let getNotificationHistory = () => { + $scope.isLoadingTable = true; + notificationService.getNotificationHistory().then(res => { + $scope.notificationHistory = res.data; + $scope.isLoadingTable = false; + }).catch(err => { + $log.error('notificationHistoryCtlr:notifSvc.getNotifHist failed: ', err); + $scope.isLoadingTable = false; + }); + } + + getNotificationHistory(); + + $scope.showDetailedJsonMessage=function (selectedAdminNotification) { + notificationService.getMessageRecipients(selectedAdminNotification.notificationId).then(res =>{ + $scope.messageRecipients = res; + var messageObject=JSON.parse(selectedAdminNotification.msgDescription); + var html=""; + html+='<p>'+'Message Source'+' : '+selectedAdminNotification.msgSource+'</p>'; + html+='<p>'+'Message Title'+' : '+selectedAdminNotification.msgHeader+'</p>'; + html+='<p>'+'Message Recipient'+' : '+$scope.messageRecipients+'</p>'; + + for(var field in messageObject){ + if(field=='eventDate'||field=='lastModifiedDate'){ + html+='<p>'+field+' : '+new Date(+messageObject[field])+'</p>'; + + }else{ + html+='<p>'+field+' : '+messageObject[field]+'</p>'; + + } + } + + var modalInstance = ngDialog.open({ + templateUrl: 'app/views/user-notifications-admin/user.notifications.Json.details.modal.page.html', + controller: 'userNotificationCtrl', + resolve: { + message: function () { + var message = { + title: '', + text: html + + }; + return message; + }, + + } + }); + + }).catch(err => { + $log.error('userNotificationsCtrl:getMessageRecipients:: error ', err); + $scope.isLoadingTable = false; + }); + + }; + } + } + notificationHistoryCtrl.$inject = ['$scope', '$log', 'notificationService', 'confirmBoxService', '$modal', 'ngDialog', '$state']; + angular.module('ecompApp').controller('notificationHistoryCtrl', notificationHistoryCtrl); +})(); diff --git a/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.tpl.html b/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.tpl.html index 5cd56e97..f5d0b292 100644 --- a/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.tpl.html +++ b/ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.tpl.html @@ -1,100 +1,100 @@ -<!--
- ================================================================================
- ECOMP Portal
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ================================================================================
- -->
-<div class="w-ecomp-user-notification-history"
- ng-style="{bottom: tabBottom}">
- <div class="user-notification-history" id="page-content">
- <div id='app-title' class="w-ecomp-main-view-title">
- <h1 class="heading-page" >Recent Notifications</h1>
- </div>
- <div class="notifHistTable">
-
- <div class="table-control">
- <div class="simulateCatGridHeaderDetails">This table shows
- notifications published in the last 30 days.</div>
- <div align="right">
- <input class="table-search" type="text" id="input-search"
- placeholder="Search in entire table" ng-model="searchString" />
- </div>
- </div>
-
- <span class="ecomp-spinner" ng-show="isLoadingTable"></span>
-
- <div id="table-main" class="b2b-table-div" ng-hide="isLoadingTable">
- <table b2b-table id="notification-history-table"
- table-data="notificationHistory"
- search-string="searchString"
- view-per-page="viewPerPagerIgnored"
- current-page="ignoredCurrentPage"
- total-page="totalPageIgnored">
- <thead b2b-table-row type="header">
- <tr>
- <th id="th-notif-0" b2b-table-header key="msgSource"
- sortable="true" style=" width: 10px;">Message Source</th>
- <th id="th-notif-1" b2b-table-header key="msgHeader"
- sortable="true">Message</th>
- <th id="th-notif-2" b2b-table-header key="startTime"
- sortable="true">Start Date (Local Time)</th>
- <th id="th-notif-3" b2b-table-header key="endTime"
- sortable="true">End Date (Local Time)</th>
- <th id="th-notif-4" b2b-table-header key="priority"
- sortable="true">Priority</th>
- <th id="th-notif-5" b2b-table-header key="loginId"
- sortable="true">Created By</th>
- <th id="th-notif-6" b2b-table-header key="createdDate"
- sortable="true">Created Time</th>
- </tr>
- </thead>
-
- <tbody b2b-table-row
- type="body"
- class="table-body"
- track-by="$index"
- row-repeat="rowData in notificationHistory">
- <tr id="row-{{$index}}">
- <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}">
- <div id="{{$index}}-msgSource">{{rowData.msgSource}}</div>
- </td>
- <td class="td-first" b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}" ng-click="rowData.msgSource=='EP'||showDetailedJsonMessage(rowData)">
- <div id="{{$index}}-title" style="font-weight: bold;" ng-bind="rowData.msgHeader"></div>
- <div id="{{$index}}-message" ng-if="rowData.msgSource==='EP'" style="width:500px" ng-bind="rowData.msgDescription"></div>
- <div id="{{$index}}-message" ng-if="rowData.msgSource!=='EP'" ng-bind="rowData.msgDescription| elipsis: 27"></div>
- </td>
- <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}">
- <div id="{{$index}}-startTime" ng-bind="rowData.startTime | date:'medium'"></div>
- </td>
- <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}">
- <div id="{{$index}}-endTime" ng-bind="rowData.endTime | date:'medium'"></div>
- </td>
- <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}">
- <div id="{{$index}}-priority" ng-bind="priorityItems[rowData.priority]"></div>
- </td>
- <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}">
- <div id="{{$index}}-loginId" ng-bind="!rowData.loginId ? externalNotification : rowData.loginId"></div>
- </td>
- <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}">
- <div id="{{$index}}-createdDate" ng-bind="rowData.createdDate | date:'medium'"></div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
-</div>
+<!-- + ================================================================================ + ECOMP Portal + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ================================================================================ + --> +<div class="w-ecomp-user-notification-history" + ng-style="{bottom: tabBottom}"> + <div class="user-notification-history" id="page-content"> + <div id='app-title' class="w-ecomp-main-view-title"> + <h1 class="heading-page" >Recent Notifications</h1> + </div> + <div class="notifHistTable"> + + <div class="table-control"> + <div class="simulateCatGridHeaderDetails">This table shows + notifications published in the last 30 days.</div> + <div align="right"> + <input class="table-search" type="text" id="input-search" + placeholder="Search in entire table" ng-model="searchString" /> + </div> + </div> + + <span class="ecomp-spinner" ng-show="isLoadingTable"></span> + + <div id="table-main" class="b2b-table-div" ng-hide="isLoadingTable"> + <table b2b-table id="notification-history-table" + table-data="notificationHistory" + search-string="searchString" + view-per-page="viewPerPagerIgnored" + current-page="ignoredCurrentPage" + total-page="totalPageIgnored"> + <thead b2b-table-row type="header"> + <tr> + <th id="th-notif-0" b2b-table-header key="msgSource" + sortable="true" style=" width: 10px;">Message Source</th> + <th id="th-notif-1" b2b-table-header key="msgHeader" + sortable="true">Message</th> + <th id="th-notif-2" b2b-table-header key="startTime" + sortable="true">Start Date (Local Time)</th> + <th id="th-notif-3" b2b-table-header key="endTime" + sortable="true">End Date (Local Time)</th> + <th id="th-notif-4" b2b-table-header key="priority" + sortable="true">Priority</th> + <th id="th-notif-5" b2b-table-header key="loginId" + sortable="true">Created By</th> + <th id="th-notif-6" b2b-table-header key="createdDate" + sortable="true">Created Time</th> + </tr> + </thead> + + <tbody b2b-table-row + type="body" + class="table-body" + track-by="$index" + row-repeat="rowData in notificationHistory"> + <tr id="row-{{$index}}"> + <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}"> + <div id="{{$index}}-msgSource">{{rowData.msgSource}}</div> + </td> + <td class="td-first" b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}" ng-click="rowData.msgSource=='EP'||showDetailedJsonMessage(rowData)"> + <div id="{{$index}}-title" style="font-weight: bold;" ng-bind="rowData.msgHeader"></div> + <div id="{{$index}}-message" ng-if="rowData.msgSource==='EP'" style="width:500px" ng-bind="rowData.msgDescription"></div> + <div id="{{$index}}-message" ng-if="rowData.msgSource!=='EP'" ng-bind="rowData.msgDescription| elipsis: 27"></div> + </td> + <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}"> + <div id="{{$index}}-startTime" ng-bind="rowData.startTime | date:'medium'"></div> + </td> + <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}"> + <div id="{{$index}}-endTime" ng-bind="rowData.endTime | date:'medium'"></div> + </td> + <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}"> + <div id="{{$index}}-priority" ng-bind="priorityItems[rowData.priority]"></div> + </td> + <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}"> + <div id="{{$index}}-loginId" ng-bind="!rowData.loginId ? externalNotification : rowData.loginId"></div> + </td> + <td b2b-table-body style="{{rowData.expired?'color:lightgray !important':''}}"> + <div id="{{$index}}-createdDate" ng-bind="rowData.createdDate | date:'medium'"></div> + </td> + </tr> + </tbody> + </table> + </div> + </div> + </div> +</div> |