Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DT-783] Add study details page #2741

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 52 additions & 50 deletions src/Routes.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import {Redirect, Route, Switch} from 'react-router-dom';
import { StudyDetails } from './components/study_details/StudyDetails';
import AuthenticatedRoute from './components/AuthenticatedRoute';
import {USER_ROLES} from './libs/utils';
import ManageDac from './pages/manage_dac/ManageDac';
Expand Down Expand Up @@ -47,65 +48,66 @@ import EditDac from './pages/manage_dac/EditDac';

const Routes = (props) => (
<Switch>
<Route exact path="/" render={(routeProps) => <Home {...routeProps} {...props} />} />
<Route exact path="/home" render={(routeProps) => <Home {...routeProps} {...props} />} />
<Route exact path="/status" render={(routeProps) => <Status {...routeProps} {...props} />} />
<Route exact path="/liveness" component={HealthCheck} />
<Route exact path="/backgroundsignin" render={
<Route exact path='/' render={(routeProps) => <Home {...routeProps} {...props} />} />
<Route exact path='/home' render={(routeProps) => <Home {...routeProps} {...props} />} />
<Route exact path='/status' render={(routeProps) => <Status {...routeProps} {...props} />} />
<Route exact path='/liveness' component={HealthCheck} />
<Route exact path='/backgroundsignin' render={
(routeProps) =>
checkEnv(envGroups.NON_STAGING)
? <BackgroundSignIn {...routeProps} />
: <NotFound />
} />
<Route path="/nih_ic_webform" component={NIHICWebform} />
<Route path="/nih_pilot_info" component={NIHPilotInfo} />
<Route path="/privacy" component={PrivacyPolicy} />
<Route path="/tos" component={TermsOfService} props={props} />
<Route path="/tos_acceptance" component={TermsOfServiceAcceptance} props={props} />
<Route path="/consent_text_generator" component={ConsentTextGenerator} />
<Route path="/nih_dms_policy" component={NIHDMSPolicyInfo} />
<Route path="/anvil_dms_policy" component={AnVILDMSPolicyInfo} />
<AuthenticatedRoute path="/profile" component={UserProfile} props={props} rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path="/request_role" component={RequestForm} rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path="/admin_review_collection/:collectionId" component={DarCollectionReview} props={Object.assign({adminPage: true}, props)} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path="/admin_manage_users" component={AdminManageUsers} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path="/admin_edit_user/:userId" component={AdminEditUser} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path="/manage_dac" component={ManageDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path="/manage_edit_dac/:dacId" component={ManageEditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path="/manage_add_dac" component={ManageEditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
{DAAUtils.isEnabled() && <AuthenticatedRoute path="/manage_edit_dac_daa/:dacId" component={EditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />}
{DAAUtils.isEnabled() && <AuthenticatedRoute path="/manage_add_dac_daa" component={EditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />}
<AuthenticatedRoute path="/admin_manage_institutions" component={AdminManageInstitutions} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path="/researcher_console" component={ResearcherConsole} props={props} rolesAllowed={[USER_ROLES.researcher]}/>
<AuthenticatedRoute path="/dar_collection/:collectionId" component={DarCollectionReview} props={props} rolesAllowed={[USER_ROLES.researcher, USER_ROLES.chairperson, USER_ROLES.member, USER_ROLES.signingOfficial]}/>
<AuthenticatedRoute path="/chair_console" component={ChairConsole} props={props} rolesAllowed={[USER_ROLES.chairperson]}/>
<AuthenticatedRoute path="/member_console" component={MemberConsole} props={props} rolesAllowed={[USER_ROLES.member]}/>
<AuthenticatedRoute path="/dar_vote_review/:collectionId" component={DarCollectionReview} props={Object.assign({readOnly: true}, props)}
<Route path='/nih_ic_webform' component={NIHICWebform} />
<Route path='/nih_pilot_info' component={NIHPilotInfo} />
<Route path='/privacy' component={PrivacyPolicy} />
<Route path='/tos' component={TermsOfService} props={props} />
<Route path='/tos_acceptance' component={TermsOfServiceAcceptance} props={props} />
<Route path='/consent_text_generator' component={ConsentTextGenerator} />
<Route path='/nih_dms_policy' component={NIHDMSPolicyInfo} />
<Route path='/anvil_dms_policy' component={AnVILDMSPolicyInfo} />
<AuthenticatedRoute path='/profile' component={UserProfile} props={props} rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path='/request_role' component={RequestForm} rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path='/admin_review_collection/:collectionId' component={DarCollectionReview} props={Object.assign({adminPage: true}, props)} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path='/admin_manage_users' component={AdminManageUsers} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path='/admin_edit_user/:userId' component={AdminEditUser} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path='/manage_dac' component={ManageDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path='/manage_edit_dac/:dacId' component={ManageEditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path='/manage_add_dac' component={ManageEditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
{DAAUtils.isEnabled() && <AuthenticatedRoute path='/manage_edit_dac_daa/:dacId' component={EditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />}
{DAAUtils.isEnabled() && <AuthenticatedRoute path='/manage_add_dac_daa' component={EditDac} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />}
<AuthenticatedRoute path='/admin_manage_institutions' component={AdminManageInstitutions} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path='/researcher_console' component={ResearcherConsole} props={props} rolesAllowed={[USER_ROLES.researcher]}/>
<AuthenticatedRoute path='/dar_collection/:collectionId' component={DarCollectionReview} props={props} rolesAllowed={[USER_ROLES.researcher, USER_ROLES.chairperson, USER_ROLES.member, USER_ROLES.signingOfficial]}/>
<AuthenticatedRoute path='/chair_console' component={ChairConsole} props={props} rolesAllowed={[USER_ROLES.chairperson]}/>
<AuthenticatedRoute path='/member_console' component={MemberConsole} props={props} rolesAllowed={[USER_ROLES.member]}/>
<AuthenticatedRoute path='/dar_vote_review/:collectionId' component={DarCollectionReview} props={Object.assign({readOnly: true}, props)}
rolesAllowed={[USER_ROLES.chairperson, USER_ROLES.member]}/>
<AuthenticatedRoute path="/dar_application_review/:collectionId" component={DataAccessRequestApplication} props={Object.assign({}, props, {readOnlyMode: true})}
<AuthenticatedRoute path='/dar_application_review/:collectionId' component={DataAccessRequestApplication} props={Object.assign({}, props, {readOnlyMode: true})}
rolesAllowed={[USER_ROLES.researcher]} />
{/* Order is important for processing links with embedded dataRequestIds */}
<AuthenticatedRoute path="/dar_application/:dataRequestId" component={DataAccessRequestApplication} props={Object.assign({}, props, {draftDar: true})}
<AuthenticatedRoute path='/dar_application/:dataRequestId' component={DataAccessRequestApplication} props={Object.assign({}, props, {draftDar: true})}
rolesAllowed={[USER_ROLES.researcher]} />
<AuthenticatedRoute path="/dar_application" component={DataAccessRequestApplication} props={props} rolesAllowed={[USER_ROLES.researcher]} />
<AuthenticatedRoute path="/signing_official_console/researchers" component={ensureSoHasDaaAcknowledgement(SigningOfficialResearchers, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />
{DAAUtils.isEnabled() && <AuthenticatedRoute path="/signing_official_console/researchers_daa_associations" component={ensureSoHasDaaAcknowledgement(ManageResearcherDAAs, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />}
<AuthenticatedRoute path="/signing_official_console/dar_requests" component={ensureSoHasDaaAcknowledgement(SigningOfficialDarRequests)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />
{DAAUtils.isEnabled() && <AuthenticatedRoute path="/signing_official_console/data_submitters" component={ensureSoHasDaaAcknowledgement(SigningOfficialDataSubmitters, false, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />}
<AuthenticatedRoute path="/dataset_submissions" component={DatasetSubmissions} props={props} rolesAllowed={[USER_ROLES.dataSubmitter]}/>
<AuthenticatedRoute path="/dataset_update/:datasetId" component={DatasetUpdateForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path="/data_submission_form" component={DataSubmissionForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson, USER_ROLES.dataSubmitter]} />
<AuthenticatedRoute path="/study_update/:studyId" component={StudyUpdateForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson, USER_ROLES.dataSubmitter]} />
<AuthenticatedRoute path="/admin_manage_lc/" component={AdminManageLC} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path="/admin_manage_dar_collections/" component={AdminManageDarCollections} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path="/datalibrary/:query" component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path="/datalibrary" component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path="/dataset/:datasetIdentifier" component={DatasetStatistics} props={props} rolesAllowed={[USER_ROLES.all]} />
<Redirect from="/DUOS-:duosId" to="/dataset/DUOS-:duosId" props={props} rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path="/dac_datasets" component={DACDatasets} props={props} rolesAllowed={[USER_ROLES.chairperson]} />
<AuthenticatedRoute path="/tos_acceptance" component={TermsOfServiceAcceptance} props={props} rolesAllowed={[USER_ROLES.all]} />
{checkEnv(envGroups.NON_PROD) && <AuthenticatedRoute path="/translate" component={Translator} props={props} rolesAllowed={[USER_ROLES.researcher]}/>}
<Route path="*" component={NotFound} />
<AuthenticatedRoute path='/dar_application' component={DataAccessRequestApplication} props={props} rolesAllowed={[USER_ROLES.researcher]} />
<AuthenticatedRoute path='/signing_official_console/researchers' component={ensureSoHasDaaAcknowledgement(SigningOfficialResearchers, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />
{DAAUtils.isEnabled() && <AuthenticatedRoute path='/signing_official_console/researchers_daa_associations' component={ensureSoHasDaaAcknowledgement(ManageResearcherDAAs, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />}
<AuthenticatedRoute path='/signing_official_console/dar_requests' component={ensureSoHasDaaAcknowledgement(SigningOfficialDarRequests)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />
{DAAUtils.isEnabled() && <AuthenticatedRoute path='/signing_official_console/data_submitters' component={ensureSoHasDaaAcknowledgement(SigningOfficialDataSubmitters, false, true)} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.signingOfficial]} />}
<AuthenticatedRoute path='/dataset_submissions' component={DatasetSubmissions} props={props} rolesAllowed={[USER_ROLES.dataSubmitter]}/>
<AuthenticatedRoute path='/dataset_update/:datasetId' component={DatasetUpdateForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson]} />
<AuthenticatedRoute path='/data_submission_form' component={DataSubmissionForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson, USER_ROLES.dataSubmitter]} />
<AuthenticatedRoute path='/study_update/:studyId' component={StudyUpdateForm} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.chairperson, USER_ROLES.dataSubmitter]} />
<AuthenticatedRoute path='/admin_manage_lc/' component={AdminManageLC} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path='/admin_manage_dar_collections/' component={AdminManageDarCollections} props={props} rolesAllowed={[USER_ROLES.admin]} />
<AuthenticatedRoute path='/datalibrary/:query' component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path='/datalibrary' component={DatasetSearch} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
<AuthenticatedRoute path='/studies/:studyId' component={StudyDetails} props={props} rolesAllowed={[USER_ROLES.admin, USER_ROLES.all]} />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only new line here, other than that its all linting

<AuthenticatedRoute path='/dataset/:datasetIdentifier' component={DatasetStatistics} props={props} rolesAllowed={[USER_ROLES.all]} />
<Redirect from='/DUOS-:duosId' to='/dataset/DUOS-:duosId' props={props} rolesAllowed={[USER_ROLES.all]} />
<AuthenticatedRoute path='/dac_datasets' component={DACDatasets} props={props} rolesAllowed={[USER_ROLES.chairperson]} />
<AuthenticatedRoute path='/tos_acceptance' component={TermsOfServiceAcceptance} props={props} rolesAllowed={[USER_ROLES.all]} />
{checkEnv(envGroups.NON_PROD) && <AuthenticatedRoute path='/translate' component={Translator} props={props} rolesAllowed={[USER_ROLES.researcher]}/>}
<Route path='*' component={NotFound} />
</Switch>
);

Expand Down
Loading
Loading