-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(website): review pages are now per-group (#1586)
- Loading branch information
1 parent
de82bf3
commit 66f01bf
Showing
11 changed files
with
131 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 21 additions & 15 deletions
36
website/src/pages/[organism]/submission/[groupId]/review.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
--- | ||
import { ReviewPage } from '../../../../components/ReviewPage/ReviewPage'; | ||
import NeedToLogin from '../../../../components/common/NeedToLogin.astro'; | ||
import SubmissionPageWrapper from '../../../../components/Submission/SubmissionPageWrapper.astro'; | ||
import { getRuntimeConfig } from '../../../../config'; | ||
import BaseLayout from '../../../../layouts/BaseLayout.astro'; | ||
import { type ClientConfig } from '../../../../types/runtimeConfig'; | ||
import { getAccessToken } from '../../../../utils/getAccessToken'; | ||
import { getGroupsAndCurrentGroup } from '../../../../utils/submissionPages'; | ||
|
||
const organism = Astro.params.organism!; | ||
const accessToken = getAccessToken(Astro.locals.session)!; | ||
const groupsResult = await getGroupsAndCurrentGroup(Astro.params, Astro.locals.session); | ||
|
||
const clientConfig: ClientConfig = getRuntimeConfig().public; | ||
--- | ||
|
||
{ | ||
accessToken ? ( | ||
<BaseLayout title='Current submissions'> | ||
<h1 class='title'>Current submissions</h1> | ||
<ReviewPage clientConfig={clientConfig} organism={organism} accessToken={accessToken} client:load /> | ||
</BaseLayout> | ||
) : ( | ||
<BaseLayout title='Current submissions'> | ||
<NeedToLogin /> | ||
</BaseLayout> | ||
) | ||
} | ||
<SubmissionPageWrapper title='Review current submissions' organism={organism} groupsResult={groupsResult}> | ||
{ | ||
groupsResult.match( | ||
({ currentGroup: group }) => ( | ||
<ReviewPage | ||
clientConfig={clientConfig} | ||
organism={organism} | ||
group={group} | ||
accessToken={getAccessToken(Astro.locals.session)!} | ||
client:load | ||
/> | ||
), | ||
() => undefined, | ||
) | ||
} | ||
</SubmissionPageWrapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.