Skip to content

Commit

Permalink
CM-487: task update (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan <j.dolkowski@soldevelo.com>
  • Loading branch information
jdolkowski and Jan authored Feb 9, 2024
1 parent a122c5e commit 2f910d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 },
],
};

Expand Down
8 changes: 6 additions & 2 deletions src/pages/TaskDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function TaskDetailsPage({
submittingMutation,
mutation,
clearTask,
hideBody = false,
}) {
const modulesManager = useModulesManager();
const classes = useStyles();
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2f910d9

Please sign in to comment.