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

Fix Event sorting on Home Screen #383

Closed
wants to merge 4 commits into from

Conversation

irby
Copy link
Collaborator

@irby irby commented Aug 10, 2024

Fixes #382

Changes made:

  • Use getActive scope when fetching events on Home and Events pages, this will check both events are active and sort by active_at attribute
  • Update GitHub Actions check to build with vite before running tests (required to run tests against web controllers)
  • Use Carbon::now() instead of DB::raw('NOW()' because of SQLite does not support this command.

@irby irby changed the title Irby/382/home screen sorting Fix Event sorting on Home Screen Aug 10, 2024
@allella
Copy link
Member

allella commented Aug 11, 2024

@irby I think Bogdan added the orderBy to fix an issue on /calendar where August 2024 was sorting incorrectly. It was sorted between Dec 2024 and Jan 2025, or some such.

You may want to check the calendar page to see if that bug returned.

@irby
Copy link
Collaborator Author

irby commented Aug 13, 2024

@allella I've checked the CalendarController and saw that the data route does not need to have the getActive attribute in order to properly arrange the events, right now it does not properly sort events by their active_at attribute. Want me to apply the change there as well?

@allella
Copy link
Member

allella commented Aug 13, 2024

@irby whatever makes sense. If the PR branch is sorting like stage and live, then it's not what we expect.

Showing the next 5 events starting with the current time seems to be what we had there and something in the recent rework made it do what it's doing on with only showing events for one org
https://hackgreenville.com

@irby
Copy link
Collaborator Author

irby commented Aug 13, 2024

@allella Looking at the website, I do not see there's any issue with how the calendar is presented today.

I think the difference as to why this is working on the calendar view is the following:

  • The calendar view handles sorting the data into the appropriate days on the calendar. It's able to take an unsorted set of calendar data and place it appropriately in the calendar grid
  • The data endpoint doesn't truncate/paginate data. The issue with the home screen is that it was taking the first 5 results it receives, currently unsorted in live today.

With that being said, if it's not breaking the calendar experience we have today there's no point in making a code change to order the data set that's generated by the backend.

@allella
Copy link
Member

allella commented Aug 13, 2024

I'll merge this and see how things look on stage.

As long as the homepage is showing the next 5 items, and not the last 5 in the database, then we should be good.

@allella
Copy link
Member

allella commented Aug 13, 2024

@bogdankharchenko do you have any input on this PR?

@bogdankharchenko
Copy link
Collaborator

@allella @irby I think the smallest diff change is to add "orderBy" logic to the "future" scope. It will solve everything - I want to remove getActive scope hence why I have been removing all of it slowly =)

@bogdankharchenko
Copy link
Collaborator

See: #384

@irby
Copy link
Collaborator Author

irby commented Aug 13, 2024

@bogdankharchenko Approved PR with comment, think we should axe getActive if we're going to merge the logic into future

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.

Bug: Upcoming Events on Homepage only Showing DefCon
3 participants