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

View file

@ -11,6 +11,7 @@ angular.module('quay').directive('repoPanelTags', function () {
scope: { scope: {
'repository': '=repository', 'repository': '=repository',
'selectedTags': '=selectedTags', 'selectedTags': '=selectedTags',
'historyFilter': '=historyFilter',
'imagesResource': '=imagesResource', 'imagesResource': '=imagesResource',
'imageLoader': '=imageLoader', '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) { $scope.getTagNames = function(checked) {
var names = checked.map(function(tag) { var names = checked.map(function(tag) {
return tag.name; return tag.name;

View file

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