Skip to content

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

Closed

Description

@m-natarajan

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

Activity

  1. added
    External
    Daily
    Bug
    on Dec 9, 2023
  2. 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 [/+] on Dec 9, 2023
  3. melvin-bot commented on Dec 9, 2023

    @melvin-bot
  4. melvin-bot commented on Dec 9, 2023

    @melvin-bot

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

  5. added
    Help Wanted
    on Dec 9, 2023
  6. melvin-bot commented on Dec 9, 2023

    @melvin-bot

    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
  7. melvin-bot commented on Dec 9, 2023

    @melvin-bot

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

  8. namhihi237 commented on Dec 9, 2023

    @namhihi237
    Contributor

    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

  9. abzokhattab commented on Dec 9, 2023

    @abzokhattab
    Contributor

    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)}
                        />
    
  10. jayeshmangwani commented on Dec 9, 2023

    @jayeshmangwani
    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

  11. dukenv0307 commented on Dec 10, 2023

    @dukenv0307
    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)

  12. 19 remaining items

  13. melvin-bot commented on Jan 4, 2024

    @melvin-bot

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

  14. fedirjh commented on Jan 5, 2024

    @fedirjh
    Contributor

    Not overdue , just waititng for close.

  15. melvin-bot commented on Jan 6, 2024

    @melvin-bot

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

  16. melvin-bot commented on Jan 6, 2024

    @melvin-bot

    @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!

  17. added
    Internal
    and removed
    External
    Help Wanted
    on Jan 6, 2024
  18. melvin-bot commented on Jan 6, 2024

    @melvin-bot

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

  19. fedirjh commented on Jan 6, 2024

    @fedirjh
    Contributor

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

  20. conorpendergrast commented on Jan 8, 2024

    @conorpendergrast

    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

Metadata

Metadata

Labels

BugDailyEngineeringInternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions