Open IuliiaHerets opened 2 hours ago
Triggered auto assignment to @muttmuure (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.
@muttmuure 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
Rules - Custom name field is not disabled when Report fields are disabled
We are not passing customReportNamesUnavailable
(!policy?.areReportFieldsEnabled
) to disabled
prop of MenuItemWithTopDescription
here. policy?.areReportFieldsEnabled becomes false when we disable report feilds
https://github.com/Expensify/App/blob/98dc643e14378f654e45a7ce96f35be9f407c007/src/pages/workspace/rules/ExpenseReportRulesSection.tsx#L72-L77
customReportNamesUnavailable
to disabledprop of
MenuItemWithTopDescription`
disabled={customReportNamesUnavailable}
In Step 7, Custom name field can be clicked and edited when Report fields are disabled. After editing the custom name, Report fields are enabled.
We update Onyx areReportFieldsEnabled
and do not update OnyxshouldShowCustomReportTitleOption
when we disable report fields
We should update Onyx key shouldShowCustomReportTitleOption = false
when we disable report fields and not show custom name field in Rules page (similar behavior when Track Tax in Distance Rates setting page)
const policy = getPolicy(policyID);
const onyxData: OnyxData = {
optimisticData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
areReportFieldsEnabled: enabled,
shouldShowCustomReportTitleOption: enabled ?? policy?.shouldShowCustomReportTitleOption,
pendingFields: {
areReportFieldsEnabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
},
},
],
and need to update successData
, failureData
as well
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: 9.0.38-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Precondition:
Expected Result:
In Step 7, Custom name field should be disabled when Report fields are disabled (similar behavior when Approver field is disabled in category rule when Worflows are enabled).
Actual Result:
In Step 7, Custom name field can be clicked and edited when Report fields are disabled. After editing the custom name, Report fields are enabled.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/38780d0a-2885-4ade-be2c-0f759a5aa1a4
View all open jobs on GitHub