Move tag actions into a menu and fix view history action

This commit is contained in:
Joseph Schorr 2017-03-08 13:06:57 -05:00
parent 25db46c341
commit f206b4b95e
3 changed files with 30 additions and 10 deletions

View file

@ -26,16 +26,25 @@
</span>
<span class="co-checked-actions" ng-if="checkedTags.checked.length">
<a class="btn btn-default"
ng-click="showHistory(true, getTagNames(checkedTags.checked))"
ng-if="repository.can_write">
<i class="fa fa-history"></i><span class="text">View History</span>
</a>
<button class="btn btn-primary"
ng-click="askDeleteMultipleTags(checkedTags.checked)"
ng-if="repository.can_write">
<i class="fa fa-times"></i><span class="text">Delete</span>
</button>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<i class="fa fa-cog"></i>
Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a ng-click="showHistory(checkedTags.checked)">
<i class="fa fa-history"></i><span class="text">View Tags History</span>
</a>
</li>
<li ng-if="repository.can_write">
<a ng-click="askDeleteMultipleTags(checkedTags.checked)">
<i class="fa fa-times"></i><span class="text">Delete Tags</span>
</a>
</li>
</ul>
</div>
</span>
<span class="co-filter-box">

View file

@ -11,6 +11,7 @@ angular.module('quay').directive('repoPanelTags', function () {
scope: {
'repository': '=repository',
'selectedTags': '=selectedTags',
'historyFilter': '=historyFilter',
'imagesResource': '=imagesResource',
'imageLoader': '=imageLoader',
@ -349,6 +350,15 @@ angular.module('quay').directive('repoPanelTags', function () {
});
};
$scope.showHistory = function(checked) {
if (!checked.length) {
return;
}
$scope.historyFilter = $scope.getTagNames(checked);
$scope.setTab('history');
};
$scope.getTagNames = function(checked) {
var names = checked.map(function(tag) {
return tag.name;

View file

@ -86,6 +86,7 @@
repository="viewScope.repository"
image-loader="viewScope.imageLoader"
selected-tags="viewScope.selectedTags"
history-filter="viewScope.historyFilter"
is-enabled="tagsShown"></div>
</div>