Skip to content

Commit

Permalink
update edit bundle conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Feb 13, 2024
1 parent f4e6baa commit 6213004
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/TaskAnalysisTable/TaskAnalysisTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ const setupColumnTypes = (props, taskBaseRoute, manager, data, openComments) =>
const isMapper = props.task?.completedBy ? props.task.completedBy === props.user.id : true

const isTagFix = AsCooperativeWork(props.task).isTagType()
const enableEditForMapper = props.task?.status === 0 || (props.task?.reviewStatus === ( 2 || 4 || 5 ))
const enableEditForMapper = [0, 3].includes(props.task?.status) || [2, 4, 5].includes(props.task?.reviewStatus)

const disableSelecting = props.taskReadOnly || isTagFix || !isMapper || !enableEditForMapper

return (
Expand Down Expand Up @@ -376,7 +377,7 @@ const setupColumnTypes = (props, taskBaseRoute, manager, data, openComments) =>
minWidth: 110,
Cell: ({ row }) => {
const isTaskSelected = props.taskId === row._original.id
const enableEditForMapper = props.task?.status === 0 || (props.task?.reviewStatus === ( 2 || 4 || 5 ))
const enableEditForMapper = [0, 3].includes(props.task?.status) || [2, 4, 5].includes(props.task?.reviewStatus)
const isTaskRemovable = !props.taskReadOnly && enableEditForMapper

const enableRemove = props.task?.completedBy ? props.task.completedBy === props.user.id : true
Expand Down
4 changes: 2 additions & 2 deletions src/components/Widgets/TaskBundleWidget/TaskBundleWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ const ActiveBundle = props => {
values={{taskCount: props.taskBundle.taskIds.length}}
/>
</h3>
{!props.taskReadOnly && props.task.status === 0 && enableRemove && !props.disallowBundleChanges &&
{!props.taskReadOnly && props.task?.status === 0 || props.task?.status === 3 && enableRemove && !props.disallowBundleChanges ?
<button
className="mr-button mr-button--green-lighter mr-button--small"
onClick={() => {
props.unbundleTasks()
}}
>
<FormattedMessage {...messages.unbundleTasksLabel} />
</button>
</button> : null
}
</div>

Expand Down

0 comments on commit 6213004

Please sign in to comment.