Skip to content

Commit

Permalink
Merge branch 'main' into revert-22717-chirag-thread-subscription-logic
Browse files Browse the repository at this point in the history
merge main
  • Loading branch information
srikarparsi committed Jul 18, 2023
2 parents 2a7fce3 + 8c952e1 commit e5d7527
Show file tree
Hide file tree
Showing 70 changed files with 1,320 additions and 1,189 deletions.
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 1001034103
versionName "1.3.41-3"
versionCode 1001034221
versionName "1.3.42-21"
}

splits {
Expand Down
278 changes: 153 additions & 125 deletions desktop/main.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ To create your event workspace in Expensify:
*Protip*: Your account manager can complete this step with you. Chat with them in #admins on new.expensify.com to coordinate!

To create a new chat room:
1. Go to new.expensify.com
1. Go to [new.expensify.com](https://new.expensify.com)
2. Go to “+” > New room
3. Name to room e.g. “#social”
4. Select the workspace created at step 1
Expand All @@ -60,7 +60,7 @@ For an easy-to-follow event, we recommend creating these chat rooms:
### Step 3: Add chat room QR codes to the applicable session slide deck

Gather QR codes:
1. Go to new.exensify.com
1. Go to [new.expensify.com](https://new.expensify.com)
2. Click into a room and click the room name or avatar in the top header
3. Go into Share Code
4. Download or screenshot the QR code image
Expand Down Expand Up @@ -111,4 +111,3 @@ Continue the connections by using Expensify Chat to keep your conference communi
## You’re all set!

Once you have completed the above steps you are ready to host your conference on Expensify Chat! Let your account manager know any questions you have over in your new.expensify.com #admins room and start driving activity in your Expensify Chat rooms. By step 4 you have the foundations in place so a great next step is to start training your speakers on how to use Expensify Chat for their sessions. Coordinate with your account manager to make sure everything goes smoothly!

4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.41</string>
<string>1.3.42</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.41.3</string>
<string>1.3.42.21</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.41</string>
<string>1.3.42</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.41.3</string>
<string>1.3.42.21</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.41-3",
"version": "1.3.42-21",
"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
10 changes: 9 additions & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const CONST = {
CLOSED: 'CLOSED',
CREATED: 'CREATED',
TASKEDITED: 'TASKEDITED',
TASKCANCELED: 'TASKCANCELED',
TASKCANCELLED: 'TASKCANCELLED',
IOU: 'IOU',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
Expand Down Expand Up @@ -744,6 +744,7 @@ const CONST = {
VALIDATE_TFA_CODE_FORM: 'ValidateTfaCodeForm',
RESEND_VALIDATION_FORM: 'ResendValidationForm',
UNLINK_LOGIN_FORM: 'UnlinkLoginForm',
RESEND_VALIDATE_CODE_FORM: 'ResendValidateCodeForm',
},
APP_STATE: {
ACTIVE: 'active',
Expand Down Expand Up @@ -2461,6 +2462,13 @@ const CONST = {
NUMBER_OF_TAPS: 4,
},

MENU_HELP_URLS: {
LEARN_MORE: 'https://www.expensify.com',
DOCUMENTATION: 'https://github.com/Expensify/App/blob/main/README.md',
COMMUNITY_DISCUSSIONS: 'https://expensify.slack.com/archives/C01GTK53T8Q',
SEARCH_ISSUES: 'https://github.com/Expensify/App/issues',
},

PAYPAL_SUPPORTED_CURRENCIES: [
'AUD',
'BRL',
Expand Down
3 changes: 0 additions & 3 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ export default {
// Is app in beta version
IS_BETA: 'isBeta',

// Whether the auth token is valid
IS_TOKEN_VALID: 'isTokenValid',

// The theme setting set by the user in preferences.
// This can be either "light", "dark" or "system"
PREFERRED_THEME: 'preferredTheme',
Expand Down
2 changes: 1 addition & 1 deletion src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default {
getReportWelcomeMessageRoute: (reportID) => `r/${reportID}/welcomeMessage`,
REPORT_SETTINGS_WRITE_CAPABILITY: 'r/:reportID/settings/who-can-post',
getReportSettingsWriteCapabilityRoute: (reportID) => `r/${reportID}/settings/who-can-post`,
TRANSITION_FROM_OLD_DOT: 'transition',
TRANSITION_BETWEEN_APPS: 'transition',
VALIDATE_LOGIN: 'v/:accountID/:validateCode',
GET_ASSISTANCE: 'get-assistance/:taskID',
getGetAssistanceRoute: (taskID) => `get-assistance/${taskID}`,
Expand Down
2 changes: 1 addition & 1 deletion src/SCREENS.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
REPORT: 'Report',
REPORT_ATTACHMENTS: 'ReportAttachments',
NOT_FOUND: 'not-found',
TRANSITION_FROM_OLD_DOT: 'TransitionFromOldDot',
TRANSITION_BETWEEN_APPS: 'TransitionBetweenApps',
SETTINGS: {
PREFERENCES: 'Settings_Preferences',
},
Expand Down
112 changes: 4 additions & 108 deletions src/components/AvatarWithIndicator.js
Original file line number Diff line number Diff line change
@@ -1,109 +1,30 @@
import _ from 'underscore';
import React from 'react';
import {StyleSheet, View} from 'react-native';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import Avatar from './Avatar';
import styles from '../styles/styles';
import Tooltip from './Tooltip';
import ONYXKEYS from '../ONYXKEYS';
import policyMemberPropType from '../pages/policyMemberPropType';
import bankAccountPropTypes from './bankAccountPropTypes';
import cardPropTypes from './cardPropTypes';
import userWalletPropTypes from '../pages/EnablePayments/userWalletPropTypes';
import {policyPropTypes} from '../pages/workspace/withPolicy';
import walletTermsPropTypes from '../pages/EnablePayments/walletTermsPropTypes';
import * as PolicyUtils from '../libs/PolicyUtils';
import * as PaymentMethods from '../libs/actions/PaymentMethods';
import * as ReimbursementAccountProps from '../pages/ReimbursementAccount/reimbursementAccountPropTypes';
import * as UserUtils from '../libs/UserUtils';
import themeColors from '../styles/themes/default';
import Indicator from './Indicator';

const propTypes = {
/** URL for the avatar */
source: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired,

/** To show a tooltip on hover */
tooltipText: PropTypes.string,

/* Onyx Props */

/** The employee list of all policies (coming from Onyx) */
allPolicyMembers: PropTypes.objectOf(PropTypes.objectOf(policyMemberPropType)),

/** All the user's policies (from Onyx via withFullPolicy) */
policies: PropTypes.objectOf(policyPropTypes.policy),

/** List of bank accounts */
bankAccountList: PropTypes.objectOf(bankAccountPropTypes),

/** List of cards */
cardList: PropTypes.objectOf(cardPropTypes),

/** The user's wallet (coming from Onyx) */
userWallet: userWalletPropTypes,

/** Bank account attached to free plan */
reimbursementAccount: ReimbursementAccountProps.reimbursementAccountPropTypes,

/** Information about the user accepting the terms for payments */
walletTerms: walletTermsPropTypes,

/** Login list for the user that is signed in */
loginList: PropTypes.shape({
/** Date login was validated, used to show info indicator status */
validatedDate: PropTypes.string,

/** Field-specific server side errors keyed by microtime */
errorFields: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),
}),
};

const defaultProps = {
tooltipText: '',
reimbursementAccount: {},
allPolicyMembers: {},
policies: {},
bankAccountList: {},
cardList: {},
userWallet: {},
walletTerms: {},
loginList: {},
};

function AvatarWithIndicator(props) {
// If a policy was just deleted from Onyx, then Onyx will pass a null value to the props, and
// those should be cleaned out before doing any error checking
const cleanPolicies = _.pick(props.policies, (policy) => policy);
const cleanAllPolicyMembers = _.pick(props.allPolicyMembers, (policyMembers) => policyMembers);

// All of the error & info-checking methods are put into an array. This is so that using _.some() will return
// early as soon as the first error / info condition is returned. This makes the checks very efficient since
// we only care if a single error / info condition exists anywhere.
const errorCheckingMethods = [
() => !_.isEmpty(props.userWallet.errors),
() => PaymentMethods.hasPaymentMethodError(props.bankAccountList, props.cardList),
() => _.some(cleanPolicies, PolicyUtils.hasPolicyError),
() => _.some(cleanPolicies, PolicyUtils.hasCustomUnitsError),
() => _.some(cleanAllPolicyMembers, PolicyUtils.hasPolicyMemberError),
() => !_.isEmpty(props.reimbursementAccount.errors),
() => UserUtils.hasLoginListError(props.loginList),

// Wallet term errors that are not caused by an IOU (we show the red brick indicator for those in the LHN instead)
() => !_.isEmpty(props.walletTerms.errors) && !props.walletTerms.chatReportID,
];
const infoCheckingMethods = [() => UserUtils.hasLoginListInfo(props.loginList)];
const shouldShowErrorIndicator = _.some(errorCheckingMethods, (errorCheckingMethod) => errorCheckingMethod());
const shouldShowInfoIndicator = !shouldShowErrorIndicator && _.some(infoCheckingMethods, (infoCheckingMethod) => infoCheckingMethod());

const indicatorColor = shouldShowErrorIndicator ? themeColors.danger : themeColors.success;
const indicatorStyles = [styles.alignItemsCenter, styles.justifyContentCenter, styles.statusIndicator(indicatorColor)];

return (
<Tooltip text={props.tooltipText}>
<View style={[styles.sidebarAvatar]}>
<Avatar source={UserUtils.getSmallSizeAvatar(props.source)} />
{(shouldShowErrorIndicator || shouldShowInfoIndicator) && <View style={StyleSheet.flatten(indicatorStyles)} />}
<Indicator />
</View>
</Tooltip>
);
Expand All @@ -113,29 +34,4 @@ AvatarWithIndicator.defaultProps = defaultProps;
AvatarWithIndicator.propTypes = propTypes;
AvatarWithIndicator.displayName = 'AvatarWithIndicator';

export default withOnyx({
allPolicyMembers: {
key: ONYXKEYS.COLLECTION.POLICY_MEMBERS,
},
policies: {
key: ONYXKEYS.COLLECTION.POLICY,
},
bankAccountList: {
key: ONYXKEYS.BANK_ACCOUNT_LIST,
},
reimbursementAccount: {
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
},
cardList: {
key: ONYXKEYS.CARD_LIST,
},
userWallet: {
key: ONYXKEYS.USER_WALLET,
},
walletTerms: {
key: ONYXKEYS.WALLET_TERMS,
},
loginList: {
key: ONYXKEYS.LOGIN_LIST,
},
})(AvatarWithIndicator);
export default AvatarWithIndicator;
Loading

0 comments on commit e5d7527

Please sign in to comment.