Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use manager_resource only to create Repository #899

Merged
merged 1 commit into from
Apr 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ManageIQ.angular.app.controller('repositoryFormController', ['$scope', 'reposito
name: '',
description: '',
scm_type: 'git',
manager_resource: {},
scm_url: '',
authentication_id: null,
scm_branch: '',
Expand All @@ -17,10 +16,6 @@ ManageIQ.angular.app.controller('repositoryFormController', ['$scope', 'reposito
scm_update_on_launch: false,
};

API.get('/api/providers?collection_class=ManageIQ::Providers::EmbeddedAutomationManager')
.then(getManagerResource)
.catch(miqService.handleFailure);

vm.model = 'repositoryModel';

ManageIQ.angular.scope = vm;
Expand All @@ -37,9 +32,9 @@ ManageIQ.angular.app.controller('repositoryFormController', ['$scope', 'reposito
.then(getRepositoryFormData)
.catch(miqService.handleFailure);
} else {
vm.afterGet = true;
vm.modelCopy = angular.copy( vm.repositoryModel );
miqService.sparkleOff();
API.get('/api/providers?collection_class=ManageIQ::Providers::EmbeddedAutomationManager')
.then(getManagerResource)
.catch(miqService.handleFailure);
}
};

Expand Down Expand Up @@ -70,12 +65,16 @@ ManageIQ.angular.app.controller('repositoryFormController', ['$scope', 'reposito
.catch(miqService.handleFailure);
};

var getRepositoryFormData = function(response) {
var data = response;
Object.assign(vm.repositoryModel, data);
function setForm() {
vm.modelCopy = angular.copy( vm.repositoryModel );
vm.afterGet = true;
miqService.sparkleOff();
}

var getRepositoryFormData = function(response) {
var data = response;
Object.assign(vm.repositoryModel, data);
setForm();
};

var getBack = function(response) {
Expand Down Expand Up @@ -117,6 +116,7 @@ ManageIQ.angular.app.controller('repositoryFormController', ['$scope', 'reposito
} else {
vm.repositoryModel.manager_resource = {'href': response.resources[0].href};
}
setForm();
};
init();
}]);
Expand Down