Correction in Comment popup from Daily Progress Report. #152
@ -112,7 +112,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => {
|
|||||||
|
|
||||||
const { currentPage, totalPages, currentItems: paginatedAttendances, paginate, resetPage } = usePagination(
|
const { currentPage, totalPages, currentItems: paginatedAttendances, paginate, resetPage } = usePagination(
|
||||||
processedData,
|
processedData,
|
||||||
10
|
20
|
||||||
);
|
);
|
||||||
|
|
||||||
// Reset to the first page whenever processedData changes (due to switch on/off)
|
// Reset to the first page whenever processedData changes (due to switch on/off)
|
||||||
|
@ -13,6 +13,15 @@ const schema = z.object({
|
|||||||
comment: z.string().min(1, "Comment cannot be empty"),
|
comment: z.string().min(1, "Comment cannot be empty"),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ReportTaskComments component for displaying and adding comments to a task.
|
||||||
|
* It also shows a summary of the activity and task details.
|
||||||
|
*
|
||||||
|
* @param {object} props - The component props.
|
||||||
|
* @param {object} props.commentsData - Data related to the task and its comments, including the description.
|
||||||
|
* @param {function} props.closeModal - Callback function to close the modal.
|
||||||
|
*/
|
||||||
|
|
||||||
const ReportTaskComments = ({ commentsData, closeModal }) => {
|
const ReportTaskComments = ({ commentsData, closeModal }) => {
|
||||||
const [loading, setloading] = useState(false);
|
const [loading, setloading] = useState(false);
|
||||||
const [comments, setComment] = useState([]);
|
const [comments, setComment] = useState([]);
|
||||||
@ -79,7 +88,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
showToast(error.response.data?.message || "Something went wrong", "error");
|
showToast(error.response.data?.message || "Something went wrong", "error");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
console.log("Kartik", commentsData)
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="modal-dialog modal-lg modal-simple report-task-comments-modal mx-sm-auto mx-1"
|
className="modal-dialog modal-lg modal-simple report-task-comments-modal mx-sm-auto mx-1"
|
||||||
@ -93,10 +102,15 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
onClick={closeModal}
|
onClick={closeModal}
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
></button>
|
></button>
|
||||||
<p className="fs-6 text-dark text-start m-0">Activity Summary</p>
|
<h5 className=" text-center mb-2">
|
||||||
|
Activity Summary
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
|
||||||
<p className="small-text text-start my-2">
|
<p className="small-text text-start my-2">
|
||||||
{comments && comments[0]?.comment}
|
{commentsData?.workItem?.workArea?.floor?.building?.description}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p className="fw-bold my-2 text-start">
|
<p className="fw-bold my-2 text-start">
|
||||||
Assigned By :
|
Assigned By :
|
||||||
<span className=" ms-2">
|
<span className=" ms-2">
|
||||||
@ -126,7 +140,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
Completed Work : {commentsData?.completedTask}
|
Completed Work : {commentsData?.completedTask}
|
||||||
</p>
|
</p>
|
||||||
<div className="d-flex align-items-center flex-wrap">
|
<div className="d-flex align-items-center flex-wrap">
|
||||||
<p className="fw-bold text-start m-0 me-1">Team:</p>
|
<p className="fw-bold text-start m-0 me-1">Team :</p>
|
||||||
<div className="d-flex flex-wrap align-items-center gap-2">
|
<div className="d-flex flex-wrap align-items-center gap-2">
|
||||||
{commentsData?.teamMembers?.map((member, idx) => (
|
{commentsData?.teamMembers?.map((member, idx) => (
|
||||||
<span key={idx} className="d-flex align-items-center">
|
<span key={idx} className="d-flex align-items-center">
|
||||||
@ -147,7 +161,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
{...register("comment")}
|
{...register("comment")}
|
||||||
className="form-control"
|
className="form-control"
|
||||||
id="exampleFormControlTextarea1"
|
id="exampleFormControlTextarea1"
|
||||||
rows="1"
|
// rows="2"
|
||||||
placeholder="Enter comment"
|
placeholder="Enter comment"
|
||||||
/>
|
/>
|
||||||
{errors.comment && (
|
{errors.comment && (
|
||||||
@ -170,8 +184,8 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
|
|
||||||
<ul
|
<ul
|
||||||
className="list-group px-0 mx-0 overflow-auto border-0"
|
className="list-group px-0 mx-0 overflow-auto border-0"
|
||||||
// ref={containerRef} // auto scroll according data
|
// ref={containerRef} // auto scroll according data
|
||||||
style={{ maxHeight: "200px" }}
|
// style={{ maxHeight: "200px" }}
|
||||||
>
|
>
|
||||||
{comments &&
|
{comments &&
|
||||||
comments
|
comments
|
||||||
@ -196,9 +210,9 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={`text-start py-0`}>
|
<div className={`text-start py-0 d-flex align-items-center justify-content-start`}>
|
||||||
<p className={`mb-0 text-${bgClass}`}>{fullName}</p>
|
<p className={`mb-0 text-muted me-2`}>{fullName}</p>
|
||||||
<p className="text-muted m-0" style={{ fontSize: "10px" }}>
|
<p className={`text-${bgClass} m-0`} style={{ fontSize: "10px" }}>
|
||||||
{moment.utc(data?.commentDate).local().fromNow()}
|
{moment.utc(data?.commentDate).local().fromNow()}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user