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

Shows a different message when approving/paying all hold expenses #42736

Conversation

bernhardoj
Copy link
Contributor

@bernhardoj bernhardoj commented May 29, 2024

Details

Currently, when we are trying to approve/pay a report that contains all hold expenses, the confirmation message isn't adjusted for all hold expenses. It still asks whether to approve what's on hold or all even though all are on hold. This PR updates the message accordingly.

Fixed Issues

$ #41613
PROPOSAL: #41613 (comment)

Tests

Same as QA Steps

  • Verify that no errors appear in the JS console

Offline tests

Same as QA Steps

QA Steps

Prerequisite: approval enabled

  1. As user A, submit 2 expenses to B's workspace
  2. As user A, hold one of the expenses
  3. As user B, open the policy expense report
  4. As User B, press approve button
  5. As user B, verify the confirmation modal message shows as Approve what's not on hold, or approve the entire report. (unchanged)
  6. As user A, hold all expenses
  7. As user B, press approve button
  8. As user B, verify the confirmation modal message shows as These expenses are on hold. Do you want to approve anyway?
  9. As user A, delete one of the expenses
  10. As user B, press approve button
  11. As user B, verify the confirmation modal message shows as This expense is on hold. Do you want to approve anyway?

Prerequisite: approval disabled

  1. Repeat steps 1-3 above
  2. As user B, press pay button
  3. As user B, verify the confirmation modal message shows as Pay what's not on hold, or pay the entire report.
  4. As user A, hold all expenses
  5. As user B, press pay button
  6. As user B, verify the confirmation modal message shows as These expenses are on hold. Do you want to pay anyway?
  7. As user A, delete one of the expenses
  8. As user B, press pay button
  9. As user B, verify the confirmation modal message shows as This expense is on hold. Do you want to pay anyway?
  • Verify that no errors appear in the JS console

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 either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • 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 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(theme.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 the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • 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.

Screenshots/Videos

Android: Native

approval enabled
image

image image

approval disabled
image

image image
Android: mWeb Chrome

approval enabled
image

image image

approval disabled
image

image image
iOS: Native

approval enabled
image

image image

approval disabled
image

image image
iOS: mWeb Safari

approval enabled
image

image image

approval disabled
image

image image
MacOS: Chrome / Safari

approval enabled
image

image image

approval disabled
image

image image
MacOS: Desktop

approval enabled
image

image image

approval disabled
image

image image

@bernhardoj bernhardoj requested a review from a team as a code owner May 29, 2024 05:25
@melvin-bot melvin-bot bot requested review from mananjadhav and removed request for a team May 29, 2024 05:25
Copy link

melvin-bot bot commented May 29, 2024

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

@bernhardoj
Copy link
Contributor Author

Here is how it looks with the new confirmation message for approval,
Screenshot 2024-05-29 at 13 15 41

But we still have a case for pay, here is how it currently looks,
Screenshot 2024-05-29 at 13 20 55

what should be the message for the pay case?

it's currently possible to hold all expenses again after approving it

@mananjadhav @laurenreidexpensify @jasperhuangg

@jasperhuangg
Copy link
Contributor

jasperhuangg commented May 30, 2024

@bernhardoj @mananjadhav I just updated the QA steps in the OP with accurate ones that have been checked, please use those to test the PR, thanks!

An important distinction is that these new test steps only ever create/deal with a single expense report.

@bernhardoj
Copy link
Contributor Author

@jasperhuangg I have a few questions:

  1. How to hold a one-expense report? I don't see an option to hold it. (the hold option is only available in the transaction thread)
image
  1. Does this mean the new message is only for one-expense report? If there are multiple expenses and all of them are on hold, will we use the old message?

@jasperhuangg jasperhuangg self-requested a review May 31, 2024 19:56
@jasperhuangg
Copy link
Contributor

@bernhardoj I updated the testing steps with the expected behavior, let me know if you have any trouble.

@bernhardoj
Copy link
Contributor Author

bernhardoj commented Jun 1, 2024

@jasperhuangg I think the test step is a little bit confusing because both users A and B are approving the report.

  1. As user B, approve the report
  2. As user A, add more expenses to the expense report, hold one and approve the rest.
  3. As user B, press the pay button

Also, we can't add more expense to an approved/submitted report.
image

But I got the idea to hold one expense report.

  1. Does this mean the new message is only for one-expense report? If there are multiple expenses and all of them are on hold, will we use the old message?

And do you know what we should do about this question?

I think it doesn't make sense to use the current message for a report that has all expenses on hold.
image

@jasperhuangg
Copy link
Contributor

@bernhardoj If the one-expense report is ready to paid, shouldn't the expenses on it be approved already (and not held)?

@bernhardoj
Copy link
Contributor Author

Yes, but I can hold an approved request. I don't know if that's expected though. No error from BE when I tested it last time. If that's not expected, we can update the test step to turn off the approval setting, so the next step will be pay and not approve.

@mananjadhav
Copy link
Collaborator

we can update the test step to turn off the approval setting, so the next step will be pay and not approve.

This seems good, but any specific reason why BE doesn't throw the error @jasperhuangg ?

@jasperhuangg
Copy link
Contributor

I think we should still be able to hold approved requests based on what I'm seeing. I think updating the testing step to do that should be fine. Thanks for investigating. @bernhardoj

@bernhardoj
Copy link
Contributor Author

Great! I think the last thing left is the case for more than 1 expense all on hold. I see that you previously answered it from the email, but looks like it's already been deleted.

image

@jasperhuangg Are we waiting for the team's confirmation for the wording/copy or is it an unintentional deletion?

@jasperhuangg
Copy link
Contributor

@bernhardoj Ah yes, I deleted it on purpose, I'm waiting for confirmation on what the correct wording should be, thanks.

@jasperhuangg
Copy link
Contributor

@bernhardoj Yeah, so we don't want any change to the existing modal copy in production when approving a report with a mix of held/unheld expenses.

We only want to update the copy for reports where all expenses are held.

@bernhardoj
Copy link
Contributor Author

@jasperhuangg Hmm, I think I'm a bit confused here 😅. If there is held and unheld expense, the copy won't change.

I think what we want to know is the copy for

  1. when there is only one expense and it's on hold and,
  2. there are multiple expenses and all of them are on hold.

Should it be:

  1. This expense is on hold. Do you want to approve anyway? (from the test step)
  2. All expenses on this report are on hold. Do you want to unhold them and approve? (from [HOLD for payment 2024-07-17] [$250] [Held requests] Incorrectly showing the held confirmation modal for one expense report #41613 (comment))

Or should we use copy 2 for both cases?

@jasperhuangg
Copy link
Contributor

Use copy 2 for both cases!

@bernhardoj
Copy link
Contributor Author

Great, I updated the test step to use back my test step since it's easier to test multiple expenses.

But I still need a copy for the pay case. From the previous test step you gave, the copy is
This expense is on hold. Do you want to pay anyway?

but we use this for approve
All expenses on this report are on hold. Do you want to unhold them and approve?.

should I just change approve to pay?

I will ask for a translation after this.

@jasperhuangg
Copy link
Contributor

@bernhardoj I think that's fine. Thanks for pushing this forward!

@mananjadhav
Copy link
Collaborator

@bernhardoj Can you resolve the conflicts? and did you post a message about the translation?

@bernhardoj
Copy link
Contributor Author

Conflicts solved. Asked for translation confirmation here

@mananjadhav
Copy link
Collaborator

@jasperhuangg Could you help with the translations here (thread)?

@jasperhuangg
Copy link
Contributor

@bernhardoj We realized the translations we've been talking about are incorrect.

Can you update the text to say:
This expense is on hold. Do you want to approve anyway?
This expense is on hold. Do you want to pay anyway?

In the case where there is just 1 expense on the report? In all other cases we should use the existing copy. Sorry for the confusion, and thank you for your patience.

@bernhardoj
Copy link
Contributor Author

bernhardoj commented Jun 13, 2024

Ah okay, so to confirm,

A single expense on hold: This expense is on hold. Do you want to approve anyway?
Some expenses are on hold, some expenses are non-hold: Approve what's not on hold, or approve the entire report. unchanged
Multiple expenses all are on hold: Approve what's not on hold, or approve the entire report. unchanged

I still think the multi expenses all on hold doesn't looks good though (which leads to the same 2nd question here 😅), but is the above correct?

If it's correct, then the last thing I need is the es translation.

@jasperhuangg
Copy link
Contributor

@bernhardoj Will ask for clarification–I'm honestly kinda confused now as to what we want 😓 Thanks for your patience

jasperhuangg
jasperhuangg previously approved these changes Jun 24, 2024
@mananjadhav
Copy link
Collaborator

@mananjadhav Ah okay yup we should have the plural Estos gastos están bloqueados for both translations, just got confirmation.

Yeah that's what @bernhardoj and I meant. Working on the checklist now.

@jasperhuangg
Copy link
Contributor

@mananjadhav Any updates on that checklist?

@mananjadhav
Copy link
Collaborator

@jasperhuangg Left with final testing. The rest of the items of the checklist are fine, so I'll finish it once the QA is done.

@trjExpensify
Copy link
Contributor

We good here?

@jasperhuangg
Copy link
Contributor

@trjExpensify Still waiting on @mananjadhav to post the updated checklist.

It looks like we ran into some conflicts too @bernhardoj, sorry that happened!

@mananjadhav
Copy link
Collaborator

Yeah I was able to test this on Web. I'll have the checklist ready by in a few hours/tomorrow.

@bernhardoj
Copy link
Contributor Author

Conflicts fixed

@jasperhuangg
Copy link
Contributor

@mananjadhav Can we please get that checklist soon 🙇 we're running into conflicts almost every day

@mananjadhav
Copy link
Collaborator

Yes 😞 I am just finishing one PR and getting to this next! Sorry for the delay.

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jul 1, 2024

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (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
    • 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 either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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
  • 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
    • 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(theme.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 the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • 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 reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Approval Flow

android-approve-name android-approve-all-hold android-single-hold-approve

Payment Flow

android-pay-single-hold android-pay-all-hold android-pay-hold-some
Android: mWeb Chrome

Approval Flow

mweb-chrome-approve-some mweb-chrome-approve-all-hold mweb-chrome-single-hold-approve

Payment Flow

mweb-chrome-pay-single-hold mweb-chrome-pay-all-hold mweb-chrome-hold-some
iOS: Native

Approval Flow

ios-approve-some ios-approve-all-hold ios-single-hold-approve

Payment Flow

ios-pay-single-hold ios-pay-all-hold ios-pay-hold-some-es
iOS: mWeb Safari

Approval Flow

mweb-safari-approve-some mweb-safari-approve-all-hold mweb-safari-single-hold-approve

Payment Flow

mweb-safari-pay-single-hold mweb-safari-pay-all-hold mweb-safari-pay-hold-some-es
MacOS: Chrome / Safari

Approval Flow

web-approve-some-es web-approve-some web-approve-all-hold web-approve-all-hold-es web-single-hold-approve-es web-single-hold-approve

Payment Flow

web-pay-single-hold-es web-pay-single-hold web-pay-all-hold web-pay-all-hold-es web-pay-hold-some web-pay-hold-some-es
MacOS: Desktop

Approval Flow

desktop-approve-some desktop-approve-all-hold desktop-single-hold-approve

Payment Flow

desktop-pay-single-hold desktop-pay-all-hold desktop-pay-hold-some

@melvin-bot melvin-bot bot requested a review from jasperhuangg July 1, 2024 23:43
@mananjadhav
Copy link
Collaborator

mananjadhav commented Jul 1, 2024

Just finished with the checklist, took a bit longer because had to test several test cases. @bernhardoj Can you resolve the conflicts please?

@bernhardoj
Copy link
Contributor Author

Conflicts fixed

Copy link
Contributor

@jasperhuangg jasperhuangg left a comment

Choose a reason for hiding this comment

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

Thank you guys for your patience and perseverance with this one!

@jasperhuangg jasperhuangg merged commit 12fe22f into Expensify:main Jul 3, 2024
14 checks passed
@OSBotify
Copy link
Contributor

OSBotify commented Jul 3, 2024

✋ 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 Jul 3, 2024

🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.0.4-0 🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Jul 4, 2024

🚀 Cherry-picked to staging by https://github.com/tgolen in version: 9.0.4-5 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-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.

5 participants