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

Don't redirect admin users

parent 3ab2d1e7
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -21,7 +21,6 @@ function Landing(): ReactElement { ...@@ -21,7 +21,6 @@ function Landing(): ReactElement {
return ( return (
<Container className="py-5 grey-container"> <Container className="py-5 grey-container">
<Row> <Row>
{hasNren && moveToSurvey()}
<div className="center-text"> <div className="center-text">
<h1 className="geant-header">THE GÉANT COMPENDIUM OF NRENS SURVEY</h1> <h1 className="geant-header">THE GÉANT COMPENDIUM OF NRENS SURVEY</h1>
...@@ -38,16 +37,17 @@ function Landing(): ReactElement { ...@@ -38,16 +37,17 @@ function Landing(): ReactElement {
<span>Current registration status:</span> <span>Current registration status:</span>
<br /> <br />
<br /> <br />
{isAdmin && <ul> {isAdmin ? <ul>
<li><span>You are logged in as a Compendium Administrator</span></li> <li><span>You are logged in as a Compendium Administrator</span></li>
<li><span>Click <a href="/survey/admin/surveys">here</a> to access the survey management page.</span></li> <li><span>Click <a href="/survey/admin/surveys">here</a> to access the survey management page.</span></li>
<li><span>Click <a href="/survey/admin/users">here</a> to access the user management page.</span></li> <li><span>Click <a href="/survey/admin/users">here</a> to access the user management page.</span></li>
</ul> : <ul>
{!isAdmin && hasNren && moveToSurvey()}
{loggedIn ? <li><span>You are logged in</span></li> : <li><span>You are not logged in</span></li>}
{loggedIn && !hasNren && <li><span>Your access to the survey has not been approved</span></li>}
{loggedIn && !hasNren && <li><span>Once you have been approved, you will immediately be directed to the relevant survey upon visiting this page</span></li>}
</ul>} </ul>}
<ul>
{!isAdmin && (loggedIn ? <li><span>You are logged in</span></li> : <li><span>You are not logged in</span></li>)}
{!isAdmin && loggedIn && !hasNren && <li><span>Your access to the survey has not been approved</span></li>}
{!isAdmin && loggedIn && !hasNren && <li><span>Once you have been approved, you will immediately be directed to the relevant survey upon visiting this page</span></li>}
</ul>
</div> </div>
... ...
......
...@@ -55,9 +55,8 @@ function SurveyContainerComponent({ loadFrom, saveTo = '', readonly = false }) { ...@@ -55,9 +55,8 @@ function SurveyContainerComponent({ loadFrom, saveTo = '', readonly = false }) {
getModel().catch(error => setError('Error when loading survey: ' + error.message)) getModel().catch(error => setError('Error when loading survey: ' + error.message))
}); }, []);
console.log(surveyModel) if (!surveyModel) {
if (surveyModel === undefined) {
return error return error
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment