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

[$500] Merchant entry field should clear when editing the merchant name that is missing #32780

Closed
1 of 6 tasks
m-natarajan opened this issue Dec 9, 2023 · 29 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@m-natarajan
Copy link

m-natarajan commented Dec 9, 2023

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.10.1
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: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1702081607918859

Action Performed:

  1. Create a expense report using some random image
  2. Open the merchant details page
  3. Click on the row "Merchant" to edit the name which is missing (i.e none)

Expected Result:

Merchant text entry field should be blank "none" should be cleared from the field

Actual Result:

Field is not cleared and it just adds characters after (none)

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

image (5)

image (4)

Recording.317.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017434affbfc54ad52
  • Upwork Job ID: 1733507434197475328
  • Last Price Increase: 2024-01-06
@m-natarajan m-natarajan added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 9, 2023
@melvin-bot melvin-bot bot changed the title Merchant entry field should clear when editing the merchant name that is missing [$500] Merchant entry field should clear when editing the merchant name that is missing Dec 9, 2023
Copy link

melvin-bot bot commented Dec 9, 2023

Job added to Upwork: https://www.upwork.com/jobs/~017434affbfc54ad52

Copy link

melvin-bot bot commented Dec 9, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 9, 2023
Copy link

melvin-bot bot commented Dec 9, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 9, 2023

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

@namhihi237
Copy link
Contributor

namhihi237 commented Dec 9, 2023

Proposal

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

The merchant field should clear when editing the merchant name that is missing

What is the root cause of that problem?

Currently, we use the default value (none)when create a transaction

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

We can check if is default value is (none) we will show empty this field in EditRequestMerchantPage

What alternative solutions did you explore? (Optional)

N/A

@abzokhattab
Copy link
Contributor

abzokhattab commented Dec 9, 2023

Proposal

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

The merchant field should clear when editing the merchant name that is missing

What is the root cause of that problem?

none is returned from the backend in case the merchant is empty
image

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

we check if the returned value is (none) and display it as empty string or add a placeholder and asign it (none) in casse we still want to show (none) and clear it on changing the value

we can do that by changing this:

<View style={styles.mb4}>
<InputWrapper
InputComponent={TextInput}
inputID="merchant"
name="merchant"
defaultValue={defaultMerchant}
label={translate('common.merchant')}
accessibilityLabel={translate('common.merchant')}
role={CONST.ACCESSIBILITY_ROLE.TEXT}
ref={(e) => (merchantInputRef.current = e)}
/>
</View>
</FormProvider>

to:

    const isEmptyMerchant =  defaultMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

     <InputWrapper
                        InputComponent={TextInput}
                        inputID="merchant"
                        name="merchant"
                        defaultValue={isEmptyMerchant ? '' : defaultMerchant}
                        label={translate('common.merchant')}
                        accessibilityLabel={translate('common.merchant')}
                        placeholder={CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT}
                        role={CONST.ACCESSIBILITY_ROLE.TEXT}
                        ref={(e) => (merchantInputRef.current = e)}
                    />

@jayeshmangwani
Copy link
Contributor

Proposal

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

Merchant name input is showing none as placeholder but when we try to edit then text is none text is not clearing from prefix

What is the root cause of that problem?

On the MoneyRequestView we check if the merchat name is empty(is equal to "(none)") and has errors from BE then show the brickRoadIndicator but when we press edit then we does not check same thing at edit request page here

if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.MERCHANT) {
return (
<EditRequestMerchantPage
defaultMerchant={transactionMerchant}

merchant: transactionMerchant,

and we directly pass the BE value, in this case it will be (none) from the BE

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

We should add the same check on the edit page, if the server response has error and value is "(none)" then pass the empty string as default value

Logic at MoneyRequestView for showing error

brickRoadIndicator={hasErrors && isEmptyMerchant ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''}
error={hasErrors && isEmptyMerchant ? translate('common.error.enterMerchant') : ''}

Can use same logic on the edit page

const canEdit = ReportUtils.canEditMoneyRequest(parentReportAction);
const hasErrors = canEdit && TransactionUtils.hasMissingSmartscanFields(transaction);
const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.UNKNOWN_MERCHANT || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;

defaultMerchant={transactionMerchant}

defaultMerchant={hasErrors && isEmptyMerchant ? "":transactionMerchant}

We should create a common util for this and we should use at MoneyRequestView and EditRequestPage or ant other page where we need same logic

What alternative solutions did you explore? (Optional)

N/A

@dukenv0307
Copy link
Contributor

Proposal

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

Default merchant doesn't clear when editing the merchant name

What is the root cause of that problem?

We always set default value for merchant as the correct value

defaultValue={defaultMerchant}

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

I think instead of displaying blank, we should auto-select the text input if the value of merchant is the default. Add selectTextOnFocus prop into the merchant input.

selectTextOnFocus={defaultMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && defaultMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT}

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Dec 12, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

@conorpendergrast, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Dec 15, 2023

@conorpendergrast, @fedirjh Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Dec 16, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@conorpendergrast
Copy link
Contributor

@fedirjh any preference for the proposals above?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 18, 2023
Copy link

melvin-bot bot commented Dec 22, 2023

@conorpendergrast, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Dec 23, 2023

@conorpendergrast @fedirjh this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Dec 23, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Dec 26, 2023

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

Copy link

melvin-bot bot commented Dec 28, 2023

@conorpendergrast, @fedirjh 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Copy link

melvin-bot bot commented Dec 30, 2023

@conorpendergrast @fedirjh this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

Copy link

melvin-bot bot commented Dec 30, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Copy link

melvin-bot bot commented Jan 1, 2024

@conorpendergrast, @fedirjh 12 days overdue. Walking. Toward. The. Light...

@fedirjh
Copy link
Contributor

fedirjh commented Jan 1, 2024

@conorpendergrast This issue was fixed with #32486. I retested and couldn’t reproduce, let's close.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 1, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

@conorpendergrast, @fedirjh Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@fedirjh
Copy link
Contributor

fedirjh commented Jan 5, 2024

Not overdue , just waititng for close.

@melvin-bot melvin-bot bot removed the Overdue label Jan 5, 2024
Copy link

melvin-bot bot commented Jan 6, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Jan 6, 2024

@conorpendergrast @fedirjh this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

  • Decide whether any proposals currently meet our guidelines and can be approved as-is today
  • If no proposals meet that standard, please take this issue internal and treat it as one of your highest priorities
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@melvin-bot melvin-bot bot added Internal Requires API changes or must be handled by Expensify staff and removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 6, 2024
Copy link

melvin-bot bot commented Jan 6, 2024

Current assignee @fedirjh is eligible for the Internal assigner, not assigning anyone new.

@fedirjh
Copy link
Contributor

fedirjh commented Jan 6, 2024

This is already fixed, check #32780 (comment).

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
@conorpendergrast
Copy link
Contributor

Ah, I was OoO. Thanks for finding that @fedirjh !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

8 participants