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

Prevent workspace menu from dismissing when clicking on add work email #9046

Conversation

techievivek
Copy link
Contributor

@techievivek techievivek commented May 17, 2022

Details

While clicking on the add work email address option under the workspace menu in the new dot it dismisses the workspace menu and we do not want that to happen.

Please have a look at the issue it has a video showing the unexpected behaviour.

Fixed Issues

$ #9013

Tests

  1. To test this you first need to generate(generator:account) a new account using a public mail service provider like Gmail.
  2. Once you have created a verified account create a new workspace under this account by logging into new dot.
  3. Now to this workspace let's add a VBA(verified bank account) by following the instruction to add OPEN state bank account from this SO in New Dot (Profiles -> workspace -> issue cards -> add bank account).
  4. Once the VBA is added when we go to the same option to issue cards we can see an option to add work email address, clicking this will not dismiss the workspace menu like before.
  • Verify that no errors appear in the JS console

PR Review Checklist

Contributor (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 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 included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 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 was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team 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
  • 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 */
    • Any functional components have the displayName property
    • 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
  • 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 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.

PR Reviewer Checklist

  • 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 verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 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 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 was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • 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 */
    • Any functional components have the displayName property
    • 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 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 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.

QA Steps

  1. To test this make sure you have a verified account created using a public mail service provider like Gmail.
  2. Once you have created a verified account create a new workspace under this account by logging into the new dot.
  3. Now to this workspace let's add a VBA(verified bank account) by following the instruction to add an OPEN state bank account from this SO in New Dot (Profiles -> workspace -> issue cards -> add bank account).
  4. Once the VBA is added when we go to the same option to issue cards we can see an option to add work email address, clicking this will not dismiss the workspace menu like before.
  • Verify that no errors appear in the JS console

Screenshots

Web

web.mp4

Mobile Web

mweb.mp4

Desktop

desktop.mp4

iOS

ios.mp4

Android

android.mp4

@techievivek techievivek requested a review from a team as a code owner May 17, 2022 10:29
@techievivek techievivek changed the title Prevent workspace menu from dismissal when clicking on add work email Prevent workspace menu from dismissing when clicking on add work email May 17, 2022
@melvin-bot melvin-bot bot requested review from luacmartins and removed request for a team May 17, 2022 10:30
@techievivek techievivek self-assigned this May 17, 2022
@luacmartins
Copy link
Contributor

@techievivek is this still a work in progress?

@techievivek
Copy link
Contributor Author

@luacmartins No but I am not able to test this. But the fix is to only remove the part which dismisses the sidebar.

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

Leaving a few comments:

  1. We should fix the lint error by removing the unused Navigation import.
  2. I think we could easily test this on dev by following the steps below:
    • Create an account with a public domain (we can use ./scripts/clitools.sh generator:account for that)
    • Login and create a new workspace
    • Add a VBA following this SO
    • Navigate to Workspace > Issue cards
    • Kill connection and tap Add work email address
    • Verify that the modal is not dismissed
  3. Make sure that you go through the checklist and check off any applicable items on the list!

@techievivek techievivek added the InternalQA This pull request required internal QA label May 17, 2022
@techievivek
Copy link
Contributor Author

Updated the test section thanks for the help.

@luacmartins
Copy link
Contributor

Thanks for updating the test! Can we go through the rest of the checklist and add videos for all platforms?

@techievivek
Copy link
Contributor Author

Sure I will add them today. Thanks

@techievivek
Copy link
Contributor Author

@luacmartins I have added a few videos for different platforms and all seem to work fine.

@luacmartins
Copy link
Contributor

@techievivek The PR template has sections for each video. Would you mind moving the videos there so it's less confusing? Additionally, we should add videos for all platforms.

@techievivek
Copy link
Contributor Author

@luacmartins I have updated the video placement and have added videos for all platforms except(Mobile web) not sure how would I access localhost:8080 on my emulator. Any pointers on how to test this out? Thanks

@luacmartins
Copy link
Contributor

I think this SO might help

@techievivek
Copy link
Contributor Author

@luacmartins Thanks that worked like charm, just updated the video for mWeb as well.

@luacmartins
Copy link
Contributor

@techievivek Cool! thanks for the updated videos! A few more small comments:

  1. Please make sure to go through the PR checklist and check any applicable checkboxes.
  2. I noticed that while we have Test steps, we didn't add any QA steps. This is important because that's what Applause (our outsourced QA team), or an internal QAer will use to test the PR. The QA steps are steps that you can take in staging or production to test the PR (so that means no terminal commands, db access, etc). In this PR's case, I think the steps are the same (except for the account generator commands), but we should at least mention that under QA steps.
  3. I see that you added the InternalQA label, but I think that this can be tested by Applause. At least in the past, they were able to test this flow. So I think we should remove that.

Sorry about all the back and forth, but it seems like a good learning opportunity for how our QA process works 😄

@techievivek techievivek removed the InternalQA This pull request required internal QA label May 23, 2022
@techievivek
Copy link
Contributor Author

techievivek commented May 23, 2022

@luacmartins Not an issue Carlos, I appreciate the time and effort you are taking to guide me through this it would definitely help me be a better contributor and will make things easy for others involved as well. I have updated the PR and QA. I have some small queries related to QAs which I always struggle with

  1. So the QA team tests the changes only in staging and production?
  2. How do we determine if the particular PR is testable by the QA team? Do they have access to Internal SO? Like in this one I thought about how would they have access to SO and the credentials used to open VBA.
  3. Do they have access to script repo?
    Thanks for all the learnings so far. 🙌

@luacmartins
Copy link
Contributor

luacmartins commented May 23, 2022

So the QA team tests the changes only in staging and production?

Yes, the PR author and reviewer are responsible for testing the changes in dev.

How do we determine if the particular PR is testable by the QA team? Do they have access to Internal SO? Like in this one I thought about how would they have access to SO and the credentials used to open VBA.

I'd say that the default is external QA, unless you are certain it's not. If they cannot test it, they will always ping you and you can always change to internal and test it yourself. As for which ones are internal, I'd say that internal tools (Concierge, Expensiworks, etc), if we need to run manual queries, or very specific flows that they don't have access to. I'm not sure about this part, but I think that they have access to credentials through the testing steps in TestRail.

Do they have access to script repo?

They do not. So that's why in my previous comment I mentioned that the only difference in the Test vs QA steps would be the account generator script. The script just saves us time in dev, but they can be performed manually if needed, in this case, Applause will create an account manually.

Copy link
Contributor

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

LGTM and tests well! Thanks for the fix @techievivek!

@luacmartins luacmartins merged commit 4aadc67 into main May 23, 2022
@luacmartins luacmartins deleted the techievivek_donot_close_workspace_menu_on_click_add_work_email branch May 23, 2022 15:04
@melvin-bot melvin-bot bot added the Emergency label May 23, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 23, 2022

@luacmartins looks like this was merged without passing tests. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@luacmartins
Copy link
Contributor

luacmartins commented May 23, 2022

Tests were passing... Removing emergency label.

@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.

@techievivek
Copy link
Contributor Author

Thanks, @luacmartins for all the help and guidance, learnt a lot.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @luacmartins in version: 1.1.66-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.1.66-1 🚀

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.

3 participants