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

Match Report Header and LHN Avatars #22467

Merged
merged 18 commits into from
Aug 1, 2023
Merged

Conversation

grgia
Copy link
Contributor

@grgia grgia commented Jul 8, 2023

Details

As part of #20486, we want to ensure that the avatars match between report headers and LHN. This PR uses the logic from the LHN Options List to display the header avatars.

Fixed Issues

$ #22468
#20486
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

Step 1. Create one of each of the following reports:

  • IOU Report
  • IOU Request
  • Workspace Expense Report
  • Workspace Expense Request

Step 2.

  • Open each report and ensure that the avatar style in the header matches the style in the LHN

IOUs

  1. Start a DM between userA and userB.
  2. Click on the plus actions icon next to "write something.." in the compose message box and select "request money".
  3. Click on the expense request preview.
  4. In the expense report, confirm the subheader says From <userA full name>
    image

IOUs children (IOU Requests)

  1. Continuing from previous. Click on the specific expense in the expense report.
  2. Confirm you see the single expense request view. Confirm the subheader says From <parent IOU report name>
    The parent IOU report can be seen in the LHN. In the below screenshot the parent IOU report name is "Marc Glasser owes $20.00" and so the child has that as its subheader.
    image
  3. Click on the subheader and confirm you are navigated up one level to parent.
  4. Create another thread in the expense report, Or a few nested thread. Confirm all thread subheaders show From <parent IOU report name>.
    image

Expense Reports

  1. Create a workspace. As admin userA, invite userB to the workspace.
  2. You should see a workspace chat between the two like so (view for the admin is below, for a member it will look slightly different),
    image
  3. As userB, click on the plus actions button in the compose message and select "request money"
  4. Once requested have userA and userB click on the expense preview to view the expense report.
  5. Confirm userA, the admin sees the subheader, From <userB full name> in <workspace name>
    image
  6. Confirm userB, the member sees the subheader From <workspace name>
    image
  7. Click on the subheader and confirm you are navigated up one level to parent.

Expense Reports children (Expense Requests)

  1. Continuation from the previous section, click on a specific expense request.
  2. Confirm both admin and member sees From <Expense parent report name> in <workspace name>. The Expense parent report name can be seen in the LHN of the expense report.
  3. Create any number of threads or nested threads under the expense report and confirm the subheader for them all is From <Expense parent report name> in <workspace name>.
    image
  4. Click on the subheader and confirm you are always navigated up one level to parent.

For Example,
251966662-c5fbcaa7-e002-45d1-929a-58b6cc879275

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-07-11.at.11.32.48.AM.mov
Mobile Web - Chrome
Mobile Web - Safari
Screen.Recording.2023-07-11.at.11.26.57.AM.mov
Desktop image
iOS
Android
Screen.Recording.2023-07-11.at.11.31.43.AM.mov

@grgia grgia self-assigned this Jul 8, 2023
@grgia grgia marked this pull request as ready for review July 11, 2023 10:49
@grgia grgia requested a review from a team as a code owner July 11, 2023 10:49
@melvin-bot melvin-bot bot requested review from parasharrajat and removed request for a team July 11, 2023 10:49
@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@grgia grgia requested review from a team and removed request for parasharrajat July 11, 2023 10:50
@melvin-bot melvin-bot bot requested review from parasharrajat and removed request for a team July 11, 2023 10:50
@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@parasharrajat
Copy link
Member

I am confused with the number of components that have similiar kind of logic.

  1. HeaderView.
  2. HeaderWithbackButton.
  3. MoneyRequestHeader

I checked that mainly HeaderView is used for report headers. Why does the change was made to AvatarWithDisplayName?
Are there only a few types of reports where the header was wrong from the list in the test steps?

@parasharrajat
Copy link
Member

Can you please also clarify the changed features? for example, which report-related header is changed.

@parasharrajat
Copy link
Member

Bump

@grgia
Copy link
Contributor Author

grgia commented Jul 13, 2023

I am confused with the number of components that have similiar kind of logic.
HeaderView.
HeaderWithbackButton.
MoneyRequestHeader

I agree with you and thought the same while looking into this. We could refactor here, but I don't think it's a priority.

I checked that mainly HeaderView is used for report headers. Why does the change was made to AvatarWithDisplayName?
Are there only a few types of reports where the header was wrong from the list in the test steps?

AvatarWithDisplayName is only used in the headers, it was using incorrect logic and did not match the LHN.

@grgia
Copy link
Contributor Author

grgia commented Jul 13, 2023

