- Progress Commit

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-04-01 14:45:55 -04:00
parent 54dc9c8587
commit ae07f71e76
17 changed files with 223 additions and 78 deletions

View File

@@ -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