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

Workspaces list #11784

Merged
merged 55 commits into from
Oct 27, 2022
Merged

Workspaces list #11784

merged 55 commits into from
Oct 27, 2022

Conversation

chiragsalian
Copy link
Contributor

@chiragsalian chiragsalian commented Oct 13, 2022

Details

Fixed Issues

$ #9971

Tests / QA Steps

  1. Create a new account. Login, click on profile icon to view settings.
  2. Confirm you see a new "Workspaces" option above "Profile".
  3. Click into it and confirm you see "Create a new workspace" message with text explaining about a workspace below it. Confirm you see a button for "New Workspace" at the bottom.
  4. Click on the New Workspace button. Confirm a workspace is created successfully.
  5. Click back to go to the Settings and confirm you see 1 workspace avatars next to Workspaces.
  6. Repeat steps 4 and 5, until you have 4 workspaces and confirm you see 4 avatars.
  7. Repeat steps 4 and 5 again for a 5th workspace, this time confirm you see 4 avatars but the 4rth one is opague with +1 over it.
  8. Add workspace profile icons for the 1st, 3rd and 4rth workspaces. Go to settings and confirm their avatars show up with the proper icons uploaded. (the 4th one has opacity so you might have to zoom in to see clearer)
  9. Click on workspaces -> select a workspace -> manage members -> set network throttling to offline in chrome dev tools -> invite user +25857527444 (this is an incorrect user and should throw error). Close settings.
  10. Turn network throttling to online. Confirm you see error red dot on profile icon, click it.
  11. Confirm you see error red dot next to the avatars and the UI still looks good.
  • Verify that no errors appear in the JS console

PR Review Checklist

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 */
    • 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

PR Reviewer Checklist

The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed

  • 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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 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 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

Screen.Recording.2022-10-20.at.3.49.58.PM.mov

Mobile Web - Chrome

image

image

image

image

Mobile Web - Safari

image

image

image

image

Desktop

image

image

image

image

iOS

image

image

image

image

Android

image

image

image

image

@chiragsalian chiragsalian self-assigned this Oct 13, 2022
@sobitneupane
Copy link
Contributor

sobitneupane commented Oct 25, 2022

#11784 (review) : I think We should create follow up issue.
#11784 (review) : I cannot reproduce this issue any longer.
#11784 (review) : No any avatar shown for deleted workspace. But we can find the deleted workspace in Workspaces list. I am not sure if it is an issue.

Screen.Recording.2022-10-25.at.18.39.25.mov

#11784 (review) : I cannot constantly reproduce it. But I can still reproduce this issue once in 3-4 attempts. This time at first I see blank page without "Create a new workspace" message. After refreshing the page, I can still see the deleted workspace.

Screen.Recording.2022-10-25.at.18.56.48.mov

#11784 (review) : I can still reproduce this issue. I followed the reproduction steps two times. On the second attempt, I was able to reproduce.

Screen.Recording.2022-10-25.at.19.05.26.mov

Above two issues (4th and 5th) gets resolved after I sign out and sign in again. These issues might not be related to this PR. They might be related to existing delete functionality. I believe it has something to do with Onyx data in delete functionality.

@chiragsalian
Copy link
Contributor Author

#11784 (review) - I agree. I created a follow-up here. I'll add the necessary labels and mark external once this code is merged.

#11784 (review) - That's not an issue. In offline mode we should show the deleted workspace with a strikethrough. Unless you are online, hard to tell from your video. When online the deleted workspace should vanish.

#11784 (review) - I tried the test 6 times in a row and could not reproduce. Also that issue does not look related to this PR. You should check the network request for that one because it looked like the deleted command failed. Because on refresh if you see the deleted workspace that means it was never deleted in the backend. So it doesn't look related to this PR.

#11784 (review) - Also worked fine for me and i also feel this is the similar problem as previous where your network request is not really deleting the workspace which is why it shows up on reconnect. Not related to this PR since i don't change the behavior of those.

