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

Issue 15 - saved frequent user locations #20

Merged

Conversation

hilmyveradin
Copy link
Collaborator

@hilmyveradin hilmyveradin commented Jul 4, 2024

Adding favorite locations and recent locations functionality

Related Issues

#15

Description

This PR related to issue #15. Within this PR, the changes included are:

  1. Adding a favorite locations section so that users can add their favorite locations.
  2. If users tap a location, the location will be saved to recent locations.
  3. Users can see the details of favorite locations and recent locations from the “more” button.

Media

Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-07-04.at.12.49.55.mov

Test Instructions

To test this PR, you can do the following:

  1. Tap any Origin or Destination.
  2. Search for a location and tap the selected location. Check if it’s being added to recent locations. It should be visible.
  3. Click the plus button in the add location section. Search for a location and tap your desired location. It should be added to the Favorite locations section.
  4. If you click on the details of a favorite location, you should be able to see the details of the location’s title and subtitle.
  5. Try to delete a favorite location from the favorite location details. It should be removed from the favorite locations section.

Additional Context

Currently, this PR not having any edit functionality for favorite location yet because for MVP, I was thinking the scope of favorite locations is just marking the searched locations only

@hilmyveradin hilmyveradin changed the title DRAFT - Issue 15 - saved frequent user locations Issue 15 - saved frequent user locations Jul 7, 2024
Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

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

great work! as noted, I saw a couple minor issues but I will log them in a set of followup issues when I have full repro steps.

@@ -45,7 +44,7 @@ struct TripPlannerView: View {
fromPlace: "47.6097,-122.3331",
toPlace: "47.6154,-122.3208",
time: "8:00 AM",
date: "05-10-2024",
date: "07-05-2024",
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be composed dynamically so we don't end up in the same situation again :)

func getFormattedTomorrowDate() -> String {
    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "MM-dd-yyyy"
    let tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: Date())!
        
    return dateFormatter.string(from: tomorrow)
}

@aaronbrethorst aaronbrethorst merged commit 16daff4 into OneBusAway:main Jul 14, 2024
3 checks passed
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