couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/5] fauxton commit: updated refs/heads/master to 14224ea
Date Wed, 30 Nov 2016 13:42:22 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 2dc418893 -> 14224ea7e


remove doc_editor template


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

Branch: refs/heads/master
Commit: 26b797a194d8fe4651378b28cc173d786ee7c55f
Parents: 2dc4188
Author: Garren Smith <garren.smith@gmail.com>
Authored: Wed Nov 23 11:03:16 2016 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Wed Nov 30 11:38:38 2016 +0200

----------------------------------------------------------------------
 app/addons/components/layouts.js          | 24 ++++++++++++++++++
 app/addons/documents/routes-doc-editor.js | 35 ++++++++++++++++----------
 app/templates/layouts/doc_editor.html     | 25 ------------------
 3 files changed, 46 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/26b797a1/app/addons/components/layouts.js
----------------------------------------------------------------------
diff --git a/app/addons/components/layouts.js b/app/addons/components/layouts.js
index ddd10df..234e305 100644
--- a/app/addons/components/layouts.js
+++ b/app/addons/components/layouts.js
@@ -113,3 +113,27 @@ export const OnePaneSimpleLayout = ({component, docUrl, endpoint, crumbs})
=> {
     </OnePane>
   );
 };
+
+export const DocEditorContent = ({children}) => {
+  return (
+    <div id="dashboard-content">
+      {children}
+    </div>
+  );
+};
+
+export const DocEditorLayout = ({component, docUrl, endpoint, crumbs}) => {
+  return (
+    <div id="dashboard" className="one-pane doc-editor-page">
+        <OnePaneHeader
+          crumbs={crumbs}
+          endpoint={endpoint}
+          docUrl={docUrl}
+        >
+        </OnePaneHeader>
+      <DocEditorContent>
+        {component}
+      </DocEditorContent>
+    </div>
+  );
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/26b797a1/app/addons/documents/routes-doc-editor.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-doc-editor.js b/app/addons/documents/routes-doc-editor.js
index b13fc32..8fcfaae 100644
--- a/app/addons/documents/routes-doc-editor.js
+++ b/app/addons/documents/routes-doc-editor.js
@@ -10,6 +10,7 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
+import React from 'react';
 import app from "../../app";
 import FauxtonAPI from "../../core/api";
 import Helpers from "./helpers";
@@ -19,10 +20,13 @@ import Actions from "./doc-editor/actions";
 import ReactComponents from "./doc-editor/components.react";
 import RevBrowserActions from "./rev-browser/rev-browser.actions";
 import RevBrowserComponents from "./rev-browser/rev-browser.components.react";
+import {DocEditorLayout} from '../components/layouts';
 
 
 const DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
-  layout: 'doc_editor',
+  layout: 'empty',
+  hideApiBar: true,
+  hideNotificationCenter: true,
   selectedHeader: 'Databases',
 
   roles: ['fx_loggedIn'],
@@ -42,26 +46,30 @@ const DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
     'database/:database/new': 'codeEditor'
   },
 
-  crumbs: function () {},
 
   revisionBrowser: function (databaseName, docId) {
     const backLink = FauxtonAPI.urls('allDocs', 'app', FauxtonAPI.url.encode(this.database.safeID()));
-    const docUrl = FauxtonAPI.urls('document', 'app', this.database.safeID(), this.docId);
+    const docURL = FauxtonAPI.urls('document', 'app', this.database.safeID(), this.docId);
 
-    this.crumbs = [
+    const crumbs = [
       { name: this.database.safeID(), link: backLink },
       { name: this.docId + ' > Conflicts' }
     ];
 
     RevBrowserActions.showConfirmModal(false, null);
     RevBrowserActions.initDiffEditor(databaseName, docId);
-    this.setComponent('#dashboard-content', RevBrowserComponents.DiffyController);
+    this.setComponent(".template", DocEditorLayout, {
+      crumbs,
+      endpoint: this.doc.url('apiurl'),
+      docURL,
+      component: <RevBrowserComponents.DiffyController />
+    });
   },
 
   codeEditor: function (databaseName, docId) {
     const backLink = FauxtonAPI.urls('allDocs', 'app', FauxtonAPI.url.encode(databaseName));
 
-    this.crumbs =  [
+    const crumbs =  [
       { name: databaseName, link: backLink },
       { name: docId ? docId : 'New Document' }
     ];
@@ -73,18 +81,19 @@ const DocEditorRouteObject = FauxtonAPI.RouteObject.extend({
     }
 
     Actions.initDocEditor({ doc: this.doc, database: this.database });
-    this.setComponent('#dashboard-content', ReactComponents.DocEditorController, {
-      database: this.database,
-      isNewDoc: docId ? false : true
+    this.setComponent(".template", DocEditorLayout, {
+      crumbs,
+      endpoint: this.doc.url('apiurl'),
+      docURL: this.doc.documentation(),
+      component: <ReactComponents.DocEditorController
+        database={this.database}
+        isNewDoc={docId ? false : true}
+      />
     });
   },
 
   showDesignDoc: function (database, ddoc) {
     this.codeEditor(database, '_design/' + ddoc);
-  },
-
-  apiUrl: function () {
-    return [this.doc.url('apiurl'), this.doc.documentation()];
   }
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/26b797a1/app/templates/layouts/doc_editor.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/doc_editor.html b/app/templates/layouts/doc_editor.html
deleted file mode 100644
index 470d930..0000000
--- a/app/templates/layouts/doc_editor.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 id="dashboard" class="one-pane doc-editor-page">
-  <header>
-    <div class="flex-layout flex-row">
-      <div id="breadcrumbs" class="flex-body"></div>
-      <div id="api-navbar"></div>
-      <div id="notification-center-btn"></div>
-    </div>
-  </header>
-
-  <div id="dashboard-content"></div>
-</div>


Mime
View raw message