Skip to content
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
7 changes: 4 additions & 3 deletions src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ const propTypes = {
phoneNumber: PropTypes.string,
})).isRequired,

/** Is this IOU associated with existing report */
isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired,
/** Can the participants be modified or not */
canModifyParticipants: PropTypes.bool,

...windowDimensionsPropTypes,

Expand Down Expand Up @@ -91,6 +91,7 @@ const defaultProps = {
onUpdateComment: null,
comment: '',
iouType: CONST.IOU.IOU_TYPE.REQUEST,
canModifyParticipants: false,
...withCurrentUserPersonalDetailsDefaultProps,
};

Expand Down Expand Up @@ -275,7 +276,7 @@ class IOUConfirmationList extends Component {
const shouldShowSettlementButton = this.props.iouType === CONST.IOU.IOU_TYPE.SEND;
const shouldDisableButton = selectedParticipants.length === 0;
const recipient = this.state.participants[0];
const canModifyParticipants = !this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
const canModifyParticipants = this.props.canModifyParticipants && this.props.hasMultipleParticipants;

return (
<OptionsSelector
Expand Down
8 changes: 7 additions & 1 deletion src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,13 @@ class IOUModal extends Component {
comment={this.state.comment}
onUpdateComment={this.updateComment}
iouType={this.props.iouType}
isIOUAttachedToExistingChatReport={!_.isEmpty(reportID)}

// The participants can only be modified when the action is initiated from directly within a group chat and not the floating-action-button.
// This is because when there is a group of people, say they are on a trip, and you have some shared expenses with some of the people,
// but not all of them (maybe someone skipped out on dinner). Then it's nice to be able to select/deselect people from the group chat bill
// split rather than forcing the user to create a new group, just for that expense. The reportID is empty, when the action was initiated from
// the floating-action-button (since it is something that exists outside the context of a report).
canModifyParticipants={!_.isEmpty(reportID)}
/>
</AnimatedStep>
)}
Expand Down
7 changes: 4 additions & 3 deletions src/pages/iou/steps/IOUConfirmPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ const propTypes = {
/** IOU type */
iouType: PropTypes.string,

/** Is this IOU associated with existing report */
isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired,
/** Can the participants be modified or not */
canModifyParticipants: PropTypes.bool,
};

const defaultProps = {
onUpdateComment: null,
comment: '',
iouType: CONST.IOU.IOU_TYPE.REQUEST,
canModifyParticipants: false,
};

const IOUConfirmPage = props => (
Expand All @@ -63,7 +64,7 @@ const IOUConfirmPage = props => (
onConfirm={props.onConfirm}
onSendMoney={props.onSendMoney}
iouType={props.iouType}
isIOUAttachedToExistingChatReport={props.isIOUAttachedToExistingChatReport}
canModifyParticipants={props.canModifyParticipants}
/>
);

Expand Down