-
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-11-13] [$250] Report fields - Initial value field shows disabled list value but it is not shown in the list #48429
Comments
Triggered auto assignment to @dylanexpensify ( |
@dylanexpensify 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-09-02 20:15:33 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Report fields - Initial value field shows disabled list value but it is not shown in the list What is the root cause of that problem?We are not checking if the default value ( App/src/libs/WorkspaceReportFieldUtils.ts Lines 73 to 78 in 33b331d
What changes do you think we should make in order to solve the problem?We should check if the default value is disabled first, and return empty string if it is disabled function getReportFieldInitialValue(reportField: PolicyReportField | null): string {
const indexOfDefaultValue = reportField?.values.indexOf(reportField?.defaultValue);
const defalutValueDisabled = indexOfDefaultValue && reportField?.disabledOptions[indexOfDefaultValue];
if (defalutValueDisabled) {
return '';
} Note: We can move the suggested change into this if condition here, to make the change only to list report field and not text and date report fields. What alternative solutions did you explore? (Optional) |
I am able to reproduce this. |
Yes, I tested it again and the issue is reproducible. |
Edited by proposal-police: This proposal was edited at 2024-09-02 20:43:53 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.In the report fields, the initial value field displays a disabled list value, but this value is not shown in the list. What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?First solution:
if (!isVisible) {
return;
}
{inputValues[INPUT_IDS.TYPE] === CONST.REPORT_FIELD_TYPES.LIST && (
<InputWrapper
InputComponent={InitialListValueSelector}
inputID={INPUT_IDS.INITIAL_VALUE}
label={translate('common.initialValue')}
isVisible={availableListValuesLength > 0}
onInputChange={(value) => ReportField.setInitialCreateReportFieldsForm(value)}
subtitle={translate('workspace.reportFields.listValuesInputSubtitle')}
/>
)}
Second solution:another approach would be to show a placeholder or disable the menu item if the Third solution:Another approach would be to check if the default value is disabled when submitting the form. If it is, replace the default value with an empty string here. const submitForm = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_REPORT_FIELDS_FORM>) => {
const initialValueIndex = formDraft?.[INPUT_IDS.LIST_VALUES].indexOf(values[INPUT_IDS.INITIAL_VALUE]) ?? -1;
const initialValue = formDraft?.[INPUT_IDS.DISABLED_LIST_VALUES]?.[initialValueIndex] ? '' : values[INPUT_IDS.INITIAL_VALUE];
ReportField.createReportField(policyID, {
name: values[INPUT_IDS.NAME],
type: values[INPUT_IDS.TYPE],
initialValue,
});
Navigation.goBack();
},
[formDraft, policyID],
); or better would be to check if |
Job added to Upwork: https://www.upwork.com/jobs/~021831343278141946652 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale ( |
Upwork job price has been updated to $50 |
ProposalPlease re-state the problem that we are trying to solve in this issue.In the report fields, the initial value field displays a disabled list value, but this value is not shown in the list. What is the root cause of that problem?inside the App/src/libs/WorkspaceReportFieldUtils.ts Lines 73 to 78 in 33b331d
What changes do you think we should make in order to solve the problem?We should check if the default value is disabled, then return empty string function getReportFieldInitialValue(reportField: PolicyReportField | null): string {
if (!reportField) return ''; // we shouldnt remove this line as done in the first proposal
const indexOfDefaultValue = reportField?.values?.indexOf(reportField.defaultValue) ?? -1;
const defaultValueDisabled = indexOfDefaultValue >= 0 && reportField?.disabledOptions?.[indexOfDefaultValue];
if (defaultValueDisabled) return "" |
📣 @hayes102! 📣
|
Could we please update the price to match the other issues? This issue seems to be tricky to identify and address.. i believe it deserves a higher bounty, can u please confirm? @akinwale I mean it seems that the company pays more for the simple upgrade version task. so can we please revise the price. i am eager to get my first job |
@akinwale, @dylanexpensify Eep! 4 days overdue now. Issues have feelings too... |
|
Upwork job price has been updated to $250 |
@akinwale can we review proposals? 🙏 |
@akinwale, @dylanexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
We can move forward with @etCoderDysto's proposal here. 🎀👀🎀 C+ reviewed. |
The issue is not assigned to me yet. The pr will be ready once assigned |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Bump @dylanexpensify |
@akinwale, @CortneyOfstad, @MonilBhavsar Still overdue 6 days?! Let's take care of this! |
Sorry, was OoO so going to get this adjusted! @abzokhattab assigning you now! |
📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @abzokhattab 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR is ready ! |
PR deployed to staging yesterday, so will keep an eye as to when it deploys to production! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.57-10 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-11-13. 🎊 For reference, here are some details about the assignees on this issue:
|
@akinwale @CortneyOfstad 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] |
Payment set for tomorrow! |
Payment Summary@akinwale — paid $250 via Upwork |
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: v9.0.27-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The Initial value field should not display the disabled list value (disabled in Step 9) because the list value is disabled.
The field should be empty while clickable.
Actual Result:
The Initial value field shows the disabled list value, but it is not shown in the list in Initial value page.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6590738_1725293979256.20240903_000954.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @CortneyOfstadThe text was updated successfully, but these errors were encountered: