@@ -90,7 +90,9 @@ function TaskListComponent({
|
||||
setTaskUpsertContext,
|
||||
toggleDeletedStatus,
|
||||
relationshipType,
|
||||
relationshipId
|
||||
relationshipId,
|
||||
onlyMine ,
|
||||
parentJobId
|
||||
}) {
|
||||
const {t} = useTranslation();
|
||||
|
||||
@@ -102,12 +104,25 @@ function TaskListComponent({
|
||||
sortcolumn,
|
||||
sortorder,
|
||||
deleted,
|
||||
completed
|
||||
completed,
|
||||
mine
|
||||
} = search;
|
||||
|
||||
const history = useNavigate();
|
||||
|
||||
const columns = [
|
||||
const columns = [];
|
||||
|
||||
if (!onlyMine) {
|
||||
columns.push(
|
||||
{
|
||||
title: t("tasks.fields.assigned_to"),
|
||||
dataIndex: "assigned_to",
|
||||
key: "assigned_to",
|
||||
width: '10%',
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
columns.push(
|
||||
{
|
||||
title: t("tasks.fields.job.ro_number"),
|
||||
dataIndex: ["job", "ro_number"],
|
||||
@@ -178,8 +193,8 @@ function TaskListComponent({
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
}
|
||||
);
|
||||
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
@@ -190,6 +205,7 @@ function TaskListComponent({
|
||||
setTaskUpsertContext({
|
||||
actions: {},
|
||||
context: {
|
||||
jobid: parentJobId,
|
||||
[relationshipType]: relationshipId,
|
||||
},
|
||||
});
|
||||
@@ -219,6 +235,15 @@ function TaskListComponent({
|
||||
const tasksExtra = useCallback(() => {
|
||||
return (
|
||||
<Space direction='horizontal'>
|
||||
{!onlyMine && (
|
||||
<Switch
|
||||
checkedChildren={t('tasks.buttons.myTasks')}
|
||||
unCheckedChildren={t('tasks.buttons.allTasks')}
|
||||
title={t('tasks.titles.mine')}
|
||||
checked={mine === "true"}
|
||||
onChange={(value) => handleSwitchChange('mine', value)}
|
||||
/>
|
||||
)}
|
||||
<Switch
|
||||
checkedChildren={<CheckCircleFilled/>}
|
||||
unCheckedChildren={<CheckCircleOutlined/>}
|
||||
@@ -242,7 +267,7 @@ function TaskListComponent({
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
}, [refetch, deleted, completed]);
|
||||
}, [refetch, deleted, completed, mine]);
|
||||
|
||||
return (
|
||||
<Card
|
||||
|
||||
Reference in New Issue
Block a user