Skip to content

Commit

Permalink
Merge pull request #2492 from flacial/2462-lack-of-information-when-t…
Browse files Browse the repository at this point in the history
…heres-nothing-to-review

Add an Info Alert when there's nothing to review
  • Loading branch information
flacial authored Nov 5, 2022
2 parents 0f9e90f + 8f4a757 commit ab65256
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
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

1 comment on commit ab65256

@vercel
Copy link

@vercel vercel bot commented on ab65256 Nov 5, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.