reload all repositories after adding one with staged as a new one is automatically created

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1388405 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-09-21 10:38:47 +00:00
parent 5de5246c4d
commit 8c8f3a21ea
1 changed files with 11 additions and 2 deletions

View File

@ -244,8 +244,17 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
data: dataJson,
dataType: 'json',
success: function(data) {
curManagedRepository.location(data.location);
self.managedRepositoriesViewModel.managedRepositories.push(curManagedRepository);
if (managedRepository.stageRepoNeeded()){
$.log("stageRepoNeeded:"+managedRepository.stageRepoNeeded());
// reload all to see the new staged repo
loadManagedRepositories(function(data){
self.managedRepositoriesViewModel.managedRepositories(mapManagedRepositories(data));
});
} else {
curManagedRepository.location(data.location);
self.managedRepositoriesViewModel.managedRepositories.push(curManagedRepository);
}
displaySuccessMessage($.i18n.prop('managedrepository.added',curManagedRepository.id()));
curManagedRepository.modified(false);
activateManagedRepositoriesGridTab();