From b4bed57d4c7a48357009520a8dfae86a7c60b536 Mon Sep 17 00:00:00 2001 From: cle1000 Date: Wed, 8 Feb 2017 21:07:40 +0100 Subject: fix show_lines button visible in edit mode if you change tabs --- web/src/js/ducks/ui/flow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web') diff --git a/web/src/js/ducks/ui/flow.js b/web/src/js/ducks/ui/flow.js index b5f6f78b..fa7474d2 100644 --- a/web/src/js/ducks/ui/flow.js +++ b/web/src/js/ducks/ui/flow.js @@ -89,7 +89,7 @@ export default function reducer(state = defaultState, action) { ...state, tab: action.tab ? action.tab : 'request', displayLarge: false, - showFullContent: false + showFullContent: state.contentView == 'Edit' } case SET_CONTENT_VIEW: -- cgit v1.2.3 From fb06c664379fc009c68dc780120fe600cd74cf5f Mon Sep 17 00:00:00 2001 From: cle1000 Date: Wed, 8 Feb 2017 21:09:03 +0100 Subject: remove contentview selector and view description if edit mode is on --- web/src/js/components/ContentView/ContentViewOptions.jsx | 4 ++-- web/src/js/components/ContentView/ViewSelector.jsx | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) (limited to 'web') diff --git a/web/src/js/components/ContentView/ContentViewOptions.jsx b/web/src/js/components/ContentView/ContentViewOptions.jsx index 6bc66db2..1ec9013e 100644 --- a/web/src/js/components/ContentView/ContentViewOptions.jsx +++ b/web/src/js/components/ContentView/ContentViewOptions.jsx @@ -12,13 +12,13 @@ ContentViewOptions.propTypes = { function ContentViewOptions({ flow, message, uploadContent, readonly, contentViewDescription }) { return (
- + {readonly ? : View: edit}     {!readonly && }   - {contentViewDescription} + {readonly && {contentViewDescription}}
) } diff --git a/web/src/js/components/ContentView/ViewSelector.jsx b/web/src/js/components/ContentView/ViewSelector.jsx index fcdc3ee3..43a53995 100644 --- a/web/src/js/components/ContentView/ViewSelector.jsx +++ b/web/src/js/components/ContentView/ViewSelector.jsx @@ -1,6 +1,5 @@ import React, { PropTypes, Component } from 'react' import { connect } from 'react-redux' -import * as ContentViews from './ContentViews' import { setContentView } from '../../ducks/ui/flow'; import Dropdown from '../common/Dropdown' @@ -8,27 +7,20 @@ import Dropdown from '../common/Dropdown' ViewSelector.propTypes = { contentViews: PropTypes.array.isRequired, activeView: PropTypes.string.isRequired, - isEdit: PropTypes.bool.isRequired, setContentView: PropTypes.func.isRequired } -function ViewSelector ({contentViews, activeView, isEdit, setContentView}){ - let edit = ContentViews.Edit.displayName - let inner = View: {activeView} +function ViewSelector ({contentViews, activeView, setContentView}){ + let inner = View: {activeView.toLowerCase()} return ( {contentViews.map(name => - {e.preventDefault(); setContentView(name)}}> + {e.preventDefault(); setContentView(name)}}> {name.toLowerCase().replace('_', ' ')} ) } - {isEdit && - {e.preventDefault(); setContentView(edit)}}> - {edit.toLowerCase()} - - } ) } @@ -37,7 +29,6 @@ export default connect ( state => ({ contentViews: state.settings.contentViews, activeView: state.ui.flow.contentView, - isEdit: !!state.ui.flow.modifiedFlow, }), { setContentView, } -- cgit v1.2.3