mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
Adding labels for notifications on related tabs
for notification type column
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest',
|
export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', 'GetChoices',
|
||||||
function(Wait, GetBasePath, ProcessErrors, Rest) {
|
function(Wait, GetBasePath, ProcessErrors, Rest, GetChoices) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
url = params.url,
|
url = params.url,
|
||||||
@@ -27,6 +27,14 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest',
|
|||||||
scope.relatednotificationsRemove = scope.$on('relatednotifications', function () {
|
scope.relatednotificationsRemove = scope.$on('relatednotifications', function () {
|
||||||
var columns = ['/notification_templates_success/', '/notification_templates_error/'];
|
var columns = ['/notification_templates_success/', '/notification_templates_error/'];
|
||||||
|
|
||||||
|
GetChoices({
|
||||||
|
scope: scope,
|
||||||
|
url: GetBasePath('notifications'),
|
||||||
|
field: 'notification_type',
|
||||||
|
variable: 'notification_type_options',
|
||||||
|
callback: 'choicesReadyNotifierList'
|
||||||
|
});
|
||||||
|
|
||||||
_.map(columns, function(column){
|
_.map(columns, function(column){
|
||||||
var notifier_url = url + id + column;
|
var notifier_url = url + id + column;
|
||||||
Rest.setUrl(notifier_url);
|
Rest.setUrl(notifier_url);
|
||||||
@@ -52,6 +60,21 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest',
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (scope.removeChoicesHere) {
|
||||||
|
scope.removeChoicesHere();
|
||||||
|
}
|
||||||
|
scope.removeChoicesHere = scope.$on('choicesReadyNotifierList', function () {
|
||||||
|
if (scope.notifications) {
|
||||||
|
scope.notifications.forEach(function(notification, i) {
|
||||||
|
scope.notification_type_options.forEach(function(type) {
|
||||||
|
if (type.value === notification.notification_type) {
|
||||||
|
scope.notifications[i].notification_type = type.label;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user