-
Notifications
You must be signed in to change notification settings - Fork 0
Replaced building hours #35
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
Conversation
- Created functions for open/close time logic based on fitness centers - Changed open/close status and time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job Caitlyn! Please address my comments and request me again.
- Renamed home page labels - Removed `GymDetailViewModel` - Added `fitnessCenterIsOpen()` and `determineStatus()` to `Gym` model - Created test cases for the above functions - Created dummy data for Teagle - Simplified status logic in `HomeGymCell`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on addressing my comments Caitlyn! Essentially good to go, but there are just a few typos and quick changes you should address before merging. Hopefully you understand how unit tests work and how useful they are!
In the future, we should expand our testing and create multiple test suites. Because we only test a few functions, this is fine for now. We should also configure a GitHub workflow that triggers an Xcode command line to run the test suite on PR creation, but it's not that important.
- Fixed grammatical errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool! I'm going to reference this in the future when implementing logic! Looks good btw.
// TODO: Removed building hours. Determine what should be displayed here. | ||
// switch gym.status { | ||
// case .closed: | ||
// Text("CLOSED") | ||
// .font(Constants.Fonts.h3) | ||
// .foregroundStyle(Constants.Colors.closed) | ||
// case .open: | ||
// Text("OPEN") | ||
// .font(Constants.Fonts.h3) | ||
// .foregroundStyle(Constants.Colors.open) | ||
// case .none: | ||
// EmptyView() | ||
// } | ||
// | ||
// viewHoursButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to delete this for style right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're holding onto this code for now because we had to remove building hours, not sure what we're going to do with it yet.
Overview
Replaced the displayed building hours to reflect the status and open/close hours of the fitness centers. This change is applied to the gym cards on the home page as well as the gym detail pages.
Changes Made
Gym
fitnessCenterIsOpen
to determine whether at least one fitness center is open at the specified gym.determineStatus
to retrieve the status of theGym
depending on the hours of its fitness centers. This status reflects the latest close time if at least one fitness center is open and the earliest open time if no fitness centers are open.Home Gym Cell
Gym Detail View
Other Changes
DummyData.swift
. Due to missing propertyisSpecial
, fixed previous dummy data that includesOpenHours
.Test Coverage
fitnessCenterIsOpen
inGym
.determineStatus
inGym
.Next Steps
Screenshots (optional)
Building Hours -> Gym/Fitness Center Hours
fix-hours-before.mp4
fix-hours-after.mp4