From d7536758964774a18c31123b5c71aed893dc34e5 Mon Sep 17 00:00:00 2001 From: Santhoshkumar Sellavel Date: Sun, 24 Apr 2022 00:38:49 +0530 Subject: [PATCH 1/2] IOU Contact Preview clickable cursor issue fixed --- src/components/IOUConfirmationList.js | 7 ++++--- src/pages/iou/IOUModal.js | 2 +- src/pages/iou/steps/IOUConfirmPage.js | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index a02a75595805..05ed4139520b 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -60,8 +60,8 @@ const propTypes = { phoneNumber: PropTypes.string, })).isRequired, - /** Whether this is an IOU split and belongs to a group report */ - isGroupSplit: PropTypes.bool.isRequired, + /** Is this IOU associated with existing report */ + isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, ...windowDimensionsPropTypes, @@ -352,6 +352,7 @@ class IOUConfirmationList extends Component { const shouldDisableButton = selectedParticipants.length === 0 || this.props.network.isOffline; const isLoading = this.props.iou.loading && !this.props.network.isOffline; const recipient = this.state.participants[0]; + const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants; return ( <> @@ -364,7 +365,7 @@ class IOUConfirmationList extends Component { canSelectMultipleOptions={this.props.hasMultipleParticipants} selectedOptions={this.getSelectedOptions()} onSelectRow={toggleOption} - isDisabled={!this.props.isGroupSplit} + isDisabled={!canModifyParticipants} optionHoveredStyle={hoverStyle} /> diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js index a75b7f990cfe..72819565b4e9 100755 --- a/src/pages/iou/IOUModal.js +++ b/src/pages/iou/IOUModal.js @@ -434,7 +434,7 @@ class IOUModal extends Component { comment={this.state.comment} onUpdateComment={this.updateComment} iouType={this.props.iouType} - isGroupSplit={this.steps.length === 2} + isIOUAttachedToExistingChatReport={!_.isEmpty(reportID)} /> )} diff --git a/src/pages/iou/steps/IOUConfirmPage.js b/src/pages/iou/steps/IOUConfirmPage.js index 6d59ed01c7ce..5352ccfdcf83 100644 --- a/src/pages/iou/steps/IOUConfirmPage.js +++ b/src/pages/iou/steps/IOUConfirmPage.js @@ -42,8 +42,8 @@ const propTypes = { /** IOU type */ iouType: PropTypes.string, - /** Whether this is an IOU split and belongs to a group report */ - isGroupSplit: PropTypes.bool.isRequired, + /** Is this IOU associated with existing report */ + isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired, }; const defaultProps = { @@ -62,7 +62,7 @@ const IOUConfirmPage = props => ( onConfirm={props.onConfirm} onSendMoney={props.onSendMoney} iouType={props.iouType} - isGroupSplit={props.isGroupSplit} + isIOUAttachedToExistingChatReport={props.isIOUAttachedToExistingChatReport} /> ); From d8979141a088b72e5fdc01deee3d4a57059b2698 Mon Sep 17 00:00:00 2001 From: Santhoshkumar Sellavel Date: Mon, 16 May 2022 00:19:16 +0530 Subject: [PATCH 2/2] IOU creator cannot deselect their account --- src/components/IOUConfirmationList.js | 1 + src/components/OptionsList/BaseOptionsList.js | 2 +- src/components/OptionsSelector.js | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index d15d34795e57..7468e2138ca4 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -225,6 +225,7 @@ class IOUConfirmationList extends Component { data: [formattedMyPersonalDetails], shouldShow: true, indexOffset: 0, + isDisabled: true, }, { title: this.props.translate('iOUConfirmationList.whoWasThere'), data: formattedSelectedParticipants, diff --git a/src/components/OptionsList/BaseOptionsList.js b/src/components/OptionsList/BaseOptionsList.js index f6049a886c5a..1b66eec802dd 100644 --- a/src/components/OptionsList/BaseOptionsList.js +++ b/src/components/OptionsList/BaseOptionsList.js @@ -111,7 +111,7 @@ class BaseOptionsList extends Component { showSelectedState={this.props.canSelectMultipleOptions} hideAdditionalOptionStates={this.props.hideAdditionalOptionStates} forceTextUnreadStyle={this.props.forceTextUnreadStyle} - isDisabled={this.props.isDisabled} + isDisabled={this.props.isDisabled || section.isDisabled} /> ); } diff --git a/src/components/OptionsSelector.js b/src/components/OptionsSelector.js index 48c34b1fcb15..81a83cbdf19e 100755 --- a/src/components/OptionsSelector.js +++ b/src/components/OptionsSelector.js @@ -30,6 +30,9 @@ const propTypes = { /** Whether this section should show or not */ shouldShow: PropTypes.bool, + + /** Whether this section items disabled for selection */ + isDisabled: PropTypes.bool, })).isRequired, /** Value in the search input field */