Repository: couchdb-fauxton Updated Branches: refs/heads/master e5f9f9da0 -> b7cbb14d7
Add Documentation page and outside links Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/b7cbb14d Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/b7cbb14d Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/b7cbb14d Branch: refs/heads/master Commit: b7cbb14d7eff9e1203137af874692f006e074d7d Parents: e5f9f9d Author: michellephung <[email protected]> Authored: Sun Jan 24 18:04:10 2016 -0500 Committer: michellephung <[email protected]> Committed: Mon Feb 1 19:21:03 2016 -0500 ---------------------------------------------------------------------- .gitignore | 1 + .../assets/less/documentation.less | 72 +++++++++++++++ app/addons/documentation/base.js | 33 +++++++ app/addons/documentation/components.react.jsx | 67 ++++++++++++++ app/addons/documentation/resources.js | 18 ++++ app/addons/documentation/routes.js | 39 +++++++++ app/addons/documentation/stores.js | 87 +++++++++++++++++++ .../tests/nightwatch/checksDocsPage.js | 34 ++++++++ app/addons/fauxton/navigation/stores.js | 10 +-- .../fauxton/navigation/tests/storeSpec.js | 4 +- assets/img/asf-feather-logo.png | Bin 0 -> 22956 bytes assets/img/couchdb-docs-logo.png | Bin 0 -> 2156 bytes assets/img/github.png | Bin 0 -> 4268 bytes assets/img/googleplus.png | Bin 0 -> 3637 bytes assets/img/linkedin.png | Bin 0 -> 1991 bytes assets/img/twitter.png | Bin 0 -> 32528 bytes settings.json.default.json | 3 +- 17 files changed, 356 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 5420277..f1b2f0a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ app/addons/* !app/addons/fauxton !app/addons/databases !app/addons/documents +!app/addons/documentation !app/addons/styletests !app/addons/cors !app/addons/setup http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/assets/less/documentation.less ---------------------------------------------------------------------- diff --git a/app/addons/documentation/assets/less/documentation.less b/app/addons/documentation/assets/less/documentation.less new file mode 100644 index 0000000..6119a5d --- /dev/null +++ b/app/addons/documentation/assets/less/documentation.less @@ -0,0 +1,72 @@ +/*// 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.*/ + +#documentation-page { + + table{ + margin: 50px; + + .icons-container { + width: 80px; + height: 80px; + max-width: 200px; + max-height: 100px; + padding-right: 20px; + } + + .couchdb-icon { + background: transparent url('../img/couchdb-docs-logo.png') no-repeat 50% 50%; + height: 60px; + width: 60px; + background-size: 60px auto; + } + + .github-icon { + background: transparent url('../img/github.png') no-repeat 50% 50%; + height: 40px; + width: 40px; + background-size: 40px auto; + } + + .asf-feather-icon { + background: transparent url('../img/asf-feather-logo.png') no-repeat 50% 50%; + height: 70px; + width: 100px; + background-size: 70px; + } + + .linkedin-icon { + background: transparent url('../img/linkedin.png') no-repeat 50% 50%; + height: 40px; + width: 40px; + background-size: 40px auto; + } + + .google-plus-icon { + background: transparent url('../img/googleplus.png') no-repeat 50% 50%; + height: 40px; + width: 40px; + background-size: 40px auto; + } + + .twitter-icon { + background: transparent url('../img/twitter.png') no-repeat 50% 50%; + height: 50px; + width: 50px; + background-size: 60px; + } + + .icon { + margin: auto; + } + } +} http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/base.js ---------------------------------------------------------------------- diff --git a/app/addons/documentation/base.js b/app/addons/documentation/base.js new file mode 100644 index 0000000..49a99de --- /dev/null +++ b/app/addons/documentation/base.js @@ -0,0 +1,33 @@ +// 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. + +define([ + 'app', + 'api', + 'addons/documentation/routes' +], + +function (app, FauxtonAPI, Documentation) { + + Documentation.initialize = function () { + FauxtonAPI.addHeaderLink({ + id: 'Documentation', + title: 'Documentation', + icon: 'fonticon-bookmark', + href: '/documentation', + bottomNav: true, + top: true + }); + }; + + return Documentation; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/components.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/documentation/components.react.jsx b/app/addons/documentation/components.react.jsx new file mode 100644 index 0000000..324ab81 --- /dev/null +++ b/app/addons/documentation/components.react.jsx @@ -0,0 +1,67 @@ +// 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. + +define([ + 'app', + 'api', + 'react', + 'addons/documentation/stores' +], function (app, FauxtonAPI, React, Stores) { + + var documentationStore = Stores.documentationStore; + + var DocumentationController = React.createClass({ + getStoreState: function () { + return { + links: documentationStore.getLinks() + }; + }, + + getInitialState: function () { + return this.getStoreState(); + }, + + createLinkRows: function () { + return this.state.links.map(function (linkObject) { + return ( + <tr key={linkObject.title}> + <td className="icons-container"> + <div className={"icon " + linkObject.iconClassName}> </div> + </td> + <td> + <a href={linkObject.link} target="_blank" data-bypass="true">{linkObject.title}</a> + </td> + </tr> + ); + }); + }, + + render: function () { + return ( + <div id="documentation-page" className="scrollable"> + <div className="links"> + <table> + <tbody> + {this.createLinkRows()} + </tbody> + </table> + </div> + </div> + ); + } + }); + + return { + DocumentationController: DocumentationController + }; + +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/resources.js ---------------------------------------------------------------------- diff --git a/app/addons/documentation/resources.js b/app/addons/documentation/resources.js new file mode 100644 index 0000000..d203e08 --- /dev/null +++ b/app/addons/documentation/resources.js @@ -0,0 +1,18 @@ + +// 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. + +define([], +function () { + // this is empty because the compiler looks for a resource.js file here + return null; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/routes.js ---------------------------------------------------------------------- diff --git a/app/addons/documentation/routes.js b/app/addons/documentation/routes.js new file mode 100644 index 0000000..d5a79d9 --- /dev/null +++ b/app/addons/documentation/routes.js @@ -0,0 +1,39 @@ +// 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. + +define([ + 'app', + 'api', + 'addons/documentation/components.react' +], + +function (app, FauxtonAPI, DocumentationComponents) { + + var DocumentationRouteObject = FauxtonAPI.RouteObject.extend({ + selectedHeader: 'Documentation', + layout: 'one_pane', + disableLoader: false, + routes: { + 'documentation': 'documentation' + }, + crumbs: [ + {'name': 'Documentation', 'link': '/documentation'} + ], + roles: ['fx_loggedIn'], + documentation: function () { + this.setComponent('#dashboard-content', DocumentationComponents.DocumentationController); + } + }); + DocumentationRouteObject.RouteObjects = [DocumentationRouteObject]; + + return DocumentationRouteObject; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/stores.js ---------------------------------------------------------------------- diff --git a/app/addons/documentation/stores.js b/app/addons/documentation/stores.js new file mode 100644 index 0000000..41103a8 --- /dev/null +++ b/app/addons/documentation/stores.js @@ -0,0 +1,87 @@ +// 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. + +define([ + 'app', + 'api' +], function (app, FauxtonAPI) { + + var DocumentationStore = FauxtonAPI.Store.extend({ + getLinks: function () { + return [ + { + title: 'CouchDB Offical Documentation -- Online', + link: 'http://docs.couchdb.org/en/latest/', + iconClassName: 'couchdb-icon' + }, + { + title: 'CouchDB Offical Documentation -- Offline', + link: '/_utils/docs/contents.html', + iconClassName: 'couchdb-icon' + }, + { + title: 'CouchDB Weekly News', + link: 'http://blog.couchdb.org/', + iconClassName: 'couchdb-icon' + }, + { + title: 'CouchDB Homepage', + link: 'https://couchdb.apache.org/', + iconClassName: 'couchdb-icon' + }, + { + title: 'CouchDB on Github', + link: 'https://github.com/apache/couchdb', + iconClassName: 'github-icon' + }, + { + title: 'Fauxton on Github', + link: 'https://github.com/apache/couchdb-fauxton', + iconClassName: 'github-icon' + }, + { + title: 'Fauxton Visual Guide', + link: 'https://couchdb.apache.org/fauxton-visual-guide/index.html', + iconClassName: 'couchdb-icon' + }, + { + title: 'The Apache Software Foundation', + link: 'http://www.apache.org/', + iconClassName: 'asf-feather-icon' + }, + { + title: 'Follow CouchDB on Twitter', + link: 'https://twitter.com/couchdb', + iconClassName: 'twitter-icon' + }, + { + title: 'Follow CouchDB on Google Plus', + link: 'https://plus.google.com/+CouchDB', + iconClassName: 'google-plus-icon' + }, + { + title: 'Follow CouchDB on LinkedIn', + link: 'https://www.linkedin.com/company/apache-couchdb', + iconClassName: 'linkedin-icon' + } + ]; + + } + }); + + var documentationStore = new DocumentationStore(); + + return { + documentationStore: documentationStore + }; + +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/documentation/tests/nightwatch/checksDocsPage.js ---------------------------------------------------------------------- diff --git a/app/addons/documentation/tests/nightwatch/checksDocsPage.js b/app/addons/documentation/tests/nightwatch/checksDocsPage.js new file mode 100644 index 0000000..4a44e54 --- /dev/null +++ b/app/addons/documentation/tests/nightwatch/checksDocsPage.js @@ -0,0 +1,34 @@ +// 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 = { + 'Check the documentation page exists': function (client) { + var waitTime = client.globals.maxWaitTime, + baseUrl = client.globals.test_settings.launch_url; + + client + .loginToGUI() + .clickWhenVisible('a[href="/documentation"]') + .waitForElementVisible('a[href="http://docs.couchdb.org/en/latest/"]', waitTime, false) + .waitForElementVisible('a[href="/_utils/docs/contents.html"]', waitTime, false) + .waitForElementVisible('a[href="http://blog.couchdb.org/"]', waitTime, false) + .waitForElementVisible('a[href="https://couchdb.apache.org/"]', waitTime, false) + .waitForElementVisible('a[href="https://github.com/apache/couchdb"]', waitTime, false) + .waitForElementVisible('a[href="https://github.com/apache/couchdb-fauxton"]', waitTime, false) + .waitForElementVisible('a[href="https://couchdb.apache.org/fauxton-visual-guide/index.html"]', waitTime, false) + .waitForElementVisible('a[href="http://www.apache.org/"]', waitTime, false) + .waitForElementVisible('a[href="https://twitter.com/couchdb"]', waitTime, false) + .waitForElementVisible('a[href="https://plus.google.com/+CouchDB"]', waitTime, false) + .waitForElementVisible('a[href="https://www.linkedin.com/company/apache-couchdb"]', waitTime, false) + .end(); + } +}; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/fauxton/navigation/stores.js ---------------------------------------------------------------------- diff --git a/app/addons/fauxton/navigation/stores.js b/app/addons/fauxton/navigation/stores.js index 9aa9f2f..5ee104e 100644 --- a/app/addons/fauxton/navigation/stores.js +++ b/app/addons/fauxton/navigation/stores.js @@ -30,15 +30,7 @@ function (app, FauxtonAPI, ActionTypes) { this.version = null; this.navLinks = []; this.footerNavLinks = []; - this.bottomNavLinks = [{ - id: 'Documentation', - title: "Documentation", - icon: "fonticon-bookmark", - href: app.helpers.getDocUrl('GENERAL'), - bottomNav: true, - top: true, - target: '_blank' - }]; + this.bottomNavLinks = []; }, addLink: function (link) { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/app/addons/fauxton/navigation/tests/storeSpec.js ---------------------------------------------------------------------- diff --git a/app/addons/fauxton/navigation/tests/storeSpec.js b/app/addons/fauxton/navigation/tests/storeSpec.js index 7823367..fc95ca8 100644 --- a/app/addons/fauxton/navigation/tests/storeSpec.js +++ b/app/addons/fauxton/navigation/tests/storeSpec.js @@ -73,7 +73,7 @@ define([ link: link }); - assert.equal(navBarStore.getBottomNavLinks()[1].id, link.id); + assert.equal(navBarStore.getBottomNavLinks()[0].id, link.id); }); it('to top of bottom nav', function () { @@ -167,7 +167,7 @@ define([ link: link }); - assert.equal(navBarStore.getBottomNavLinks().length, 1); + assert.equal(navBarStore.getBottomNavLinks().length, 0); }); it('from footer nav links', function () { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/assets/img/asf-feather-logo.png ---------------------------------------------------------------------- diff --git a/assets/img/asf-feather-logo.png b/assets/img/asf-feather-logo.png new file mode 100644 index 0000000..842f5ed Binary files /dev/null and b/assets/img/asf-feather-logo.png differ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/assets/img/couchdb-docs-logo.png ---------------------------------------------------------------------- diff --git a/assets/img/couchdb-docs-logo.png b/assets/img/couchdb-docs-logo.png new file mode 100644 index 0000000..71f1815 Binary files /dev/null and b/assets/img/couchdb-docs-logo.png differ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/assets/img/github.png ---------------------------------------------------------------------- diff --git a/assets/img/github.png b/assets/img/github.png new file mode 100644 index 0000000..ea6ff54 Binary files /dev/null and b/assets/img/github.png differ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/assets/img/googleplus.png ---------------------------------------------------------------------- diff --git a/assets/img/googleplus.png b/assets/img/googleplus.png new file mode 100755 index 0000000..68bd450 Binary files /dev/null and b/assets/img/googleplus.png differ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/assets/img/linkedin.png ---------------------------------------------------------------------- diff --git a/assets/img/linkedin.png b/assets/img/linkedin.png new file mode 100644 index 0000000..11f7d74 Binary files /dev/null and b/assets/img/linkedin.png differ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/assets/img/twitter.png ---------------------------------------------------------------------- diff --git a/assets/img/twitter.png b/assets/img/twitter.png new file mode 100644 index 0000000..c9b8935 Binary files /dev/null and b/assets/img/twitter.png differ http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b7cbb14d/settings.json.default.json ---------------------------------------------------------------------- diff --git a/settings.json.default.json b/settings.json.default.json index 3fe5a2a..5d7c22e 100644 --- a/settings.json.default.json +++ b/settings.json.default.json @@ -13,7 +13,8 @@ { "name": "permissions" }, { "name": "compaction" }, { "name": "auth" }, - { "name": "verifyinstall" } + { "name": "verifyinstall" }, + { "name": "documentation" } ], "template": { "development": {
