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

[Report Next Steps Audit] Simplify the App optimistic next steps #45160

Merged

Conversation

rayane-djouah
Copy link
Contributor

@rayane-djouah rayane-djouah commented Jul 10, 2024

Details

Uses a new simplified next steps format (new copy and replaced "Next Step" and "Finished!" labels with icons). Please refer to the Update Report Next Steps design doc.

Fixed Issues

$ #44784

Tests

Note: Since we test how optimistic data works, I recommend to enable slow Internet or offline mode.

Pre requirements:

  1. Create/have 2 users at least. One of them is a member of workspaces. The 2nd one is an admin.
  2. Create/have 2 Collect workspaces.
  3. Use OD to manipulate with the workspaces.

1. Generates an optimistic nextStep once a report has been OPENED

1. Self review
  1. The admin: sets "Scheduled Submit" enabled via OD in the "Reports" section.
  2. The member: opens a workspace chat.
  3. The member: requests money.
  4. The member: Verify that there is a next step with a comment: "Waiting for [userSubmitter] to add expenses." and there is an hourglass accompanying icon.
2. Scheduled submit enabled
  1. The admin: sets "Scheduled Submit" enabled via OD in the "Reports" section.
  2. The admin: selects each value one by one. Here the corresponding next steps comments:
    Format: Waiting for [userSubmitter]'s expense(s) to automatically submit on [scheduleSubmitSetting]
  • Daily: "Waiting for [userSubmitter]'s expense(s) to automatically submit later today";
  • Weekly: "Waiting for [userSubmitter]'s expense(s) to automatically submit on Sunday";
  • Twice a month: "Waiting for [userSubmitter]'s expense(s) to automatically submit on the 1st and 16th of each month";
  • Monthly: "Waiting for [userSubmitter]'s expense(s) to automatically submit on the [Selected report submission date] of each month";
  • Trip: "Waiting for [userSubmitter]'s expense(s) to automatically submit at the end of their trip";
  1. The member: requests money.
  2. The member: Verify that there is a next step with a corresponding comment mentioned above and an hourglass accompanying icon.

2. Generates an optimistic nextStep once a report has been SUBMITTED

Format: Waiting for [userApprover] to approve expense(s)

1. Self review
  1. The admin: Do steps: 1.2.
  2. The admin: clicks on "Submit" button.
  3. The admin: Verify that there is a next step with a comment: "Waiting for [userApprover] to approve expense(s)" and an hourglass accompanying icon.
2. Another reviewer
  1. Do steps: 1.1.
  2. The member: clicks on a "Submit" button.
  3. The member: Verify that there is a next step with a comment: "Waiting for [userApprover] to approve expense(s)" and an hourglass accompanying icon.
Screenshot 2024-07-12 at 11 40 17 AM
3. Another owner
  1. Do steps: 1.1.
  2. The admin: clicks on a "Submit" button.
  3. The admin: Verify that there is a next step with a comment: "Waiting for [userApprover] to approve expense(s)" and an hourglass accompanying icon. When you are a manager the verb should still be approve and not replaced with review.

3. Generates an optimistic nextStep once a report has been APPROVED

1. Self review
  1. Do steps: 1.2 and 2.1.
  2. The admin: clicks on an "Approve" button.
  3. The admin: Verify that there is a next step with a comment: "Waiting for [userApprover] to approve expense(s)" and an hourglass accompanying icon.
  4. The admin: clicks on an "Approve" button.
  5. The admin: Verify that there is a next step with a comment: "Waiting for [userAdmin] to pay expense(s)" and an hourglass accompanying icon.
Screenshot 2024-07-12 at 11 42 21 AM
2. Another owner
  1. Do steps: 1.1 and 2.3.
  2. The admin: clicks on an "Approve" button.
  3. The admin: Verify that there is a next step with a comment: "Finished! No further action required." and an Checkmark accompanying icon.
Screenshot 2024-07-12 at 11 42 29 AM

4. Generates an optimistic nextStep once a report has been PAID

1. Paid with wallet
  1. Do steps: 1.1 and 2.3, 3.1 or 3.2.
  2. The admin: clicks on a "Pay elsewhere" button.
  3. The admin: Verify that there is a next step with a comment: "Finished! No further action required." and an Checkmark accompanying icon.
2. Paid outside of Expensify
  1. Do steps: 1.1 and 2.3, 3.1 or 3.2.
  2. The admin: clicks on a "Pay with Expensify" button.
  3. The admin: Verify that there is a next step with a comment: "Finished! No further action required." and an Checkmark accompanying icon.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests.

QA Steps

Same as Tests.

  • 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
Screen.Recording.2024-07-15.at.11.40.06.AM.mov
Android: mWeb Chrome
Screen.Recording.2024-07-15.at.11.36.46.AM.mov
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-15.at.11.35.35.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-15.at.11.35.35.mp4
MacOS: Chrome / Safari
Screen.Recording.2024-07-12.at.10.54.37.AM.mov
Screen.Recording.2024-07-12.at.10.55.35.AM.mov
Screen.Recording.2024-07-12.at.10.56.21.AM.mov
Screen.Recording.2024-07-12.at.10.57.16.AM.mov
Untitled.mov
Screen.Recording.2024-07-12.at.11.41.42.AM.mov
MacOS: Desktop
Screen.Recording.2024-07-15.at.11.38.01.AM.mov

src/libs/NextStepUtils.ts Outdated Show resolved Hide resolved
@rayane-djouah rayane-djouah changed the title [Report Next Steps Audit] Simplify the App optimistic next steps [Report Next Steps Audit] [Hold for backend changes] Simplify the App optimistic next steps Jul 15, 2024
@rayane-djouah rayane-djouah changed the title [Report Next Steps Audit] [Hold for backend changes] Simplify the App optimistic next steps [Hold for backend changes] [Report Next Steps Audit] Simplify the App optimistic next steps Jul 15, 2024
@rayane-djouah rayane-djouah marked this pull request as ready for review July 15, 2024 10:43
@rayane-djouah rayane-djouah requested a review from a team as a code owner July 15, 2024 10:43
@melvin-bot melvin-bot bot removed the request for review from a team July 15, 2024 10:44
Copy link

melvin-bot bot commented Jul 15, 2024

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

@mountiny
Copy link
Contributor

I believe I have answered the remaining questions @rayane-djouah @eVoloshchak

@rayane-djouah
Copy link
Contributor Author

Updated

@mountiny mountiny changed the title [Hold for backend changes] [Report Next Steps Audit] Simplify the App optimistic next steps [Report Next Steps Audit] Simplify the App optimistic next steps Jul 19, 2024
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Looking great! @eVoloshchak can you please give this a final look again? thanks!

tests/unit/NextStepUtilsTest.ts Show resolved Hide resolved
tests/unit/NextStepUtilsTest.ts Show resolved Hide resolved
tests/unit/NextStepUtilsTest.ts Show resolved Hide resolved
tests/unit/NextStepUtilsTest.ts Outdated Show resolved Hide resolved
tests/unit/NextStepUtilsTest.ts Outdated Show resolved Hide resolved
tests/unit/NextStepUtilsTest.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@eVoloshchak eVoloshchak left a comment

Choose a reason for hiding this comment

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

LGTM!

@melvin-bot melvin-bot bot requested a review from mountiny July 22, 2024 07:43
@rayane-djouah
Copy link
Contributor Author

@mountiny all yours!

mountiny
mountiny previously approved these changes Jul 22, 2024
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

LGTM

tests/unit/NextStepUtilsTest.ts Outdated Show resolved Hide resolved
Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com>
@dangrous
Copy link
Contributor

Some questions on these, based on what I've been doing on the backend. Probably more for @mountiny than for @rayane-djouah:

  • I've been removing all "strong" text with the only exceptions being emails/names and 's after an email. No verbs (approve/submit/etc.) are strong anymore, and I don't think (though I'm not sure) the harvesting suffix is strong anymore either. Is it okay that these don't match or should we update?
  • I also see we're removing a lot of the titles here, I haven't been doing that on the backend. Should I?

Otherwise it's looking good!

@mountiny
Copy link
Contributor

Is it okay that these don't match or should we update?

Lets update them, but we can do it in a follow up

titles

In newdot, we are not going to be showing them anymore, and we will use the icons instead. But we still need it for oldDot so we need to keep it in backend
image

So I think we can merge this one

Copy link
Contributor

@dangrous dangrous left a comment

Choose a reason for hiding this comment

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

I think this works for me! We may find some mismatches between the optimistic front and what gets sent from the backend once this is all complete but this should be 99% of the way there if not fully.

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Nice yeah I agree we can clean those up later, thank you very much everyone!

@mountiny mountiny merged commit d1fe4a4 into Expensify:main Jul 22, 2024
16 checks passed
@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.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.11-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by https://github.com/francoisl in version: 9.0.11-2 🚀

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/francoisl in version: 9.0.11-5 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.0.12-0 🚀

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.

6 participants