more
This commit is contained in:
@@ -35,6 +35,7 @@ const DocEditPage = () => {
|
||||
const [saveDocumentId, setSaveDocumentId] = useState("");
|
||||
const [showSaveModal, setShowSaveModal] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [isReport, setIsReport] = useState(false);
|
||||
const [responsesCreated, setResponsesCreated] = useState(
|
||||
parseInt(responseGenerations)
|
||||
);
|
||||
@@ -510,6 +511,10 @@ const DocEditPage = () => {
|
||||
setShowSaveModal(true);
|
||||
};
|
||||
|
||||
const handleConfirmReport = () => {
|
||||
setShowSaveModal(true);
|
||||
};
|
||||
|
||||
const onScrollClick = () => {
|
||||
const bottom = window.document.scrollingElement.scrollHeight;
|
||||
const place = window.scrollY;
|
||||
@@ -586,6 +591,12 @@ const DocEditPage = () => {
|
||||
</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="generate-button-box">
|
||||
{/* 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}
|
||||
{showSaveModal && isReport && documentId !== null ? (
|
||||
<ConfirmModal
|
||||
onCancel={handleCancelSave}
|
||||
onConfirm={handleSave}
|
||||
buttonLabelText="Confirm Save"
|
||||
modalText={
|
||||
"Are you sure? This will overrwrite any previously-saved edits."
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ const ConfirmModal = ({
|
||||
buttonLabelText,
|
||||
modalText,
|
||||
isBusy,
|
||||
isReport,
|
||||
}) => {
|
||||
return (
|
||||
<Modal show="true" onHide={onCancel} size="lg">
|
||||
|
||||
Reference in New Issue
Block a user