mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Merge pull request #2411 from mabashian/job-templates-remove-label
Refresh label array whenever one is removed
This commit is contained in:
commit
69c994bd16
@ -15,12 +15,6 @@ export default
|
||||
link: function(scope, element, attrs) {
|
||||
scope.seeMoreInactive = true;
|
||||
|
||||
scope.labels = scope.
|
||||
job_template.summary_fields.labels.results;
|
||||
|
||||
scope.count = scope.
|
||||
job_template.summary_fields.labels.count;
|
||||
|
||||
var getNext = function(data, arr, resolve) {
|
||||
Rest.setUrl(data.next);
|
||||
Rest.get()
|
||||
@ -75,6 +69,13 @@ export default
|
||||
actionText: 'REMOVE'
|
||||
});
|
||||
};
|
||||
|
||||
scope.$watch("job_template.summary_fields.labels.results", function() {
|
||||
// To keep the array of labels fresh, we need to set up a watcher - otherwise, the
|
||||
// array will get set initially and then never be updated as labels are removed
|
||||
scope.labels = scope.job_template.summary_fields.labels.results;
|
||||
scope.count = scope.job_template.summary_fields.labels.count;
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user