Can you please also clarify the changed features? for example, which report-related header is changed.

image

as you can see in this photo, many of the multiple avatars/subscript avatar styles were incorrect and did not match

specifically expense reports, requests, and IOUs are affected

@grgia
Copy link
Contributor Author

grgia commented Jul 18, 2023

@parasharrajat bump on reviews

@parasharrajat
Copy link
Member

Apologies for the delay. testing now.

@parasharrajat
Copy link
Member

parasharrajat commented Jul 18, 2023

As you can see in this photo, many of the multiple avatars/subscript avatar styles were incorrect and did not match

@grgia It looks the same to me. I am asking about which type of reports were broken before which you changed. I am asking this as the code is very much involved around these types of reports so if I know which one you changed, I can run special tests on those ones and find bugs in the code instead of just checking if the avatar on the header matches LHN.

@grgia
Copy link
Contributor Author

grgia commented Jul 19, 2023

Expense Requests and Expense Reports (IOUs) @parasharrajat

@grgia
Copy link
Contributor Author

grgia commented Jul 19, 2023

@parasharrajat here's the example case that this PR fixes - #22562 (comment)

@JmillsExpensify
Copy link

Thanks @PauloGasparSv! Let us know how things go tomorrow. If this still isn't resolved for you, then let's get another reviewer in the mix.

@PauloGasparSv
Copy link
Contributor

The error is still happening here, I can't create Money Requests. Pretty sure it is unrelated to these changes though.

I think this is happening because the login (and therefore debtorEmail) is missing in personalDetailsList. I'll investigate this a little bit and then point newDot to staging if I can't figure out what's happening so we can merge this.

image image

@PauloGasparSv PauloGasparSv requested a review from a team August 1, 2023 14:49
@melvin-bot melvin-bot bot requested review from Gonals and removed request for a team August 1, 2023 14:49
@melvin-bot
Copy link

melvin-bot bot commented Aug 1, 2023

@parasharrajat @Gonals One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot requested a review from parasharrajat August 1, 2023 14:49
@PauloGasparSv
Copy link
Contributor

Sorry for the delay on this, I'm still stuck on that error.

I tried pointing newDot to staging but after the SigninUser request is successful nothing happens. Now the same is happening when I'm pointing locally.

Btw, I also managed to reproduce the error in staging by requesting money from 002@new.com specifically (I noticed it didn't have a login in personalDetailsList either).

@JmillsExpensify @grgia I've assigned puller bear here so another engineer can review while I figure this errors out.

@PauloGasparSv
Copy link
Contributor

PauloGasparSv commented Aug 1, 2023

Had to step out after I assigned another engineer but now I'm back.

Since this is blocking me from doing other stuff I'll give an update here if I fix my local environment and finish the review.


That error is known and was reported in https://github.com/Expensify/Expensify/issues/301703! Did some more testing and I think I can bypass the error now.
Sadly I'm rebuilding my VM because I thought that would help so I'll re-test this in a bit.

@JmillsExpensify
Copy link

@PauloGasparSv Can you review the code first? C+ has tested, so I think the review is more important right now.

Copy link
Contributor

@PauloGasparSv PauloGasparSv left a comment

Choose a reason for hiding this comment

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

@PauloGasparSv Can you review the code first? C+ has tested, so I think the review is more important right now.

Sure thing @JmillsExpensify! I already reviewed the changes so I'm approving this based on these evidences.

Please feel free to merge, still trying to test here.

@PauloGasparSv PauloGasparSv removed the request for review from Gonals August 1, 2023 21:11
@PauloGasparSv
Copy link
Contributor

I managed to test Web now that I'm aware of https://github.com/Expensify/Expensify/issues/301703 and how to bypass it.

Web test
web.mov

Merging this right now (won't test other platforms to focus on other issues)

@PauloGasparSv PauloGasparSv merged commit b54f2d6 into main Aug 1, 2023
11 checks passed
@PauloGasparSv PauloGasparSv deleted the georgia-matchLHNHeaderAvatars branch August 1, 2023 21:14
@OSBotify
Copy link
Contributor

OSBotify commented Aug 1, 2023

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Aug 2, 2023

🚀 Deployed to staging by https://github.com/PauloGasparSv in version: 1.3.49-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@JmillsExpensify
Copy link

Thanks!

@OSBotify
Copy link
Contributor

OSBotify commented Aug 3, 2023

🚀 Deployed to staging by https://github.com/PauloGasparSv in version: 1.3.50-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Aug 3, 2023

🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.49-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Aug 7, 2023

🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.50-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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.

5 participants