[MRM-1665] Adding a Snapshot Managed Repository results in Releases being checked too.

add default value for boolean (as default can be true)

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1383279 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-09-11 07:58:06 +00:00
parent e75d0d78ae
commit ab4ba8f963
1 changed files with 6 additions and 4 deletions

View File

@ -84,15 +84,15 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
this.stageRepoNeeded.subscribe(function(newValue){self.modified(true)}); this.stageRepoNeeded.subscribe(function(newValue){self.modified(true)});
//private boolean snapshots = false; //private boolean snapshots = false;
this.snapshots=ko.observable(snapshots); this.snapshots=ko.observable(snapshots?snapshots:false);
this.snapshots.subscribe(function(newValue){self.modified(true)}); this.snapshots.subscribe(function(newValue){self.modified(true)});
//private boolean releases = true; //private boolean releases = true;
this.releases=ko.observable(releases); this.releases=ko.observable(releases?releases:false);
this.releases.subscribe(function(newValue){self.modified(true)}); this.releases.subscribe(function(newValue){self.modified(true)});
//private boolean blockRedeployments = false; //private boolean blockRedeployments = false;
this.blockRedeployments=ko.observable(blockRedeployments); this.blockRedeployments=ko.observable(blockRedeployments?blockRedeployments:false);
this.blockRedeployments.subscribe(function(newValue){self.modified(true)}); this.blockRedeployments.subscribe(function(newValue){self.modified(true)});
@ -228,11 +228,13 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
addManagedRepository=function(managedRepository,completeCallbackFn){ addManagedRepository=function(managedRepository,completeCallbackFn){
var curManagedRepository=managedRepository; var curManagedRepository=managedRepository;
var callbackFn = completeCallbackFn; var callbackFn = completeCallbackFn;
var dataJson=ko.toJSON(managedRepository);
$.log("managedRepository.release:"+managedRepository.releases()+",dataJson:"+dataJson);
$.ajax("restServices/archivaServices/managedRepositoriesService/addManagedRepository", $.ajax("restServices/archivaServices/managedRepositoriesService/addManagedRepository",
{ {
type: "POST", type: "POST",
contentType: 'application/json', contentType: 'application/json',
data: ko.toJSON(managedRepository), data: dataJson,
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
curManagedRepository.location(data.location); curManagedRepository.location(data.location);