diff --git a/src/actions/inputActions.js b/src/actions/inputActions.js index d0371be..06fa7fa 100644 --- a/src/actions/inputActions.js +++ b/src/actions/inputActions.js @@ -5,21 +5,21 @@ const inputActions = { // Handle changes to the document title input box - updateDocumentTitleInput: documentTitleInput => + updateDocumentTitleInput: input => ({ type: 'UPDATE_DOCUMENT_TITLE', - data: documentTitleInput.target.value + data: input.target.value }), - updateColorPickerInput: colorPickerInput => + updateColorPickerInput: input => ({ type: 'UPDATE_COLOR_PICKER', - data: colorPickerInput.target.value + data: input.target.value }), // Handle changes to the search input box - updateSearchInput: searchInput => + updateSearchInput: input => ({ type: 'UPDATE_SEARCH_INPUT', - data: searchInput.target.value + data: input.target.value }) } diff --git a/src/actions/userActions.js b/src/actions/userActions.js index 6fea71d..e7963c4 100644 --- a/src/actions/userActions.js +++ b/src/actions/userActions.js @@ -18,13 +18,12 @@ const userActions = { docType: docType }), // Click 'Submit' to save a document edit - submitDocumentEdit: (currentDocument, editorState, documentTitleInput, colorPickerInput, docType) => + submitDocumentEdit: (currentDocument, editorState, inputs, docType) => ({ type: 'SUBMIT_DOCUMENT_EDIT', currentDocument: currentDocument, editorState: editorState, - documentTitleInput: documentTitleInput, - colorPickerInput: colorPickerInput, + inputs: inputs, docType: docType }), // Click 'Cancel' to discard document changes @@ -62,10 +61,10 @@ const userActions = { mode: mode }), // Click 'Search' to request search results - clickSearch: searchInput => + clickSearch: inputs => ({ type: 'CLICK_SEARCH', - data: searchInput + data: inputs.search }), // Set the DocType to choose from in the Editor setDocType: docType => @@ -116,6 +115,10 @@ const userActions = { ({ type: 'CLEAR_ANNOTATION_TAG' }), + hideAdmin: () => + ({ + type: 'HIDE_ADMIN_HEADER' + }) } export default userActions \ No newline at end of file diff --git a/src/components/adminHeader.js b/src/components/adminHeader.js new file mode 100644 index 0000000..029ea7a --- /dev/null +++ b/src/components/adminHeader.js @@ -0,0 +1,28 @@ +import React from 'react' +import PropTypes from 'prop-types' + +import api from '../modules/api' + +import { ReaderAnnotateButton, ReaderEditButton, EditorToolButton, EditorDeleteToolButton, AnnotatorNewButton, AnnotatorRemoveButton } from './button' + +const refreshElasticsearch = () => { + api.HTTPGetRefreshList().then(response => + location.reload() + ) +} + +const AdminHeader = ({toggles, hideAdmin}) => +