Skip to content
Snippets Groups Projects
Commit 4cec444b authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Don't show buttons on readonly surveys

parent a350f798
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ function SurveyContainerComponent({ loadFrom, saveTo = '', readonly = false }) {
}, []);
if (surveyModel === undefined) {
return 'loading...'
return 'loading survey...'
}
async function getModel() {
......@@ -128,7 +128,7 @@ function SurveyContainerComponent({ loadFrom, saveTo = '', readonly = false }) {
</Row>
<Row>
<SurveyNavigationComponent surveyModel={surveyModel} endSurvey={endSurvey} saveSurvey={saveSurvey} validatePage={validatePage}>
<SurveyNavigationComponent surveyModel={surveyModel} endSurvey={endSurvey} saveSurvey={saveSurvey} validatePage={validatePage} readonly={readonly}>
<SurveyComponent surveyModel={surveyModel} verificationStatus={verificationStatus} />
</SurveyNavigationComponent>
</Row>
......
......@@ -3,9 +3,8 @@ import ProgressBar from './ProgressBar';
import { Container, Row } from "react-bootstrap";
function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validatePage, children }) {
function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validatePage, children, readonly }) {
const [pageNo, setPageNo] = useState(0);
useEffect(() => {
setPageNo(surveyModel.currentPageNo)
}, [surveyModel]);
......@@ -27,6 +26,9 @@ function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validat
};
const renderExternalNavigation = () => {
if (readonly) {
return <></>;
}
return (
<div className="navigation-block">
<div className="navigation-progress-container">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment