-
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
[$250] Report fields -System message shows undefined when list value is changed back to initial value #47067
Comments
Triggered auto assignment to @bfitzexpensify ( |
We think that this bug might be related to #wave-control |
@bfitzexpensify 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 |
Edited by proposal-police: This proposal was edited at 2024-08-08 13:17:27 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.System message shows undefined when list value is changed back to initial value What is the root cause of that problem?When selecting the same value ( App/src/pages/EditReportFieldDropdown.tsx Line 111 in 9c7c4a1
Then when value is an empty string we assign null to value prop, update the BE with with a new reportField that has null as a valueApp/src/pages/EditReportFieldPage.tsx Lines 76 to 82 in 9c7c4a1
Then BE returns a report action object that have null on What changes do you think we should make in order to solve the problem?We should remove
from App/src/pages/EditReportFieldDropdown.tsx Line 111 in 9c7c4a1
Or we should change it to
What alternative solutions did you explore? (Optional)We can dismiss the modal when value is an empty string if (value) {
ReportActions.updateReportField(report.reportID, {...reportField, value}, reportField);
}
Navigation.dismissModal(report?.reportID); |
Edited by proposal-police: This proposal was edited at 2024-08-08 13:11:00 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.The system message contains "undefined" when the list value is changed back to the initial value. What is the root cause of that problem?If the selected value is the current value of the report field, we pass it as empty string here App/src/pages/EditReportFieldDropdown.tsx Line 111 in 4f45424
Then here we pass the new value of the report field as null App/src/pages/EditReportFieldPage.tsx Line 82 in 4f45424
So BE returns the new value in report action as It leads App/src/libs/ReportActionsUtils.ts Line 1223 in 4f45424
What changes do you think we should make in order to solve the problem?We should add another case when the new value doesn't exist to display a message like
App/src/libs/ReportActionsUtils.ts Line 1220 in 4f45424
What alternative solutions did you explore? (Optional)We can do nothing if the user select the selected value
App/src/pages/EditReportFieldDropdown.tsx Lines 111 to 112 in 4f45424
|
Updated proposal
|
|
Job added to Upwork: https://www.upwork.com/jobs/~014a67065c97e4bdba |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 ( |
This comment was marked as outdated.
This comment was marked as outdated.
Triggered auto assignment to @grgia, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@dukenv0307 Can we please ask someone from internal to confirm the expected behaviour? From UX perspective, It doesn't make sense to select the default value when the user is selecting another report field twice. Especially when the user can select the default value if they want. Report field values are 1, 2, 3. And the default value is 1 in the video. When selecting '2' twice, the value reverts to '1' which is the default value. If the user want to change the value to '1', they can select it form the list. Screen.Recording.2024-08-12.at.2.12.40.in.the.afternoon.mp4 |
@etCoderDysto can you please write this bug in numbered steps? That will be easier to understand |
@mountiny If we implement The selected solution, the result will be following Steps
Expected Result: The selected report field shouldn't fallback to default report field, and it should be the selected one which is ('2') Attachment: Screen.Recording.2024-08-12.at.2.12.40.in.the.afternoon.mp4 |
@etCoderDysto got it, I agree with that, we should not change to the default. Can we just close the panel and do nothing when user clicks on the already selected report field? |
If we want to do nothing, I believe the proposal from @etCoderDysto doesn't get this expected behavior. This proposal makes the API called then a report action is created with the message displayed like I updated my proposal with alternative solution to do that |
@mountiny When the user selects existing report field, if (value) {
ReportActions.updateReportField(report.reportID, {...reportField, value}, reportField);reportField);
}
Navigation.dismissModal(report?.reportID); App/src/pages/EditReportFieldPage.tsx Lines 76 to 82 in 9c7c4a1
Alternatively, my proposal states that we should call |
@mountiny Additional I think we can do this because for tag or category, we can de-select the select tag/category when we click on the selected option. So I think can do the same for report field. |
It will make the API call, but there will be no action messages. The action message is only rendered when there is a change in value. And the alternative solution you just proposed won't close the modal, since |
Could you take a look at We'd like to mimic the behavior there where clicking the currently selected value just does nothing and navigates back. Basically like “reselecting” it. |
@grgia Based on the discussion above here. We want to use So we need to make some changes:
|
Hm, but given that there always has to be a value for the report field (consistent with OldDot behaviour and what the backend expects) why don't we treat it like the 2024-12-05_22-34-46.mp4 |
@nkdengineer any thoughts on the above? |
@grgia When we select an already selected report field, we can avoid making an API request, and the already selected report field will remain selected. If we do that, we don't have to make BE changes to return a violation since we will not be submitting a report field with a null value. @dukenv0307 Can you please take a look at my proposal? In alternative solution, It suggests that we should close the modal without making an API request when the user selects an already selected report field. You can take a look at the result of my proposal in this video Thanks! |
Bump @dukenv0307 |
@grgia I suggest this behavior here because the backend still accepts changing the dropdown report field to empty. The context is here: #47067 (comment) |
@grgia @etCoderDysto I think we already discussed this issue before here then decided to go with @nkdengineer's idea |
I think we should ask design team for the final decision |
I like @trjExpensify 's suggestion above. |
I also like @trjExpensify's suggestion. |
Yep let's stick with that behavior @dukenv0307 |
Seem like we want to change the expectation based on this comment. So @etCoderDysto's proposal is valid now. But should we re-assign to @etCoderDysto or assign both of them since @nkdengineer's proposal was selected before and he spent time on it? cc @grgia |
@dukenv0307 given the scope changes, we should look at the proposals again holistically. Given the convo and participation, what would you suggest? |
@grgia We should go with @etCoderDysto's alternative solution |
@grgia A kind reminder to take a loo at this comment ↑ |
@grgia friendly bump |
Great, thank you! |
📣 @etCoderDysto 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@dukenv0307 PR is ready for review |
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: v9.0.18-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:
The system message will not contain "undefined".
Actual Result:
The system message contains "undefined" when the list value is changed back to the initial value.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6565437_1723109214472.20240808_172103.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @grgiaThe text was updated successfully, but these errors were encountered: