From 7b3cb9c8b7fad5774bfbf5b0fbf21fd77eb1bec7 Mon Sep 17 00:00:00 2001 From: Evan Cordell Date: Tue, 13 Jun 2017 09:56:47 -0400 Subject: [PATCH] Re-enable builds and tag operations in the UI --- static/directives/header-bar.html | 6 +++--- .../directives/repo-view/repo-panel-builds.html | 6 +++--- static/directives/repo-view/repo-panel-info.html | 2 +- static/directives/repo-view/repo-panel-tags.html | 6 +++--- static/directives/tag-operations-dialog.html | 11 ++++++----- .../repository-signing-config.component.html | 16 +++++++++++----- static/js/directives/ui/tag-operations-dialog.js | 16 ++++++++-------- static/js/types/common.types.ts | 1 + 8 files changed, 36 insertions(+), 28 deletions(-) diff --git a/static/directives/header-bar.html b/static/directives/header-bar.html index bf6ede974..ab71d1ced 100644 --- a/static/directives/header-bar.html +++ b/static/directives/header-bar.html @@ -89,14 +89,14 @@ New Robot Account - +
  • + !currentPageContext.repository.tag_operations_disabled"> New Dockerfile Build diff --git a/static/directives/repo-view/repo-panel-builds.html b/static/directives/repo-view/repo-panel-builds.html index edeb0cecb..fcca2174b 100644 --- a/static/directives/repo-view/repo-panel-builds.html +++ b/static/directives/repo-view/repo-panel-builds.html @@ -1,13 +1,13 @@
    -

    Repository Builds

    -
    +
    Builds cannot be performed on this repository because Quay Trust is enabled, which requires that all operations be signed by a user.
    @@ -83,7 +83,7 @@
    -
    +
    diff --git a/static/directives/repo-view/repo-panel-info.html b/static/directives/repo-view/repo-panel-info.html index 341b3855d..5e2b47d51 100644 --- a/static/directives/repo-view/repo-panel-info.html +++ b/static/directives/repo-view/repo-panel-info.html @@ -32,7 +32,7 @@
    No builds have been run for this repository.
    -
    +
    Click on the Builds tab to start a new build.
    diff --git a/static/directives/repo-view/repo-panel-tags.html b/static/directives/repo-view/repo-panel-tags.html index a3b1d3e5a..0e572a568 100644 --- a/static/directives/repo-view/repo-panel-tags.html +++ b/static/directives/repo-view/repo-panel-tags.html @@ -53,7 +53,7 @@
  • + ng-class="repository.tag_operations_disabled ? 'disabled-option' : ''"> Delete Tags
  • @@ -243,7 +243,7 @@ + ng-class="repository.tag_operations_disabled ? 'disabled-option' : ''"> Add New Tag Edit Labels + ng-class="repository.tag_operations_disabled ? 'disabled-option' : ''"> Delete Tag diff --git a/static/directives/tag-operations-dialog.html b/static/directives/tag-operations-dialog.html index 53277a958..5f5f7b2be 100644 --- a/static/directives/tag-operations-dialog.html +++ b/static/directives/tag-operations-dialog.html @@ -144,16 +144,17 @@ manifest-digest="restoreTagInfo.manifest_digest">? - - diff --git a/static/js/directives/ui/tag-operations-dialog.js b/static/js/directives/ui/tag-operations-dialog.js index 8d88de4ad..186713108 100644 --- a/static/js/directives/ui/tag-operations-dialog.js +++ b/static/js/directives/ui/tag-operations-dialog.js @@ -35,9 +35,9 @@ angular.module('quay').directive('tagOperationsDialog', function () { }); }; - $scope.alertOnTrust = function() { - if ($scope.repository.trust_enabled) { - $('#trustEnabledModal').modal('show'); + $scope.alertOnTagOpsDisabled = function() { + if ($scope.repository.tag_operations_disabled) { + $('#tagOperationsDisabledModal').modal('show'); return true; } @@ -62,7 +62,7 @@ angular.module('quay').directive('tagOperationsDialog', function () { $scope.createOrMoveTag = function(image, tag) { if (!$scope.repository.can_write) { return; } - if ($scope.alertOnTrust()) { + if ($scope.alertOnTagOpsDisabled()) { return; } @@ -242,7 +242,7 @@ angular.module('quay').directive('tagOperationsDialog', function () { $scope.actionHandler = { 'askDeleteTag': function(tag) { - if ($scope.alertOnTrust()) { + if ($scope.alertOnTagOpsDisabled()) { return; } @@ -252,7 +252,7 @@ angular.module('quay').directive('tagOperationsDialog', function () { }, 'askDeleteMultipleTags': function(tags) { - if ($scope.alertOnTrust()) { + if ($scope.alertOnTagOpsDisabled()) { return; } @@ -262,7 +262,7 @@ angular.module('quay').directive('tagOperationsDialog', function () { }, 'askAddTag': function(image) { - if ($scope.alertOnTrust()) { + if ($scope.alertOnTagOpsDisabled()) { return; } @@ -297,7 +297,7 @@ angular.module('quay').directive('tagOperationsDialog', function () { }, 'askRestoreTag': function(tag, image_id, opt_manifest_digest) { - if ($scope.alertOnTrust()) { + if ($scope.alertOnTagOpsDisabled()) { return; } diff --git a/static/js/types/common.types.ts b/static/js/types/common.types.ts index 088867010..7e910476e 100644 --- a/static/js/types/common.types.ts +++ b/static/js/types/common.types.ts @@ -81,6 +81,7 @@ export type Repository = { kind?: string; namespace?: string; trust_enabled?: boolean; + tag_operations_disabled?: boolean; };