From 299c723028aceafb3abfd68f6a5b97dd74b833e3 Mon Sep 17 00:00:00 2001 From: Alexandru Munteanu <alexandru.munt@gmail.com> Date: Tue, 27 Mar 2018 11:42:35 +0300 Subject: [PATCH] fix(dashboard-page): get handling editors only for admins and eics --- .../src/components/Dashboard/DashboardPage.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/components-faraday/src/components/Dashboard/DashboardPage.js b/packages/components-faraday/src/components/Dashboard/DashboardPage.js index 1e59c3c66..00a2fc968 100644 --- a/packages/components-faraday/src/components/Dashboard/DashboardPage.js +++ b/packages/components-faraday/src/components/Dashboard/DashboardPage.js @@ -10,16 +10,11 @@ import { newestFirst, selectCurrentUser } from 'xpub-selectors' import { createDraftSubmission } from 'pubsweet-component-wizard/src/redux/conversion' import Dashboard from './Dashboard' -import { getHandlingEditors } from '../../redux/editors' import withFilters from './withFilters' +import { getHandlingEditors } from '../../redux/editors' export default compose( - ConnectPage(() => [ - actions.getCollections(), - actions.getTeams(), - actions.getUsers(), - getHandlingEditors(), - ]), + ConnectPage(() => [actions.getCollections()]), connect( state => { const { collections, conversion } = state @@ -50,6 +45,12 @@ export default compose( createDraftSubmission: () => dispatch(createDraftSubmission(history)), }), ), + ConnectPage( + ({ currentUser }) => + get(currentUser, 'admin') || get(currentUser, 'editorInChief') + ? [getHandlingEditors()] + : [], + ), withRouter, withJournal, withFilters({ -- GitLab