-
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
[HOLD for payment 2024-10-17] [$250] Report fields - Same list values can be saved without error #49524
Comments
Triggered auto assignment to @johncschuster ( |
@johncschuster 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 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Report fields - Same list values can be saved without error What is the root cause of that problem?We are passing list values from draft (
What changes do you think we should make in order to solve the problem?We should pass existing field values when there is no draft lists (
const reportFieldKey = ReportUtils.getReportFieldKey(reportFieldID);
const fieldValues = policy?.fieldList?.reportFieldKey?.values;
Note: Optionally if reportFieldID is undefined we can pass What alternative solutions did you explore? (Optional) |
Edited by proposal-police: This proposal was edited at 2024-09-20 11:57:13 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Report fields - Same list values can be saved without error What is the root cause of that problem?When editing a report field, we are passing the form draft data as the value list. This is incorrect. The form draft data should only be used when creating a new field, not when editing, as the draft data is empty during field editing.
What changes do you think we should make in order to solve the problem?If the report field ID exists, it means the field is not a draft, so we can use the policy field. Otherwise, we should use the draft value: const reportFieldKey = ReportUtils.getReportFieldKey(reportFieldID);
const reportFieldValues = reportFieldID
? Object.values(policy?.fieldList?.[reportFieldKey]?.values ?? {})
: formDraft?.[INPUT_IDS.LIST_VALUES] ?? []; Then update the following line: WorkspaceReportFieldUtils.validateReportFieldListValueName(
values[INPUT_IDS.VALUE_NAME].trim(), '', reportFieldValues, INPUT_IDS.VALUE_NAME
); Note that we have to wrap the values returned from the field with What alternative solutions did you explore? (Optional)Optionally: i can see that we use the following logic in multiple locations here , here , and here Object.values(policy?.fieldList?.[reportFieldKey]?.values ?? {}) so we can move it to a util function instead of duplicating the code everywhere |
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~021838693059270278548 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hoangzinh ( |
|
I am just raising the points since the two proposals were around the same time and I took the time to validate my solution with POC and a complete working solution. lets see what others think Thanks! |
@abzokhattab thanks for pointing out those issues. IMO, those improvements seems minor and should be handled during PR phase as they don't have a substantial deviation from my RCA and suggested solution. I welcome any decision by the C+. And I appreciate that you always raise your concern in a very polite way. |
Thanks for proposals, everyone. I've appreciated it. Hmm, it's hard for me to make a decision in such cases. Agreed with @abzokhattab raised here. But overall, @etCoderDysto's approach is correct (and the same as @abzokhattab's approach), and those mistakes can be addressed in PR. Because @etCoderDysto is first (earlier than 6 mins compared with @abzokhattab), therefore I think we can go with @etCoderDysto's proposal Link to proposal #49524 (comment) 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @Julesssss, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @etCoderDysto 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.47-4 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 2024-10-17. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
I don't think we need a regression test. |
Payment Summary:Contributor: @etCoderDysto paid $250 via Upwork |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.38-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
App will show error when adding same list value in Step 9.
Actual Result:
App does not show error when adding same list value in Step 9.
User can add the same list values many times without issue.
When selecting one of the same list values via checklist, all the same values are selected and the dropdown button shows "1 selected".
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6609078_1726764527892.bandicam_2024-09-20_00-44-20-179.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @johncschusterThe text was updated successfully, but these errors were encountered: