couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject fauxton commit: updated refs/heads/master to a88bad9
Date Mon, 06 Feb 2017 13:05:52 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master b7d7b4af9 -> a88bad950


fix encoding in views


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

Branch: refs/heads/master
Commit: a88bad950c325a8d0a5b06470e0b26b050d11d8a
Parents: b7d7b4a
Author: Garren Smith <garren.smith@gmail.com>
Authored: Thu Feb 2 15:40:16 2017 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Mon Feb 6 15:05:22 2017 +0200

----------------------------------------------------------------------
 app/addons/documents/index-editor/actions.js    |  2 +-
 .../documents/mango/mango.components.react.jsx  |  2 +-
 app/addons/documents/sidebar/sidebar.react.jsx  | 10 +--
 .../tests/nightwatch/encodingSupport.js         | 89 ++++++++++++++++++++
 devserver.js                                    |  2 +-
 5 files changed, 97 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a88bad95/app/addons/documents/index-editor/actions.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-editor/actions.js b/app/addons/documents/index-editor/actions.js
index 88f4789..4ec146f 100644
--- a/app/addons/documents/index-editor/actions.js
+++ b/app/addons/documents/index-editor/actions.js
@@ -170,7 +170,7 @@ function cloneView (params) {
 }
 
 function gotoEditViewPage (databaseName, designDocName, indexName) {
-  FauxtonAPI.navigate('#' + FauxtonAPI.urls('view', 'edit', databaseName, designDocName,
indexName));
+  FauxtonAPI.navigate('#' + FauxtonAPI.urls('view', 'edit', encodeURIComponent(databaseName),
designDocName, indexName));
 }
 
 function updateMapCode (code) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a88bad95/app/addons/documents/mango/mango.components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/mango/mango.components.react.jsx b/app/addons/documents/mango/mango.components.react.jsx
