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

Fix bug to show the secondary avatar when the repost is is a policy expense chat #30068

Merged
merged 7 commits into from
Oct 25, 2023

Conversation

wlegolas
Copy link
Contributor

@wlegolas wlegolas commented Oct 20, 2023

Details

When I user requests money and splits it into a workspace, in workspace chat the split bill avatar displays the default profile sub avatar and on hovering on it, it displays the same user tooltip.

Fixed Issues

$ #29614
PROPOSAL: #29614 (comment)

Tests

  1. Open the app and login with user A
  2. Open the app on another device and login with user B
  3. From user A, invite user B to any workspace
  4. From user B, click on green plus and click on request money
  5. Enter any amount and continue
  6. Press the "Split" button beside the workspace name, press "Add to split" and confirm the split summary
  7. From user A, open workspace chat was created after inviting user B to a workspace
  • From user A, in workspace chat, observe the secondary (small) avatar, ensure that the initial letter is from the workspace name, and when hovering, ensure that the tooltip shows the workspace name.

Offline tests

  1. Open the app and login with user A
  2. Open the app on another device and login with user B
  3. From user A, invite user B to any workspace
  4. From user B, click on green plus and click on request money
  5. Enter any amount and continue
  6. Press the "Split" button beside the workspace name, press "Add to split" and confirm the split summary
  7. From user A, open workspace chat was created after inviting user B to a workspace
  8. Switch to offline mode
  • From user A, in workspace chat, observe the secondary (small) avatar, ensure that the initial letter is from the workspace name, and when hovering, ensure that the tooltip shows the workspace name.

QA Steps

  1. Open the app and login with user A
  2. Open the app on another device and login with user B
  3. From user A, invite user B to any workspace
  4. From user B, click on green plus and click on request money
  5. Enter any amount and continue
  6. Press the "Split" button beside the workspace name, press "Add to split" and confirm the split summary
  7. From user A, open workspace chat was created after inviting user B to a workspace
  • From user A, in workspace chat, observe the secondary (small) avatar, ensure that the initial letter is from the workspace name, and when hovering, ensure that the tooltip shows the workspace name.

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: mWeb Chrome
    • iOS: Native
    • iOS: mWeb 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 the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • 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

Android: Native
bug-evidence-issue-29614-Android-native.mov
Android: mWeb Chrome
bug-evidence-issue-29614-android-mWeb-Chrome.mp4
iOS: Native
bug-evidence-issue-29614-iOS-native.mov
iOS: mWeb Safari
bug-evidence-issue-29614-iOS-mWeb-Safari.mov
MacOS: Chrome / Safari
bug-evidence-issue-29614.mp4

Added tests to validate this issue
image

MacOS: Desktop
bug-evidence-issue-29614-desktop-app.mov

@wlegolas wlegolas requested a review from a team as a code owner October 20, 2023 10:52
@melvin-bot melvin-bot bot removed the request for review from a team October 20, 2023 10:52
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

@cubuspl42 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]

@melvin-bot melvin-bot bot requested a review from cubuspl42 October 20, 2023 10:52
@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@wlegolas
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@cubuspl42
Copy link
Contributor

@wlegolas Ping me when you finish the checklist

@wlegolas
Copy link
Contributor Author

@wlegolas Ping me when you finish the checklist

Sure @cubuspl42, I'm trying to run the mobile app but I've been having problems running the IOS and Android apps.

Do you know how I can have access to Stackoverflow for example this URL here https://stackoverflow.com/c/expensify/questions/13283/13284#13284?

@cubuspl42
Copy link
Contributor

@wlegolas Typically, external contributors don't access Expensify's StackOverflow Teams. If you're having technical issues, you can start a thread on Slack. You can mention me in that thread.

@wlegolas
Copy link
Contributor Author

@wlegolas Typically, external contributors don't access Expensify's StackOverflow Teams. If you're having technical issues, you can start a thread on Slack. You can mention me in that thread.

Hi @cubuspl42 I requested access to Slack, when I get the access I'll start a thread.

Thank you

Just another question, about doing a test with a “high traffic” account, I requested to change my account and did the same steps to validate my fix, and worked.

Is there a specific test scenario that I have to do with the high traffic?

@cubuspl42
Copy link
Contributor

@wlegolas Don't bother too much with the high-traffic tests here. There are some issues where this is important, but it nearly certainly won't affect us here.

The last checkbox of the checklist is quite tricky...

I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Sometimes, the checkboxes don't apply to a given PR. It's always better to be biased toward the interpretation that they do, but if it's clear that they don't, well, then they don't.

Let's focus on testing all the supported platforms (with videos).

@wlegolas
Copy link
Contributor Author

@wlegolas Don't bother too much with the high-traffic tests here. There are some issues where this is important, but it nearly certainly won't affect us here.

The last checkbox of the checklist is quite tricky...

I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Sometimes, the checkboxes don't apply to a given PR. It's always better to be biased toward the interpretation that they do, but if it's clear that they don't, well, then they don't.

Let's focus on testing all the supported platforms (with videos).

Hi @cubuspl42 thank you for clarifying and for all context.

I've been having problems running the app on Android, in the README there is the step below, but this link is related to Expensify's StackOverflow Teams.

  • Go through the instructions on this SO post to start running the app on android.

I requested access to Slack but I haven't received my invite yet. I'm waiting for this access to finish this last test.

If you have any information that helps me with this, I'll be happy to know.

@cubuspl42
Copy link
Contributor

@wlegolas

Have you tried running npm run android?

After you do, go for a walk or pick up some other work, as it takes an eternity (especially if you don't own high-end hardware).

@wlegolas
Copy link
Contributor Author

@wlegolas

Have you tried running npm run android?

After you do, go for a walk or pick up some other work, as it takes an eternity (especially if you don't own high-end hardware).

@cubuspl42,

I ran npm run android and the emulator was not displaying anything, I installed again the dependencies, and now looks like the process is running.

I'll follow your suggestion to go for a walk because this process is taking a while.

Thank you.

@wlegolas
Copy link
Contributor Author

wlegolas commented Oct 23, 2023

@cubuspl42.

I finished the tests on all devices and updated the PR with the videos, and I finished my checklist, thank you for your help on it.

One question, when I tried to run the application for IOS, I needed to configure my environment, I followed the section "Running the iOS app 📱" in the README file, but to solve the problem with file permission I used this article How to solve FilePermissionError after installing rbenv on Mac.

Could I update the README file by adding this article? If you disagree, don't worry, I'm just sharing this because it helped me a lot to solve my problem.

@cubuspl42
Copy link
Contributor

About updating README, you can share your experience on Slack when you have access and see what others think.

@wlegolas
Copy link
Contributor Author

About updating README, you can share your experience on Slack when you have access and see what others think.

@cubuspl42

Makes more sense.

I'm done, if you have any questions or suggestions, please let me know.

Thank you for your support.

@cubuspl42
Copy link
Contributor

You should make clear what's the expected behavior in the testing steps. You can check how testing steps look in other PRs, this is my PR I had at hand.

@wlegolas
Copy link
Contributor Author

Thank you for your feedback @cubuspl42.

I thought that the last step was the expected behavior that we wanted, so I changed it to have the expected behavior as a checkbox item.

@cubuspl42
Copy link
Contributor

From user A, in workspace chat, observe the split bill avatar, it displays the initial letter from the workspace name, and when hovering, it displays the tooltip with the workspace name

We have a primary (large) and secondary (small) avatar, we should make clear which is which. I think that "split bill avatar" is a ambiguous

@cubuspl42
Copy link
Contributor

Click on the split button beside workspace report used in step 3 and complete further process

-> Press the "Split" button beside the workspace name, press "Add to split" and confirm the split summary

@wlegolas
Copy link
Contributor Author

From user A, in workspace chat, observe the split bill avatar, it displays the initial letter from the workspace name, and when hovering, it displays the tooltip with the workspace name

We have a primary (large) and secondary (small) avatar, we should make clear which is which. I think that "split bill avatar" is a ambiguous

@cubuspl42

I changed it to be more clear using your suggestion, would you validate if is more clear to you, please?

@cubuspl42
Copy link
Contributor

It's better

it displays

You're saying what "does" happen, while we should phrase it as "Ensure that..."

@melvin-bot melvin-bot bot requested a review from techievivek October 24, 2023 10:32
NETWORK: 'network',
};

describe('ReportActionItemSingle', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@techievivek I approved this, but I'd like to double-check if you think the added tests are well-formed and fit well into Expensify conventions. This is the first big unit test I've received as a C+.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it looks good to me —great job @wlegolas, for adding the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @techievivek thank you.

@wlegolas
Copy link
Contributor Author

@cubuspl42 thank you so much for all your suggestions.

@cubuspl42
Copy link
Contributor

@cubuspl42 thank you so much for all your suggestions.

This is my job 🙃

@wlegolas
Copy link
Contributor Author

@cubuspl42

The step "CLA Assistant / CLA (pull_request_target)" failed but I've done the process to agree with the CLA.

Should I need to do something else?

@wlegolas wlegolas force-pushed the bugfix/issue-29614 branch 9 times, most recently from 9a90825 to b1a5399 Compare October 25, 2023 13:55
…ort is a policy expense chat

Signed-off-by: Weslley Alves <[email protected]>
Signed-off-by: Weslley Alves <[email protected]>
Signed-off-by: Weslley Alves <[email protected]>
…account from the parameters

Signed-off-by: Weslley Alves <[email protected]>
Signed-off-by: Weslley Alves <[email protected]>
@wlegolas
Copy link
Contributor Author

wlegolas commented Oct 25, 2023

@wlegolas There seems to be some prettier diff for your code. Can you run the command npm run prettier and commit the changes? Also, you will need to sign your commits https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#begin-coding-your-solution-in-a-pull-request

@techievivek I fixed the Prettier issues, you can see the changes in the commit df0bc8861

Also, I had configured my .gitconfig to use the GPG keys, but I put in the "signingkey" a wrong key, now I fixed.

Thank you for informing this @techievivek

@wlegolas
Copy link
Contributor Author

Hi @cubuspl42 and @techievivek I finished all suggestions and settings. Looks like now the only required step is the PR approval.

Is this PR ok for you to give me approval?

Copy link
Contributor

@techievivek techievivek 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, thanks for the changes and tests. 🙇

@techievivek
Copy link
Contributor

Going to merge it since @cubuspl42 already approved it earlier.

@techievivek techievivek merged commit 2e36e8c into Expensify:main Oct 25, 2023
@OSBotify
Copy link
Contributor

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

@wlegolas wlegolas deleted the bugfix/issue-29614 branch October 25, 2023 15:41
@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.91-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.91-8 🚀

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.

4 participants