mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Merge pull request #2589 from jaredevantabor/notifications
Inserting ADD NOTIFICATION TEMPLATE button for related tabs
This commit is contained in:
commit
3dae79769d
@ -19,11 +19,24 @@ export default
|
||||
var scope = $rootScope.$new(),
|
||||
url = GetBasePath('notification_templates'),
|
||||
defaultUrl = GetBasePath('system_job_templates'),
|
||||
list = NotificationsList,
|
||||
list,
|
||||
view = GenerateList,
|
||||
id = $stateParams.management_id;
|
||||
|
||||
list = _.cloneDeep(NotificationsList);
|
||||
delete list.actions.add;
|
||||
list.listTitle = `${management_job.name} <div class="List-titleLockup"></div> Notifications`;
|
||||
list.searchSize = "col-lg-12 col-md-12 col-sm-12 col-xs-12";
|
||||
list.searchRowActions = {
|
||||
add: {
|
||||
label: 'Add Notification',
|
||||
mode: 'all', // One of: edit, select, all
|
||||
ngClick: 'addNotificationTemplate()',
|
||||
awToolTip: 'Create a new notification template',
|
||||
actionClass: 'btn List-buttonSubmit',
|
||||
buttonContent: '+ ADD NOTIFICATION TEMPLATE'
|
||||
}
|
||||
};
|
||||
view.inject( list, {
|
||||
mode: 'edit',
|
||||
cancelButton: true,
|
||||
|
||||
@ -10,5 +10,9 @@ export default {
|
||||
name: 'notifications',
|
||||
route: '/notification_templates',
|
||||
templateUrl: templateUrl('notifications/notification-templates-list/list'),
|
||||
controller: 'notificationTemplatesListController'
|
||||
controller: 'notificationTemplatesListController',
|
||||
ncyBreadcrumb: {
|
||||
parent: 'setup',
|
||||
label: 'NOTIFICATION TEMPLATES'
|
||||
},
|
||||
};
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* This is the list definition for the notification templates list
|
||||
* off of the settings page
|
||||
*/
|
||||
|
||||
export default function(){
|
||||
return {
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
/**
|
||||
* This is the list definition for the notification templates list
|
||||
* used in the related tabs
|
||||
*/
|
||||
|
||||
export default function(){
|
||||
return {
|
||||
@ -53,6 +57,16 @@ export default function(){
|
||||
searchable: false,
|
||||
nosort: true,
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
add: {
|
||||
label: 'Add Notification',
|
||||
mode: 'all', // One of: edit, select, all
|
||||
ngClick: 'addNotificationTemplate()',
|
||||
awToolTip: 'Create a new notification template',
|
||||
actionClass: 'btn List-buttonSubmit',
|
||||
buttonContent: '+ ADD NOTIFICATION TEMPLATE'
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@ -15,12 +15,17 @@
|
||||
*/
|
||||
|
||||
export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', 'GetChoices',
|
||||
function(Wait, GetBasePath, ProcessErrors, Rest, GetChoices) {
|
||||
'$state',
|
||||
function(Wait, GetBasePath, ProcessErrors, Rest, GetChoices, $state) {
|
||||
return function(params) {
|
||||
var scope = params.scope,
|
||||
url = params.url,
|
||||
id = params.id;
|
||||
|
||||
scope.addNotificationTemplate = function(){
|
||||
$state.go('notifications.add');
|
||||
};
|
||||
|
||||
if (scope.relatednotificationsRemove) {
|
||||
scope.relatednotificationsRemove();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user