Merge pull request #2991 from coreos-inc/joseph.schorr/QUAY-807/disable-build-ui

Hide build-related UI elements when builds are disabled
This commit is contained in:
josephschorr 2018-01-31 19:00:10 -05:00 committed by GitHub
commit 1b065c27e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 9 deletions

View file

@ -88,14 +88,14 @@
<i class="fa ci-robot"></i> New Robot Account
</a>
</li>
<li role="presentation" class="divider" ng-if="currentPageContext.repository && currentPageContext.repository.can_write && !currentPageContext.repository.tag_operations_disabled"></li>
<li role="presentation" class="divider" ng-if="currentPageContext.repository && currentPageContext.repository.can_write && !currentPageContext.repository.tag_operations_disabled && Features.BUILD_SUPPORT"></li>
<li role="presentation" class="dropdown-header"
ng-if="currentPageContext.repository && currentPageContext.repository.can_write &&
!currentPageContext.repository.tag_operations_disabled">
!currentPageContext.repository.tag_operations_disabled && Features.BUILD_SUPPORT">
Repository {{ currentPageContext.repository.namespace }}/{{ currentPageContext.repository.name }}
</li>
<li ng-if="currentPageContext.repository && currentPageContext.repository.can_write &&
!currentPageContext.repository.tag_operations_disabled">
!currentPageContext.repository.tag_operations_disabled && Features.BUILD_SUPPORT">
<a ng-click="startBuild()">
<i class="fa fa-tasks"></i> New Dockerfile Build
</a>

View file

@ -23,7 +23,14 @@
</div>
<!-- Builds -->
<div class="col-sm-7 builds-list">
<div class="col-sm-7 builds-list" ng-if="!Features.BUILD_SUPPORT">
<div class="right-pull-controls" style="width: 100%">
<div>Pull this container with the following Docker command:</div>
<div class="copy-box" hovering-message="true" value="pullCommand"></div>
</div>
</div>
<div class="col-sm-7 builds-list" ng-if="Features.BUILD_SUPPORT">
<div class="stat-title">Recent Repo Builds</div>
<!-- Loading -->
@ -64,7 +71,7 @@
field-title="repository description"></markdown-input>
</div>
</td>
<td style="width: 400px;" class="hidden-xs hidden-sm">
<td style="width: 400px;" class="hidden-xs hidden-sm" ng-if="Features.BUILD_SUPPORT">
<div class="right-pull-controls">
<div>Pull this container with the following Docker command:</div>
<div class="copy-box" hovering-message="true" value="pullCommand"></div>

View file

@ -85,13 +85,13 @@
<!-- Build Status Badge -->
<div class="co-panel hidden-xs" ng-if="repository.kind == 'image'">
<div class="co-panel hidden-xs" ng-if="repository.kind == 'image' && Features.BUILD_SUPPORT">
<div class="co-panel-heading"><i class="fa fa-tasks"></i> Build Status Badge</div>
<div class="cor-loader" ng-show="!repository"></div>
<div ng-show="repository">
<div class="panel-body panel-section">
<!-- Token Info Banner -->
<div class="co-alert co-alert-info" ng-if="!repository.is_public">
<div class="co-alert co-alert-info" ng-if="!repository.is_public" style="margin-bottom: 20px;">
Note: This badge contains a token so the badge can be seen by external users. The token does not grant any other access and is safe to share!
</div>

View file

@ -12,7 +12,8 @@ angular.module('quay').directive('repoPanelSettings', function () {
'repository': '=repository',
'isEnabled': '=isEnabled'
},
controller: function($scope, $element, ApiService, Config) {
controller: function($scope, $element, ApiService, Config, Features) {
$scope.Features = Features;
$scope.deleteDialogCounter = 0;
var getTitle = function(repo) {

View file

@ -55,7 +55,8 @@
<i class="fa fa-newspaper-o"></i>
</cor-tab>
<cor-tab tab-title="Build Logs" tab-id="super-user-build-logs"
tab-init="loadSuperUserBuildLogs()">
tab-init="loadSuperUserBuildLogs()"
quay-show="Features.BUILD_SUPPORT">
<i class="fa fa-history"></i>
</cor-tab>
</cor-tabs>