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

Add an Info Alert when there's nothing to review #2492

Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 22 additions & 2 deletions __tests__/pages/review/__snapshots__/[lesson].test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,28 @@ exports[`Lesson Page Should render empty submissions 1`] = `
</div>
</div>
<div
class="submissions-container container p-0"
/>
class="p-0 mt-4"
>
<div
class="fade alert alert-primary show"
role="alert"
>
<div
class="d-flex align-items-center gap-3"
>
<div
class="info_image"
>
<img
height="24"
src="/assets/curriculum/icons/icon-tip.svg"
width="24"
/>
</div>
All the submissions were reviewed. Come and check later!
</div>
</div>
</div>
</div>
</div>
<footer
Expand Down
18 changes: 15 additions & 3 deletions pages/review/[lesson].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import withQueryLoader, {
import _ from 'lodash'
import { SubmissionStatus } from '../../graphql'
import { GlobalContext } from '../../helpers/globalContext'
import Alert from '../../components/Alert'

type SubmissionDisplayProps = {
submissions: Submission[]
Expand Down Expand Up @@ -85,9 +86,20 @@ const Review: React.FC<QueryDataProps<GetAppQuery>> = ({ queryData }) => {
lessonSlug={slug}
isPassed={true}
/>
{currentLesson && (
<SubmissionDisplay submissions={lessonSubmissions} />
)}
{currentLesson &&
(lessonSubmissions.length ? (
<SubmissionDisplay submissions={lessonSubmissions} />
) : (
<div className="p-0 mt-4">
<Alert
alert={{
id: 0,
text: 'All the submissions were reviewed. Come and check later!',
type: 'info'
}}
/>
</div>
))}
</div>
</Layout>
</div>
Expand Down