You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/03/30 13:49:48 UTC
[1/2] fauxton commit: updated refs/heads/master to 79d5f32
Repository: couchdb-fauxton
Updated Branches:
refs/heads/master 5306f98d3 -> 79d5f320a
docs: cleanup old views
remove a lot of old cold that we don't need any more after we
refactored the all-docs-list
PR: #338
PR-URL: https://github.com/apache/couchdb-fauxton/pull/338
Reviewed-By: garren smith <ga...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5a10f1ca
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5a10f1ca
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5a10f1ca
Branch: refs/heads/master
Commit: 5a10f1ca67347709d5654c4f5f775c63c8866e26
Parents: 5306f98
Author: Robert Kowalski <ro...@apache.org>
Authored: Fri Mar 27 10:28:59 2015 +0100
Committer: Robert Kowalski <ro...@apache.org>
Committed: Mon Mar 30 13:49:58 2015 +0200
----------------------------------------------------------------------
app/addons/documents/shared-resources.js | 16 +-----
.../documents/templates/all_docs_item.html | 43 ----------------
.../documents/templates/all_docs_layout.html | 16 ------
.../documents/templates/all_docs_list.html | 25 ---------
.../documents/templates/index_row_tabular.html | 25 ---------
app/addons/documents/views.js | 54 --------------------
6 files changed, 1 insertion(+), 178 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a10f1ca/app/addons/documents/shared-resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/shared-resources.js b/app/addons/documents/shared-resources.js
index 06306cf..04098c0 100644
--- a/app/addons/documents/shared-resources.js
+++ b/app/addons/documents/shared-resources.js
@@ -57,10 +57,6 @@ define([
return this.id && this.id.match(/^_design\//) ? "design doc" : "doc";
},
- isEditable: function () {
- return this.docType() != "reduction";
- },
-
isFromView: function () {
return !this.id;
},
@@ -88,10 +84,6 @@ define([
return views && _.keys(views).length > 0;
},
- hasAttachments: function () {
- return !!this.get('_attachments');
- },
-
getDdocView: function (view) {
if (!this.isDdoc() || !this.hasViews()) {
return false;
@@ -117,7 +109,7 @@ define([
} else {
delete tempView.reduce;
}
- tempView.map = map;
+ tempView.map = map;
views[view] = tempView;
this.set({views: views});
@@ -144,12 +136,6 @@ define([
return this;
},
- viewHasReduce: function (viewName) {
- var view = this.getDdocView(viewName);
-
- return view && view.reduce;
- },
-
// Need this to work around backbone router thinking _design/foo
// is a separate route. Alternatively, maybe these should be
// treated separately. For instance, we could default into the
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a10f1ca/app/addons/documents/templates/all_docs_item.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_item.html b/app/addons/documents/templates/all_docs_item.html
deleted file mode 100644
index f8151b8..0000000
--- a/app/addons/documents/templates/all_docs_item.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<%/*
-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.
-*/%>
-
-<div class="custom-inputs">
- <div class="checkbox inline">
- <input id="checkbox-<%- docIdentifier %>" <%- checked ? 'checked="checked"' : '' %> type="checkbox" class="js-row-select">
- <label class="label-checkbox-doclist" for="checkbox-<%- docIdentifier %>"></label>
- </div>
-</div>
-<div class="doc-item">
- <header>
- <span class="header-keylabel"><%- doc.isFromView() ? 'key' : 'id' %></span> <span class="header-doc-id">"<%- docIdentifier %>"</span>
- <% if (!doc.isReducedShown()) { %>
- <div class="doc-edit-symbol pull-right">
- <% if (doc.isFromView()) { %>
- <a href="#<%- doc.url('app') %>">
- <% } else { %>
- <a href="#<%- doc.url('web-index')%>">
- <% } %>
- <i class="fonticon-pencil"></i>
- </a>
- </div>
- <% } %>
-
- <div class="doc-item-extension-icons pull-right"></div>
-
- </header>
- <div class="doc-data">
- <pre class="prettyprint"><%- doc.prettyJSON() %></pre>
- </div>
-</div>
-<div class="clearfix"></div>
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a10f1ca/app/addons/documents/templates/all_docs_layout.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_layout.html b/app/addons/documents/templates/all_docs_layout.html
deleted file mode 100644
index 8db91ed..0000000
--- a/app/addons/documents/templates/all_docs_layout.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--
-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.
--->
-<div class="tab-content">
- <div class="tab-pane" id="query"></div>
-</div>
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a10f1ca/app/addons/documents/templates/all_docs_list.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/all_docs_list.html b/app/addons/documents/templates/all_docs_list.html
deleted file mode 100644
index 2e10e6e..0000000
--- a/app/addons/documents/templates/all_docs_list.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<%/*
-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.
-*/%>
-
-<div class="view">
- <div id="doc-list"></div>
-
- <% if (endOfResults) { %>
- <div class="end-of-results text-center well">
- <p class="muted">
- End of results
- </p>
- </div>
- <% } %>
-</div>
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a10f1ca/app/addons/documents/templates/index_row_tabular.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/index_row_tabular.html b/app/addons/documents/templates/index_row_tabular.html
deleted file mode 100644
index f5f68fa..0000000
--- a/app/addons/documents/templates/index_row_tabular.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
-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.
--->
-
-<td class="select"><input type="checkbox"></td>
-<td>
- <div>
- <pre class="prettyprint"><%- JSON.stringify(doc.get("key")) %></pre>
- </div>
-</td>
-<td>
- <div>
- <pre class="prettyprint"><%- JSON.stringify(doc.get("value")) %></pre>
- </div>
-</td>
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5a10f1ca/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index dcd607d..f5c30bc 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -215,60 +215,6 @@ function (app, FauxtonAPI, Components, Documents,
}
});
- Views.Document = FauxtonAPI.View.extend({
- template: "addons/documents/templates/all_docs_item",
-
- className: function () {
- var classNames = 'all-docs-item doc-row';
-
- if (this.checked) {
- classNames = classNames + ' js-to-delete';
- }
-
- return classNames;
- },
-
- initialize: function (options) {
- this.checked = options.checked;
- },
-
- events: {
- "dblclick .doc-item": "edit"
- },
-
- attributes: function () {
- return {
- "data-id": this.model.id
- };
- },
-
- serialize: function () {
- return {
- docIdentifier: this.model.isReducedShown() ? this.model.get('key') : this.model.get('_id'),
- doc: this.model,
- checked: this.checked
- };
- },
-
- beforeRender: function () {
- var extensions = FauxtonAPI.getExtensions('DocList:icons');
- _.each(extensions, function (View) {
- this.insertView('.doc-item-extension-icons', new View({ doc: this.model }));
- }, this);
- },
-
- establish: function () {
- return [this.model.fetch()];
- },
-
- edit: function (event) {
- event.preventDefault();
- if (!this.model.isReducedShown()) {
- FauxtonAPI.navigate(this.model.url('app'));
- }
- }
- });
-
Views.JumpToDoc = FauxtonAPI.View.extend({
template: "addons/documents/templates/jumpdoc",
[2/2] fauxton commit: updated refs/heads/master to 79d5f32
Posted by ro...@apache.org.
doc-editor: remove dead code
PR: #338
PR-URL: https://github.com/apache/couchdb-fauxton/pull/338
Reviewed-By: garren smith <ga...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/79d5f320
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/79d5f320
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/79d5f320
Branch: refs/heads/master
Commit: 79d5f320a4a708cf7c2bb5dad3480f0953e402de
Parents: 5a10f1c
Author: Robert Kowalski <ro...@apache.org>
Authored: Fri Mar 27 15:54:51 2015 +0100
Committer: Robert Kowalski <ro...@apache.org>
Committed: Mon Mar 30 13:50:05 2015 +0200
----------------------------------------------------------------------
.../documents/index-editor/components.react.jsx | 26 +++-----------------
app/addons/documents/index-editor/stores.js | 4 ---
app/addons/documents/tests/storesSpec.js | 4 ---
3 files changed, 4 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/79d5f320/app/addons/documents/index-editor/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-editor/components.react.jsx b/app/addons/documents/index-editor/components.react.jsx
index 1d3e98c..0887bac 100644
--- a/app/addons/documents/index-editor/components.react.jsx
+++ b/app/addons/documents/index-editor/components.react.jsx
@@ -17,11 +17,10 @@ define([
'addons/documents/index-editor/stores',
'addons/documents/index-editor/actions',
'addons/fauxton/components',
- 'addons/components/react-components.react',
- 'plugins/beautify'
+ 'addons/components/react-components.react'
],
-function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents, beautifyHelper) {
+function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents) {
var indexEditorStore = Stores.indexEditorStore;
var getDocUrl = app.helpers.getDocUrl;
var StyledSelect = ReactComponents.StyledSelect;
@@ -408,23 +407,7 @@ function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents,
}
});
- var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;
-
- var EditorController = React.createClass({
- getInitialState: function () {
- return {
- title: indexEditorStore.getTitle()
- };
- },
-
- componentDidMount: function () {
- indexEditorStore.on('change', this.onChange, this);
- },
-
- componentWillUnmount: function () {
- indexEditorStore.off('change', this.onChange);
- },
-
+ var EditorWrapper = React.createClass({
render: function () {
return (
<div className="editor-wrapper span5 scrollable">
@@ -432,12 +415,11 @@ function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents,
</div>
);
}
-
});
var Views = {
renderEditor: function (el) {
- React.render(<EditorController/>, el);
+ React.render(<EditorWrapper/>, el);
},
removeEditor: function (el) {
React.unmountComponentAtNode(el);
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/79d5f320/app/addons/documents/index-editor/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-editor/stores.js b/app/addons/documents/index-editor/stores.js
index 9ed952d..2070df3 100644
--- a/app/addons/documents/index-editor/stores.js
+++ b/app/addons/documents/index-editor/stores.js
@@ -96,10 +96,6 @@ function (FauxtonAPI, ActionTypes) {
return this._newView;
},
- getTitle: function () {
- return this._newView ? 'Create Index' : 'Edit Index';
- },
-
getViewName: function () {
return this._viewName;
},
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/79d5f320/app/addons/documents/tests/storesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/storesSpec.js b/app/addons/documents/tests/storesSpec.js
index 4a042ed..c60295c 100644
--- a/app/addons/documents/tests/storesSpec.js
+++ b/app/addons/documents/tests/storesSpec.js
@@ -50,10 +50,6 @@ define([
it('returns default map', function () {
assert.equal(store.getMap(), 'function (doc) {\n emit(doc._id, 1);\n}');
});
-
- it('Edit Index as title', function () {
- assert.equal(store.getTitle(), 'Create Index');
- });
});
});