Skip to content

Commit

Permalink
Merge pull request #2254 from OneCommunityGlobal/jingyi-Interact-with…
Browse files Browse the repository at this point in the history
…-Task-Ready-for-Review

Jingyi-Interact with Task "Ready for Review" button
  • Loading branch information
one-community authored Dec 3, 2024
2 parents 86b7562 + 05e5df9 commit bbb981b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/TeamMemberTasks/ReviewButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useMemo, useState } from 'react';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, DropdownToggle, DropdownMenu, DropdownItem, UncontrolledDropdown, Input } from 'reactstrap';
import { useSelector } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import './style.css';
import './reviewButton.css';
import { boxStyle, boxStyleDark } from 'styles';
Expand All @@ -9,13 +9,14 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCheck } from '@fortawesome/free-solid-svg-icons';
import httpService from '../../services/httpService';
import { ApiEndpoint } from 'utils/URL';
import hasPermission from 'utils/permissions';

const ReviewButton = ({
user,
task,
updateTask,
userPermission,
}) => {
const dispatch = useDispatch();
const darkMode = useSelector(state => state.theme.darkMode)
const [linkError, setLinkError] = useState(null);
const myUserId = useSelector(state => state.auth.user.userid);
Expand All @@ -24,6 +25,7 @@ const ReviewButton = ({
const [link, setLink] = useState("");
const [verifyModal, setVerifyModal] = useState(false);
const [selectedAction, setSelectedAction] = useState(null);
const canReview = (dispatch(hasPermission('putReviewStatus')));
const [isSubmitting, setIsSubmitting] = useState(false);
const [confirmSubmitModal, setConfirmSubmitModal] = useState(false); // New state for the final confirmation modal

Expand Down Expand Up @@ -143,7 +145,7 @@ const ReviewButton = ({
Submit for Review
</Button>;
} else if (reviewStatus === "Submitted") {
if (myRole === "Owner" ||myRole === "Administrator" || myRole === "Mentor" || myRole === "Manager" || userPermission) {
if (myRole == "Owner" ||myRole == "Administrator" || myRole == "Mentor" || myRole == "Manager" || canReview) {
return (
<UncontrolledDropdown>
<DropdownToggle className="btn--dark-sea-green reviewBtn" caret style={darkMode ? boxStyleDark : boxStyle}>
Expand Down

0 comments on commit bbb981b

Please sign in to comment.