From 454a8b7796dd7baaca1c05dfb35e48499911f04e Mon Sep 17 00:00:00 2001 From: siemiatj Date: Mon, 22 Oct 2018 20:43:57 +0200 Subject: [PATCH] - fix when and how quickactions are fetched #2021 --- src/components/app/DocumentList.js | 4 +--- src/components/app/QuickActions.js | 17 +++++++++-------- src/utils/index.js | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/components/app/DocumentList.js b/src/components/app/DocumentList.js index 3caa8364d..82a75076e 100644 --- a/src/components/app/DocumentList.js +++ b/src/components/app/DocumentList.js @@ -787,9 +787,7 @@ class DocumentList extends Component { ); } - const showQuickActions = Boolean( - !isModal || inBackground || selectionValid - ); + const showQuickActions = true; return (
{ + this.mounted = true; + const { fetchOnInit, selected, @@ -51,13 +57,12 @@ class QuickActions extends Component { viewId, childView, parentView, - } = props; - this.state = initialState; + } = this.props; if (fetchOnInit) { this.fetchActions(windowType, viewId, selected, childView, parentView); } - } + }; componentWillUnmount = () => { this.mounted = false; @@ -86,10 +91,6 @@ class QuickActions extends Component { return nextProps.shouldNotUpdate !== true; } - componentDidMount = () => { - this.mounted = true; - } - componentDidUpdate = prevProps => { const { inBackground, inModal } = this.props; @@ -161,7 +162,7 @@ class QuickActions extends Component { return; } - if (windowType && viewId && selected && childView && parentView) { + if (windowType && viewId && childView && parentView) { quickActionsRequest(windowType, viewId, selected, childView, parentView) .then(response => { this.setState({ diff --git a/src/utils/index.js b/src/utils/index.js index ddaaf7e47..bf76844f2 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -7,7 +7,7 @@ export const getQueryString = query => if (Array.isArray(value) && value.length > 0) { parameters[key] = value.join(','); - } else { + } else if (value) { parameters[key] = value; }