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

Add Rest of UI for Workspace Chats #7957

Merged
merged 46 commits into from
Mar 11, 2022
Merged

Conversation

TomatoToaster
Copy link
Contributor

@TomatoToaster TomatoToaster commented Mar 1, 2022

@amyevans, please review when you get the chance,
CC: @marcaaron, @roryabraham

Details

Using correct subtitle for PolicyExpenseChats (a.k.a Worksapce Chats) and adding welcome text for PolicyExpenseChats as well.

Held on #7852

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/195472

Tests

Same as Web QA but done locally

  • Verify that no errors appear in the JS console

PR Review Checklist

Contributor (PR Author) Checklist

  • I made sure to pull main before submitting my PR for review
  • 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 clearly indicated the environment tests should be run in (Staging vs Production)
  • I wrote testing steps that cover success & fail scenarios (if applicable)
  • I ran the tests & they passed on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified there are no console errors related to changes in this PR
  • I followed proper code patterns (see Reviewing the code)
    • I added comments when the code was not self explanatory
    • I put all copy / text shown in the product in all src/languages/* files (if applicable)
    • I followed proper naming convention for platform-specific files (if applicable)
    • I followed style guidelines (in Styling.md) for all style edits I made
  • I followed the guidelines as stated in the Review Guidelines

PR Reviewer Checklist

  • I verified the Author pulled main before submitting the PR
  • 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 testing environment is mentioned in the test steps
  • I verified testing steps cover success & fail scenarios (if applicable)
  • I verified tests pass on all platforms & I tested again on all platforms
  • I checked that screenshots or videos are included for tests on all platforms
  • I verified there are no console errors related to changes in this PR
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified comments were added when the code was not self explanatory
    • I verified any copy / text shown in the product was added in all src/languages/* files (if applicable)
    • I verified proper naming convention for platform-specific files was followed (if applicable)
    • I verified style guidelines were followed
  • I verified that this PR follows the guidelines as stated in the Review Guidelines

QA Steps

Perform this QA on staging

  1. Log into an account that doesn't have a workspace yet.
  2. Create a workspace.
  3. Search for your workspace chat (it should have the same name as your workspace and it will have the same icon as the workspace)
  4. Verify that you see the correct subtitle like this:

image

  1. Check that the welcome text in the chat looks like this:

image

  1. Click on the header and verify you see the details page like this (also be sure to click on settings to make sure it works)
    image
    image

  2. Invite another user to this workspace and look for their workspace chat (It will have their name/email as the title). Verify the header looks like this:

image

  1. Verify that the welcome text looks like this:

image

  1. Click on the header and verify that the report details page looks like this (and click on settings to see that it works)
    image
    image
  • Verify that no errors appear in the JS console

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

@TomatoToaster TomatoToaster self-assigned this Mar 1, 2022
@TomatoToaster TomatoToaster requested a review from marcaaron March 8, 2022 16:33
@TomatoToaster
Copy link
Contributor Author

This is ready for review, but I'm going to try and test the dang mobile platforms today if I can get the emulator working.

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

Nice work here 🎉 Mostly NABs and small things.

@@ -26,24 +27,34 @@ const personalDetailsPropTypes = PropTypes.shape({
});

const propTypes = {
/** Whether it is a default Chat Room */
shouldIncludeParticipants: PropTypes.bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one, that comment didn't really match the prop name.

</Text>
<Text style={[styles.textStrong]}>
{/* Use the policyExpenseChat owner's first name or their email if it's undefined or an empty string */}
{lodashGet(props.personalDetails, [props.report.ownerEmail, 'firstName']) || props.report.ownerEmail}
Copy link
Contributor

Choose a reason for hiding this comment

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

Where's the empty string come from (mentioned in the comment)? Should we at least have the firstName or ownerEmail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes I mean to say that if the firstName isn't set we should fall back to ownerEmail. I should be saying "Use the policyExpenseChat owner's first name or fall back to their email if it's unavailable". Could be a bit of a self-explanatory comment though, do you think I should just delete it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel an overwhelming almost painful impulse to delete comments if they don't explain something the code doesn't explain itself. But meditation is helping a lot with that.

src/components/ReportWelcomeText.js Outdated Show resolved Hide resolved
src/components/ReportWelcomeText.js Outdated Show resolved Hide resolved
src/languages/en.js Show resolved Hide resolved
src/libs/actions/Report.js Show resolved Hide resolved
src/pages/ReportDetailsPage.js Outdated Show resolved Hide resolved
src/pages/ReportDetailsPage.js Outdated Show resolved Hide resolved
src/pages/ReportDetailsPage.js Outdated Show resolved Hide resolved
src/pages/ReportDetailsPage.js Outdated Show resolved Hide resolved
Copy link
Contributor

@amyevans amyevans left a comment

Choose a reason for hiding this comment

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

Lgtm, not much to add (although +1 to @marcaaron's comments on the translations)! But I'll defer approval to someone with more context / experience here! 😄

src/components/ReportWelcomeText.js Outdated Show resolved Hide resolved
src/components/ReportWelcomeText.js Outdated Show resolved Hide resolved
@TomatoToaster
Copy link
Contributor Author

@amyevans @marcaaron Thanks for reviewing! I addressed/commented on your suggestions, so please give this another look when you get the chance!

Copy link
Contributor

@amyevans amyevans left a comment

Choose a reason for hiding this comment

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

👍 lgtm, but I'll allow other reviewers to chime in as well

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

Looks solid. Nice job @TomatoToaster thanks for the changes.

</Text>
<Text style={[styles.textStrong]}>
{/* Use the policyExpenseChat owner's first name or their email if it's undefined or an empty string */}
{lodashGet(props.personalDetails, [props.report.ownerEmail, 'firstName']) || props.report.ownerEmail}
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel an overwhelming almost painful impulse to delete comments if they don't explain something the code doesn't explain itself. But meditation is helping a lot with that.

src/languages/en.js Show resolved Hide resolved
src/libs/actions/Report.js Show resolved Hide resolved
@amyevans amyevans merged commit 37083a3 into main Mar 11, 2022
@amyevans amyevans deleted the amal-workspace-chats-name-ui branch March 11, 2022 18:36
@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @amyevans in version: 1.1.43-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.43-2 🚀

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.

4 participants