Skip to content

Commit

Permalink
Fix expected missing field in ExpenseReportRulesSection
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Sep 26, 2024
1 parent 7d1126f commit 6f58877
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/pages/workspace/rules/ExpenseReportRulesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function ExpenseReportRulesSection({policyID}: ExpenseReportRulesSectionProps) {
);
};

const reportTitlePendingFields = policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE]?.pendingFields ?? {};
const optionItems = [
{
title: translate('workspace.rules.expenseReportRules.customReportNamesTitle'),
Expand All @@ -62,11 +63,7 @@ function ExpenseReportRulesSection({policyID}: ExpenseReportRulesSectionProps) {
onToggle: (isEnabled: boolean) => PolicyActions.enablePolicyDefaultReportTitle(policyID, isEnabled),
subMenuItems: [
<OfflineWithFeedback
pendingAction={
!policy?.pendingFields?.shouldShowCustomReportTitleOption && policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE].pendingFields?.defaultValue
? policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE].pendingFields?.defaultValue
: null
}
pendingAction={!policy?.pendingFields?.shouldShowCustomReportTitleOption && reportTitlePendingFields.defaultValue ? reportTitlePendingFields.defaultValue : null}
key="customName"
>
<MenuItemWithTopDescription
Expand All @@ -78,11 +75,7 @@ function ExpenseReportRulesSection({policyID}: ExpenseReportRulesSectionProps) {
/>
</OfflineWithFeedback>,
<ToggleSettingOptionRow
pendingAction={
!policy?.pendingFields?.shouldShowCustomReportTitleOption && policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE].pendingFields?.deletable
? policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE].pendingFields?.deletable
: null
}
pendingAction={!policy?.pendingFields?.shouldShowCustomReportTitleOption && reportTitlePendingFields.deletable ? reportTitlePendingFields.deletable : null}
key="preventMembersFromChangingCustomNames"
title={translate('workspace.rules.expenseReportRules.preventMembersFromChangingCustomNamesTitle')}
switchAccessibilityLabel={translate('workspace.rules.expenseReportRules.preventMembersFromChangingCustomNamesTitle')}
Expand Down

0 comments on commit 6f58877

Please sign in to comment.