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

[$250] Report fields - Initial value field name is "Date" for text report field #53565

Open
8 tasks done
vincdargento opened this issue Dec 4, 2024 · 14 comments
Open
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@vincdargento
Copy link

vincdargento commented Dec 4, 2024

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: 9.0.71-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+khcategory18@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Report fields.
  3. Click Add field.
  4. Click Type and select Text.
  5. Note that the initial value field name is "Initial value".
  6. Enter a report field name and save it.
  7. Click on the added text report field.

Expected Result:

The initial value field name is "Initial value".

Actual Result:

The initial value field name is "Date".

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

bug

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864332553645385180
  • Upwork Job ID: 1864332553645385180
  • Last Price Increase: 2024-12-04
  • Automatic offers:
    • Krishna2323 | Contributor | 105197849
Issue OwnerCurrent Issue Owner: @fedirjh
@vincdargento vincdargento added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

Triggered auto assignment to @carlosmiceli (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Dec 4, 2024

💬 A slack conversation has been started in #expensify-open-source

Copy link

melvin-bot bot commented Dec 4, 2024

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 4, 2024
Copy link
Contributor

github-actions bot commented Dec 4, 2024

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@vincdargento
Copy link
Author

@abekkala FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@carlosmiceli carlosmiceli added External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment labels Dec 4, 2024
@melvin-bot melvin-bot bot changed the title Report fields - Initial value field name is "Date" for text report field [$250] Report fields - Initial value field name is "Date" for text report field Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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

@carlosmiceli carlosmiceli added the Daily KSv2 label Dec 4, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 4, 2024
@carlosmiceli carlosmiceli removed the Hourly KSv2 label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Dec 4, 2024

Edited by proposal-police: This proposal was edited at 2024-12-04 15:50:15 UTC.

Proposal

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

The initial value field name is "Date".

What is the root cause of that problem?

We are wrong when set description as date here

description={translate('common.date')}

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

We should convert this to description={translate('common.initialValue')} if not is date type

      description={isDateFieldType ? translate('common.date') : translate('common.initialValue')}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@linhvovan29546
Copy link

linhvovan29546 commented Dec 4, 2024

Edited by proposal-police: This proposal was edited at 2024-12-04 16:16:50 UTC.

Proposal

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

Report fields - Initial value field name is "Date" for text report field

What is the root cause of that problem?

  • In the ReportFieldsSettingsPage file, there are three field types on the page (list, date, text).
    {!isListFieldEmpty && (
    <MenuItemWithTopDescription
    style={[styles.moneyRequestMenuItem]}
    titleStyle={styles.flex1}
    title={WorkspaceReportFieldUtils.getReportFieldInitialValue(reportField)}
    description={translate('common.date')}
    shouldShowRightIcon={!isDateFieldType && !hasAccountingConnections}
    interactive={!isDateFieldType && !hasAccountingConnections}
    onPress={() => Navigation.navigate(ROUTES.WORKSPACE_EDIT_REPORT_FIELDS_INITIAL_VALUE.getRoute(policyID, reportFieldID))}

    The current implementation uses a simple boolean check to differentiate these types, leading to incorrect value field name.

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

  • Refactor the field-rendering logic to use a switch-case structure. This approach will:
    • Dynamically determine the UI field value for each reportField type.
    • Improve scalability.
    • Example
    •  const renderFieldName = () => {
          switch (reportField.type) {
              case CONST.REPORT_FIELD_TYPES.DATE:
              case CONST.REPORT_FIELD_TYPES.TEXT:
                  // return component here
      
                  return;
              case CONST.REPORT_FIELD_TYPES.LIST:
                  // return component here
                  return;
              default:
                  // return component here
                  return;
          }
      }`
      

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

As mentioned in the other proposal above, we check the type of reportField to display description

@twilight2294
Copy link
Contributor

regression from #50827

@Krishna2323
Copy link
Contributor

@carlosmiceli, I can handle this if needed, as it's a regression from my PR.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@carlosmiceli
Copy link
Contributor

@carlosmiceli, I can handle this if needed, as it's a regression from my PR.

Sounds good! Thank you!

@Krishna2323
Copy link
Contributor

@rushatgabhane could you please review the PR above ^? This is a regression from #53611

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants