Skip to content

Commit

Permalink
resolve merge conflicts with main
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperhuangg committed Oct 17, 2023
2 parents 0f8ddc3 + 0cfbec0 commit fa42b03
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 71 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001038502
versionName "1.3.85-2"
versionCode 1001038503
versionName "1.3.85-3"
}

flavorDimensions "default"
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.85.2</string>
<string>1.3.85.3</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.85.2</string>
<string>1.3.85.3</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.85-2",
"version": "1.3.85-3",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
2 changes: 1 addition & 1 deletion src/components/DistanceRequest/DistanceRequestFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function DistanceRequestFooter({waypoints, transaction, mapboxAccessToken, navig
pitchEnabled={false}
initialState={{
zoom: CONST.MAPBOX.DEFAULT_ZOOM,
location: CONST.MAPBOX.DEFAULT_COORDINATE,
location: lodashGet(waypointMarkers, [0, 'coordinate'], CONST.MAPBOX.DEFAULT_COORDINATE),
}}
directionCoordinates={lodashGet(transaction, 'routes.route0.geometry.coordinates', [])}
style={styles.mapView}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// eslint-disable-next-line no-restricted-imports
import {useWindowDimensions} from 'react-native';
import variables from '../../styles/variables';
import WindowDimensions from './types';

/**
* A convenience wrapper around React Native's useWindowDimensions hook that also provides booleans for our breakpoints.
* @returns {Object}
*/
export default function () {
export default function (): WindowDimensions {
const {width: windowWidth, height: windowHeight} = useWindowDimensions();
const isExtraSmallScreenHeight = windowHeight <= variables.extraSmallMobileResponsiveHeightBreakpoint;
const isSmallScreenWidth = true;
const isMediumScreenWidth = false;
const isLargeScreenWidth = false;

return {
windowWidth,
windowHeight,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// eslint-disable-next-line no-restricted-imports
import {Dimensions, useWindowDimensions} from 'react-native';
import variables from '../../styles/variables';
import WindowDimensions from './types';

/**
* A convenience wrapper around React Native's useWindowDimensions hook that also provides booleans for our breakpoints.
* @returns {Object}
*/
export default function () {
export default function (): WindowDimensions {
const {width: windowWidth, height: windowHeight} = useWindowDimensions();
// When the soft keyboard opens on mWeb, the window height changes. Use static screen height instead to get real screenHeight.
const screenHeight = Dimensions.get('screen').height;
const isExtraSmallScreenHeight = screenHeight <= variables.extraSmallMobileResponsiveHeightBreakpoint;
const isSmallScreenWidth = windowWidth <= variables.mobileResponsiveWidthBreakpoint;
const isMediumScreenWidth = windowWidth > variables.mobileResponsiveWidthBreakpoint && windowWidth <= variables.tabletResponsiveWidthBreakpoint;
const isLargeScreenWidth = windowWidth > variables.tabletResponsiveWidthBreakpoint;

return {
windowWidth,
windowHeight,
Expand Down
10 changes: 10 additions & 0 deletions src/hooks/useWindowDimensions/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type WindowDimensions = {
windowWidth: number;
windowHeight: number;
isExtraSmallScreenHeight: boolean;
isSmallScreenWidth: boolean;
isMediumScreenWidth: boolean;
isLargeScreenWidth: boolean;
};

export default WindowDimensions;
2 changes: 1 addition & 1 deletion src/libs/actions/DemoActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function runDemoByURL(url = '') {
});
} else {
// No demo is being run, so clear out demo info
Onyx.set(ONYXKEYS.DEMO_INFO, null);
Onyx.set(ONYXKEYS.DEMO_INFO, {});
}
}

Expand Down
23 changes: 2 additions & 21 deletions src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useEffect, useMemo} from 'react';
import React, {useMemo} from 'react';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
Expand All @@ -17,7 +17,6 @@ import * as OptionsListUtils from '../libs/OptionsListUtils';
import * as ReportUtils from '../libs/ReportUtils';
import * as PolicyUtils from '../libs/PolicyUtils';
import * as Report from '../libs/actions/Report';
import * as Policy from '../libs/actions/Policy';
import participantPropTypes from '../components/participantPropTypes';
import * as Expensicons from '../components/Icon/Expensicons';
import ROUTES from '../ROUTES';
Expand Down Expand Up @@ -80,12 +79,7 @@ function ReportDetailsPage(props) {
const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]);
const parentNavigationSubtitleData = ReportUtils.getParentNavigationSubtitle(props.report);
const canLeaveRoom = useMemo(() => ReportUtils.canLeaveRoom(props.report, !_.isEmpty(policy)), [policy, props.report]);
const workspaceMembers = useMemo(() => _.keys(PolicyUtils.getMemberAccountIDsForWorkspace(props.policyMembers, props.personalDetails)), [props.policyMembers, props.personalDetails]);

const participants = useMemo(
() => (props.report.policyID && !ReportUtils.isAdminRoom(props.report) ? workspaceMembers : ReportUtils.getParticipantsIDs(props.report)),
[props.report, workspaceMembers],
);
const participants = useMemo(() => ReportUtils.getParticipantsIDs(props.report), [props.report]);

const isGroupDMChat = useMemo(() => ReportUtils.isDM(props.report) && participants.length > 1, [props.report, participants.length]);

Expand Down Expand Up @@ -197,16 +191,6 @@ function ReportDetailsPage(props) {
{chatRoomSubtitle}
</Text>
) : null;
const getWorkspaceMembers = useCallback(() => {
Policy.openWorkspaceMembersPage(props.report.policyID, workspaceMembers);
}, [props.report.policyID, workspaceMembers]);

useEffect(() => {
if (!props.report.policyID || ReportUtils.isAdminRoom(props.report)) {
return;
}
getWorkspaceMembers();
}, [getWorkspaceMembers, props.report]);

return (
<ScreenWrapper testID={ReportDetailsPage.displayName}>
Expand Down Expand Up @@ -297,8 +281,5 @@ export default compose(
betas: {
key: ONYXKEYS.BETAS,
},
policyMembers: {
key: (props) => `${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${props.report.policyID}`,
},
}),
)(ReportDetailsPage);
38 changes: 1 addition & 37 deletions src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {View} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import lodashGet from 'lodash/get';
import lodashUniqBy from 'lodash/uniqBy';
import styles from '../styles/styles';
import ONYXKEYS from '../ONYXKEYS';
import HeaderWithBackButton from '../components/HeaderWithBackButton';
Expand Down Expand Up @@ -84,39 +83,7 @@ const getAllParticipants = (report, personalDetails, translate) =>
.value();

function ReportParticipantsPage(props) {
const getMemberOptions = () => {
let result = [];
_.each(props.policyMembers, (__, accountID) => {
const details = lodashGet(props.personalDetails, accountID, {displayName: props.personalDetails.displayName || props.translate('common.hidden'), avatar: ''});

result.push({
keyForList: accountID,
accountID: Number(accountID),
text: details.displayName,
displayName: details.displayName,
alternateText: details.login,
icons: [
{
id: accountID,
source: UserUtils.getAvatar(details.avatar, accountID),
name: details.login,
type: CONST.ICON_TYPE_AVATAR,
},
],
});
});

result = _.sortBy(lodashUniqBy(result, 'alternateText'), (value) => (value.text || '').toLowerCase());

return result;
};

const data =
props.report.policyID && props.policyMembers && !ReportUtils.isAdminRoom(props.report)
? getMemberOptions()
: getAllParticipants(props.report, props.personalDetails, props.translate);

const participants = _.map(data, (participant) => ({
const participants = _.map(getAllParticipants(props.report, props.personalDetails, props.translate), (participant) => ({
...participant,
isDisabled: ReportUtils.isOptimisticPersonalDetail(participant.accountID),
}));
Expand Down Expand Up @@ -183,8 +150,5 @@ export default compose(
personalDetails: {
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
},
policyMembers: {
key: (props) => `${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${props.report.policyID}`,
},
}),
)(ReportParticipantsPage);

0 comments on commit fa42b03

Please sign in to comment.