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]);
|
||||
|
||||
const [selectedTask, selectTask] = useState(null);
|
||||
const [comments, setComment] = useState(null);
|
||||
const [comments, setComment] = useState({task:null,isActionAllow:false});
|
||||
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const [isModalOpenComment, setIsModalOpenComment] = useState(false);
|
||||
@ -174,7 +174,8 @@ const DailyTask = () => {
|
||||
{isModalOpenComment && (
|
||||
<GlobalModel isOpen={isModalOpenComment} size="lg" closeModal={()=>setIsModalOpenComment(false)}>
|
||||
<ReportTaskComments
|
||||
commentsData={comments}
|
||||
commentsData={comments.task}
|
||||
actionAllow={comments.isActionAllow}
|
||||
closeModal={closeCommentModal}
|
||||
/>
|
||||
</GlobalModel>
|
||||
@ -423,12 +424,26 @@ const DailyTask = () => {
|
||||
}}
|
||||
>
|
||||
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
|
||||
type="button"
|
||||
className="btn btn-xs btn-primary ms-2"
|
||||
onClick={() => {
|
||||
setComment(task);
|
||||
setComment({task:task,isActionAllow:false});
|
||||
openComment();
|
||||
}}
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user