aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/ui/flow.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/ducks/ui/flow.js')
-rw-r--r--web/src/js/ducks/ui/flow.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/web/src/js/ducks/ui/flow.js b/web/src/js/ducks/ui/flow.js
index f3489bee..fb2a846d 100644
--- a/web/src/js/ducks/ui/flow.js
+++ b/web/src/js/ducks/ui/flow.js
@@ -10,7 +10,8 @@ export const SET_CONTENT_VIEW = 'UI_FLOWVIEW_SET_CONTENT_VIEW',
UPDATE_EDIT = 'UI_FLOWVIEW_UPDATE_EDIT',
UPLOAD_CONTENT = 'UI_FLOWVIEW_UPLOAD_CONTENT',
SET_SHOW_FULL_CONTENT = 'UI_SET_SHOW_FULL_CONTENT',
- SET_CONTENT_VIEW_DESCRIPTION = "UI_SET_CONTENT_VIEW_DESCRIPTION"
+ SET_CONTENT_VIEW_DESCRIPTION = "UI_SET_CONTENT_VIEW_DESCRIPTION",
+ SET_CONTENT = "UI_SET_CONTENT"
const defaultState = {
@@ -20,6 +21,8 @@ const defaultState = {
modifiedFlow: false,
contentView: 'Auto',
tab: 'request',
+ content: [],
+ maxContentLines: 80,
}
export default function reducer(state = defaultState, action) {
@@ -94,6 +97,14 @@ export default function reducer(state = defaultState, action) {
showFullContent: action.contentView == 'Edit'
}
+ case SET_CONTENT:
+ let isFullContentShown = action.content.length < state.maxContentLines
+ return {
+ ...state,
+ content: action.content,
+ showFullContent: isFullContentShown
+ }
+
case DISPLAY_LARGE:
return {
...state,
@@ -136,6 +147,10 @@ export function updateEdit(update) {
return { type: UPDATE_EDIT, update }
}
+export function setContent(content){
+ return { type: SET_CONTENT, content}
+}
+
export function stopEdit(flow, modifiedFlow) {
let diff = getDiff(flow, modifiedFlow)
return flowsActions.update(flow, diff)