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

Sort of courses on the home page #1532

Merged
merged 42 commits into from
May 18, 2024
Merged

Conversation

ramzieus
Copy link
Contributor

@ramzieus ramzieus commented Jan 14, 2024

Proposed Changes

  • add migration to add sort_index column to Course
  • add buttons up and down to control the order of the courses

image

@pupilfirst/developers
@pupilfirst/designers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Check if route, query, or mutation authorization looks correct.
  • Ensure that UI text is kept in I18n files.
  • Update developer and product docs, where applicable.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Check if new tables or columns that have been added need to be handled in the following services:
  • Check if changes in packaged components have been published to npm.
  • Add development seeds for new tables.
  • If the updates involve Graph mutations ensure that the files are migrated to the new approach without a mutator.
  • If the updates involve adding a new table ensure that rate limiting is added and documented in the docs/developers/rate_limiting.md file.

@ramzieus ramzieus marked this pull request as ready for review January 21, 2024 22:11
db/schema.rb Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
config/locales/ar.yml Outdated Show resolved Hide resolved
config/locales/en.yml Outdated Show resolved Hide resolved
app/models/course.rb Outdated Show resolved Hide resolved
@kaisersakhi kaisersakhi self-requested a review January 24, 2024 16:45
app/graphql/mutations/move_course.rb Outdated Show resolved Hide resolved
app/graphql/mutations/move_course.rb Outdated Show resolved Hide resolved
app/graphql/mutations/move_course.rb Outdated Show resolved Hide resolved
app/graphql/mutations/move_course.rb Outdated Show resolved Hide resolved
@kaisersakhi
Copy link
Member

@ramzieus Could you please complete the default checklist? Also, add specs for this feature as well.

@kaisersakhi
Copy link
Member

@vinutv @irajsuhail Could you please have a look at this whenever you're free.

@kaisersakhi kaisersakhi requested review from kaisersakhi and removed request for kaisersakhi January 25, 2024 16:55
@kaisersakhi
Copy link
Member

kaisersakhi commented Jan 25, 2024

  • ReScript yet to be reviewed

@ramzieus
Copy link
Contributor Author

@kaisersakhi spec added

app/frontend/admin/courses/CourseEditor__Root.res Outdated Show resolved Hide resolved
app/frontend/admin/courses/CourseEditor__Root.res Outdated Show resolved Hide resolved
app/frontend/admin/courses/CourseEditor__Root.res Outdated Show resolved Hide resolved
app/frontend/admin/courses/CourseEditor__Root.res Outdated Show resolved Hide resolved
app/frontend/admin/courses/CourseEditor__Root.res Outdated Show resolved Hide resolved
app/presenters/home/index_presenter.rb Outdated Show resolved Hide resolved
app/presenters/layouts/app_router_presenter.rb Outdated Show resolved Hide resolved
app/presenters/layouts/app_router_presenter.rb Outdated Show resolved Hide resolved
@ramzieus
Copy link
Contributor Author

ramzieus commented Feb 4, 2024

@yash-learner done

@irajsuhail
Copy link
Member

Please check the updated design for the admin dashboard
Figma doc

@ramzieus @yash-learner @vinutv

@ramzieus
Copy link
Contributor Author

@irajsuhail good and useful design

@harigopal
Copy link
Member

harigopal commented May 14, 2024

Either disable the downward direction swap for last course in the loaded courses with the first course of unloaded courses, or Handle the UI when swap is allowed.

@yash-learner It looks like this is already managed in the UI? The top course only shows the down arrow, and the bottom course only shows the up arrow. 🤔

Auth token is allowed for move_course mutation, Is this required?

There doesn't seem any harm in it. 🤷🏼‍♂️

We should also check all listing of courses to see if it follows the sort index;

I think we can gradually apply the use of courses.sort_index.

Also check how the sort index will be affected if we have applied filters.

It shouldn't have any special effect. Even when any filter is applied, the resulting list needs to be ordered by something - that something is the sort_index now.

It will be great if we have a public filter, that allows users to see all publicly listed courses.

Not absolutely necessary to get this merged, I think. Skip for now?

Copy link
Member

@yash-learner yash-learner left a comment

Choose a reason for hiding this comment

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

Comments on latest changes

It looks like this is already managed in the UI? The top course only shows the down arrow, and the bottom course only shows the up arrow. 🤔

Not handled in UI when the page is paginated

image

We decided not to swap the last course in the loaded courses with the first course of unloaded courses in pagination.


It shouldn't have any special effect. Even when any filter is applied, the resulting list needs to be ordered by something - that something is the sort_index now.

Yes


Not absolutely necessary to get this merged, I think. Skip for now?

Yes

I think we can gradually apply the use of courses.sort_index.

Yes

@harigopal harigopal requested review from yash-learner and removed request for vinutv May 16, 2024 18:35
@harigopal
Copy link
Member

Not handled in UI when the page is paginated

@yash-learner I opted not to show the Move down option for the last entry in the list, regardless of whether it's fully loaded or partially loaded. This small change allows the existing UI code to work as intended. The Move down option will appear on last loaded entry if more are loaded beneath it.

harigopal
harigopal previously approved these changes May 18, 2024
@harigopal harigopal merged commit ddb9b44 into pupilfirst:master May 18, 2024
3 checks passed
@yash-learner
Copy link
Member

Thank you, @ramzieus, for the contribution 🙌

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.

Fix the conditional check when retrieving the thumbnail image in course_type
7 participants