You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by garrensmith <gi...@git.apache.org> on 2016/11/23 09:03:38 UTC
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
GitHub user garrensmith opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/812
remove doc_editor template
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/garrensmith/couchdb-fauxton remove-doc_editor-template
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/812.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #812
----
commit eaa2286df8060cd03461a9377bf309bd89ac31cf
Author: Garren Smith <ga...@gmail.com>
Date: 2016-11-23T09:03:16Z
remove doc_editor template
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90053096
--- Diff: app/addons/documents/routes-documents.js ---
@@ -55,46 +49,39 @@ var DocumentsRouteObject = BaseRoute.extend({
this.initViews(options[0]);
},
- establish: function () {
- return [
- this.designDocs.fetch({ reset: true })
- ];
- },
-
initViews: function (dbName) {
this.databaseName = dbName;
this.database = new Databases.Model({id: this.databaseName});
this.createDesignDocsCollection();
- this.setComponent("#right-header", RightAllDocsHeader, {
- database: this.database
- });
-
- this.addLeftHeader();
this.addSidebar();
},
designDocMetadata: function (database, ddoc) {
- this.removeComponent('#footer');
- this.removeComponent('#react-headerbar');
- this.removeComponent('#dashboard-upper-content');
-
var designDocInfo = new Resources.DdocInfo({ _id: "_design/" + ddoc }, { database: this.database });
DesignDocInfoActions.fetchDesignDocInfo({
ddocName: ddoc,
designDocInfo: designDocInfo
});
- this.setComponent("#dashboard-lower-content", DesignDocInfoComponents.DesignDocInfo);
SidebarActions.selectNavItem('designDoc', {
designDocName: ddoc,
designDocSection: 'metadata'
});
QueryOptionsActions.hideQueryOptions();
-
- this.apiUrl = [designDocInfo.url('apiurl'), designDocInfo.documentation()];
+ this.apiUrl = [, designDocInfo.documentation()];
--- End diff --
`[, designDocInfo.documentation()];` => typo?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90052264
--- Diff: app/addons/components/assets/less/layouts.less ---
@@ -19,3 +19,11 @@
flex-direction: row;
height: 100%;
}
+
+//yes !important!!! We have to overridde some styles I can't override any other way for now
--- End diff --
wait a second... this css overrides it globally everywhere.
why do we need to override then - instead of replacing the old CSS?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/812
\U0001f60d heavy clean up and great refactorings. thanks so much!
found some code issue, haven't run the code locally yet. seems there is a conflict, too.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90053369
--- Diff: app/addons/documents/shared-routes.js ---
@@ -88,13 +80,13 @@ var BaseRoute = FauxtonAPI.RouteObject.extend({
];
},
- ddocInfo: function (designDoc, designDocs, view) {
- return {
- id: "_design/" + designDoc,
- currView: view,
- designDocs: designDocs
- };
- },
+ // ddocInfo: function (designDoc, designDocs, view) {
+ // return {
+ // id: "_design/" + designDoc,
+ // currView: view,
+ // designDocs: designDocs
+ // };
+ // },
--- End diff --
huh?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90052494
--- Diff: app/addons/config/layout.js ---
@@ -0,0 +1,97 @@
+// 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.
+
+import React from 'react';
+import FauxtonAPI from "../../core/api";
+import {TabsSidebarHeader} from '../documents/layouts';
+import ConfigComponents from "./components.react";
+import CORSComponents from "../cors/components.react";
+import {Breadcrumbs} from '../components/header-breadcrumbs';
+import {NotificationCenterButton} from '../fauxton/notifications/notifications.react';
+import {ApiBarWrapper} from '../components/layouts';
+
+// const sidebarItems = [
+// {
+// title: 'Main config',
+// typeSelect: 'main',
+// link: '_config/' + node
+// },
+// {
+// title: 'CORS',
+// typeSelect: 'cors',
+// link: '_config/' + node + '/cors'
+// }
+// ];
--- End diff --
remove?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/812
+1
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90198131
--- Diff: app/addons/components/assets/less/layouts.less ---
@@ -19,3 +19,11 @@
flex-direction: row;
height: 100%;
}
+
+//yes !important!!! We have to overridde some styles I can't override any other way for now
--- End diff --
That is tricky to do, because its not one specific class styling. It would require a large clean up of our css which is out of scope for this PR.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith closed the pull request at:
https://github.com/apache/couchdb-fauxton/pull/812
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #812: remove doc_editor template
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/812
merged
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90053583
--- Diff: app/addons/fauxton/components.js ---
@@ -26,163 +26,163 @@ var Components = FauxtonAPI.addon();
* - showTray
* - toggleTray
*/
-Components.Tray = FauxtonAPI.View.extend({
-
- // populated dynamically
- events: {},
-
- initTray: function (opts) {
- this.toggleTrayBtnSelector = (_.has(opts, 'toggleTrayBtnSelector')) ? opts.toggleTrayBtnSelector : null;
- this.onShowTray = (_.has(opts, 'onShowTray')) ? opts.onShowTray : null;
-
- // if the component extending this one passed along the selector of the element that toggles the tray,
- // add the appropriate events
- if (!_.isNull(this.toggleTrayBtnSelector)) {
- this.events['click ' + this.toggleTrayBtnSelector] = 'toggleTray';
- }
-
- _.bind(this.toggleTray, this);
- _.bind(this.trayVisible, this);
- _.bind(this.hideTray, this);
- _.bind(this.showTray, this);
-
- // a unique identifier for this tray
- this.trayId = 'tray-' + this.cid;
-
- var that = this;
- $('body').on('click.' + this.trayId, function (e) {
- var $clickEl = $(e.target);
-
- if (!that.trayVisible()) {
- return;
- }
- if (!_.isNull(that.toggleTrayBtnSelector) && $clickEl.closest(that.toggleTrayBtnSelector).length) {
- return;
- }
- if (!$clickEl.closest('.tray').length) {
- that.hideTray();
- }
- });
-
- FauxtonAPI.Events.on(FauxtonAPI.constants.EVENTS.TRAY_OPENED, this.onTrayOpenEvent, this);
- },
-
- cleanup: function () {
- $('body').off('click.' + this.trayId);
- },
-
- // all trays publish a EVENTS.TRAY_OPENED event containing their unique ID. This listens for those events and
- // closes the current tray if it's already open
- onTrayOpenEvent: function (msg) {
- if (!_.has(msg, 'trayId')) {
- return;
- }
- if (msg.trayId !== this.trayId && this.trayVisible()) {
- this.hideTray();
- }
- },
-
- toggleTray: function (e) {
- e.preventDefault();
-
- if (this.trayVisible()) {
- this.hideTray();
- } else {
- this.showTray();
- }
- },
-
- hideTray: function () {
- var $tray = this.$('.tray');
- $tray.velocity('reverse', FauxtonAPI.constants.MISC.TRAY_TOGGLE_SPEED, function () {
- $tray.hide();
- });
-
- if (!_.isNull(this.toggleTrayBtnSelector)) {
- this.$(this.toggleTrayBtnSelector).removeClass('enabled');
- }
- },
-
- showTray: function () {
- this.$('.tray').velocity('transition.slideDownIn', FauxtonAPI.constants.MISC.TRAY_TOGGLE_SPEED);
- if (!_.isNull(this.toggleTrayBtnSelector)) {
- this.$(this.toggleTrayBtnSelector).addClass('enabled');
- }
-
- if (!_.isNull(this.onShowTray)) {
- this.onShowTray();
- }
-
- FauxtonAPI.Events.trigger(FauxtonAPI.constants.EVENTS.TRAY_OPENED, { trayId: this.trayId });
- },
-
- trayVisible: function () {
- return this.$('.tray').is(':visible');
- }
-});
-
-Components.Typeahead = FauxtonAPI.View.extend({
-
- initialize: function (options) {
- this.source = options.source;
- this.onUpdateEventName = options.onUpdateEventName;
- },
-
- afterRender: function () {
- var onUpdateEventName = this.onUpdateEventName;
-
- this.$el.typeahead({
- source: this.source,
- updater: function (item) {
- FauxtonAPI.Events.trigger(onUpdateEventName, item);
- return item;
- }
- });
- }
-});
-
-Components.DbSearchTypeahead = Components.Typeahead.extend({
- initialize: function (options) {
- this.dbLimit = options.dbLimit || 30;
- if (options.filter) {
- this.resultFilter = options.resultFilter;
- }
- _.bindAll(this);
- },
-
- getURL: function (query, dbLimit) {
- query = encodeURIComponent(query);
- return [
- app.host,
- "/_all_dbs?startkey=%22",
- query,
- "%22&endkey=%22",
- query,
- encodeURIComponent("\u9999"),
- "%22&limit=",
- dbLimit
- ].join('');
- },
-
- source: function (query, process) {
- var url = this.getURL(query, this.dbLimit);
- var resultFilter = this.resultFilter;
-
- if (this.ajaxReq) { this.ajaxReq.abort(); }
-
- this.ajaxReq = $.ajax({
- cache: false,
- url: url,
- dataType: 'json',
- success: function (data) {
- if (resultFilter) {
- data = resultFilter(data);
- }
- process(data);
- }
- });
- }
-});
-
-
+// Components.Tray = FauxtonAPI.View.extend({
+//
+// // populated dynamically
+// events: {},
+//
+// initTray: function (opts) {
+// this.toggleTrayBtnSelector = (_.has(opts, 'toggleTrayBtnSelector')) ? opts.toggleTrayBtnSelector : null;
+// this.onShowTray = (_.has(opts, 'onShowTray')) ? opts.onShowTray : null;
+//
+// // if the component extending this one passed along the selector of the element that toggles the tray,
+// // add the appropriate events
+// if (!_.isNull(this.toggleTrayBtnSelector)) {
+// this.events['click ' + this.toggleTrayBtnSelector] = 'toggleTray';
+// }
+//
+// _.bind(this.toggleTray, this);
+// _.bind(this.trayVisible, this);
+// _.bind(this.hideTray, this);
+// _.bind(this.showTray, this);
+//
+// // a unique identifier for this tray
+// this.trayId = 'tray-' + this.cid;
+//
+// var that = this;
+// $('body').on('click.' + this.trayId, function (e) {
+// var $clickEl = $(e.target);
+//
+// if (!that.trayVisible()) {
+// return;
+// }
+// if (!_.isNull(that.toggleTrayBtnSelector) && $clickEl.closest(that.toggleTrayBtnSelector).length) {
+// return;
+// }
+// if (!$clickEl.closest('.tray').length) {
+// that.hideTray();
+// }
+// });
+//
+// FauxtonAPI.Events.on(FauxtonAPI.constants.EVENTS.TRAY_OPENED, this.onTrayOpenEvent, this);
+// },
+//
+// cleanup: function () {
+// $('body').off('click.' + this.trayId);
+// },
+//
+// // all trays publish a EVENTS.TRAY_OPENED event containing their unique ID. This listens for those events and
+// // closes the current tray if it's already open
+// onTrayOpenEvent: function (msg) {
+// if (!_.has(msg, 'trayId')) {
+// return;
+// }
+// if (msg.trayId !== this.trayId && this.trayVisible()) {
+// this.hideTray();
+// }
+// },
+//
+// toggleTray: function (e) {
+// e.preventDefault();
+//
+// if (this.trayVisible()) {
+// this.hideTray();
+// } else {
+// this.showTray();
+// }
+// },
+//
+// hideTray: function () {
+// var $tray = this.$('.tray');
+// $tray.velocity('reverse', FauxtonAPI.constants.MISC.TRAY_TOGGLE_SPEED, function () {
+// $tray.hide();
+// });
+//
+// if (!_.isNull(this.toggleTrayBtnSelector)) {
+// this.$(this.toggleTrayBtnSelector).removeClass('enabled');
+// }
+// },
+//
+// showTray: function () {
+// this.$('.tray').velocity('transition.slideDownIn', FauxtonAPI.constants.MISC.TRAY_TOGGLE_SPEED);
+// if (!_.isNull(this.toggleTrayBtnSelector)) {
+// this.$(this.toggleTrayBtnSelector).addClass('enabled');
+// }
+//
+// if (!_.isNull(this.onShowTray)) {
+// this.onShowTray();
+// }
+//
+// FauxtonAPI.Events.trigger(FauxtonAPI.constants.EVENTS.TRAY_OPENED, { trayId: this.trayId });
+// },
+//
+// trayVisible: function () {
+// return this.$('.tray').is(':visible');
+// }
+// });
+//
+// Components.Typeahead = FauxtonAPI.View.extend({
+//
+// initialize: function (options) {
+// this.source = options.source;
+// this.onUpdateEventName = options.onUpdateEventName;
+// },
+//
+// afterRender: function () {
+// var onUpdateEventName = this.onUpdateEventName;
+//
+// this.$el.typeahead({
+// source: this.source,
+// updater: function (item) {
+// FauxtonAPI.Events.trigger(onUpdateEventName, item);
+// return item;
+// }
+// });
+// }
+// });
+//
+// Components.DbSearchTypeahead = Components.Typeahead.extend({
+// initialize: function (options) {
+// this.dbLimit = options.dbLimit || 30;
+// if (options.filter) {
+// this.resultFilter = options.resultFilter;
+// }
+// _.bindAll(this);
+// },
+//
+// getURL: function (query, dbLimit) {
+// query = encodeURIComponent(query);
+// return [
+// app.host,
+// "/_all_dbs?startkey=%22",
+// query,
+// "%22&endkey=%22",
+// query,
+// encodeURIComponent("\u9999"),
+// "%22&limit=",
+// dbLimit
+// ].join('');
+// },
+//
+// source: function (query, process) {
+// var url = this.getURL(query, this.dbLimit);
+// var resultFilter = this.resultFilter;
+//
+// if (this.ajaxReq) { this.ajaxReq.abort(); }
+//
+// this.ajaxReq = $.ajax({
+// cache: false,
+// url: url,
+// dataType: 'json',
+// success: function (data) {
+// if (resultFilter) {
+// data = resultFilter(data);
+// }
+// process(data);
+// }
+// });
+// }
+// });
+//
+//
--- End diff --
just delete...
yippieh! \U0001f46f\u200d\u2642\ufe0f
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90053429
--- Diff: app/addons/fauxton/base.js ---
@@ -32,38 +32,6 @@ Fauxton.initialize = function () {
FauxtonAPI.RouteObject.on('beforeEstablish', function (routeObject) {
NavigationActions.setNavbarActiveLink(_.result(routeObject, 'selectedHeader'));
-
- if (!routeObject.hideApiBar) {
- // always attempt to render the API Bar. Even if it's hidden on initial load, it may be enabled later
- routeObject.setComponent('#api-navbar', ReactComponents.ApiBarController, {
- buttonVisible: true,
- contentVisible: false
- });
-
- const apiAndDocs = routeObject.get('apiUrl');
- if (apiAndDocs) {
- ComponentActions.updateAPIBar({
- buttonVisible: true,
- contentVisible: false,
- endpoint: apiAndDocs[0],
- docURL: apiAndDocs[1]
- });
- } else {
- ComponentActions.hideAPIBarButton();
- }
- }
-
- if (!routeObject.get('hideNotificationCenter')) {
- routeObject.setComponent('#notification-center-btn', NotificationComponents.NotificationCenterButton);
- }
-
- const crumbs = routeObject.get('crumbs');
-
- if (!crumbs.length) {
- return;
- }
-
- routeObject.setComponent('#breadcrumbs', Breadcrumbs, {crumbs: crumbs});
--- End diff --
haha :) \U0001f44d
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #812: remove doc_editor template
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/812#discussion_r90052964
--- Diff: app/addons/documents/routes-documents.js ---
@@ -55,46 +49,39 @@ var DocumentsRouteObject = BaseRoute.extend({
this.initViews(options[0]);
},
- establish: function () {
- return [
- this.designDocs.fetch({ reset: true })
- ];
- },
--- End diff --
<3
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---