You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2013/09/20 16:52:23 UTC

[1/3] git commit: updated refs/heads/master to 8a1118e

Updated Branches:
  refs/heads/master d719b781f -> 8a1118e18


icons in dropdown


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/446e1393
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/446e1393
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/446e1393

Branch: refs/heads/master
Commit: 446e139338945f60d0d937ab3a442d603b86da1d
Parents: d719b78
Author: suelockwood <de...@gmail.com>
Authored: Fri Sep 20 10:52:03 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Fri Sep 20 10:52:03 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/templates/documents/sidebar.html | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/446e1393/src/fauxton/app/templates/documents/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/sidebar.html b/src/fauxton/app/templates/documents/sidebar.html
index 18c6856..eb01942 100644
--- a/src/fauxton/app/templates/documents/sidebar.html
+++ b/src/fauxton/app/templates/documents/sidebar.html
@@ -22,12 +22,9 @@ the License.
         </button>
         <ul class="dropdown-menu">
           <!-- dropdown menu links -->
-          <li><a href="<%= db_url %>">Docs</a></li>
-          <!-- TODO::REENABLE
-          <li><a href="#">Stats</a></li>
-          -->
-          <li><a href="<%= permissions_url %>">Permissions</a></li>
-          <li><a  href="<%= changes_url %>">Changes</a></li>
+          <li><a class="icon-file" href="<%= db_url %>">Docs</a></li>
+          <li><a class="icon-lock" href="<%= permissions_url %>">Permissions</a></li>
+          <li><a class="icon-forward" href="<%= changes_url %>">Changes</a></li>
         </ul>
       </div>
     </div>


[2/3] git commit: updated refs/heads/master to 8a1118e

Posted by de...@apache.org.
Fauxton: warn user if they edit _id


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/faa65cd5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/faa65cd5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/faa65cd5

Branch: refs/heads/master
Commit: faa65cd5021bc0a1e855571e9626fec647502cd7
Parents: 446e139
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Sep 19 16:02:02 2013 +0200
Committer: suelockwood <de...@gmail.com>
Committed: Fri Sep 20 10:52:15 2013 -0400

----------------------------------------------------------------------
 src/fauxton/Gruntfile.js                       |  6 +++---
 src/fauxton/app/modules/documents/resources.js |  6 ++++++
 src/fauxton/app/modules/documents/views.js     | 18 +++++++++++++++---
 3 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/faa65cd5/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 29a70ba..f9af371 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -218,9 +218,9 @@ module.exports = function(grunt) {
       port: 8000,
       proxy: {
         target: {
-          host: 'localhost',
-          port: 5984,
-          https: false
+          host: 'garrensmith.cloudant.com',
+          port: 443,
+          https: true
         },
         // This sets the Host header in the proxy so that you can use external
         // CouchDB instances and not have the Host set to 'localhost'

http://git-wip-us.apache.org/repos/asf/couchdb/blob/faa65cd5/src/fauxton/app/modules/documents/resources.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/resources.js b/src/fauxton/app/modules/documents/resources.js
index 395d171..de27ab0 100644
--- a/src/fauxton/app/modules/documents/resources.js
+++ b/src/fauxton/app/modules/documents/resources.js
@@ -44,6 +44,12 @@ function(app, FauxtonAPI) {
       return this.database ? this.database : this.collection.database;
     },
 
+    validate: function(attrs, options) {
+      if (this.id && this.id !== attrs._id && this.get('_rev') ) {
+        return "Cannot change a documents id.";
+      }
+    },
+
     docType: function() {
       return this.id.match(/^_design/) ? "design doc" : "doc";
     },

http://git-wip-us.apache.org/repos/asf/couchdb/blob/faa65cd5/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 09ef2b5..de19386 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -633,6 +633,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
       event.preventDefault();
       this.duplicateModal.showModal();
     },
+
     updateValues: function() {
       var notification;
       if (this.model.changedAttributes()) {
@@ -676,6 +677,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
         this.getDocFromEditor();
 
         notification = FauxtonAPI.addNotification({msg: "Saving document."});
+        console.log('save',this.model);
 
         this.model.save().then(function () {
           FauxtonAPI.navigate('/database/' + that.database.id + '/' + that.model.id);
@@ -684,9 +686,17 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
           notification = FauxtonAPI.addNotification({
             msg: "Save failed: " + responseText,
             type: "error",
-            clear: true
+            clear: true,
+            selector: "#doc .errors-container"
           });
         });
+      } else if(this.model.validationError && this.model.validationError === 'Cannot change a documents id.') {
+          notification = FauxtonAPI.addNotification({
+            msg: "Cannot save: " + 'Cannot change a documents _id, try Duplicate doc instead!',
+            type: "error",
+            selector: "#doc .errors-container"
+          });
+        delete this.model.validationError;
       } else {
         notification = FauxtonAPI.addNotification({
           msg: "Please fix the JSON errors and try again.",
@@ -702,8 +712,10 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
       }
 
       json = JSON.parse(this.editor.getValue());
-      this.model.clear({silent:true});
-      this.model.set(json);
+      this.model.set(json, {validate: true});
+      if (this.model.validationError) {
+        return false;
+      }
 
       return this.model;
     },


[3/3] git commit: updated refs/heads/master to 8a1118e

Posted by de...@apache.org.
show upload errors


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8a1118e1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8a1118e1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8a1118e1

Branch: refs/heads/master
Commit: 8a1118e18790295f9094b16afe74d9f8a7fec479
Parents: faa65cd
Author: Garren Smith <ga...@gmail.com>
Authored: Thu Sep 19 16:47:31 2013 +0200
Committer: suelockwood <de...@gmail.com>
Committed: Fri Sep 20 10:52:15 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js            | 9 ++++++---
 src/fauxton/app/templates/documents/upload_modal.html | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a1118e1/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index de19386..c70e94e 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -147,6 +147,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
       event.preventDefault();
 
       var docRev = this.model.get('_rev'),
+          that = this,
           $form = this.$('#file-upload');
 
       if (!docRev) {
@@ -165,21 +166,23 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror, JSHint, re
         beforeSend: this.beforeSend,
         uploadProgress: this.uploadProgress,
         success: this.success,
-        error: function () {
-          console.log('ERR on upload', arguments);
+        error: function (resp) {
+          console.log('ERR on upload', resp);
+          return that.set_error_msg('Could not upload document: ' + JSON.parse(resp.responseText).reason);
         }
       });
     },
 
     success: function (resp) {
       var hideModal = this.hideModal,
-      $form = this.$('#file-upload');
+          $form = this.$('#file-upload');
 
       FauxtonAPI.triggerRouteEvent('reRenderDoc');
       //slight delay to make this transistion a little more fluid and less jumpy
       setTimeout(function () {
         $form.clearForm();
         hideModal();
+        $('.modal-backdrop').remove();
       }, 1000);
     },
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8a1118e1/src/fauxton/app/templates/documents/upload_modal.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/upload_modal.html b/src/fauxton/app/templates/documents/upload_modal.html
index 08a14a6..33c2861 100644
--- a/src/fauxton/app/templates/documents/upload_modal.html
+++ b/src/fauxton/app/templates/documents/upload_modal.html
@@ -18,7 +18,7 @@ the License.
     <h3>Upload an Attachment</h3>
   </div>
   <div class="modal-body">
-    <div id="modal-error" class="hide alert alert-error"/>
+    <div id="modal-error" class="alert alert-error hide" style="font-size: 16px;"> </div>
     <form id="file-upload" class="form" method="post">
       <p class="help-block">
       Please select the file you want to upload as an attachment to this document.