-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continue personalDetails
-> personalDetailsList
migration
#20328
Changes from all commits
b94183a
7a95a3a
410cb62
7f0a66d
54ecbcb
b9d30ef
e5bc39b
d547dab
588cb20
ef3d955
e8b7f86
5c395d0
5f5789b
8261127
f18dd6c
cf0b245
9d30f05
3ca4e0d
fde3aff
156deff
fe62c42
9a70430
f376593
1d585b7
c74be2c
0348e22
dda26cb
5bd48f8
60db587
eae14eb
97bf498
7e77b01
f141c28
637cce2
fd201cd
73cdf02
60b1463
3d577f5
43d050a
083c8a8
5204d4c
b5c20b7
2eaabb8
40aaaad
d580e30
7f981d8
75e0030
13de4af
a1509a8
10176c4
c3497ff
651309a
f141959
6dd4a1a
bde9682
fc38685
8d9c4eb
e55550d
bac0a50
ed057cc
1e97491
dde8e89
f3745b6
b419252
fe3d585
3754886
7fe728c
69939e8
79cca49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -860,22 +860,43 @@ const CONST = { | |
LHN_SKELETON_VIEW_ITEM_HEIGHT: 64, | ||
EXPENSIFY_PARTNER_NAME: 'expensify.com', | ||
EMAIL: { | ||
CONCIERGE: 'concierge@expensify.com', | ||
HELP: 'help@expensify.com', | ||
RECEIPTS: 'receipts@expensify.com', | ||
ACCOUNTING: 'accounting@expensify.com', | ||
ADMIN: 'admin@expensify.com', | ||
BILLS: 'bills@expensify.com', | ||
CHRONOS: '[email protected]', | ||
QA: 'qa@expensify.com', | ||
CONCIERGE: 'concierge@expensify.com', | ||
CONTRIBUTORS: '[email protected]', | ||
FIRST_RESPONDER: '[email protected]', | ||
GUIDES_DOMAIN: 'team.expensify.com', | ||
HELP: '[email protected]', | ||
INTEGRATION_TESTING_CREDS: '[email protected]', | ||
PAYROLL: '[email protected]', | ||
QA: '[email protected]', | ||
QA_TRAVIS: '[email protected]', | ||
BILLS: 'bills@expensify.com', | ||
RECEIPTS: 'receipts@expensify.com', | ||
STUDENT_AMBASSADOR: '[email protected]', | ||
ACCOUNTING: '[email protected]', | ||
PAYROLL: '[email protected]', | ||
SVFG: '[email protected]', | ||
INTEGRATION_TESTING_CREDS: '[email protected]', | ||
ADMIN: '[email protected]', | ||
GUIDES_DOMAIN: 'team.expensify.com', | ||
}, | ||
|
||
ACCOUNT_ID: { | ||
ACCOUNTING: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_ACCOUNTING', 9645353)), | ||
ADMIN: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_ADMIN', -1)), | ||
BILLS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_BILLS', 1371)), | ||
CHRONOS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_CHRONOS', 10027416)), | ||
CONCIERGE: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_CONCIERGE', 8392101)), | ||
CONTRIBUTORS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_CONTRIBUTORS', 9675014)), | ||
FIRST_RESPONDER: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_FIRST_RESPONDER', 9375152)), | ||
HELP: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_HELP', -1)), | ||
INTEGRATION_TESTING_CREDS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_INTEGRATION_TESTING_CREDS', -1)), | ||
PAYROLL: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_PAYROLL', 9679724)), | ||
QA: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_QA', 3126513)), | ||
QA_TRAVIS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_QA_TRAVIS', 8595733)), | ||
RECEIPTS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_RECEIPTS', -1)), | ||
REWARDS: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_REWARDS', 11023767)), // [email protected] | ||
STUDENT_AMBASSADOR: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_STUDENT_AMBASSADOR', 10476956)), | ||
SVFG: Number(lodashGet(Config, 'EXPENSIFY_ACCOUNT_ID_SVFG', 2012843)), | ||
// TODO: maybe make separate domain email things?? | ||
// GUIDES_DOMAIN: , | ||
}, | ||
|
||
ENVIRONMENT: { | ||
|
@@ -1164,21 +1185,41 @@ const CONST = { | |
}, | ||
get EXPENSIFY_EMAILS() { | ||
return [ | ||
this.EMAIL.CONCIERGE, | ||
this.EMAIL.HELP, | ||
this.EMAIL.RECEIPTS, | ||
this.EMAIL.ACCOUNTING, | ||
this.EMAIL.ADMIN, | ||
this.EMAIL.BILLS, | ||
this.EMAIL.CHRONOS, | ||
this.EMAIL.QA, | ||
this.EMAIL.CONCIERGE, | ||
this.EMAIL.CONTRIBUTORS, | ||
this.EMAIL.FIRST_RESPONDER, | ||
this.EMAIL.HELP, | ||
this.EMAIL.INTEGRATION_TESTING_CREDS, | ||
this.EMAIL.PAYROLL, | ||
this.EMAIL.QA, | ||
this.EMAIL.QA_TRAVIS, | ||
this.EMAIL.BILLS, | ||
this.EMAIL.RECEIPTS, | ||
this.EMAIL.STUDENT_AMBASSADOR, | ||
this.EMAIL.ACCOUNTING, | ||
this.EMAIL.PAYROLL, | ||
this.EMAIL.SVFG, | ||
this.EMAIL.INTEGRATION_TESTING_CREDS, | ||
this.EMAIL.ADMIN, | ||
]; | ||
}, | ||
get EXPENSIFY_ACCOUNT_IDS() { | ||
return [ | ||
this.ACCOUNT_ID.ACCOUNTING, | ||
this.ACCOUNT_ID.ADMIN, | ||
this.ACCOUNT_ID.BILLS, | ||
this.ACCOUNT_ID.CHRONOS, | ||
this.ACCOUNT_ID.CONCIERGE, | ||
this.ACCOUNT_ID.CONTRIBUTORS, | ||
this.ACCOUNT_ID.FIRST_RESPONDER, | ||
this.ACCOUNT_ID.HELP, | ||
this.ACCOUNT_ID.INTEGRATION_TESTING_CREDS, | ||
this.ACCOUNT_ID.PAYROLL, | ||
this.ACCOUNT_ID.QA, | ||
this.ACCOUNT_ID.QA_TRAVIS, | ||
this.ACCOUNT_ID.RECEIPTS, | ||
this.ACCOUNT_ID.REWARDS, | ||
this.ACCOUNT_ID.STUDENT_AMBASSADOR, | ||
this.ACCOUNT_ID.SVFG, | ||
]; | ||
}, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,9 +42,6 @@ export default { | |
// Has information about the network status (offline/online) | ||
NETWORK: 'network', | ||
|
||
// Contains all the personalDetails the user has access to | ||
PERSONAL_DETAILS: 'personalDetails', | ||
|
||
// Contains all the personalDetails the user has access to, keyed by accountID | ||
PERSONAL_DETAILS_LIST: 'personalDetailsList', | ||
|
||
|
@@ -114,6 +111,7 @@ export default { | |
DOWNLOAD: 'download_', | ||
POLICY: 'policy_', | ||
POLICY_MEMBER_LIST: 'policyMemberList_', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we can remove this now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not quite done migrating to the new key so IMO we should leave it until that's done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Giggidy 👍 |
||
POLICY_MEMBERS: 'policyMembers_', | ||
WORKSPACE_INVITE_MEMBERS_DRAFT: 'workspaceInviteMembersDraft_', | ||
REPORT: 'report_', | ||
REPORT_ACTIONS: 'reportActions_', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,9 +60,15 @@ const propTypes = { | |
/** Email address of the manager in this iou report */ | ||
managerEmail: PropTypes.string, | ||
|
||
/** Account ID of the manager in this iou report */ | ||
managerID: PropTypes.number, | ||
|
||
/** Email address of the creator of this iou report */ | ||
ownerEmail: PropTypes.string, | ||
|
||
/** Account ID of the creator of this iou report */ | ||
ownerAccountID: PropTypes.number, | ||
|
||
/** Outstanding amount in cents of this transaction */ | ||
total: PropTypes.number, | ||
|
||
|
@@ -128,14 +134,14 @@ const IOUPreview = (props) => { | |
if (_.isEmpty(props.iouReport) && !props.isBillSplit) { | ||
return null; | ||
} | ||
const sessionEmail = lodashGet(props.session, 'email', null); | ||
const managerEmail = props.iouReport.managerEmail || ''; | ||
const ownerEmail = props.iouReport.ownerEmail || ''; | ||
const participantEmails = props.isBillSplit ? lodashGet(props.action, 'originalMessage.participants', []) : [managerEmail, ownerEmail]; | ||
const participantAvatars = OptionsListUtils.getAvatarsForLogins(participantEmails, props.personalDetails); | ||
const sessionAccountID = lodashGet(props.session, 'accountID', null); | ||
const managerID = props.iouReport.managerID || ''; | ||
const ownerAccountID = props.iouReport.ownerAccountID || ''; | ||
const participantAccountIDs = props.isBillSplit ? lodashGet(props.action, 'originalMessage.participantAccountIDs', []) : [managerID, ownerAccountID]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have sorted the account ids. Not doing so resulted in #31732 |
||
const participantAvatars = OptionsListUtils.getAvatarsForAccountIDs(participantAccountIDs, props.personalDetails); | ||
|
||
// Pay button should only be visible to the manager of the report. | ||
const isCurrentUserManager = managerEmail === sessionEmail; | ||
const isCurrentUserManager = managerID === sessionAccountID; | ||
|
||
const moneyRequestAction = ReportUtils.getMoneyRequestAction(props.action); | ||
|
||
|
@@ -228,10 +234,10 @@ const IOUPreview = (props) => { | |
)} | ||
{!_.isEmpty(requestComment) && <Text style={[styles.colorMuted]}>{requestComment}</Text>} | ||
</View> | ||
{props.isBillSplit && !_.isEmpty(participantEmails) && ( | ||
{props.isBillSplit && !_.isEmpty(participantAccountIDs) && ( | ||
<Text style={[styles.textLabel, styles.colorMuted, styles.ml1]}> | ||
{props.translate('iou.amountEach', { | ||
amount: CurrencyUtils.convertToDisplayString(IOUUtils.calculateAmount(participantEmails.length - 1, requestAmount), requestCurrency), | ||
amount: CurrencyUtils.convertToDisplayString(IOUUtils.calculateAmount(participantAccountIDs.length - 1, requestAmount), requestCurrency), | ||
})} | ||
</Text> | ||
)} | ||
|
@@ -267,7 +273,7 @@ export default compose( | |
withLocalize, | ||
withOnyx({ | ||
personalDetails: { | ||
key: ONYXKEYS.PERSONAL_DETAILS, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
}, | ||
iouReport: { | ||
key: ({iouReportID}) => `${ONYXKEYS.COLLECTION.REPORT}${iouReportID}`, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we need this? I think yes, but it's not in
CONST.EMAIL
at the moment 🤷