Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonals committed May 30, 2023
2 parents 9cab709 + 8afd126 commit f125e5d
Show file tree
Hide file tree
Showing 55 changed files with 1,166 additions and 795 deletions.
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# The GH actions don't seem to compile and verify themselves well when Prettier is applied to them
.github/actions/javascript/**/index.js
.well-known
desktop/dist/**/*.js
dist/**/*.js
assets/animations
android
ios
vendor
package.json
package-lock.json
*.html
*.yml
*.yaml
*.css
*.scss
*.md
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001031903
versionName "1.3.19-3"
versionCode 1001032002
versionName "1.3.20-2"
}

splits {
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.19</string>
<string>1.3.20</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.19.3</string>
<string>1.3.20.2</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.19</string>
<string>1.3.20</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.19.3</string>
<string>1.3.20.2</string>
</dict>
</plist>
18 changes: 9 additions & 9 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.19-3",
"version": "1.3.20-2",
"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 Expand Up @@ -32,7 +32,7 @@
"lint": "eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/eslint",
"lint-watch": "npx eslint-watch --watch --changed",
"shellcheck": "./scripts/shellCheck.sh",
"prettier": "prettier --write \"**/*.js\"",
"prettier": "prettier --write .",
"prettier-watch": "onchange \"**/*.js\" -- prettier --write --ignore-unknown {{changed}}",
"print-version": "echo $npm_package_version",
"storybook": "start-storybook -p 6006",
Expand Down Expand Up @@ -113,7 +113,7 @@
"react-native-key-command": "^1.0.1",
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.41",
"react-native-onyx": "1.0.43",
"react-native-pdf": "^6.6.2",
"react-native-performance": "^4.0.0",
"react-native-permissions": "^3.0.1",
Expand Down
24 changes: 17 additions & 7 deletions src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const propTypes = {
roomName: PropTypes.string,
}),

/** Whether the app is waiting for the server's response to determine if a room is public */
isCheckingPublicRoom: PropTypes.bool,

...withLocalizePropTypes,
};

Expand All @@ -81,6 +84,7 @@ const defaultProps = {
updateAvailable: false,
isSidebarLoaded: false,
screenShareRequest: null,
isCheckingPublicRoom: true,
};

function Expensify(props) {
Expand All @@ -90,7 +94,7 @@ function Expensify(props) {
const [isSplashHidden, setIsSplashHidden] = useState(false);

const isAuthenticated = useMemo(() => Boolean(lodashGet(props.session, 'authToken', null)), [props.session]);
const shouldInit = isNavigationReady && (!isAuthenticated || props.isSidebarLoaded);
const shouldInit = isNavigationReady && (!isAuthenticated || props.isSidebarLoaded) && !props.isCheckingPublicRoom;
const shouldHideSplash = shouldInit && !isSplashHidden;

const initializeClient = () => {
Expand Down Expand Up @@ -151,10 +155,10 @@ function Expensify(props) {
appStateChangeListener.current = AppState.addEventListener('change', initializeClient);

// If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report
Linking.getInitialURL().then((url) => Report.openReportFromDeepLink(url));
Linking.getInitialURL().then((url) => Report.openReportFromDeepLink(url, isAuthenticated));

// Open chat report from a deep link (only mobile native)
Linking.addEventListener('url', (state) => Report.openReportFromDeepLink(state.url));
Linking.addEventListener('url', (state) => Report.openReportFromDeepLink(state.url, isAuthenticated));

return () => {
if (!appStateChangeListener.current) {
Expand Down Expand Up @@ -193,10 +197,12 @@ function Expensify(props) {
</>
)}

<NavigationRoot
onReady={setNavigationReady}
authenticated={isAuthenticated}
/>
{!props.isCheckingPublicRoom && (
<NavigationRoot
onReady={setNavigationReady}
authenticated={isAuthenticated}
/>
)}

{shouldHideSplash && <SplashScreenHider onHide={onSplashHide} />}
</DeeplinkWrapper>
Expand All @@ -208,6 +214,10 @@ Expensify.defaultProps = defaultProps;
export default compose(
withLocalize,
withOnyx({
isCheckingPublicRoom: {
key: ONYXKEYS.IS_CHECKING_PUBLIC_ROOM,
initWithStoredValues: false,
},
session: {
key: ONYXKEYS.SESSION,
},
Expand Down
6 changes: 6 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ export default {
// Whether the auth token is valid
IS_TOKEN_VALID: 'isTokenValid',

// Whether we're checking if the room is public or not
IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom',

// A map of the user's security group IDs they belong to in specific domains
MY_DOMAIN_SECURITY_GROUPS: 'myDomainSecurityGroups',

// Report ID of the last report the user viewed as anonymous user
LAST_OPENED_PUBLIC_ROOM_ID: 'lastOpenedPublicRoomID',
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const BaseAnchorForCommentsOnly = (props) => {
inline
onSecondaryInteraction={(event) => {
ReportActionContextMenu.showContextMenu(
Str.isValidEmailMarkdown(props.displayName) ? ContextMenuActions.CONTEXT_MENU_TYPES.EMAIL : ContextMenuActions.CONTEXT_MENU_TYPES.LINK,
Str.isValidEmailMarkdown(props.href.replace(/mailto:/i, '')) ? ContextMenuActions.CONTEXT_MENU_TYPES.EMAIL : ContextMenuActions.CONTEXT_MENU_TYPES.LINK,
event,
props.href,
lodashGet(linkRef, 'current'),
Expand Down
58 changes: 58 additions & 0 deletions src/components/AnonymousReportFooter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';
import {View, Text} from 'react-native';
import Button from './Button';
import AvatarWithDisplayName from './AvatarWithDisplayName';
import ExpensifyWordmark from './ExpensifyWordmark';
import compose from '../libs/compose';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import reportPropTypes from '../pages/reportPropTypes';
import CONST from '../CONST';
import styles from '../styles/styles';
import * as Session from '../libs/actions/Session';

const propTypes = {
/** The report currently being looked at */
report: reportPropTypes,

...windowDimensionsPropTypes,
...withLocalizePropTypes,
};

const defaultProps = {
report: {},
};

const AnonymousReportFooter = (props) => (
<View style={styles.anonymousRoomFooter}>
<View style={[styles.flexRow]}>
<AvatarWithDisplayName
report={props.report}
size={CONST.AVATAR_SIZE.MEDIUM}
isAnonymous
/>
</View>
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<View style={styles.mr4}>
<View style={[props.isSmallScreenWidth ? styles.alignItemsStart : styles.alignItemsEnd]}>
<ExpensifyWordmark style={styles.anonymousRoomFooterLogo} />
</View>
<Text style={[styles.textNormal, styles.textWhite]}>{props.translate('anonymousReportFooter.logoTagline')}</Text>
</View>
<View style={styles.anonymousRoomFooterSignInButton}>
<Button
medium
success
text={props.translate('common.signIn')}
onPress={() => Session.signOutAndRedirectToSignIn()}
/>
</View>
</View>
</View>
);

AnonymousReportFooter.propTypes = propTypes;
AnonymousReportFooter.defaultProps = defaultProps;
AnonymousReportFooter.displayName = 'AnonymousReportFooter';

export default compose(withWindowDimensions, withLocalize)(AnonymousReportFooter);
72 changes: 37 additions & 35 deletions src/components/AttachmentPicker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, {useRef} from 'react';
import CONST from '../../CONST';
import {propTypes, defaultProps} from './attachmentPickerPropTypes';
import * as FileUtils from '../../libs/fileDownload/FileUtils';
Expand All @@ -22,44 +22,46 @@ function getAcceptableFileTypes(type) {
* a callback. This is the web/mWeb/desktop version since
* on a Browser we must append a hidden input to the DOM
* and listen to onChange event.
* @param {propTypes} props
* @returns {JSX.Element}
*/
class AttachmentPicker extends React.Component {
render() {
return (
<>
<input
hidden
type="file"
ref={(el) => (this.fileInput = el)}
onChange={(e) => {
let file = e.target.files[0];
function AttachmentPicker(props) {
const fileInput = useRef();
const onPicked = useRef();
return (
<>
<input
hidden
type="file"
ref={fileInput}
onChange={(e) => {
let file = e.target.files[0];

if (file) {
const cleanName = FileUtils.cleanFileName(file.name);
if (file.name !== cleanName) {
file = new File([file], cleanName);
}
file.uri = URL.createObjectURL(file);
this.onPicked(file);
if (file) {
const cleanName = FileUtils.cleanFileName(file.name);
if (file.name !== cleanName) {
file = new File([file], cleanName);
}
file.uri = URL.createObjectURL(file);
onPicked.current(file);
}

// Cleanup after selecting a file to start from a fresh state
this.fileInput.value = null;
}}
// We are stopping the event propagation because triggering the `click()` on the hidden input
// causes the event to unexpectedly bubble up to anything wrapping this component e.g. Pressable
onClick={(e) => e.stopPropagation()}
accept={getAcceptableFileTypes(this.props.type)}
/>
{this.props.children({
openPicker: ({onPicked}) => {
this.onPicked = onPicked;
this.fileInput.click();
},
})}
</>
);
}
// Cleanup after selecting a file to start from a fresh state
fileInput.current.value = null;
}}
// We are stopping the event propagation because triggering the `click()` on the hidden input
// causes the event to unexpectedly bubble up to anything wrapping this component e.g. Pressable
onClick={(e) => e.stopPropagation()}
accept={getAcceptableFileTypes(props.type)}
/>
{props.children({
openPicker: ({onPicked: newOnPicked}) => {
onPicked.current = newOnPicked;
fileInput.current.click();
},
})}
</>
);
}

AttachmentPicker.propTypes = propTypes;
Expand Down
Loading

0 comments on commit f125e5d

Please sign in to comment.