From 893dd20eadcf5a0b74d458254a2dc4a632c8fea1 Mon Sep 17 00:00:00 2001 From: jaredevantabor Date: Thu, 2 Feb 2017 15:19:54 -0800 Subject: [PATCH] adding notification template activity stream --- awx/ui/client/legacy-styles/lists.less | 2 +- .../streamDropdownNav/stream-dropdown-nav.directive.js | 1 + awx/ui/client/src/helpers/ActivityStream.js | 3 +++ awx/ui/client/src/helpers/ApiModel.js | 3 +++ awx/ui/client/src/notifications/main.js | 4 ++++ awx/ui/client/src/widgets/Stream.js | 3 ++- 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/legacy-styles/lists.less b/awx/ui/client/legacy-styles/lists.less index 351bf3988b..eb0a50529b 100644 --- a/awx/ui/client/legacy-styles/lists.less +++ b/awx/ui/client/legacy-styles/lists.less @@ -167,7 +167,7 @@ table, tbody { } .List-auxActionStream { - width: 175px; + width: 200px; } .List-action:not(.ng-hide) ~ .List-action:not(.ng-hide) { diff --git a/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js b/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js index 3b3574d93b..59c2b82a3c 100644 --- a/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js +++ b/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js @@ -26,6 +26,7 @@ export default ['templateUrl', 'i18n', function(templateUrl, i18n) { {label: i18n._('Inventories'), value: 'inventory'}, {label: i18n._('Inventory Scripts'), value: 'inventory_script'}, {label: i18n._('Jobs'), value: 'job'}, + {label: i18n._('Notification Templates'), value: 'notification_template'}, {label: i18n._('Organizations'), value: 'organization'}, {label: i18n._('Projects'), value: 'project'}, {label: i18n._('Schedules'), value: 'schedule'}, diff --git a/awx/ui/client/src/helpers/ActivityStream.js b/awx/ui/client/src/helpers/ActivityStream.js index 065d466ba5..d0bb7d6fd9 100644 --- a/awx/ui/client/src/helpers/ActivityStream.js +++ b/awx/ui/client/src/helpers/ActivityStream.js @@ -34,6 +34,9 @@ export default case 'team': rtnTitle = i18n._('TEAMS'); break; + case 'notification_template': + rtnTitle = i18n._('NOTIFICATION TEMPLATES'); + break; case 'organization': rtnTitle = i18n._('ORGANIZATIONS'); break; diff --git a/awx/ui/client/src/helpers/ApiModel.js b/awx/ui/client/src/helpers/ApiModel.js index 06544675c5..a93c62d61c 100644 --- a/awx/ui/client/src/helpers/ApiModel.js +++ b/awx/ui/client/src/helpers/ApiModel.js @@ -39,6 +39,9 @@ export default case 'team': basePathKey = 'teams'; break; + case 'notification_template': + basePathKey = 'notification_templates'; + break; case 'organization': basePathKey = 'organizations'; break; diff --git a/awx/ui/client/src/notifications/main.js b/awx/ui/client/src/notifications/main.js index 58f6e59689..808d30f447 100644 --- a/awx/ui/client/src/notifications/main.js +++ b/awx/ui/client/src/notifications/main.js @@ -79,6 +79,10 @@ angular.module('notifications', [ ] } }, + data: { + activityStream: true, + activityStreamTarget: 'notification_template' + }, ncyBreadcrumb: { parent: 'setup', label: N_('NOTIFICATIONS') diff --git a/awx/ui/client/src/widgets/Stream.js b/awx/ui/client/src/widgets/Stream.js index d9b19eeca1..a41b14b462 100644 --- a/awx/ui/client/src/widgets/Stream.js +++ b/awx/ui/client/src/widgets/Stream.js @@ -76,7 +76,8 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti } break; case 'notification_template': - throw {name : 'NotImplementedError', message : 'activity.summary_fields to build this url not implemented yet'}; + url += `notification_templates/${obj.id}`; + break; case 'role': throw {name : 'NotImplementedError', message : 'role object management is not consolidated to a single UI view'}; default: