Skip to content

Conversation

@binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Dec 4, 2020

This PR changes the user's saved locations pane using LocationField for entering locations and obtaining the locations coordinates, so that coordinates are persisted with the user preferences. by updating the widget (FavoritePlaceRow) to display each location (place).

The PR also lets the user Clicking a FavoritePlaceRow opens a page (FavoritePlacePage) where the user can change the type of location (e.g. 'dining', 'custom' - what other predefined types need to be added?). A dropdown is added to the left of the location. (It is not possible to edit the nickname of each location yet.)

Code-wise, each location row is now its own FavoriteLocation FavoritePlaceRow component. The FavoritePlacePage that hosts a styled FavoriteLocationField PlaceLocationField version of LocationField. This will allow further refinements of the layout or allowing more advanced editing so let me know if you have any suggestions.

EDIT 1:

  • The PR refactors the code connecting LocationField instances to the redux store.
  • The PR replaces instances where FontAwesome is used directly with Icon (from narrative).

EDIT 2:

  • Added a nickname field for the locations
  • Updated the styling to reflect mockup
  • Added a new FixedFavoriteLocation component and removed quirks in the code regarding placeholders
  • Moved more shared components to favorite-location-controls.
  • Updated screenshots below.

EDIT 3

  • Moved favorite location components to subfolder /user/favorite-locations/

EDIT 4

  • Updated PR description
  • Renamed /user/favorite-locations/ => /user/places and renamed components within.
  • Added page/routing support for editing places.
  • Updated visuals

EDIT 5:

  • Create new versions of <Link> and <LinkContainer> that preserve the query parameters (fix Unable to use LinkContainer #202).
  • Use a separate URL for each page in the New account wizard (e.g. /account/create/terms), so that when user finishes editing a place, they remain in the wizard mode instead of seeing a single page with all settings.
  • Issue: If the new user set the notification preference other than email then edits a place, the notification preference is lost. This issue will be addressed when we remove the Save button for user settings.

EDIT 6:

When editing places:

  • while creating new accounts, the "My account" header is not shown.
  • the Back/Save buttons are now shown below the place details.

Screenshot:
image

NEW screenshots:
image

image

NEWEST screenshots

image

image

Copy link
Member

@landonreed landonreed left a comment

Choose a reason for hiding this comment

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

Looking good, but I do have a couple of changes. We do have some updated mocks that deal with the user account page (see sprint review presentation) that this doesn't align with, but perhaps we should discuss further (maybe we can handle alignment in a separate PR).

@binh-dam-ibigroup binh-dam-ibigroup removed their assignment Dec 10, 2020
*/
function setUser (user, fetchTrips) {
return function (dispatch, getState) {
positionHomeAndWorkFirst(user)
Copy link
Member

Choose a reason for hiding this comment

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

I still don't think the client should be concerned with this, but I won't make this blocking so we can move forward. I do think we should add an issue to otp-middleware that handles this sorting before persisting an update and ensures that there is only one home/work location for any given user.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

/>
<Route
component={FavoritePlaceScreen}
path={`${PLACES_PATH}/:id`}
Copy link
Member

Choose a reason for hiding this comment

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

When creating a place in the context of a new account, I think we should avoid placing the My account header content at the top of the page. Doing so takes the user out of the create account context and also shows the Trips/Settings links, which should not be available at this stage. I don't want to overcomplicate this though... thoughts on a clean approach here?

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is now addressed in 70f449c. Per chat, the Back/Save buttons are harmonized in 411caf1.

Copy link
Member

@landonreed landonreed left a comment

Choose a reason for hiding this comment

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

Just one main thing: the 'My account' page header should not show when adding a place while creating account. Perhaps we could use a path like account/create/places/0.

@binh-dam-ibigroup
Copy link
Collaborator Author

Alright, ready for review again...

locationType='to'
onLocationSelected={this._handleLocationChange}
showClearButton={false}
static={isMobile()}
Copy link
Member

Choose a reason for hiding this comment

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

Sigh... I forgot that showing the field in mobile view is why we opted for the buttons above instead of below. We may want to change this so that in mobile mode the buttons render at the top of the screen and in desktop they're below the location field.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll add that. The other thing we could do in mobile (in another PR) is to flush the back/save buttons to the bottom of the screen so that they are always shown, but that may be also be tricky...

Copy link
Collaborator Author

@binh-dam-ibigroup binh-dam-ibigroup Feb 17, 2021

Choose a reason for hiding this comment

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

Updated in 326199f. I also created an issue #331 for tracking.

@landonreed landonreed removed their assignment Feb 19, 2021
@binh-dam-ibigroup binh-dam-ibigroup merged commit f32b2bb into dev Feb 22, 2021
@binh-dam-ibigroup binh-dam-ibigroup deleted the improve-save-user-locations branch February 22, 2021 15:04
@evansiroky evansiroky mentioned this pull request Mar 31, 2021
@github-actions
Copy link
Contributor

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Unable to use LinkContainer

5 participants