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

[CP Staging] - Only show Pending Banner for ECard Transactions #29659

Merged
merged 8 commits into from
Oct 16, 2023
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
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ const CONST = {
HAND_ICON_HEIGHT: 152,
HAND_ICON_WIDTH: 200,
SHUTTER_SIZE: 90,
MAX_REPORT_PREVIEW_RECEIPTS: 3,
},
REPORT: {
MAXIMUM_PARTICIPANTS: 8,
Expand Down
2 changes: 1 addition & 1 deletion src/components/MoneyRequestHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function MoneyRequestHeader({session, parentReport, report, parentReportAction,
}, [parentReportAction, setIsDeleteModalVisible]);

const isScanning = TransactionUtils.hasReceipt(transaction) && TransactionUtils.isReceiptBeingScanned(transaction);
const isPending = TransactionUtils.isPending(transaction);
const isPending = TransactionUtils.isExpensifyCardTransaction(transaction) && TransactionUtils.isPending(transaction);

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like your transactionID was incorrect, I don't see the amount set in this example

Copy link
Member

Choose a reason for hiding this comment

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

oh good catch, thank you! 🙇


const canModifyRequest = isActionOwner && !isSettled && !isApproved && !ReportActionsUtils.isDeletedAction(parentReportAction);

Expand Down
6 changes: 4 additions & 2 deletions src/components/ReportActionItem/ReportActionItemImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ const defaultProps = {
*/

function ReportActionItemImages({images, size, total, isHovered}) {
const numberOfShownImages = size || images.length;
const shownImages = images.slice(0, size);
// Calculate the number of images to be shown, limited by the value of 'size' (if defined)
// or the total number of images.
const numberOfShownImages = Math.min(size || images.length, images.length);
const shownImages = images.slice(0, numberOfShownImages);
const remaining = (total || images.length) - size;
const MAX_REMAINING = 9;

Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/ReportPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ function ReportPreview(props) {
{hasReceipts && (
<ReportActionItemImages
images={lastThreeReceipts}
size={3}
grgia marked this conversation as resolved.
Show resolved Hide resolved
total={transactionsWithReceipts.length}
isHovered={props.isHovered || isScanning}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
/>
)}
<View style={styles.reportPreviewBoxBody}>
Expand Down
6 changes: 1 addition & 5 deletions src/pages/iou/SplitBillDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ONYXKEYS from '../../ONYXKEYS';
import CONST from '../../CONST';
import * as OptionsListUtils from '../../libs/OptionsListUtils';
import personalDetailsPropType from '../personalDetailsPropType';
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize';
import compose from '../../libs/compose';
import reportActionPropTypes from '../home/report/reportActionPropTypes';
import reportPropTypes from '../reportPropTypes';
Expand Down Expand Up @@ -62,8 +61,6 @@ const propTypes = {
/** Currently logged in user email */
email: PropTypes.string,
}).isRequired,

...withLocalizePropTypes,
};

const defaultProps = {
Expand Down Expand Up @@ -113,7 +110,7 @@ function SplitBillDetailsPage(props) {
return (
<ScreenWrapper testID={SplitBillDetailsPage.displayName}>
<FullPageNotFoundView shouldShow={_.isEmpty(reportID) || _.isEmpty(reportAction) || _.isEmpty(props.transaction)}>
<HeaderWithBackButton title={props.translate('common.details')} />
<HeaderWithBackButton title={translate('common.details')} />
<View
pointerEvents="box-none"
style={[styles.containerWithSpaceBetween]}
Expand Down Expand Up @@ -161,7 +158,6 @@ SplitBillDetailsPage.defaultProps = defaultProps;
SplitBillDetailsPage.displayName = 'SplitBillDetailsPage';

export default compose(
withLocalize,
withReportAndReportActionOrNotFound,
withOnyx({
report: {
Expand Down
Loading