Github user benkeen commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/670#discussion_r60452424
--- Diff: app/addons/documents/routes-doc-editor.js ---
@@ -32,47 +76,53 @@ function (app, FauxtonAPI, Helpers, Documents,
Databases, Actions, ReactComponen
initialize: function (route, masterLayout, options) {
this.databaseName = options[0];
- this.docID = options[1] || 'new';
+ this.docId = options[1];
this.database = this.database || new Databases.Model({ id:
this.databaseName });
- this.doc = new Documents.Doc({ _id: this.docID }, { database:
this.database });
- this.isNewDoc = false;
+ this.doc = new Documents.NewDoc(null, { database: this.database });
this.wasCloned = false;
},
routes: {
'database/:database/:doc/code_editor': 'codeEditor',
+ 'database/:database/_design/:ddoc': 'showDesignDoc',
'database/:database/:doc': 'codeEditor',
- 'database/:database/_design/:ddoc': 'showDesignDoc'
+ 'database/:database/new': 'codeEditor'
},
events: {
'route:duplicateDoc': 'duplicateDoc'
},
crumbs: function () {
- var previousPage = Helpers.getPreviousPageForDoc(this.database,
this.wasCloned);
+ if (this.docId) {
+ let previousPage = Helpers.getPreviousPageForDoc(this.database,
this.wasCloned);
+
+ return [
+ { type: 'back', link: previousPage },
+ { name: this.docId, link: '#' }
+ ];
+ }
+
+ let previousPage = Helpers.getPreviousPageForDoc(this.database);
return [
{ type: 'back', link: previousPage },
- { name: this.docID, link: '#' }
+ { name: 'New Document', link: '#' }
];
},
- codeEditor: function (database, doc) {
+ codeEditor: function (databaseName, docId) {
+ console.log(databaseName, docId);
--- End diff --
should be removed
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---