You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2020/10/30 19:45:57 UTC
[couchdb-fauxton] branch goodbye-master created (now 8704b8b)
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a change to branch goodbye-master
in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git.
at 8704b8b Remove master content, point to main
This branch includes the following new commits:
new 8704b8b Remove master content, point to main
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb-fauxton] 01/01: Remove master content, point to main
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch goodbye-master
in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git
commit 8704b8b3fdb9ccbcb56d3248d5171e9ac1c6ebb5
Author: Joan Touzet <jo...@atypical.net>
AuthorDate: Fri Oct 30 15:45:37 2020 -0400
Remove master content, point to main
---
.babelrc | 8 -
.env | 5 -
.eslintignore | 11 -
.eslintrc | 93 -
.github/ISSUE_TEMPLATE.md | 32 -
.github/PULL_REQUEST_TEMPLATE.md | 42 -
.gitignore | 48 -
.npmignore | 6 -
.travis.yml | 31 +-
CONTRIBUTING.md | 64 -
Gruntfile.js | 266 -
LICENSE | 203 -
__mocks__/fileMock.js | 1 -
__mocks__/styleMock.js | 1 -
.../activetasks/__tests__/components.test.js | 86 -
.../__tests__/fakeActiveTaskResponse.js | 118 -
app/addons/activetasks/__tests__/reducer.test.js | 105 -
app/addons/activetasks/actions.js | 77 -
app/addons/activetasks/actiontypes.js | 20 -
app/addons/activetasks/api.js | 25 -
.../activetasks/assets/less/activetasks.less | 155 -
app/addons/activetasks/base.js | 26 -
app/addons/activetasks/components/controller.js | 59 -
app/addons/activetasks/components/filtertabs.js | 75 -
app/addons/activetasks/components/polling.js | 48 -
app/addons/activetasks/components/table.js | 44 -
app/addons/activetasks/components/tablebody.js | 70 -
.../activetasks/components/tablebodycontents.js | 117 -
app/addons/activetasks/components/tableheader.js | 86 -
app/addons/activetasks/container.js | 55 -
app/addons/activetasks/layout.js | 41 -
app/addons/activetasks/reducers.js | 141 -
app/addons/activetasks/routes.js | 34 -
app/addons/auth/__tests__/components.test.js | 95 -
app/addons/auth/actions.js | 143 -
app/addons/auth/actiontypes.js | 18 -
app/addons/auth/api.js | 57 -
app/addons/auth/assets/less/auth.less | 27 -
app/addons/auth/base.js | 70 -
app/addons/auth/components/changepasswordform.js | 100 -
app/addons/auth/components/createadminform.js | 124 -
app/addons/auth/components/index.js | 23 -
app/addons/auth/components/loginform.js | 113 -
app/addons/auth/components/passwordmodal.js | 109 -
app/addons/auth/layout.js | 93 -
app/addons/auth/routes/auth.js | 60 -
app/addons/auth/routes/index.js | 16 -
app/addons/auth/routes/user.js | 68 -
app/addons/auth/session.js | 110 -
app/addons/cluster/__tests__/cluster.test.js | 42 -
app/addons/cluster/actions.js | 58 -
app/addons/cluster/actiontypes.js | 15 -
app/addons/cluster/api.js | 34 -
app/addons/cluster/base.js | 23 -
app/addons/cluster/cluster.js | 50 -
app/addons/cluster/reducers.js | 29 -
app/addons/cluster/routes.js | 43 -
app/addons/components/README.md | 3 -
app/addons/components/__tests__/accordion.test.js | 48 -
app/addons/components/__tests__/apilinks.test.js | 37 -
app/addons/components/__tests__/badges.test.js | 34 -
app/addons/components/__tests__/beautify.test.js | 68 -
app/addons/components/__tests__/codeEditor.test.js | 137 -
.../components/__tests__/codeEditorPanel.test.js | 75 -
.../components/__tests__/confirmButton.test.js | 51 -
app/addons/components/__tests__/copy.test.js | 39 -
.../__tests__/deleteDatabaseModal.test.js | 57 -
app/addons/components/__tests__/doc.test.js | 181 -
.../components/__tests__/headerBreadcrumbs.test.js | 75 -
.../__tests__/headerTogglebutton.test.js | 30 -
.../components/__tests__/paddedBorderedBox.test.js | 27 -
app/addons/components/__tests__/polling.test.js | 105 -
.../components/__tests__/stringEditModal.test.js | 33 -
.../components/__tests__/styledSelect.test.js | 47 -
.../components/__tests__/tabwindowwrapper.test.js | 61 -
app/addons/components/__tests__/zenMode.test.js | 55 -
app/addons/components/actions.js | 57 -
app/addons/components/actiontypes.js | 15 -
app/addons/components/assets/less/accordion.less | 27 -
app/addons/components/assets/less/badges.less | 20 -
.../components/assets/less/bulk-selector.less | 123 -
app/addons/components/assets/less/code-editor.less | 100 -
app/addons/components/assets/less/components.less | 29 -
app/addons/components/assets/less/docs.less | 133 -
.../components/assets/less/header-breadcrumbs.less | 51 -
.../assets/less/header-togglebutton.less | 73 -
app/addons/components/assets/less/jsonlink.less | 80 -
app/addons/components/assets/less/layouts.less | 37 -
.../components/assets/less/loading-lines.less | 76 -
.../components/assets/less/menudropdown.less | 17 -
app/addons/components/assets/less/modals.less | 25 -
app/addons/components/assets/less/polling.less | 87 -
.../components/assets/less/styled-select.less | 78 -
app/addons/components/assets/less/tab-element.less | 115 -
.../components/assets/less/tab-window-wrapper.less | 19 -
app/addons/components/base.js | 17 -
app/addons/components/components/accordion.js | 74 -
app/addons/components/components/apibar.js | 43 -
app/addons/components/components/badge.js | 82 -
app/addons/components/components/beautify.js | 61 -
app/addons/components/components/bulkaction.js | 108 -
app/addons/components/components/codeeditor.js | 380 -
.../components/components/codeeditorpanel.js | 145 -
app/addons/components/components/confirmbutton.js | 66 -
app/addons/components/components/copy.js | 103 -
.../components/components/deletedatabasemodal.js | 119 -
app/addons/components/components/document.js | 148 -
app/addons/components/components/loadlines.js | 21 -
app/addons/components/components/menudropdown.js | 154 -
.../components/components/paddedborderbox.js | 25 -
app/addons/components/components/polling.js | 149 -
.../components/components/stringeditmodal.js | 90 -
app/addons/components/components/styledselect.js | 42 -
app/addons/components/components/tabelement.js | 62 -
.../components/components/tabwindowwrapper.js | 58 -
.../components/components/throttledreacselect.js | 50 -
.../components/components/toggleheaderbutton.js | 44 -
app/addons/components/components/tray.js | 162 -
app/addons/components/components/zenmodeoverlay.js | 133 -
app/addons/components/header-breadcrumbs.js | 68 -
app/addons/components/layouts.js | 138 -
app/addons/components/react-components.js | 65 -
app/addons/components/stores.js | 56 -
app/addons/config/__tests__/actions.test.js | 147 -
app/addons/config/__tests__/components.test.js | 268 -
app/addons/config/__tests__/reducers.test.js | 111 -
app/addons/config/actions.js | 131 -
app/addons/config/actiontypes.js | 27 -
app/addons/config/api.js | 54 -
app/addons/config/assets/less/config.less | 208 -
app/addons/config/base.js | 31 -
app/addons/config/components/AddOptionButton.js | 129 -
.../config/components/AddOptionButtonContainer.js | 35 -
app/addons/config/components/ConfigOption.js | 62 -
app/addons/config/components/ConfigOptionTrash.js | 56 -
app/addons/config/components/ConfigOptionValue.js | 83 -
app/addons/config/components/ConfigTable.js | 66 -
.../config/components/ConfigTableContainer.js | 58 -
app/addons/config/components/ConfigTableScreen.js | 69 -
app/addons/config/components/ConfigTabs.js | 51 -
app/addons/config/layout.js | 84 -
app/addons/config/reducers.js | 172 -
app/addons/config/routes.js | 72 -
app/addons/cors/__tests__/actions.test.js | 115 -
app/addons/cors/__tests__/components.test.js | 266 -
app/addons/cors/__tests__/helpers.test.js | 52 -
app/addons/cors/actions.js | 129 -
app/addons/cors/actiontypes.js | 18 -
app/addons/cors/api.js | 82 -
app/addons/cors/assets/less/cors.less | 146 -
app/addons/cors/base.js | 25 -
app/addons/cors/components.js | 37 -
app/addons/cors/components/CORSContainer.js | 43 -
app/addons/cors/components/CORSScreen.js | 150 -
app/addons/cors/components/OriginInput.js | 61 -
app/addons/cors/components/OriginRow.js | 87 -
app/addons/cors/components/OriginTable.js | 49 -
app/addons/cors/components/Origins.js | 46 -
app/addons/cors/helpers.js | 44 -
app/addons/cors/reducers.js | 67 -
app/addons/databases/__tests__/components.test.js | 266 -
.../databases/__tests__/databasepagination.test.js | 49 -
app/addons/databases/__tests__/reducers.test.js | 61 -
app/addons/databases/__tests__/stores.test.js | 86 -
app/addons/databases/actions.js | 256 -
app/addons/databases/actiontypes.js | 22 -
app/addons/databases/api.js | 19 -
app/addons/databases/assets/less/databases.less | 137 -
app/addons/databases/base.js | 125 -
app/addons/databases/components.js | 581 -
app/addons/databases/layout.js | 39 -
app/addons/databases/reducers.js | 52 -
app/addons/databases/resources.js | 115 -
app/addons/databases/routes.js | 63 -
app/addons/databases/stores.js | 179 -
.../tests/nightwatch/checkDatabaseTooltip.js | 50 -
.../databases/tests/nightwatch/createsDatabase.js | 96 -
.../tests/nightwatch/createsDatabasePartitioned.js | 98 -
.../databases/tests/nightwatch/deletesDatabase.js | 57 -
.../nightwatch/deletesDatabaseSpecialChars.js | 57 -
.../tests/nightwatch/permissionsDbTable.js | 38 -
.../tests/nightwatch/specialCharListLinks.js | 48 -
.../databases/tests/nightwatch/switchDatabase.js | 44 -
.../documentation/assets/less/documentation.less | 72 -
app/addons/documentation/base.js | 28 -
app/addons/documentation/components.js | 105 -
app/addons/documentation/routes.js | 37 -
.../tests/nightwatch/checksDocsPage.js | 35 -
.../documents/__tests__/additional-params.test.js | 58 -
.../documents/__tests__/base-actions.test.js | 177 -
.../documents/__tests__/changes-reducers.test.js | 142 -
app/addons/documents/__tests__/changes.test.js | 186 -
.../__tests__/designdocinfo-action.test.js | 69 -
.../documents/__tests__/fetch-actions.test.js | 386 -
app/addons/documents/__tests__/helpers.test.js | 123 -
.../documents/__tests__/index-results.test.js | 170 -
app/addons/documents/__tests__/json-view.test.js | 141 -
.../documents/__tests__/key-search-fields.test.js | 123 -
.../documents/__tests__/main-fields-view.test.js | 136 -
.../documents/__tests__/pagination-actions.test.js | 110 -
.../documents/__tests__/pagination-footer.test.js | 199 -
.../documents/__tests__/paging-controls.test.js | 62 -
.../documents/__tests__/partition-key.test.js | 128 -
.../documents/__tests__/perpage-selector.test.js | 27 -
.../documents/__tests__/query-buttons.test.js | 27 -
.../documents/__tests__/query-options.test.js | 351 -
.../__tests__/queryoptions-actions.test.js | 177 -
app/addons/documents/__tests__/reducers.test.js | 532 -
app/addons/documents/__tests__/resources.test.js | 333 -
.../documents/__tests__/results-options.test.js | 63 -
.../documents/__tests__/results-toolbar.test.js | 169 -
.../documents/__tests__/shared-helpers.test.js | 277 -
.../documents/__tests__/table-controls.test.js | 51 -
app/addons/documents/__tests__/table-row.test.js | 87 -
app/addons/documents/__tests__/table-view.test.js | 179 -
app/addons/documents/assets/less/changes.less | 151 -
app/addons/documents/assets/less/doc-editor.less | 227 -
app/addons/documents/assets/less/documents.less | 225 -
.../documents/assets/less/header-docs-left.less | 82 -
app/addons/documents/assets/less/header.less | 32 -
.../documents/assets/less/index-results.less | 275 -
.../documents/assets/less/partition-key.less | 52 -
.../documents/assets/less/query-options.less | 183 -
.../documents/assets/less/revision-browser.less | 98 -
app/addons/documents/assets/less/sidenav.less | 264 -
app/addons/documents/assets/less/view-editor.less | 268 -
app/addons/documents/base.js | 284 -
app/addons/documents/changes/actions.js | 84 -
app/addons/documents/changes/actiontypes.js | 19 -
.../documents/changes/components/AddFilterForm.js | 93 -
.../documents/changes/components/ChangeID.js | 29 -
.../documents/changes/components/ChangeRow.js | 120 -
.../changes/components/ChangesCodeTransition.js | 94 -
.../changes/components/ChangesContainer.js | 27 -
.../documents/changes/components/ChangesScreen.js | 67 -
.../changes/components/ChangesTabContent.js | 52 -
.../components/ChangesTabContentContainer.js | 28 -
app/addons/documents/changes/reducers.js | 126 -
app/addons/documents/components/actions.js | 40 -
.../documents/components/header-docs-left.js | 89 -
.../documents/components/header-docs-right.js | 53 -
app/addons/documents/components/jumptodoc.js | 49 -
app/addons/documents/components/results-options.js | 99 -
app/addons/documents/components/results-toolbar.js | 101 -
app/addons/documents/constants.js | 32 -
app/addons/documents/designdocinfo/actions.js | 70 -
app/addons/documents/designdocinfo/actiontypes.js | 18 -
.../designdocinfo/components/DesignDocInfo.js | 151 -
.../components/DesignDocInfoContainer.js | 32 -
app/addons/documents/designdocinfo/reducers.js | 57 -
.../__tests__/doc-editor.actions.test.js | 169 -
.../__tests__/doc-editor.components.test.js | 372 -
.../__tests__/doc-editor.reducers.test.js | 77 -
app/addons/documents/doc-editor/actions.js | 281 -
app/addons/documents/doc-editor/actiontypes.js | 31 -
.../components/AttachmentsPanelButton.js | 70 -
.../doc-editor/components/CloneDocModal.js | 100 -
.../doc-editor/components/DocEditorContainer.js | 88 -
.../doc-editor/components/DocEditorScreen.js | 249 -
.../documents/doc-editor/components/PanelButton.js | 47 -
.../documents/doc-editor/components/UploadModal.js | 95 -
app/addons/documents/doc-editor/reducers.js | 137 -
app/addons/documents/header/header.js | 100 -
app/addons/documents/helpers.js | 168 -
.../index-editor/__tests__/actions.test.js | 148 -
.../index-editor/__tests__/components.test.js | 275 -
.../index-editor/__tests__/reducers.test.js | 351 -
app/addons/documents/index-editor/actions.js | 331 -
app/addons/documents/index-editor/actiontypes.js | 28 -
app/addons/documents/index-editor/components.js | 27 -
.../index-editor/components/DesignDocSelector.js | 160 -
.../index-editor/components/IndexEditor.js | 202 -
.../components/IndexEditorContainer.js | 88 -
.../index-editor/components/ReduceEditor.js | 118 -
app/addons/documents/index-editor/reducers.js | 219 -
app/addons/documents/index-results/actions/base.js | 125 -
.../documents/index-results/actions/fetch.js | 208 -
.../documents/index-results/actions/pagination.js | 88 -
.../index-results/actions/queryoptions.js | 141 -
app/addons/documents/index-results/actiontypes.js | 36 -
app/addons/documents/index-results/api.js | 74 -
.../components/pagination/PaginationFooter.js | 92 -
.../components/pagination/PagingControls.js | 48 -
.../components/pagination/PerPageSelector.js | 58 -
.../components/pagination/TableControls.js | 66 -
.../components/queryoptions/AdditionalParams.js | 78 -
.../components/queryoptions/KeySearchFields.js | 127 -
.../components/queryoptions/MainFieldsView.js | 176 -
.../components/queryoptions/QueryButtons.js | 40 -
.../components/queryoptions/QueryOptions.js | 187 -
.../components/results/IndexResults.js | 120 -
.../components/results/NoResultsScreen.js | 35 -
.../components/results/ResultsScreen.js | 154 -
.../index-results/components/results/TableRow.js | 163 -
.../index-results/components/results/TableView.js | 106 -
.../components/results/WrappedAutocomplete.js | 41 -
.../index-results/containers/ApiBarContainer.js | 45 -
.../containers/IndexResultsContainer.js | 115 -
.../containers/PaginationContainer.js | 83 -
.../containers/QueryOptionsContainer.js | 156 -
.../documents/index-results/helpers/json-view.js | 49 -
.../index-results/helpers/shared-helpers.js | 125 -
.../documents/index-results/helpers/table-view.js | 181 -
app/addons/documents/index-results/reducers.js | 404 -
app/addons/documents/layouts.js | 290 -
.../documents/mango/__tests__/mango.api.test.js | 139 -
.../mango/__tests__/mango.components.test.js | 246 -
.../documents/mango/components/ExecutionStats.js | 127 -
.../documents/mango/components/ExplainPage.js | 37 -
.../documents/mango/components/MangoIndexEditor.js | 192 -
.../mango/components/MangoIndexEditorContainer.js | 57 -
.../documents/mango/components/MangoQueryEditor.js | 196 -
.../mango/components/MangoQueryEditorContainer.js | 103 -
app/addons/documents/mango/mango.actions.js | 123 -
app/addons/documents/mango/mango.actiontypes.js | 21 -
app/addons/documents/mango/mango.api.js | 128 -
app/addons/documents/mango/mango.components.js | 21 -
app/addons/documents/mango/mango.constants.js | 21 -
app/addons/documents/mango/mango.helper.js | 60 -
app/addons/documents/mango/mango.reducers.js | 205 -
app/addons/documents/mangolayout.js | 219 -
.../partition-key/PartitionKeySelector.js | 140 -
app/addons/documents/partition-key/actions.js | 29 -
app/addons/documents/partition-key/actiontypes.js | 15 -
app/addons/documents/partition-key/container.js | 49 -
app/addons/documents/partition-key/reducers.js | 37 -
app/addons/documents/resources.js | 197 -
app/addons/documents/rev-browser/actions.js | 140 -
app/addons/documents/rev-browser/actiontypes.js | 23 -
.../rev-browser/components/confirmmodal.js | 86 -
.../components/conflictingrevisiondropdown.js | 53 -
.../documents/rev-browser/components/controller.js | 79 -
.../components/revisionbrowsercontrols.js | 146 -
.../rev-browser/components/revisiondiffarea.js | 43 -
.../rev-browser/components/splitscreenarea.js | 74 -
app/addons/documents/rev-browser/container.js | 84 -
app/addons/documents/rev-browser/reducers.js | 92 -
.../rev-browser/rev-browser.components.js | 429 -
.../documents/rev-browser/rev-browser.stores.js | 120 -
app/addons/documents/routes-doc-editor.js | 127 -
app/addons/documents/routes-documents.js | 171 -
app/addons/documents/routes-index-editor.js | 204 -
app/addons/documents/routes-mango.js | 141 -
app/addons/documents/routes.js | 26 -
app/addons/documents/shared-resources.js | 329 -
app/addons/documents/shared-routes.js | 69 -
.../sidebar/SidebarControllerContainer.js | 122 -
.../sidebar/__tests__/sidebar.actions.test.js | 69 -
.../sidebar/__tests__/sidebar.components.test.js | 254 -
.../sidebar/__tests__/sidebar.reducers.test.js | 74 -
app/addons/documents/sidebar/actions.js | 175 -
app/addons/documents/sidebar/actiontypes.js | 27 -
.../sidebar/components/CloneIndexModal.js | 118 -
.../documents/sidebar/components/DesignDoc.js | 172 -
.../documents/sidebar/components/DesignDocList.js | 87 -
.../documents/sidebar/components/IndexSection.js | 159 -
.../documents/sidebar/components/MainSidebar.js | 100 -
.../sidebar/components/SidebarController.js | 154 -
app/addons/documents/sidebar/helpers.js | 40 -
app/addons/documents/sidebar/reducers.js | 252 -
app/addons/documents/sidebar/sidebar.js | 21 -
app/addons/documents/tests/document-test-helper.js | 31 -
.../documents/tests/nightwatch/bulkDelete.js | 110 -
app/addons/documents/tests/nightwatch/changes.js | 34 -
.../documents/tests/nightwatch/changesFilter.js | 54 -
.../tests/nightwatch/checkSidebarBehavior.js | 42 -
app/addons/documents/tests/nightwatch/cloneDoc.js | 59 -
.../documents/tests/nightwatch/createsDocument.js | 153 -
.../tests/nightwatch/createsDocumentWithoutId.js | 50 -
.../tests/nightwatch/deleteDatabaseModal.js | 66 -
.../documents/tests/nightwatch/deletesDocuments.js | 170 -
.../documents/tests/nightwatch/designConflicts.js | 28 -
.../tests/nightwatch/designDocInfoPresent.js | 28 -
.../tests/nightwatch/doubleEmitResults.js | 36 -
.../nightwatch/editDocumentWithStringEditor.js | 50 -
.../tests/nightwatch/editDocumentsFromView.js | 58 -
.../documents/tests/nightwatch/encodingSupport.js | 64 -
.../tests/nightwatch/fixRegressionTableView.js | 40 -
app/addons/documents/tests/nightwatch/jsonView.js | 30 -
.../documents/tests/nightwatch/mangoIndex.js | 74 -
.../documents/tests/nightwatch/mangoQuery.js | 45 -
...ateAfterEditingDocShouldShowAConfirmationBox.js | 37 -
.../tests/nightwatch/navigateFromNewDoc.js | 38 -
.../tests/nightwatch/navigateNotFoundDB.js | 33 -
.../documents/tests/nightwatch/paginateAllDocs.js | 140 -
.../documents/tests/nightwatch/paginateView.js | 163 -
.../documents/tests/nightwatch/previousButton.js | 26 -
.../documents/tests/nightwatch/queryOptions.js | 42 -
.../tests/nightwatch/queryOptionsCloseBug.js | 42 -
.../tests/nightwatch/replicateDatabaseButton.js | 56 -
.../documents/tests/nightwatch/resultsToolbar.js | 72 -
.../documents/tests/nightwatch/revBrowser.js | 108 -
.../tests/nightwatch/selectDocViaTypeahead.js | 58 -
app/addons/documents/tests/nightwatch/tableView.js | 79 -
.../tests/nightwatch/tableViewConflicts.js | 38 -
app/addons/documents/tests/nightwatch/viewClone.js | 38 -
.../documents/tests/nightwatch/viewCreate.js | 141 -
.../tests/nightwatch/viewCreateBadView.js | 71 -
.../documents/tests/nightwatch/viewDelete.js | 43 -
app/addons/documents/tests/nightwatch/viewEdit.js | 236 -
.../documents/tests/nightwatch/viewQueryOptions.js | 59 -
app/addons/fauxton/__tests__/components.test.js | 123 -
app/addons/fauxton/appwrapper.js | 125 -
app/addons/fauxton/assets/less/components.less | 66 -
app/addons/fauxton/assets/less/fauxton.less | 2 -
app/addons/fauxton/assets/less/navigation.less | 222 -
app/addons/fauxton/base.js | 40 -
app/addons/fauxton/components.js | 213 -
.../fauxton/navigation/__tests__/burger-test.js | 29 -
.../navigation/__tests__/login-logout-test.js | 63 -
.../fauxton/navigation/__tests__/navbar-test.js | 70 -
.../navigation/__tests__/navigation-reducers.js | 185 -
.../fauxton/navigation/__tests__/navlink-test.js | 71 -
app/addons/fauxton/navigation/actions.js | 60 -
app/addons/fauxton/navigation/actiontypes.js | 27 -
app/addons/fauxton/navigation/components/Brand.js | 38 -
app/addons/fauxton/navigation/components/Burger.js | 43 -
app/addons/fauxton/navigation/components/Footer.js | 35 -
.../fauxton/navigation/components/LoginButton.js | 44 -
.../fauxton/navigation/components/LogoutButton.js | 49 -
app/addons/fauxton/navigation/components/NavBar.js | 113 -
.../fauxton/navigation/components/NavLink.js | 62 -
app/addons/fauxton/navigation/container/NavBar.js | 47 -
app/addons/fauxton/navigation/reducers.js | 209 -
.../notifications/__tests__/components.test.js | 123 -
.../__tests__/permanentNotification.test.js | 61 -
.../notifications/__tests__/reducers.test.js | 131 -
app/addons/fauxton/notifications/actions.js | 52 -
app/addons/fauxton/notifications/actiontypes.js | 22 -
.../components/NotificationCenterButton.js | 55 -
.../components/NotificationCenterPanel.js | 145 -
.../components/NotificationPanelContainer.js | 36 -
.../components/NotificationPanelRow.js | 66 -
.../components/NotificationPanelWithTransition.js | 64 -
.../components/PermanentNotification.js | 52 -
.../components/PermanentNotificationContainer.js | 15 -
app/addons/fauxton/notifications/reducers.js | 143 -
.../fauxton/tests/nightwatch/highlightsidebar.js | 30 -
.../fauxton/tests/nightwatch/notificationCenter.js | 42 -
.../tests/nightwatch/updatesUrlsSameRouteobject.js | 32 -
app/addons/news/assets/less/news.less | 23 -
app/addons/news/base.js | 28 -
app/addons/news/components.js | 81 -
app/addons/news/routes.js | 37 -
app/addons/permissions/__tests__/actions-test.js | 112 -
app/addons/permissions/__tests__/container-test.js | 58 -
app/addons/permissions/__tests__/helpers-test.js | 84 -
.../__tests__/permissionsScreen-test.js | 97 -
app/addons/permissions/actions.js | 129 -
app/addons/permissions/actiontypes.js | 14 -
.../permissions/assets/less/permissions.less | 32 -
app/addons/permissions/base.js | 24 -
app/addons/permissions/components/Permissions.js | 50 -
.../permissions/components/PermissionsItem.js | 38 -
.../permissions/components/PermissionsScreen.js | 88 -
.../permissions/components/PermissionsSection.js | 158 -
.../permissions/container/PermissionsContainer.js | 40 -
app/addons/permissions/helpers.js | 39 -
app/addons/permissions/layout.js | 44 -
app/addons/permissions/reducers.js | 67 -
app/addons/permissions/routes.js | 72 -
.../permissions/tests/nightwatch/permissions.js | 40 -
app/addons/replication/__tests__/actions.test.js | 276 -
app/addons/replication/__tests__/api.tests.js | 610 -
.../replication/__tests__/auth-options.test.js | 57 -
.../replication/__tests__/common-table.test.js | 40 -
app/addons/replication/__tests__/helpers.tests.js | 34 -
.../replication/__tests__/newreplication.test.js | 416 -
app/addons/replication/__tests__/target.test.js | 81 -
app/addons/replication/actions.js | 418 -
app/addons/replication/actiontypes.js | 42 -
app/addons/replication/api.js | 418 -
.../replication/assets/less/replication.less | 376 -
app/addons/replication/base.js | 36 -
app/addons/replication/components/activity.js | 116 -
app/addons/replication/components/auth-options.js | 198 -
.../replication/components/common-activity.js | 52 -
app/addons/replication/components/common-table.js | 428 -
app/addons/replication/components/modals.js | 154 -
.../replication/components/newreplication.js | 399 -
app/addons/replication/components/options.js | 99 -
app/addons/replication/components/remoteexample.js | 50 -
.../replication/components/replicate-activity.js | 118 -
app/addons/replication/components/source.js | 170 -
app/addons/replication/components/submit.js | 45 -
app/addons/replication/components/target.js | 274 -
app/addons/replication/constants.js | 35 -
app/addons/replication/container.js | 137 -
app/addons/replication/controller.js | 246 -
app/addons/replication/helpers.js | 23 -
app/addons/replication/reducers.js | 409 -
app/addons/replication/route.js | 73 -
.../replication/tests/nightwatch/replication.js | 286 -
.../tests/nightwatch/replicationactivity.js | 133 -
app/addons/search/__tests__/components.test.js | 160 -
app/addons/search/__tests__/search.actions.test.js | 53 -
.../search/__tests__/search.reducers.test.js | 176 -
app/addons/search/actions.js | 429 -
app/addons/search/actiontypes.js | 38 -
app/addons/search/api.js | 33 -
app/addons/search/assets/less/search.less | 160 -
app/addons/search/base.js | 102 -
app/addons/search/components/Analyzer.js | 125 -
app/addons/search/components/AnalyzerDropdown.js | 78 -
app/addons/search/components/AnalyzerMultiple.js | 94 -
app/addons/search/components/AnalyzerRow.js | 81 -
app/addons/search/components/SearchForm.js | 131 -
.../search/components/SearchFormContainer.js | 36 -
app/addons/search/components/SearchIndexEditor.js | 165 -
.../components/SearchIndexEditorContainer.js | 82 -
app/addons/search/constants.js | 76 -
app/addons/search/layout.js | 102 -
app/addons/search/reducers.js | 331 -
app/addons/search/resources.js | 72 -
app/addons/search/routes.js | 201 -
.../search/tests/nightwatch/cloneSearchIndex.js | 46 -
.../search/tests/nightwatch/createNewSearch.js | 128 -
.../search/tests/nightwatch/deleteSearchIndex.js | 86 -
.../search/tests/nightwatch/searchPageApiBar.js | 56 -
app/addons/setup/__tests__/helpers.test.js | 70 -
app/addons/setup/actions.js | 309 -
app/addons/setup/actiontypes.js | 23 -
app/addons/setup/assets/less/setup.less | 62 -
app/addons/setup/base.js | 36 -
app/addons/setup/components/ConfiguredScreen.js | 46 -
.../setup/components/CurrentAdminPassword.js | 54 -
app/addons/setup/components/FirstStepController.js | 71 -
.../setup/components/MultipleNodeController.js | 157 -
app/addons/setup/components/NodeCountSetting.js | 41 -
app/addons/setup/components/OptionalSettings.js | 55 -
.../setup/components/SingleNodeController.js | 80 -
.../setup/container/ConfiguredSceenContainer.js | 24 -
app/addons/setup/container/FirstStepContainer.js | 35 -
.../setup/container/MultipleNodeContainer.js | 71 -
app/addons/setup/container/SingleNodeContainer.js | 60 -
app/addons/setup/helpers.js | 40 -
app/addons/setup/reducers.js | 137 -
app/addons/setup/route.js | 91 -
.../verifyinstall/__tests__/components.test.js | 107 -
.../verifyinstall/__tests__/reducers.test.js | 61 -
app/addons/verifyinstall/actions.js | 101 -
app/addons/verifyinstall/actiontypes.js | 18 -
.../verifyinstall/assets/less/verifyinstall.less | 16 -
app/addons/verifyinstall/base.js | 31 -
.../components/VerifyInstallButton.js | 29 -
.../components/VerifyInstallContainer.js | 30 -
.../components/VerifyInstallResults.js | 70 -
.../components/VerifyInstallScreen.js | 32 -
app/addons/verifyinstall/constants.js | 24 -
app/addons/verifyinstall/reducers.js | 75 -
app/addons/verifyinstall/resources.js | 161 -
app/addons/verifyinstall/routes.js | 37 -
app/app.js | 82 -
app/constants.js | 52 -
app/core/__tests__/ajax.test.js | 212 -
app/core/__tests__/api.test.js | 44 -
app/core/__tests__/utils.test.js | 116 -
app/core/ajax.js | 140 -
app/core/api.js | 123 -
app/core/authentication.js | 54 -
app/core/base.js | 217 -
app/core/dispatcher.js | 49 -
app/core/routeObject.js | 91 -
app/core/router.js | 116 -
app/core/store.js | 30 -
app/core/utils.js | 147 -
app/helpers.js | 98 -
app/initialize.js.underscore | 29 -
app/load_addons.js.underscore | 27 -
app/main.js | 101 -
assets/fonts/FontAwesome.otf | Bin 61896 -> 0 bytes
assets/fonts/Gemfile | 6 -
assets/fonts/README.md | 45 -
assets/fonts/fauxtonicon5.eot | Bin 19606 -> 0 bytes
assets/fonts/fauxtonicon5.svg | 729 -
assets/fonts/fauxtonicon5.ttf | Bin 19412 -> 0 bytes
assets/fonts/fauxtonicon5.woff | Bin 11208 -> 0 bytes
assets/fonts/fontawesome-webfont.eot | Bin 37405 -> 0 bytes
assets/fonts/fontawesome-webfont.svg | 399 -
assets/fonts/fontawesome-webfont.ttf | Bin 79076 -> 0 bytes
assets/fonts/fontawesome-webfont.woff | Bin 43572 -> 0 bytes
assets/fonts/fontcustom.yml | 51 -
assets/fonts/styleguide/fauxtonicon5-preview.html | 2003 --
assets/fonts/templates/icons.less | 33 -
assets/icons/activetasks.svg | 8 -
assets/icons/arrow-box-down.svg | 8 -
assets/icons/arrow-box-up.svg | 8 -
assets/icons/arrow_left.svg | 7 -
assets/icons/arrow_right.svg | 7 -
assets/icons/arrows-cw.svg | 8 -
assets/icons/article.svg | 8 -
assets/icons/attention-alt.svg | 8 -
assets/icons/attention-circled.svg | 8 -
assets/icons/bell.svg | 14 -
assets/icons/block.svg | 8 -
assets/icons/bookmark-ribbon-wplus.svg | 8 -
assets/icons/bookmark.svg | 8 -
assets/icons/burger.svg | 8 -
assets/icons/cancel-circled.svg | 8 -
assets/icons/cancel-circled2.svg | 8 -
assets/icons/cancel.svg | 8 -
assets/icons/circle-empty.svg | 8 -
assets/icons/clipboard.svg | 8 -
assets/icons/clock.svg | 8 -
assets/icons/cog.svg | 8 -
assets/icons/collapse.svg | 8 -
assets/icons/cw.svg | 8 -
assets/icons/dashboard.svg | 8 -
assets/icons/database.svg | 8 -
assets/icons/deselect-all.svg | 15 -
assets/icons/document.svg | 8 -
assets/icons/documents.svg | 8 -
assets/icons/dot-circled.svg | 8 -
assets/icons/down-1.svg | 8 -
assets/icons/down-circled.svg | 8 -
assets/icons/down-dir.svg | 8 -
assets/icons/down-open.svg | 8 -
assets/icons/down.svg | 8 -
assets/icons/drop-down-dots.svg | 8 -
assets/icons/exchange.svg | 8 -
assets/icons/expand.svg | 8 -
assets/icons/eye.svg | 8 -
assets/icons/file-code-o.svg | 1 -
assets/icons/files-o.svg | 1 -
assets/icons/filter.svg | 1 -
assets/icons/gears.svg | 8 -
assets/icons/help-circled.svg | 8 -
assets/icons/help.svg | 8 -
assets/icons/info-circled.svg | 8 -
assets/icons/json.svg | 8 -
assets/icons/key.svg | 8 -
assets/icons/left-1.svg | 8 -
assets/icons/left-circled.svg | 8 -
assets/icons/left-dir.svg | 8 -
assets/icons/left-open.svg | 8 -
assets/icons/left.svg | 8 -
assets/icons/link.svg | 8 -
assets/icons/list-alt.svg | 8 -
assets/icons/lock.svg | 8 -
assets/icons/mail-alt.svg | 8 -
assets/icons/mail.svg | 8 -
assets/icons/map.svg | 10 -
assets/icons/map2.svg | 10 -
assets/icons/megaphone.svg | 8 -
assets/icons/minus-circled.svg | 8 -
assets/icons/minus-circled2.svg | 9 -
assets/icons/minus-squared-alt.svg | 8 -
assets/icons/minus-squared.svg | 8 -
assets/icons/minus.svg | 8 -
assets/icons/mixer.svg | 8 -
assets/icons/new-database.svg | 8 -
assets/icons/ok-circled-2.svg | 8 -
assets/icons/ok-circled.svg | 8 -
assets/icons/ok.svg | 8 -
assets/icons/paperclip.svg | 1364 --
assets/icons/pencil.svg | 8 -
assets/icons/picture.svg | 8 -
assets/icons/play.svg | 8 -
assets/icons/plus-circled.svg | 8 -
assets/icons/plus-circled2.svg | 10 -
assets/icons/plus-squared-alt.svg | 8 -
assets/icons/plus-squared.svg | 8 -
assets/icons/plus.svg | 8 -
assets/icons/popin.svg | 8 -
assets/icons/popout.svg | 8 -
assets/icons/profile.svg | 8 -
assets/icons/replicate.svg | 8 -
assets/icons/reply-all.svg | 8 -
assets/icons/reply.svg | 8 -
assets/icons/resize-full-reverse.svg | 8 -
assets/icons/resize-full.svg | 8 -
assets/icons/resize-small-reverse.svg | 8 -
assets/icons/resize-small.svg | 8 -
assets/icons/right-1.svg | 8 -
assets/icons/right-circled.svg | 8 -
assets/icons/right-dir.svg | 8 -
assets/icons/right-open.svg | 8 -
assets/icons/right.svg | 8 -
assets/icons/save.svg | 8 -
assets/icons/search.svg | 8 -
assets/icons/select-all.svg | 11 -
assets/icons/sidenav-filter-function.svg | 10 -
assets/icons/sidenav-info.svg | 15 -
assets/icons/sidenav-list-function.svg | 12 -
assets/icons/sidenav-map-reduce.svg | 13 -
assets/icons/sidenav-search.svg | 17 -
assets/icons/sidenav-show-function.svg | 13 -
assets/icons/sidenav-update-function.svg | 12 -
assets/icons/sitemap.svg | 8 -
assets/icons/stats.svg | 8 -
assets/icons/support.svg | 8 -
assets/icons/swap-arrows.svg | 1318 --
assets/icons/table.svg | 8 -
assets/icons/trash.svg | 8 -
assets/icons/up-1.svg | 8 -
assets/icons/up-circled.svg | 8 -
assets/icons/up-dir.svg | 8 -
assets/icons/up-open.svg | 8 -
assets/icons/up.svg | 8 -
assets/icons/user.svg | 8 -
assets/icons/users.svg | 8 -
assets/icons/vertical-ellipsis.svg | 10 -
assets/icons/wrench.svg | 8 -
assets/icons/wrench2.svg | 1 -
assets/img/CouchDB-horizontal-logo.png | Bin 30060 -> 0 bytes
assets/img/CouchDB-negative-logo.png | Bin 14000 -> 0 bytes
assets/img/asf-feather-logo.png | Bin 22956 -> 0 bytes
assets/img/couch-watermark.png | Bin 2095 -> 0 bytes
assets/img/couchdb-logo.png | Bin 3105 -> 0 bytes
assets/img/github.png | Bin 4268 -> 0 bytes
assets/img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes
assets/img/glyphicons-halflings.png | Bin 13826 -> 0 bytes
assets/img/googleplus.png | Bin 3637 -> 0 bytes
assets/img/linen.png | Bin 87134 -> 0 bytes
assets/img/linkedin.png | Bin 1991 -> 0 bytes
assets/img/loader.gif | Bin 5193 -> 0 bytes
assets/img/twitter.png | Bin 32528 -> 0 bytes
assets/index.underscore | 52 -
assets/js/plugins/beautify.js | 4047 ----
assets/js/plugins/cloudant.pagingcollection.js | 200 -
assets/js/plugins/prettify.js | 28 -
assets/less/animations.less | 79 -
assets/less/bootstrap/accordion.less | 34 -
assets/less/bootstrap/alerts.less | 79 -
assets/less/bootstrap/bootstrap.less | 62 -
assets/less/bootstrap/breadcrumbs.less | 24 -
assets/less/bootstrap/button-groups.less | 222 -
assets/less/bootstrap/buttons.less | 228 -
assets/less/bootstrap/carousel.less | 158 -
assets/less/bootstrap/close.less | 30 -
assets/less/bootstrap/code.less | 61 -
assets/less/bootstrap/component-animations.less | 22 -
assets/less/bootstrap/dropdowns.less | 274 -
assets/less/bootstrap/font-awesome/bootstrap.less | 84 -
assets/less/bootstrap/font-awesome/core.less | 129 -
assets/less/bootstrap/font-awesome/extras.less | 93 -
.../bootstrap/font-awesome/font-awesome-ie7.less | 1953 --
.../less/bootstrap/font-awesome/font-awesome.less | 33 -
assets/less/bootstrap/font-awesome/icons.less | 381 -
assets/less/bootstrap/font-awesome/mixins.less | 48 -
assets/less/bootstrap/font-awesome/path.less | 14 -
assets/less/bootstrap/font-awesome/variables.less | 734 -
assets/less/bootstrap/forms.less | 690 -
assets/less/bootstrap/grid.less | 21 -
assets/less/bootstrap/hero-unit.less | 25 -
assets/less/bootstrap/labels-badges.less | 84 -
assets/less/bootstrap/layouts.less | 16 -
assets/less/bootstrap/media.less | 55 -
assets/less/bootstrap/mixins.less | 716 -
assets/less/bootstrap/modals.less | 95 -
assets/less/bootstrap/navbar.less | 496 -
assets/less/bootstrap/navs.less | 406 -
assets/less/bootstrap/pager.less | 43 -
assets/less/bootstrap/pagination.less | 123 -
assets/less/bootstrap/popovers.less | 133 -
assets/less/bootstrap/progress-bars.less | 122 -
assets/less/bootstrap/reset.less | 216 -
assets/less/bootstrap/responsive-1200px-min.less | 28 -
assets/less/bootstrap/responsive-767px-max.less | 193 -
assets/less/bootstrap/responsive-768px-979px.less | 19 -
assets/less/bootstrap/responsive-navbar.less | 189 -
assets/less/bootstrap/responsive-utilities.less | 59 -
assets/less/bootstrap/responsive.less | 48 -
assets/less/bootstrap/scaffolding.less | 53 -
assets/less/bootstrap/sprites.less | 197 -
assets/less/bootstrap/tables.less | 244 -
assets/less/bootstrap/tests/buttons.html | 139 -
assets/less/bootstrap/tests/css-tests.css | 150 -
assets/less/bootstrap/thumbnails.less | 53 -
assets/less/bootstrap/tooltip.less | 70 -
assets/less/bootstrap/type.less | 247 -
assets/less/bootstrap/utilities.less | 30 -
assets/less/bootstrap/variables.less | 301 -
assets/less/bootstrap/wells.less | 29 -
assets/less/code-editors.less | 53 -
assets/less/couchdb.less | 66 -
assets/less/fauxton.less | 677 -
assets/less/formstyles.less | 372 -
assets/less/icons.less | 417 -
assets/less/layouts.less | 166 -
assets/less/mixins.less | 66 -
assets/less/notification-center.less | 229 -
assets/less/pagination.less | 141 -
assets/less/prettyprint.less | 33 -
assets/less/react-animations.less | 47 -
assets/less/templates.less | 319 -
assets/less/trays.less | 96 -
assets/less/variables.less | 139 -
bin/build-couchdb-dev.sh | 22 -
bin/create-animal-db | 25 -
bin/create-n-dbs | 131 -
bin/docker-up-and-check.sh | 62 -
bin/fauxton | 43 -
bin/install-docker-travis.sh | 23 -
bin/remove-test-dbs.js | 51 -
code-layout.md | 82 -
codemods/amd-to-es6-import.md | 9 -
codemods/space-in-parens.sh | 3 -
couchapp.js | 39 -
devserver.js | 125 -
docker/dc.selenium-debug.yml | 15 -
docker/dc.selenium.yml | 15 -
extensions.md | 15 -
i18n.json.default.json | 27 -
index.js | 108 -
jest-config.json | 16 -
jest-setup.js | 48 -
jest-shim.js | 8 -
package-lock.json | 19859 -------------------
package.json | 155 -
readme.md | 103 +-
settings.json.default.json | 89 -
styleguide.md | 261 -
tasks/fauxton.js | 222 -
tasks/helper.js | 58 -
test/animal-db.json | 14 -
test/create-animal-db.js | 188 -
test/mocha/testUtils.js | 23 -
.../custom-commands/auth/loginToGUI.js | 46 -
.../custom-commands/checkForDatabaseCreated.js | 42 -
.../custom-commands/checkForDatabaseDeleted.js | 53 -
.../custom-commands/checkForDocumentCreated.js | 49 -
.../custom-commands/checkForDocumentDeleted.js | 49 -
.../custom-commands/checkForStringNotPresent.js | 54 -
.../custom-commands/checkForStringPresent.js | 54 -
.../custom-commands/clickWhenVisible.js | 32 -
.../custom-commands/closeNotification.js | 25 -
.../custom-commands/closeNotifications.js | 25 -
.../custom-commands/createAnimalDb.js | 43 -
.../custom-commands/createDatabase.js | 47 -
.../custom-commands/createDocument.js | 66 -
.../custom-commands/createManyDocuments.js | 44 -
.../custom-commands/deleteDatabase.js | 39 -
.../custom-commands/deleteDocument.js | 40 -
test/nightwatch_tests/custom-commands/helper.js | 56 -
.../custom-commands/populateDatabase.js | 154 -
.../populateDatabaseWithConflicts.js | 75 -
.../custom-commands/replicateDatabase.js | 46 -
.../custom-commands/waitForAttribute.js | 86 -
test/nightwatch_tests/helpers/helpers.js | 117 -
test/nightwatch_tests/nightwatch.json.underscore | 114 -
test/nightwatch_tests/nightwatch_README.md | 87 -
tests.md | 80 -
version-check.js | 9 -
webpack.config.dev.js | 121 -
webpack.config.release.js | 152 -
846 files changed, 3 insertions(+), 105283 deletions(-)
diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 575accf..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "presets": [
- "@babel/react",
- "@babel/env"
- ],
- "plugins": ["@babel/plugin-transform-object-assign", "@babel/plugin-proposal-object-rest-spread",
- "@babel/plugin-proposal-class-properties", "babel-plugin-array-includes","@babel/plugin-transform-async-to-generator"]
-}
diff --git a/.env b/.env
deleted file mode 100644
index d18f8e8..0000000
--- a/.env
+++ /dev/null
@@ -1,5 +0,0 @@
-# Default environment variables for the Docker Compose files in /docker
-# This file needs to be placed where the docker-compose command is run from.
-
-# Used to provide a CouchDB 2 / 3 build matrix in .travis.yml
-COUCHDB_IMAGE=ibmcom/couchdb3
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 1680c40..0000000
--- a/.eslintignore
+++ /dev/null
@@ -1,11 +0,0 @@
-# node_modules ignored by default
-
-dist/
-test/
-assets/
-
-app/**/*.react.js
-app/addons/.module-cache
-app/addons/**/assets/*
-app/addons/**/dependencies/*
-app/load_addons.js
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 37e2aa0..0000000
--- a/.eslintrc
+++ /dev/null
@@ -1,93 +0,0 @@
-{
- "root": true,
- "parser": "babel-eslint",
-
- "plugins": [
- "react"
- ],
-
- "extends": [
- "eslint:recommended",
- "plugin:react/recommended"
- ],
-
- "rules": {
- "semi": ["error", "always"],
- "keyword-spacing": "error",
- "space-infix-ops": "error",
- "space-before-blocks": "error",
- "array-bracket-spacing": ["error", "never"],
- "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
- "comma-spacing": ["error", {"before": false, "after": true}],
- "computed-property-spacing": ["error", "never"],
- "eol-last": "error",
- "indent": ["error", 2, { "SwitchCase": 1, "VariableDeclarator": { "var": 2, "let": 2, "const": 3 } }],
- "no-case-declarations": "off",
- "no-console": [1, { "allow": ["warn", "error", "info"] }],
- "no-else-return": "error",
- "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
- "no-trailing-spaces": "error",
- "semi-spacing": ["error", {"before": false, "after": true}],
- "space-in-parens": ["error", "never"],
- "space-unary-ops": "error",
- "no-unused-vars": ["error", {"varsIgnorePattern": "ReactDOM"}],
- "react/display-name": "off",
- // disabling for now since there are too many components without PropTypes
- "react/prop-types": "off"
- },
-
- "parserOptions": {
- "sourceType": "module",
- "ecmaFeatures": {
- "jsx": true,
- "experimentalObjectRestSpread": true
- }
- },
-
- "env": {
- "browser": true,
- "node": true,
- "jquery": true,
- "amd": true,
- "mocha": true,
- "phantomjs": true,
- "es6": true
- },
-
- "globals": {
- "document": true,
- "window": true,
- "location": true,
- "alert": true,
- "console": true,
- "clearInterval": true,
- "setInterval": true,
- "setTimeout": true,
- "prompt": true,
- "confirm": true,
-
- "jQuery": true,
- "Backbone": true,
- "$": true,
- "_": true,
- "require": true,
- "module": true,
- "sinon": true,
- "it": true,
- "describe": true,
- "beforeEach": true,
- "afterEach": true,
- "before": true,
- "after": true,
- "define": true,
- "expect": true,
- "prettyPrint": true,
- "jest": true
- },
-
- "settings": {
- "react": {
- "version": "detect"
- }
- }
-}
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
deleted file mode 100644
index be4f816..0000000
--- a/.github/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--- Provide a general summary of the issue in the Title above -->
-
-## Expected Behavior
-<!--- If you're describing a bug, tell us what should happen -->
-<!--- If you're suggesting a change/improvement, tell us how it should work -->
-
-## Current Behavior
-<!--- If describing a bug, tell us what happens instead of the expected behavior -->
-<!--- If suggesting a change/improvement, explain the difference from current behavior -->
-
-## Possible Solution
-<!--- Not obligatory, but suggest a fix/reason for the bug, -->
-<!--- or ideas how to implement the addition or change -->
-
-## Steps to Reproduce (for bugs)
-<!--- Provide a link to a live example, or an unambiguous set of steps to -->
-<!--- reproduce this bug. Include code to reproduce, if relevant -->
-1.
-2.
-3.
-4.
-
-## Context
-<!--- How has this issue affected you? What are you trying to accomplish? -->
-<!--- Providing context helps us come up with a solution that is most useful in the real world -->
-
-## Your Environment
-<!--- Include as many relevant details about the environment you experienced the bug in -->
-* Version used:
-* Browser Name and version:
-* Operating System and version (desktop or mobile):
-* Link to your project:
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index cd39026..0000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,42 +0,0 @@
-<!-- Thank you for your contribution!
-
- Please file this form by replacing the Markdown comments
- with your text. If a section needs no action - remove it.
-
- Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
- of code collaboration. Positive feedback is represented +1 from committers
- and negative is a -1. The -1 also means veto, and needs to be addressed
- to proceed. Once there are no objections, the PR can be merged by a
- CouchDB committer.
-
- See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->
-
-## Overview
-
-<!-- Please give a short brief for the pull request,
- what problem it solves or how it makes things better. -->
-
-## Testing recommendations
-
-<!-- Describe how we can test your changes.
- Does it provides any behaviour that the end users
- could notice? -->
-
-## GitHub issue number
-
-<!-- If this is a significant change, please file a separate issue at:
- https://github.com/apache/couchdb-fauxton/issues
- and include the number here and in commit message(s) using
- syntax like "Fixes #472" or "Fixes apache/couchdb#472". -->
-
-## Related Pull Requests
-
-<!-- If your changes affects multiple components in different
- repositories please put links to those pull requests here. -->
-
-## Checklist
-
-- [ ] Code is written and works correctly;
-- [ ] Changes are covered by tests;
-- [ ] Documentation reflects the changes;
-- [ ] Update [rebar.config.script](https://github.com/apache/couchdb/blob/master/rebar.config.script) with the correct tag once a new Fauxton release is made
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 2d7315c..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,48 +0,0 @@
-node_modules
-dist
-build
-app/load_addons.js
-!app/addons/
-app/addons/*
-!app/addons/activetasks
-!app/addons/config
-!app/addons/cluster
-!app/addons/components
-!app/addons/replication
-!app/addons/auth
-!app/addons/permissions
-!app/addons/verifyinstall
-!app/addons/compaction
-!app/addons/fauxton
-!app/addons/databases
-!app/addons/documents
-!app/addons/documentation
-!app/addons/styletests
-!app/addons/cors
-!app/addons/setup
-!app/addons/search
-!app/addons/news
-settings.json*
-i18n.json
-!settings.json.default
-!settings.json.default.json
-!i18n.json.default.json
-test/test.config.js
-app/initialize.js
-.module-cache
-test/nightwatch_tests/nightwatch.json
-test/nightwatch_tests/reports/*
-test/nightwatch_tests/selenium/*
-!test/nightwatch_tests/selenium/.gitkeep
-.DS_Store
-selenium-debug.log
-npm-debug.log
-test/bundle.js
-test/bundle.dev.js
-test/templates.js
-test/dashboard.assets
-# test coverage dir
-coverage
-
-# Jetbrains IDE
-.idea/
diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index 0da95e4..0000000
--- a/.npmignore
+++ /dev/null
@@ -1,6 +0,0 @@
-app/
-assets/
-tasks
-test/
-dist/debug
-dist/tmp-out
diff --git a/.travis.yml b/.travis.yml
index 9354f57..735a399 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,35 +1,6 @@
language: node_js
-node_js:
- - "10"
-sudo: false
-services:
- - docker
git:
depth: 1
-env:
- - COUCHDB_IMAGE=apache/couchdb:2.3.1 NIGHTWATCH_SKIPTAGS="search,partitioned"
- - COUCHDB_IMAGE=apache/couchdb:3 NIGHTWATCH_SKIPTAGS="search,nonpartitioned,couchdb-v2-only"
- # - COUCHDB_IMAGE=couchdb:dev NIGHTWATCH_SKIPTAGS="search,nonpartitioned"
-before_install:
- - npm install -g npm@latest
- - ./bin/build-couchdb-dev.sh
-install:
- - npm ci
-before_script:
- - travis_retry ./bin/docker-up-and-check.sh
- - curl http://127.0.0.1:5984
- - npm run stylecheck
- - npm ls --production --depth=0
- - npm test
- - grunt debugDev
- - DIST=./dist/debug ./bin/fauxton &
- - sleep 30
script:
- - ./node_modules/.bin/grunt nightwatch_retries
-after_script:
- - npm run docker:down
-cache:
- - apt
- - directories:
- - "$HOME/.npm"
+ - echo "Passed!"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 1d6dd22..0000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# Contributing to Fauxton
-
-Please take a moment to review this document in order to make the contribution
-process easy and effective for everyone involved.
-
-Following these guidelines helps to communicate that you respect the time of
-the developers managing and developing this open source project. In return,
-they should reciprocate that respect in addressing your issue, assessing
-changes, and helping you finalize your pull requests.
-
-Contributions to CouchDB are governed by our [Code of Conduct][6] and a set of
-[Project Bylaws][7]. Apache CouchDB itself also has a [CONTRIBUTING.md][9] if
-you want to help with the larger project. Come join us!
-
-## Contributor quick start
-
-If you never created a pull request before, welcome :tada: :smile: [Here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
-on how to send one :)
-
-The [Readme file](https://github.com/apache/couchdb-fauxton/blob/master/readme.md) has information about how to get the project set up for development.
-
-## Guide to Contributions
-
-We follow our coding-styleguide to make it easier for everyone to write, read and review code:
-[https://github.com/apache/couchdb-fauxton/blob/master/styleguide.md](https://github.com/apache/couchdb-fauxton/blob/master/styleguide.md)
-
-To start working on a specific ticket, create a branch with the GitHub Issue # followed by a traincase description of the issue.
-
-> e.g. 1234-Added-support-for-list-functions
-
-If there is no GH Issue for the issue you have, you don't have to create one. Please describe the issue, how it happens and how you fixed it in the commit message.
-
-Commit messages should follow the following style:
-
-```
-A brief one line description < 72 chars
-
-Followed by further explanation if needed, this should be wrapped at
-around 72 characters. Most commits should reference an existing
-issue
-
-Fixes #XXX (if there is a GH Issue)
-Fixes apache/couchdb#XXX (if there is a CouchDB project GH Issue)
-```
-
-Before you submit the Pull Request, please [run our test suite](#tests.md) and make sure that it passes.
-
-We regularly check the PR list for Fauxton and should get back
-to you with a code review. If no one has responded to you yet, you can find us on [Freenode IRC in #couchdb-dev][8].
-Ping **garren**, **robertkowalski** or **michellep** though anyone in the room should be able to help you.
-
-## Get in Touch
-
-We appreciate constructive feedback from people who use CouchDB, so don't be shy. We know there are bugs and we know
-there is room for improvement.
-
-ʕ´•ᴥ•`ʔ Thanks!
-
--- Fauxton team
-
-[6]: http://couchdb.apache.org/conduct.html
-[7]: http://couchdb.apache.org/bylaws.html
-[8]: http://webchat.freenode.net?channels=%23couchdb-dev
-[9]: https://github.com/apache/couchdb/blob/master/CONTRIBUTING.md
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index 215bbf4..0000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,266 +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.
-
-
-// This is the main application configuration file. It is a Grunt
-// configuration file, which you can learn more about here:
-// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
-
-/*jslint node: true */
-"use strict";
-
-module.exports = function (grunt) {
- var helper = require('./tasks/helper.js'),
- initHelper = helper.init(grunt),
- _ = grunt.util._;
-
- var couch_config = function () {
- var default_couch_config = {
- fauxton: {
- db: helper.couch + 'fauxton',
- app: './couchapp.js',
- options: {
- okay_if_missing: true
- }
- }
- };
-
- var settings_couch_config = initHelper.readSettingsFile().couch_config;
- return settings_couch_config || default_couch_config;
- }();
-
- var cleanableAddons = function () {
- var theListToClean = [];
- initHelper.processAddons(function (addon) {
- // Only clean addons that are included from a local dir
- if (addon.path) {
- theListToClean.push("app/addons/" + addon.name);
- }
- });
-
- return theListToClean;
- }();
-
- var cleanable = function () {
- // Whitelist files and directories to be cleaned
- // You'll always want to clean these two directories
- // Now find the external addons you have and add them for cleaning up
- return _.union(["dist/", "app/load_addons.js"], cleanableAddons);
- }();
-
- var templateSettings = (function getTemplateSettings () {
- var settings = initHelper.readSettingsFile();
-
- var i18n = JSON.stringify(initHelper.readI18nFile(), null, ' ');
-
- Object.keys(settings.template).forEach(function (key) {
- settings.template[key].variables.generationDate = new Date().toISOString();
- if (!settings.template[key].variables.generationLabel) {
- settings.template[key].variables.generationLabel = 'Generated: ';
- }
- settings.template[key].app.i18n = i18n;
- });
-
- return settings.template;
- })();
-
- var config = {
-
- // The clean task ensures all files are removed from the dist/ directory so
- // that no files linger from previous builds.
- clean: {
- options: {
- 'force': true
- },
- release: cleanable
- },
-
- template: templateSettings,
-
- // Copy build artifacts and library code into the distribution
- // see - http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
- copy: {
- couchdb: {
- files: [
- // this gets built in the template task
- {src: "dist/release/index.html", dest: "../../share/www/index.html"},
- {src: ["**"], dest: '../../share/www/dashboard.assets/', cwd: 'dist/release/dashboard.assets/', expand: true},
- ]
- },
- couchdebug: {
- files: [
- // this gets built in the template task
- {src: "dist/debug/index.html", dest: "../../share/www/index.html"},
- ]
- },
- dist:{
- files:[
- {src: 'dist/debug/index.html', dest: 'dist/release/index.html'},
- {src: './favicon.ico', dest: "dist/release/favicon.ico"}
- ]
- },
-
- distDepsRequire: {
- files:[
- {src: 'assets/**', dest: 'dist/tmp-out/', flatten: false, expand: false},
- ]
- },
-
- debug: {
- files:[
- {src: './favicon.ico', dest: "dist/debug/favicon.ico"}
- ]
- },
-
- testfiles: {
- files:[
- {src: ['test/**'], dest: 'dist/debug/', flatten: false, expand: true},
- {src: 'assets/**', dest: 'dist/debug/', flatten: false, expand: false},
- ]
- }
- },
-
- get_deps: {
- "default": {
- src: "settings.json"
- }
- },
-
- gen_load_addons: {
- "default": {
- src: "settings.json"
- }
- },
- gen_initialize: templateSettings,
- checkTestExists: templateSettings,
-
- mkcouchdb: couch_config,
- rmcouchdb: couch_config,
- couchapp: couch_config,
-
- shell: {
- webpack: {
- command: 'npm run webpack:dev'
- },
-
- webpackrelease: {
- command: 'npm run webpack:release'
- }
- },
-
- exec: {
- start_nightWatch: {
- command: 'node ' + __dirname + '/node_modules/nightwatch/bin/nightwatch' +
- ' -c ' + __dirname + '/test/nightwatch_tests/nightwatch.json',
- options: {
- maxBuffer: 1000 * 1024
- }
- },
- start_nightWatch_with_retries: {
- command: 'node ' + __dirname + '/node_modules/nightwatch/bin/nightwatch' +
- ' -c ' + __dirname + '/test/nightwatch_tests/nightwatch.json' +
- ' --suiteRetries 3',
- options: {
- maxBuffer: 1000 * 1024
- }
- }
- },
-
- // generates the nightwatch.json file with appropriate content for this env
- initNightwatch: {
- default: {
- settings: initHelper.readSettingsFile(),
- template: 'test/nightwatch_tests/nightwatch.json.underscore',
- dest: 'test/nightwatch_tests/nightwatch.json'
- }
- }
- };
-
- grunt.initConfig(config);
-
- /*
- * Load Grunt plugins
- */
- // Load fauxton specific tasks
- grunt.loadTasks('tasks');
-
- grunt.loadNpmTasks('grunt-couchapp');
- grunt.loadNpmTasks('grunt-exec');
- grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.loadNpmTasks('grunt-contrib-clean');
- grunt.loadNpmTasks('grunt-shell');
- /*
- * Default task
- */
- // defult task - install minified app to local CouchDB
- grunt.registerTask('default', 'couchdb');
-
- /*
- * Transformation tasks
- */
- grunt.registerTask('test', ['clean:release', 'dependencies', 'copy:debug', 'gen_initialize:development']);
-
- // Fetch dependencies (from git or local dir)
- grunt.registerTask('dependencies', ['get_deps', 'gen_load_addons:default']);
-
- // minify code and css, ready for release.
- grunt.registerTask('build', ['copy:distDepsRequire', 'shell:webpackrelease']);
- /*
- * Build the app in either dev, debug, or release mode
- */
- // dev server
- grunt.registerTask('dev', function () {
- console.warn('This is deprecated. Please run npm run dev instead');
- });
-
- // build a debug release
- grunt.registerTask('debug', ['clean', 'dependencies', "gen_initialize:development",
- 'copy:debug']);
-
- grunt.registerTask('debugDev', ['clean', 'dependencies', "gen_initialize:development",
- 'copy:debug', 'shell:webpack']);
-
- grunt.registerTask('devSetup', ['dependencies', "gen_initialize:development",
- 'copy:debug']);
- grunt.registerTask('devSetupWithClean', ['clean', 'devSetup']);
-
- grunt.registerTask('watchRun', ['clean:watch', 'dependencies', 'shell:stylecheck']);
-
- // build a release
- grunt.registerTask('release_commons_prefix', ['clean', 'dependencies']);
- grunt.registerTask('release_commons_suffix', ['build', 'copy:dist']);
-
- grunt.registerTask('release', ['release_commons_prefix', 'gen_initialize:release', 'release_commons_suffix']);
- grunt.registerTask('couchapp_release', ['release_commons_prefix', 'gen_initialize:couchapp', 'release_commons_suffix']);
-
- /*
- * Install into CouchDB in either debug, release, or couchapp mode
- */
- // make a development install that is server by mochiweb under _utils
- grunt.registerTask('couchdebug', ['debug', 'copy:couchdebug']);
- // make a minimized install that is server by mochiweb under _utils
- grunt.registerTask('couchdb', ['release', 'copy:couchdb']);
- // make an install that can be deployed as a couchapp
- grunt.registerTask('couchapp_setup', ['couchapp_release']);
- // install fauxton as couchapp
- grunt.registerTask('couchapp_install', ['rmcouchdb:fauxton', 'mkcouchdb:fauxton', 'couchapp:fauxton']);
- // setup and install fauxton as couchapp
- grunt.registerTask('couchapp_deploy', ['couchapp_setup', 'couchapp_install']);
-
- /*
- * Nightwatch functional testing
- */
- //Start Nightwatch test from terminal, using: $ grunt nightwatch
- grunt.registerTask('nightwatch', ['initNightwatch', 'exec:start_nightWatch']);
- //Same as above but the Nightwatch runner will retry tests 3 times before failing
- grunt.registerTask('nightwatch_retries', ['initNightwatch', 'exec:start_nightWatch_with_retries']);
-};
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index e747955..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
-
diff --git a/__mocks__/fileMock.js b/__mocks__/fileMock.js
deleted file mode 100644
index 86059f3..0000000
--- a/__mocks__/fileMock.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = 'test-file-stub';
diff --git a/__mocks__/styleMock.js b/__mocks__/styleMock.js
deleted file mode 100644
index f053ebf..0000000
--- a/__mocks__/styleMock.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = {};
diff --git a/app/addons/activetasks/__tests__/components.test.js b/app/addons/activetasks/__tests__/components.test.js
deleted file mode 100644
index d5dea22..0000000
--- a/app/addons/activetasks/__tests__/components.test.js
+++ /dev/null
@@ -1,86 +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.
-import TableHeader from '../components/tableheader';
-import FilterTabs from '../components/filtertabs';
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-describe('Active Tasks -- Components', () => {
-
- describe('Active Tasks Table (Components)', () => {
- describe('Active Tasks Filter tray', () => {
-
- const radioTexts = [
- 'Replication',
- 'Database Compaction',
- 'Indexer',
- 'View Compaction'
- ];
-
- it('should trigger change to radio buttons', () => {
- radioTexts.forEach((text) => {
- let spy = sinon.spy();
- const tabs = mount(
- <FilterTabs
- onRadioClick={spy}
- selectedRadio={"All Tasks"}
- radioNames={radioTexts}
- />
- );
-
- tabs.find(`input[value="${text}"]`).simulate('change');
- expect(spy.calledOnce).toBeTruthy();
- });
- });
-
- it('should trigger change to search term', () => {
- const spy = sinon.spy();
- const tabs = mount(
- <FilterTabs
- onSearch={spy}
- selectedRadio={"All Tasks"}
- />
- );
- tabs.find('.searchbox').simulate('change', {target: {value: 'searching'}});
- expect(spy.calledOnce).toBeTruthy();
- });
- });
-
- describe('Active Tasks Table Headers', () => {
- const tableTexts = [
- 'type',
- 'database',
- 'started-on'
- ];
-
- it('should trigger change to radio buttons', () => {
-
- tableTexts.forEach((text) => {
- let spy = sinon.spy();
- const table = mount(
- <table>
- <TableHeader
- onTableHeaderClick={spy}
- headerIsAscending={true}
- sortByHeader={"All Tasks"}
- />
- </table>
- );
-
- table.find(`.${text}`).simulate('click');
- expect(spy.calledOnce).toBeTruthy();
- });
- });
- });
- });
-});
diff --git a/app/addons/activetasks/__tests__/fakeActiveTaskResponse.js b/app/addons/activetasks/__tests__/fakeActiveTaskResponse.js
deleted file mode 100644
index bf60a47..0000000
--- a/app/addons/activetasks/__tests__/fakeActiveTaskResponse.js
+++ /dev/null
@@ -1,118 +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.
-export default [
- {
- "user": "okra",
- "updated_on": 10,
- "type": "replication",
- "target": "https://okra.fake.com/okra_rep/",
- "doc_write_failures": 0,
- "doc_id": "rep_1",
- "continuous": true,
- "checkpointed_source_seq": "3-g1AAAAEkeJyFzkEOgjAQBdAJkHgOPUBDQS1dyVVmaE0l0CaIa72Z3qyOwahscPMn-Zm8_A4AMpca2BhqwmBrQzIXfQj-7E7eiqYLF4N-FN6OHf8mCHSIMbYuwbTnYiUllUbJl7H-GNUSQTUnXd8KTEqR467Qc0UtKT7jhBsfhu5fCa3SFR3nUvlfekzS76a9Vmi37RPEPVpb",
- "checkpoint_interval": 5000,
- "changes_pending": null,
- "pid": "<0.10487.5819>",
- "node": "fake1@fake.net",
- "docs_read": 0,
- "docs_written": 0,
- "missing_revisions_found": 0,
- "replication_id": "07d9a41f181ce11b93ba1855ca7+continuous+create_target",
- "revisions_checked": 0,
- "source": "https://okra.fake.com/okra/",
- "source_seq": 0,
- "started_on": 9
- },
- {
- "user": "ooo",
- "updated_on": 8,
- "type": "indexer",
- "node": "fake2@fake2.net",
- "pid": "<0.10541.4469>",
- "changes_done": 145,
- "database": "shards/00000000-3fffffff/ooo/fakedatabase.1234567890abc",
- "design_document": "_design/superpurple",
- "progress": 0,
- "started_on": 7,
- "total_changes": 22942
- },
- {
- "updated_on": 6,
- "node": "fake3@fake3.net",
- "pid": "<0.1152.4474>",
- "changes_done": 144001,
- "database": "shards/00000000-3fffffff/global_changes.1398718618",
- "progress": 66,
- "started_on": 5,
- "total_changes": 218052,
- "type": "database_compaction"
- },
- {
- "user": "information",
- "updated_on": 4,
- "type": "replication",
- "target": "https://information.com/somedatabase/",
- "doc_write_failures": 0,
- "doc_id": "c0ffb663f75cd940aadb4a4eaa",
- "continuous": true,
- "checkpointed_source_seq": 58717,
- "checkpoint_interval": 3600000,
- "changes_pending": 0,
- "pid": "<0.11612.3684>",
- "node": "fake.fake.com",
- "docs_read": 108,
- "docs_written": 108,
- "missing_revisions_found": 108,
- "replication_id": "a546c13951c6bd4f2d187d388+continuous",
- "revisions_checked": 1024,
- "source": "http://software:*****@123.123.123:5984/somedatabase/",
- "source_seq": 58717,
- "started_on": 3
- },
- {
- "user": "abc",
- "updated_on": 2,
- "type": "replication",
- "target": "https://fake.com/db_abc/",
- "doc_write_failures": 0,
- "doc_id": "replication_2014",
- "continuous": true,
- "checkpointed_source_seq": "2-g1AAAAEXeJzLYWBgYMlgTyrNSS3QS87JL01JzCvRy0styQGqY0pkSLL___9_VgZTImMuUIA9JSUx1cTIAE2_IS79SQ5AMqkexQiLNAPzNAsjYp2QxwIkGRqAFNCU_SBjGMDGGFokp6WZJ6IZY4TfmAMQY_4jjDE2SDE3TzHJAgBp5FSv",
- "checkpoint_interval": 5000,
- "changes_pending": 0,
- "pid": "<0.14029.1733>",
- "node": "node.node.node..net",
- "docs_read": 0,
- "docs_written": 0,
- "missing_revisions_found": 0,
- "replication_id": "33af566bab6a58aee04e+continuous",
- "revisions_checked": 7,
- "source": "https://fake.fake123.com/db_abc/",
- "source_seq": "2-g1AAAAEXeJzLYWBgYMlgS3QS87JL01JzCvRy0styQGqY0pkSLL___9_VgZTImMuUIA9JSUx1cTIAE2_IS79SQ5AMqkexQiLNAPzNAsjYp2QxwIkGRqAFNCU_SBjGMDGGFokp6WZJ6IZY4TfmAMQY_4jjDE2SDE3TzHJAgBp5FSv",
- "started_on": 1
- },
- {
- "view": 5,
- "user": "treeman",
- "updated_on": 1426614009,
- "type": "view_compaction",
- "total_changes": 1108953,
- "node": "treeman.net",
- "pid": "<0.19668.4045>",
- "changes_done": 430000,
- "database": "shards/c0000000-ffffffff/treecompany/fake.1234567890",
- "design_document": "_design/trunk",
- "phase": "view",
- "progress": 38,
- "started_on": 1426602505
- },
-];
diff --git a/app/addons/activetasks/__tests__/reducer.test.js b/app/addons/activetasks/__tests__/reducer.test.js
deleted file mode 100644
index e1ddb8f..0000000
--- a/app/addons/activetasks/__tests__/reducer.test.js
+++ /dev/null
@@ -1,105 +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.
-
-import reducer from '../reducers';
-import ActionTypes from '../actiontypes';
-import fakedResponse from "./fakeActiveTaskResponse";
-
-describe('Active Tasks -- Stores', () => {
- let initState;
-
- beforeEach(() => {
- initState = reducer(undefined, {
- type: ActionTypes.ACTIVE_TASKS_FETCH_AND_SET,
- options: fakedResponse
- });
- });
-
- describe('Active Task Stores - Filter Tab Tray', () => {
-
- it('should filter the table correctly, by radio -- All Tasks', () => {
- const state = reducer(initState, {
- type: ActionTypes.ACTIVE_TASKS_SWITCH_TAB,
- options: 'all_tasks'
- });
- expect(state.tasks.length).toBeGreaterThan(0);
- expect(state.tasks.length).toEqual(state.filteredTasks.length);
- });
-
- it('should filter the table correctly, by radio', () => {
- const state = reducer(initState, {
- type: ActionTypes.ACTIVE_TASKS_SWITCH_TAB,
- options: 'replication'
- });
-
- //parse table and check that it only contains objects with type: Replication
- expect(state.filteredTasks.length > 0).toBeTruthy();
- state.filteredTasks.forEach(task => {
- expect(task.type).toEqual('replication');
- expect(task.type).toEqual(state.selectedRadio);
- });
- });
-
- it('should search the table correctly', () => {
- var searchTerm = 'base';
- const state = reducer(initState, {
- type: ActionTypes.ACTIVE_TASKS_SET_SEARCH_TERM,
- options: searchTerm
- });
-
- const fakeFilteredTable = [
- { user: 'information'},
- { user: 'ooo'}
- ];
-
- expect(fakeFilteredTable[0].user).toBe(state.filteredTasks[0].user);
- expect(fakeFilteredTable[1].user).toBe(state.filteredTasks[1].user);
- });
- });
-
- describe('Active Task Stores - Table Header Sort - Select Ascending/Descending', () => {
-
- it('should set header as ascending, on default', () => {
- const state = reducer(initState, {
- type: ActionTypes.ACTIVE_TASKS_SWITCH_TAB,
- options: 'all_tasks'
- });
- expect(state.headerIsAscending).toBeTruthy();
- });
-
- it('should set header as descending, if same header is selected again', () => {
- const state = reducer(initState, {
- type: ActionTypes.ACTIVE_TASKS_SORT_BY_COLUMN_HEADER,
- options: 'sameHeader'
- });
- expect(state.headerIsAscending).toBeTruthy();
-
- const state2 = reducer(state, {
- type: ActionTypes.ACTIVE_TASKS_SORT_BY_COLUMN_HEADER,
- options: 'sameHeader'
- });
- expect(state2.headerIsAscending).toBeFalsy();
-
- const state3 = reducer(state2, {
- type: ActionTypes.ACTIVE_TASKS_SORT_BY_COLUMN_HEADER,
- options: 'sameHeader'
- });
- expect(state3.headerIsAscending).toBeTruthy();
-
- const state4 = reducer(state3, {
- type: ActionTypes.ACTIVE_TASKS_SORT_BY_COLUMN_HEADER,
- options: 'differentHeader'
- });
- expect(state4.headerIsAscending).toBeTruthy();
- });
- });
-});
diff --git a/app/addons/activetasks/actions.js b/app/addons/activetasks/actions.js
deleted file mode 100644
index 60d6488..0000000
--- a/app/addons/activetasks/actions.js
+++ /dev/null
@@ -1,77 +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.
-import FauxtonAPI from '../../core/api';
-import ActionTypes from "./actiontypes";
-import fetchActiveTasks from './api';
-
-export const setActiveTaskIsLoading = (boolean) => {
- return {
- type: ActionTypes.ACTIVE_TASKS_SET_IS_LOADING,
- options: boolean
- };
-};
-
-export const setActiveTasks = (tasks) => {
- return {
- type: ActionTypes.ACTIVE_TASKS_FETCH_AND_SET,
- options: tasks
- };
-};
-
-export const init = () => (dispatch) => {
- dispatch(setActiveTaskIsLoading(true));
- fetchActiveTasks()
- .then(tasks => {
- dispatch(setActiveTaskIsLoading(false));
- dispatch(setActiveTasks(tasks));
- })
- .catch(error => {
- FauxtonAPI.addNotification({
- msg: `Fetching active tasks failed: ${error}`,
- type: 'error'
- });
- });
-};
-
-export const switchTab = (tab) => {
- return {
- type: ActionTypes.ACTIVE_TASKS_SWITCH_TAB,
- options: tab
- };
-};
-
-export const setSearchTerm = (searchTerm) => {
- return {
- type: ActionTypes.ACTIVE_TASKS_SET_SEARCH_TERM,
- options: searchTerm
- };
-};
-
-export const sortByColumnHeader = (columnName) => {
- return {
- type: ActionTypes.ACTIVE_TASKS_SORT_BY_COLUMN_HEADER,
- options: columnName
- };
-};
-
-export const runPollingUpdate = () => (dispatch) => {
- fetchActiveTasks()
- .then(tasks => {
- dispatch(setActiveTasks(tasks));
- })
- .catch(error => {
- FauxtonAPI.addNotification({
- msg: `Fetching active tasks failed: ${error}`,
- type: 'error'
- });
- });
-};
diff --git a/app/addons/activetasks/actiontypes.js b/app/addons/activetasks/actiontypes.js
deleted file mode 100644
index 16e463d..0000000
--- a/app/addons/activetasks/actiontypes.js
+++ /dev/null
@@ -1,20 +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.
-export default {
- ACTIVE_TASKS_SWITCH_TAB: 'ACTIVE_TASKS_SWITCH_TAB',
- ACTIVE_TASKS_SET_COLLECTION: 'ACTIVE_TASKS_SET_COLLECTION',
- ACTIVE_TASKS_SET_SEARCH_TERM: 'ACTIVE_TASKS_SET_SEARCH_TERM',
- ACTIVE_TASKS_SORT_BY_COLUMN_HEADER: 'ACTIVE_TASKS_SORT_BY_COLUMN_HEADER',
- ACTIVE_TASKS_FETCH_AND_SET: 'ACTIVE_TASKS_FETCH_AND_SET',
- ACTIVE_TASKS_SET_IS_LOADING: 'ACTIVE_TASKS_SET_IS_LOADING',
- ACTIVE_TASKS_POLLING_COLLECTION: 'ACTIVE_TASKS_POLLING_COLLECTION'
-};
diff --git a/app/addons/activetasks/api.js b/app/addons/activetasks/api.js
deleted file mode 100644
index 161c341..0000000
--- a/app/addons/activetasks/api.js
+++ /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.
-
-import Helpers from "../../helpers";
-import { get } from '../../core/ajax';
-
-export default () => {
- return get(Helpers.getServerUrl('/_active_tasks'))
- .then(tasks => {
- if (tasks.error) {
- throw new Error(tasks.reason);
- }
- return tasks;
- });
-};
-
diff --git a/app/addons/activetasks/assets/less/activetasks.less b/app/addons/activetasks/assets/less/activetasks.less
deleted file mode 100644
index 5b4cb7a..0000000
--- a/app/addons/activetasks/assets/less/activetasks.less
+++ /dev/null
@@ -1,155 +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.
-
-@import "../../../../../assets/less/bootstrap/variables.less";
-@import "../../../../../assets/less/variables.less";
-@import "../../../../../assets/less/bootstrap/mixins.less";
-@import "../../../../../assets/less/mixins.less";
-
-#active-tasks-page {
- overflow: auto;
-
- .inner {
- overflow: auto;
- height: 100%;
- }
-
- .task-tabs li,
- .active-tasks td.tableheader {
- cursor: pointer;
- padding-bottom: 15px;
-
- &.type {
- width: 10%;
- }
-
- &.database {
- width: 30%;
- }
-
- &.started-on {
- width: 13%;
- }
-
- &.updated-on {
- width: 13%;
- }
-
- &.pid {
- width: 10%;
- }
-
- &.progress {
- width: 23%;
- }
- }
-
- #active-tasks-table {
- min-width: 725px;
- td.header-field {
- padding: 0px;
- }
-
- p.multiline-active-tasks-message {
- margin: 0;
- line-height: 1.3;
- margin-bottom: 3px;
-
- &.time:nth-child(2) {
- color: #888;
- }
-
- &.to-from-database{
- &:first-child {
- border-bottom: 1px solid #ddd;
- }
- padding-bottom: 15px;
- }
- }
- }
-
- .task-search-database {
- margin: 20px;
- }
-
- .active-tasks.dashboard-upper-menu {
- left: 220px;
-
- .closeMenu & {
- left: 64px;
- }
- }
-
- .component-tab-element-wrapper {
- #active-tasks-search-box {
- display: inline;
- font-size: 14px;
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
- height: 51px;
- background-color: #eee;
- width: 200px;
- margin: 9px 0 0 0;
-
- &:focus {
- background-color: #fff;
- outline-color: #fff;
- };
- }
- }
-
- .dashboard-lower-menu {
- padding-top: 90px;
- padding-left: 20px;
- }
-
- .header-field {
- background-color: #ccc;
-
-
- &.radio {
- display: none;
- }
-
- &.label-text {
- display: block;
- font-weight: bold;
- padding:10px;
- margin: 0px;
- height: 50px;
- .noselect()
- }
-
- .table td& {
- padding: 0px;
- margin: 0px;
- }
-
- .active-tasks-header {
- background-color: #ccc;
- }
-
- .icon-caret-up, .icon-caret-down {
- color: @brandHighlight;
- }
- }
-}
-
-.active-tasks__polling-wrapper {
- display: flex;
- align-items: center;
- flex-direction: row;
- height: 100%;
-
- &--ie1X {
- align-items: stretch;
- }
-}
diff --git a/app/addons/activetasks/base.js b/app/addons/activetasks/base.js
deleted file mode 100644
index f51cf89..0000000
--- a/app/addons/activetasks/base.js
+++ /dev/null
@@ -1,26 +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.
-
-import FauxtonAPI from "../../core/api";
-import Activetasks from "./routes";
-import "./assets/less/activetasks.less";
-import reducers from './reducers';
-
-Activetasks.initialize = function () {
- FauxtonAPI.addHeaderLink({title: 'Active Tasks', icon: 'fonticon-activetasks', href: '#/activetasks'});
-};
-
-FauxtonAPI.addReducers({
- activetasks: reducers
-});
-
-export default Activetasks;
diff --git a/app/addons/activetasks/components/controller.js b/app/addons/activetasks/components/controller.js
deleted file mode 100644
index ec8a841..0000000
--- a/app/addons/activetasks/components/controller.js
+++ /dev/null
@@ -1,59 +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.
-import React from 'react';
-import ActiveTasksFilterTabs from './filtertabs';
-import ActiveTaskTable from './table';
-
-export default class ActiveTasksController extends React.Component {
- componentDidMount() {
- this.props.init();
- }
-
- setNewSearchTerm = (searchTerm) => {
- this.props.setSearchTerm(searchTerm);
- };
-
- switchTab = (newRadioButton) => { //tabs buttons
- this.props.switchTab(newRadioButton);
- };
-
- tableHeaderOnClick = (headerClicked) => {
- this.props.sortByColumnHeader(headerClicked);
- };
-
- render() {
- const {isLoading, tasks, searchTerm, selectedRadio, sortByHeader, headerIsAscending} = this.props;
-
- const setSearchTerm = this.setNewSearchTerm;
- const onTableHeaderClick = this.tableHeaderOnClick;
-
- return (
- <div id="active-tasks-page" className="scrollable">
- <div className="inner">
- <ActiveTasksFilterTabs
- searchTerm={searchTerm}
- selectedRadio={selectedRadio}
- onSearch={setSearchTerm}
- onRadioClick={this.switchTab}/>
- <ActiveTaskTable
- isLoading={isLoading}
- tasks={tasks}
- searchTerm={searchTerm}
- selectedRadio={selectedRadio}
- onTableHeaderClick={onTableHeaderClick}
- sortByHeader={sortByHeader}
- headerIsAscending={headerIsAscending} />
- </div>
- </div>
- );
- }
-}
diff --git a/app/addons/activetasks/components/filtertabs.js b/app/addons/activetasks/components/filtertabs.js
deleted file mode 100644
index 8d5410c..0000000
--- a/app/addons/activetasks/components/filtertabs.js
+++ /dev/null
@@ -1,75 +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.
-import React from 'react';
-import Components from "../../components/react-components";
-const {TabElement, TabElementWrapper} = Components;
-
-export default class ActiveTasksFilterTabs extends React.Component {
- static defaultProps = {
- radioNames : [
- 'All Tasks',
- 'Replication',
- 'Database Compaction',
- 'Indexer',
- 'View Compaction'
- ]
- };
-
- checked = (radioName) => {
- return this.props.selectedRadio === radioName;
- };
-
- onRadioClick = (e) => {
- var radioName = e.target.value;
- this.props.onRadioClick(radioName);
- };
-
- createFilterTabs = () => {
- return (
- this.props.radioNames.map((radioName, i) => {
- const checked = this.checked(radioName);
-
- return (
- <TabElement
- key={i}
- selected={checked}
- text={radioName}
- onChange={this.onRadioClick} />
- );
- })
- );
- };
-
- searchTermChange = (e) => {
- var searchTerm = e.target.value;
- this.props.onSearch(searchTerm);
- };
-
- render() {
- const filterTabs = this.createFilterTabs();
- return (
- <TabElementWrapper>
- {filterTabs}
- <li className="component-tab-list-element">
- <input
- id="active-tasks-search-box"
- className="searchbox"
- type="text"
- name="search"
- placeholder="Search for databases..."
- value={this.props.searchTerm}
- onChange={this.searchTermChange} />
- </li>
- </TabElementWrapper>
- );
- }
-}
diff --git a/app/addons/activetasks/components/polling.js b/app/addons/activetasks/components/polling.js
deleted file mode 100644
index 6e3d52e..0000000
--- a/app/addons/activetasks/components/polling.js
+++ /dev/null
@@ -1,48 +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.
-
-import React from 'react';
-import Helpers from '../../../helpers';
-import Components from "../../components/react-components";
-const { Polling } = Components;
-
-export default class ActiveTasksPollingWidgetController extends React.Component {
-
- runPollingUpdate = () => {
- this.props.runPollingUpdate();
- };
-
- getPluralForLabel = () => {
- return this.state.pollingInterval === "1" ? '' : 's';
- };
-
-
- render() {
- let activePollingClass = "active-tasks__polling-wrapper";
- if (Helpers.isIE1X()) {
- activePollingClass += " " + activePollingClass + "--ie1X";
- }
- return (
- <div className={activePollingClass}>
- <Polling
- min={1}
- max={30}
- stepSize={1}
- startValue={15}
- valueUnits={"second"}
- onPoll={this.runPollingUpdate}
- />
- </div>
- );
- }
-}
-
diff --git a/app/addons/activetasks/components/table.js b/app/addons/activetasks/components/table.js
deleted file mode 100644
index b006090..0000000
--- a/app/addons/activetasks/components/table.js
+++ /dev/null
@@ -1,44 +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.
-import React from 'react';
-import ActiveTasksTableBody from './tablebody';
-import ActiveTasksTableHeader from './tableheader';
-
-export default class ActiveTaskTable extends React.Component {
- render() {
- const {
- tasks,
- selectedRadio,
- searchTerm,
- sortByHeader,
- onTableHeaderClick,
- headerIsAscending,
- isLoading
- } = this.props;
-
- return (
- <div id="dashboard-lower-content">
- <table id="active-tasks-table" className="table table-bordered table-striped active-tasks">
- <ActiveTasksTableHeader
- onTableHeaderClick={onTableHeaderClick}
- sortByHeader={sortByHeader}
- headerIsAscending={headerIsAscending}/>
- <ActiveTasksTableBody
- tasks={tasks}
- selectedRadio={selectedRadio}
- isLoading={isLoading}
- searchTerm={searchTerm}/>
- </table>
- </div>
- );
- }
-}
diff --git a/app/addons/activetasks/components/tablebody.js b/app/addons/activetasks/components/tablebody.js
deleted file mode 100644
index bb73880..0000000
--- a/app/addons/activetasks/components/tablebody.js
+++ /dev/null
@@ -1,70 +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.
-
-import React from 'react';
-import ActiveTaskTableBodyContents from './tablebodycontents';
-
-export default class ActiveTasksTableBody extends React.Component {
- createRows = () => {
- var isThereASearchTerm = this.props.searchTerm.trim() === "";
-
- if (this.props.tasks.length === 0 || this.props.isLoading) {
- return isThereASearchTerm ? this.noActiveTasks() : this.noActiveTasksMatchFilter();
- }
-
- return this.props.tasks.map((item, key) => {
- return <ActiveTaskTableBodyContents key={key} item={item} />;
- });
- };
-
- getType = () => {
- const type = this.props.selectedRadio;
- if (type === "All Tasks") {
- return "";
- }
-
- return type;
- }
-
- noActiveTasks = () => {
- const type = this.getType();
- let msg = <td colSpan="6">No active {type} tasks.</td>;
-
- if (this.props.isLoading) {
- msg = <td colSpan="6">Loading tasks.</td>;
- }
-
- return (
- <tr className="no-matching-database-on-search">
- {msg}
- </tr>
- );
- };
-
- noActiveTasksMatchFilter = () => {
- const type = this.getType();
-
- return (
- <tr className="no-matching-database-on-search">
- <td colSpan="6">No active {type} tasks match with filter: "{this.props.searchTerm}"</td>
- </tr>
- );
- };
-
- render() {
- return (
- <tbody className="js-tasks-go-here">
- {this.createRows()}
- </tbody>
- );
- }
-}
diff --git a/app/addons/activetasks/components/tablebodycontents.js b/app/addons/activetasks/components/tablebodycontents.js
deleted file mode 100644
index e8c6e2b..0000000
--- a/app/addons/activetasks/components/tablebodycontents.js
+++ /dev/null
@@ -1,117 +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.
-
-import React from 'react';
-import app from '../../../app';
-
-const activeTasksHelpers = {
- getTimeInfo (timeStamp) {
- var timeMessage = [
- app.helpers.formatDate(timeStamp),
- app.helpers.getDateFromNow(timeStamp)
- ];
- return timeMessage;
- },
-
- getDatabaseFieldMessage (item) {
- var type = item.type;
- var databaseFieldMessage = [];
-
- if (type === 'replication') {
- databaseFieldMessage.push('From: ' + item.source);
- databaseFieldMessage.push('To: ' + item.target);
- } else if (type === 'indexer') {
- databaseFieldMessage.push(item.database);
- databaseFieldMessage.push('(View: ' + item.design_document + ')');
- } else {
- databaseFieldMessage.push(item.database);
- }
-
- return databaseFieldMessage;
- },
-
- getProgressMessage (item) {
- var progressMessage = [];
- var type = item.type;
-
- if (_.has(item, 'progress')) {
- progressMessage.push('Progress: ' + item.progress + '%');
- }
-
- if (type === 'indexer') {
- progressMessage.push(
- 'Processed ' + item.changes_done + ' of ' + item.total_changes + ' changes.'
- );
- } else if (type === 'replication') {
- progressMessage.push(item.docs_written + ' docs written.');
-
- if (_.has(item, 'changes_pending')) {
- progressMessage.push(item.changes_pending + ' pending changes.');
- }
- }
-
- if (_.has(item, 'changes_done')) {
- progressMessage.push(item.changes_done + ' Changes done.');
- }
-
- return progressMessage;
- },
-
- getSourceSequence (item) {
- return item.source_seq;
- }
-
-};
-
-export default class ActiveTaskTableBodyContents extends React.Component {
- getInfo = (item) => {
- return {
- type : item.type,
- objectField: activeTasksHelpers.getDatabaseFieldMessage(item),
- started_on: activeTasksHelpers.getTimeInfo(item.started_on),
- updated_on: activeTasksHelpers.getTimeInfo(item.updated_on),
- pid: item.pid.replace(/[<>]/g, ''),
- progress: activeTasksHelpers.getProgressMessage(item),
- };
- };
-
- multilineMessage = (messageArray, optionalClassName) => {
-
- if (!optionalClassName) {
- optionalClassName = '';
- }
- var cssClasses = 'multiline-active-tasks-message ' + optionalClassName;
-
- return messageArray.map(function (msgLine, iterator) {
- return <p key={iterator} className={cssClasses}>{msgLine}</p>;
- });
- };
-
- render() {
- var rowData = this.getInfo(this.props.item);
- var objectFieldMsg = this.multilineMessage(rowData.objectField, 'to-from-database');
- var startedOnMsg = this.multilineMessage(rowData.started_on, 'time');
- var updatedOnMsg = this.multilineMessage(rowData.updated_on, 'time');
- var progressMsg = this.multilineMessage(rowData.progress);
-
- return (
- <tr>
- <td>{rowData.type}</td>
- <td>{objectFieldMsg}</td>
- <td>{startedOnMsg}</td>
- <td>{updatedOnMsg}</td>
- <td>{rowData.pid}</td>
- <td>{progressMsg}</td>
- </tr>
- );
- }
-}
diff --git a/app/addons/activetasks/components/tableheader.js b/app/addons/activetasks/components/tableheader.js
deleted file mode 100644
index 2b85cc5..0000000
--- a/app/addons/activetasks/components/tableheader.js
+++ /dev/null
@@ -1,86 +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.
-
-import React from 'react';
-
-export class TableHeader extends React.Component {
-
- constructor (props) {
- super(props);
- this.onTableHeaderClick = this.onTableHeaderClick.bind(this);
- }
-
-
- arrow = () => {
- const sortBy = this.props.sortByHeader;
- const currentName = this.props.headerName;
- const headerIsAscending = this.props.headerIsAscending;
- const arrow = headerIsAscending ? 'icon icon-caret-up' : 'icon icon-caret-down';
-
- if (sortBy === currentName) {
- return <i className={arrow}></i>;
- }
- };
-
- onTableHeaderClick = () => {
- this.props.onTableHeaderClick(this.props.headerName);
- };
-
- render() {
- return (
- <td className={`header-field ${this.props.headerName} tableheader`} onClick={this.onTableHeaderClick}>
- <label className="header-field label-text active-tasks-header noselect">
- {this.props.displayName} {this.arrow()}
- </label>
- </td>
- );
- }
-}
-
-export default class ActiveTasksTableHeader extends React.Component {
- static defaultProps = {
- headerNames : [
- ['type', 'Type'],
- ['database', 'Database'],
- ['started-on', 'Started on'],
- ['updated-on', 'Updated on'],
- ['pid', 'PID'],
- ['progress', 'Status']
- ]
- };
-
- createTableHeadingFields = () => {
- const {
- onTableHeaderClick,
- sortByHeader,
- headerIsAscending
- } = this.props;
-
- return this.props.headerNames.map(function (header) {
- return <TableHeader
- headerName={header[0]}
- displayName={header[1]}
- key={header[0]}
- onTableHeaderClick={onTableHeaderClick}
- sortByHeader={sortByHeader}
- headerIsAscending={headerIsAscending} />;
- });
- };
-
- render() {
- return (
- <thead>
- <tr>{this.createTableHeadingFields()}</tr>
- </thead>
- );
- }
-}
diff --git a/app/addons/activetasks/container.js b/app/addons/activetasks/container.js
deleted file mode 100644
index 38f8fad..0000000
--- a/app/addons/activetasks/container.js
+++ /dev/null
@@ -1,55 +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.
-
-import { connect } from 'react-redux';
-import Controller from './layout';
-import {
- init,
- setSearchTerm,
- sortByColumnHeader,
- switchTab,
- runPollingUpdate
-} from './actions';
-import {
- getTasks,
- getHeaderIsAscending,
- getSelectedRadio,
- getSortByHeader,
- getSearchTerm,
- getIsLoading
-} from './reducers';
-
-const mapStateToProps = ({activetasks}) => {
- return {
- tasks: getTasks(activetasks),
- headerIsAscending: getHeaderIsAscending(activetasks),
- selectedRadio: getSelectedRadio(activetasks),
- sortByHeader: getSortByHeader(activetasks),
- searchTerm: getSearchTerm(activetasks),
- isLoading: getIsLoading(activetasks)
- };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- init: () => dispatch(init()),
- setSearchTerm: (term) => dispatch(setSearchTerm(term)),
- sortByColumnHeader: (column) => dispatch(sortByColumnHeader(column)),
- switchTab: (tab) => dispatch(switchTab(tab)),
- runPollingUpdate: () => dispatch(runPollingUpdate())
- };
-};
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(Controller);
diff --git a/app/addons/activetasks/layout.js b/app/addons/activetasks/layout.js
deleted file mode 100644
index e126237..0000000
--- a/app/addons/activetasks/layout.js
+++ /dev/null
@@ -1,41 +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.
-
-import React from 'react';
-import Helpers from "../../helpers";
-import FauxtonAPI from "../../core/api";
-import {OnePane, OnePaneHeader, OnePaneContent} from '../components/layouts';
-import ActiveTasksController from "./components/controller";
-import ActiveTasksPollingWidgetController from './components/polling';
-
-const crumbs = [
- {'name': 'Active Tasks'}
-];
-
-export const ActiveTasksLayout = (props) => {
- return (
- <OnePane>
- <OnePaneHeader
- crumbs={crumbs}
- docURL={FauxtonAPI.constants.DOC_URLS.ACTIVE_TASKS}
- endpoint={Helpers.getApiUrl('/_active_tasks')}
- >
- <ActiveTasksPollingWidgetController {...props} />
- </OnePaneHeader>
- <OnePaneContent>
- <ActiveTasksController {...props} />
- </OnePaneContent>
- </OnePane>
- );
-};
-
-export default ActiveTasksLayout;
diff --git a/app/addons/activetasks/reducers.js b/app/addons/activetasks/reducers.js
deleted file mode 100644
index bba4bf4..0000000
--- a/app/addons/activetasks/reducers.js
+++ /dev/null
@@ -1,141 +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.
-import ActionTypes from "./actiontypes";
-import { has, sortBy, isUndefined } from 'lodash';
-
-const initialState = {
- isLoading: false,
- sortByHeader: 'started-on',
- headerIsAscending: true,
- selectedRadio: 'All Tasks',
- searchTerm: '',
- tasks: [],
- filteredTasks: []
-};
-
-const sortTasksByColumnHeader = (colName, tasks, headerIsAscending) => {
- var sorted = sortBy(tasks, (item) => {
- var variable = colName;
-
- if (isUndefined(item[variable])) {
- variable = 'source';
- }
- return item[variable];
- });
-
- if (!headerIsAscending) {
- return sorted.reverse();
- }
-
- return sorted;
-};
-
-
-const setSearchTerm = (state, searchTerm) => {
- const filteredTasks = filterTasks(searchTerm, state.selectedRadio, state.sortbyHeader, state.tasks, state.headerIsAscending);
- return {
- ...state,
- filteredTasks,
- searchTerm
- };
-};
-
-const passesSearchFilter = (item, searchTerm) => {
- const regex = new RegExp(searchTerm, 'g');
- let itemDatabasesTerm = '';
- if (has(item, 'database')) {
- itemDatabasesTerm += item.database;
- }
- if (has(item, 'source')) {
- itemDatabasesTerm += item.source;
- }
- if (has(item, 'target')) {
- itemDatabasesTerm += item.target;
- }
-
- return regex.test(itemDatabasesTerm);
-};
-
-const passesRadioFilter = (item, selectedRadio) => {
- const fixedSelectedRadio = selectedRadio.toLowerCase().replace(' ', '_');
- return item.type === fixedSelectedRadio || fixedSelectedRadio === 'all_tasks';
-};
-
-const filterTasks = (searchTerm, selectedRadio, sortByHeader, tasks, headerIsAscending) => {
- const filtered = tasks.filter(task => {
- return passesRadioFilter(task, selectedRadio) && passesSearchFilter(task, searchTerm);
- });
-
- return sortTasksByColumnHeader(sortByHeader, filtered, headerIsAscending);
-};
-
-const setHeaderIsAscending = (prevSortbyHeader, sortByHeader, headerIsAscending) => {
- if (prevSortbyHeader === sortByHeader) {
- return !headerIsAscending;
- }
-
- return true;
-};
-
-export default (state = initialState, {type, options}) => {
- switch (type) {
- case ActionTypes.ACTIVE_TASKS_FETCH_AND_SET:
- return {
- ...state,
- tasks: options,
- filteredTasks: filterTasks(state.searchTerm, state.selectedRadio, state.sortByHeader, options, state.headerIsAscending)
- };
-
- case ActionTypes.ACTIVE_TASKS_SWITCH_TAB:
- const filteredTasks = filterTasks(state.searchTerm, options, state.sortByHeader, state.tasks, headerIsAscending);
- return {
- ...state,
- selectedRadio: options,
- filteredTasks
- };
-
- case ActionTypes.ACTIVE_TASKS_CHANGE_POLLING_INTERVAL:
- return {
- ...state,
- pollingIntervalSeconds: options
- };
-
- case ActionTypes.ACTIVE_TASKS_SET_SEARCH_TERM:
- return setSearchTerm(state, options);
-
- case ActionTypes.ACTIVE_TASKS_SORT_BY_COLUMN_HEADER:
- const prevSortbyHeader = state.sortByHeader;
- const sortByHeader = options;
- const headerIsAscending = setHeaderIsAscending(prevSortbyHeader, sortByHeader, state.headerIsAscending);
- const headerFilteredTasks = filterTasks(state.searchTerm, state.selectedRadio, sortByHeader, state.tasks, headerIsAscending);
- return {
- ...state,
- sortByHeader,
- headerIsAscending,
- filteredTasks: headerFilteredTasks
- };
-
- case ActionTypes.ACTIVE_TASKS_SET_IS_LOADING:
- return {
- ...state,
- isLoading: options
- };
- }
- return state;
-};
-
-export const getTasks = (state) => state.filteredTasks;
-export const getHeaderIsAscending = (state) => state.headerIsAscending;
-export const getIsLoading = (state) => state.isLoading;
-export const getSelectedRadio = (state) => state.selectedRadio;
-export const getSortByHeader = (state) => state.sortByHeader;
-export const getSearchTerm = (state) => state.searchTerm;
diff --git a/app/addons/activetasks/routes.js b/app/addons/activetasks/routes.js
deleted file mode 100644
index 2d51fc4..0000000
--- a/app/addons/activetasks/routes.js
+++ /dev/null
@@ -1,34 +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.
-
-import React from 'react';
-import FauxtonAPI from "../../core/api";
-import Layout from './container';
-
-var ActiveTasksRouteObject = FauxtonAPI.RouteObject.extend({
- selectedHeader: 'Active Tasks',
-
- routes: {
- 'activetasks/:id': 'showActiveTasks',
- 'activetasks': 'showActiveTasks'
- },
-
- roles: ['_admin'],
-
- showActiveTasks: function () {
- return <Layout />;
- }
-});
-
-export default {
- RouteObjects: [ActiveTasksRouteObject]
-};
diff --git a/app/addons/auth/__tests__/components.test.js b/app/addons/auth/__tests__/components.test.js
deleted file mode 100644
index 8a1066e..0000000
--- a/app/addons/auth/__tests__/components.test.js
+++ /dev/null
@@ -1,95 +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.
-
-import React from "react";
-import LoginForm from "../components/loginform";
-import {CreateAdminForm} from "../components/createadminform";
-import {ChangePasswordForm} from '../components/changepasswordform';
-import * as Actions from "../actions";
-import { mount } from 'enzyme';
-import sinon from "sinon";
-
-describe('Auth -- Components', () => {
-
- describe('LoginForm', () => {
- let stub;
-
- beforeEach(() => {
- stub = sinon.stub(Actions, 'login');
- });
-
- afterEach(() => {
- Actions.login.restore();
- });
-
- it('should trigger login event when form submitted', () => {
- const loginForm = mount(<LoginForm/>);
- loginForm.find('#login').simulate('submit');
- expect(stub.calledOnce).toBeTruthy();
- });
-
- it('in case of nothing in state, should pass actual values to Actions.login()', () => {
- const username = 'bob';
- const password = 'smith';
-
- const loginForm = mount(
- <LoginForm
- testBlankUsername={username}
- testBlankPassword={password}
- />);
-
- loginForm.find('#login').simulate('submit');
- expect(stub.calledOnce).toBeTruthy();
-
- // confirm Actions.login() received the values that weren't in the DOM
- expect(stub.args[0][0]).toBe(username);
- expect(stub.args[0][1]).toBe(password);
- });
-
- });
-
- describe('ChangePasswordForm', () => {
-
- it('should update state on password change', () => {
- const changePasswordForm = mount(<ChangePasswordForm />);
- changePasswordForm.find('#password').simulate('change', { target: { value: 'bobsyouruncle' }});
- expect(changePasswordForm.state('password')).toEqual('bobsyouruncle');
- });
-
- it('should update state on password confirm change', () => {
- const changePasswordForm = mount(<ChangePasswordForm />);
- changePasswordForm.find('#password-confirm').simulate('change', { target: { value: 'hotdiggity' }});
- expect(changePasswordForm.state('passwordConfirm')).toEqual('hotdiggity');
- });
-
- it('should call action to submit form', () => {
- const spy = sinon.spy();
- const changePasswordForm = mount(<ChangePasswordForm username={"bobsyouruncle"} changePassword={spy} />);
- changePasswordForm.find('#change-password').simulate('submit');
- expect(spy.calledOnce).toBeTruthy();
- });
- });
-
- describe('CreateAdminForm', () => {
- it('should update username state', () => {
- const createAdminForm = mount(<CreateAdminForm loginAfter={false} />);
- createAdminForm.find('#username').simulate('change', { target: { value: 'catsmeow' }});
- expect(createAdminForm.state('username')).toEqual('catsmeow');
- });
-
- it('should call action to update password confirm on field change', () => {
- const createAdminForm = mount(<CreateAdminForm loginAfter={false} />);
- createAdminForm.find('#password').simulate('change', { target: { value: 'topnotch' }});
- expect(createAdminForm.state('password')).toEqual('topnotch');
- });
- });
-});
diff --git a/app/addons/auth/actions.js b/app/addons/auth/actions.js
deleted file mode 100644
index 1e094c9..0000000
--- a/app/addons/auth/actions.js
+++ /dev/null
@@ -1,143 +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.
-import FauxtonAPI from "../../core/api";
-import app from "../../app";
-import ActionTypes from './actiontypes';
-import Api from './api';
-
-const {
- AUTH_HIDE_PASSWORD_MODAL,
-} = ActionTypes;
-
-const errorHandler = ({ message }) => {
- FauxtonAPI.addNotification({
- msg: message,
- type: "error"
- });
-};
-
-const validate = (...predicates) => {
- return predicates.every(isTrue => isTrue);
-};
-
-export const validateUser = (username, password) => {
- return validate(!_.isEmpty(username), !_.isEmpty(password));
-};
-
-export const validatePasswords = (password, passwordConfirm) => {
- return validate(
- !_.isEmpty(password),
- !_.isEmpty(passwordConfirm),
- password === passwordConfirm
- );
-};
-
-export const login = (username, password, urlBack) => {
- if (!validateUser(username, password)) {
- return errorHandler({message: app.i18n.en_US['auth-missing-credentials']});
- }
-
- return Api.login({name: username, password})
- .then(resp => {
- if (resp.error) {
- errorHandler({message: resp.reason});
- return resp;
- }
-
- let msg = app.i18n.en_US['auth-logged-in'];
- if (msg) {
- FauxtonAPI.addNotification({msg});
- }
-
- if (urlBack && !urlBack.includes("login")) {
- return FauxtonAPI.navigate(urlBack);
- }
- FauxtonAPI.navigate("/");
- })
- .catch(errorHandler);
-};
-
-export const changePassword = (username, password, passwordConfirm, nodes) => () => {
- if (!validatePasswords(password, passwordConfirm)) {
- return errorHandler({message: app.i18n.en_US['auth-passwords-not-matching']});
- }
- //To change an admin's password is the same as creating an admin. So we just use the
- //same api function call here.
- Api.createAdmin({
- name: username,
- password,
- node: nodes[0].node
- }).then(
- () => {
- FauxtonAPI.addNotification({
- msg: app.i18n.en_US["auth-change-password"]
- });
- },
- errorHandler
- );
-};
-
-export const createAdmin = (username, password, loginAfter, nodes) => () => {
- const node = nodes[0].node;
- if (!validateUser(username, password)) {
- return errorHandler({message: app.i18n.en_US['auth-missing-credentials']});
- }
-
- Api.createAdmin({name: username, password, node})
- .then(resp => {
- if (resp.error) {
- return errorHandler({message: `${app.i18n.en_US['auth-admin-creation-failed-prefix']} ${resp.reason}`});
- }
-
- FauxtonAPI.addNotification({
- msg: app.i18n.en_US['auth-admin-created']
- });
-
- if (loginAfter) {
- return FauxtonAPI.navigate("/login");
- }
- });
-};
-
-// simple authentication method - does nothing other than check creds
-export const authenticate = (username, password, onSuccess) => {
- Api.login({
- name: username,
- password: password
- })
- .then((resp) => {
- if (resp.error) {
- throw (resp);
- }
- hidePasswordModal();
- onSuccess(username, password);
- })
- .catch(() => {
- FauxtonAPI.addNotification({
- msg: "Your username or password is incorrect.",
- type: "error",
- clear: true
- });
- });
-};
-
-export const hidePasswordModal = () => {
- FauxtonAPI.dispatch({ type: AUTH_HIDE_PASSWORD_MODAL });
-};
-
-export const logout = () => {
- FauxtonAPI.addNotification({ msg: "You have been logged out." });
- Api.logout()
- .then(Api.getSession)
- .then(() => FauxtonAPI.navigate('/'))
- .catch(errorHandler);
-};
diff --git a/app/addons/auth/actiontypes.js b/app/addons/auth/actiontypes.js
deleted file mode 100644
index 4ab3e5b..0000000
--- a/app/addons/auth/actiontypes.js
+++ /dev/null
@@ -1,18 +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.
-
-export default {
- AUTH_CREDS_VALID: 'AUTH_CREDS_VALID',
- AUTH_CREDS_INVALID: 'AUTH_CREDS_INVALID',
- AUTH_SHOW_PASSWORD_MODAL: 'AUTH_SHOW_PASSWORD_MODAL',
- AUTH_HIDE_PASSWORD_MODAL: 'AUTH_HIDE_PASSWORD_MODAL'
-};
diff --git a/app/addons/auth/api.js b/app/addons/auth/api.js
deleted file mode 100644
index a281675..0000000
--- a/app/addons/auth/api.js
+++ /dev/null
@@ -1,57 +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.
-
-import app from './../../app';
-import Helpers from "../../helpers";
-import {deleteFormEncoded, get, postFormEncoded, put} from '../../core/ajax';
-
-
-export function createAdmin({name, password, node}) {
- const url = Helpers.getServerUrl(`/_node/${node}/_config/admins/${name}`);
- return put(url, password);
-}
-
-let loggedInSessionPromise;
-
-export function getSession() {
- if (loggedInSessionPromise) {
- return loggedInSessionPromise;
- }
-
- const url = Helpers.getServerUrl('/_session');
- const promise = get(url).then(resp => {
- if (resp.userCtx.name) {
- loggedInSessionPromise = promise;
- }
- return resp.userCtx;
- });
-
- return promise;
-}
-
-export function login(body) {
- const url = Helpers.getServerUrl('/_session');
- return postFormEncoded(url, app.utils.queryParams(body));
-}
-
-export function logout() {
- loggedInSessionPromise = null;
- const url = Helpers.getServerUrl('/_session');
- return deleteFormEncoded(url, app.utils.queryParams({ username: "_", password: "_" }));
-}
-
-export default {
- createAdmin,
- login,
- logout,
- getSession
-};
diff --git a/app/addons/auth/assets/less/auth.less b/app/addons/auth/assets/less/auth.less
deleted file mode 100644
index bf6ddcc..0000000
--- a/app/addons/auth/assets/less/auth.less
+++ /dev/null
@@ -1,27 +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.
-
-@import "../../../../../assets/less/variables.less";
-
-.sidenav header {
- padding-left: 24px !important;
- h3 {
- margin: 8px 0 4px;
- }
-}
-
-.faux__auth-page {
- padding: 20px !important;
- h3 {
- margin-top: 0;
- }
-}
diff --git a/app/addons/auth/base.js b/app/addons/auth/base.js
deleted file mode 100644
index 0fce5f8..0000000
--- a/app/addons/auth/base.js
+++ /dev/null
@@ -1,70 +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.
-
-import FauxtonAPI from "../../core/api";
-import RouteObjects from './routes';
-import "./assets/less/auth.less";
-import Session from './session';
-
-const cleanupAuthSection = () => {
- FauxtonAPI.removeHeaderLink({ id: 'auth', bottomNav: true });
-};
-
-FauxtonAPI.setSession(new Session({allowAdminParty: true}));
-
-export default ({
- initialize: () => {
- FauxtonAPI.addHeaderLink({
- id: 'auth',
- title: 'Login',
- href: '#/login',
- icon: 'fonticon-user',
- bottomNav: true
- });
-
- FauxtonAPI.session.onChange(() => {
- const session = FauxtonAPI.session;
- let link;
-
- if (session.isAdminParty()) {
- link = {
- id: 'auth',
- title: 'Admin Party!',
- href: '#/createAdmin',
- icon: 'fonticon-user',
- bottomNav: true
- };
-
- cleanupAuthSection();
- FauxtonAPI.addHeaderLink(link);
- FauxtonAPI.hideLogin();
-
- } else if (session.isLoggedIn()) {
- link = {
- id: 'auth',
- title: 'Your Account',
- href: '#/changePassword',
- icon: 'fonticon-user',
- bottomNav: true
- };
-
- cleanupAuthSection();
- FauxtonAPI.addHeaderLink(link);
- FauxtonAPI.showLogout();
- } else {
- cleanupAuthSection();
- FauxtonAPI.showLogin();
- }
- });
- },
- RouteObjects
-});
diff --git a/app/addons/auth/components/changepasswordform.js b/app/addons/auth/components/changepasswordform.js
deleted file mode 100644
index 14943d7..0000000
--- a/app/addons/auth/components/changepasswordform.js
+++ /dev/null
@@ -1,100 +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.
-
-import React from "react";
-import ReactDOM from "react-dom";
-import FauxtonAPI from '../../../core/api';
-import {
- changePassword
-} from "./../actions";
-
-import {connect} from 'react-redux';
-
-export class ChangePasswordForm extends React.Component {
-
- constructor(props) {
- super(props);
- this.state = {
- password: '',
- passwordConfirm: ''
- };
- }
-
- onChangePassword(e) {
- this.setState({password: e.target.value});
- }
-
- onChangePasswordConfirm(e) {
- this.setState({passwordConfirm: e.target.value});
- }
-
- componentDidMount() {
- this.passwordField.focus();
- }
-
- changePassword(e) {
- e.preventDefault();
- this.props.changePassword(this.props.username, this.state.password, this.state.passwordConfirm, this.props.nodes);
- }
-
- render() {
- return (
- <div className="faux__auth-page">
- <h3>Change Password</h3>
-
- <form id="change-password" onSubmit={this.changePassword.bind(this)}>
- <p>
- Enter your new password.
- </p>
-
- <input
- id="password"
- type="password"
- ref={node => this.passwordField = node}
- name="password"
- placeholder="Password"
- size="24"
- onChange={this.onChangePassword.bind(this)}
- value={this.state.password}
- />
- <br />
- <input
- id="password-confirm"
- type="password"
- name="password_confirm"
- placeholder="Verify Password"
- size="24"
- onChange={this.onChangePasswordConfirm.bind(this)}
- value={this.state.passwordConfirm}
- />
-
- <br />
- <p>
- <button type="submit" className="btn btn-primary">Change</button>
- </p>
- </form>
- </div>
- );
- }
-}
-
-const mapStateToProps = ({clusters}) => {
- return {
- nodes: clusters.nodes,
- username: FauxtonAPI.session.user().name
- };
-};
-
-export default connect(
- mapStateToProps,
- {changePassword}
-)(ChangePasswordForm);
diff --git a/app/addons/auth/components/createadminform.js b/app/addons/auth/components/createadminform.js
deleted file mode 100644
index 333b419..0000000
--- a/app/addons/auth/components/createadminform.js
+++ /dev/null
@@ -1,124 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import {
- createAdmin
-} from "./../actions";
-import {connect} from 'react-redux';
-
-export class CreateAdminForm extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- username: '',
- password: ''
- };
- }
-
- onChangeUsername(e) {
- this.setState({username: e.target.value});
- }
-
- onChangePassword(e) {
- this.setState({password: e.target.value});
- }
-
- componentDidMount() {
- this.usernameField.focus();
- }
-
- createAdmin(e) {
- e.preventDefault();
- this.props.createAdmin(
- this.state.username,
- this.state.password,
- this.props.loginAfter,
- this.props.nodes
- );
- }
-
- render() {
- return (
- <div className="faux__auth-page">
- <h3>Create Admins</h3>
-
- <p>
- Before a server admin is configured, all clients have admin privileges. This is fine when
-
- HTTP access is restricted to trusted users. <strong>
- If end-users will be accessing this
- CouchDB, you must create an admin account to prevent accidental (or malicious) data
-
- loss.
- </strong>
- </p>
- <p>
- Server admins can create and destroy databases, install and update _design documents, run
-
- the test suite, and edit all aspects of CouchDB configuration.
- </p>
-
- <form id="create-admin-form" onSubmit={this.createAdmin.bind(this)}>
- <input
- id="username"
- type="text"
- ref={node => this.usernameField = node}
- name="name"
- placeholder="Username"
- size="24"
- onChange={this.onChangeUsername.bind(this)}
- />
- <br />
- <input
- id="password"
- type="password"
- name="password"
- placeholder="Password"
- size="24"
- onChange={this.onChangePassword.bind(this)}
- />
- <p>
- Non-admin users have read and write access to all databases, which
- are controlled by validation. CouchDB can be configured to block all
- access to anonymous users.
- </p>
- <button type="submit" id="create-admin" className="btn btn-primary">
- Create Admin
- </button>
- </form>
- </div>
- );
- }
-}
-
-CreateAdminForm.propTypes = {
- loginAfter: PropTypes.bool.isRequired
-};
-
-CreateAdminForm.defaultProps = {
- loginAfter: false
-};
-
-const mapStateToProps = ({clusters}) => {
- return {
- nodes: clusters.nodes
- };
-};
-
-
-export default connect(
- mapStateToProps,
- {createAdmin}
-)(CreateAdminForm);
diff --git a/app/addons/auth/components/index.js b/app/addons/auth/components/index.js
deleted file mode 100644
index 2c38e5a..0000000
--- a/app/addons/auth/components/index.js
+++ /dev/null
@@ -1,23 +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.
-
-import LoginForm from './loginform.js';
-import PasswordModal from './passwordmodal.js';
-import CreateAdminForm from './createadminform.js';
-import ChangePasswordForm from './changepasswordform.js';
-
-export default {
- LoginForm,
- PasswordModal,
- CreateAdminForm,
- ChangePasswordForm
-};
diff --git a/app/addons/auth/components/loginform.js b/app/addons/auth/components/loginform.js
deleted file mode 100644
index b961c93..0000000
--- a/app/addons/auth/components/loginform.js
+++ /dev/null
@@ -1,113 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-import { login } from "./../actions";
-
-class LoginForm extends React.Component {
- constructor() {
- super();
- this.state = {
- username: "",
- password: ""
- };
- }
- onUsernameChange(e) {
- this.setState({username: e.target.value});
- }
- onPasswordChange(e) {
- this.setState({password: e.target.value});
- }
-
- submit(e) {
- e.preventDefault();
- if (!this.checkUnrecognizedAutoFill()) {
- this.login(this.state.username, this.state.password);
- }
- }
- // Safari has a bug where autofill doesn't trigger a change event. This checks for the condition where the state
- // and form fields have a mismatch. See: https://issues.apache.org/jira/browse/COUCHDB-2829
- checkUnrecognizedAutoFill() {
- if (this.state.username !== "" || this.state.password !== "") {
- return false;
- }
- let username = this.props.testBlankUsername
- ? this.props.testBlankUsername
- : this.usernameField.value;
- let password = this.props.testBlankPassword
- ? this.props.testBlankPassword
- : this.passwordField.value;
- this.setState({ username: username, password: password }); // doesn't set immediately, hence separate login() call
- this.login(username, password);
-
- return true;
- }
- login(username, password) {
- login(username, password, this.props.urlBack);
- }
- componentDidMount() {
- this.usernameField.focus();
- }
- render() {
- return (
- <div className="couch-login-wrapper">
- <div className="row-fluid">
- <div className="span12">
- <form id="login" onSubmit={this.submit.bind(this)}>
- <p className="help-block">
- Enter your username and password.
- </p>
- <input
- id="username"
- type="text"
- name="username"
- ref={node => this.usernameField = node}
- placeholder="Username"
- size="24"
- onChange={this.onUsernameChange.bind(this)}
- value={this.state.username}
- />
- <br />
- <input
- id="password"
- type="password"
- name="password"
- ref={node => this.passwordField = node}
- placeholder="Password"
- size="24"
- onChange={this.onPasswordChange.bind(this)}
- value={this.state.password}
- />
- <br />
- <button id="submit" className="btn btn-success" type="submit">
- Log In
- </button>
- </form>
- </div>
- </div>
- </div>
- );
- }
-}
-
-LoginForm.defaultProps = {
- urlBack: ""
-};
-
-LoginForm.propTypes = {
- urlBack: PropTypes.string.isRequired
-};
-
-export default LoginForm;
diff --git a/app/addons/auth/components/passwordmodal.js b/app/addons/auth/components/passwordmodal.js
deleted file mode 100644
index b652c66..0000000
--- a/app/addons/auth/components/passwordmodal.js
+++ /dev/null
@@ -1,109 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import { Modal } from "react-bootstrap";
-import { hidePasswordModal, authenticate } from "./../actions";
-import Components from "../../components/react-components";
-import FauxtonAPI from "../../../core/api";
-
-class PasswordModal extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- password: ""
- };
- this.authenticate = this.authenticate.bind(this);
- this.onKeyPress = this.onKeyPress.bind(this);
- }
-
- // clicking <Enter> should submit the form
- onKeyPress(e) {
- if (e.key === "Enter") {
- this.authenticate();
- }
- }
- // default authentication function. This can be overridden via props if you want to do something different
- authenticate() {
- const username = FauxtonAPI.session.user().name;
- this.props.onSubmit(username, this.state.password, this.props.onSuccess);
- }
- render() {
- const {
- visible,
- onClose,
- submitBtnLabel,
- headerTitle,
- modalMessage
- } = this.props;
- if (!this.props.visible) {
- return null;
- }
-
- return (
- <Modal
- dialogClassName="enter-password-modal"
- show={visible}
- onHide={() => onClose()}
- >
- <Modal.Header closeButton={true}>
- <Modal.Title>{headerTitle}</Modal.Title>
- </Modal.Header>
- <Modal.Body>
- {modalMessage}
- <input
- style={{ width: "385px" }}
- type="password"
- className="password-modal-input"
- placeholder="Enter your password"
- autoFocus={true}
- value={this.state.password}
- onChange={e => this.setState({ password: e.target.value })}
- onKeyPress={this.onKeyPress}
- />
- </Modal.Body>
- <Modal.Footer>
- <a className="cancel-link" onClick={() => onClose()}>Cancel</a>
- <Components.ConfirmButton
- text={submitBtnLabel}
- onClick={this.authenticate}
- />
- </Modal.Footer>
- </Modal>
- );
- }
-}
-
-PasswordModal.propTypes = {
- visible: PropTypes.bool.isRequired,
- modalMessage: PropTypes.oneOfType([
- PropTypes.string,
- PropTypes.element
- ]),
- onSubmit: PropTypes.func.isRequired,
- onClose: PropTypes.func.isRequired,
- submitBtnLabel: PropTypes.string
-};
-
-PasswordModal.defaultProps = {
- headerTitle: "Enter Password",
- visible: false,
- modalMessage: "",
- onClose: hidePasswordModal,
- onSubmit: authenticate,
- onSuccess: () => {},
- submitBtnLabel: "Continue"
-};
-
-export default PasswordModal;
diff --git a/app/addons/auth/layout.js b/app/addons/auth/layout.js
deleted file mode 100644
index 54b59ef..0000000
--- a/app/addons/auth/layout.js
+++ /dev/null
@@ -1,93 +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.
-
-import React from 'react';
-import {OnePane, OnePaneContent} from '../components/layouts';
-import {Breadcrumbs} from '../components/header-breadcrumbs';
-import Components from "./components";
-import {TabElementWrapper, TabElement} from '../components/components/tabelement';
-import FauxtonAPI from "../../core/api";
-
-const {
- CreateAdminForm,
- ChangePasswordForm
-} = Components;
-
-export const OnePaneHeader = ({crumbs}) => {
- return (
- <header>
- <div className='flex-layout flex-row'>
- <div id='breadcrumbs' className='flex-body'>
- <Breadcrumbs crumbs={crumbs}/>
- </div>
- </div>
- </header>
- );
-};
-
-export const AuthLayout = ({crumbs, component}) => {
- return (
- <OnePane>
- <OnePaneHeader
- crumbs={crumbs}
- >
- </OnePaneHeader>
- <OnePaneContent>
- {component}
- </OnePaneContent>
- </OnePane>
- );
-};
-
-const Tabs = ({changePassword}) => {
- return (
- <TabElementWrapper>
- <TabElement
- key={1}
- selected={changePassword}
- text={"Change Password"}
- onChange={() => {
- FauxtonAPI.navigate('#changePassword');
- }}
- />
- <TabElement
- key={2}
- selected={!changePassword}
- text={"Create Server Admin"}
- onChange={() => {
- FauxtonAPI.navigate('#addAdmin');
- }}
- />
- </TabElementWrapper>
- );
-};
-
-export const AdminLayout = ({crumbs, changePassword}) => {
- let content = changePassword ? <ChangePasswordForm /> : <CreateAdminForm loginAfter={false} />;
- return (
- <OnePane>
- <OnePaneHeader crumbs={crumbs}/>
- <OnePaneContent>
- <div className="template-content flex-body flex-layout flex-col">
- <Tabs changePassword={changePassword} />
- <div id="dashboard-conten1t" className="flex-layout flex-col">
- {content}
- </div>
- </div>
- </OnePaneContent>
- </OnePane>
-
- );
-
-};
-
-export default AuthLayout;
diff --git a/app/addons/auth/routes/auth.js b/app/addons/auth/routes/auth.js
deleted file mode 100644
index d274c08..0000000
--- a/app/addons/auth/routes/auth.js
+++ /dev/null
@@ -1,60 +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.
-
-import React from "react";
-import FauxtonAPI from "../../../core/api";
-import ClusterActions from "../../cluster/actions";
-import { AuthLayout } from "./../layout";
-import app from "../../../app";
-import Components from "./../components";
-import {logout} from '../actions';
-
-const {
- LoginForm,
- CreateAdminForm
-} = Components;
-
-const crumbs = [{ name: "Log In to CouchDB" }];
-
-export default FauxtonAPI.RouteObject.extend({
- routes: {
- "login?*extra": "login",
- "login": "login",
- "logout": "logout",
- "createAdmin": "checkNodes",
- "createAdmin/:node": "createAdminForNode"
- },
- checkNodes() {
- ClusterActions.navigateToNodeBasedOnNodeCount("/createAdmin/");
- },
- login() {
- return (
- <AuthLayout
- crumbs={crumbs}
- component={<LoginForm urlBack={app.getParams().urlback} />}
- />
- );
- },
- logout() {
- logout();
- },
- createAdminForNode() {
- ClusterActions.fetchNodes();
- const crumbs = [{ name: "Create Admin" }];
- return (
- <AuthLayout
- crumbs={crumbs}
- component={<CreateAdminForm loginAfter={true} />}
- />
- );
- }
-});
diff --git a/app/addons/auth/routes/index.js b/app/addons/auth/routes/index.js
deleted file mode 100644
index da37e64..0000000
--- a/app/addons/auth/routes/index.js
+++ /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.
-
-import Auth from './auth';
-import User from './user';
-
-export default [Auth, User];
diff --git a/app/addons/auth/routes/user.js b/app/addons/auth/routes/user.js
deleted file mode 100644
index 36a8f53..0000000
--- a/app/addons/auth/routes/user.js
+++ /dev/null
@@ -1,68 +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.
-
-import React from "react";
-import FauxtonAPI from "../../../core/api";
-import ClusterActions from "../../cluster/actions";
-import { AdminLayout } from "./../layout";
-
-export default FauxtonAPI.RouteObject.extend({
- hideNotificationCenter: true,
- hideApiBar: true,
- selectedHeader: 'Your Account',
-
- routes: {
- changePassword: {
- route: "checkNodesForPasswordChange",
- roles: ["fx_loggedIn"]
- },
- "changePassword/:node": {
- route: "changePassword",
- roles: ["fx_loggedIn"]
- },
- addAdmin: {
- route: "checkNodesForAddAdmin",
- roles: ["_admin"]
- },
- "addAdmin/:node": {
- route: "addAdmin",
- roles: ["_admin"]
- }
- },
-
- checkNodesForPasswordChange() {
- ClusterActions.navigateToNodeBasedOnNodeCount("/changePassword/");
- },
-
- checkNodesForAddAdmin() {
- ClusterActions.navigateToNodeBasedOnNodeCount("/addAdmin/");
- },
-
- changePassword() {
- ClusterActions.fetchNodes();
- return (
- <AdminLayout
- crumbs={[{ name: "User Management" }]}
- changePassword={true}
- />
- );
- },
- addAdmin() {
- ClusterActions.fetchNodes();
- return (
- <AdminLayout
- crumbs={[{ name: "User Management" }]}
- changePassword={false}
- />
- );
- }
-});
diff --git a/app/addons/auth/session.js b/app/addons/auth/session.js
deleted file mode 100644
index 20e72fc..0000000
--- a/app/addons/auth/session.js
+++ /dev/null
@@ -1,110 +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.
-
-import { uniqueId, each, includes } from "lodash";
-import Api from './api';
-import Promise from 'bluebird';
-
-function isAdmin(roles = []) {
- return includes(roles, "_admin");
-}
-
-export default class {
-
- constructor(opts) {
- this._user = {
- name: false,
- roles: []
- };
- this._onChange = {};
- this._authenticatedPromise = new Promise((resolve, reject) => {
- this._authenticateResolve = resolve;
- this._authenticateReject = reject;
- });
-
- this._allowAdminParty = opts.allowAdminParty;
- }
-
- isAuthenticated () {
- return this._authenticatedPromise;
- }
-
- setUser(user) {
- if (this._user.name !== user.name) {
- this._user = {
- name: user.name,
- roles: user.roles,
- isAdmin: isAdmin(user.roles)
- };
- each(this._onChange, fn => fn(this._user));
- }
- return this._user;
- }
-
- user() {
- return this._user;
- }
-
- getSession() {
- return Api.getSession()
- .then(userCtx => {
- this.setUser(userCtx);
- if (this.isLoggedIn()) {
- this._authenticateResolve(this.user());
- }
- })
- .catch(err => {
- this._authenticateReject(err);
- });
- }
-
- isAdminParty() {
- if (!this._allowAdminParty) {
- return false;
- }
-
- return !this._user.name && this._user.isAdmin;
- }
-
- isLoggedIn() {
- return !_.isNull(this._user.name);
- }
-
- userRoles() {
- const user = this._user;
-
- if (this.isLoggedIn()) {
- if (user.roles.indexOf("fx_loggedIn") === -1) {
- user.roles.push("fx_loggedIn");
- }
- return user.roles;
- }
- return [];
- }
-
- onChange(fn) {
- let uuid = uniqueId();
- this._onChange[uuid] = fn;
- return () => {
- delete this._onChange[uuid];
- };
- }
-
- matchesRoles(roles = []) {
- if (roles.length === 0) {
- return true;
- }
-
- const numberMatchingRoles = _.intersection(this.userRoles(), roles).length;
- return numberMatchingRoles > 0;
- }
-}
diff --git a/app/addons/cluster/__tests__/cluster.test.js b/app/addons/cluster/__tests__/cluster.test.js
deleted file mode 100644
index c9012bf..0000000
--- a/app/addons/cluster/__tests__/cluster.test.js
+++ /dev/null
@@ -1,42 +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.
-import FauxtonAPI from "../../../core/api";
-import {DisabledConfigController} from "../cluster";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from 'sinon';
-
-
-describe('Cluster Controller', () => {
- let controller;
-
- beforeEach(() => {
- FauxtonAPI.reduxDispatch = sinon.stub();
-
- var nodeList = [
- {'node': 'node1@127.0.0.1', 'isInCluster': true},
- {'node': 'node2@127.0.0.1', 'isInCluster': true},
- {'node': 'node3@127.0.0.1', 'isInCluster': false},
- {'node': 'node3@127.0.0.1', 'isInCluster': false},
- {'node': 'node3@127.0.0.1', 'isInCluster': false},
- {'node': 'node3@127.0.0.1', 'isInCluster': false}
- ];
-
- controller = mount(
- <DisabledConfigController nodes={nodeList} />
- );
- });
-
- it('renders the amount of nodes', () => {
- expect(controller.text()).toMatch(/6 nodes/);
- });
-});
diff --git a/app/addons/cluster/actions.js b/app/addons/cluster/actions.js
deleted file mode 100644
index 60ec0c9..0000000
--- a/app/addons/cluster/actions.js
+++ /dev/null
@@ -1,58 +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.
-
-import FauxtonAPI from "../../core/api";
-import getNodes from "./api";
-import ActionTypes from "./actiontypes";
-
-export default {
- fetchNodes () {
- getNodes().then((nodes) => {
- this.updateNodes({
- nodes: nodes.nodes_mapped
- });
- })
- .catch(err => {
- FauxtonAPI.addNotification({
- type: 'error',
- msg: err.message,
- clear: true
- });
- });
- },
-
- updateNodes (options) {
- FauxtonAPI.reduxDispatch({
- type: ActionTypes.CLUSTER_FETCH_NODES,
- options: options
- });
- },
-
- navigateToNodeBasedOnNodeCount (successtarget) {
- getNodes().then((nodes) => {
- const allNodes = nodes.all_nodes;
-
- if (allNodes.length === 1) {
- return FauxtonAPI.navigate(successtarget + allNodes[0]);
- }
- return FauxtonAPI.navigate('/cluster/disabled', {trigger: true});
- })
- .catch(err => {
- FauxtonAPI.addNotification({
- type: 'error',
- msg: err.message,
- clear: true
- });
- });
- }
-
-};
diff --git a/app/addons/cluster/actiontypes.js b/app/addons/cluster/actiontypes.js
deleted file mode 100644
index 525e7f6..0000000
--- a/app/addons/cluster/actiontypes.js
+++ /dev/null
@@ -1,15 +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.
-
-export default {
- CLUSTER_FETCH_NODES: 'CLUSTER_FETCH_NODES'
-};
diff --git a/app/addons/cluster/api.js b/app/addons/cluster/api.js
deleted file mode 100644
index a6c05a1..0000000
--- a/app/addons/cluster/api.js
+++ /dev/null
@@ -1,34 +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.
-
-import Helpers from "../../helpers";
-import {get} from '../../core/ajax';
-
-export default () => {
- return get(Helpers.getServerUrl('/_membership'))
- .then(res => {
- if (!res.all_nodes) {
- const details = res.reason ? res.reason : '';
- throw new Error('Failed to load list of nodes.' + details);
- }
-
- const list = res.all_nodes.reduce(function (acc, node) {
- var isInCluster = res.cluster_nodes.indexOf(node) !== -1;
-
- acc.push({node: node, isInCluster: isInCluster});
- return acc;
- }, []);
-
- res.nodes_mapped = list;
- return res;
- });
-};
diff --git a/app/addons/cluster/base.js b/app/addons/cluster/base.js
deleted file mode 100644
index d61ca99..0000000
--- a/app/addons/cluster/base.js
+++ /dev/null
@@ -1,23 +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.
-
-import Cluster from "./routes";
-import FauxtonAPI from "../../core/api";
-import reducers from './reducers';
-
-Cluster.initialize = function () {};
-
-FauxtonAPI.addReducers({
- clusters: reducers
-});
-
-export default Cluster;
diff --git a/app/addons/cluster/cluster.js b/app/addons/cluster/cluster.js
deleted file mode 100644
index 7a4d1a3..0000000
--- a/app/addons/cluster/cluster.js
+++ /dev/null
@@ -1,50 +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.
-
-import React from "react";
-import {connect} from 'react-redux';
-
-export class DisabledConfigController extends React.Component {
- render() {
- return (
- <div className="config-warning-cluster-wrapper">
- <div className="config-warning-cluster-container">
- <div>
- <div className="config-warning-icon-container pull-left">
- <i className="fonticon-attention-circled"></i>
- </div>
- It seems that you are running a cluster with {this.props.nodes.length} nodes. For CouchDB 2.0
- or greater we recommend using a configuration management tools like Chef, Ansible,
- Puppet or Salt (in no particular order) to configure your nodes in a cluster.
- <br/>
- <br/>
- <div className="config-warning-other-text">
- We highly recommend against configuring nodes in your cluster using the HTTP API and
- suggest using a configuration management tool for all configurations.
- </div>
- </div>
- </div>
- </div>
- );
- }
-}
-
-const mapStateToProps = ({clusters}) => {
- return {
- nodes: clusters.nodes
- };
-};
-
-export default connect(
- mapStateToProps,
- null,
-)(DisabledConfigController);
diff --git a/app/addons/cluster/reducers.js b/app/addons/cluster/reducers.js
deleted file mode 100644
index 8a48c7a..0000000
--- a/app/addons/cluster/reducers.js
+++ /dev/null
@@ -1,29 +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.
-
-import ActionTypes from "./actiontypes";
-
-const initialState = {
- nodes: []
-};
-
-export default (state = initialState, {type, options}) => {
- switch (type) {
- case ActionTypes.CLUSTER_FETCH_NODES:
- return {
- ...state,
- nodes: options.nodes
- };
- }
-
- return state;
-};
diff --git a/app/addons/cluster/routes.js b/app/addons/cluster/routes.js
deleted file mode 100644
index 37ed665..0000000
--- a/app/addons/cluster/routes.js
+++ /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.
-
-import React from 'react';
-import FauxtonAPI from "../../core/api";
-import Helpers from "../../helpers";
-import DisabledConfigController from "./cluster";
-import ClusterActions from "./actions";
-import {OnePaneSimpleLayout} from '../components/layouts';
-
-
-var ConfigDisabledRouteObject = FauxtonAPI.RouteObject.extend({
- selectedHeader: 'Configuration',
-
- routes: {
- 'cluster/disabled': 'showDisabledFeatureScreen'
- },
-
- showDisabledFeatureScreen: function () {
- ClusterActions.fetchNodes();
- return <OnePaneSimpleLayout
- component={<DisabledConfigController/>}
- endpoint={Helpers.getServerUrl('/_membership')}
- docURL={FauxtonAPI.constants.DOC_URLS.MEMBERSHIP}
- crumbs={[
- { name: 'Config disabled' }
- ]}
- />;
- }
-});
-
-export default {
- RouteObjects: [ConfigDisabledRouteObject]
-};
diff --git a/app/addons/components/README.md b/app/addons/components/README.md
deleted file mode 100644
index 01bf4b5..0000000
--- a/app/addons/components/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Components
-
-small building blocks for Fauxton built using React
diff --git a/app/addons/components/__tests__/accordion.test.js b/app/addons/components/__tests__/accordion.test.js
deleted file mode 100644
index 40eb602..0000000
--- a/app/addons/components/__tests__/accordion.test.js
+++ /dev/null
@@ -1,48 +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.
-
-import { Accordion, AccordionItem } from '../components/accordion';
-import { mount } from 'enzyme';
-import React from 'react';
-import sinon from 'sinon';
-
-describe('Accordion', () => {
-
- it('Shows and hides content after clicking on header', () => {
- const el = mount(
- <Accordion>
- <AccordionItem title={'Click to open'}>
- <p id="test_content">Have a great day</p>
- </AccordionItem>
- </Accordion>
- );
-
- expect(el.find('.faux--accordion__item-content').hasClass('in')).toBe(false);
- el.find('.faux--accordion__item-header').simulate('click');
- expect(el.find('.faux--accordion__item-content').hasClass('in')).toBe(true);
- });
-
- it('Calls onClick event', () => {
- const spy = sinon.spy();
- const el = mount(
- <Accordion>
- <AccordionItem title={'Click to open'} onClick={spy}>
- <p id="test_content">Have a great day</p>
- </AccordionItem>
- </Accordion>
- );
-
- el.find('.faux--accordion__item-header').simulate('click');
- sinon.assert.called(spy);
- });
-
-});
diff --git a/app/addons/components/__tests__/apilinks.test.js b/app/addons/components/__tests__/apilinks.test.js
deleted file mode 100644
index 75dfe15..0000000
--- a/app/addons/components/__tests__/apilinks.test.js
+++ /dev/null
@@ -1,37 +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.
-import { JSONLink, DocLink } from "../components/apibar";
-import { mount } from "enzyme";
-import React from "react";
-import ReactDOM from "react-dom";
-
-describe('JSONLink', () => {
-
- it('Should render with url', () => {
- const url = "http://couchdb.com/_all_dbs";
- const el = mount(<JSONLink endpoint={url}/>);
-
- expect(el.find('a').prop('href')).toEqual(url);
- });
-
-});
-
-describe('DocLink', () => {
-
- it('Should render with url', () => {
- const url = "http://couchdb.com/help/_all_dbs";
- const el = mount(<DocLink docURL={url}/>);
-
- expect(el.find('a').prop('href')).toEqual(url);
- });
-
-});
diff --git a/app/addons/components/__tests__/badges.test.js b/app/addons/components/__tests__/badges.test.js
deleted file mode 100644
index 5cb84cc..0000000
--- a/app/addons/components/__tests__/badges.test.js
+++ /dev/null
@@ -1,34 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-
-describe('Badges', () => {
- it('renders a list of badges', () => {
- const el = mount(
- <ReactComponents.BadgeList elements={['foo', 'bar']} removeBadge={() => {}} />
- );
-
- expect(el.find('.component-badge').length).toBe(2);
- });
-
- it('supports custom label formatters', () => {
- const el = mount(
- <ReactComponents.BadgeList elements={['foo', 'bar']} removeBadge={() => {}} getLabel={(el) => { return el + 'foo'; }} />
- );
-
- expect(el.find('.component-badge').first().text()).toBe('foofoo×');
- expect(el.find('.component-badge').last().text()).toBe('barfoo×');
- });
-
-});
diff --git a/app/addons/components/__tests__/beautify.test.js b/app/addons/components/__tests__/beautify.test.js
deleted file mode 100644
index faefe5f..0000000
--- a/app/addons/components/__tests__/beautify.test.js
+++ /dev/null
@@ -1,68 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-
-describe('Beautify', () => {
- let beautifyEl;
-
- it('should be empty for multi-lined code', () => {
- const correctCode = 'function() {\n console.log("hello");\n}';
- beautifyEl = mount(
- <ReactComponents.Beautify code={correctCode}/>
- );
- expect(beautifyEl.instance().render()).toBeNull();
- });
-
- it('should have button to beautify for single line code', () => {
- const badCode = '() => { console.log("hello"); }';
- beautifyEl = mount(<ReactComponents.Beautify code={badCode}/>);
- expect(beautifyEl.find('button').hasClass('beautify')).toBeTruthy();
- });
-
- it('on click beautifies code', () => {
- let fixedCode;
- const correctCode = 'function() {\n console.log("hello");\n}';
-
- const beautifiedCode = (code) => {
- fixedCode = code;
- };
-
- beautifyEl = mount(
- <ReactComponents.Beautify
- beautifiedCode={beautifiedCode}
- code={'function() { console.log("hello"); }'}
- noOfLines={1}/>
- );
- beautifyEl.simulate('click');
- expect(fixedCode).toBe(correctCode);
- });
-
- it('on click beautifies es6 code', () => {
- let fixedCode;
- const correctCode = '({\n type,\n code\n}) => type === \'WIDGET\' && emit(code, 1)';
-
- const beautifiedCode = (code) => {
- fixedCode = code;
- };
-
- beautifyEl = mount(
- <ReactComponents.Beautify
- beautifiedCode={beautifiedCode}
- code={'({type,code}) => type === \'WIDGET\' && emit(code,1)'}
- noOfLines={1}/>
- );
- beautifyEl.simulate('click');
- expect(fixedCode).toBe(correctCode);
- });
-});
diff --git a/app/addons/components/__tests__/codeEditor.test.js b/app/addons/components/__tests__/codeEditor.test.js
deleted file mode 100644
index a4990c6..0000000
--- a/app/addons/components/__tests__/codeEditor.test.js
+++ /dev/null
@@ -1,137 +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.
-
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-var code = 'function (doc) {\n emit(doc._id, 1);\n}';
-var code2 = 'function (doc) {\n if(doc._id) { \n emit(doc._id, 2); \n } \n}';
-
-var ignorableErrors = [
- 'Missing name in function declaration.',
- "['{a}'] is better written in dot notation."
-];
-
-describe('Code Editor', () => {
- let codeEditorEl, spy;
-
- beforeEach(() => {
- spy = sinon.spy();
-
- codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code} blur={spy} />
- );
- });
-
- describe('Tracking edits', () => {
- it('no change on mount', () => {
- expect(codeEditorEl.instance().hasChanged()).toBeFalsy();
- });
-
- it('detects change on user input', () => {
- codeEditorEl.instance().editor.setValue(code2, -1);
- expect(codeEditorEl.instance().hasChanged()).toBeTruthy();
- });
- });
-
- describe('onBlur', () => {
- it('calls blur function', () => {
- codeEditorEl.instance().editor._emit('blur');
- expect(spy.calledOnce).toBeTruthy();
- });
- });
-
- describe('setHeightToLineCount', () => {
- it('check default num lines #1', () => {
- codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code} setHeightToLineCount={true} />
- );
- codeEditorEl.update();
- expect(codeEditorEl.instance().editor.getSession().getDocument().getLength()).toBe(3);
- });
- it('check default num lines #2', () => {
- codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code2} setHeightToLineCount={true} />
- );
- expect(codeEditorEl.instance().editor.getSession().getDocument().getLength()).toBe(5);
- });
- // Skipping because the maxLines option is not working in the ACE editor
- it.skip('check maxLines', () => {
- codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code2} setHeightToLineCount={true} maxLines={2} />
- );
- expect(codeEditorEl.instance().editor.getSession().getDocument().getLength()).toBe(2);
- });
- });
-
- describe('removeIncorrectAnnotations', () => {
- beforeEach(() => {
- codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code} ignorableErrors={ignorableErrors} />
- );
- });
- it('removes default errors that do not apply to CouchDB Views', () => {
- expect(codeEditorEl.instance().getAnnotations()).toEqual([]);
- });
- });
-
- describe('getEditor', () => {
- beforeEach(() => {
- codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code} />
- );
- });
- it('returns a reference to get access to the editor', () => {
- expect(codeEditorEl.instance().getEditor()).toBeTruthy();
- });
- });
-
- describe('parseLineForStringMatch', () => {
- const initEditor = (code) => {
- const editor = mount(
- <ReactComponents.CodeEditor defaultCode={code} />
- );
- sinon.stub(editor.instance(), 'getSelectionStart').returns({row: 1});
- sinon.stub(editor.instance(), 'getSelectionEnd').returns({row: 1});
- sinon.stub(editor.instance(), 'isRowExpanded').returns(true);
- return editor;
- };
-
- it('returns matches on pretty formatted code', () => {
- const code = '{\n "field": "my string value" \n}';
- codeEditorEl = initEditor(code);
- const matches = codeEditorEl.instance().parseLineForStringMatch();
- expect('"my string value" ').toBe(matches[3]);
- });
- it('returns matches when line ends with comma', () => {
- const code = '{\n "field": "my string value", \n "field2": 123 \n}';
- codeEditorEl = initEditor(code);
- const matches = codeEditorEl.instance().parseLineForStringMatch();
- expect('"my string value", ').toBe(matches[3]);
- });
- it('returns matches on code with extra spaces', () => {
- const code = '{\n "field" \t : \t "my string value" \t , \t \n "field2": 123 \n}';
- codeEditorEl = initEditor(code);
- const matches = codeEditorEl.instance().parseLineForStringMatch();
- expect('"my string value" \t , \t ').toBe(matches[3]);
- });
- it('returns matches on code with special and non-ASCII chars', () => {
- const code = '{\n "@languaæ¼¢å—g e" : "my string value",\n "field2": 123 \n}';
- codeEditorEl = initEditor(code);
- const matches = codeEditorEl.instance().parseLineForStringMatch();
- expect('"my string value",').toBe(matches[3]);
- });
- });
-
-});
diff --git a/app/addons/components/__tests__/codeEditorPanel.test.js b/app/addons/components/__tests__/codeEditorPanel.test.js
deleted file mode 100644
index a13608b..0000000
--- a/app/addons/components/__tests__/codeEditorPanel.test.js
+++ /dev/null
@@ -1,75 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-
-var codeNoNewlines = 'function (doc) {emit(doc._id, 1);}';
-var code = 'function (doc) {\n emit(doc._id, 1);\n}';
-
-describe('CodeEditorPanel', () => {
-
- describe('Doc icon', () => {
- it('hidden by default', () => {
-
- const codeEditorEl = mount(
- <ReactComponents.CodeEditorPanel defaultCode={code} />
- );
- expect(codeEditorEl.find('.icon-question-sign').length).toBe(0);
- });
- it('hidden by default', () => {
-
- const codeEditorEl = mount(
- <ReactComponents.CodeEditorPanel defaultCode={code} docLink="http://link.com" />
- );
- expect(codeEditorEl.find('.icon-question-sign').length).toBe(1);
- });
- });
-
- describe('Zen Mode', () => {
- it('shows zen mode by default', () => {
-
- const codeEditorEl = mount(
- <ReactComponents.CodeEditorPanel defaultCode={code} />
- );
- expect(codeEditorEl.find('.zen-editor-icon').length).toBe(1);
- });
-
- it('omits zen mode if explicitly turned off', () => {
-
- const codeEditorEl = mount(
- <ReactComponents.CodeEditor defaultCode={code} allowZenMode={false} />
- );
- expect(codeEditorEl.find('.zen-editor-icon').length).toBe(0);
- });
- });
-
- describe('Beautify', () => {
- it('confirm clicking beautify actually works within context of component', () => {
-
- const codeEditorEl = mount(
- <ReactComponents.CodeEditorPanel
- defaultCode={codeNoNewlines}
- />
- );
-
- // confirm there are no newlines in the code at this point
- expect(codeEditorEl.instance().getValue().match(/\n/g)).toBeNull();
-
- codeEditorEl.find('.beautify').simulate('click');
-
- // now confirm newlines are found
- expect(codeEditorEl.instance().getValue().match(/\n/g).length).toBe(2);
- });
- });
-
-});
diff --git a/app/addons/components/__tests__/confirmButton.test.js b/app/addons/components/__tests__/confirmButton.test.js
deleted file mode 100644
index 1b3df1d..0000000
--- a/app/addons/components/__tests__/confirmButton.test.js
+++ /dev/null
@@ -1,51 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-describe('ConfirmButton', function () {
- let button;
-
- it('should render text properties', function () {
- button = mount(
- <ReactComponents.ConfirmButton text="Click here to render Rocko Artischocko" />
- );
- expect(button.text()).toBe('Click here to render Rocko Artischocko');
- });
-
- it('should use onClick handler if provided', function () {
- const spy = sinon.spy();
-
- button = mount(
- <ReactComponents.ConfirmButton text="Click here" onClick={spy} />
- );
-
- button.simulate('click');
- expect(spy.calledOnce).toBeTruthy();
- });
-
- it('shows icon by default', function () {
- button = mount(
- <ReactComponents.ConfirmButton text="Click here" onClick={function () { }} />
- );
- expect(button.find('.icon').length).toBe(1);
- });
-
- it('optionally omits the icon', function () {
- button = mount(
- <ReactComponents.ConfirmButton text="Click here" onClick={function () { }} showIcon={false} />
- );
- expect(button.find('.icon').length).toBe(0);
- });
-});
diff --git a/app/addons/components/__tests__/copy.test.js b/app/addons/components/__tests__/copy.test.js
deleted file mode 100644
index 64216c7..0000000
--- a/app/addons/components/__tests__/copy.test.js
+++ /dev/null
@@ -1,39 +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.
-import { Copy } from "../components/copy";
-import { mount } from "enzyme";
-import React from "react";
-import ReactDOM from "react-dom";
-import uuid from 'uuid';
-
-describe('Copy', () => {
-
- it('shows a copy icon by default', () => {
- const wrapper = mount(<Copy uniqueKey={uuid.v4()} text="copy me"/>);
- expect(wrapper.find('.icon-paste').length).toBe(1);
- });
-
- it('shows text if specified', () => {
- const wrapper = mount(<Copy uniqueKey={uuid.v4()} text="copy me" displayType="text" />);
- expect(wrapper.find('.icon-paste').length).toBe(0);
- });
-
- it('shows custom text if specified', () => {
- const wrapper = mount(<Copy uniqueKey={uuid.v4()} displayType="text" textDisplay="booyah!" text="copy me" />);
- expect(wrapper.html()).toMatch(/booyah!/);
- });
-
- it('shows an input field and button if specified', () => {
- const wrapper = mount(<Copy uniqueKey={uuid.v4()} displayType='input' text="http://localhost:8000/_all_dbs" />);
- expect(wrapper.find('input').length).toBe(1);
- });
-});
diff --git a/app/addons/components/__tests__/deleteDatabaseModal.test.js b/app/addons/components/__tests__/deleteDatabaseModal.test.js
deleted file mode 100644
index 9c12cd7..0000000
--- a/app/addons/components/__tests__/deleteDatabaseModal.test.js
+++ /dev/null
@@ -1,57 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-
-const noop = () => {};
-
-describe('DeleteDatabaseModal', function () {
-
- it('submitting is disabled when initially rendered', function () {
- const modal = mount(
- <ReactComponents.DeleteDatabaseModal
- showHide={noop}
- modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />
- );
-
- expect(modal.find('button.delete').first().prop('disabled')).toBe(true);
- });
-
- it('submitting is disabled when garbage entered', function () {
- const modal = mount(
- <ReactComponents.DeleteDatabaseModal
- showHide={noop}
- modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />
- );
-
- const input = modal.find('input');
-
- input.simulate('change', {target: {value: 'Hello, world'}});
- expect(modal.find('button.delete').prop('disabled')).toBe(true);
- });
-
- it('submitting is enabled when same db name entered', function () {
- const modal = mount(
- <ReactComponents.DeleteDatabaseModal
- showHide={noop}
- modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />
- );
-
- var input = modal.find('.modal').find('input');
-
- input.simulate('change', {target: {value: 'fooo'}});
- expect(modal.find('button.delete').prop('disabled')).toBeFalsy();
- });
-
-
-});
diff --git a/app/addons/components/__tests__/doc.test.js b/app/addons/components/__tests__/doc.test.js
deleted file mode 100644
index 6107ca1..0000000
--- a/app/addons/components/__tests__/doc.test.js
+++ /dev/null
@@ -1,181 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-const noop = () => {};
-
-describe('Document', () => {
- let el;
-
- const doc = {};
- _.times(1000, (n) => {
- doc['prop' + n] = n;
- });
-
- const docContent = JSON.stringify(doc, null, ' ');
-
- it('hosts child elements', () => {
- el = mount(
- <ReactComponents.Document docIdentifier="foo" docChecked={noop}>
- <div className="foo-children"></div>
- </ReactComponents.Document>
- );
- expect(el.find('.foo-children').length).toBeGreaterThan(0);
- });
-
- it('does not require child elements', () => {
- el = mount(
- <ReactComponents.Document docIdentifier="foo" docChecked={noop} />
- );
- expect(el.find('.doc-edit-symbol').length).toBe(0);
- });
-
- it('you can check it', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} isDeletable={true} checked={true} docIdentifier="foo" />
- );
- expect(el.find('input').prop('data-checked')).toBe(true);
- });
-
- it('you can uncheck it', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} isDeletable={true} docIdentifier="foo" />
- );
- expect(el.find('[data-checked="true"]').length).toBe(0);
- });
-
- it('it calls an onchange callback', () => {
- var spy = sinon.spy();
-
- el = mount(
- <ReactComponents.Document doc={{id: "foo"}} isDeletable={true} docChecked={spy} docIdentifier="foo" />
- );
- el.find('input[type="checkbox"]').first().simulate('change', {target: {value: 'Hello, world'}});
- expect(spy.calledOnce).toBeTruthy();
- });
-
- it('it calls an onclick callback', () => {
- var spy = sinon.spy();
-
- el = mount(
- <ReactComponents.Document docChecked={noop} isDeletable={true} onClick={spy} docIdentifier="foo" />
- );
- el.find('.doc-item header').first().simulate('click');
- expect(spy.calledOnce).toBeTruthy();
- });
-
- it('can render without checkbox', () => {
- var spy = sinon.spy();
-
- el = mount(
- <ReactComponents.Document docChecked={noop} isDeletable={false} onDoubleClick={spy} docIdentifier="foo" />
- );
- expect(el.find('input[type="checkbox"]').length).toBe(0);
- expect(el.find('.checkbox-dummy').length).toBeGreaterThan(0);
- });
-
- it('contains a doc-data element when there\'s doc content', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} isDeletable={true} checked={true} docIdentifier="foo" docContent='{ "content": true }' />
- );
- expect(el.find('.doc-data').length).toBe(1);
- });
-
- it('doesn\'t contain a doc-data element when there\'s no doc content', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} isDeletable={true} checked={true} docIdentifier="foo" docContent='' />
- );
- expect(el.find('.doc-data').length).toBe(0);
- });
-
- it('allows empty headers', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} header={null} isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
- );
- expect(el.find('.header-doc-id').text()).toBe('');
- });
-
- it('allows supports headers with "', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent='' />
- );
- expect(el.find('.header-doc-id').text()).toBe('"foo"');
- });
-
- it('small docs should not be truncated', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent='{ "content": true }' />
- );
- expect(el.find('.doc-content-truncated').length).toBe(0);
- });
-
- it('large docs should get truncated', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} />
- );
- expect(el.find('.doc-content-truncated').length).toBe(1);
- });
-
- it('custom truncate value', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} maxRows={2000} />
- );
- expect(el.find('.doc-content-truncated').length).toBe(0);
- });
-
- it('disabling truncation', () => {
- el = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} truncate={false} />
- );
- expect(el.find('.doc-content-truncated').length).toBe(0);
- });
-
- it('shows icon only for docs with type MangoIndex', () => {
- const index = {
- type: "json",
- def: { fields: [{ foo: "asc" }] }
- };
- const content = JSON.stringify(index, null, ' ');
- const elMangoIndex = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true}
- checked={false} docIdentifier="foo" docContent={content}
- truncate={false} docType="MangoIndex"/>
- );
- expect(elMangoIndex.find('i.fonticon-document').exists()).toBe(true);
-
- const elRegularDoc = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true}
- checked={false} docIdentifier="foo" docContent={content}
- truncate={false} docType="view"/>
- );
- expect(elRegularDoc.find('i.fonticon-documents').exists()).toBe(false);
- });
-
- it('shows icon for partitioned mango index', () => {
- const index = {
- type: "json",
- partitioned: true,
- def: { fields: [{ foo: "asc" }] }
- };
- const content = JSON.stringify(index, null, ' ');
- const elMangoIndex = mount(
- <ReactComponents.Document docChecked={noop} header="foo" isDeletable={true}
- checked={false} docIdentifier="foo" docContent={content}
- truncate={false} docType="MangoIndex"/>
- );
- expect(elMangoIndex.find('i.fonticon-documents').exists()).toBe(true);
- });
-
-});
diff --git a/app/addons/components/__tests__/headerBreadcrumbs.test.js b/app/addons/components/__tests__/headerBreadcrumbs.test.js
deleted file mode 100644
index 8231aee..0000000
--- a/app/addons/components/__tests__/headerBreadcrumbs.test.js
+++ /dev/null
@@ -1,75 +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.
-
-import React from 'react';
-import {mount} from 'enzyme';
-
-import {Breadcrumbs} from '../header-breadcrumbs';
-
-describe('Breadcrumbs', () => {
- it('should not inject dividers if 1 element present', () => {
-
- const crumbs = [{name: 'pineapple'}];
-
- let el = mount(
- <div><Breadcrumbs crumbs={crumbs} /></div>
- );
-
- expect(el.find('.faux-header__breadcrumbs-divider').length).toBe(0);
- });
-
- it('should inject 2 dividers if 3 elements present', () => {
-
- const crumbs = [
- {name: 'pineapple'},
- {name: 'mango'},
- {name: 'guayaba'}
- ];
-
- let el = mount(
- <div><Breadcrumbs crumbs={crumbs} /></div>
- );
-
-
- expect(el.find('.faux-header__breadcrumbs-divider').length).toBe(2);
- });
-
- it('linked breadcrumbs are possible', () => {
-
- const crumbs = [
- {name: 'pineapple'},
- {name: 'mango', link: 'http://example.com'},
- {name: 'guayaba'}
- ];
-
- let el = mount(
- <div><Breadcrumbs crumbs={crumbs} /></div>
- );
-
- expect(el.find('.faux-header__breadcrumbs-link').length).toBe(1);
- });
-
- it('linked breadcrumbs are not created for non-linked elements', () => {
-
- const crumbs = [
- {name: 'pineapple'},
- {name: 'mango'},
- {name: 'guayaba'}
- ];
-
- let el = mount(
- <div><Breadcrumbs crumbs={crumbs} /></div>
- );
-
- expect(el.find('.faux-header__breadcrumbs-link').length).toBe(0);
- });
-});
diff --git a/app/addons/components/__tests__/headerTogglebutton.test.js b/app/addons/components/__tests__/headerTogglebutton.test.js
deleted file mode 100644
index 9ea0b59..0000000
--- a/app/addons/components/__tests__/headerTogglebutton.test.js
+++ /dev/null
@@ -1,30 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-describe('Header Togglebutton', () => {
- let toggleEl, toggleCallback;
- beforeEach(() => {
- toggleCallback = sinon.spy();
- toggleEl = mount(<ReactComponents.ToggleHeaderButton fonticon={'foo'}
- classString={'bar'} toggleCallback={toggleCallback} />);
- });
-
-
- it('should call the passed callback', () => {
- toggleEl.simulate('click');
- expect(toggleCallback.calledOnce).toBeTruthy();
- });
-});
diff --git a/app/addons/components/__tests__/paddedBorderedBox.test.js b/app/addons/components/__tests__/paddedBorderedBox.test.js
deleted file mode 100644
index 80abf3e..0000000
--- a/app/addons/components/__tests__/paddedBorderedBox.test.js
+++ /dev/null
@@ -1,27 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-
-describe('PaddedBorderedBox', function () {
- let el;
-
- it('hosts child elements', function () {
- el = mount(
- <ReactComponents.PaddedBorderedBox>
- <div className="foo-children"></div>
- </ReactComponents.PaddedBorderedBox>
- );
- expect(el.find('.foo-children').length).toBeGreaterThan(0);
- });
-});
diff --git a/app/addons/components/__tests__/polling.test.js b/app/addons/components/__tests__/polling.test.js
deleted file mode 100644
index e1d9cec..0000000
--- a/app/addons/components/__tests__/polling.test.js
+++ /dev/null
@@ -1,105 +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.
-import {Polling, clearPollCounter, resetPollCounter} from "../components/polling";
-import {mount} from "enzyme";
-import sinon from "sinon";
-import React from "react";
-
-describe("Polling", () => {
- describe('Counters', () => {
-
- it('resetPollCounter calls cb after set time', done => {
- let called = false;
- resetPollCounter(100, () => {
- called = true;
- expect(called).toBeTruthy();
- done();
- });
- });
-
- it('clearRefreshCounter stops counter', done => {
- let called = false;
- resetPollCounter(100, () => {
- called = true;
- });
-
- clearPollCounter();
- setTimeout(() => {
- expect(called).toBeFalsy();
- done();
- }, 200);
- });
- });
-
- describe('Component', () => {
- var clock;
- beforeEach(() => {
- clock = sinon.useFakeTimers();
- });
-
- afterEach(() => {
- clock.restore();
- });
-
- it('renders slider with correct info', () => {
- const wrapper = mount(<Polling
- startValue={10}
- min={1}
- max={20}
- stepSize={1}
- onPoll={() => {}}
- />);
-
- const props = wrapper.find('.faux__polling-info-slider').at(0).props();
- expect(props.defaultValue).toEqual(10);
- expect(props.step).toEqual(1);
- expect(props.min).toEqual(1);
- expect(props.max).toEqual(21);
- });
-
- it('turns polling off if value is max', () => {
- const wrapper = mount(<Polling
- startValue={10}
- min={1}
- max={20}
- stepSize={1}
- onPoll={() => {}}
- />);
-
- const handler = wrapper.find('.rc-slider-handle').at(1);
- wrapper.simulate('focus');
- // Simulate key END to move handle to the max value
- handler.simulate('keyDown', { keyCode: 35 });
- const isOff = wrapper.find('.faux__polling-info-value--off').text();
- expect(isOff.toLowerCase()).toEqual("off");
- });
-
- it('turns polling off if value is max', (done) => {
- let pollCalled = false;
- const onPoll = () => {
- pollCalled = true;
- expect(pollCalled).toBeTruthy();
- done();
- };
- mount(<Polling
- startValue={1}
- min={1}
- max={20}
- stepSize={1}
- onPoll={onPoll}
- />);
-
- clock.tick(1010);
-
- });
- });
-});
diff --git a/app/addons/components/__tests__/stringEditModal.test.js b/app/addons/components/__tests__/stringEditModal.test.js
deleted file mode 100644
index ffd5921..0000000
--- a/app/addons/components/__tests__/stringEditModal.test.js
+++ /dev/null
@@ -1,33 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-//need enzyme to support portals
-describe('String Edit Modal', () => {
- var stub = () => {};
-
- describe('onSave', () => {
- it('ensures same content returns on saving', () => {
- var string = "a string!";
- var spy = sinon.spy();
- const el = mount(
- <ReactComponents.StringEditModal visible={true} onClose={stub} onSave={spy} value={string} />
- );
- el.find('#string-edit-save-btn').simulate('click');
- sinon.assert.calledOnce(spy);
- sinon.assert.calledWith(spy, string);
- });
- });
-});
diff --git a/app/addons/components/__tests__/styledSelect.test.js b/app/addons/components/__tests__/styledSelect.test.js
deleted file mode 100644
index a1e6366..0000000
--- a/app/addons/components/__tests__/styledSelect.test.js
+++ /dev/null
@@ -1,47 +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.
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-describe('styled select', () => {
- let selectorEl, spy = sinon.spy();
-
- beforeEach(() => {
- const selectContent = (
- <optgroup label="Select a document">
- <option value="new">New Design Document</option>
- <option value="foo">New Design Document</option>
- </optgroup>
- );
-
- selectorEl = mount(
- <ReactComponents.StyledSelect
- selectValue={"foo"}
- selectId="new-ddoc"
- selectClass=""
- selectContent={selectContent}
- selectChange={spy} />
- );
- });
-
- it('calls the callback on select', () => {
- selectorEl.find('#new-ddoc').simulate('change', {
- target: {
- value: 'new'
- }
- });
- expect(spy.calledOnce).toBeTruthy();
- });
-
-});
diff --git a/app/addons/components/__tests__/tabwindowwrapper.test.js b/app/addons/components/__tests__/tabwindowwrapper.test.js
deleted file mode 100644
index 2745bb2..0000000
--- a/app/addons/components/__tests__/tabwindowwrapper.test.js
+++ /dev/null
@@ -1,61 +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.
-import { TabWindowWrapper } from "../components/tabwindowwrapper";
-import { mount } from "enzyme";
-import React from "react";
-import ReactDOM from "react-dom";
-
-describe('TabWindowWrapper', () => {
- const mock = () => {
- return (<div></div>);
- };
-
- const tabs = [
- {
- name: 'Tab1',
- component: mock,
- route: 'tab1'
- },
- {
- name: 'Tab2',
- component: mock,
- route: 'tab2'
- },
- {
- name: 'Tab3',
- component: mock,
- route: 'tab3'
- }
- ];
-
- it('shows all tabs', () => {
- const wrapper = mount(<TabWindowWrapper tabs={tabs} selectedTab={"Tab1"}/>);
- expect(wrapper.find('.component-tab-element-wrapper').length).toBe(1);
- expect(wrapper.find('.tab-element-content').length).toBe(3);
- });
-
- it('shows the selected tab', () => {
- const wrapper = mount(<TabWindowWrapper tabs={tabs} selectedTab={"Tab2"}/>);
- expect(wrapper.find('.tab-element-checked .tab-element-content').html()).toMatch(/Tab2/);
- });
-
- it('shows tab badge', () => {
- const tabNoBadge = [{name: 'Tab1', component: mock, route: 'tab1'}];
- const wrapperNoBadge = mount(<TabWindowWrapper tabs={tabNoBadge} selectedTab={"Tab1"}/>);
- expect(wrapperNoBadge.find('.tab-element-badge').length).toBe(0);
-
- const tabWithBadge = [{name: 'Tab1', component: mock, route: 'tab1', badgeText: 'new'}];
- const wrapperWithBadge = mount(<TabWindowWrapper tabs={tabWithBadge} selectedTab={"Tab1"}/>);
- expect(wrapperWithBadge.find('.tab-element-badge').length).toBe(1);
- expect(wrapperWithBadge.find('.tab-element-badge').text()).toBe('new');
- });
-});
diff --git a/app/addons/components/__tests__/zenMode.test.js b/app/addons/components/__tests__/zenMode.test.js
deleted file mode 100644
index 1873227..0000000
--- a/app/addons/components/__tests__/zenMode.test.js
+++ /dev/null
@@ -1,55 +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.
-
-import ReactComponents from "../react-components";
-import React from "react";
-import {mount} from 'enzyme';
-import sinon from "sinon";
-
-var code = 'function (doc) {\n emit(doc._id, 1);\n}';
-
-describe('Zen Mode', () => {
- let el, spy;
-
- beforeEach(() => {
- spy = sinon.spy();
-
- el = mount(
- <ReactComponents.ZenModeOverlay defaultCode={code} onExit={spy} />
- );
- });
-
- afterEach(() => {
- window.localStorage.removeItem('zenTheme');
- });
-
- describe('Toggle theme', () => {
- it('defaults to dark theme', () => {
- expect(el.find('div.zen-theme-dark').exists()).toBeTruthy();
- });
-
- it('switch to light theme on click', () => {
- el.find('.js-toggle-theme').simulate('click');
- expect(el.find('div.zen-theme-light').exists()).toBeTruthy();
- // reset
- el.find('.js-toggle-theme').simulate('click');
- });
- });
-
- describe('Closing zen mode', () => {
- it('method called', () => {
- el.find('.js-exit-zen-mode').simulate('click');
- expect(spy.calledOnce).toBeTruthy();
- });
- });
-
-});
diff --git a/app/addons/components/actions.js b/app/addons/components/actions.js
deleted file mode 100644
index bc1783b..0000000
--- a/app/addons/components/actions.js
+++ /dev/null
@@ -1,57 +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.
-
-import { deleteRequest } from '../../core/ajax';
-import FauxtonAPI from '../../core/api';
-import ActionTypes from './actiontypes';
-
-function showDeleteDatabaseModal (options) {
- FauxtonAPI.dispatch({
- type: ActionTypes.CMPNTS_DATABASES_SHOWDELETE_MODAL,
- options: options
- });
-}
-
-function deleteDatabase (dbId, onDeleteSuccess) {
- const url = FauxtonAPI.urls('databaseBaseURL', 'server', dbId, '');
-
- deleteRequest(url).then(resp => {
- if (!resp.ok) {
- const msg = resp.reason || '';
- throw new Error(msg);
- }
- this.showDeleteDatabaseModal({ showModal: true });
-
- FauxtonAPI.addNotification({
- msg: 'The database <code>' + _.escape(dbId) + '</code> has been deleted.',
- clear: true,
- escape: false // beware of possible XSS when the message changes
- });
-
- Backbone.history.loadUrl(FauxtonAPI.urls('allDBs', 'app'));
- if (onDeleteSuccess) {
- onDeleteSuccess();
- }
- }).catch(err => {
- FauxtonAPI.addNotification({
- msg: 'Could not delete the database. ' + err.message,
- type: 'error',
- clear: true
- });
- });
-}
-
-
-export default {
- deleteDatabase: deleteDatabase,
- showDeleteDatabaseModal: showDeleteDatabaseModal
-};
diff --git a/app/addons/components/actiontypes.js b/app/addons/components/actiontypes.js
deleted file mode 100644
index d9e7183..0000000
--- a/app/addons/components/actiontypes.js
+++ /dev/null
@@ -1,15 +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.
-
-export default {
- CMPNTS_DATABASES_SHOWDELETE_MODAL: 'CMPNTS_DATABASES_SHOWDELETE_MODAL'
-};
diff --git a/app/addons/components/assets/less/accordion.less b/app/addons/components/assets/less/accordion.less
deleted file mode 100644
index 16a504f..0000000
--- a/app/addons/components/assets/less/accordion.less
+++ /dev/null
@@ -1,27 +0,0 @@
-.faux--accordion {
- list-style: none;
- margin: 0px;
- width: 100%;
-}
-
-.faux--accordion__item {
- background-color: transparent;
- transition: all 0.5s linear;
-}
-
-.faux--accordion__item-header {
- border: 0;
- background-color: transparent;
- color: inherit;
- font-size: inherit;
- padding-left: 0px;
- span {
- padding-left: 0.5rem;
- }
-}
-
-.faux--accordion__item-content {
- padding-left: 1.35rem;
- padding-top: 0.75rem;
- font-size: inherit;
-}
diff --git a/app/addons/components/assets/less/badges.less b/app/addons/components/assets/less/badges.less
deleted file mode 100644
index a049758..0000000
--- a/app/addons/components/assets/less/badges.less
+++ /dev/null
@@ -1,20 +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.
-ul.component-badgelist {
- margin: 0;
- display: inline-block;
- li {
- list-style-type: none;
- float: left;
- margin-left: 5px;
- }
-}
diff --git a/app/addons/components/assets/less/bulk-selector.less b/app/addons/components/assets/less/bulk-selector.less
deleted file mode 100644
index a55ba7f..0000000
--- a/app/addons/components/assets/less/bulk-selector.less
+++ /dev/null
@@ -1,123 +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.
-
-#bulk-action-component-popover {
- font-size: 13px;
-
- i.icon {
- margin-right: 10px;
- }
-
- ul {
- margin: inherit;
- }
-
- li {
- padding: 14px 15px;
- line-height: 0;
- cursor: pointer;
- list-style-type: none;
-
- &.disabled {
- color: #cccccc;
- cursor: default;
- &:hover {
- background-color: inherit;
- }
- }
-
- &:hover {
- background-color: #fbcece; // light red
- }
- &:last-child {
- -webkit-border-bottom-right-radius: 5px;
- -webkit-border-bottom-left-radius: 5px;
- -moz-border-radius-bottomright: 5px;
- -moz-border-radius-bottomleft: 5px;
- border-bottom-right-radius: 5px;
- border-bottom-left-radius: 5px;
- }
- }
- .popover-title {
- margin: -1px;
- }
-
- .popover {
- left: 10px !important;
-
- .arrow {
- margin-left: -39px;
- }
- }
-
- .popover-content {
- padding: 0;
- }
-}
-
-.bulk-action-component {
- min-height: 43px;
-
- button {
- height: 26px;
- width: 26px;
- background-color: @background;
- border: 1px solid @darkBorder;
- margin-left: 7px;
- }
-
- .fonticon-trash:before {
- font-size: 12px;
- margin-left: 2px;
- margin-top: 1px;
- }
-
-
- .separator {
- border-left: 1px solid @darkBorder;
- margin: 5px 0;
- height: 15px;
- }
-
- .bulk-action-component-selector-group {
-
- .fonticon {
- font-size: 8px;
- color: #505050;
- padding: 3px 0;
- &:hover {
- color: @dangerRed;
- }
- }
-
- }
-
- .bulk-action-component-panel {
- input[type="checkbox"] {
- margin: 6px;
- }
-
- border: 1px solid @darkBorder;
-
- position: relative;
- float: left;
- div.arrow-button {
- height: 24px;
- width: 24px;
- transform: rotate(90deg);
- cursor: pointer;
- i {
- margin-left: 10px;
- }
- }
- }
-}
diff --git a/app/addons/components/assets/less/code-editor.less b/app/addons/components/assets/less/code-editor.less
deleted file mode 100644
index eff819b..0000000
--- a/app/addons/components/assets/less/code-editor.less
+++ /dev/null
@@ -1,100 +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.
-
-.zen-editor-icon {
- float: right;
- font-size: 13px;
- margin-top: 3px;
-}
-
-.full-page-editor-modal-wrapper {
- position: fixed;
- padding: 110px;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- margin: 0;
- width: 100%;
- z-index: 1025;
-
- &.zen-theme-dark {
- background-color: #323232;
- }
- &.zen-theme-light {
- background-color: #ffffff;
- }
-
- &>div {
- height: 100%;
- &.zen-mode-controls {
- height: 96px;
- }
- }
-
- .ace_editor {
- height: 100%;
- font-size: 15px;
- line-height: 25px;
- background-color: inherit;
-
- .ace_gutter, .ace_gutter-active-line {
- background-color: inherit;
- }
- }
-}
-
-.zen-theme-light {
- .zen-mode-controls {
- color: #999999;
- }
-}
-
-.zen-mode-controls {
- position: absolute;
- right: 30px;
- top: 30px;
- font-size: 20px;
- color: white;
-
- .zen-mode-controls-wrapper {
- position: relative;
- float: left;
- }
-
- .tooltips {
- position: relative;
- float: left;
- }
-
- ul {
- float: right;
- list-style-type: none;
- }
-
- .tooltip {
- margin-right: 20px;
- min-width: 140px;
- }
-
- span {
- cursor: pointer;
- width: 23px;
- height: 23px;
- margin: 10px;
- display: inline-block;
- }
-}
-
-html body .ace_editor .ace_marker-layer .ace_selection {
- background-color: rgba(29, 151, 215, 0.5);
-}
diff --git a/app/addons/components/assets/less/components.less b/app/addons/components/assets/less/components.less
deleted file mode 100644
index a334648..0000000
--- a/app/addons/components/assets/less/components.less
+++ /dev/null
@@ -1,29 +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.
-
-@import "../../../../../assets/less/variables.less";
-
-@import "accordion.less";
-@import "header-togglebutton.less";
-@import "styled-select.less";
-@import "docs.less";
-@import "loading-lines.less";
-@import "code-editor.less";
-@import "bulk-selector.less";
-@import "badges.less";
-@import "modals.less";
-@import "tab-element.less";
-@import "header-breadcrumbs.less";
-@import "layouts.less";
-@import "polling.less";
-@import "jsonlink.less";
-@import "menudropdown.less";
diff --git a/app/addons/components/assets/less/docs.less b/app/addons/components/assets/less/docs.less
deleted file mode 100644
index a148d08..0000000
--- a/app/addons/components/assets/less/docs.less
+++ /dev/null
@@ -1,133 +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.
-
-@import "../../../../../assets/less/variables.less";
-@import "../../../../../assets/less/bootstrap/mixins.less";
-
-#doc-list {
- .custom-inputs {
- display: none;
- }
- padding: 30px 12px 0 12px;
- div.doc-row {
- margin-bottom: 20px;
- .doc-item {
- vertical-align: top;
- position: relative;
- .box-shadow(3px 4px 0 rgba(0, 0, 0, 0.3));
- .doc-data {
- border-bottom: 1px solid @docHeaderBorderBottom;
- border-left: 1px solid @docHeaderOtherBorders;
- border-right: 1px solid @docHeaderOtherBorders;
- font-family: monospace;
- .prettyprint--small {
- font-size: 11px;
- }
- .prettyprint--large {
- font-size: 15px;
- }
- }
- header {
- cursor: pointer;
- font-weight: bold;
- position: relative;
- padding: 5px 10px;
- background-color: @docHeaderBG;
- border-bottom: 1px solid @docHeaderBorderBottom;
- border-left: 1px solid @docHeaderOtherBorders;
- border-right: 1px solid @docHeaderOtherBorders;
- border-top: 1px solid @docHeaderOtherBorders;
- .header-doc-id {
- color: @docHeaderDocId;
- margin-left: 0;
- }
- .header-keylabel {
- margin-right: 10px;
- }
- .header-keylabel:empty
- {
- display:none;
- }
- .header-keylabel,
- .fonticon-pencil {
- color: @docHeaderLabels;
- }
- .doc-edit-symbol {
- position: relative;
- }
- .fonticon-pencil {
- font-size: 16px;
- }
- .fonticon-pencil:hover {
- color: @hoverHighlight;
- }
- }
- }
- }
-}
-
-.view #doc-list {
- padding-top: 12px;
-}
-
-.show-select {
- #doc-list {
- padding: 0px 0 30px 0;
- .custom-inputs {
- display: block;
- float: left;
- }
- }
- .checkbox.inline {
- padding-top: 17px;
- padding-left: 0;
- label {
- padding-left: 23px; // 7px to the right-border + 16px around
- }
- }
- .checkbox-dummy {
- width: 20px;
- height: 20px;
- padding-left: 23px;
- margin-right: 15px;
- }
- .doc-item {
- width: auto;
- overflow: hidden;
- }
- label.label-checkbox-doclist {
- // https://code.google.com/p/chromium/issues/detail?id=411065
- -webkit-user-select: none;
- height: 1px;
- width: 1px;
- }
- /* checkboxes in doc-list */
- input[type="checkbox"] + label:before {
- background-color: @docCheckBoxUncheckedBG;
- border: @docCheckBoxUncheckedBorder;
- }
- input[type="checkbox"] + label:hover:before {
- border: @docCheckBoxHoverBorder;
- }
- input[type="checkbox"]:checked + label::before {
- border: @docCheckBoxCheckedBorder;
- background-color: @docCheckBoxCheckedBG;
- }
-}
-
-.doc-content-truncated {
- background-color: #4d4d4d;
- color: #bbbbbb;
- padding: 10px;
- font-size: 13px;
- margin: 0;
-}
diff --git a/app/addons/components/assets/less/header-breadcrumbs.less b/app/addons/components/assets/less/header-breadcrumbs.less
deleted file mode 100644
index 7e4b8a0..0000000
--- a/app/addons/components/assets/less/header-breadcrumbs.less
+++ /dev/null
@@ -1,51 +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.
-
-@import "../../../../../assets/less/variables.less";
-
-.faux-header__breadcrumbs {
- .display-flex();
- height: @collapsedNavWidth;
-}
-
-.faux-header__breadcrumbs-element {
- margin: 0 4px 0 4px;
- color: #333;
- padding: 18px 10px;
- font-size: 24px;
- text-shadow: none;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-a.faux-header__breadcrumbs-link {
- color: @brandHighlight;
- &:hover {
- color: @hoverHighlight;
- text-decoration: none;
- cursor: pointer;
- }
-}
-
-
-.faux-header__breadcrumbs-divider {
- width: 13px;
- padding-top: 22px;
- font-size: 20px;
-}
-
-.faux-header__controlbox-backlink {
- border-right: 1px solid #ccc;
- padding-left: 10px;
- padding-right: 2px;
-}
diff --git a/app/addons/components/assets/less/header-togglebutton.less b/app/addons/components/assets/less/header-togglebutton.less
deleted file mode 100644
index 9df3672..0000000
--- a/app/addons/components/assets/less/header-togglebutton.less
+++ /dev/null
@@ -1,73 +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.
-@import "../../../../../assets/less/variables.less";
-
-.header-control-box {
- color: #666;
- font-size: 13px;
- line-height: 33px;
- padding: 12px 20px 12px 20px;
- height: @collapsedNavWidth;
- background-color: transparent;
- border: none;
- border-left: 1px solid @btnBorder;
- text-decoration: none;
- .icon {
- font-size: 20px;
- &:before {
- float: left;
- margin: 10px 0 0 0;
- }
- }
- span {
- margin-left: 6px;
- }
- .icon.fontawesome {
- &:before {
- margin: 6px 6px 0 0;
- }
- }
-}
-
-.header-control-square {
- height: @collapsedNavWidth;
- width: @collapsedNavWidth;
- float: left;
- .icon {
- &:before {
- margin: 0;
- float: none;
- }
- }
-}
-
-.header-control-box:hover {
- .icon, span {
- color: @hoverHighlight;
- }
-}
-
-.js-headerbar-togglebutton-selected {
- .icon, span {
- color: @linkColor;
- }
-}
-
-button.control-toggle-alternative-header {
- float: left;
- border-right: 1px solid @btnBorder;
- border-left: none;
-}
-
-button.control-toggle-alternative-header.js-headerbar-togglebutton-selected {
- border-right: none;
-}
diff --git a/app/addons/components/assets/less/jsonlink.less b/app/addons/components/assets/less/jsonlink.less
deleted file mode 100644
index 304a848..0000000
--- a/app/addons/components/assets/less/jsonlink.less
+++ /dev/null
@@ -1,80 +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.
-
-.faux__jsonlink {
- /*width: 76px; Static width cause rendering problems on Edge */
- border-left: 1px solid #ccc;
- padding: 16px 12px 12px 12px !important;
- height: 64px;
- background-color: rgba(0, 0, 0, 0);
- text-align: center;
- min-width: 55px;
-}
-
-.faux__jsonlink-link {
- color: #666;
- text-decoration: none;
- line-height: 33px;
- font-size: 13px;
-}
-
-.faux__jsonlink-link:visited,
-.faux__jsonlink-link:focus,
-.faux__jsonlink-link:active {
- text-decoration: none;
- color: #666;
-}
-
-.faux__jsonlink-link-brackets {
- font-size: 15px;
- padding-right: 3px;
- font-weight: 500;
-}
-
-.faux__doclink {
- text-align: center;
- width: 55px;
- border-left: 1px solid #ccc;
- padding: 18px 12px 12px 12px !important;
- height: 64px;
- background-color: rgba(0, 0, 0, 0);
-}
-
-.faux__doclink-link {
- color: #666;
- text-decoration: none;
- line-height: 33px;
- font-size: 20px;
-}
-
-.faux__doclink-link:active,
-.faux__doclink-link:focus,
-.faux__doclink-link:visited {
- text-decoration: none;
- color: #666;
-}
-
-@media (max-width: 1090px) {
- #main:not(.closeMenu) {
- .faux__jsonlink-link-label{
- display: none;
- }
- }
-}
-
-@media (max-width: 1120px) {
- #main.closeMenu {
- .faux__jsonlink-link-label{
- display: none;
- }
- }
-}
diff --git a/app/addons/components/assets/less/layouts.less b/app/addons/components/assets/less/layouts.less
deleted file mode 100644
index 8d72807..0000000
--- a/app/addons/components/assets/less/layouts.less
+++ /dev/null
@@ -1,37 +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.
-.template {
- height: 100%;
-}
-
-.right-header-flex {
- display: flex;
- align-items: center;
- flex-direction: row;
- height: 100%;
-
- &--ie1X{
- align-items:stretch;
- }
-}
-
-//yes !important!!! We have to overridde some styles I can't override any other way for now
-div.faux__breadcrumbs-mango-header {
- height: 64px !important;
- -ms-flex: 0 0 440px !important;
- flex: 0 0 440px !important;
- overflow: hidden !important;
-}
-
-div.faux__jsondoc-wrapper {
- display:flex;
-}
diff --git a/app/addons/components/assets/less/loading-lines.less b/app/addons/components/assets/less/loading-lines.less
deleted file mode 100644
index ce3a5d8..0000000
--- a/app/addons/components/assets/less/loading-lines.less
+++ /dev/null
@@ -1,76 +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.
-
-
-@import "../../../../../assets/less/variables.less";
-
-
-@loadingLinesHeight: 30px;
-@loadingLinesMargin: 3px;
-@loadingLinesWidth: 10px;
-@loadingLinesTime: 0.8s;
-@loadingLinesEffect: linear;
-@loadingLinesColor: @brandHighlight;
-
-.loading-lines {
- display: block;
- width: 80px;
- margin-left: auto;
- margin-right: auto;
- div {
- background-color: @loadingLinesColor;
- width: @loadingLinesWidth;
- height: 1px;
- float: left;
- animation: height-change @loadingLinesTime infinite @loadingLinesEffect;
- -webkit-animation: height-change @loadingLinesTime infinite @loadingLinesEffect;
- }
-}
-
-#line2 {
- animation-delay: 0.1s;
- -webkit-animation-delay: 0.1s;
- margin-left: @loadingLinesMargin;
-}
-#line3 {
- animation-delay: 0.2s;
- -webkit-animation-delay: 0.2s;
- margin-left: @loadingLinesMargin;
-}
-#line4 {
- animation-delay: 0.3s;
- -webkit-animation-delay: 0.3s;
- margin-left: @loadingLinesMargin;
-}
-
-@-webkit-keyframes height-change {
- 0% {
- height: 1px;
- }
- 50% {
- height: @loadingLinesHeight;
- }
- 100% {
- height: 1px;
- }
-}
-@keyframes height-change {
- 0% {
- height: 1px;
- }
- 50% {
- height: @loadingLinesHeight;
- }
- 100% {
- height: 1px;
- }
-}
diff --git a/app/addons/components/assets/less/menudropdown.less b/app/addons/components/assets/less/menudropdown.less
deleted file mode 100644
index 2638a29..0000000
--- a/app/addons/components/assets/less/menudropdown.less
+++ /dev/null
@@ -1,17 +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.
-
-
-.dropdown-menu > li > a.fonticon-placeholder:before {
- padding-right: 17px;
- content: "";
-}
diff --git a/app/addons/components/assets/less/modals.less b/app/addons/components/assets/less/modals.less
deleted file mode 100644
index 93e1ba3..0000000
--- a/app/addons/components/assets/less/modals.less
+++ /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.
-
-
-@import "../../../../../assets/less/variables.less";
-
-.modal .cancel-link {
- margin: 0 15px;
- font-size: 14px;
- color: #666;
- &:hover {
- color: @hoverHighlight;
- text-decoration: none;
- cursor: pointer;
- }
-}
diff --git a/app/addons/components/assets/less/polling.less b/app/addons/components/assets/less/polling.less
deleted file mode 100644
index 0c423e4..0000000
--- a/app/addons/components/assets/less/polling.less
+++ /dev/null
@@ -1,87 +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.
-
-.faux__polling {
- padding: 0 15px !important;
- width: 236px;
-
- .rc-slider-rail {
- background-color: @sliderBackground;
- height: 8px;
- border: 1px solid @sliderBorderColor;
- }
-
- .rc-slider-track {
- background-color: @sliderBackgroundHighlight;
- height: 8px;
- border: 1px solid @sliderBackgroundHighlight;
- }
-
- .rc-slider-handle {
- height: 14px;
- width: 14px;
- margin-top: -3px;
- border: 1px solid @sliderBackgroundHighlight;
- border-radius: 8px;
- background-color: @sliderBackgroundHighlight;
- }
-}
-
-.faux__polling-info {
- font-size: 14px;
-}
-
-.faux__polling-info-text {
- color: #666;
-}
-
-.faux__polling-info-value {
- float: right;
-}
-
-.faux__polling-info-value--off {
- color: #999;
-}
-
-.faux__polling-info-value--active {
- color: @brandHighlight;
-}
-
-.faux__polling-info-slider {
- cursor: pointer;
- height: 20px;
- padding-top: 8px;
-}
-
-div.faux__refresh-btn {
- border-left: 1px solid #ccc;
- line-height: 40px;
- padding: 12px 13px;
- flex: 0 0 auto;
-}
-
-.faux__refresh-icon {
- margin-right: 4px;
-}
-
-.faux__refresh-link:visited,
-.faux__refresh-link:focus,
-.faux__refresh-link {
- color: #666;
- font-size: 14px;
- text-decoration: none;
-}
-
-.faux__refresh-link:hover {
- text-decoration: none;
- color: @hoverHighlight;
-}
diff --git a/app/addons/components/assets/less/styled-select.less b/app/addons/components/assets/less/styled-select.less
deleted file mode 100644
index 78a83e3..0000000
--- a/app/addons/components/assets/less/styled-select.less
+++ /dev/null
@@ -1,78 +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.
-
-.styled-select {
- width: 200px;
-}
-
-.styled-select label {
- margin: 0;
-}
-
-.styled-select select {
- -webkit-appearance: none;
- -moz-appearance: none;
- appearance: none;
- background-color: #e6e6e6;
- border: 1px solid #b3b3b3;
- width: 200px;
- text-indent: 4px;
- height: 46px;
- padding-right: 35px;
- color: #333;
-}
-
-//bug in firefox for text-indent
-@-moz-document url-prefix() {
- .styled-select select {
- text-indent: 0px;
- }
-}
-
-.styled-select select:-moz-focusring {
- color: transparent;
- text-shadow: 0 0 0 #000;
-}
-
-.styled-select select::-ms-expand {
- display: none;
-}
-
-.styled-select-icon {
- pointer-events: none;
- position: absolute;
- right: 10px;
- top: 12px;
- color: #333;
-}
-
-.styled-select-hover-icon {
- pointer-events: none;
- position: absolute;
- right: 10px;
- top: 12px;
- color: @hoverHighlight;
- display: none;
- z-index: 30;
-}
-
-//this is a litte css trick to create a hover effect for the triangle. We can't use the normal hover event because we
-//need to set pointer-events to none so that a click on the triangle is actually a click on the select dropdown
-.styled-select:hover {
- .styled-select-hover-icon {
- display: inline;
- }
-
- .styled-select-icon {
- display: none;
- }
-}
diff --git a/app/addons/components/assets/less/tab-element.less b/app/addons/components/assets/less/tab-element.less
deleted file mode 100644
index 63060d3..0000000
--- a/app/addons/components/assets/less/tab-element.less
+++ /dev/null
@@ -1,115 +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.
-
-@import "../../../../../assets/less/mixins.less";
-
-.component-tab-element-wrapper {
- margin-left: 0;
- padding-left: 0;
- margin-bottom: 0;
- height: 60px;
- background-color: #CBCBCB;
- padding-left: 20px;
- overflow: hidden;
- width: 100%;
- min-width: 770px;
-}
-
-.component-tab-list-element {
- list-style-type: none;
-}
-
-.component-tab-element {
- background-color: #eee;
- margin-top: 10px;
- margin-right: 5px;
- margin-bottom: -1px;
- float: left;
- list-style-type: none;
- line-height: 40px;
-
- input {
- display: none;
- }
-
- label {
- margin-right: 0;
- margin-bottom: 0;
- line-height: 25px;
- .noselect()
- }
-
- .tab-element-content {
- padding: 8px 12px 12px 12px;
- }
-
- .tab-element-indicator-wrapper {
- height: 5px;
- }
-
- .tab-element-badge {
- display: inline-block;
- min-width: 10px;
- padding: 3px 7px;
- line-height: 1;
- color: #fff;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- background-color: @linkColorHover;
- border-radius: 10px;
- margin-left: 0.25rem;
- font-size: 0.75rem;
- }
-
- .tab-element-indicator {
- height: 0px;
- transition: all .25s linear;
- }
-
- &.tab-element-checked .tab-element-indicator {
- height: 5px;
- background-color: @linkColorHover;
- };
-
- &.tab-element-checked {
- background-color: #fff;
- label {
- cursor: default;
- pointer-events: none;
- }
- }
-
- &.tab-element-checked .tab-element-content {
- font-weight: bold;
- }
-
- transition: all .25s linear;
-
- &:hover {
- background-color: #fff;
- color: @linkColorHover;
- };
-
- &.tab-element-checked .tab-element-content:hover {
- color: initial;
- };
-
- &.tab-element-checked:hover {
- color: initial;
- };
-
- &:hover .tab-element-indicator {
- height: 5px;
- background-color: @linkColorHover;
- };
-}
diff --git a/app/addons/components/assets/less/tab-window-wrapper.less b/app/addons/components/assets/less/tab-window-wrapper.less
deleted file mode 100644
index 5c2da30..0000000
--- a/app/addons/components/assets/less/tab-window-wrapper.less
+++ /dev/null
@@ -1,19 +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.
-
-#dashboard-content > .tab__wrapper {
- padding: 0;
-}
-
-.tab__container > div {
- padding: 20px;
-}
\ No newline at end of file
diff --git a/app/addons/components/base.js b/app/addons/components/base.js
deleted file mode 100644
index 47789ef..0000000
--- a/app/addons/components/base.js
+++ /dev/null
@@ -1,17 +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.
-
-import "./assets/less/components.less";
-
-export default {
- initialize () {}
-};
diff --git a/app/addons/components/components/accordion.js b/app/addons/components/components/accordion.js
deleted file mode 100644
index 48de9af..0000000
--- a/app/addons/components/components/accordion.js
+++ /dev/null
@@ -1,74 +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.
-
-import PropTypes from 'prop-types';
-import React from 'react';
-import { Collapse } from 'react-bootstrap';
-import classnames from 'classnames';
-
-export const Accordion = (props) => {
- const { children, className, style } = props;
- const classNames = classnames('faux--accordion', className);
- return (
- <ul className={classNames} style={style}>
- {children}
- </ul>
- );
-};
-
-export class AccordionItem extends React.Component {
- static propTypes = {
- title: PropTypes.string.isRequired
- };
-
- static defaultProps = {
- onClick: () => { }
- };
-
- state = {
- open: false
- };
-
- handleClick = (event) => {
- const newOpen = !this.state.open;
- this.setState({ open: newOpen });
- this.props.onClick({ isOpen: newOpen, event });
- };
-
- render() {
- const { children, title } = this.props;
- const icon = this.state.open ? 'fonticon-down-open' : 'fonticon-right-open';
- const contentClassNames = classnames(
- 'faux--accordion__item-content', 'collapse',
- {in: this.state.open}
- );
-
- return (
- <li
- className='faux--accordion__item'
- onClick={this.handleClick}>
- <button
- type="button"
- className={`faux--accordion__item-header`}
- onClick={this.handleClick}>
- <i className={icon}></i>
- <span>{title}</span>
- </button>
- <Collapse in={this.state.open}>
- <div className={contentClassNames}>
- { children }
- </div>
- </Collapse>
- </li>
- );
- }
-}
diff --git a/app/addons/components/components/apibar.js b/app/addons/components/components/apibar.js
deleted file mode 100644
index 83b44e8..0000000
--- a/app/addons/components/components/apibar.js
+++ /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.
-
-import React from "react";
-import ReactDOM from "react-dom";
-
-export const JSONLink = ({endpoint}) => {
- if (!endpoint) {
- return null;
- }
-
- return (
- <div className="faux__jsonlink">
- <a data-bypass={true} className="faux__jsonlink-link" href={endpoint} target="_blank" rel="noopener noreferrer">
- <span className="faux__jsonlink-link-brackets">{'{\u00a0}'}</span>
- <span className="faux__jsonlink-link-label">JSON</span>
- </a>
- </div>
- );
-};
-
-export const DocLink = ({docURL}) => {
- if (!docURL) {
- return null;
- }
-
- return (
- <div className="faux__doclink">
- <a data-bypass="true" href={docURL} target="_blank" rel="noopener noreferrer" className="faux__doclink-link">
- <i className="icon fonticon-bookmark"></i>
- </a>
- </div>
- );
-};
diff --git a/app/addons/components/components/badge.js b/app/addons/components/components/badge.js
deleted file mode 100644
index 47dd2e5..0000000
--- a/app/addons/components/components/badge.js
+++ /dev/null
@@ -1,82 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-
-export class BadgeList extends React.Component {
- static propTypes = {
- elements: PropTypes.array.isRequired,
- removeBadge: PropTypes.func.isRequired
- };
-
- static defaultProps = {
- getLabel (el) {
- return el;
- },
-
- getId (el) {
- return el;
- }
- };
-
- getBadges = () => {
- return this.props.elements.map(function (el, i) {
- return <Badge
- label={this.props.getLabel(el)}
- key={i}
- id={el}
- remove={this.removeBadge} />;
- }.bind(this));
- };
-
- removeBadge = (label, el) => {
- this.props.removeBadge(label, el);
- };
-
- render() {
- return (
- <ul className="component-badgelist">
- {this.getBadges()}
- </ul>
- );
- }
-}
-
-export class Badge extends React.Component {
- static propTypes = {
- label: PropTypes.string.isRequired,
- remove: PropTypes.func.isRequired
- };
-
- remove = (e) => {
- e.preventDefault();
- this.props.remove(this.props.label, this.props.id);
- };
-
- render() {
- return (
- <li className="component-badge">
- <span className="label label-info">{this.props.label}</span>
- <a
- href="#"
- className="label label-info remove-filter"
- onClick={this.remove} data-bypass="true"
- >
- ×
- </a>
- </li>
- );
- }
-}
diff --git a/app/addons/components/components/beautify.js b/app/addons/components/components/beautify.js
deleted file mode 100644
index 79f4df9..0000000
--- a/app/addons/components/components/beautify.js
+++ /dev/null
@@ -1,61 +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.
-import React from "react";
-import ReactDOM from "react-dom";
-import beautifyHelper from "../../../../assets/js/plugins/beautify";
-import {Tooltip, OverlayTrigger} from 'react-bootstrap';
-
-const helper = beautifyHelper.js_beautify ? beautifyHelper.js_beautify : beautifyHelper;
-
-export class Beautify extends React.Component {
- noOfLines = () => {
- return this.props.code.split(/\r\n|\r|\n/).length;
- };
-
- canBeautify = () => {
- return this.noOfLines() === 1;
- };
-
- beautify = (event) => {
- event.preventDefault();
- var beautifiedCode = helper(this.props.code);
- this.props.beautifiedCode(beautifiedCode);
- };
-
- getTooltip = () => {
- return (
- <Tooltip id="tooltip">
- Switch to editable code format.
- </Tooltip>
- );
- };
-
- render() {
- if (!this.canBeautify()) {
- return null;
- }
-
- const tooltip = this.getTooltip();
-
- return (
- <OverlayTrigger placement="right" overlay={tooltip}>
- <button
- onClick={this.beautify}
- className="beautify beautify_map btn btn-primary btn-small beautify-tooltip"
- type="button"
- >
- Format Code
- </button>
- </OverlayTrigger>
- );
- }
-}
diff --git a/app/addons/components/components/bulkaction.js b/app/addons/components/components/bulkaction.js
deleted file mode 100644
index fc63a81..0000000
--- a/app/addons/components/components/bulkaction.js
+++ /dev/null
@@ -1,108 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-import {OverlayTrigger, Popover} from "react-bootstrap";
-
-export class BulkActionComponent extends React.Component {
- static propTypes = {
- hasSelectedItem: PropTypes.bool.isRequired,
- removeItem: PropTypes.func.isRequired,
- selectAll: PropTypes.func,
- toggleSelect: PropTypes.func.isRequired,
- isChecked: PropTypes.bool.isRequired,
- disabled: PropTypes.bool
- };
-
- static defaultProps = {
- disabled: false,
- title: 'Select rows that can be...',
- bulkIcon: 'fonticon-trash',
- buttonTitle: 'Delete all selected',
- dropdownContentText: 'Deleted',
- enableOverlay: false
- };
-
- render() {
- return (
- <div className="bulk-action-component">
- <div className="bulk-action-component-selector-group">
- {this.getMasterSelector()}
- {this.getMultiSelectOptions()}
- </div>
- </div>
- );
- }
-
- getMultiSelectOptions = () => {
- if (!this.props.hasSelectedItem) {
- return null;
- }
-
- return (
- <button
- onClick={this.props.removeItem}
- className={'fonticon ' + this.props.bulkIcon}
- title={this.props.buttonTitle} />
- );
- };
-
- getPopupContent = () => {
- return (
- <ul className="bulk-action-component-popover-actions">
- <li onClick={this.selectAll} >
- <i className="icon fonticon-cancel"></i> {this.props.dropdownContentText}
- </li>
- </ul>
- );
- };
-
- selectAll = () => {
- this.bulkActionPopover.hide();
- this.props.selectAll();
- };
-
- getOverlay = () => {
- return (
- <OverlayTrigger
- ref={node => this.bulkActionPopover = node}
- trigger="click"
- placement="bottom"
- rootClose={true}
- overlay={
- <Popover id="bulk-action-component-popover" title={this.props.title}>
- {this.getPopupContent()}
- </Popover>
- }>
- <div className="arrow-button">
- <i className="fonticon fonticon-play"></i>
- </div>
- </OverlayTrigger>
- );
- };
-
- getMasterSelector = () => {
- return (
- <div className="bulk-action-component-panel">
- <input type="checkbox"
- checked={this.props.isChecked}
- onChange={this.props.toggleSelect}
- disabled={this.props.disabled} />
- {this.props.enableOverlay ? <div className="separator"></div> : null}
- {this.props.enableOverlay ? this.getOverlay() : null}
- </div>
- );
- };
-}
diff --git a/app/addons/components/components/codeeditor.js b/app/addons/components/components/codeeditor.js
deleted file mode 100644
index ca7a9e3..0000000
--- a/app/addons/components/components/codeeditor.js
+++ /dev/null
@@ -1,380 +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.
-import React from "react";
-import FauxtonAPI from "../../../core/api";
-import ace from "brace";
-import "brace/ext/searchbox";
-import {StringEditModal} from './stringeditmodal';
-
-require('brace/mode/javascript');
-require('brace/mode/json');
-require('brace/theme/idle_fingers');
-
-export class CodeEditor extends React.Component {
- static defaultProps = {
- id: 'code-editor',
- mode: 'javascript',
- theme: 'idle_fingers',
- fontSize: 13,
-
- // this sets the default value for the editor. On the fly changes are stored in state in this component only. To
- // change the editor content after initial construction use CodeEditor.setValue()
- defaultCode: '',
- disabled: false,
- showGutter: true,
- highlightActiveLine: true,
- showPrintMargin: false,
- autoScrollEditorIntoView: true,
- autoFocus: false,
- stringEditModalEnabled: false,
-
- // these two options create auto-resizeable code editors, with a maximum number of lines
- setHeightToLineCount: false,
- maxLines: 10,
- minLines: 11, // show double digits in sidebar
-
- // optional editor key commands (e.g. specific save action)
- editorCommands: [],
-
- // notifies users that there is unsaved changes in the editor when navigating away from the page
- notifyUnsavedChanges: false,
-
- // an optional array of ignorable Ace errors. Lets us filter out errors based on context
- ignorableErrors: [],
-
- // un-Reacty, but the code editor is a self-contained component and it's helpful to be able to tie into
- // editor specific events like content changes and leaving the editor
- change () {},
- blur () {}
- };
-
- state = {
- originalCode: this.props.defaultCode,
-
- // these are all related to the (optional) string edit modal
- stringEditModalVisible: false,
- stringEditIconVisible: false,
- stringEditIconStyle: {},
- stringEditModalValue: ''
- };
-
- hasChanged = () => {
- return !_.isEqual(this.state.originalCode, this.getValue());
- };
-
- clearChanges = () => {
- this.setState({
- originalCode: this.getValue()
- });
- };
-
- setupAce = (props, shouldUpdateCode) => {
- this.editor = ace.edit(this.ace);
-
- // see https://github.com/ajaxorg/ace/issues/36 don't steal browser's default keybinding
- this.editor.commands.bindKeys(
- {
- "Ctrl-L|Command-L": null,
- "Ctrl-Shift-L|Command-Shift-L": "gotoline"
- }
- );
-
- // suppresses an Ace editor error
- this.editor.$blockScrolling = Infinity;
-
- if (shouldUpdateCode) {
- this.setValue(props.defaultCode);
- }
-
- this.editor.setShowPrintMargin(props.showPrintMargin);
- this.editor.autoScrollEditorIntoView = props.autoScrollEditorIntoView;
-
- this.editor.setOption('highlightActiveLine', this.props.highlightActiveLine);
-
- if (this.props.setHeightToLineCount) {
- this.setHeightToLineCount();
- }
-
- if (this.props.ignorableErrors) {
- this.removeIgnorableAnnotations();
- }
-
- this.addCommands();
- this.editor.getSession().setMode('ace/mode/' + props.mode);
- this.editor.setTheme('ace/theme/' + props.theme);
- this.editor.setFontSize(props.fontSize);
- this.editor.getSession().setTabSize(2);
- this.editor.getSession().setUseSoftTabs(true);
-
- if (this.props.autoFocus) {
- this.editor.focus();
- }
- this.editor.setReadOnly(props.disabled);
- };
-
- addCommands = () => {
- _.each(this.props.editorCommands, (command) => {
- this.editor.commands.addCommand(command);
- });
- };
-
- setupEvents = () => {
- this.editor.on('blur', _.bind(this.onBlur, this));
- this.editor.on('change', _.bind(this.onContentChange, this));
-
- if (this.props.stringEditModalEnabled) {
- this.editor.on('changeSelection', _.bind(this.showHideEditStringGutterIcon, this));
- this.editor.getSession().on('changeBackMarker', _.bind(this.showHideEditStringGutterIcon, this));
- this.editor.getSession().on('changeScrollTop', _.bind(this.updateEditStringGutterIconPosition, this));
- }
-
- if (this.props.notifyUnsavedChanges) {
- window.addEventListener('beforeunload', this.quitWarningMsg);
- FauxtonAPI.beforeUnload('editor_' + this.props.id, this.quitWarningMsg);
- }
- };
-
- onBlur = () => {
- this.props.blur(this.getValue());
- };
-
- onContentChange = () => {
- if (this.props.setHeightToLineCount) {
- this.setHeightToLineCount();
- }
- this.props.change(this.getValue());
- };
-
- quitWarningMsg = () => {
- if (this.hasChanged()) {
- return 'Your changes have not been saved. Click Cancel to return to the document, or OK to proceed.';
- }
- };
-
- removeEvents = () => {
- if (this.props.notifyUnsavedChanges) {
- window.removeEventListener('beforeunload', this.quitWarningMsg);
- FauxtonAPI.removeBeforeUnload('editor_' + this.props.id);
- }
- };
-
- setHeightToLineCount = () => {
- var numLines = this.editor.getSession().getDocument().getLength();
- var maxLines = (numLines > this.props.maxLines) ? this.props.maxLines : numLines;
- this.editor.setOptions({
- maxLines: maxLines,
- minLines: this.props.minLines
- });
- };
-
- componentDidMount() {
- this.setupAce(this.props, true);
- this.setupEvents();
-
- if (this.props.autoFocus) {
- this.editor.focus();
- }
- }
-
- componentWillUnmount() {
- this.removeEvents();
- this.editor.destroy();
- }
-
- UNSAFE_componentWillReceiveProps(nextProps) {
- this.setupAce(nextProps, false);
- }
-
- getAnnotations = () => {
- return this.editor.getSession().getAnnotations();
- };
-
- isIgnorableError = (msg) => {
- return _.includes(this.props.ignorableErrors, msg);
- };
-
- removeIgnorableAnnotations = () => {
- var isIgnorableError = this.isIgnorableError;
- this.editor.getSession().on('changeAnnotation', function () {
- var annotations = this.editor.getSession().getAnnotations();
- var newAnnotations = _.reduce(annotations, function (annotations, error) {
- if (!isIgnorableError(error.raw)) {
- annotations.push(error);
- }
- return annotations;
- }, []);
-
- if (annotations.length !== newAnnotations.length) {
- this.editor.getSession().setAnnotations(newAnnotations);
- }
- }.bind(this));
- };
-
- showHideEditStringGutterIcon = () => {
- if (this.hasErrors() || !this.parseLineForStringMatch()) {
- this.setState({ stringEditIconVisible: false });
- return false;
- }
-
- this.setState({
- stringEditIconVisible: true,
- stringEditIconStyle: {
- top: this.getGutterIconPosition()
- }
- });
-
- return true;
- };
-
- updateEditStringGutterIconPosition = () => {
- if (!this.state.stringEditIconVisible) {
- return;
- }
- this.setState({
- stringEditIconStyle: {
- top: this.getGutterIconPosition()
- }
- });
- };
-
- getGutterIconPosition = () => {
- var rowHeight = this.getRowHeight();
- var scrollTop = this.editor.session.getScrollTop();
- var positionFromTop = (rowHeight * this.documentToScreenRow(this.getSelectionStart().row)) - scrollTop;
- return positionFromTop + 'px';
- };
-
- parseLineForStringMatch = () => {
- const selStart = this.getSelectionStart().row;
- const selEnd = this.getSelectionEnd().row;
-
- // one JS(ON) string can't span more than one line - we edit one string, so ensure we don't select several lines
- if (selStart >= 0 && selEnd >= 0 && selStart === selEnd && this.isRowExpanded(selStart)) {
- const editLine = this.getLine(selStart);
- const editMatch = editLine.match(/^([ \t]*)("[^"]*["][ \t]*:[ \t]*)?(["|'].*"[ \t]*,?[ \t]*)$/);
- if (editMatch) {
- return editMatch;
- }
- }
- return false;
- };
-
- openStringEditModal = () => {
- const matches = this.parseLineForStringMatch();
- let string = matches[3].trim();
- // Removes trailing comma and surrouding spaces
- if (string.substring(string.length - 1) === ',') {
- string = string.substring(0, string.length - 1).trim();
- }
- // Removes surrouding quotes
- string = string.substring(1, string.length - 1);
-
- this.setState({
- stringEditModalVisible: true,
- stringEditModalValue: string
- });
- };
-
- saveStringEditModal = (newString) => {
- // replace the string on the selected line
- var line = this.parseLineForStringMatch();
- var indent = line[1] || '',
- key = line[2] || '',
- originalString = line[3],
- comma = '';
- if (originalString.substring(originalString.length - 1) === ',') {
- comma = ',';
- }
- this.replaceCurrentLine(indent + key + JSON.stringify(newString) + comma + '\n');
- this.closeStringEditModal();
- };
-
- closeStringEditModal = () => {
- this.setState({
- stringEditModalVisible: false
- });
- };
-
- hasErrors = () => {
- return !_.every(this.getAnnotations(), (error) => {
- return this.isIgnorableError(error.raw);
- });
- };
-
- setReadOnly = (readonly) => {
- this.editor.setReadOnly(readonly);
- };
-
- setValue = (code, lineNumber) => {
- lineNumber = lineNumber ? lineNumber : -1;
- this.editor.setValue(code, lineNumber);
- };
-
- getValue = () => {
- return this.editor.getValue();
- };
-
- getEditor = () => {
- return this;
- };
-
- getLine = (lineNum) => {
- return this.editor.session.getLine(lineNum);
- };
-
- getSelectionStart = () => {
- return this.editor.getSelectionRange().start;
- };
-
- getSelectionEnd = () => {
- return this.editor.getSelectionRange().end;
- };
-
- getRowHeight = () => {
- return this.editor.renderer.layerConfig.lineHeight;
- };
-
- isRowExpanded = (row) => {
- return !this.editor.getSession().isRowFolded(row);
- };
-
- documentToScreenRow = (row) => {
- return this.editor.getSession().documentToScreenRow(row, 0);
- };
-
- replaceCurrentLine = (replacement) => {
- this.editor.getSelection().selectLine();
- this.editor.insert(replacement);
- this.editor.getSelection().moveCursorUp();
- };
-
- render() {
- return (
- <div>
- <div ref={node => this.ace = node} className="js-editor" id={this.props.id}></div>
- <button ref={node => this.stringEditIcon = node}
- className="btn string-edit"
- title="Edit string"
- disabled={!this.state.stringEditIconVisible || this.props.disabled}
- style={this.state.stringEditIconStyle} onClick={this.openStringEditModal}>
- <i className="icon icon-edit"></i>
- </button>
- <StringEditModal
- ref={node => this.stringEditModal = node}
- visible={this.state.stringEditModalVisible}
- value={this.state.stringEditModalValue}
- onSave={this.saveStringEditModal}
- onClose={this.closeStringEditModal} />
- </div>
- );
- }
-}
diff --git a/app/addons/components/components/codeeditorpanel.js b/app/addons/components/components/codeeditorpanel.js
deleted file mode 100644
index 825138d..0000000
--- a/app/addons/components/components/codeeditorpanel.js
+++ /dev/null
@@ -1,145 +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.
-import React from "react";
-import ReactDOM from "react-dom";
-import {CodeEditor} from './codeeditor';
-import {Beautify} from './beautify';
-import {ZenModeOverlay} from './zenmodeoverlay';
-
-
-// list of JSHINT errors to ignore: gets around problem of anonymous functions not being valid
-const ignorableErrors = [
- 'Missing name in function declaration.',
- "['{a}'] is better written in dot notation."
-];
-
-/**
- * A pre-packaged JS editor panel for use on the Edit Index / Mango pages. Includes options for a title, zen mode
- * icon and beautify button.
- */
-export class CodeEditorPanel extends React.Component {
- static defaultProps = {
- id: 'code-editor',
- className: '',
- defaultCode: '',
- title: '',
- docLink: '',
- allowZenMode: true,
- blur () {}
- };
-
- getStoreState = () => {
- return {
- zenModeEnabled: false,
- code: this.props.defaultCode
- };
- };
-
- UNSAFE_componentWillReceiveProps(nextProps) {
- if (nextProps.defaultCode !== this.props.defaultCode) {
- this.setState({ code: nextProps.defaultCode });
- }
- }
-
- getZenModeIcon = () => {
- if (this.props.allowZenMode) {
- return <span className="fonticon fonticon-resize-full zen-editor-icon" title="Enter Zen mode" onClick={this.enterZenMode}></span>;
- }
- };
-
- getDocIcon = () => {
- if (this.props.docLink) {
- return (
- <a className="help-link"
- data-bypass="true"
- href={this.props.docLink}
- target="_blank"
- rel="noopener noreferrer"
- >
- <i className="icon-question-sign"></i>
- </a>
- );
- }
- };
-
- getZenModeOverlay = () => {
- if (this.state.zenModeEnabled) {
- return (
- <ZenModeOverlay
- defaultCode={this.state.code}
- mode={this.props.mode}
- ignorableErrors={ignorableErrors}
- onExit={this.exitZenMode} />
- );
- }
- };
-
- enterZenMode = () => {
- this.setState({
- zenModeEnabled: true,
- code: this.codeEditor.getValue()
- });
- };
-
- exitZenMode = (content) => {
- this.setState({ zenModeEnabled: false });
- this.getEditor().setValue(content);
- };
-
- getEditor = () => {
- return this.codeEditor;
- };
-
- getValue = () => {
- return this.getEditor().getValue();
- };
-
- beautify = (code) => {
- this.setState({ code: code });
- this.getEditor().setValue(code);
- };
-
- update = () => {
- this.getEditor().setValue(this.state.code);
- };
-
- state = this.getStoreState();
-
- render() {
- var classes = 'control-group';
- if (this.props.className) {
- classes += ' ' + this.props.className;
- }
- return (
- <div className={classes}>
- <label>
- <span>{this.props.title}</span>
- {this.getDocIcon()}
- {this.getZenModeIcon()}
- </label>
- <CodeEditor
- id={this.props.id}
- ref={node => this.codeEditor = node}
- mode="javascript"
- defaultCode={this.state.code}
- showGutter={true}
- ignorableErrors={ignorableErrors}
- setHeightToLineCount={true}
- maxLines={10000}
- blur={this.props.blur}
- />
- <Beautify code={this.state.code} beautifiedCode={this.beautify} />
- {this.getZenModeOverlay()}
- </div>
- );
- }
-}
diff --git a/app/addons/components/components/confirmbutton.js b/app/addons/components/components/confirmbutton.js
deleted file mode 100644
index 1846592..0000000
--- a/app/addons/components/components/confirmbutton.js
+++ /dev/null
@@ -1,66 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-
-export class ConfirmButton extends React.Component {
- static propTypes = {
- showIcon: PropTypes.bool,
- id: PropTypes.string,
- customIcon: PropTypes.string,
- style: PropTypes.object,
- buttonType: PropTypes.string,
- 'data-id': PropTypes.string,
- onClick: PropTypes.func,
- disabled: PropTypes.bool,
- };
-
- static defaultProps = {
- disabled: false,
- showIcon: true,
- customIcon: 'fonticon-ok-circled',
- buttonType: 'btn-primary',
- style: {},
- 'data-id': null,
- onClick () { }
- };
-
- getIcon = () => {
- if (!this.props.showIcon) {
- return null;
- }
- return (
- <i className={"icon " + this.props.customIcon} />
- );
- };
-
- render() {
- const { onClick, buttonType, id, style, text, disabled } = this.props;
- return (
- <button
- onClick={onClick}
- type="submit"
- disabled={disabled}
- data-id={this.props['data-id']}
- className={'btn save ' + buttonType}
- id={id}
- style={style}
- >
- {this.getIcon()}
- {text}
- </button>
- );
- }
-}
diff --git a/app/addons/components/components/copy.js b/app/addons/components/components/copy.js
deleted file mode 100644
index 85b9f42..0000000
--- a/app/addons/components/components/copy.js
+++ /dev/null
@@ -1,103 +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.
-
-import PropTypes from 'prop-types';
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import Clipboard from 'clipboard';
-
-let clipboard;
-
-// Locates the specific element on the DOM, configures the clipboard, and
-// sets the callback on 'success' (usually a Fauxton notification).
-export const initializeClipboard = (uniqueKey, cb) => {
- clipboard = new Clipboard('#copy-' + uniqueKey);
- clipboard.on('success', function() {
- cb();
- });
-};
-
-// Cleans up the fake elements left around by clipboard.js
-export const destroyClipboard = () => {
- clipboard.destroy();
-};
-
-export class Copy extends React.Component {
- componentDidMount () {
- initializeClipboard(this.props.uniqueKey, this.props.onClipboardClick);
- }
-
- componentWillUnmount () {
- destroyClipboard();
- }
-
- // Necessary for copy elements that are not unmounted even though they are
- // no longer visible (ex. Notification rows in the notification center).
- componentDidUpdate () {
- initializeClipboard(this.props.uniqueKey, this.props.onClipboardClick);
- }
-
- getClipboardElement () {
- if (this.props.displayType === 'icon') {
- return (<i aria-hidden="true" className="fontawesome icon-paste"></i>);
- }
- return this.props.textDisplay;
- }
-
- getClipboardButton () {
- const btnClasses = this.props.displayType === 'input' ? "btn copy-button" : "copy" + " clipboard-copy-element";
- return (
- <button
- aria-label="Copy to Clipboard"
- className={btnClasses}
- data-clipboard-text={this.props.text}
- title={this.props.title}
- id={"copy-" + this.props.uniqueKey}
- >
- {this.getClipboardElement()}
- </button>
- );
- }
-
- render () {
- if (this.props.displayType === 'input') {
- return (
- <p>
- <input
- type="text"
- className="input-xxlarge text-field-to-copy"
- readOnly
- value={this.props.text} />
- {this.getClipboardButton()}
- </p>
- );
- }
- return (
- this.getClipboardButton()
- );
- }
-}
-
-Copy.defaultProps = {
- displayType: 'icon',
- textDisplay: 'Copy',
- title: 'Copy to clipboard',
- onClipboardClick: function () { }
-};
-
-Copy.propTypes = {
- text: PropTypes.string.isRequired,
- displayType: PropTypes.oneOf(['icon', 'text', 'input']),
- uniqueKey: PropTypes.string.isRequired,
- onClipboardClick: PropTypes.func.isRequired
-};
diff --git a/app/addons/components/components/deletedatabasemodal.js b/app/addons/components/components/deletedatabasemodal.js
deleted file mode 100644
index 004ad68..0000000
--- a/app/addons/components/components/deletedatabasemodal.js
+++ /dev/null
@@ -1,119 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-import {Modal} from "react-bootstrap";
-import Actions from "../actions";
-
-export class DeleteDatabaseModal extends React.Component {
- static propTypes = {
- showHide: PropTypes.func.isRequired,
- modalProps: PropTypes.object,
- onSuccess: PropTypes.func
- };
-
- state = {
- inputValue: '',
- disableSubmit: true
- };
-
- close = (e) => {
- if (e) {
- e.preventDefault();
- }
-
- this.setState({
- inputValue: '',
- disableSubmit: true
- });
-
- this.props.showHide({showModal: false});
- };
-
- open = () => {
- this.props.showHide({showModal: true});
- };
-
- getDatabaseName = () => {
- return this.props.modalProps.dbId.trim();
- };
-
- onInputChange = (e) => {
- const val = e.target.value.trim();
-
- this.setState({
- inputValue: val
- });
-
- this.setState({
- disableSubmit: val !== this.getDatabaseName()
- });
- };
-
- onDeleteClick = (e) => {
- e.preventDefault();
-
- Actions.deleteDatabase(this.getDatabaseName(), this.props.onSuccess);
- };
-
- onInputKeypress = (e) => {
- if (e.keyCode === 13 && this.state.disableSubmit !== true) {
- Actions.deleteDatabase(this.getDatabaseName(), this.props.onSuccess);
- }
- };
-
- render() {
- var isSystemDatabase = this.props.modalProps.isSystemDatabase;
- var showDeleteModal = this.props.modalProps.showDeleteModal;
- var dbId = this.props.modalProps.dbId;
-
- var warning = isSystemDatabase ? (
- <p style={{color: '#d14'}} className="warning">
- <b>You are about to delete a system database, be careful!</b>
- </p>
- ) : null;
-
- return (
- <Modal dialogClassName="delete-db-modal" show={showDeleteModal} onHide={this.close}>
- <Modal.Header closeButton={true}>
- <Modal.Title>Confirm Deletion</Modal.Title>
- </Modal.Header>
- <Modal.Body>
- {warning}
- <p>
- Warning: This action will permanently delete <code>{dbId}</code>.
- To confirm the deletion of the database and all of the
- database's documents, you must enter the database's name.
- </p>
- <input
- type="text"
- className="input-block-level"
- onKeyUp={this.onInputKeypress}
- onChange={this.onInputChange}
- autoFocus={true} />
- </Modal.Body>
- <Modal.Footer>
- <a href="#" onClick={this.close} data-bypass="true" className="cancel-link">Cancel</a>
- <button
- disabled={this.state.disableSubmit}
- onClick={this.onDeleteClick}
- className="btn btn-danger delete">
- <i className="icon icon-trash" /> Delete Database
- </button>
- </Modal.Footer>
- </Modal>
- );
- }
-}
diff --git a/app/addons/components/components/document.js b/app/addons/components/components/document.js
deleted file mode 100644
index abb6a68..0000000
--- a/app/addons/components/components/document.js
+++ /dev/null
@@ -1,148 +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.
-
-import classnames from 'classnames';
-import PropTypes from 'prop-types';
-import React from 'react';
-import FauxtonAPI from '../../../core/api';
-import Constants from '../../documents/constants';
-import Helpers from '../../documents/helpers';
-
-export class Document extends React.Component {
- static propTypes = {
- docIdentifier: PropTypes.string.isRequired,
- docType: PropTypes.string,
- docChecked: PropTypes.func.isRequired,
- truncate: PropTypes.bool,
- maxRows: PropTypes.number,
- resultsStyle: PropTypes.object
- };
-
- static defaultProps = {
- truncate: true,
- maxRows: 500,
- resultsStyle: {
- fontSize: Constants.INDEX_RESULTS_STYLE.FONT_SIZE_MEDIUM
- },
- docType: Constants.INDEX_RESULTS_DOC_TYPE.VIEW
- };
-
- onChange = (e) => {
- e.preventDefault();
- this.props.docChecked(this.props.doc.id, this.props.doc._rev);
- };
-
- getUrlFragment = () => {
- if (!this.props.children) {
- return '';
- }
-
- return (
- <div className="doc-edit-symbol pull-right" title="Edit document">
- {this.props.children}
- </div>
- );
- };
-
- getExtensionIcons = () => {
- var extensions = FauxtonAPI.getExtensions('DocList:icons');
- return _.map(extensions, (Extension, i) => {
- return (<Extension doc={this.props.doc} key={i} />);
- });
- };
-
- getDocumentTypeIcon = () => {
- if (this.props.docType === Constants.INDEX_RESULTS_DOC_TYPE.MANGO_INDEX) {
- if (this.props.docContent.includes(`"partitioned": true`)) {
- return <i className="fonticon-documents" title="Partitioned index"></i>;
- }
- return <i className="fonticon-document" title="Global index"></i>;
- }
- return null;
- };
-
- getCheckbox = () => {
- if (!this.props.isDeletable) {
- return <div className="checkbox-dummy"></div>;
- }
-
- return (
- <div className="checkbox inline">
- <input
- id={'checkbox-' + this.props.docIdentifier}
- checked={this.props.checked}
- data-checked={this.props.checked}
- type="checkbox"
- onChange={this.onChange}
- className="js-row-select" />
- <label onClick={this.onChange}
- className="label-checkbox-doclist"
- htmlFor={'checkbox-' + this.props.docIdentifier} />
- </div>
- );
- };
-
- onClick = (e) => {
- this.props.onClick(this.props.docIdentifier, this.props.doc, e);
- };
-
- getDocContent = () => {
- if (_.isEmpty(this.props.docContent)) {
- return null;
- }
-
- // if need be, truncate the document
- var content = this.props.docContent;
- var isTruncated = false;
- if (this.props.truncate) {
- var result = Helpers.truncateDoc(this.props.docContent, this.props.maxRows);
- isTruncated = result.isTruncated;
- content = result.content;
- }
- const { fontSize } = this.props.resultsStyle;
- const classNames = classnames('prettyprint', {
- 'prettyprint--small': fontSize === Constants.INDEX_RESULTS_STYLE.FONT_SIZE_SMALL,
- 'prettyprint--large': fontSize === Constants.INDEX_RESULTS_STYLE.FONT_SIZE_LARGE
- });
- return (
- <div className="doc-data">
- <pre className={classNames}>{content}</pre>
- {isTruncated ? <div className="doc-content-truncated">(truncated)</div> : null}
- </div>
- );
- };
-
- render() {
- return (
- <div data-id={this.props.docIdentifier} className="doc-row">
- <div className="custom-inputs">
- {this.getCheckbox()}
- </div>
- <div className="doc-item">
- <header onClick={this.onClick}>
- <span className="header-keylabel">
- {this.getDocumentTypeIcon()}
- {this.props.keylabel}
- </span>
- <span className="header-doc-id">
- {this.props.header ? '"' + this.props.header + '"' : null}
- </span>
- {this.getUrlFragment()}
- <div className="doc-item-extension-icons pull-right">{this.getExtensionIcons()}</div>
- </header>
- {this.getDocContent()}
- </div>
- <div className="clearfix"></div>
- </div>
- );
- }
-}
diff --git a/app/addons/components/components/loadlines.js b/app/addons/components/components/loadlines.js
deleted file mode 100644
index 0fa2b74..0000000
--- a/app/addons/components/components/loadlines.js
+++ /dev/null
@@ -1,21 +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.
-import React from "react";
-import ReactDOM from "react-dom";
-
-export const LoadLines = () =>
- <div className="loading-lines">
- <div id="line1"> </div>
- <div id="line2"> </div>
- <div id="line3"> </div>
- <div id="line4"> </div>
- </div>;
diff --git a/app/addons/components/components/menudropdown.js b/app/addons/components/components/menudropdown.js
deleted file mode 100644
index 8df4c23..0000000
--- a/app/addons/components/components/menudropdown.js
+++ /dev/null
@@ -1,154 +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.
-
-import classnames from 'classnames';
-import PropTypes from 'prop-types';
-import React from "react";
-import { Button, Dropdown } from "react-bootstrap";
-import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper';
-
-export class MenuDropDown extends React.Component {
- static defaultProps = {
- icon: 'fonticon-plus-circled',
- hideArrow: false,
- toggleType: 'link'
- };
-
- static propTypes = {
- icon: PropTypes.string,
- hideArrow: PropTypes.bool,
- links: PropTypes.array.isRequired,
- toggleType: PropTypes.string.isRequired
- };
-
- createSectionLinks = (links) => {
- if (!links) { return null; }
-
- return links.map((link, key) => {
- return this.createEntry(link, key);
- });
- };
-
- createEntry = (link, key) => {
- return (
- <li key={key}>
- <a className={classnames('icon', link.icon, { 'fonticon-placeholder': !link.icon})}
- data-bypass={link.external ? 'true' : ''}
- href={link.url}
- onClick={link.onClick}
- target={link.external ? '_blank' : ''}>
- {link.title}
- </a>
- </li>
- );
- };
-
- createSectionTitle = (title, key) => {
- if (!title) {
- return null;
- }
-
- return (
- <li key={key} className="header-label">{title}</li>
- );
- };
-
- createSection = () => {
- return this.props.links.map((linkSection, key) => {
- if (linkSection.title && linkSection.links) {
- return ([
- this.createSectionTitle(linkSection.title, 'title_' + key),
- this.createSectionLinks(linkSection.links)
- ]);
- }
- return this.createEntry(linkSection, 'el' + key);
- });
- };
-
- render() {
- const menuItems = this.createSection();
- const arrowClass = this.props.hideArrow ? '' : 'arrow';
- const CustomMenuToggle = this.props.toggleType === 'button' ? CustomMenuButtonToggle : CustomMenuLinkToggle;
- return (
- <Dropdown id="dropdown-menu">
- <CustomMenuToggle bsRole="toggle" icon={this.props.icon}>
- </CustomMenuToggle>
- <CustomMenu bsRole="menu" className={arrowClass}>
- {menuItems}
- </CustomMenu>
- </Dropdown>
- );
- }
-}
-
-class CustomMenuButtonToggle extends React.Component {
- constructor(props, context) {
- super(props, context);
- this.handleClick = this.handleClick.bind(this);
- }
-
- handleClick(e) {
- e.preventDefault();
- this.props.onClick(e);
- }
-
- render() {
- return (
- <Button
- onClick={this.handleClick}>
- <i className={"dropdown-toggle " + this.props.icon}
- style={{ fontSize: '1rem', boxShadow: '0px 0px 0px' }}>
- </i>
- {this.props.children}
- </Button>
- );
- }
-}
-
-class CustomMenuLinkToggle extends React.Component {
- constructor(props, context) {
- super(props, context);
- this.handleClick = this.handleClick.bind(this);
- }
-
- handleClick(e) {
- e.preventDefault();
- this.props.onClick(e);
- }
-
- render() {
- return (
- <a className={"dropdown-toggle icon " + this.props.icon}
- style={{ fontSize: '1rem', boxShadow: '0px 0px 0px' }}
- onClick={this.handleClick}>
- {this.props.children}
- </a>
- );
- }
-}
-
-export class CustomMenu extends React.Component {
- constructor(props, context) {
- super(props, context);
- }
-
- render() {
- const { children, open, onClose, className } = this.props;
- return (
- <RootCloseWrapper disabled={!open} onRootClose={onClose}>
- <ul className={classnames('dropdown-menu', className)} role="menu" aria-labelledby="dLabel">
- {children}
- </ul>
- </RootCloseWrapper>
- );
- }
-}
diff --git a/app/addons/components/components/paddedborderbox.js b/app/addons/components/components/paddedborderbox.js
deleted file mode 100644
index 166e129..0000000
--- a/app/addons/components/components/paddedborderbox.js
+++ /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.
-import React from "react";
-import ReactDOM from "react-dom";
-
-export class PaddedBorderedBox extends React.Component {
- render() {
- return (
- <div className="bordered-box">
- <div className="padded-box">
- {this.props.children}
- </div>
- </div>
- );
- }
-}
diff --git a/app/addons/components/components/polling.js b/app/addons/components/components/polling.js
deleted file mode 100644
index 26859a1..0000000
--- a/app/addons/components/components/polling.js
+++ /dev/null
@@ -1,149 +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.
-
-import PropTypes from 'prop-types';
-import React from 'react';
-import Slider from 'rc-slider';
-
-let pollIntervalId;
-
-export const clearPollCounter = () => {
- if (pollIntervalId) {
- window.clearInterval(pollIntervalId);
- }
-};
-
-export const resetPollCounter = (time, cb) => {
- clearPollCounter();
- pollIntervalId = window.setInterval(cb, time);
-};
-
-const getCountdown = (secsString, units, max, min) => {
- const secs = parseInt(secsString, 10);
- if (secs === 0 || secs > max || secs < min) {
- return 'off';
- }
-
- if (secs < 60 && units === 'minute') {
- return `${secs} seconds`;
- }
-
- let displayValue = secs;
- if (units === 'minute') {
- displayValue = Math.floor(secs / 60);
- }
- return `${displayValue} ${displayValue === 1 ? units : `${units}s`}`;
-};
-
-export class Polling extends React.Component {
- constructor (props) {
- super(props);
- this.state = {
- value: this.props.startValue
- };
- this.updatePollingFreq = this.updatePollingFreq.bind(this);
- }
-
- componentDidMount () {
- this.setPollingCounter(this.state.value);
- }
-
- componentWillUnmount () {
- clearPollCounter();
- }
-
- setPollingCounter (value) {
- const {min, max, onPoll} = this.props;
- this.setState({value: value});
-
- if (value === 0 || value < min || value > max) {
- clearPollCounter();
- return;
- }
-
- resetPollCounter(value * 1000, () => onPoll());
- }
-
- updatePollingFreq (newValue) {
- this.setPollingCounter(parseInt(newValue, 10));
- }
-
- UNSAFE_componentWillReceiveProps(nextProps) {
- if (this.props.startValue !== nextProps.startValue) {
- this.setPollingCounter(nextProps.startValue);
- }
- }
-
- render () {
- const {
- stepSize,
- min,
- max,
- valueUnits
- } = this.props;
-
- const {value} = this.state;
-
- const pollValue = getCountdown(value, valueUnits, max, min);
- const pollStyle = pollValue === 'off' ? 'faux__polling-info-value--off' : 'faux__polling-info-value--active';
- return (
- <div className='faux__polling'>
- <div className='faux__polling-info'>
- <span className='faux__polling-info-text'>Polling Interval</span>
- <span className={`faux__polling-info-value faux__polling-info-value ${pollStyle}`}>{pollValue}</span>
- </div>
- <Slider
- className="faux__polling-info-slider"
- min={min}
- max={max + stepSize}
- defaultValue={value}
- onChange={this.updatePollingFreq}
- />
- </div>
- );
- }
-}
-
-Polling.defaultProps = {
- startValue: 0,
- min: 0,
- valueUnits: 'minute'
-};
-
-Polling.propTypes = {
- startValue: PropTypes.number,
- valueUnits: PropTypes.string,
- min: PropTypes.number,
- max: PropTypes.number.isRequired,
- stepSize: PropTypes.number.isRequired,
- onPoll: PropTypes.func.isRequired,
-};
-
-export const RefreshBtn = ({refresh}) =>
- <div className="faux__refresh-btn">
- <a
- className="faux__refresh-link"
- href="#"
- data-bypass="true"
- onClick={e => {
- e.preventDefault();
- refresh();
- }}
- >
- <i className="faux__refresh-icon fonticon-arrows-cw"></i>
- Refresh
- </a>
- </div>;
-
-RefreshBtn.propTypes = {
- refresh: PropTypes.func.isRequired
-};
diff --git a/app/addons/components/components/stringeditmodal.js b/app/addons/components/components/stringeditmodal.js
deleted file mode 100644
index df5877d..0000000
--- a/app/addons/components/components/stringeditmodal.js
+++ /dev/null
@@ -1,90 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-import {Modal} from "react-bootstrap";
-import ace from "brace";
-import Helpers from "../../documents/helpers";
-require('brace/mode/javascript');
-require('brace/mode/json');
-require('brace/theme/idle_fingers');
-
-// this appears when the cursor is over a string. It shows an icon in the gutter that opens the modal.
-export class StringEditModal extends React.Component {
- static propTypes = {
- value: PropTypes.string.isRequired,
- visible: PropTypes.bool.isRequired,
- onClose: PropTypes.func.isRequired,
- onSave: PropTypes.func.isRequired
- };
-
- static defaultProps = {
- visible: false,
- onClose () { },
- onSave () { }
- };
-
- state = {
- editorInitialized: false
- };
-
- initAceEditor = (dom_node) => {
- this.editor = ace.edit(dom_node);
- this.editor.$blockScrolling = Infinity; // suppresses an Ace editor error
- this.editor.setShowPrintMargin(false);
- this.editor.setOption('highlightActiveLine', true);
- this.editor.setTheme('ace/theme/idle_fingers');
- const val = Helpers.parseJSON(this.props.value);
- this.editor.setValue(val, -1);
- if (!this.state.editorInitialized) {
- this.setState({ editorInitialized: true });
- }
- };
-
- closeModal = () => {
- this.props.onClose();
- };
-
- save = () => {
- this.props.onSave(this.editor.getValue());
- };
-
- getSaveBtn = () => {
- return this.state.editorInitialized && (
- <button id="string-edit-save-btn" onClick={this.save} className="btn btn-primary save">
- <i className="fonticon-circle-check"></i> Modify Text
- </button>);
- };
-
- render() {
- return (
- <Modal className="string-editor-modal" show={this.props.visible} onHide={this.closeModal}>
- <Modal.Header closeButton={true}>
- <Modal.Title>Edit Value <span id="string-edit-header"></span></Modal.Title>
- </Modal.Header>
- <Modal.Body>
- <div id="modal-error" className="hide alert alert-error"/>
- <div id="string-editor-wrapper">
- <div id="string-editor-container" ref={node => this.initAceEditor(node)} className="doc-code"></div>
- </div>
- </Modal.Body>
- <Modal.Footer>
- <a className="cancel-link" onClick={this.closeModal}>Cancel</a>
- { this.getSaveBtn() }
- </Modal.Footer>
- </Modal>
- );
- }
-}
diff --git a/app/addons/components/components/styledselect.js b/app/addons/components/components/styledselect.js
deleted file mode 100644
index 5a4d5c5..0000000
--- a/app/addons/components/components/styledselect.js
+++ /dev/null
@@ -1,42 +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.
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-
-export class StyledSelect extends React.Component {
- static propTypes = {
- selectValue: PropTypes.string.isRequired,
- selectId: PropTypes.string.isRequired,
- selectChange: PropTypes.func.isRequired
- };
-
- render() {
- return (
- <div className="styled-select">
- <label htmlFor={this.props.selectId}>
- <i className="fonticon-down-dir styled-select-icon"></i>
- <i className="fonticon-down-dir styled-select-hover-icon"></i>
- <select
- value={this.props.selectValue}
- id={this.props.selectId}
- className={this.props.selectValue}
- onChange={this.props.selectChange}
- >
- {this.props.selectContent}
- </select>
- </label>
- </div>
- );
- }
-}
diff --git a/app/addons/components/components/tabelement.js b/app/addons/components/components/tabelement.js
deleted file mode 100644
index 37f1e72..0000000
--- a/app/addons/components/components/tabelement.js
+++ /dev/null
@@ -1,62 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import ReactDOM from "react-dom";
-
-export const TabElement = ({selected, text, onChange, iconClass, badgeText}) => {
-
- const additionalClass = selected ? 'tab-element-checked' : '';
- let badge = null;
- if (badgeText) {
- badge = <span className="tab-element-badge">{badgeText}</span>;
- }
- return (
- <li className={`component-tab-element ${additionalClass}`}>
-
- <label>
- <div className="tab-element-indicator-wrapper">
- <div className="tab-element-indicator"></div>
- </div>
- <div className="tab-element-content">
- <i className={iconClass}></i>
- <input
- type="radio"
- value={text}
- checked={selected}
- onChange={onChange} />
-
- {text}
- {badge}
- </div>
- </label>
- </li>
-
- );
-};
-TabElement.propTypes = {
- selected: PropTypes.bool.isRequired,
- text: PropTypes.string.isRequired,
- onChange: PropTypes.func.isRequired,
- iconClass: PropTypes.string,
- badgeText: PropTypes.string
-};
-
-export const TabElementWrapper = ({children}) => {
- return (
- <ul className="component-tab-element-wrapper">
- {children}
- </ul>
- );
-};
diff --git a/app/addons/components/components/tabwindowwrapper.js b/app/addons/components/components/tabwindowwrapper.js
deleted file mode 100644
index 3a7d4a4..0000000
--- a/app/addons/components/components/tabwindowwrapper.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import FauxtonAPI from '../../../core/api';
-import PropTypes from 'prop-types';
-import React from 'react';
-import {TabElement, TabElementWrapper} from './tabelement';
-
-
-export class TabWindowWrapper extends React.Component {
-
- constructor (props) {
- super(props);
- }
-
- render () {
- const {selectedTab, tabs} = this.props;
-
- const elements = tabs.map((tab, i) => {
-
- return (
- <TabElement
- key={i}
- selected={tab.name === selectedTab}
- text={tab.name}
- badgeText={tab.badgeText}
- onChange={() => { FauxtonAPI.navigate(tab.route, {redirect: true}); }}
- iconClass="" />
- );
- });
-
- const selectedPage = tabs.reduce((acc, el) => {
- if (el.name === selectedTab) {
- return el;
- }
- return acc;
- }, {});
-
- if (!selectedPage.component) {
- return null;
- }
-
- return (
- <div className="tab__wrapper">
- <TabElementWrapper>
- {elements}
- </TabElementWrapper>
-
- <div className="tab__container">
- <selectedPage.component />
- </div>
- </div>
- );
- }
-
-}
-
-TabWindowWrapper.propTypes = {
- tabs: PropTypes.array.isRequired,
- selectedTab: PropTypes.string.isRequired
-};
diff --git a/app/addons/components/components/throttledreacselect.js b/app/addons/components/components/throttledreacselect.js
deleted file mode 100644
index a5df5e7..0000000
--- a/app/addons/components/components/throttledreacselect.js
+++ /dev/null
@@ -1,50 +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.
-
-import React from "react";
-import ReactDOM from "react-dom";
-import ReactSelect from "react-select";
-
-export class ThrottledReactSelectAsync extends React.Component {
- constructor(props) {
- super(props);
- this.lastCall = undefined;
- }
-
- wrapThrottler(loadOptions) {
- if (!loadOptions) {
- return () => {};
- }
- return (id, callback) => {
- if (this.lastCall) {
- clearTimeout(this.lastCall);
- }
- this.lastCall = setTimeout(() => {
- loadOptions(id, callback);
- }, 400);
- };
- }
-
- render() {
- // wrapThrottler() must be called here to ensure a new
- // function is created when props.loadOptions is updated
- const throttledLoadOptions = this.wrapThrottler(
- this.props.loadOptions
- ).bind(this);
- const newProps = {
- ...this.props,
- loadOptions: throttledLoadOptions,
- onBlurResetsInput: false
- };
- return <ReactSelect.Async {...newProps} />;
- }
-}
diff --git a/app/addons/components/components/toggleheaderbutton.js b/app/addons/components/components/toggleheaderbutton.js
deleted file mode 100644
index 6f0a51e..0000000
--- a/app/addons/components/components/toggleheaderbutton.js
+++ /dev/null
@@ -1,44 +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.
-
-import React from "react";
-import ReactDOM from "react-dom";
-
-export class ToggleHeaderButton extends React.Component {
- static defaultProps = {
- innerClasses: '',
- fonticon: '',
- containerClasses: '',
- selected: false,
- title: '',
- disabled: false,
- toggleCallback: null,
- text: '',
- iconDefaultClass: 'icon'
- };
-
- render() {
- const { iconDefaultClass, fonticon, innerClasses, selected, containerClasses, title, disabled, text, toggleCallback, active } = this.props;
- const selectedBtnClass = (selected || active) ? 'js-headerbar-togglebutton-selected' : '';
-
- return (
- <button
- title={title}
- disabled={disabled}
- onClick={toggleCallback}
- className={`button ${containerClasses} ${selectedBtnClass}`}
- >
- <i className={`${iconDefaultClass} ${fonticon} ${innerClasses}`}></i><span>{text}</span>
- </button>
- );
- }
-}
diff --git a/app/addons/components/components/tray.js b/app/addons/components/components/tray.js
deleted file mode 100644
index e37d18e..0000000
--- a/app/addons/components/components/tray.js
+++ /dev/null
@@ -1,162 +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.
-
-import PropTypes from 'prop-types';
-
-import React from "react";
-import {Overlay} from 'react-bootstrap';
-import {TransitionMotion, spring} from 'react-motion';
-
-export class TrayContents extends React.Component {
- static propTypes = {
- contentVisible: PropTypes.bool.isRequired,
- closeTray: PropTypes.func.isRequired,
- onEnter: PropTypes.func,
- container: PropTypes.object
- };
-
- static defaultProps = {
- onEnter: () => {}
- };
-
- constructor (props) {
- super(props);
- if (!props.container) {
- this.container = this;
- }
- }
-
- getChildren = (items) => {
- const {style} = items[0];
- const className = "tray show-tray " + this.props.className;
- return (
- <div key={'1'} id={this.props.id} style={{opacity: style.opacity, top: style.top + 'px'}} className={className}>
- {this.props.children}
- </div>);
- };
-
- willEnter = () => {
- return {
- opacity: spring(1),
- top: spring(64)
- };
- };
-
- willLeave = () => {
- return {
- opacity: spring(0),
- top: spring(30)
- };
- };
-
- getDefaultStyles = () => {
- return [{key: '1', style: {opacity: 0, top: 30}}];
- };
-
- getStyles = (prevStyle) => {
- if (!prevStyle) {
- return [{
- key: '1',
- style: this.willEnter()
- }];
- }
- return prevStyle.map(item => {
- return {
- key: '1',
- style: item.style
- };
- });
- };
-
- render() {
- return (
- <Overlay
- show={this.props.contentVisible}
- onHide={this.props.closeTray}
- placement={"bottom"}
- container={this.props.container}
- rootClose={true}
- onEnter={this.props.onEnter}
- >
- <TransitionMotion
- defaultStyles={this.getDefaultStyles()}
- styles={this.getStyles()}
- willLeave={this.willLeave}
- willEnter={this.willEnter}
- >
- {this.getChildren}
- </TransitionMotion>
- </Overlay>
- );
- }
-}
-
-
-export const connectToStores = (Component, stores, getStateFromStores) => {
- class WrappingElement extends React.Component {
- state = getStateFromStores(this.props);
-
- componentDidMount() {
- stores.forEach(store => {
- store.on('change', this.onChange, this);
- });
- }
-
- componentWillUnmount() {
- stores.forEach(function (store) {
- store.off('change', this.onChange);
- }.bind(this));
- }
-
- onChange = () => {
- this.setState(getStateFromStores(this.props));
- };
-
- handleStoresChanged = () => {
- this.setState(getStateFromStores(this.props));
- };
-
- render() {
- return <Component {...this.state} {...this.props} />;
- }
- }
-
- return WrappingElement;
-};
-
-export class TrayWrapper extends React.Component {
- static defaultProps = {
- className: ''
- };
-
- renderChildren = () => {
- return React.Children.map(this.props.children, (child) => {
-
- const props = {};
- Object.keys(this.props).filter((k) => {
- return Object.prototype.hasOwnProperty.call(this.props, k);
- }).map((k) => {
- return props[k] = this.props[k];
- });
-
- return React.cloneElement(child, props);
- });
- };
-
- render() {
- return (
- <div>
- {this.renderChildren()}
- </div>
- );
- }
-}
diff --git a/app/addons/components/components/zenmodeoverlay.js b/app/addons/components/components/zenmodeoverlay.js
deleted file mode 100644
index dceb24c..0000000
--- a/app/addons/components/components/zenmodeoverlay.js
+++ /dev/null
@@ -1,133 +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.
-import React from "react";
-import ReactDOM from "react-dom";
-import app from "../../../app";
-import {CodeEditor} from './codeeditor';
-import {Tooltip, OverlayTrigger} from 'react-bootstrap';
-
-require('brace/theme/dawn');
-
-const themes = {
- dark: 'idle_fingers',
- light: 'dawn'
-};
-// Zen mode editing has very few options:
-// - It covers the full screen, hiding everything else
-// - Two themes: light & dark (choice stored in local storage)
-// - No save option, but has a 1-1 map with a <CodeEditor /> element which gets updated when the user leaves
-// - [Escape] closes the mode, as does clicking the shrink icon at the top right
-export class ZenModeOverlay extends React.Component {
- static defaultProps = {
- mode: 'javascript',
- defaultCode: '',
- ignorableErrors: [],
- onExit: null,
- highlightActiveLine: false
- };
-
- getStoreState = () => {
- return {
- theme: this.getZenTheme(),
- code: this.props.defaultCode
- };
- };
-
- getZenTheme = () => {
- var selectedTheme = app.utils.localStorageGet('zenTheme');
- return _.isUndefined(selectedTheme) ? 'dark' : selectedTheme;
- };
-
- onChange = () => {
- this.setState(this.getStoreState());
- };
-
- exitZenMode = () => {
- this.props.onExit(this.getValue());
- };
-
- getValue = () => {
- return this.ace.getValue();
- };
-
- toggleTheme = () => {
- var newTheme = (this.state.theme === 'dark') ? 'light' : 'dark';
- this.setState({
- theme: newTheme,
- code: this.getValue()
- });
- app.utils.localStorageSet('zenTheme', newTheme);
- };
-
- setValue = (code, lineNumber) => {
- lineNumber = lineNumber ? lineNumber : -1;
- this.editor.setValue(code, lineNumber);
- };
-
- state = this.getStoreState();
-
- render() {
- var classes = 'full-page-editor-modal-wrapper zen-theme-' + this.state.theme;
-
- var editorCommands = [{
- name: 'close',
- bindKey: { win: 'ESC', mac: 'ESC' },
- exec: this.exitZenMode
- }];
-
- const tooltipExit = <Tooltip id="tooltip">
- Exit zen mode (`esc`)
- </Tooltip>;
-
- const tooltipTheme = <Tooltip id="tooltip">
- Switch zen theme
- </Tooltip>;
-
- return (
- <div className={classes}>
- <div className="zen-mode-controls">
- <ul>
- <li>
- <OverlayTrigger placement="left" overlay={tooltipExit}>
- <span
- className="fonticon fonticon-resize-small js-exit-zen-mode"
- data-container=".zen-mode-controls .tooltips"
- onClick={this.exitZenMode}>
- </span>
- </OverlayTrigger>
- </li>
- <li>
- <OverlayTrigger placement="left" overlay={tooltipTheme}>
- <span
- className="fonticon fonticon-picture js-toggle-theme"
- data-container=".zen-mode-controls .tooltips"
- title="Switch zen theme"
- onClick={this.toggleTheme}>
- </span>
- </OverlayTrigger>
- </li>
- </ul>
- <div className="tooltips"></div>
- </div>
- <CodeEditor
- ref={node => this.ace = node}
- autoFocus={true}
- theme={themes[this.state.theme]}
- defaultCode={this.props.defaultCode}
- editorCommands={editorCommands}
- ignorableErrors={this.props.ignorableErrors}
- highlightActiveLine={this.props.highlightActiveLine}
- />
- </div>
- );
- }
-}
diff --git a/app/addons/components/header-breadcrumbs.js b/app/addons/components/header-breadcrumbs.js
deleted file mode 100644
index 898b997..0000000
--- a/app/addons/components/header-breadcrumbs.js
+++ /dev/null
@@ -1,68 +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.
-
-import PropTypes from 'prop-types';
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-
-export const Breadcrumbs = ({crumbs}) => {
-
- return (
- <div className="faux-header__breadcrumbs">
- {getChildren(crumbs)}
- </div>
- );
-
-};
-
-Breadcrumbs.propTypes = {
- crumbs: PropTypes.array.isRequired
-};
-
-
-const CrumbElement = ({children}) => {
- return <div className="faux-header__breadcrumbs-element">{children}</div>;
-};
-
-const Divider = () => {
- return (
- <div className="fonticon-right-open faux-header__breadcrumbs-divider"></div>
- );
-};
-
-function getChildren (crumbs) {
- const amountDividers = crumbs.length - 1;
-
- return crumbs.map((c, i) => {
-
... 101186 lines suppressed ...