Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.54k stars 2.89k forks source link

[$500] Bank Account - No character limit on Legal Business name #31874

Closed lanitochka17 closed 11 months ago

lanitochka17 commented 11 months ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.3-6 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

  1. Go to settings > Workspace > choose a works space
  2. Bank account > Connect Manually
  3. Fill the details of step one and go to step 2
  4. Go to Legal Business name and type a long long name. Notice that the field allows you to enter any amount of characters. No End

Expected Result:

There is a character limit for legal business names

Actual Result:

No character limit

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/b4f68c6b-24db-49eb-80d1-53a23d45469b

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015ab3357e3b21f462
  • Upwork Job ID: 1728574837185871872
  • Last Price Increase: 2023-11-26
melvin-bot[bot] commented 11 months ago

Job added to Upwork: https://www.upwork.com/jobs/~015ab3357e3b21f462

melvin-bot[bot] commented 11 months ago

Triggered auto assignment to @kevinksullivan (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 11 months ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 11 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External)

giltron commented 11 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

The input field for the business name can be of any length and is beyond reasonable.
(over 1600 characters in the example which is beyond what a legal business name could be)

What is the root cause of that problem?

InputWrapper in CompanyStep has no input character limit (https://github.com/Expensify/App/blob/d985a0ee2604686911f34c99f5298af059622244/src/pages/ReimbursementAccount/CompanyStep.js#L165)

What changes do you think we should make in order to solve the problem

Set a reasonable maximum limit with the InputWrapper in CompanyStep. This value should go in CONST.ts with the explanation on the limit (ie. 40)

<InputWrapper
                    InputComponent={TextInput}
                    label={translate('companyStep.legalBusinessName')}
                    accessibilityLabel={translate('companyStep.legalBusinessName')}
                    role={CONST.ACCESSIBILITY_ROLE.TEXT}
                    inputID="companyName"
                    containerStyles={[styles.mt4]}
                    disabled={shouldDisableCompanyName}
                    maxLength={CONST.MAX_BUSINESS_NAME_LENGTH}
                    defaultValue={getDefaultStateForField('companyName')}
                    shouldSaveDraft
                    shouldUseDefaultValue={shouldDisableCompanyName}
                />

What alternative solutions did you explore? (Optional)

lukaspawlik commented 11 months ago

Proposal

Please find attached patch as a solution for the problem. CompanyStep.js component on lines 165-176 should have maxLength prop with the value coming from CONST.ts and named CONST.LEGAL_NAMES_CHARACTER_LIMIT.

diff --git a/src/pages/ReimbursementAccount/CompanyStep.js b/src/pages/ReimbursementAccount/CompanyStep.js
index e31988fbb1..79a6467003 100644
--- a/src/pages/ReimbursementAccount/CompanyStep.js
+++ b/src/pages/ReimbursementAccount/CompanyStep.js
@@ -165,6 +165,7 @@ function CompanyStep({reimbursementAccount, reimbursementAccountDraft, getDefaul
                 <InputWrapper
                     InputComponent={TextInput}
                     label={translate('companyStep.legalBusinessName')}
+                    maxLength={CONST.LEGAL_NAMES_CHARACTER_LIMIT}
                     accessibilityLabel={translate('companyStep.legalBusinessName')}
                     role={CONST.ACCESSIBILITY_ROLE.TEXT}
                     inputID="companyName"
melvin-bot[bot] commented 11 months ago

📣 @lukaspawlik! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
lukaspawlik commented 11 months ago

Contributor details Your Expensify account email: lukasz.pawlik@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01d0a5c201a9ae3e6a

melvin-bot[bot] commented 11 months ago

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

jaimishg2098 commented 11 months ago

How Can i Solve the max length issue?

I went thought the code and found issue in validate function, there is not max length condition and also max-length props is not there.

<InputWrapper InputComponent={TextInput} label={translate('companyStep.legalBusinessName')} accessibilityLabel={translate('companyStep.legalBusinessName')} role={CONST.ACCESSIBILITY_ROLE.TEXT} inputID="companyName" containerStyles={[styles.mt4]} disabled={shouldDisableCompanyName} defaultValue={getDefaultStateForField('companyName')} shouldSaveDraft shouldUseDefaultValue={shouldDisableCompanyName} />

DylanDylann commented 11 months ago

This should be handled in here

ashishdevswami commented 11 months ago

Contributor details Your Expensify account email: ashishdevswami@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~011ad3126c906e7452

melvin-bot[bot] commented 11 months ago

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

ashishdevswami commented 11 months ago

I observed the code implemented here and found maxLength property is missing for the InputWrapper component object on line 165. Implementing this will solve the issue and this is as per the standard of code.

https://github.com/Expensify/App/assets/2726330/e9bbf3fa-ad6b-4239-a8b6-000c2113c858

Simulator Screenshot - iPhone 14 Plus - 2023-11-26 at 19 18 31

melvin-bot[bot] commented 11 months ago

@mananjadhav, @kevinksullivan Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] commented 11 months ago

@mananjadhav, @kevinksullivan 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] commented 11 months ago

@mananjadhav, @kevinksullivan 10 days overdue. Is anyone even seeing these? Hello?

kevinksullivan commented 11 months ago

Hi @mananjadhav , are you going to review these proposals? If not in the next day or two I'll have to reassign.

mananjadhav commented 11 months ago

I think we should close this and handle it here

kevinksullivan commented 11 months ago

Got it, I am going to close then.