From 69abd207c6827544365ecc37dfbb6cd3c90ae3de Mon Sep 17 00:00:00 2001 From: "kartik.sharma" Date: Tue, 27 May 2025 16:36:22 +0530 Subject: [PATCH 1/2] Correction in Comment popup from Daily Progress Report. --- src/components/Activities/AttendcesLogs.jsx | 2 +- .../Activities/ReportTaskComments.jsx | 36 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/components/Activities/AttendcesLogs.jsx b/src/components/Activities/AttendcesLogs.jsx index feda6c77..1ac58c72 100644 --- a/src/components/Activities/AttendcesLogs.jsx +++ b/src/components/Activities/AttendcesLogs.jsx @@ -112,7 +112,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => { const { currentPage, totalPages, currentItems: paginatedAttendances, paginate, resetPage } = usePagination( processedData, - 10 + 20 ); // Reset to the first page whenever processedData changes (due to switch on/off) diff --git a/src/components/Activities/ReportTaskComments.jsx b/src/components/Activities/ReportTaskComments.jsx index efe62d0a..5b494758 100644 --- a/src/components/Activities/ReportTaskComments.jsx +++ b/src/components/Activities/ReportTaskComments.jsx @@ -13,6 +13,15 @@ const schema = z.object({ 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 [loading, setloading] = useState(false); const [comments, setComment] = useState([]); @@ -27,7 +36,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { }); const containerRef = useRef(null); - const firstRender = useRef(true); + const firstRender = useRef(true); useEffect(() => { @@ -79,7 +88,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { showToast(error.response.data?.message || "Something went wrong", "error"); } }; - + console.log("Kartik", commentsData) return (
{ onClick={closeModal} aria-label="Close" > -

Activity Summary

+
+ Activity Summary +
+ +

- {comments && comments[0]?.comment} + {commentsData?.workItem?.workArea?.floor?.building?.description}

+

Assigned By : @@ -126,7 +140,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { Completed Work : {commentsData?.completedTask}

-

Team:

+

Team :

{commentsData?.teamMembers?.map((member, idx) => ( @@ -147,7 +161,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => { {...register("comment")} className="form-control" id="exampleFormControlTextarea1" - rows="1" + // rows="2" placeholder="Enter comment" /> {errors.comment && ( @@ -170,8 +184,8 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
    {comments && comments @@ -196,9 +210,9 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
-
-

{fullName}

-

+

+

{fullName}

+

{moment.utc(data?.commentDate).local().fromNow()}

-- 2.43.0 From 792fcd6965d746bf87a3b635e35349aaf25ff85a Mon Sep 17 00:00:00 2001 From: "kartik.sharma" Date: Tue, 27 May 2025 17:24:14 +0530 Subject: [PATCH 2/2] Changes in Comment popup --- src/components/Activities/ReportTaskComments.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Activities/ReportTaskComments.jsx b/src/components/Activities/ReportTaskComments.jsx index 5b494758..91399b79 100644 --- a/src/components/Activities/ReportTaskComments.jsx +++ b/src/components/Activities/ReportTaskComments.jsx @@ -212,7 +212,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {

{fullName}

-

+

{moment.utc(data?.commentDate).local().fromNow()}

-- 2.43.0