diff --git a/src/index.js b/src/index.js index 1b8372f..08ddfb9 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,7 @@ import TaskGroupPicker from './pickers/TaskGroupPicker'; import TaskSearcher from './components/TaskSearcher'; import getAdminMainMenuContributions from './contributions/AdminMainMenuContributions'; import { TASK_ROUTE } from './constants'; +import { fetchTask } from './actions'; const ROUTE_TASKS_MANAGEMENT = 'tasks'; const ROUTE_TASK_MANAGEMENT = 'tasks/task'; @@ -40,6 +41,8 @@ const DEFAULT_CONFIG = { { key: 'tasksManagement.taskPreviewCell', ref: TaskPreviewCell }, { key: 'tasksManagement.taskGroupPicker', ref: TaskGroupPicker }, { key: 'tasksManagement.taskSearcher', ref: TaskSearcher }, + { key: 'tasksManagement.taskDetailsPage', ref: TaskDetailsPage }, + { key: 'tasksManagement.fetchTask', ref: fetchTask }, ], }; diff --git a/src/pages/TaskDetailsPage.js b/src/pages/TaskDetailsPage.js index ee155e2..36bed1e 100644 --- a/src/pages/TaskDetailsPage.js +++ b/src/pages/TaskDetailsPage.js @@ -30,6 +30,7 @@ function TaskDetailsPage({ submittingMutation, mutation, clearTask, + hideBody = false, }) { const modulesManager = useModulesManager(); const classes = useStyles(); @@ -87,7 +88,10 @@ function TaskDetailsPage({ }; const panels = () => { - const panels = [TaskPreviewPanel]; + const panels = []; + if (!hideBody) { + panels.push(TaskPreviewPanel); + } if (task && isCurrentUserInTaskGroup() && task.status === taskStatus.ACCEPTED) { panels.push(TaskApprovementPanel); } @@ -131,7 +135,7 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ const mapStateToProps = (state, props) => ({ rights: !!state.core && !!state.core.user && !!state.core.user.i_user ? state.core.user.i_user.rights : [], currentUser: !!state.core && !!state?.core?.user ? state.core.user : null, - taskUuid: props.match.params.task_uuid, + taskUuid: props?.match?.params?.task_uuid, submittingMutation: state.tasksManagement.submittingMutation, mutation: state.tasksManagement.mutation, task: state.tasksManagement.task,