Compare commits
No commits in common. "c1020f4693e003afc79a028693c575dbd35d2c1a" and "a68bd7dc384ddddc70f509bd8e2011da5021663d" have entirely different histories.
c1020f4693
...
a68bd7dc38
@ -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,
|
||||||
20
|
10
|
||||||
);
|
);
|
||||||
|
|
||||||
// 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,15 +13,6 @@ 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([]);
|
||||||
@ -36,7 +27,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const containerRef = useRef(null);
|
const containerRef = useRef(null);
|
||||||
const firstRender = useRef(true);
|
const firstRender = useRef(true);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -88,7 +79,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"
|
||||||
@ -102,15 +93,10 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
onClick={closeModal}
|
onClick={closeModal}
|
||||||
aria-label="Close"
|
aria-label="Close"
|
||||||
></button>
|
></button>
|
||||||
<h5 className=" text-center mb-2">
|
<p className="fs-6 text-dark text-start m-0">Activity Summary</p>
|
||||||
Activity Summary
|
|
||||||
</h5>
|
|
||||||
|
|
||||||
|
|
||||||
<p className="small-text text-start my-2">
|
<p className="small-text text-start my-2">
|
||||||
{commentsData?.workItem?.workArea?.floor?.building?.description}
|
{comments && comments[0]?.comment}
|
||||||
</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">
|
||||||
@ -140,7 +126,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">
|
||||||
@ -161,7 +147,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
{...register("comment")}
|
{...register("comment")}
|
||||||
className="form-control"
|
className="form-control"
|
||||||
id="exampleFormControlTextarea1"
|
id="exampleFormControlTextarea1"
|
||||||
// rows="2"
|
rows="1"
|
||||||
placeholder="Enter comment"
|
placeholder="Enter comment"
|
||||||
/>
|
/>
|
||||||
{errors.comment && (
|
{errors.comment && (
|
||||||
@ -184,8 +170,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
|
||||||
@ -210,9 +196,9 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={`text-start py-0 d-flex align-items-center justify-content-start`}>
|
<div className={`text-start py-0`}>
|
||||||
<p className={`mb-0 text-muted me-2`}>{fullName}</p>
|
<p className={`mb-0 text-${bgClass}`}>{fullName}</p>
|
||||||
<p className={`text-secondary m-0`} style={{ fontSize: "10px" }}>
|
<p className="text-muted 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