modified comment state for handle audit and comment form
This commit is contained in:
parent
407680fa9b
commit
3b826342ba
@ -114,7 +114,7 @@ const DailyTask = () => {
|
|||||||
}, [TaskLists]);
|
}, [TaskLists]);
|
||||||
|
|
||||||
const [selectedTask, selectTask] = useState(null);
|
const [selectedTask, selectTask] = useState(null);
|
||||||
const [comments, setComment] = useState(null);
|
const [comments, setComment] = useState({task:null,isActionAllow:false});
|
||||||
|
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
const [isModalOpenComment, setIsModalOpenComment] = useState(false);
|
const [isModalOpenComment, setIsModalOpenComment] = useState(false);
|
||||||
@ -174,7 +174,8 @@ const DailyTask = () => {
|
|||||||
{isModalOpenComment && (
|
{isModalOpenComment && (
|
||||||
<GlobalModel isOpen={isModalOpenComment} size="lg" closeModal={()=>setIsModalOpenComment(false)}>
|
<GlobalModel isOpen={isModalOpenComment} size="lg" closeModal={()=>setIsModalOpenComment(false)}>
|
||||||
<ReportTaskComments
|
<ReportTaskComments
|
||||||
commentsData={comments}
|
commentsData={comments.task}
|
||||||
|
actionAllow={comments.isActionAllow}
|
||||||
closeModal={closeCommentModal}
|
closeModal={closeCommentModal}
|
||||||
/>
|
/>
|
||||||
</GlobalModel>
|
</GlobalModel>
|
||||||
@ -423,12 +424,26 @@ const DailyTask = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Report
|
Report
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={`btn btn-xs btn-warning ${
|
||||||
|
task.reportedDate == null
|
||||||
|
? "d-none"
|
||||||
|
: ""
|
||||||
|
}`}
|
||||||
|
onClick={() => {
|
||||||
|
setComment({task:task,isActionAllow:true});
|
||||||
|
openComment();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Take Action
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-xs btn-primary ms-2"
|
className="btn btn-xs btn-primary ms-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setComment(task);
|
setComment({task:task,isActionAllow:false});
|
||||||
openComment();
|
openComment();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user