]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1665] Adding a Snapshot Managed Repository results in Releases being checked...
authorOlivier Lamy <olamy@apache.org>
Tue, 11 Sep 2012 07:58:06 +0000 (07:58 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 11 Sep 2012 07:58:06 +0000 (07:58 +0000)
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

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js

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