This commit is contained in:
Kenneth Jannette
2024-01-16 20:47:42 -06:00
parent f2be25886f
commit cb3d0eadbf
3 changed files with 32 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ const DocEditPage = () => {
const [saveDocumentId, setSaveDocumentId] = useState(""); const [saveDocumentId, setSaveDocumentId] = useState("");
const [showSaveModal, setShowSaveModal] = useState(false); const [showSaveModal, setShowSaveModal] = useState(false);
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [isReport, setIsReport] = useState(false);
const [responsesCreated, setResponsesCreated] = useState( const [responsesCreated, setResponsesCreated] = useState(
parseInt(responseGenerations) parseInt(responseGenerations)
); );
@@ -510,6 +511,10 @@ const DocEditPage = () => {
setShowSaveModal(true); setShowSaveModal(true);
}; };
const handleConfirmReport = () => {
setShowSaveModal(true);
};
const onScrollClick = () => { const onScrollClick = () => {
const bottom = window.document.scrollingElement.scrollHeight; const bottom = window.document.scrollingElement.scrollHeight;
const place = window.scrollY; const place = window.scrollY;
@@ -586,6 +591,12 @@ const DocEditPage = () => {
</div> </div>
</div> </div>
))} ))}
<div
className="docedit-report-container"
onClick={() => handleConfirmReport()}
>
<div className="docedit-report-link">Report an issue</div>
</div>
<div className="doc-editing-button-container"> <div className="doc-editing-button-container">
<div className="generate-button-box"> <div className="generate-button-box">
{/* TODO: add tooltip: "This will save the document and create a .docx file that will (be downloaded? saved somewhere?" */} {/* TODO: add tooltip: "This will save the document and create a .docx file that will (be downloaded? saved somewhere?" */}
@@ -624,6 +635,16 @@ const DocEditPage = () => {
} }
/> />
) : null} ) : null}
{showSaveModal && isReport && documentId !== null ? (
<ConfirmModal
onCancel={handleCancelSave}
onConfirm={handleSave}
buttonLabelText="Confirm Save"
modalText={
"Are you sure? This will overrwrite any previously-saved edits."
}
/>
) : null}
</> </>
); );
}; };

View File

@@ -7,6 +7,7 @@ const ConfirmModal = ({
buttonLabelText, buttonLabelText,
modalText, modalText,
isBusy, isBusy,
isReport,
}) => { }) => {
return ( return (
<Modal show="true" onHide={onCancel} size="lg"> <Modal show="true" onHide={onCancel} size="lg">

View File

@@ -52,7 +52,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
margin-top: 1rem; margin-top: 0.6rem;
} }
.edit-back-button { .edit-back-button {
@@ -359,6 +359,15 @@
margin-top: 50px; margin-top: 50px;
} }
.docedit-report-link {
color: red;
}
.docedit-report-link:hover {
text-decoration: underline;
cursor: pointer;
}
@media only screen and (max-width: 1140px) { @media only screen and (max-width: 1140px) {
.scroll-button { .scroll-button {
right: 30px; right: 30px;