diff --git a/frontend/src/components/CommentInput.js b/frontend/src/components/CommentInput.js index 744a816..363dbd9 100644 --- a/frontend/src/components/CommentInput.js +++ b/frontend/src/components/CommentInput.js @@ -26,12 +26,12 @@ const HOTKEYS = { const cleanInput = (val) => { const textList = val.map((item) => item['children'][0]['text']) - const firstIndex = textList.findIndex((text) => text != '') - if (firstIndex == -1) { + const firstIndex = textList.findIndex((text) => text !== '') + if (firstIndex === -1) { return [] } - const lastIndex = textList.findLastIndex((text) => text != '') + const lastIndex = textList.findLastIndex((text) => text !== '') return val.slice(firstIndex, lastIndex + 1) } @@ -39,7 +39,7 @@ const cleanInput = (val) => { //Disables the "send" button if input isn't valid const invalidInput = (val) => { for (let i = 0; i < val.length; i++) { - if (val[i]['children'][0]['text'] != '') { + if (val[i]['children'][0]['text'] !== '') { return false } } diff --git a/frontend/src/components/CommentSection.js b/frontend/src/components/CommentSection.js index 9d6aa35..b681f4d 100644 --- a/frontend/src/components/CommentSection.js +++ b/frontend/src/components/CommentSection.js @@ -21,7 +21,6 @@ const CommentSection = ({ ticket, allUsers }) => { .then((data) => { setComments([...data.data]) forceRefresh() - console.log(data) }) .then(() => { setLoading(false) diff --git a/frontend/src/components/CommentView.js b/frontend/src/components/CommentView.js index 7db147b..5068635 100644 --- a/frontend/src/components/CommentView.js +++ b/frontend/src/components/CommentView.js @@ -231,6 +231,7 @@ const CommentView = ({ comment, allUsers, getComments }) => { {comment.replies.map((reply) => { return ( { + const { heading, reporter } = props + + return ( + + + {heading} + + + {!reporter ? ( + + No Reporter + + ) : ( + + + {reporter.displayName} + + + )} + + ) +} + +export default ReporterTableRow diff --git a/frontend/src/components/ReporterInfoTip.js b/frontend/src/components/ReporterInfoTip.js index da80d97..c896a5f 100644 --- a/frontend/src/components/ReporterInfoTip.js +++ b/frontend/src/components/ReporterInfoTip.js @@ -1,96 +1,43 @@ import React from 'react' -import { - Th, - Tr, - Text, - Image, - Box, - Popover, - PopoverTrigger, - PopoverContent, - HStack, - Td, -} from '@chakra-ui/react' +import { Text, Image, Box, PopoverContent, HStack } from '@chakra-ui/react' -const ReporterInfoTip = (props) => { - const { heading, reporter } = props +const ReporterInfoTip = ({ reporter }) => { + if (!reporter) return null return ( - - - {heading} - - - {!reporter ? ( - - No Reporter - - ) : ( - - + + + + reporter photo + {reporter.displayName} - - - - - reporter photo - - - {reporter.displayName} - -
- - {reporter.email} - -
-
-
-
-
- )} - +
+ + {reporter.email} + + + + + ) } diff --git a/frontend/src/components/TicketContent/UPRAdminContentTable.js b/frontend/src/components/TicketContent/UPRAdminContentTable.js index 92dad71..bdc3a08 100644 --- a/frontend/src/components/TicketContent/UPRAdminContentTable.js +++ b/frontend/src/components/TicketContent/UPRAdminContentTable.js @@ -12,8 +12,8 @@ import { useGetCurrentTicket } from '../../hooks/hooks' const UPRAdminContentTable = () => { const location = useLocation() const currentTicket = useGetCurrentTicket() - const [reqNum, setReqNum] = useState(currentTicket.requisition_number) - const [poNum, setPoNum] = useState(currentTicket.po_number) + const [reqNum, setReqNum] = useState('') + const [poNum, setPoNum] = useState('') const [changed, setChanged] = React.useState(false) const setAllTickets = useSetRecoilState(allTicketsState) const changeReqNumber = (e) => { diff --git a/frontend/src/pages/Dashboard.js b/frontend/src/pages/Dashboard.js index eb1734e..0f28132 100644 --- a/frontend/src/pages/Dashboard.js +++ b/frontend/src/pages/Dashboard.js @@ -13,6 +13,7 @@ import { useDisclosure, Grid, useToast, + Popover, } from '@chakra-ui/react' import TreeView from '../components/TreeView' import Navbar from '../components/Navbar' @@ -45,6 +46,7 @@ import PPRReporterTable from '../components/TicketContent/PPRReporterTable' import ClaimSummary from './ClaimSummary' import { createErrorMessage } from '../utils/errorToasts' import { useGetCurrentTicket } from '../hooks/hooks' +import ReporterTableRow from '../components/ReporterInfoTableRow' const Dashboard = () => { const navigate = useNavigate() @@ -313,30 +315,42 @@ const Dashboard = () => { Metadata - - - - user.uid === - currentTicket.reporter_id - )} - /> - - - -
+ + + + + user.uid === + currentTicket.reporter_id + )} + /> + + + +
+ + user.uid === currentTicket.reporter_id + )} + /> +
{supportingDocuments.length > 0 && ( @@ -345,7 +359,12 @@ const Dashboard = () => { {supportingDocuments?.map((file) => { - return + return ( + + ) })} @@ -357,7 +376,12 @@ const Dashboard = () => { {attachments?.map((file) => { - return + return ( + + ) })}