Warn if the docker file directory entered does not match any of those found

This commit is contained in:
Joseph Schorr 2014-02-25 00:42:33 -05:00
parent e6a8b84ff3
commit 77c2e7fa5e
2 changed files with 10 additions and 1 deletions

View file

@ -31,7 +31,8 @@
<div class="dropdown-select" placeholder="'(Repository Root)'" selected-item="currentLocation"
lookahead-items="locations" handle-input="handleLocationInput(input)">
<!-- Icons -->
<i class="dropdown-select-icon none-icon fa fa-folder-o fa-lg"></i>
<i class="dropdown-select-icon none-icon fa fa-folder-o fa-lg" ng-show="isInvalidLocation"></i>
<i class="dropdown-select-icon none-icon fa fa-folder fa-lg" style="color: black;" ng-show="!isInvalidLocation"></i>
<i class="dropdown-select-icon fa fa-folder fa-lg"></i>
<!-- Dropdown menu -->
@ -51,6 +52,9 @@
<div class="alert alert-warning" ng-show="locationError">
{{ locationError }}
</div>
<div class="alert alert-info" ng-show="locations.length && isInvalidLocation">
Note: The folder does not currently exist or contain a Dockerfile
</div>
</div>
</div>

View file

@ -2693,11 +2693,13 @@ quayApp.directive('triggerSetupGithub', function () {
$scope.handleLocationInput = function(location) {
$scope.trigger['config']['subdir'] = location || '';
$scope.isInvalidLocation = $scope.locations.indexOf(location) < 0;
};
$scope.setLocation = function(location) {
$scope.currentLocation = location;
$scope.trigger['config']['subdir'] = location || '';
$scope.isInvalidLocation = false;
};
$scope.selectRepo = function(repo, org) {
@ -2735,16 +2737,19 @@ quayApp.directive('triggerSetupGithub', function () {
$scope.locationError = resp['message'] || 'Could not load Dockerfile locations';
$scope.locations = null;
$scope.trigger.$ready = false;
$scope.isInvalidLocation = false;
return;
}
$scope.locationError = null;
$scope.locations = resp['subdir'] || [];
$scope.trigger.$ready = true;
$scope.isInvalidLocation = resp['subdir'].indexOf('') < 0;
}, function(resp) {
$scope.locationError = resp['message'] || 'Could not load Dockerfile locations';
$scope.locations = null;
$scope.trigger.$ready = false;
$scope.isInvalidLocation = false;
});
}
};