Skip to content

fix: Quick Action for Scan receipt giving not found page #53747

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

Merged
merged 4 commits into from
Dec 11, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,27 @@ const getQuickActionIcon = (action: QuickActionName): React.FC<SvgProps> => {
}
};

const getIouType = (action: QuickActionName) => {
switch (action) {
case CONST.QUICK_ACTIONS.REQUEST_MANUAL:
case CONST.QUICK_ACTIONS.REQUEST_SCAN:
case CONST.QUICK_ACTIONS.REQUEST_DISTANCE:
return CONST.IOU.TYPE.SUBMIT;
case CONST.QUICK_ACTIONS.SPLIT_MANUAL:
case CONST.QUICK_ACTIONS.SPLIT_SCAN:
case CONST.QUICK_ACTIONS.SPLIT_DISTANCE:
return CONST.IOU.TYPE.SPLIT;
case CONST.QUICK_ACTIONS.TRACK_DISTANCE:
case CONST.QUICK_ACTIONS.TRACK_MANUAL:
case CONST.QUICK_ACTIONS.TRACK_SCAN:
return CONST.IOU.TYPE.TRACK;
case CONST.QUICK_ACTIONS.SEND_MONEY:
return CONST.IOU.TYPE.PAY;
default:
return undefined;
}
};

const getQuickActionTitle = (action: QuickActionName): TranslationPaths => {
switch (action) {
case CONST.QUICK_ACTIONS.REQUEST_MANUAL:
Expand Down Expand Up @@ -449,6 +470,10 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl
};

if (quickAction?.action) {
const iouType = getIouType(quickAction?.action);
if (!!iouType && !ReportUtils.canCreateRequest(quickActionReport, quickActionPolicy, iouType)) {
return [];
}
return [
{
...baseQuickAction,
Expand Down Expand Up @@ -498,6 +523,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl
navigateToQuickAction,
selectOption,
isValidReport,
quickActionPolicy,
]);

const viewTourTaskReportID = introSelected?.viewTour;
Expand Down
Loading