Skip to content
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

update status num to correct value #56950

Merged
merged 4 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions src/libs/NextStepUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ function buildNextStep(report: OnyxEntry<Report>, predictedNextStatus: ValueOf<t
optimisticNextStep = {
type,
icon: CONST.NEXT_STEP.ICONS.HOURGLASS,
message: [
};
// We want to show pending approval next step for cases where the policy has approvals enabled
if (autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the reason for this change?

optimisticNextStep.message = [
{
text: 'Waiting for ',
},
Expand All @@ -246,8 +249,37 @@ function buildNextStep(report: OnyxEntry<Report>, predictedNextStatus: ValueOf<t
{
text: ' %expenses.',
},
],
};
];
} else {
optimisticNextStep.message = [
{
text: 'Waiting for ',
},
isPayer(
{
accountID: currentUserAccountID,
email: currentUserEmail,
},
report,
)
? {
text: `you`,
type: 'strong',
}
: {
text: `an admin`,
Copy link
Contributor

@dukenv0307 dukenv0307 Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the text an admin, do we need type strong? We don't use strong in

text: 'an admin',

},
{
text: ' to ',
},
{
text: 'pay',
},
{
text: ' %expenses.',
},
];
}

break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8667,7 +8667,7 @@ function cancelPayment(expenseReport: OnyxEntry<OnyxTypes.Report>, chatReport: O
const policy = getPolicy(chatReport.policyID);
const approvalMode = policy?.approvalMode ?? CONST.POLICY.APPROVAL_MODE.BASIC;
const stateNum: ValueOf<typeof CONST.REPORT.STATE_NUM> = approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL ? CONST.REPORT.STATE_NUM.SUBMITTED : CONST.REPORT.STATE_NUM.APPROVED;
const statusNum: ValueOf<typeof CONST.REPORT.STATUS_NUM> = approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL ? CONST.REPORT.STATUS_NUM.CLOSED : CONST.REPORT.STATUS_NUM.APPROVED;
const statusNum: ValueOf<typeof CONST.REPORT.STATUS_NUM> = approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL ? CONST.REPORT.STATUS_NUM.SUBMITTED : CONST.REPORT.STATUS_NUM.APPROVED;
const optimisticNextStep = buildNextStep(expenseReport, statusNum);
const iouReportActions = getAllReportActions(chatReport.iouReportID);
const expenseReportActions = getAllReportActions(expenseReport.reportID);
Expand Down