Maybe try again by deleting node_modules and running npm i. Maybe some files are older or out of sync hence causing these problems? Either way, since i feel those are not related to this PR can we move ahead with reviewing or approving this PR. If those problems persist we can open follow-ups for them 🙂

Copy link
Contributor

@sobitneupane sobitneupane left a comment

Choose a reason for hiding this comment

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

@chiragsalian QA steps are not added.

I verified the steps for Staging and/or Production testing are in the QA steps section

Changes look good and test well on all platforms.
🎀👀🎀 C+ reviewed

cc: @roryabraham @cristipaval

  • 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:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • 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 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 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 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots

Web

Screen.Recording.2022-10-26.at.08.52.50.mov

Mobile Web - Chrome

Screen.Recording.2022-10-26.at.08.47.21.mov

Mobile Web - Safari

Screen.Recording.2022-10-26.at.08.38.19.mov

Desktop

Screen.Recording.2022-10-26.at.08.48.55.mov

iOS

Screen.Recording.2022-10-26.at.08.36.43.mov

Android

Screen.Recording.2022-10-26.at.08.39.52.mov

@chiragsalian
Copy link
Contributor Author

chiragsalian commented Oct 26, 2022

QA steps are not added.

Oh hah, classic. Thanks Rory for updating the section to say Tests / QA steps.

btw @sobitneupane, for some of the issues you mentioned where deleted workspaces are showing back up - some other engineers reported similar issues and we're discussing it here #12109 and should have a fix for it soon. I hope it would solve the problem.

@chiragsalian
Copy link
Contributor Author

I bumped @cristipaval on newDot to review this.

Copy link
Contributor

@cristipaval cristipaval left a comment

Choose a reason for hiding this comment

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

After deleting all workspaces, the placeholder in Workspaces is hidden.
Please see this recording. It occurs on desktop

Screen.Recording.2022-10-27.at.22.24.08.mov

@chiragsalian
Copy link
Contributor Author

Works fine for me on desktop,

Screen.Recording.2022-10-27.at.12.44.52.PM.mov

Copy link
Contributor

@cristipaval cristipaval left a comment

Choose a reason for hiding this comment

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

After deleting node_modules and running npm i again, it works well!

@cristipaval cristipaval merged commit 92c1752 into main Oct 27, 2022
@cristipaval cristipaval deleted the chirag-workspaces-list branch October 27, 2022 20:00
@melvin-bot melvin-bot bot added the Emergency label Oct 27, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2022

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

@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 @cristipaval in version: 1.2.21-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Julesssss in version: 1.2.21-4 🚀

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

@arosiclair
Copy link
Contributor

Hey the scenario for viewing a deleted/invalid workspace and backing out of it was missed when implementing this new page and caused #13276. Since this is a new page between the initial settings page and the workspace page, we should've updated the "not found" blocking view to just return you to the new list page instead of dismissing the modal entirely.

@NikkiWines
Copy link
Contributor

👋 This PR didn't optimistically filter out policies that were pending deletion resulting in #13615. Since we want to optimistically assume success here, we should have removed the policies up front and added them back in the request failed.

@francoisl
Copy link
Contributor

👋 This PR caused an issue when the app was configured in Spanish, because the empty Workspaces page didn't have correct horizontal padding. Not sure what could have been differently since the test steps don't say to test with the app in Spanish, but started a discussion here if anyone thinks we could have done something different to prevent the issue.

@eVoloshchak
Copy link
Contributor

👋 This PR was sorting workspaces alphabetically while not ignoring the case, which caused #16925 and resolved by using
.sortBy(policy => policy.title.toLowerCase())
Not a regression, just something that was missed during the initial implementation

{Boolean(props.brickRoadIndicator) && (
<View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>
<View style={[styles.alignItemsCenter, styles.justifyContentCenter, styles.l4]}>
Copy link
Contributor

Choose a reason for hiding this comment

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

We had a small inconsistent padding issue caused by this change.

Issue: #18418
Issue Tittle: Workspaces icons and green dot has inconsistent padding

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.

10 participants