Revision a031a055
Added by Justin Sherrill about 10 years ago
engines/bastion/app/assets/javascripts/bastion/content-views/details/content-view-details.controller.js | ||
---|---|---|
var taskIds = _.map(version['active_history'], function (history) {
|
||
return history.task.id;
|
||
});
|
||
|
||
if (taskIds.length > 0) {
|
||
version.task = AggregateTask.new(taskIds, function (task) {
|
||
version.task = task;
|
||
taskUpdated(version, task);
|
||
});
|
||
}
|
||
});
|
||
}
|
||
|
||
function taskUpdated(version, task) {
|
||
version.task = task;
|
||
if (!task.pending && task.result === 'success') {
|
||
if (task.label === 'Actions::Katello::ContentView::Promote') {
|
||
$scope.successMessages.push(promotionMessage(version, task));
|
||
} else if (task.label === 'Actions::Katello::ContentView::Publish') {
|
||
$scope.successMessages.push(publishMessage(version));
|
||
}
|
||
}
|
||
}
|
||
|
||
function promotionMessage(version, task) {
|
||
return gettext("Successfully promoted %cv version %ver to %env")
|
||
.replace('%cv', version['content_view'].name)
|
||
.replace('%ver', version.version)
|
||
.replace('%env', task.input['environment_name']);
|
||
}
|
||
|
||
function publishMessage(version) {
|
||
return gettext("Successfully published %cv version %ver and promoted to Library")
|
||
.replace('%cv', version['content_view'].name)
|
||
.replace('%ver', version.version);
|
||
}
|
||
|
||
$scope.reloadVersions = function () {
|
||
var contentViewId = $scope.contentView.id || $scope.$stateParams.contentViewId;
|
||
$scope.contentView.versions = [];
|
||
|
||
ContentViewVersion.query({'content_view_id': contentViewId}, function (data) {
|
||
$scope.versions = data.results;
|
||
if ($scope.contentView) {
|
Also available in: Unified diff
fixes #4810 - indicate completion on content view publish/promote