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

feat(admin): Create challenges page #2491

Merged

Conversation

flacial
Copy link
Member

@flacial flacial commented Nov 5, 2022

Related to #2081

Description

This PR aims at adding the page that'll be used to create and edit the challenges.

Page image image

Testing

  1. Go to /admin/lessons/js0/challenges
  2. Select one of the challenges in the sidebar and click it
  3. Edit the challenge name
  4. Press SAVE CHANGES → Make sure it got updated correctly
  5. Press ADD NEW MODULE at the bottom of the sidebar
  6. Fill in the inputs and set the order as 0 → Make sure it appears as the first item in the sidebar

Issues

The sidebar text should be ADD NEW CHALLENGE & NO CHALLENGES instead of modules. This will be fixed in a subsequent PR.

@vercel
Copy link

vercel bot commented Nov 5, 2022

@flacial is attempting to deploy a commit to the c0d3-prod Team on Vercel.

A member of the Team first needs to authorize it.

@@ -162,7 +161,12 @@ const ModulesPage = ({ modules, lessonId, refetch }: ModulesPageProps) => {
<div className={styles.container__modulesPanel}>
<AdminLessonSideNav
title="Modules"
items={modules}
items={modules.map(module => ({
Copy link
Member Author

@flacial flacial Nov 5, 2022

Choose a reason for hiding this comment

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

AdminLessonSideNav takes a specific object. For it to work, we're passing what it expects.

fetchPolicy: 'no-cache'
})

const { data: modulesData, refetch: refetchModules } = useModulesQuery({
Copy link
Member Author

Choose a reason for hiding this comment

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

To reduce the number of queries sent, we can only send a request to get x query (e.g, modules) when the user goes to its page. Let me know what you think.

@vercel
Copy link

vercel bot commented Nov 5, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
c0d3-app ✅ Ready (Inspect) Visit Preview Nov 12, 2022 at 11:57AM (UTC)

@codecov
Copy link

codecov bot commented Nov 5, 2022

Codecov Report

Merging #2491 (270cbd7) into master (22a6115) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #2491   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          186       186           
  Lines         3324      3348   +24     
  Branches       883       889    +6     
=========================================
+ Hits          3324      3348   +24     
Impacted Files Coverage Δ
...es/admin/lessons/[lessonSlug]/[pageName]/index.tsx 100.00% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants