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

Categories UI/UX #26501

Merged
merged 57 commits into from
Sep 12, 2023
Merged

Conversation

rezkiy37
Copy link
Contributor

@rezkiy37 rezkiy37 commented Sep 1, 2023

Details

This is the third PR the issue. Goals for this PR:

  • Connect previously created categories simple UI and helpers.
  • Enable categories for manual and distance requests.
  • Send a selected category among other request details (the backend is not ready yet to test responses).

Fixed Issues

$ #24463
PROPOSAL: N/A

Tests

1. The "Category" button exists with a workspace with categories.

  1. Open a workspace chat where there are categories.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there is "Category" row.

2. The "Category" button does not exist with a regular (private) chat.

  1. Open a private chat.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there isn't "Category" row.

3. The category list <8 items.

  1. Open a workspace chat where there are categories.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there isn "Category" row.
  8. Click on the row.
  9. Verify that there is a list of categories.
  10. Verify that when less than 8 categories, you have a simple list without any sections, search bar.
  11. Click on any category.
  12. Verify that the app redirects you to the previous page and the "Category" row has the selected category.
  13. Click on the row.
  14. Verify that the list respects the same order of categories as it was.
  15. Verify that the selected category is highlighted and has a "done" icon.
  16. Click on the selected category.
  17. Verify that the app redirects you to the previous page and the "Category" row has no selected category anymore.

4. The category list >=8 items.

  1. Open a workspace chat where there are categories.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there isn "Category" row.
  8. Click on the row.
  9. Verify that there is a list of categories.
  10. Verify that when more than 8 categories, you have a search bar and an "All" section with all categories.
  11. Click on any category.
  12. Verify that the app redirects you to the previous page and the "Category" row has the selected category.
  13. Click on the row.
  14. Verify that at the very top of the list you have the selected category.
  15. Verify that the selected category is highlighted and has a "done" icon.
  16. Click on the selected category.
  17. Verify that the app redirects you to the previous page and the "Category" row has no selected category anymore.

5. The category list >=8 items and a "Recent" section.

  1. Open a workspace chat where there are categories.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there isn "Category" row.
  8. Click on the row.
  9. Select a few times different categories.
  10. Verify that once previous selected categories within a new "Recent" section.
  11. Verify that the section keeps max 5 categories.

6. The category list >=8 items and search.

  1. Open a workspace chat where there are categories.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there isn "Category" row.
  8. Click on the row.
  9. Verify that when more than 8 categories, you have a search bar and an "All" section with all categories.
  10. Click on "Search".
  11. Enter a valid name.
  12. Verify that search results are correct by your request.
  13. Verify that there is no sections like "All", just a simple list.
  14. Enter an invalid name.
  15. Verify that there is a caption: "No results found".

7. The category list with "Parent: Child" categories.

  1. Open a workspace chat where there are nested categories.
  2. Click on "+" (Actions) to the left of Composer.
  3. Click on "Request money".
  4. Enter any amount.
  5. Click on "Next".
  6. Click on "Show more".
  7. Verify that there isn "Category" row.
  8. Click on the row.
  9. Verify that each nested category has a corresponding indent.
  10. Verify that if a parent category is no enabled, you cannot select it, but still able to select a child one.
  • 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 / 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 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

Web
Chrome.Distance.mp4
Chrome.Manual.mp4
Safari.Manual.mp4
Mobile Web - Chrome
IOS.Chrome.mp4
Android.Chrome.mp4
Mobile Web - Safari
IOS.Safari.mp4
Desktop
Desktop.Distance.mp4
Desktop.Manual.mp4
iOS
IOS.mp4
Android
Android.mp4

@BeeMargarida
Copy link
Contributor

BeeMargarida commented Sep 12, 2023

@yuwenmemon Updated with your docs suggestions!

yuwenmemon
yuwenmemon previously approved these changes Sep 12, 2023
@rezkiy37 rezkiy37 dismissed yuwenmemon’s stale review September 12, 2023 16:54

The merge-base changed after approval.

@yuwenmemon
Copy link
Contributor

@rezkiy37 Did you want to merge main into this branch?

@rezkiy37
Copy link
Contributor Author

@rezkiy37 Did you want to merge main into this branch?

It is some automation from GH. I haven't touched the PR 😅

Screenshot 2023-09-12 at 18 59 52

@rezkiy37
Copy link
Contributor Author

Since we don't have any conflicts and all conversations are resolved, we can move forward.

yuwenmemon
yuwenmemon previously approved these changes Sep 12, 2023
@rezkiy37 rezkiy37 dismissed yuwenmemon’s stale review September 12, 2023 17:16

The merge-base changed after approval.

@rezkiy37
Copy link
Contributor Author

WHAT?

@yuwenmemon
Copy link
Contributor

Okay - Can you merge main into this branch so we can merge? 😄

@rezkiy37
Copy link
Contributor Author

Let's try now or I am deleting GH 🤣

@yuwenmemon yuwenmemon merged commit 83a448b into Expensify:main Sep 12, 2023
13 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/yuwenmemon in version: 1.3.69-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 1.3.69-2 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/yuwenmemon in version: 1.3.70-0 🚀

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

@rezkiy37 rezkiy37 mentioned this pull request Sep 15, 2023
59 tasks
@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.70-8 🚀

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

[policyCategories, policyRecentlyUsedCategories, searchValue, selectedOptions],
);

const headerMessage = OptionsListUtils.getHeaderMessage(lodashGet(sections, '[0].data.length', 0) > 0, false, searchValue);
Copy link
Member

Choose a reason for hiding this comment

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

Hi, OptionsListUtils validates if the searchValue is an email or phone.
We should have changed this behavior to only check if it matches any category.

issue: #28078

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rushatgabhane, is it fixed already or I can work on it?

Copy link
Member

Choose a reason for hiding this comment

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

it's fixed in the linked issue

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.

8 participants