Merge pull request #2426 from alecmerdler/frontend-refactoring
More Front-end TypeScript Refactoring
This commit is contained in:
commit
cd61482ff1
26 changed files with 1250 additions and 441 deletions
|
@ -10,10 +10,8 @@ angular.module('quay').directive('dockerfileBuildForm', function () {
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository',
|
||||
|
||||
'isReady': '=?isReady',
|
||||
'reset': '=?reset',
|
||||
|
||||
'readyForBuild': '&readyForBuild'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, DockerfileService, Config) {
|
||||
|
@ -39,25 +37,27 @@ angular.module('quay').directive('dockerfileBuildForm', function () {
|
|||
$scope.state = 'checking';
|
||||
$scope.selectedFiles = files;
|
||||
|
||||
DockerfileService.getDockerfile(files[0], function(df) {
|
||||
var baseImage = df.getRegistryBaseImage();
|
||||
if (baseImage) {
|
||||
checkPrivateImage(baseImage);
|
||||
} else {
|
||||
$scope.state = 'ready';
|
||||
}
|
||||
DockerfileService.getDockerfile(files[0])
|
||||
.then(function(dockerfileInfo) {
|
||||
var baseImage = dockerfileInfo.getRegistryBaseImage();
|
||||
if (baseImage) {
|
||||
checkPrivateImage(baseImage);
|
||||
} else {
|
||||
$scope.state = 'ready';
|
||||
}
|
||||
|
||||
$scope.$apply(function() {
|
||||
opt_callback && opt_callback(true, 'Dockerfile found and valid')
|
||||
});
|
||||
}, function(msg) {
|
||||
$scope.state = 'empty';
|
||||
$scope.privateBaseRepository = null;
|
||||
$scope.$apply(function() {
|
||||
opt_callback && opt_callback(true, 'Dockerfile found and valid')
|
||||
});
|
||||
})
|
||||
.catch(function(error) {
|
||||
$scope.state = 'empty';
|
||||
$scope.privateBaseRepository = null;
|
||||
|
||||
$scope.$apply(function() {
|
||||
opt_callback && opt_callback(false, msg || 'Could not find valid Dockerfile');
|
||||
$scope.$apply(function() {
|
||||
opt_callback && opt_callback(false, error || 'Could not find valid Dockerfile');
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.handleFilesCleared = function() {
|
||||
|
|
Reference in a new issue