Compare commits

..

No commits in common. "c1020f4693e003afc79a028693c575dbd35d2c1a" and "a68bd7dc384ddddc70f509bd8e2011da5021663d" have entirely different histories.

2 changed files with 12 additions and 26 deletions

View File

@ -112,7 +112,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => {
const { currentPage, totalPages, currentItems: paginatedAttendances, paginate, resetPage } = usePagination(
processedData,
20
10
);
// Reset to the first page whenever processedData changes (due to switch on/off)

View File

@ -13,15 +13,6 @@ 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([]);
@ -36,7 +27,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
});
const containerRef = useRef(null);
const firstRender = useRef(true);
const firstRender = useRef(true);
useEffect(() => {
@ -88,7 +79,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
showToast(error.response.data?.message || "Something went wrong", "error");
}
};
console.log("Kartik", commentsData)
return (
<div
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}
aria-label="Close"
></button>
<h5 className=" text-center mb-2">
Activity Summary
</h5>
<p className="fs-6 text-dark text-start m-0">Activity Summary</p>
<p className="small-text text-start my-2">
{commentsData?.workItem?.workArea?.floor?.building?.description}
{comments && comments[0]?.comment}
</p>
<p className="fw-bold my-2 text-start">
Assigned By :
<span className=" ms-2">
@ -140,7 +126,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
Completed Work : {commentsData?.completedTask}
</p>
<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">
{commentsData?.teamMembers?.map((member, idx) => (
<span key={idx} className="d-flex align-items-center">
@ -161,7 +147,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
{...register("comment")}
className="form-control"
id="exampleFormControlTextarea1"
// rows="2"
rows="1"
placeholder="Enter comment"
/>
{errors.comment && (
@ -184,8 +170,8 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
<ul
className="list-group px-0 mx-0 overflow-auto border-0"
// ref={containerRef} // auto scroll according data
// style={{ maxHeight: "200px" }}
// ref={containerRef} // auto scroll according data
style={{ maxHeight: "200px" }}
>
{comments &&
comments
@ -210,9 +196,9 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
</span>
</div>
<div className={`text-start py-0 d-flex align-items-center justify-content-start`}>
<p className={`mb-0 text-muted me-2`}>{fullName}</p>
<p className={`text-secondary m-0`} style={{ fontSize: "10px" }}>
<div className={`text-start py-0`}>
<p className={`mb-0 text-${bgClass}`}>{fullName}</p>
<p className="text-muted m-0" style={{ fontSize: "10px" }}>
{moment.utc(data?.commentDate).local().fromNow()}
</p>
</div>