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

[User Settings] Add new Profile view #1767

Merged
merged 23 commits into from
Mar 23, 2021

Conversation

Maftalion
Copy link
Contributor

@Maftalion Maftalion commented Mar 13, 2021

Details

  • Added new personal details update form to profile page
  • Created new checkbox component

Fixed Issues

Fixes https://github.com//issues/1711

Tests

  • Go to settings/profile, modify details
  • Click "save" and refresh app to confirm changes took effect

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Video

Screen.Recording.2021-03-13.at.1.44.57.PM.mov

Web

Screen Shot 2021-03-13 at 1 31 30 PM

Mobile Web

Screen Shot 2021-03-13 at 1 30 03 PM

Desktop

Screen Shot 2021-03-13 at 1 32 17 PM

iOS

Screen Shot 2021-03-13 at 1 31 13 PM

Android

Screen Shot 2021-03-13 at 1 32 43 PM

@Maftalion Maftalion requested a review from a team as a code owner March 13, 2021 21:53
@botify botify requested review from nickmurray47 and removed request for a team March 13, 2021 21:53
@Maftalion
Copy link
Contributor Author

How are pages with keyboards normally handled?
Screen Shot 2021-03-13 at 1 19 10 PM

@Maftalion
Copy link
Contributor Author

@shawnborton updated
Screen Shot 2021-03-15 at 8 41 42 AM

Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

Some initial comments, I think the first way of approaching the self-select option @Maftalion is good.

This might be slightly outside the scope of this particular PR @shawnborton but it seems awkward to me that after clicking Save in the profile section that nothing happens to indicate the details were actually saved. I feel like we should give the user a small pop-up like User details updated! and it can just be added as a callback from the updatePersonalDetails method.

src/components/Checkbox.js Outdated Show resolved Hide resolved
src/components/Checkbox.js Outdated Show resolved Hide resolved
src/components/Checkbox.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
shawnborton
shawnborton previously approved these changes Mar 15, 2021
@shawnborton
Copy link
Contributor

Visually this looks good to me, will leave the code review for @nickmurray47

@Maftalion
Copy link
Contributor Author

@nickmurray47 updated

This might be slightly outside the scope of this particular PR @shawnborton but it seems awkward to me that after clicking Save in the profile section that nothing happens to indicate the details were actually saved. I feel like we should give the user a small pop-up like User details updated! and it can just be added as a callback from the updatePersonalDetails method.

I brought this up in the proposal as well, sounds like it will be covered with follow-up work #1711 (comment)

@nickmurray47
Copy link
Contributor

I brought this up in the proposal as well, sounds like it will be covered with follow-up work #1711 (comment)

Oh nice! Missed this comment, thanks for the clarification

Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

Works great @Maftalion!

src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/components/Checkbox.js Outdated Show resolved Hide resolved
@NikkiWines NikkiWines linked an issue Mar 15, 2021 that may be closed by this pull request
@nickmurray47
Copy link
Contributor

Think there was a weird GH bug yesterday, going to re-run the checks @Maftalion so we can get unblocked on this

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

This is looking really great. Left som minor comments and style suggestions

src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Other than a couple minor color alterations, this is looking great 🎉 Will re-review once those are updated and conflicts are resolved.

@shawnborton
Copy link
Contributor

@NikkiWines @michelle-thompson @Maftalion I wanted to get your thoughts on some things quickly:

Do we think the Save button should be fixed to the bottom of the profile view?
I can see an argument where this matches other patterns we've established where the primary button on a view like this is fixed to the bottom. So if that's the case, we would want to make all of the Profile content scrollable but keep the button fixed, like this:
image

Can we conditionally show the save button?
I'm not sure if this was discussed elsewhere, but it doesn't make sense to show a Save button when nothing has changed in this view. If we always want to show a Save button, I would suggest that we make it appear disabled until a value changes, or not show it at all until a value changes.

@michelle-thompson
Copy link
Contributor

Yeah, I like the idea of disabling the button until changes are detected. Since we'll also eventually add in-line buttons with the same behavior, this would make things more consistent too!

@NikkiWines
Copy link
Contributor

Do we think the Save button should be fixed to the bottom of the profile view?

I do think we should fix it to the bottom and make the profile scrollable. This is helpful for users with smaller screens too.

Can we conditionally show the save button?

I don't really think we should do this. For the password page, it makes sense to have the Save button conditionally enabled because we disable the view if there's an invalid password based on discrete conditions (fields are empty, they don't match, they're not complex enough, etc.) For this page though, you can have empty fields and we don't really have any conditions that need to be matched (for now), so there's no reason you couldn't save your profile at any time.

Overall, I think it adds complexity for no real reason.

@NikkiWines
Copy link
Contributor

Since this issue is holding up a couple of other ones, maybe we could think about a conditionally enabled safe button as a v2? I'd like to get this one out asap if possible.

@Maftalion
Copy link
Contributor Author

Both variants seem fine, I think the main thing is being consistent across the app.
Here are my opinions though:

Do we think the Save button should be fixed to the bottom of the profile view?
Personally I like having the CTA always visible so the user knows what actions they can make without needing to look for it. The only drawback is on smaller devices if the form is cut-off perfectly then the user might not know there are other fields they can scroll down to.

Can we conditionally show the save button?
I tend to favor disabled buttons vs hidden buttons so a user knows that they can complete an action to "unlock" the button vs not knowing it even exists

PS. I've been replicating the button behavior on the change password screen (it's been merged recently) so if we change it here, we should probably update that screen as well.

@shawnborton
Copy link
Contributor

Cool, so sounds like fix the button to the bottom, and use a disabled button instead of show/hide. I like it!

nickmurray47
nickmurray47 previously approved these changes Mar 19, 2021
Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

LGTM rn, and it sounds like it'd be best for those additional UI updates to be in v2, right @NikkiWines?

@NikkiWines
Copy link
Contributor

I guess it depends on how quickly @Maftalion can make those changes. @Maftalion, is that something you think you can handle today? If not maybe we can make a follow-up issue to implement this.

@Maftalion
Copy link
Contributor Author

I can prob get to it later today, just a couple of questions.

  1. By fixed button, am I just reverting it back to how it was before or something different?
  2. For disabling the button, should it enable when the form is dirty or when the new values !== onyx values

@shawnborton
Copy link
Contributor

If you go to create a new group in Expensify.cash, you will see the behavior we want for the fixed button.

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Two minor comments -- looks great overall! 🚀

src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
src/pages/settings/ProfilePage.js Show resolved Hide resolved
NikkiWines
NikkiWines previously approved these changes Mar 20, 2021
Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Looks good!

@shawnborton
Copy link
Contributor

Looks good, and the scrolling works well.

One thing I noticed while testing this morning was that if I change the value in the pronoun menu, the Save button does not become enabled:

image

nickmurray47
nickmurray47 previously approved these changes Mar 22, 2021
Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

LGTM and tests well

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Added one minor comment, also you have conflicts.

src/pages/settings/ProfilePage.js Outdated Show resolved Hide resolved
Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Nice! 🎉 Going to merge since Nick approved previously :shipit:

@NikkiWines NikkiWines merged commit 196f61c into Expensify:master Mar 23, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[User Settings] Add new Settings/Profile view
5 participants