Notes
Notes - notes.io |
import Documents from './Documents'
import DocumentViewer from '../../../Shared/Components/DocumentViewer'
import { useSelector } from 'react-redux'
import { selectDocName, selectDocUrl } from '../../../Shared/Redux/Slicers/SubmissionSlice'
import '../Submission-Summary/Summary.css'
import './Documents.css'
import { FormControl, InputLabel, OutlinedInput, Select, MenuItem, Typography } from '@mui/material';
import { useLocation, useHistory } from 'react-router-dom/cjs/react-router-dom';
import ApiService from '../../../Shared/Services/CyberAIService';
function SubmissionDocuments({ rowdata }) {
const doc = useSelector(selectDocName);
const url = useSelector(selectDocUrl);
const history = useHistory();
const location = useLocation();
const [selectedRfpStatus, setSelectedRfpStatus] = React.useState(
(location.state?.e?.rfp_status) || rowdata.e.rfp_status
);
const [docReviewStatus, setDocReviewStatus] = React.useState(
(location.state?.e?.document_reviewed_status || rowdata.e.document_reviewed_status)
);
const onRfpStatusHandler = async (event) => {
const selectedValue = event.target.value;
const requestBody = {
submission_id: rowdata.e.submission_id,
submission_version: 1,
rfp_status: selectedValue
};
try {
const res = await ApiService.updateRFPStatusDocumentsApiUrl(requestBody);
if (res.status === 200 && res.data === true) {
setSelectedRfpStatus(selectedValue);
history.replace({
pathname: history.location.pathname,
state: { e: { ...location.state.e, rfp_status: selectedValue } }
});
}
} catch (err) {
console.error('Error updating RFP Status:', err);
}
};
// Allow child component to send updated review status back
const handleDocReviewStatusUpdate = (status) => {
setDocReviewStatus(status);
};
return (
<div>
<div className='main-container-documents'>
<div className='row container-layout'>
<div className="row align-items-center">
<div className="col-auto tab-title-div">Submission Documents</div>
<div className="col-auto ms-auto d-flex align-items-center gap-3">
<Typography variant="body1" className="docs-pending-label">
Docs Pending: {docReviewStatus}
</Typography>
<FormControl sx={{ width: 300 }}>
<InputLabel id="rfp-status-label">RFP Status</InputLabel>
<Select
labelId="rfp-status-label"
id="rfp-status-select"
input={<OutlinedInput label="RFP Status" />}
onChange={onRfpStatusHandler}
value={selectedRfpStatus}
>
<MenuItem value="Not Started">Not Started</MenuItem>
<MenuItem value="Logged-Census Incomplete">Logged-Census Incomplete</MenuItem>
<MenuItem value="Logged-Census Complete">Logged-Census Complete</MenuItem>
<MenuItem value="In Preparation">In Preparation</MenuItem>
</Select>
</FormControl>
</div>
</div>
<div className='divbreak'></div>
<div className="row">
<div className='col-sm-6'>
<Documents data={rowdata} onDocReviewStatusChange={handleDocReviewStatusUpdate} />
</div>
<div className='col-sm-6'>
<DocumentViewer url={url} doc={doc} header={"Documents"} />
</div>
</div>
</div>
</div>
</div>
)
}
export default SubmissionDocuments
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team
