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

Fix bolded text for Existing Owners Error #4261

Merged
merged 2 commits into from
Jul 29, 2021

Conversation

jasperhuangg
Copy link
Contributor

@jasperhuangg jasperhuangg commented Jul 27, 2021

Details

This PR fixes the text in the error message to prevent any separators (e.g. , , , and, etc.) from being bolded. It also ensures we use the localization for the word and.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/169896#issuecomment-884327715

Tests

  1. Paste this code block here. This'll simulate the server returning with an existingOwners error:
    return new Promise(resolve => resolve({existingOwners: ['patrick@expensify.com', 'spongebob@expensify.com', 'sandy@expensify.com']})).then((response) => {
        const existingOwnersList = response.existingOwners.reduce((ownersStr, owner, i, ownersArr) => {
            let separator = ',\n';
            if (i === 0) {
                separator = '\n';
            } else if (i === ownersArr.length - 1) {
                separator = ' and\n';
            }
            return `${ownersStr}${separator}${owner}`;
        }, '');
        Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: false, error: CONST.BANK_ACCOUNT.ERROR.EXISTING_OWNERS, existingOwnersList});
    });
  2. Navigate to the add bank account flow for a workspace.
  3. Verify that you're unable to add the account since the bank account already has an existing owner, and verify that the error step displays (see screenshots).

QA

  1. Create a new workspace and click "Get Started".
  2. Add a bank account manually following the steps here.
  3. In a different account, follow steps 1 and 2.
  4. Verify that you're unable to add the account since the bank account already has an existing owner, and verify that the error step displays (see screenshots).

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen Shot 2021-07-27 at 3 45 11 PM

Mobile Web

Screen Shot 2021-07-27 at 3 45 25 PM

Desktop

Screen Shot 2021-07-27 at 3 47 18 PM

iOS

Screen Shot 2021-07-27 at 3 45 34 PM

Android

Screen Shot 2021-07-28 at 11 39 34 AM

cc @michelle-thompson

@jasperhuangg jasperhuangg self-assigned this Jul 27, 2021
@jasperhuangg jasperhuangg marked this pull request as ready for review July 27, 2021 22:48
@jasperhuangg jasperhuangg requested a review from a team as a code owner July 27, 2021 22:48
@MelvinBot MelvinBot requested review from tgolen and removed request for a team July 27, 2021 22:48
tgolen
tgolen previously approved these changes Jul 28, 2021
Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

Are you able to get it tested on Android?

@jasperhuangg
Copy link
Contributor Author

@tgolen My android emulator is being all wonky. I have an old android device lying around somewhere, lemme see if I can find it 🧐

@jasperhuangg
Copy link
Contributor Author

jasperhuangg commented Jul 28, 2021

Yup, can't get my physical device to work either :/ @tgolen Reaching out in #engineering-chat for help.

@tgolen Got it working and added a screenshot on Android, thanks!

@tgolen
Copy link
Contributor

tgolen commented Jul 28, 2021

Ah, cool. Thanks! Sorry it gave you such fits. I know the pain

@tgolen
Copy link
Contributor

tgolen commented Jul 28, 2021

I assume the removal of flex was intentional?

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

I'll must assume you meant to remove the flex and merge this. If we need to revert that change in another PR (like if it was a mistake), then that's OK.

@tgolen tgolen merged commit f6b41a3 into main Jul 29, 2021
@tgolen tgolen deleted the jasper-fixBoldTextExistingOwnersError branch July 29, 2021 14:29
@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 in version: 1.0.81-5🚀

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

@OSBotify
Copy link
Contributor

OSBotify commented Aug 6, 2021

🚀 Deployed to production in version: 1.0.82-7🚀

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