custom trigger: more wizard progress

This commit is contained in:
Jimmy Zelinskie 2015-03-31 17:12:40 -04:00
parent 7d1d53ebcb
commit d2f9a8838c
4 changed files with 43 additions and 12 deletions

View file

@ -21,7 +21,7 @@
</div>
<div ng-switch-when="custom">
<div class="trigger-setup-custom" repository="repository" trigger="trigger"
next-set-counter="nextStepCounter" current-setp-valid="state.stepValid"
next-step-counter="nextStepCounter" current-step-valid="state.stepValid"
analyze="checkAnalyze(isValid)"></div>
</div>
</div>
@ -35,7 +35,7 @@
<div class="trigger-option-section" ng-show="currentView == 'analyzed'">
<!-- Messaging -->
<div class="alert alert-danger" ng-if="pullInfo.analysis.status == 'error'">
<div class="alert alert-danger" ng-if="pullInfo.analysis.status == 'error' && !(trigger.service == 'custom')">
{{ pullInfo.analysis.message }}
</div>
<div class="alert alert-warning" ng-if="pullInfo.analysis.status == 'warning'">
@ -59,7 +59,10 @@
</div>
</div>
<div style="margin-bottom: 12px">Please select the credentials to use when pulling the base image:</div>
<div style="margin-bottom: 12px">
<p>Because Dockerfiles may depend on other private images, you may need to use a robot account to build this repository.</p>
Please select the credentials to use when pulling the base image:
</div>
<div ng-if="!isNamespaceAdmin(repository.namespace)" style="color: #aaa;">
<strong>Note:</strong> In order to set pull credentials for a build trigger, you must be an
Administrator of the namespace <strong>{{ repository.namespace }}</strong>

View file

@ -1,16 +1,39 @@
<div class="trigger-setup-custom-element">
<!-- Current selected info, is this even necessary? -->
<div class="selected-info" ng-show="nextStepCounter > 0">
<table style="width: 100%;">
<tr ng-show="nextStepCounter > 0">
<td width="200px">Repository</td>
<td>{{ state.gitURL }}</td>
</tr>
<tr ng-show="nextStepCounter > 1">
<td>Dockerfile Location:</td>
<td>
<div class="dockerfile-location">
<i class="fa fa-folder fa-lg"></i> {{ state.currentLocation || '(Repository Root)' }}
</div>
</td>
</table>
</div>
<!-- Step view -->
<div class="step-view" next-step-counter="nextStepCounter" current-step-valid="currentStepValid"
steps-completed="stepsCompleted()">
steps-completed="stepsCompleted()">
<!-- Git URL Input -->
<div class="step-view-step" complete-condition="state.gitURL">
<div style="margin-bottom: 12px;">Please enter the URL used to clone the your git repository:</div>
<input type="text" ng-pattern="">
</div>
<!-- Git URL Input -->
<div class="step-view-step" complete-condition="state.gitURL" load-callback="nopLoad(callback)"
load-message="Loading Git URL Input">
<div style="margin-bottom: 12px;">Please enter the URL used to clone your git repository:</div>
<input class="form-control" type="text" placeholder="git://example.com/namespace/repository.git" style="width: 100%;"
ng-model="state.gitURL" ng-pattern="/(git|http|https):\/\/(.*)(\.git)/">
</div>
<!-- Dockerfile folder select -->
<div class="step-view-step" complete-condition="state.currentLocation" load-callback="nopLoad(callback)"
load-message="Loading Folder Input">
<div style="margin-bottom: 12px">Dockerfile Location:</div>
<input class="form-control" type="text" placeholder="/" style="width: 100%;"
ng-model="state.currentLocation">
</div>
</div>
</div>

View file

@ -33,7 +33,7 @@
</td>
<td>
<div class="dockerfile-location">
<i class="fa fa-folder fa-lg"></i> {{ state.currentLocation || '(Repository Root)' }}
<i class="fa fa-folder fa-lg"></i> {{ state.currentLocation || '(Repository Root)' }}
</div>
</td>
</tr>

View file

@ -23,10 +23,15 @@ angular.module('quay').directive('triggerSetupCustom', function() {
$scope.state = {
'gitURL': null,
'subdir': null,
};
$scope.stepsCompleted = function() {
$scope.analyze({'isValid': $scope.state.gitURL != null});
$scope.analyze({'isValid': $scope.state.gitURL != null && $scope.subdir != null});
};
$scope.nopLoad = function(callback) {
callback();
};
}
};