index dab725f..76b26b4 100644
--- a/app/addons/documents/mango/mango.components.react.jsx
+++ b/app/addons/documents/mango/mango.components.react.jsx
@@ -178,7 +178,7 @@ var MangoEditor = React.createClass({
     return (
       <PaddedBorderedBox>
         <strong>Your available Indexes:</strong>
-        <a className="edit-link" href={'#' + FauxtonAPI.urls('mango', 'index-app', this.props.dbName)}>edit</a>
+        <a className="edit-link" href={'#' + FauxtonAPI.urls('mango', 'index-app', encodeURIComponent(this.props.dbName))}>edit</a>
         <pre
           className="mango-available-indexes">
           {this.getIndexes('index', this.props.availableIndexes)}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a88bad95/app/addons/documents/sidebar/sidebar.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/sidebar/sidebar.react.jsx b/app/addons/documents/sidebar/sidebar.react.jsx
index b791fa2..10b561b 100644
--- a/app/addons/documents/sidebar/sidebar.react.jsx
+++ b/app/addons/documents/sidebar/sidebar.react.jsx
@@ -45,7 +45,7 @@ var MainSidebar = React.createClass({
   },
 
   buildDocLinks: function () {
-    var base = FauxtonAPI.urls('base', 'app', this.props.databaseName);
+    const base = FauxtonAPI.urls('base', 'app', this.props.databaseName);
     return FauxtonAPI.getExtensions('docLinks').map(function (link) {
       return (
         <li key={link.url} className={this.getNavItemClass(link.url)}>
@@ -148,7 +148,7 @@ var IndexSection = React.createClass({
     var sortedItems = this.props.items.sort();
 
     return _.map(sortedItems, function (indexName, index) {
-      var href = FauxtonAPI.urls(this.props.urlNamespace, 'app', this.props.database.id,
this.props.designDocName);
+      var href = FauxtonAPI.urls(this.props.urlNamespace, 'app', encodeURIComponent(this.props.database.id),
this.props.designDocName);
       var className = (this.props.selectedIndex === indexName) ? 'active' : '';
 
       return (
@@ -324,7 +324,7 @@ var DesignDoc = React.createClass({
   },
 
   getNewButtonLinks: function () {
-    var newUrlPrefix = FauxtonAPI.urls('databaseBaseURL', 'app', this.props.database.id);
+    var newUrlPrefix = FauxtonAPI.urls('databaseBaseURL', 'app', encodeURIComponent(this.props.database.id));
     var designDocName = this.props.designDocName;
 
     var addNewLinks = _.reduce(FauxtonAPI.getExtensions('sidebar:links'), function (menuLinks,
link) {
@@ -336,7 +336,7 @@ var DesignDoc = React.createClass({
       return menuLinks;
     }, [{
       title: 'New View',
-      url: '#' + FauxtonAPI.urls('new', 'addView', this.props.database.id, designDocName),
+      url: '#' + FauxtonAPI.urls('new', 'addView', encodeURIComponent(this.props.database.id),
designDocName),
       icon: 'fonticon-plus-circled'
     }]);
 
@@ -356,7 +356,7 @@ var DesignDoc = React.createClass({
       toggleBodyClassNames += ' in';
     }
     var designDocName = this.props.designDocName;
-    var designDocMetaUrl = FauxtonAPI.urls('designDocs', 'app', this.props.database.id, designDocName);
+    var designDocMetaUrl = FauxtonAPI.urls('designDocs', 'app', encodeURIComponent(this.props.database.id),
designDocName);
     var metadataRowClass = (this.props.selectedNavInfo.designDocSection === 'metadata') ?
'active' : '';
 
     return (

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a88bad95/app/addons/documents/tests/nightwatch/encodingSupport.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/encodingSupport.js b/app/addons/documents/tests/nightwatch/encodingSupport.js
new file mode 100644
index 0000000..8d92b43
--- /dev/null
+++ b/app/addons/documents/tests/nightwatch/encodingSupport.js
@@ -0,0 +1,89 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+
+
+module.exports = {
+  'mango supports encoding': function (client) {
+    var waitTime = client.globals.maxWaitTime,
+        newDatabaseName = 'encoded/db',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .deleteDatabase(newDatabaseName)
+      .createDatabase(newDatabaseName)
+      .populateDatabase(newDatabaseName)
+      .loginToGUI()
+      .url(baseUrl + '/#/database/' + encodeURIComponent(newDatabaseName) + '/_all_docs')
+      .waitForElementPresent('.bulk-action-component-panel', waitTime, true)
+      .clickWhenVisible('#mango-query', waitTime, true)
+      .waitForElementPresent('.mango-editor-wrapper', waitTime, true)
+    .end();
+  },
+
+  'permissions supports encoding': function (client) {
+    var waitTime = client.globals.maxWaitTime,
+        newDatabaseName = 'encoded/db',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .deleteDatabase(newDatabaseName)
+      .createDatabase(newDatabaseName)
+      .populateDatabase(newDatabaseName)
+      .loginToGUI()
+      .url(baseUrl + '/#/database/' + encodeURIComponent(newDatabaseName) + '/_all_docs')
+      .waitForElementPresent('.bulk-action-component-panel', waitTime, true)
+      .clickWhenVisible('#permissions', waitTime, true)
+      .waitForElementPresent('.permissions-page', waitTime, true)
+    .end();
+  },
+
+  'changes supports encoding': function (client) {
+    var waitTime = client.globals.maxWaitTime,
+        newDatabaseName = 'encoded/db',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .deleteDatabase(newDatabaseName)
+      .createDatabase(newDatabaseName)
+      .populateDatabase(newDatabaseName)
+      .loginToGUI()
+      .url(baseUrl + '/#/database/' + encodeURIComponent(newDatabaseName) + '/_all_docs')
+      .waitForElementPresent('.bulk-action-component-panel', waitTime, true)
+      .clickWhenVisible('#changes', waitTime, true)
+      .waitForElementPresent('.changes-header', waitTime, true)
+    .end();
+  },
+  'views support encoding': function (client) {
+    var waitTime = client.globals.maxWaitTime,
+        newDatabaseName = 'encoded/db',
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .deleteDatabase(newDatabaseName)
+      .createDatabase(newDatabaseName)
+      .populateDatabase(newDatabaseName)
+      .loginToGUI()
+      .url(baseUrl + '/#/database/' + encodeURIComponent(newDatabaseName) + '/_all_docs')
+      .waitForElementPresent('.bulk-action-component-panel', waitTime, true)
+      .clickWhenVisible('#nav-header-testdesigndoc', waitTime, true)
+      .clickWhenVisible('a[href="#/database/encoded%2Fdb/_design/testdesigndoc/_info"]',
waitTime, true)
+      .waitForElementPresent('.metadata-page', waitTime, true)
+      .clickWhenVisible('#nav-design-function-testdesigndocviews', waitTime, true)
+      .clickWhenVisible('#testdesigndoc_stubview', waitTime, true)
+      .waitForElementPresent('#doc-list', waitTime, true)
+      .clickWhenVisible('.active .index-menu-toggle', waitTime, true)
+      .clickWhenVisible('.fonticon-file-code-o')
+      .waitForElementPresent('.view-query-save', waitTime, true)
+    .end();
+  }
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a88bad95/devserver.js
----------------------------------------------------------------------
diff --git a/devserver.js b/devserver.js
index 4e2f881..9be142a 100644
--- a/devserver.js
+++ b/devserver.js
@@ -49,7 +49,7 @@ var devSetup = function (cb) {
   });
 };
 
-const defaultHeaderValue = "default-src 'self'; img-src 'self' data:; font-src 'self'; "
+
+const defaultHeaderValue = "default-src 'self'; child-src 'self' blob:; img-src 'self' data:;
font-src 'self'; " +
                   "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';";
 function getCspHeaders () {
   if (!settings.contentSecurityPolicy) {


Mime
View raw message