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

✨(frontend) dashboard teacher: page profile courses #1951

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

rlecellier
Copy link
Collaborator

@rlecellier rlecellier commented Mar 31, 2023

Purpose

Add course search page for teacher profile in new teacher dashboard.

Sketch preview

Proposal

  • Rename existing type Joanie.Course into Joanie.CourseLight
  • Add a new type Joanie.Course used in Teacher Dashboard listings
  • Add MSW mock for joanie endpoint : "/courses"
  • Use existing CourseGlimpse and CourseGlimpseList in new TeacherDashboardCourse page.
  • Implement search filters in new TeacherDashboardCourse page.

Todo

Backend filters for courses

  • filter status: incoming, ongoing, archived
  • filter type:

Date manipulation

it would be nice to have a library to handle date transformations and formating.
The one used on my previous project was date-fns.

dashboard_teacher_courses_home
dashboard_teacher_courses_filtered

@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 3 times, most recently from 5f25a8f to 22b9ec7 Compare April 3, 2023 15:14
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch from 22b9ec7 to fb0d2ac Compare April 4, 2023 12:23
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 2 times, most recently from 678e1de to 88c4ec6 Compare April 5, 2023 14:59
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 8 times, most recently from 6bc9958 to 185555d Compare April 18, 2023 08:54
@rlecellier rlecellier changed the title 🚧(frontend) dashboard teacher: page profile courses ✨(frontend) dashboard teacher: page profile courses Apr 18, 2023
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 2 times, most recently from 14aa15b to a9e52c8 Compare April 18, 2023 13:36
@rlecellier rlecellier marked this pull request as ready for review April 18, 2023 13:36
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 2 times, most recently from d0574c7 to cfab391 Compare April 18, 2023 15:23
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 2 times, most recently from 1672b03 to 207ddb5 Compare April 21, 2023 08:47
src/frontend/js/api/mocks/joanie/courses.ts Outdated Show resolved Hide resolved
src/frontend/js/components/CourseGlimpseList/index.tsx Outdated Show resolved Hide resolved
src/frontend/js/components/DashboardCourseList/index.tsx Outdated Show resolved Hide resolved
src/frontend/js/hooks/useCourses/index.ts Outdated Show resolved Hide resolved
src/frontend/scss/colors/_theme.scss Outdated Show resolved Hide resolved
@jbpenrath
Copy link
Member

jbpenrath commented Apr 21, 2023

Great work !

Just a general feeback : for next reviews, try to split our changes into smaller commit, this PR was a bit hard to review 💊

@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch from 207ddb5 to e1f0a53 Compare April 24, 2023 13:58
Copy link
Collaborator Author

@rlecellier rlecellier left a comment

Choose a reason for hiding this comment

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

Loading hook and animation have been moved into #1971

Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

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

Last one review then we will be ready to merge

CHANGELOG.md Show resolved Hide resolved
src/frontend/scss/colors/_theme.scss Outdated Show resolved Hide resolved
src/frontend/js/api/mocks/joanie/courses.ts Show resolved Hide resolved
src/frontend/js/hooks/useCourses/index.ts Outdated Show resolved Hide resolved
We need Course to contain lot's more information for our course
endpoint that will be make for teacher dashboard course page.
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch from e1f0a53 to 326c1f7 Compare April 25, 2023 12:59
Comment on lines +43 to +44
status: CourseStatusFilter;
type: CourseTypeFilter;
Copy link
Member

Choose a reason for hiding this comment

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

Should be optional, nope ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As is, we always have a filter value with "all" instead of undefined for all the results

src/frontend/js/types/Joanie.ts Show resolved Hide resolved
</span>
</Spinner>
)}
{!fetching && courses.length && (
Copy link
Member

Choose a reason for hiding this comment

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

Currently, if courses array is empty, 0 will be displayed.

Suggested change
{!fetching && courses.length && (
{!fetching && courses.length > 0 && (

Copy link
Member

Choose a reason for hiding this comment

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

I think a test is missing to check what happens when courses is empty.

src/frontend/js/components/DashboardCourseList/index.tsx Outdated Show resolved Hide resolved
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch 2 times, most recently from d9335e9 to b6a0e73 Compare April 27, 2023 13:19
Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

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

LGTM ✅

    Part of teacher dashboard development, list teacher courses.
@rlecellier rlecellier force-pushed the rlecellier/dashboard_teacher_courses branch from b6a0e73 to a56f322 Compare April 27, 2023 13:47
@rlecellier rlecellier merged commit d625467 into master Apr 27, 2023
@rlecellier rlecellier deleted the rlecellier/dashboard_teacher_courses branch April 27, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants