-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add Report Field Menu Items #33392
Add Report Field Menu Items #33392
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this intentional but there is a PR to migrate this to TS already #33255, not sure if it will conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually copied it from there. It was required in order to create this PR. Will clean it up once that is merged!
src/libs/ReportUtils.ts
Outdated
return value; | ||
} | ||
|
||
return value.replaceAll(/{report:([a-zA-Z]+)}/g, (match, property) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@allroundexperts we have Lint failing and a conflict. |
Hi @getusha! Can you please prioritise the review here? |
BUG: opening split request crashes the app
Screen.Recording.2024-01-04.at.7.30.09.PM.mov |
@getusha Seems to work fine on my end. Screen.Recording.2024-01-05.at.12.12.48.PM.movCan you please share a complete video? |
@allroundexperts you have to click on it Screen.Recording.2024-01-05.at.11.39.14.PM.mov |
@getusha Fixed! |
Reviewer Checklist
Screenshots/Videos |
@allroundexperts i took a policy id from the workspace onyx value and replaced it yet nothing happens, i think i am doing it wrong. |
@getusha You don't have to take a random policy ID. Create an IOU report and get the policy id of that report. |
Also, you need to make sure that |
@allroundexperts am i doing anything wrong? please check this. Screen.Recording.2024-01-08.at.7.41.29.PM.mov |
@getusha You should look for the fields in the expense report. In the video, you have opened a single request of a expense report. Report fields are mean't for an expense report. |
I see it now thanks! currently we can't change the values, is this something that's planned to implement later? |
Lets also fix conflicts. |
Yep. It's part of an upcoming ticket. |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #32762 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a minor change
src/libs/ReportUtils.ts
Outdated
@@ -4316,6 +4316,21 @@ function navigateToPrivateNotes(report: Report, session: Session) { | |||
Navigation.navigate(ROUTES.PRIVATE_NOTES_LIST.getRoute(report.reportID)); | |||
} | |||
|
|||
function getReportFieldTitle(report: OnyxEntry<Report>, reportField: PolicyReportField) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include a comment to explain the purpose and the expected output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can we also add the return type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the return type will be only string, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Added.
return value.replaceAll(CONST.REGEX.REPORT_FIELD_TITLE, (match, property) => { | ||
if (report && property in report) { | ||
return report[property as keyof Report]?.toString() ?? match; | ||
} | ||
return match; | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can test this out - but I'm not sure if we can generate the formula optimistically like this. Probably some fields but we'll need to get the current result from the backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting that I should remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can test this out - but we will have to think about a better way to handle formula titles offline if they are required because there are some formula items that cannot be generated on the FE. Something to bring back into a slack discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.26-2 🚀
|
Details
This PR adds custom report fields to the expense reports.
In order to test this, make sure that the
reportFields
beta is turned on from frontend.Fixed Issues
$ #32762
PROPOSAL: N/A
Tests
policyID
with thepolicyID
of thepolicy
the opened report is attached to:Offline tests
N/A
QA Steps
policyID
with thepolicyID
of thepolicy
the opened report is attached to:PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2023-12-21.at.9.53.43.AM.mov
MacOS: Desktop