fixed endet at and duration not set after grouptask finished
parent
4e66d10a51
commit
97e25d4d0c
|
@ -643,6 +643,89 @@ export default function GroupTasksViewModal({ isOpen }) {
|
|||
);
|
||||
};
|
||||
|
||||
const PopoverContent = () => {
|
||||
// get current group task from useState as endetAt and duration not updated only with currentGroupTask as it is a useRef
|
||||
const cGroupTask = groupTasksContext.groupTasks.find(
|
||||
(g) => g.Id === currentGroupTask.current.Id
|
||||
);
|
||||
|
||||
return (
|
||||
<div key={paramGroupTaskId}>
|
||||
<h1
|
||||
style={{
|
||||
color: Constants.COLORS.PRIMARY,
|
||||
fontWeight: "bold",
|
||||
marginBottom: 0,
|
||||
}}
|
||||
>
|
||||
{currentGroupTask.current.GroupName}{" "}
|
||||
<Popover
|
||||
trigger="click"
|
||||
title={
|
||||
<h2
|
||||
style={{
|
||||
fontWeight: "bold",
|
||||
color: Constants.COLORS.SECONDARY,
|
||||
}}
|
||||
>
|
||||
{t("groupTasks.groupTasksViewModal.popover.details")}
|
||||
</h2>
|
||||
}
|
||||
content={
|
||||
<>
|
||||
<p style={{ margin: 0 }}>
|
||||
<span style={{ fontWeight: "bold" }}>ID:</span>{" "}
|
||||
{paramGroupTaskId} <br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.category")}:
|
||||
</span>{" "}
|
||||
{currentGroupTask.current.Category}
|
||||
<br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.startedAt")}:
|
||||
</span>{" "}
|
||||
{FormatDatetime(currentGroupTask.current.StartedAt)}
|
||||
<br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.endedAt")}:
|
||||
</span>{" "}
|
||||
{FormatDatetime(cGroupTask.EndedAt)}
|
||||
<br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.duration")}:
|
||||
</span>{" "}
|
||||
{GetDuration(cGroupTask.StartedAt, cGroupTask.EndedAt)}
|
||||
</p>
|
||||
|
||||
<GlobalInputs />
|
||||
</>
|
||||
}
|
||||
>
|
||||
<InfoCircleOutlined
|
||||
style={{
|
||||
fontSize: "18px",
|
||||
color: Constants.COLORS.ICON_INFO,
|
||||
marginBottom: "4px",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</Popover>{" "}
|
||||
<MyAvatar
|
||||
tooltip
|
||||
allUsers={appContext.users}
|
||||
userId={currentGroupTask.current.CreatorUserId}
|
||||
/>
|
||||
<br />
|
||||
</h1>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<span>{currentGroupTask.current.Description}</span>
|
||||
</div>
|
||||
|
||||
<Steps direction="vertical" items={stepsItemHandler()} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<MyModal isOpen={isOpen} onCancel={handleCancel}>
|
||||
{notificationContextHolder}
|
||||
|
@ -658,82 +741,7 @@ export default function GroupTasksViewModal({ isOpen }) {
|
|||
resultTitle={t("groupTasks.groupTasksViewModal.groupTaskNotFound")}
|
||||
/>
|
||||
) : (
|
||||
<div key={paramGroupTaskId}>
|
||||
<h1
|
||||
style={{
|
||||
color: Constants.COLORS.PRIMARY,
|
||||
fontWeight: "bold",
|
||||
marginBottom: 0,
|
||||
}}
|
||||
>
|
||||
{currentGroupTask.current.GroupName}{" "}
|
||||
<Popover
|
||||
trigger="click"
|
||||
title={
|
||||
<h2
|
||||
style={{
|
||||
fontWeight: "bold",
|
||||
color: Constants.COLORS.SECONDARY,
|
||||
}}
|
||||
>
|
||||
{t("groupTasks.groupTasksViewModal.popover.details")}
|
||||
</h2>
|
||||
}
|
||||
content={
|
||||
<>
|
||||
<p style={{ margin: 0 }}>
|
||||
<span style={{ fontWeight: "bold" }}>ID:</span>{" "}
|
||||
{paramGroupTaskId} <br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.category")}:
|
||||
</span>{" "}
|
||||
{currentGroupTask.current.Category}
|
||||
<br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.startedAt")}:
|
||||
</span>{" "}
|
||||
{FormatDatetime(currentGroupTask.current.StartedAt)}
|
||||
<br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.endedAt")}:
|
||||
</span>{" "}
|
||||
{FormatDatetime(currentGroupTask.current.EndedAt)}
|
||||
<br />
|
||||
<span style={{ fontWeight: "bold" }}>
|
||||
{t("groupTasks.groupTasksViewModal.duration")}:
|
||||
</span>{" "}
|
||||
{GetDuration(
|
||||
currentGroupTask.current.StartedAt,
|
||||
currentGroupTask.current.EndedAt
|
||||
)}
|
||||
</p>
|
||||
|
||||
<GlobalInputs />
|
||||
</>
|
||||
}
|
||||
>
|
||||
<InfoCircleOutlined
|
||||
style={{
|
||||
fontSize: "18px",
|
||||
color: Constants.COLORS.ICON_INFO,
|
||||
marginBottom: "4px",
|
||||
verticalAlign: "middle",
|
||||
}}
|
||||
/>
|
||||
</Popover>{" "}
|
||||
<MyAvatar
|
||||
tooltip
|
||||
allUsers={appContext.users}
|
||||
userId={currentGroupTask.current.CreatorUserId}
|
||||
/>
|
||||
<br />
|
||||
</h1>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<span>{currentGroupTask.current.Description}</span>
|
||||
</div>
|
||||
|
||||
<Steps direction="vertical" items={stepsItemHandler()} />
|
||||
</div>
|
||||
<PopoverContent />
|
||||
)}
|
||||
</MyModal>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue