From 6d7cd82e2e9f4ce6620761b4b6f02fedefcea8cc Mon Sep 17 00:00:00 2001 From: maftalion Date: Fri, 9 Apr 2021 09:30:04 -0700 Subject: [PATCH 01/45] skip iou participants step --- src/ROUTES.js | 6 +++-- src/pages/iou/IOUModal.js | 46 ++++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index 2e706584f08f..7cab700111f7 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -15,8 +15,10 @@ export default { REPORT: 'r', REPORT_WITH_ID: 'r/:reportID', getReportRoute: reportID => `r/${reportID}`, - IOU_REQUEST: 'iou/request', - IOU_BILL: 'iou/split', + IOU_REQUEST: 'iou/request/:reportID', + getIouRequestRoute: reportID => `iou/request/${reportID}`, + IOU_BILL: 'iou/split/:reportID', + getIouSplitRoute: reportID => `iou/split/${reportID}`, SEARCH: 'search', SIGNIN: 'signin', SET_PASSWORD_WITH_VALIDATE_CODE: 'setpassword/:accountID/:validateCode', diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js index 593addfda470..3c944fcc3976 100644 --- a/src/pages/iou/IOUModal.js +++ b/src/pages/iou/IOUModal.js @@ -1,6 +1,8 @@ import React, {Component} from 'react'; import {View, TouchableOpacity} from 'react-native'; import PropTypes from 'prop-types'; +import lodashGet from 'lodash/get'; +import {withOnyx} from 'react-native-onyx'; import IOUAmountPage from './steps/IOUAmountPage'; import IOUParticipantsPage from './steps/IOUParticipantsPage'; import IOUConfirmPage from './steps/IOUConfirmPage'; @@ -10,17 +12,27 @@ import Icon from '../../components/Icon'; import {getPreferredCurrency} from '../../libs/actions/IOU'; import {Close, BackArrow} from '../../components/Icon/Expensicons'; import Navigation from '../../libs/Navigation/Navigation'; +import ONYXKEYS from '../../ONYXKEYS'; /** * IOU modal for requesting money and splitting bills. */ const propTypes = { - // Is this new IOU for a single request or group bill split? + // Whether the IOU is for a single request or a group bill split hasMultipleParticipants: PropTypes.bool, + + // The report passed via the route + report: PropTypes.shape({ + // Participants associated with current report + participants: PropTypes.arrayOf(PropTypes.string), + }), }; const defaultProps = { hasMultipleParticipants: false, + report: { + participants: [], + }, }; // Determines type of step to display within Modal, value provides the title for that page. @@ -30,26 +42,31 @@ const Steps = { IOUConfirm: 'Confirm', }; -// The steps to be shown within the create IOU flow. -const steps = [Steps.IOUAmount, Steps.IOUParticipants, Steps.IOUConfirm]; - class IOUModal extends Component { constructor(props) { super(props); - this.navigateToPreviousStep = this.navigateToPreviousStep.bind(this); this.navigateToNextStep = this.navigateToNextStep.bind(this); this.updateAmount = this.updateAmount.bind(this); this.currencySelected = this.currencySelected.bind(this); - this.addParticipants = this.addParticipants.bind(this); + const participants = lodashGet(props, 'report.participants', []); + this.state = { currentStepIndex: 0, - participants: [], + participants, amount: '', selectedCurrency: 'USD', isAmountPageNextButtonDisabled: true, }; + + // Skip IOUParticipants step if participants are passed in + if (participants.length) { + // The steps to be shown within the create IOU flow. + this.steps = [Steps.IOUAmount, Steps.IOUConfirm]; + } else { + this.steps = [Steps.IOUAmount, Steps.IOUParticipants, Steps.IOUConfirm]; + } } componentDidMount() { @@ -61,15 +78,14 @@ class IOUModal extends Component { * * @returns {String} */ - getTitleForStep() { if (this.state.currentStepIndex === 1) { return `${this.props.hasMultipleParticipants ? 'Split' : 'Request'} $${this.state.amount}`; } - if (steps[this.state.currentStepIndex] === Steps.IOUAmount) { + if (this.steps[this.state.currentStepIndex] === Steps.IOUAmount) { return this.props.hasMultipleParticipants ? 'Split Bill' : 'Request Money'; } - return steps[this.state.currentStepIndex] || ''; + return this.steps[this.state.currentStepIndex] || ''; } /** @@ -88,7 +104,7 @@ class IOUModal extends Component { * Navigate to the previous IOU step if possible */ navigateToNextStep() { - if (this.state.currentStepIndex >= steps.length - 1) { + if (this.state.currentStepIndex >= this.steps.length - 1) { return; } this.setState(prevState => ({ @@ -139,7 +155,7 @@ class IOUModal extends Component { } render() { - const currentStep = steps[this.state.currentStepIndex]; + const currentStep = this.steps[this.state.currentStepIndex]; return ( <> @@ -206,4 +222,8 @@ IOUModal.propTypes = propTypes; IOUModal.defaultProps = defaultProps; IOUModal.displayName = 'IOUModal'; -export default IOUModal; +export default withOnyx({ + report: { + key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`, + }, +})(IOUModal); From 77a6149b770fd2219c5562da509d9cfd5002f16c Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Wed, 14 Apr 2021 15:59:52 -0700 Subject: [PATCH 02/45] Focus emoji picker search input --- src/components/Modal/BaseModal.js | 1 + src/components/Modal/ModalPropTypes.js | 4 ++++ .../home/report/EmojiPickerMenu/index.js | 21 ++++++++++++++++++- src/pages/home/report/ReportActionCompose.js | 9 ++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/components/Modal/BaseModal.js b/src/components/Modal/BaseModal.js index 2471288ed923..b4266eeaf8b0 100644 --- a/src/components/Modal/BaseModal.js +++ b/src/components/Modal/BaseModal.js @@ -79,6 +79,7 @@ class BaseModal extends PureComponent { onModalShow={() => { this.subscribeToKeyEvents(); setModalVisibility(true); + this.props.onModalShow(); }} onModalHide={this.hideModalAndRemoveEventListeners} onSwipeComplete={this.props.onClose} diff --git a/src/components/Modal/ModalPropTypes.js b/src/components/Modal/ModalPropTypes.js index 54d509921552..12cfcafe221e 100644 --- a/src/components/Modal/ModalPropTypes.js +++ b/src/components/Modal/ModalPropTypes.js @@ -18,6 +18,9 @@ const propTypes = { // Callback method fired when the modal is hidden onModalHide: PropTypes.func, + // Callback method fired when the modal is shown + onModalShow: PropTypes.func, + // Style of modal to display type: PropTypes.oneOf([ CONST.MODAL.MODAL_TYPE.CONFIRM, @@ -48,6 +51,7 @@ const defaultProps = { onSubmit: null, type: '', onModalHide: () => {}, + onModalShow: () => {}, animationIn: null, popoverAnchorPosition: {}, }; diff --git a/src/pages/home/report/EmojiPickerMenu/index.js b/src/pages/home/report/EmojiPickerMenu/index.js index f46a3ea16e97..907b335e3c83 100644 --- a/src/pages/home/report/EmojiPickerMenu/index.js +++ b/src/pages/home/report/EmojiPickerMenu/index.js @@ -12,6 +12,11 @@ import TextInputFocusable from '../../../../components/TextInputFocusable'; const propTypes = { // Function to add the selected emoji to the main compose text input onEmojiSelected: PropTypes.func.isRequired, + forwardedRef: PropTypes.func, +}; + +const defaultProps = { + forwardedRef: () => {}, }; class EmojiPickerMenu extends Component { @@ -43,6 +48,16 @@ class EmojiPickerMenu extends Component { }; } + componentDidMount() { + // This callback prop is used by the parent component using the constructor to + // get a ref to the inner textInput element e.g. if we do + // this.textInput = el} /> this will not + // return a ref to the component, but rather the HTML element by default + if (this.props.forwardedRef && _.isFunction(this.props.forwardedRef)) { + this.props.forwardedRef(this.searchInput); + } + } + /** * Filter the entire list of emojis to only emojis that have the search term in their keywords * @@ -124,5 +139,9 @@ class EmojiPickerMenu extends Component { } EmojiPickerMenu.propTypes = propTypes; +EmojiPickerMenu.defaultProps = defaultProps; -export default EmojiPickerMenu; +export default React.forwardRef((props, ref) => ( + // eslint-disable-next-line react/jsx-props-no-spreading + +)); diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index dfa937c442af..24995d6a452c 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -88,6 +88,9 @@ class ReportActionCompose extends React.Component { this.focus = this.focus.bind(this); this.comment = props.comment; this.shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus(); + this.focusEmojiSearchInput = this.focusEmojiSearchInput.bind(this); + + this.emojiSearchInput = null; this.state = { isFocused: this.shouldFocusInputOnScreenFocus, @@ -250,6 +253,10 @@ class ReportActionCompose extends React.Component { this.setTextInputShouldClear(true); } + focusEmojiSearchInput() { + this.emojiSearchInput.focus(); + } + render() { // eslint-disable-next-line no-unused-vars const hasMultipleParticipants = lodashGet(this.props.report, 'participants.length') > 1; @@ -370,6 +377,7 @@ class ReportActionCompose extends React.Component { this.emojiSearchInput = el} /> Date: Thu, 15 Apr 2021 17:02:02 -0700 Subject: [PATCH 03/45] Add method docs --- src/pages/home/report/ReportActionCompose.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 24995d6a452c..88c1ba05c7e7 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -224,6 +224,11 @@ class ReportActionCompose extends React.Component { this.setState({isEmojiPickerVisible: false}); } + /** + * Hide the emoji picker modal and add the selected emoji to the main text input. + * + * @param {String} emoji + */ addEmojiToTextBox(emoji) { this.hideEmojiPicker(); this.textInput.value = this.comment + emoji; @@ -231,6 +236,13 @@ class ReportActionCompose extends React.Component { this.updateComment(this.textInput.value); } + /** + * Focus the search input in the emoji picker. + */ + focusEmojiSearchInput() { + this.emojiSearchInput.focus(); + } + /** * Add a new comment to this chat * @@ -253,10 +265,6 @@ class ReportActionCompose extends React.Component { this.setTextInputShouldClear(true); } - focusEmojiSearchInput() { - this.emojiSearchInput.focus(); - } - render() { // eslint-disable-next-line no-unused-vars const hasMultipleParticipants = lodashGet(this.props.report, 'participants.length') > 1; From 2f3189650d82f26133a02a5063f103b416d6660d Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 15 Apr 2021 17:47:16 -0700 Subject: [PATCH 04/45] Hide the emoji search keyboard on mobile web --- src/components/withWindowDimensions.js | 23 ++++++++++--- .../home/report/EmojiPickerMenu/index.js | 33 +++++++++++-------- src/pages/home/report/ReportActionCompose.js | 4 ++- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/src/components/withWindowDimensions.js b/src/components/withWindowDimensions.js index 3dc8c3c0c9f8..25e669d507d0 100644 --- a/src/components/withWindowDimensions.js +++ b/src/components/withWindowDimensions.js @@ -16,7 +16,15 @@ const windowDimensionsPropTypes = { }; export default function (WrappedComponent) { - class withWindowDimensions extends Component { + const propTypes = { + forwardedRef: PropTypes.func, + }; + + const defaultProps = { + forwardedRef: () => {}, + }; + + class WithWindowDimensions extends Component { constructor(props) { super(props); @@ -56,10 +64,12 @@ export default function (WrappedComponent) { } render() { + const {forwardedRef, ...rest} = this.props; return ( ( + // eslint-disable-next-line react/jsx-props-no-spreading + + )); } export { diff --git a/src/pages/home/report/EmojiPickerMenu/index.js b/src/pages/home/report/EmojiPickerMenu/index.js index 907b335e3c83..dca7ea099009 100644 --- a/src/pages/home/report/EmojiPickerMenu/index.js +++ b/src/pages/home/report/EmojiPickerMenu/index.js @@ -8,11 +8,16 @@ import themeColors from '../../../../styles/themes/default'; import emojis from '../../../../../assets/emojis'; import EmojiPickerMenuItem from '../EmojiPickerMenuItem'; import TextInputFocusable from '../../../../components/TextInputFocusable'; +import withWindowDimensions, {windowDimensionsPropTypes} from '../../../../components/withWindowDimensions'; const propTypes = { // Function to add the selected emoji to the main compose text input onEmojiSelected: PropTypes.func.isRequired, + + // The ref to the search input (may be null on small screen widths) forwardedRef: PropTypes.func, + + ...windowDimensionsPropTypes, }; const defaultProps = { @@ -113,17 +118,19 @@ class EmojiPickerMenu extends Component { render() { return ( - - this.searchInput = el} - /> - + {!this.props.isSmallScreenWidth && ( + + this.searchInput = el} + /> + + )} ( +export default withWindowDimensions(React.forwardRef((props, ref) => ( // eslint-disable-next-line react/jsx-props-no-spreading -)); +))); diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 88c1ba05c7e7..66b29a540118 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -240,7 +240,9 @@ class ReportActionCompose extends React.Component { * Focus the search input in the emoji picker. */ focusEmojiSearchInput() { - this.emojiSearchInput.focus(); + if (this.emojiSearchInput) { + this.emojiSearchInput.focus(); + } } /** From 3e296db0ae730ef108943069d9111234ea0bf00f Mon Sep 17 00:00:00 2001 From: Rafida Date: Fri, 16 Apr 2021 09:14:01 +0300 Subject: [PATCH 05/45] Done button is not present to close keyboard #2371 --- src/pages/settings/AddSecondaryLoginPage.js | 108 +++++++++++--------- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/src/pages/settings/AddSecondaryLoginPage.js b/src/pages/settings/AddSecondaryLoginPage.js index 7ac3f1e6deb7..2ed6abf94525 100644 --- a/src/pages/settings/AddSecondaryLoginPage.js +++ b/src/pages/settings/AddSecondaryLoginPage.js @@ -1,7 +1,9 @@ import React, {Component} from 'react'; import Onyx, {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; -import {View, TextInput} from 'react-native'; +import { + View, TextInput, KeyboardAvoidingView, Platform, +} from 'react-native'; import _ from 'underscore'; import Str from 'expensify-common/lib/str'; import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; @@ -96,60 +98,66 @@ class AddSecondaryLoginPage extends Component { render() { return ( - Navigation.navigate(ROUTES.SETTINGS_PROFILE)} - onCloseButtonPress={() => Navigation.dismissModal()} - /> - - - - {this.formType === CONST.LOGIN_TYPE.PHONE - ? 'Enter your preferred phone number and password to send a validation link.' - : 'Enter your preferred email address and password to send a validation link.'} - - - - {this.formType === CONST.LOGIN_TYPE.PHONE ? 'Phone Number' : 'Email Address'} + + Navigation.navigate(ROUTES.SETTINGS_PROFILE)} + onCloseButtonPress={() => Navigation.dismissModal()} + /> + + + + {this.formType === CONST.LOGIN_TYPE.PHONE + ? 'Enter your preferred phone number and password to send a validation link.' + : 'Enter your preferred email address and password to send a validation link.'} - this.setState({login})} - autoFocus - keyboardType={this.formType === CONST.LOGIN_TYPE.PHONE - ? CONST.KEYBOARD_TYPE.PHONE_PAD : undefined} - returnKeyType="done" - /> - - - Password - this.setState({password})} - secureTextEntry - autoCompleteType="password" - textContentType="password" - onSubmitEditing={this.submitForm} - /> - - {!_.isEmpty(this.props.user.error) && ( + + + {this.formType === CONST.LOGIN_TYPE.PHONE ? 'Phone Number' : 'Email Address'} + + this.setState({login})} + autoFocus + keyboardType={this.formType === CONST.LOGIN_TYPE.PHONE + ? CONST.KEYBOARD_TYPE.PHONE_PAD : undefined} + returnKeyType="done" + /> + + + Password + this.setState({password})} + secureTextEntry + autoCompleteType="password" + textContentType="password" + onSubmitEditing={this.submitForm} + /> + + {!_.isEmpty(this.props.user.error) && ( {this.props.user.error} - )} - - - + )} + + + + - + ); } From 0cd2934545ea824edf542ee6266d33abada34ae7 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Mon, 19 Apr 2021 08:18:43 -1000 Subject: [PATCH 06/45] add CustomActions --- src/libs/Navigation/CustomActions.js | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/libs/Navigation/CustomActions.js diff --git a/src/libs/Navigation/CustomActions.js b/src/libs/Navigation/CustomActions.js new file mode 100644 index 000000000000..74570a88edea --- /dev/null +++ b/src/libs/Navigation/CustomActions.js @@ -0,0 +1,33 @@ +import {CommonActions} from '@react-navigation/native'; + +/** + * In order to create the desired browser navigation behavior on web and mobile web we need to replace any + * type: 'drawer' routes with a type: 'route' so that when pushing to a report screen we never show the + * drawer. We don't want to remove these since we always want the history length to increase by 1 whenever + * we are moving to a new report screen or back to a previous one. This is a workaround since + * react-navigation default behavior for a drawer is to skip pushing history states when navigating to the + * current route + * + * @param {String} screenName + * @param {Object} params + * @returns {Function} + */ +function pushDrawerRoute(screenName, params) { + return (state) => { + const screenRoute = {type: 'route', name: screenName}; + const history = [...state.history].map(() => screenRoute); + history.push(screenRoute); + return CommonActions.reset({ + ...state, + routes: [{ + name: screenName, + params, + }], + history, + }); + }; +} + +export default { + pushDrawerRoute, +}; From cc0b5ed92d5697128813c79afbe821186a3ea75c Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Mon, 19 Apr 2021 08:22:12 -1000 Subject: [PATCH 07/45] Add pushDrawerRoute --- src/libs/Navigation/Navigation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js index d3d2e8811c8d..30cce16a51ae 100644 --- a/src/libs/Navigation/Navigation.js +++ b/src/libs/Navigation/Navigation.js @@ -6,6 +6,7 @@ import {getIsDrawerOpenFromState} from '@react-navigation/drawer'; import linkTo from './linkTo'; import ROUTES from '../../ROUTES'; import SCREENS from '../../SCREENS'; +import CustomActions from './CustomActions'; export const navigationRef = React.createRef(); @@ -49,7 +50,7 @@ function navigate(route = ROUTES.HOME) { const {reportID} = ROUTES.parseReportRouteParams(route); if (reportID) { - navigationRef.current.navigate(SCREENS.REPORT, {reportID}); + navigationRef.current.dispatch(CustomActions.pushDrawerRoute(SCREENS.REPORT, {reportID})); return; } From e55d353f3c53f0ba04014eb3106859c58ad02d1a Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Mon, 19 Apr 2021 16:01:01 -0600 Subject: [PATCH 08/45] Add native popover component --- src/components/Popover/index.native.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/components/Popover/index.native.js diff --git a/src/components/Popover/index.native.js b/src/components/Popover/index.native.js new file mode 100644 index 000000000000..e69de29bb2d1 From 2175cbf5806c0924671e57572b0ab9e412f295c6 Mon Sep 17 00:00:00 2001 From: maftalion Date: Tue, 20 Apr 2021 00:52:05 -0700 Subject: [PATCH 09/45] format participants for confirm page --- src/pages/iou/IOUModal.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js index 0e2c855783a1..35ddac83f2ef 100644 --- a/src/pages/iou/IOUModal.js +++ b/src/pages/iou/IOUModal.js @@ -13,6 +13,7 @@ import {createIOUSplit, createIOUTransaction, getPreferredCurrency} from '../../ import {Close, BackArrow} from '../../components/Icon/Expensicons'; import Navigation from '../../libs/Navigation/Navigation'; import ONYXKEYS from '../../ONYXKEYS'; +import {getPersonalDetailsForLogins} from '../../libs/OptionsListUtils'; /** * IOU modal for requesting money and splitting bills. @@ -35,6 +36,18 @@ const propTypes = { // Whether or not transaction creation has resulted to error error: PropTypes.bool, }).isRequired, + + // Personal details of all the users + personalDetails: PropTypes.objectOf({ + // Primary login of participant + login: PropTypes.string, + + // Display Name of participant + displayName: PropTypes.string, + + // Avatar url of participant + avatar: PropTypes.string, + }).isRequired, }; const defaultProps = { @@ -62,10 +75,18 @@ class IOUModal extends Component { this.updateComment = this.updateComment.bind(this); this.addParticipants = this.addParticipants.bind(this); const participants = lodashGet(props, 'report.participants', []); + const participantsWithDetails = getPersonalDetailsForLogins(participants, props.personalDetails) + .map(personalDetails => ({ + login: personalDetails.login, + text: personalDetails.displayName, + alternateText: personalDetails.login, + icons: [personalDetails.avatar], + keyForList: personalDetails.login, + })); this.state = { currentStepIndex: 0, - participants, + participants: participantsWithDetails, // amount is currency in decimal format amount: '', @@ -269,5 +290,10 @@ export default withOnyx({ iousReport: { key: ONYXKEYS.COLLECTION.REPORT_IOUS, }, - iou: {key: ONYXKEYS.IOU}, + iou: { + key: ONYXKEYS.IOU, + }, + personalDetails: { + key: ONYXKEYS.PERSONAL_DETAILS, + }, })(IOUModal); From f8170558d32ea95c82786e619cee655647f3f51b Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Tue, 20 Apr 2021 08:53:27 -0600 Subject: [PATCH 10/45] Add native popover --- src/components/Popover/index.native.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/components/Popover/index.native.js b/src/components/Popover/index.native.js index e69de29bb2d1..0b9398749fc0 100644 --- a/src/components/Popover/index.native.js +++ b/src/components/Popover/index.native.js @@ -0,0 +1,23 @@ +import React from 'react'; +import {propTypes, defaultProps} from './PopoverPropTypes'; +import CONST from '../../CONST'; +import Modal from '../Modal'; +import withWindowDimensions from '../withWindowDimensions'; + +/* + * This is a convenience wrapper around the Modal component for a responsive Popover. + * On small screen widths, it uses BottomDocked modal type, and a Popover type on wide screen widths. + */ +const Popover = props => ( + +); + +Popover.propTypes = propTypes; +Popover.defaultProps = defaultProps; +Popover.displayName = 'Popover'; + +export default withWindowDimensions(Popover); From adc28c56ff39a289f31db3c695b228e943395a14 Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Tue, 20 Apr 2021 09:43:19 -0600 Subject: [PATCH 11/45] Fix emoji space styling --- src/styles/styles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/styles.js b/src/styles/styles.js index 0971df3e6d7f..5e2e27b16d40 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -831,6 +831,7 @@ const styles = { emojiText: { fontFamily: fontFamily.GTA_BOLD, fontSize: variables.iconSizeLarge, + textAlign: 'center', ...spacing.pv1, ...spacing.ph2, }, From e615b9b795c9c285cec21e59340131624d51e2f6 Mon Sep 17 00:00:00 2001 From: Rafida Date: Tue, 20 Apr 2021 22:24:00 +0300 Subject: [PATCH 12/45] Platform Specific Code to Library --- .../KeyboardAvoidingView/index.android.js | 23 +++++++++++++++++++ src/libs/KeyboardAvoidingView/index.ios.js | 23 +++++++++++++++++++ src/libs/KeyboardAvoidingView/index.js | 22 ++++++++++++++++++ src/pages/settings/AddSecondaryLoginPage.js | 9 +++----- 4 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 src/libs/KeyboardAvoidingView/index.android.js create mode 100644 src/libs/KeyboardAvoidingView/index.ios.js create mode 100644 src/libs/KeyboardAvoidingView/index.js diff --git a/src/libs/KeyboardAvoidingView/index.android.js b/src/libs/KeyboardAvoidingView/index.android.js new file mode 100644 index 000000000000..45915f6f0baa --- /dev/null +++ b/src/libs/KeyboardAvoidingView/index.android.js @@ -0,0 +1,23 @@ +import React from 'react'; +import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; +import styles from '../../styles/styles'; +import PropTypes from 'prop-types'; + +function KeyboardAvoidingView({children}) { + return ( + + {children} + + ); +} +KeyboardAvoidingView.propTypes = { + children: PropTypes.node, +}; +KeyboardAvoidingView.defaultProps = { + children: null, +}; +export default KeyboardAvoidingView; diff --git a/src/libs/KeyboardAvoidingView/index.ios.js b/src/libs/KeyboardAvoidingView/index.ios.js new file mode 100644 index 000000000000..0e6006ba4171 --- /dev/null +++ b/src/libs/KeyboardAvoidingView/index.ios.js @@ -0,0 +1,23 @@ +import React from 'react'; +import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; +import PropTypes from 'prop-types'; +import styles from '../../styles/styles'; + +function KeyboardAvoidingView({children}) { + return ( + + {children} + + ); +} + +KeyboardAvoidingView.propTypes = { + children: PropTypes.node, +}; +KeyboardAvoidingView.defaultProps = { + children: null, +}; +export default KeyboardAvoidingView; diff --git a/src/libs/KeyboardAvoidingView/index.js b/src/libs/KeyboardAvoidingView/index.js new file mode 100644 index 000000000000..31e4f946890f --- /dev/null +++ b/src/libs/KeyboardAvoidingView/index.js @@ -0,0 +1,22 @@ +import React from 'react'; +import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; +import styles from '../../styles/styles'; +import PropTypes from 'prop-types'; + +function KeyboardAvoidingView({children}) { + return ( + + {children} + + ); +} +KeyboardAvoidingView.propTypes = { + children: PropTypes.node, +}; +KeyboardAvoidingView.defaultProps = { + children: null, +}; +export default KeyboardAvoidingView; diff --git a/src/pages/settings/AddSecondaryLoginPage.js b/src/pages/settings/AddSecondaryLoginPage.js index 2ed6abf94525..d15cf42027a1 100644 --- a/src/pages/settings/AddSecondaryLoginPage.js +++ b/src/pages/settings/AddSecondaryLoginPage.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import Onyx, {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import { - View, TextInput, KeyboardAvoidingView, Platform, + View, TextInput, } from 'react-native'; import _ from 'underscore'; import Str from 'expensify-common/lib/str'; @@ -16,6 +16,7 @@ import ONYXKEYS from '../../ONYXKEYS'; import ButtonWithLoader from '../../components/ButtonWithLoader'; import ROUTES from '../../ROUTES'; import CONST from '../../CONST'; +import KeyboardAvoidingView from '../../libs/KeyboardAvoidingView'; const propTypes = { /* Onyx Props */ @@ -98,11 +99,7 @@ class AddSecondaryLoginPage extends Component { render() { return ( - + Date: Tue, 20 Apr 2021 22:28:04 +0300 Subject: [PATCH 13/45] lint fix --- .../KeyboardAvoidingView/index.android.js | 2 +- src/libs/KeyboardAvoidingView/index.js | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/libs/KeyboardAvoidingView/index.android.js b/src/libs/KeyboardAvoidingView/index.android.js index 45915f6f0baa..5c502891cb75 100644 --- a/src/libs/KeyboardAvoidingView/index.android.js +++ b/src/libs/KeyboardAvoidingView/index.android.js @@ -1,7 +1,7 @@ import React from 'react'; import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; -import styles from '../../styles/styles'; import PropTypes from 'prop-types'; +import styles from '../../styles/styles'; function KeyboardAvoidingView({children}) { return ( diff --git a/src/libs/KeyboardAvoidingView/index.js b/src/libs/KeyboardAvoidingView/index.js index 31e4f946890f..5c502891cb75 100644 --- a/src/libs/KeyboardAvoidingView/index.js +++ b/src/libs/KeyboardAvoidingView/index.js @@ -1,22 +1,23 @@ import React from 'react'; import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; -import styles from '../../styles/styles'; import PropTypes from 'prop-types'; +import styles from '../../styles/styles'; function KeyboardAvoidingView({children}) { - return ( - - {children} - - ); + return ( + + {children} + + ); } KeyboardAvoidingView.propTypes = { - children: PropTypes.node, + children: PropTypes.node, }; KeyboardAvoidingView.defaultProps = { - children: null, + children: null, }; export default KeyboardAvoidingView; From ac274864ae2b3f5c3e06f6634892ea25d93fd8f6 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Wed, 21 Apr 2021 01:51:00 +0000 Subject: [PATCH 14/45] Update version to 1.0.27-3 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 6bbab5c893b7..06e2b722a19d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002702 - versionName "1.0.27-2" + versionCode 1001002703 + versionName "1.0.27-3" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index 4c6ecd54d202..e355cf477651 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.27.2 + 1.0.27.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 76dabd87c495..e558edd47377 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.27.2 + 1.0.27.3 diff --git a/package-lock.json b/package-lock.json index 3940880006aa..2f6346f8e307 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.27-2", + "version": "1.0.27-3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1ddb2728c104..ab6dd81f19c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.27-2", + "version": "1.0.27-3", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 42c755a0c4a90687a47606854afee389e55118d7 Mon Sep 17 00:00:00 2001 From: maftalion Date: Wed, 21 Apr 2021 09:25:09 -0700 Subject: [PATCH 15/45] remove route, fix proptype --- src/ROUTES.js | 6 ++---- src/pages/iou/IOUModal.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index db64ae62bb9c..36d5f2117a51 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -21,10 +21,8 @@ export default { REPORT, REPORT_WITH_ID: 'r/:reportID', getReportRoute: reportID => `r/${reportID}`, - IOU_REQUEST: 'iou/request/:reportID', - getIouRequestRoute: reportID => `iou/request/${reportID}`, - IOU_BILL: 'iou/split/:reportID', - getIouSplitRoute: reportID => `iou/split/${reportID}`, + IOU_REQUEST: 'iou/request', + IOU_BILL: 'iou/split', SEARCH: 'search', SIGNIN: 'signin', SET_PASSWORD_WITH_VALIDATE_CODE: 'setpassword/:accountID/:validateCode', diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js index 35ddac83f2ef..269074eac1c6 100644 --- a/src/pages/iou/IOUModal.js +++ b/src/pages/iou/IOUModal.js @@ -38,7 +38,7 @@ const propTypes = { }).isRequired, // Personal details of all the users - personalDetails: PropTypes.objectOf({ + personalDetails: PropTypes.shape({ // Primary login of participant login: PropTypes.string, From 87081808f610369e048fe2f200d837305ac3ba36 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 07:00:21 -1000 Subject: [PATCH 16/45] Add something about solving problems --- CONTRIBUTING.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cce5c9b9742..14358a84c414 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,40 +19,47 @@ If you are hired for an Upwork job and have any job-specific questions, please a If you've found a vulnerability, please email security@expensify.com with the subject `Vulnerability Report` instead of creating an issue. ## Payment for Contributions -We hire and pay external contributors via Upwork.com. If you'd like to be paid for contributing, please create an Upwork account and apply for a job in the [Upwork issue list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). Payment for your contributions will be made no less than 7 days after the pull request is merged to allow for regression testing. We hire one contributor for each Upwork job. New Expensify.cash contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. If you have not received payment after 8 days of the PR being deployed to production, please email contributors@expensify.com referencing the GH issue and your GH handle. +We hire and pay external contributors via Upwork.com. If you'd like to be paid for contributing, please create an Upwork account and apply for a job in the [Upwork issue list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). Payment for your contributions will be made no less than 7 days after the pull request is merged to allow for regression testing. We hire one contributor for each Upwork job. New Expensify.cash contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. If you have not received payment after 8 days of the PR being deployed to production, please email contributors@expensify.com referencing the GH issue and your GH handle. ## Finding Expensify.cash Jobs -There are two ways you can find an Expensify.cash job that you can contribute to: +There are two ways you can find an Expensify.cash job that you can contribute to: #### Finding a job that Expensify posted -This is the most common scenario for contributors. The Expensify team posts Expensify.cash jobs to the Upwork job list [here](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). Each job in Upwork has a corresponding GitHub issue, which will include instructions to follow. +This is the most common scenario for contributors. The Expensify team posts Expensify.cash jobs to the Upwork job list [here](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). Each job in Upwork has a corresponding GitHub issue, which will include instructions to follow. #### Proposing a job that Expensify hasn’t posted In this scenario, it’s possible that you found a bug or enhancement that we haven’t posted to the [Upwork job list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2) or [Github repository](https://github.com/Expensify/Expensify.cash/issues?q=is%3Aissue). This is an opportunity to propose a job, and (optionally) a solution. If it's a valid job proposal, we will compensate you for the solution and give an additional bonus of $150 for proactively proposing the job. In this case, please take the following steps: - 1. Check to ensure an issue does not already exist in the Expensify.cash Issue list or Upwork job list. Please use your best judgement to search for similar titles and issue descriptions. - 2. If your bug or enhancement matches an existing issue, please feel free to comment on that GitHub issue with your findings if you think it’ll help solve a problem. - 3. If there is no existing issue or Upwork job, create a new GitHub issue in the Expensify.cash repo. - 4. Make sure to fill out all the required information fields in the issue template. - 5. Optional: If you would like to solve the bug or enhancement that you are proposing, please add a comment on your issue with a solution proposal. + 1. Check to ensure an issue does not already exist in the Expensify.cash Issue list or Upwork job list. Please use your best judgement to search for similar titles and issue descriptions. + 2. If your bug or enhancement matches an existing issue, please feel free to comment on that GitHub issue with your findings if you think it’ll help solve a problem. + 3. If there is no existing issue or Upwork job, create a new GitHub issue in the Expensify.cash repo. + 4. Make sure to fill out all the required information fields in the issue template. + 5. Optional: If you would like to solve the bug or enhancement that you are proposing, please add a comment on your issue with a solution proposal. 6. Pause on this step until a member of the Expensify team responds on your issue with next steps. +#### Solving Problems + +Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with difficult to measure results. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example: + +**Problem:** The app start up time has regressed because we introduced "Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. +**Solution:** Start up time will decrease by 1042ms if we prevent the re-rendering of this component. + ## Working on an Expensify.cash Jobs *Reminder: For technical guidance please refer to the [README](https://github.com/Expensify/Expensify.cash/blob/main/README.md)*. #### Express interest for the job on Upwork.com -1. If you are interested in working on a job posted in Upwork, click **Submit a Proposal** in Upwork to express your interest to the Expensify team. +1. If you are interested in working on a job posted in Upwork, click **Submit a Proposal** in Upwork to express your interest to the Expensify team. #### Make sure you can reproduce the problem -2. Use your test account(s) to reproduce the problem by following the steps in the GitHub issue. +2. Use your test account(s) to reproduce the problem by following the steps in the GitHub issue. 3. If you cannot reproduce the problem, pause on this step and add a comment to the issue explaining where you are stuck. -#### Propose a solution for the job +#### Propose a solution for the job 4. After you reproduce the issue, make a proposal for your solution and post it as a comment in the corresponding GitHub issue (linked in the Upwork job). Your solution proposal should include a brief technical explanation of the changes you will make. -5. Pause at this step until Expensify provides feedback on your proposal (do not begin coding or creating a pull request yet). -6. If your solution proposal is accepted, Expensify will hire you on Upwork and assign the GitHub issue to you. +5. Pause at this step until Expensify provides feedback on your proposal (do not begin coding or creating a pull request yet). +6. If your solution proposal is accepted, Expensify will hire you on Upwork and assign the GitHub issue to you. #### Begin coding your solution in a pull request 7. When you are ready to start, fork the repository and create a new branch. @@ -79,8 +86,8 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha 13. Please never force push when a PR review has already started (because this messes with the PR review history) 14. Upon submission of a PR, please include a numbered list of explicit testing steps for each platform (Web, Desktop, iOS, and Android) to confirm the fix works as expected and there are no regressions. -#### Timeline expectations and asking for help along the way -- If you have made a change to your pull request and are ready for another review, leave a comment that says "Updated" on the pull request itself. +#### Timeline expectations and asking for help along the way +- If you have made a change to your pull request and are ready for another review, leave a comment that says "Updated" on the pull request itself. - Please keep the conversation in GitHub, and do not ping individual reviewers in Slack or Upwork to get their attention. - Pull Request reviews can sometimes take a few days. If your pull request has not been addressed after four days please let us know via the #expensify-open-source Slack channel. From 57bc1041647c9c8cc3d30c0540c248ca21870c9f Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Wed, 21 Apr 2021 10:09:26 -0700 Subject: [PATCH 17/45] Include app version in deploy comment --- .github/actions/markPullRequestsAsDeployed/action.yml | 3 +++ .../markPullRequestsAsDeployed/markPullRequestsAsDeployed.js | 3 ++- .github/workflows/platformDeploy.yml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/markPullRequestsAsDeployed/action.yml b/.github/actions/markPullRequestsAsDeployed/action.yml index 42c9a6604aba..cb23977e2306 100644 --- a/.github/actions/markPullRequestsAsDeployed/action.yml +++ b/.github/actions/markPullRequestsAsDeployed/action.yml @@ -8,6 +8,9 @@ inputs: description: "Check if deploying to production" required: false default: "false" + VERSION: + description: "The app version in which the pull requests were deployed" + required: true GITHUB_TOKEN: description: "Github token for authentication" required: true diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 3449a4341088..8eb6f7a911ab 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -6,6 +6,7 @@ const prList = JSON.parse(core.getInput('PR_LIST', {required: true})); const isProd = JSON.parse( core.getInput('IS_PRODUCTION_DEPLOY', {required: true}), ); +const version = JSON.parse(core.getInput('VERSION', {required: true})); const token = core.getInput('GITHUB_TOKEN', {required: true}); const octokit = github.getOctokit(token); const githubUtils = new GithubUtils(octokit); @@ -38,7 +39,7 @@ const webResult = getDeployTableMessage(core.getInput('WEB', {required: true})); const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` + `/actions/runs/${process.env.GITHUB_RUN_ID}`; -let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} 🚀`; +let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} in v${version}🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 0255fc0302a2..9de2a03c9e9e 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -292,6 +292,7 @@ jobs: with: PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }} IS_PRODUCTION_DEPLOY: ${{ env.SHOULD_DEPLOY_PRODUCTION == 'true' }} + VERSION: ${{ env.version }} GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} ANDROID: ${{ needs.android.result }} DESKTOP: ${{ needs.desktop.result }} From 560ae699a1099269aa61e107bb7f294c93b601a3 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Wed, 21 Apr 2021 10:12:54 -0700 Subject: [PATCH 18/45] Rebuild GH actions --- .github/actions/markPullRequestsAsDeployed/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index eb24d24e90c5..cdfbfe639177 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -16,6 +16,7 @@ const prList = JSON.parse(core.getInput('PR_LIST', {required: true})); const isProd = JSON.parse( core.getInput('IS_PRODUCTION_DEPLOY', {required: true}), ); +const version = JSON.parse(core.getInput('VERSION', {required: true})); const token = core.getInput('GITHUB_TOKEN', {required: true}); const octokit = github.getOctokit(token); const githubUtils = new GithubUtils(octokit); @@ -48,7 +49,7 @@ const webResult = getDeployTableMessage(core.getInput('WEB', {required: true})); const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` + `/actions/runs/${process.env.GITHUB_RUN_ID}`; -let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} 🚀`; +let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} in v${version}🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; From 4587441839c71be4f4a1488f956b27ae7d51ec69 Mon Sep 17 00:00:00 2001 From: Rory Abraham <47436092+roryabraham@users.noreply.github.com> Date: Wed, 21 Apr 2021 10:18:50 -0700 Subject: [PATCH 19/45] Update .github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js Co-authored-by: Andrew Gable --- .../markPullRequestsAsDeployed/markPullRequestsAsDeployed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 8eb6f7a911ab..0a58fce4606f 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -39,7 +39,7 @@ const webResult = getDeployTableMessage(core.getInput('WEB', {required: true})); const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` + `/actions/runs/${process.env.GITHUB_RUN_ID}`; -let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} in v${version}🚀`; +let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} in version: ${version}🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; From e9a278bcc7845009de4c655a9dfe36fa6511272a Mon Sep 17 00:00:00 2001 From: Rory Abraham <47436092+roryabraham@users.noreply.github.com> Date: Wed, 21 Apr 2021 10:19:12 -0700 Subject: [PATCH 20/45] Update .github/workflows/platformDeploy.yml Co-authored-by: Andrew Gable --- .github/workflows/platformDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 9de2a03c9e9e..b67ddc074db6 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -292,7 +292,7 @@ jobs: with: PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }} IS_PRODUCTION_DEPLOY: ${{ env.SHOULD_DEPLOY_PRODUCTION == 'true' }} - VERSION: ${{ env.version }} + VERSION: ${{ env.VERSION }} GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} ANDROID: ${{ needs.android.result }} DESKTOP: ${{ needs.desktop.result }} From 9c2fb202a439646342e922612263724385bc0ed1 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Wed, 21 Apr 2021 17:20:59 +0000 Subject: [PATCH 21/45] Update version to 1.0.28-0 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 4 ++-- ios/ExpensifyCashTests/Info.plist | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 06e2b722a19d..26a8e782725d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002703 - versionName "1.0.27-3" + versionCode 1001002800 + versionName "1.0.28-0" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index e355cf477651..bac4857e3d08 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.27 + 1.0.28 CFBundleSignature ???? CFBundleURLTypes @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.27.3 + 1.0.28.0 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index e558edd47377..b3d09644d00f 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0.27 + 1.0.28 CFBundleSignature ???? CFBundleVersion - 1.0.27.3 + 1.0.28.0 diff --git a/package-lock.json b/package-lock.json index 2f6346f8e307..6894a4dd8fec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.27-3", + "version": "1.0.28-0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ab6dd81f19c2..5d5f8842bed2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.27-3", + "version": "1.0.28-0", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 88f7e44476efeb719eee3bb184ff371fa95b71c7 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 07:28:26 -1000 Subject: [PATCH 22/45] add perceptibly --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14358a84c414..caf4aa28a541 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,8 +42,8 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with difficult to measure results. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example: -**Problem:** The app start up time has regressed because we introduced "Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. -**Solution:** Start up time will decrease by 1042ms if we prevent the re-rendering of this component. +**Problem:** The app start up time has regressed because we introduced "Feature X" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. +**Solution:** Start up time will perceptibly decrease by 1042ms if we prevent the re-rendering of this component. ## Working on an Expensify.cash Jobs *Reminder: For technical guidance please refer to the [README](https://github.com/Expensify/Expensify.cash/blob/main/README.md)*. From 2aa7fe98d452668fd912cb5568959dce87dec3b0 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 07:30:55 -1000 Subject: [PATCH 23/45] edit --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index caf4aa28a541..5556c0db0fe0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,8 +42,8 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with difficult to measure results. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example: -**Problem:** The app start up time has regressed because we introduced "Feature X" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. -**Solution:** Start up time will perceptibly decrease by 1042ms if we prevent the re-rendering of this component. +**Problem:** The app start up time has regressed because we introduced "New Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. +**Solution:** Start up time will perceptibly decrease by 1042ms if we prevent the unnecessary re-renders of this component. ## Working on an Expensify.cash Jobs *Reminder: For technical guidance please refer to the [README](https://github.com/Expensify/Expensify.cash/blob/main/README.md)*. From 449a591a35f9b3c48889aad85ce368ee42c0c661 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 07:31:37 -1000 Subject: [PATCH 24/45] add a new line --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5556c0db0fe0..1e78a4ac9b49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,6 +43,7 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with difficult to measure results. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example: **Problem:** The app start up time has regressed because we introduced "New Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. + **Solution:** Start up time will perceptibly decrease by 1042ms if we prevent the unnecessary re-renders of this component. ## Working on an Expensify.cash Jobs From 0ca375e89bf7d87941fa6e2fe9d84a08f0500d3f Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 07:45:05 -1000 Subject: [PATCH 25/45] store currently viewed report on each mount --- src/pages/home/ReportScreen.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index ddbb72a9e659..75a88cd4684b 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -31,6 +31,7 @@ class ReportScreen extends React.Component { componentDidMount() { this.prepareTransition(); + this.storeCurrentlyViewedReport(); } componentDidUpdate(prevProps) { From f1d999485bfb6b27cc40ba83ebc08d0db17a51f8 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 08:05:50 -1000 Subject: [PATCH 26/45] make suggested improvments --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e78a4ac9b49..2b321ffc176d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha #### Solving Problems -Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with difficult to measure results. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example: +Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with results that are difficult to measure. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example of a good problem/solution: **Problem:** The app start up time has regressed because we introduced "New Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. From deb367ff47a0cee26618cba44cd0a675c392cf58 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Wed, 21 Apr 2021 11:39:21 -0700 Subject: [PATCH 27/45] Fix CreateMenu and mobile safari attachment picker --- src/components/CreateMenu.js | 117 ------------------ src/components/CreateMenu/BaseCreateMenu.js | 10 +- .../CreateMenu/CreateMenuPropTypes.js | 29 ++++- src/components/CreateMenu/index.js | 6 +- src/components/CreateMenu/index.native.js | 5 +- 5 files changed, 42 insertions(+), 125 deletions(-) delete mode 100644 src/components/CreateMenu.js diff --git a/src/components/CreateMenu.js b/src/components/CreateMenu.js deleted file mode 100644 index 2e0931bb8c6e..000000000000 --- a/src/components/CreateMenu.js +++ /dev/null @@ -1,117 +0,0 @@ -import React, {PureComponent} from 'react'; -import {View} from 'react-native'; -import PropTypes from 'prop-types'; -import Popover from './Popover'; -import styles from '../styles/styles'; -import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; -import MenuItem from './MenuItem'; - -const propTypes = { - // Callback to fire on request to modal close - onClose: PropTypes.func.isRequired, - - // State that determines whether to display the create menu or not - isVisible: PropTypes.bool.isRequired, - - // Callback to fire when a CreateMenu item is selected - onItemSelected: PropTypes.func.isRequired, - - // Menu items to be rendered on the list - menuItems: PropTypes.arrayOf( - PropTypes.shape({ - icon: PropTypes.func.isRequired, - text: PropTypes.string.isRequired, - onSelected: PropTypes.func.isRequired, - }), - ).isRequired, - - // The anchor position of the CreateMenu popover - anchorPosition: PropTypes.shape({ - top: PropTypes.number, - right: PropTypes.number, - bottom: PropTypes.number, - left: PropTypes.number, - }).isRequired, - - // A react-native-animatable animation definition for the modal display animation. - animationIn: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.object, - ]), - - // A react-native-animatable animation definition for the modal hide animation. - animationOut: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.object, - ]), - - ...windowDimensionsPropTypes, -}; - -const defaultProps = { - animationIn: 'fadeIn', - animationOut: 'fadeOut', -}; - -class CreateMenu extends PureComponent { - constructor(props) { - super(props); - this.onModalHide = () => {}; - this.setOnModalHide = this.setOnModalHide.bind(this); - this.resetOnModalHide = this.resetOnModalHide.bind(this); - } - - /** - * Sets a new function to execute when the modal hides - * @param {Function} callback The function to be called on modal hide - */ - setOnModalHide(callback) { - this.onModalHide = callback; - } - - /** - * After the modal hides, reset the onModalHide to an empty function - */ - resetOnModalHide() { - this.onModalHide = () => {}; - } - - render() { - return ( - { - this.onModalHide(); - this.resetOnModalHide(); - }} - animationIn={this.props.animationIn} - animationOut={this.props.animationOut} - > - - {this.props.menuItems.map(({ - icon, - text, - onSelected = () => {}, - }) => ( - { - this.props.onItemSelected(); - this.setOnModalHide(onSelected); - }} - /> - ))} - - - ); - } -} - -CreateMenu.propTypes = propTypes; -CreateMenu.defaultProps = defaultProps; - -export default withWindowDimensions(CreateMenu); diff --git a/src/components/CreateMenu/BaseCreateMenu.js b/src/components/CreateMenu/BaseCreateMenu.js index 667158645ae5..73d1e5234b89 100644 --- a/src/components/CreateMenu/BaseCreateMenu.js +++ b/src/components/CreateMenu/BaseCreateMenu.js @@ -5,7 +5,10 @@ import Popover from '../Popover'; import styles from '../../styles/styles'; import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions'; import MenuItem from '../MenuItem'; -import createMenuPropTypes from './CreateMenuPropTypes'; +import { + propTypes as createMenuPropTypes, + defaultProps as defaultCreateMenuPropTypes, +} from './CreateMenuPropTypes'; const propTypes = { // Callback fired when the menu is completely closed @@ -16,6 +19,7 @@ const propTypes = { }; const defaultProps = { + ...defaultCreateMenuPropTypes, onMenuHide: () => {}, }; @@ -23,10 +27,12 @@ class BaseCreateMenu extends PureComponent { render() { return ( {this.props.menuItems.map(item => ( diff --git a/src/components/CreateMenu/CreateMenuPropTypes.js b/src/components/CreateMenu/CreateMenuPropTypes.js index b8fd59c2493c..89d1b9f7da3a 100644 --- a/src/components/CreateMenu/CreateMenuPropTypes.js +++ b/src/components/CreateMenu/CreateMenuPropTypes.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; -const createMenuPropTypes = { +const propTypes = { // Callback method fired when the user requests to close the modal onClose: PropTypes.func.isRequired, @@ -23,6 +23,31 @@ const createMenuPropTypes = { onSelected: PropTypes.func.isRequired, }), ).isRequired, + + // The anchor position of the CreateMenu popover + anchorPosition: PropTypes.shape({ + top: PropTypes.number, + right: PropTypes.number, + bottom: PropTypes.number, + left: PropTypes.number, + }).isRequired, + + // A react-native-animatable animation definition for the modal display animation. + animationIn: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.object, + ]), + + // A react-native-animatable animation definition for the modal hide animation. + animationOut: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.object, + ]), +}; + +const defaultProps = { + animationIn: 'fadeIn', + animationOut: 'fadeOut', }; -export default createMenuPropTypes; +export {propTypes, defaultProps}; diff --git a/src/components/CreateMenu/index.js b/src/components/CreateMenu/index.js index 2bc0c03226c8..39338cb49554 100644 --- a/src/components/CreateMenu/index.js +++ b/src/components/CreateMenu/index.js @@ -1,6 +1,6 @@ import React from 'react'; import BaseCreateMenu from './BaseCreateMenu'; -import createMenuPropTypes from './CreateMenuPropTypes'; +import {propTypes, defaultProps} from './CreateMenuPropTypes'; /** * The web implementation of the menu needs to trigger actions before the popup closes @@ -23,6 +23,8 @@ const CreateMenu = (props) => { return ; }; -CreateMenu.propTypes = createMenuPropTypes; +CreateMenu.propTypes = propTypes; +CreateMenu.defaultProps = defaultProps; +CreateMenu.displayName = 'CreateMenu'; export default CreateMenu; diff --git a/src/components/CreateMenu/index.native.js b/src/components/CreateMenu/index.native.js index 043da3819853..6d20a86850f8 100644 --- a/src/components/CreateMenu/index.native.js +++ b/src/components/CreateMenu/index.native.js @@ -1,6 +1,6 @@ import React, {Component} from 'react'; import BaseCreateMenu from './BaseCreateMenu'; -import createMenuPropTypes from './CreateMenuPropTypes'; +import {propTypes, defaultProps} from './CreateMenuPropTypes'; /** * The mobile native implementation of the CreateMenu needs to trigger actions after the popup closes @@ -35,6 +35,7 @@ class CreateMenu extends Component { } } -CreateMenu.propTypes = createMenuPropTypes; +CreateMenu.propTypes = propTypes; +CreateMenu.defaultProps = defaultProps; export default CreateMenu; From 9da412c18992cf3201c0e25be0850245b0b33a19 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Wed, 21 Apr 2021 12:08:27 -0700 Subject: [PATCH 28/45] Rebuild GH actions --- .github/actions/markPullRequestsAsDeployed/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index cdfbfe639177..1179df1fd254 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -49,7 +49,7 @@ const webResult = getDeployTableMessage(core.getInput('WEB', {required: true})); const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` + `/actions/runs/${process.env.GITHUB_RUN_ID}`; -let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} in v${version}🚀`; +let message = `🚀 [Deployed](${workflowURL}) to ${isProd ? 'production' : 'staging'} in version: ${version}🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; From e2cc3c8bc4753aa4d641c665fa0ebeff4285b58d Mon Sep 17 00:00:00 2001 From: Rafida Date: Wed, 21 Apr 2021 22:42:55 +0300 Subject: [PATCH 29/45] review changes --- .../KeyboardAvoidingView/index.android.js | 23 ------------------- src/libs/KeyboardAvoidingView/index.ios.js | 19 ++++++++++----- src/libs/KeyboardAvoidingView/index.js | 20 +++++++++++----- src/pages/settings/AddSecondaryLoginPage.js | 4 +--- 4 files changed, 28 insertions(+), 38 deletions(-) delete mode 100644 src/libs/KeyboardAvoidingView/index.android.js diff --git a/src/libs/KeyboardAvoidingView/index.android.js b/src/libs/KeyboardAvoidingView/index.android.js deleted file mode 100644 index 5c502891cb75..000000000000 --- a/src/libs/KeyboardAvoidingView/index.android.js +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; -import PropTypes from 'prop-types'; -import styles from '../../styles/styles'; - -function KeyboardAvoidingView({children}) { - return ( - - {children} - - ); -} -KeyboardAvoidingView.propTypes = { - children: PropTypes.node, -}; -KeyboardAvoidingView.defaultProps = { - children: null, -}; -export default KeyboardAvoidingView; diff --git a/src/libs/KeyboardAvoidingView/index.ios.js b/src/libs/KeyboardAvoidingView/index.ios.js index 0e6006ba4171..fc08d4f52fa6 100644 --- a/src/libs/KeyboardAvoidingView/index.ios.js +++ b/src/libs/KeyboardAvoidingView/index.ios.js @@ -1,8 +1,19 @@ +/** + * This is a KeyboardAvoidingView only enabled for ios && disabled for all other platforms + * @param {Node} + */ import React from 'react'; import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; import PropTypes from 'prop-types'; import styles from '../../styles/styles'; +const propTypes = { + children: PropTypes.node, +}; +const defaultProps = { + children: null, +}; + function KeyboardAvoidingView({children}) { return ( ); } -KeyboardAvoidingView.propTypes = { - children: PropTypes.node, -}; -KeyboardAvoidingView.defaultProps = { - children: null, -}; + +KeyboardAvoidingView.propTypes = propTypes; +KeyboardAvoidingView.defaultProps = defaultProps; export default KeyboardAvoidingView; diff --git a/src/pages/settings/AddSecondaryLoginPage.js b/src/pages/settings/AddSecondaryLoginPage.js index d15cf42027a1..4527654d97f3 100644 --- a/src/pages/settings/AddSecondaryLoginPage.js +++ b/src/pages/settings/AddSecondaryLoginPage.js @@ -1,9 +1,7 @@ import React, {Component} from 'react'; import Onyx, {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; -import { - View, TextInput, -} from 'react-native'; +import {View, TextInput} from 'react-native'; import _ from 'underscore'; import Str from 'expensify-common/lib/str'; import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; From 68eae30859f2d844477d1752fa1525b90831db24 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Wed, 21 Apr 2021 14:26:21 -0700 Subject: [PATCH 30/45] Rename step in deployBlocker.yml --- .github/workflows/deployBlocker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployBlocker.yml b/.github/workflows/deployBlocker.yml index 458768f8a34d..9c0cd20c89bd 100644 --- a/.github/workflows/deployBlocker.yml +++ b/.github/workflows/deployBlocker.yml @@ -21,7 +21,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} NEW_DEPLOY_BLOCKERS: ${{ github.event.issue.html_url }} - - name: Update StagingDeployCash with issue + - name: Update StagingDeployCash with pull request uses: Expensify/Expensify.cash/.github/actions/createOrUpdateStagingDeploy@main if: ${{ github.event_name == 'pull_request' }} with: From 47757d077469ef8cc681a4a9e3d8c06ad5c751c9 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 11:45:47 -1000 Subject: [PATCH 31/45] Move comment into a note section --- CONTRIBUTING.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b321ffc176d..d394f9d48cc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,15 +38,13 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha 5. Optional: If you would like to solve the bug or enhancement that you are proposing, please add a comment on your issue with a solution proposal. 6. Pause on this step until a member of the Expensify team responds on your issue with next steps. -#### Solving Problems +>**Note:** Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with results that are difficult to measure. We also prefer to identify and solve problems at their root. Given that, please ensure all proposed jobs fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example of a good problem/solution: +> +>**Problem:** The app start up time has regressed because we introduced "New Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. +> +>**Solution:** Start up time will perceptibly decrease by 1042ms if we prevent the unnecessary re-renders of this component. -Our problem solving approach at Expensify is to focus on high value problems and avoid small optimizations with results that are difficult to measure. We also prefer to identify and solve problems at their root. Given that, please ensure all proposals fix a specific problem in a measurable way with evidence so they are easy to evaluate. Here's an example of a good problem/solution: - -**Problem:** The app start up time has regressed because we introduced "New Feature" in PR #12345 and is now 1042ms slower because `SomeComponent` is re-rendering 42 times. - -**Solution:** Start up time will perceptibly decrease by 1042ms if we prevent the unnecessary re-renders of this component. - -## Working on an Expensify.cash Jobs +## Working on Expensify.cash Jobs *Reminder: For technical guidance please refer to the [README](https://github.com/Expensify/Expensify.cash/blob/main/README.md)*. #### Express interest for the job on Upwork.com From 3fbaab08d7a85c37a70ed8a0cf5ce62d154b3ba8 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 15:41:50 -1000 Subject: [PATCH 32/45] consolidate clickaway handlers --- .../Navigation/AppNavigator/AuthScreens.js | 1 + .../ClickAwayHandler.js | 12 +++++++---- .../AppNavigator/ClickAwayHandler/index.js | 3 --- .../ClickAwayHandler/index.native.js | 20 ------------------- .../AppNavigator/ModalStackNavigators.js | 1 + 5 files changed, 10 insertions(+), 27 deletions(-) rename src/libs/Navigation/AppNavigator/{ClickAwayHandler => }/ClickAwayHandler.js (55%) delete mode 100644 src/libs/Navigation/AppNavigator/ClickAwayHandler/index.js delete mode 100644 src/libs/Navigation/AppNavigator/ClickAwayHandler/index.native.js diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.js b/src/libs/Navigation/AppNavigator/AuthScreens.js index 2269e198f9e5..d0c8b1988b9a 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -179,6 +179,7 @@ class AuthScreens extends React.Component { cardStyleInterpolator: modalCardStyleInterpolator, animationEnabled: true, gestureDirection: 'horizontal', + cardOverlayEnabled: true, // This is a custom prop we are passing to custom navigator so that we will know to add a Pressable overlay // when displaying a modal. This allows us to dismiss by clicking outside on web / large screens. diff --git a/src/libs/Navigation/AppNavigator/ClickAwayHandler/ClickAwayHandler.js b/src/libs/Navigation/AppNavigator/ClickAwayHandler.js similarity index 55% rename from src/libs/Navigation/AppNavigator/ClickAwayHandler/ClickAwayHandler.js rename to src/libs/Navigation/AppNavigator/ClickAwayHandler.js index 9e1daab19fa7..b7ffc5525709 100644 --- a/src/libs/Navigation/AppNavigator/ClickAwayHandler/ClickAwayHandler.js +++ b/src/libs/Navigation/AppNavigator/ClickAwayHandler.js @@ -1,15 +1,19 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Pressable} from 'react-native'; -import Navigation from '../../Navigation'; -import styles from '../../../../styles/styles'; +import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; +import Navigation from '../Navigation'; +import styles from '../../../styles/styles'; const propTypes = { + // Whether a modal is currently being displayed isDisplayingModal: PropTypes.bool.isRequired, + + ...windowDimensionsPropTypes, }; const ClickAwayHandler = (props) => { - if (!props.isDisplayingModal) { + if (!props.isDisplayingModal || props.isSmallScreenWidth) { return null; } @@ -23,4 +27,4 @@ const ClickAwayHandler = (props) => { ClickAwayHandler.propTypes = propTypes; ClickAwayHandler.displayName = 'ClickAwayHandler'; -export default ClickAwayHandler; +export default withWindowDimensions(ClickAwayHandler); diff --git a/src/libs/Navigation/AppNavigator/ClickAwayHandler/index.js b/src/libs/Navigation/AppNavigator/ClickAwayHandler/index.js deleted file mode 100644 index 837018cba06c..000000000000 --- a/src/libs/Navigation/AppNavigator/ClickAwayHandler/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import ClickAwayHandler from './ClickAwayHandler'; - -export default ClickAwayHandler; diff --git a/src/libs/Navigation/AppNavigator/ClickAwayHandler/index.native.js b/src/libs/Navigation/AppNavigator/ClickAwayHandler/index.native.js deleted file mode 100644 index 565061dadb5f..000000000000 --- a/src/libs/Navigation/AppNavigator/ClickAwayHandler/index.native.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import withWindowDimensions, {windowDimensionsPropTypes} from '../../../../components/withWindowDimensions'; -import ClickAwayHandler from './ClickAwayHandler'; - -const propTypes = { - ...windowDimensionsPropTypes, -}; - -const ClickAwayHandlerWithWindowDimensions = (props) => { - if (props.isSmallScreenWidth) { - return null; - } - - // eslint-disable-next-line react/jsx-props-no-spreading - return ; -}; - -ClickAwayHandlerWithWindowDimensions.propTypes = propTypes; -ClickAwayHandlerWithWindowDimensions.displayName = 'ClickAwayHandlerWithWindowDimensions'; -export default withWindowDimensions(ClickAwayHandlerWithWindowDimensions); diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index e5a39c19549f..ae0c19a805c4 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -29,6 +29,7 @@ const IOUBillModalStack = createStackNavigator(); const defaultSubRouteOptions = { cardStyle: styles.navigationScreenCardStyle, headerShown: false, + cardOverlayEnabled: true, }; const IOUBillStackNavigator = () => ( From 3de669799a817d9655e158bc2b568ddf43377258 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 15:47:47 -1000 Subject: [PATCH 33/45] Fix regression to tapping on multiple participants --- src/ROUTES.js | 4 ++-- src/libs/Url.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index 36d5f2117a51..7db85c957b98 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -1,5 +1,5 @@ import lodashGet from 'lodash/get'; -import {addTrailingForwardSlash} from './libs/Url'; +import {wrapWithForwardSlash} from './libs/Url'; /** * This is a file containing constants for all of the routes we want to be able to go to @@ -41,7 +41,7 @@ export default { * @returns {Object} */ parseReportRouteParams: (route) => { - if (!route.startsWith(addTrailingForwardSlash(REPORT))) { + if (!route.startsWith(wrapWithForwardSlash(REPORT))) { return {}; } diff --git a/src/libs/Url.js b/src/libs/Url.js index e166c127a83f..8ad99e37c36b 100644 --- a/src/libs/Url.js +++ b/src/libs/Url.js @@ -10,7 +10,23 @@ function addTrailingForwardSlash(url) { return url; } +/** + * Add / to the end of any URL if not present + * @param {String} url + * @returns {String} + */ +function wrapWithForwardSlash(url) { + const newUrl = addTrailingForwardSlash(url); + if (newUrl.startsWith('/')) { + return newUrl; + } + + return `/${newUrl}`; +} + + export { // eslint-disable-next-line import/prefer-default-export addTrailingForwardSlash, + wrapWithForwardSlash, }; From c0e8e8271c2290bba099af17112638af023371cb Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 15:56:13 -1000 Subject: [PATCH 34/45] remove unneeded code. fix copy/paste comment; --- src/libs/Navigation/AppNavigator/ModalStackNavigators.js | 1 - src/libs/Url.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index ae0c19a805c4..e5a39c19549f 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -29,7 +29,6 @@ const IOUBillModalStack = createStackNavigator(); const defaultSubRouteOptions = { cardStyle: styles.navigationScreenCardStyle, headerShown: false, - cardOverlayEnabled: true, }; const IOUBillStackNavigator = () => ( diff --git a/src/libs/Url.js b/src/libs/Url.js index 8ad99e37c36b..004e9c5fe173 100644 --- a/src/libs/Url.js +++ b/src/libs/Url.js @@ -11,7 +11,7 @@ function addTrailingForwardSlash(url) { } /** - * Add / to the end of any URL if not present + * Add / to the beginning and end of any URL if not present * @param {String} url * @returns {String} */ From 1ba38af01ab17e831af924f89df74a6d3023c3b2 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 21 Apr 2021 16:21:01 -1000 Subject: [PATCH 35/45] add an ipad-sm to make it easier to test things --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5d5f8842bed2..b8779eeeae7a 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "android": "react-native run-android", "ios": "react-native run-ios", "ipad": "react-native run-ios --simulator=\"iPad Pro (12.9-inch) (4th generation)\"", + "ipad-sm": "react-native run-ios --simulator=\"iPad Pro (9.7-inch)\"", "desktop": "node desktop/start.js", "start": "react-native start", "web": "node web/proxy.js & webpack-dev-server --open --config config/webpack/webpack.dev.js", From 5b57ce3e761d1419a5398420eb8d098374ffa028 Mon Sep 17 00:00:00 2001 From: Rajat Parashar Date: Thu, 22 Apr 2021 08:03:16 +0530 Subject: [PATCH 36/45] fix: remove unnecessary manual focus --- src/components/TextInputFocusable/index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/TextInputFocusable/index.js b/src/components/TextInputFocusable/index.js index 01c038bdb8b5..89b5928742f9 100644 --- a/src/components/TextInputFocusable/index.js +++ b/src/components/TextInputFocusable/index.js @@ -92,7 +92,6 @@ class TextInputFocusable extends React.Component { } componentDidMount() { - this.focusInput(); this.updateNumberOfLines(); // This callback prop is used by the parent component using the constructor to @@ -212,10 +211,6 @@ class TextInputFocusable extends React.Component { }); } - focusInput() { - this.textInput.focus(); - } - render() { const propStyles = StyleSheet.flatten(this.props.style); propStyles.outline = 'none'; From 13b18a369ad05ab92756d58cbfeb20c907d597f6 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Thu, 22 Apr 2021 12:27:19 +0800 Subject: [PATCH 37/45] Fix spelling --- src/libs/Navigation/AppNavigator/ModalStackNavigators.js | 2 +- src/libs/Navigation/linkingConfig.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index e5a39c19549f..37f5445f8a98 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -163,7 +163,7 @@ const SettingsModalStackNavigator = () => ( component={SettingsProfilePage} /> Date: Thu, 22 Apr 2021 16:35:24 +0000 Subject: [PATCH 38/45] Update version to 1.0.28-1 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 26a8e782725d..7db6e7de4e04 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002800 - versionName "1.0.28-0" + versionCode 1001002801 + versionName "1.0.28-1" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index bac4857e3d08..fa93c2550f4e 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.28.0 + 1.0.28.1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index b3d09644d00f..16bec377152d 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.28.0 + 1.0.28.1 diff --git a/package-lock.json b/package-lock.json index 6894a4dd8fec..6a1b745cc780 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.28-0", + "version": "1.0.28-1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5d5f8842bed2..690313a00d7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.28-0", + "version": "1.0.28-1", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From a87e33b61871c7f691d235a5ee71b83a4e5c77d5 Mon Sep 17 00:00:00 2001 From: maftalion Date: Thu, 22 Apr 2021 10:05:17 -0700 Subject: [PATCH 39/45] add new routes --- src/ROUTES.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index 36d5f2117a51..db64ae62bb9c 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -21,8 +21,10 @@ export default { REPORT, REPORT_WITH_ID: 'r/:reportID', getReportRoute: reportID => `r/${reportID}`, - IOU_REQUEST: 'iou/request', - IOU_BILL: 'iou/split', + IOU_REQUEST: 'iou/request/:reportID', + getIouRequestRoute: reportID => `iou/request/${reportID}`, + IOU_BILL: 'iou/split/:reportID', + getIouSplitRoute: reportID => `iou/split/${reportID}`, SEARCH: 'search', SIGNIN: 'signin', SET_PASSWORD_WITH_VALIDATE_CODE: 'setpassword/:accountID/:validateCode', From d96ed386060978a0e9ed6eea9d79620f988722b2 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Thu, 22 Apr 2021 17:35:48 +0000 Subject: [PATCH 40/45] Update version to 1.0.28-2 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 7db6e7de4e04..162ee7bd6c33 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002801 - versionName "1.0.28-1" + versionCode 1001002802 + versionName "1.0.28-2" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index fa93c2550f4e..c6276c8d2b0d 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.28.1 + 1.0.28.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 16bec377152d..a85906b756f9 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.28.1 + 1.0.28.2 diff --git a/package-lock.json b/package-lock.json index 6a1b745cc780..017c347c1bc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.28-1", + "version": "1.0.28-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 690313a00d7c..0eb9310bd87c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.28-1", + "version": "1.0.28-2", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 3be846709a03a782899ae9db959fce84e40780eb Mon Sep 17 00:00:00 2001 From: OSBotify Date: Thu, 22 Apr 2021 19:23:36 +0000 Subject: [PATCH 41/45] Update version to 1.0.29-0 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 4 ++-- ios/ExpensifyCashTests/Info.plist | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 162ee7bd6c33..8186f8fab3c1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002802 - versionName "1.0.28-2" + versionCode 1001002900 + versionName "1.0.29-0" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index c6276c8d2b0d..c0de2421c956 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0.28 + 1.0.29 CFBundleSignature ???? CFBundleURLTypes @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.28.2 + 1.0.29.0 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index a85906b756f9..c85654d85ceb 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0.28 + 1.0.29 CFBundleSignature ???? CFBundleVersion - 1.0.28.2 + 1.0.29.0 diff --git a/package-lock.json b/package-lock.json index 017c347c1bc7..2758b35e014e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.28-2", + "version": "1.0.29-0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0eb9310bd87c..5231208fc7c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.28-2", + "version": "1.0.29-0", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 08e9af638510ab7d6bd4ea6bdcddf2d577340273 Mon Sep 17 00:00:00 2001 From: maftalion Date: Thu, 22 Apr 2021 17:19:53 -0700 Subject: [PATCH 42/45] change modal stack animation --- src/libs/Navigation/AppNavigator/ModalStackNavigators.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index e5a39c19549f..bf8e06bb2f62 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -1,5 +1,5 @@ import React from 'react'; -import {createStackNavigator} from '@react-navigation/stack'; +import {createStackNavigator, CardStyleInterpolators} from '@react-navigation/stack'; import styles from '../../../styles/styles'; import ROUTES from '../../../ROUTES'; import NewChatPage from '../../../pages/NewChatPage'; @@ -29,6 +29,7 @@ const IOUBillModalStack = createStackNavigator(); const defaultSubRouteOptions = { cardStyle: styles.navigationScreenCardStyle, headerShown: false, + cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS, }; const IOUBillStackNavigator = () => ( From 05fbe4409d6ff901d42f7937d94bedd95a655179 Mon Sep 17 00:00:00 2001 From: Rory Abraham <47436092+roryabraham@users.noreply.github.com> Date: Thu, 22 Apr 2021 17:57:37 -0700 Subject: [PATCH 43/45] Revert "fix inline code blocks for native platforms" --- src/components/AnchorForCommentsOnly/index.js | 7 +- .../InlineCodeBlock/index.android.js | 19 ++++ .../{index.native.js => index.ios.js} | 19 ++-- src/components/InlineCodeBlock/wrappedText.js | 87 ------------------- src/styles/styles.js | 40 +-------- src/styles/variables.js | 1 - 6 files changed, 34 insertions(+), 139 deletions(-) create mode 100644 src/components/InlineCodeBlock/index.android.js rename src/components/InlineCodeBlock/{index.native.js => index.ios.js} (50%) delete mode 100644 src/components/InlineCodeBlock/wrappedText.js diff --git a/src/components/AnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/index.js index 3edda2184b8c..6e70e859cf96 100644 --- a/src/components/AnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import {StyleSheet, Text} from 'react-native'; +import {StyleSheet} from 'react-native'; import anchorForCommentsOnlyPropTypes from './anchorForCommentsOnlyPropTypes'; const defaultProps = { @@ -18,9 +18,8 @@ const AnchorForCommentsOnly = ({ style, ...props }) => ( - {children} - + ); AnchorForCommentsOnly.propTypes = anchorForCommentsOnlyPropTypes; diff --git a/src/components/InlineCodeBlock/index.android.js b/src/components/InlineCodeBlock/index.android.js new file mode 100644 index 000000000000..d68ca0031b84 --- /dev/null +++ b/src/components/InlineCodeBlock/index.android.js @@ -0,0 +1,19 @@ +/* eslint-disable react/jsx-props-no-spreading */ +import React from 'react'; +import {View} from 'react-native'; +import inlineCodeBlockPropTypes from './inlineCodeBlockPropTypes'; + +const InlineCodeBlock = ({ + TDefaultRenderer, + defaultRendererProps, + boxModelStyle, + textStyle, +}) => ( + + + +); + +InlineCodeBlock.propTypes = inlineCodeBlockPropTypes; +InlineCodeBlock.displayName = 'InlineCodeBlock'; +export default InlineCodeBlock; diff --git a/src/components/InlineCodeBlock/index.native.js b/src/components/InlineCodeBlock/index.ios.js similarity index 50% rename from src/components/InlineCodeBlock/index.native.js rename to src/components/InlineCodeBlock/index.ios.js index 0178ecf18289..163bf4a201d8 100644 --- a/src/components/InlineCodeBlock/index.native.js +++ b/src/components/InlineCodeBlock/index.ios.js @@ -1,26 +1,23 @@ +/* eslint-disable react/jsx-props-no-spreading */ import React from 'react'; +import {View} from 'react-native'; import styles from '../../styles/styles'; -import WrappedText from './wrappedText'; import inlineCodeBlockPropTypes from './inlineCodeBlockPropTypes'; const InlineCodeBlock = ({ + TDefaultRenderer, defaultRendererProps, boxModelStyle, textStyle, }) => ( - - {defaultRendererProps.tnode.data} - + + ); InlineCodeBlock.propTypes = inlineCodeBlockPropTypes; diff --git a/src/components/InlineCodeBlock/wrappedText.js b/src/components/InlineCodeBlock/wrappedText.js deleted file mode 100644 index 930ebb4c99bc..000000000000 --- a/src/components/InlineCodeBlock/wrappedText.js +++ /dev/null @@ -1,87 +0,0 @@ -import React, {Fragment} from 'react'; -import {Text, View} from 'react-native'; -import PropTypes from 'prop-types'; -import styles from '../../styles/styles'; - -/** - * Breaks the text into matrix - * for eg: My Name is Rajat - * [ - * [My,'',Name,'','',is,'',Rajat], - * ] - * - * @param {String} text - * @returns {Array} - */ -function getTextMatrix(text) { - return text.split('\n').map(row => row.split(/(\s)/)); -} - -const propTypes = { - // Required text - children: PropTypes.string.isRequired, - - // Style to be applied to Text - // eslint-disable-next-line react/forbid-prop-types - textStyle: PropTypes.object, - - // Style for each word(Token) in the text, - // remember that token also includes the following spaces before next word break - // eslint-disable-next-line react/forbid-prop-types - wordStyle: PropTypes.object, - - // Style for first word - // eslint-disable-next-line react/forbid-prop-types - firstWordStyle: PropTypes.object, - - // Style for last word - // eslint-disable-next-line react/forbid-prop-types - lastWordStyle: PropTypes.object, -}; - -const defaultProps = { - textStyle: {}, - wordStyle: {}, - firstWordStyle: {}, - lastWordStyle: {}, -}; - -const WrappedText = (props) => { - const textMatrix = getTextMatrix(props.children); - return ( - <> - {textMatrix.map((rowText, rowIndex) => ( - - {rowText.map((colText, colIndex) => ( - - // Outer View is important to vertically center the Text - - - {colText} - - - ))} - - ))} - - ); -}; - -WrappedText.propTypes = propTypes; -WrappedText.defaultProps = defaultProps; -WrappedText.displayName = 'WrappedText'; - -export default WrappedText; diff --git a/src/styles/styles.js b/src/styles/styles.js index fcdfd665b348..3f3fa97e6782 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1312,39 +1312,6 @@ const styles = { scrollbarWidth: 'none', }, - codeWordWrapper: { - height: 10, - }, - - codeWordStyle: { - borderLeftWidth: 0, - borderRightWidth: 0, - borderTopLeftRadius: 0, - borderBottomLeftRadius: 0, - borderTopRightRadius: 0, - borderBottomRightRadius: 0, - flexBasis: 'auto', - paddingLeft: 0, - paddingRight: 0, - justifyContent: 'center', - marginVertical: -2, - top: -1, - }, - - codeFirstWordStyle: { - borderLeftWidth: 1, - borderTopLeftRadius: 4, - borderBottomLeftRadius: 4, - paddingLeft: 5, - }, - - codeLastWordStyle: { - borderRightWidth: 1, - borderTopRightRadius: 4, - borderBottomRightRadius: 4, - paddingRight: 5, - }, - fullScreenLoading: { backgroundColor: themeColors.componentBG, opacity: 0.8, @@ -1365,6 +1332,8 @@ const styles = { const baseCodeTagStyles = { borderWidth: 1, borderRadius: 5, + marginTop: 4, + marginBottom: 4, borderColor: themeColors.border, backgroundColor: themeColors.textBackground, }; @@ -1421,9 +1390,9 @@ const webViewStyles = { ...baseCodeTagStyles, paddingLeft: 5, paddingRight: 5, + paddingBottom: 2, + alignSelf: 'flex-start', fontFamily: fontFamily.MONOSPACE, - lineHeight: 18, - fontSize: 13, }, img: { @@ -1436,7 +1405,6 @@ const webViewStyles = { baseFontStyle: { color: themeColors.text, fontSize: variables.fontSizeNormal, - lineHeight: variables.fontSizeNormalHeight, fontFamily: fontFamily.GTA, }, }; diff --git a/src/styles/variables.js b/src/styles/variables.js index 4ca7fef91365..9b70c5d5b072 100644 --- a/src/styles/variables.js +++ b/src/styles/variables.js @@ -12,7 +12,6 @@ export default { fontSizeExtraSmall: 9, fontSizeLabel: 13, fontSizeNormal: 15, - fontSizeNormalHeight: 20, fontSizeLarge: 17, fontSizeh1: 19, iconSizeExtraSmall: 12, From e7486d4afaaf3a72812e85621b071bae0ed00e1f Mon Sep 17 00:00:00 2001 From: OSBotify Date: Fri, 23 Apr 2021 14:48:57 +0000 Subject: [PATCH 44/45] Update version to 1.0.29-1 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 8186f8fab3c1..26022a1cfc37 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002900 - versionName "1.0.29-0" + versionCode 1001002901 + versionName "1.0.29-1" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index c0de2421c956..df389b55676c 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.29.0 + 1.0.29.1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index c85654d85ceb..febfe7e70bd1 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.29.0 + 1.0.29.1 diff --git a/package-lock.json b/package-lock.json index 2758b35e014e..9be4b161c85b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.29-0", + "version": "1.0.29-1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f366f52a0040..3624bbd61f06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.29-0", + "version": "1.0.29-1", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 414f3db0a312aeae6dcc65d476eb6baf6418b67e Mon Sep 17 00:00:00 2001 From: OSBotify Date: Fri, 23 Apr 2021 15:54:50 +0000 Subject: [PATCH 45/45] Update version to 1.0.29-2 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 26022a1cfc37..11a8a698a0d1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001002901 - versionName "1.0.29-1" + versionCode 1001002902 + versionName "1.0.29-2" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index df389b55676c..1ea80d858899 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.29.1 + 1.0.29.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index febfe7e70bd1..1ce40fc06954 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.29.1 + 1.0.29.2 diff --git a/package-lock.json b/package-lock.json index 9be4b161c85b..d8217472ae5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.29-1", + "version": "1.0.29-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3624bbd61f06..285cd985b976 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.29-1", + "version": "1.0.29-2", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",