You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-07-01] [$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field #64428
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 9.1.68-3 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:@allgandalf Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Create a Workspace
Go to reports > Click Add Field
Enter any name > Select type as Date
Expected Result:
As seen in OldDot, the 3rd row should have a heading as Initial Value like other fields List and Name and the value should be Current Date
Actual Result:
We see the that the heading is incorrectly shown as Date and the value is shown as Initial Value
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
Please re-state the problem that we are trying to solve in this issue.
Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page for date field.
What is the root cause of that problem?
We incorrectly show the title and description when the field is Date in report fields, instead of the Initial Value title, we show Date as title and shown Initial Value as the value present:
changed the title [-]Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/-][+][$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/+]on Jun 18, 2025
When creating or viewing a report field of type Date, the UI incorrectly shows:
The heading "Date" instead of "Initial Value"
The value "Initial Value" instead of the actual date value
This happens in two places:
In the Create Report Fields page (CreateReportFieldsPage.tsx)
In the Report Fields Settings page (ReportFieldsSettingsPage.tsx)
Root Cause
The issue is in the MenuItemWithTopDescription component in CreateReportFieldsPage.tsx (lines 185-191). The component has the title and description parameters swapped:
The title should be the value displayed in the main text area, and description should be the label above it. However, they're reversed from what they should be.
Similarly, in ReportFieldsSettingsPage.tsx (lines 110-118), there's a similar issue:
Here, when isDateFieldType is true, the description is set to 'common.date' instead of 'common.initialValue'.
Proposed Solution
Fix the MenuItemWithTopDescription in CreateReportFieldsPage.tsx:
{inputValues[INPUT_IDS.TYPE]===CONST.REPORT_FIELD_TYPES.DATE&&(<MenuItemWithTopDescriptiontitle={defaultDate}// Show the actual default datedescription={translate('common.initialValue')}// Show "Initial Value" as the labelrightLabel={translate('common.required')}interactive={false}/>)}
Fix the MenuItemWithTopDescription in ReportFieldsSettingsPage.tsx:
<MenuItemWithTopDescriptionstyle={[styles.moneyRequestMenuItem]}titleStyle={styles.flex1}title={WorkspaceReportFieldUtils.getReportFieldInitialValue(reportField)}description={translate('common.initialValue')}// Always show "Initial Value" as the labelshouldShowRightIcon={!isDateFieldType&&!hasAccountingConnections}interactive={!isDateFieldType&&!hasAccountingConnections}onPress={()=>Navigation.navigate(ROUTES.WORKSPACE_EDIT_REPORT_FIELDS_INITIAL_VALUE.getRoute(policyID,reportFieldID))}/>
Fix the getReportFieldInitialValue function in WorkspaceReportFieldUtils.ts to return the actual date value for date fields instead of the string "Initial Value":
The label consistently shows "Initial Value" for all field types
The actual date value is displayed for date fields instead of showing "Initial Value"
The UI matches the expected behavior as described in the issue
This solution addresses the inconsistency in both the create and edit pages for report fields, ensuring a consistent user experience across the application.
changed the title [-][$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/-][+][Due for payment 2025-07-01] [$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/+]on Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ZhenjaHorbach / @allgandalf@VictoriaExpensify@ZhenjaHorbach / @allgandalf The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
It's more of a new feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
I'm not sure if tests are needed here
Since this is a UI bug
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jun 18, 2025
Triggered auto assignment to @VictoriaExpensify (
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.m-natarajan commentedon Jun 18, 2025
Proposal by @allgandalf
Proposal
Please re-state the problem that we are trying to solve in this issue.
Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page for date field.
What is the root cause of that problem?
We incorrectly show the title and description when the field is
Datein report fields, instead of theInitial Valuetitle, we showDateas title and shownInitial Valueas the value present:App/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx
Lines 187 to 190 in 0686278
Also when we are editing the report Field, we set the default value for the date field as
Initial Valuewhich is wrong:App/src/libs/WorkspaceReportFieldUtils.ts
Lines 82 to 84 in 0686278
Both of these cause a visual difference and confusion, we have the correct representation on OldDot:
What changes do you think we should make in order to solve the problem?
To fix these we need to update 3 files almost.
WorkspaceReportFieldUtilsto return the correct values for the date field:App/src/libs/WorkspaceReportFieldUtils.ts
Line 73 in 0686278
WorkspaceCreateReportFieldsPageto shown the correct values for date field:App/src/pages/workspace/reportFields/CreateReportFieldsPage.tsx
Lines 187 to 191 in 0686278
ReportFieldsSettingsPageto shown the correct description:Update if there are any more places for dates
App/src/pages/workspace/reportFields/ReportFieldsSettingsPage.tsx
Lines 111 to 116 in 0686278
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A, this is a UI bug but we can always have UI test to see if the values are shown correctly, but this is not required for this case
What alternative solutions did you explore? (Optional)
N/A
allgandalf commentedon Jun 18, 2025
@VictoriaExpensify Here's the correct format from OldDot:
Can you make this issue external please
VictoriaExpensify commentedon Jun 18, 2025
Thanks @allgandalf
[-]Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/-][+][$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/+]melvin-bot commentedon Jun 18, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021935301768696082784
melvin-bot commentedon Jun 18, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)DmitryChizhevsky-vs commentedon Jun 18, 2025
Problem
When creating or viewing a report field of type Date, the UI incorrectly shows:
This happens in two places:
CreateReportFieldsPage.tsx)ReportFieldsSettingsPage.tsx)Root Cause
The issue is in the
MenuItemWithTopDescriptioncomponent inCreateReportFieldsPage.tsx(lines 185-191). The component has the title and description parameters swapped:The
titleshould be the value displayed in the main text area, anddescriptionshould be the label above it. However, they're reversed from what they should be.Similarly, in
ReportFieldsSettingsPage.tsx(lines 110-118), there's a similar issue:Here, when
isDateFieldTypeis true, the description is set to 'common.date' instead of 'common.initialValue'.Proposed Solution
MenuItemWithTopDescriptioninCreateReportFieldsPage.tsx:MenuItemWithTopDescriptioninReportFieldsSettingsPage.tsx:getReportFieldInitialValuefunction inWorkspaceReportFieldUtils.tsto return the actual date value for date fields instead of the string "Initial Value":These changes will ensure that:
This solution addresses the inconsistency in both the create and edit pages for report fields, ensuring a consistent user experience across the application.
12 remaining items
[-][$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/-][+][Due for payment 2025-07-01] [$250] Date field is incorrectly mapped as Initial Value when creating report fields and in the edit page as well for date field[/+]melvin-bot commentedon Jun 24, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-07-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 24, 2025
@ZhenjaHorbach / @allgandalf @VictoriaExpensify @ZhenjaHorbach / @allgandalf The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
allgandalf commentedon Jun 25, 2025
@ZhenjaHorbach will fill the checklist
VictoriaExpensify commentedon Jul 2, 2025
Payment Summary:
C: @allgandalf paid $250 via Upwork
C+: @ZhenjaHorbach pwed $250 via NewDot
ZhenjaHorbach commentedon Jul 2, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
It's more of a new feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
I'm not sure if tests are needed here
Since this is a UI bug
ZhenjaHorbach commentedon Jul 2, 2025
Requested in ND !
garrettmknight commentedon Jul 21, 2025
$250 approved for @ZhenjaHorbach