Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
93292f7
add invoice chat type
rezkiy37 Apr 10, 2024
1c17dd6
add invoice report type
rezkiy37 Apr 10, 2024
08c640b
create isInvoiceRoom and isInvoiceReport
rezkiy37 Apr 10, 2024
10c2d2f
check isInvoiceReport in report screen
rezkiy37 Apr 10, 2024
5022a11
check that invoice room is chat room
rezkiy37 Apr 10, 2024
86f52ca
implement invoice room welcome message
rezkiy37 Apr 10, 2024
f9243bb
accept invoice report in AvatarWithDisplayName
rezkiy37 Apr 10, 2024
c15f33d
support invoice report in getChatRoomSubtitle
rezkiy37 Apr 10, 2024
e08889e
accept invoice room in shouldReportShowSubscript
rezkiy37 Apr 10, 2024
2d67b99
integrate invoice room in canLeaveRoom
rezkiy37 Apr 10, 2024
3e94616
integrate invoice icon in getIcons
rezkiy37 Apr 10, 2024
8a41a36
create getInvoicesChatName
rezkiy37 Apr 11, 2024
2446057
add awaiting payment translation
rezkiy37 Apr 12, 2024
8e66700
create PaymentWaitingBanner
rezkiy37 Apr 12, 2024
fd8a5bd
create isInvoiceAwaitingPayment
rezkiy37 Apr 12, 2024
19175e9
render MoneyRequestView in ReportActionItem for invoice
rezkiy37 Apr 12, 2024
21fb170
add invoiceReceiver to report
rezkiy37 Apr 12, 2024
32536ff
integrate invoiceReceiver usage
rezkiy37 Apr 12, 2024
4bad9a2
add invoice banner to MoneyReportHeader
rezkiy37 Apr 12, 2024
4e81a6c
integrate deleted invoice message
rezkiy37 Apr 12, 2024
19b54e3
integrate deleted invoice message in getTransactionReportName
rezkiy37 Apr 12, 2024
ca98bd9
add invoice banner to ReportPreview
rezkiy37 Apr 12, 2024
89e2eed
add todo
rezkiy37 Apr 12, 2024
d83d22a
invoice is not a default for ReportWelcomeText
rezkiy37 Apr 15, 2024
b9ed19d
fix welcome message
rezkiy37 Apr 15, 2024
697de5e
render proper welcome hero text
rezkiy37 Apr 15, 2024
60462fd
render proper invoice room title
rezkiy37 Apr 15, 2024
a524346
integrate report subtitle for invoice room
rezkiy37 Apr 15, 2024
933499e
integrate payer name
rezkiy37 Apr 15, 2024
80dbeef
render proper actor of invoice
rezkiy37 Apr 15, 2024
2f5a0be
Support one transaction view for invoices
VickyStash Apr 16, 2024
875d321
restrict room leaving
rezkiy37 Apr 16, 2024
babdb9a
configure ReportDetailsPage for invoices
rezkiy37 Apr 16, 2024
6230317
check if the user can pay an invoice
rezkiy37 Apr 16, 2024
3c4d718
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Apr 17, 2024
23dd180
improve getInvoicesChatName
rezkiy37 Apr 17, 2024
12bd9c4
add comment
rezkiy37 Apr 17, 2024
7b71142
Revert "integrate deleted invoice message"
rezkiy37 Apr 17, 2024
78f5f64
Revert "integrate deleted invoice message in getTransactionReportName"
rezkiy37 Apr 17, 2024
c230799
clear redundant participant props
rezkiy37 Apr 17, 2024
5625582
sync changes
rezkiy37 Apr 17, 2024
1b92e52
update invoice receiver const
rezkiy37 Apr 17, 2024
fb69172
improve getInvoicesChatSubtitle
rezkiy37 Apr 17, 2024
2610f14
revert extra changes
rezkiy37 Apr 17, 2024
b8d94a7
simplify invoice room subtitle
rezkiy37 Apr 17, 2024
04ee7b1
Revert "integrate report subtitle for invoice room"
rezkiy37 Apr 17, 2024
b55a27f
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Apr 19, 2024
cb5fb77
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Apr 22, 2024
3e448b6
use proper type
rezkiy37 Apr 22, 2024
012e877
Merge remote-tracking branch 'expensify/main' into feature/40013-invo…
waterim Apr 24, 2024
4b5db30
fix translations, CONST
waterim Apr 24, 2024
4b1ab71
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Apr 25, 2024
7d05ac2
remove payment waiting banner
rezkiy37 Apr 25, 2024
4264b50
show invoice room in sidebar
rezkiy37 Apr 25, 2024
83346bc
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
rezkiy37 Apr 26, 2024
c852145
clarify comments
rezkiy37 Apr 26, 2024
1a24b88
restrict for request options invoice room
rezkiy37 Apr 26, 2024
b024fe5
restrict for request options invoice room
rezkiy37 Apr 26, 2024
396447f
Fix TS issues
cristipaval Apr 26, 2024
7c8a492
Merge remote-tracking branch 'origin/main' into feature/40013-invoice…
cristipaval Apr 26, 2024
3844b32
Merge remote-tracking branch 'origin/main' into feature/40013-invoice…
cristipaval Apr 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const chatTypes = {
POLICY_ROOM: 'policyRoom',
POLICY_EXPENSE_CHAT: 'policyExpenseChat',
SELF_DM: 'selfDM',
INVOICE: 'invoice',
} as const;

// Explicit type annotation is required
Expand Down Expand Up @@ -805,6 +806,7 @@ const CONST = {
EXPENSE: 'expense',
IOU: 'iou',
TASK: 'task',
INVOICE: 'invoice',
},
CHAT_TYPE: chatTypes,
WORKSPACE_CHAT_ROOMS: {
Expand Down Expand Up @@ -854,6 +856,10 @@ const CONST = {
SHARE: 'share',
OWN: 'own',
},
INVOICE_RECEIVER_TYPE: {
INDIVIDUAL: 'individual',
BUSINESS: 'policy',
},
},
NEXT_STEP: {
FINISHED: 'Finished!',
Expand Down Expand Up @@ -1470,6 +1476,7 @@ const CONST = {
PAY: 'pay',
SPLIT: 'split',
REQUEST: 'request',
INVOICE: 'invoice',
SUBMIT: 'submit',
TRACK: 'track',
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ function AvatarWithDisplayName({
const title = ReportUtils.getReportName(report);
const subtitle = ReportUtils.getChatRoomSubtitle(report);
const parentNavigationSubtitleData = ReportUtils.getParentNavigationSubtitle(report);
const isMoneyRequestOrReport = ReportUtils.isMoneyRequestReport(report) || ReportUtils.isMoneyRequest(report) || ReportUtils.isTrackExpenseReport(report);
const isMoneyRequestOrReport =
ReportUtils.isMoneyRequestReport(report) || ReportUtils.isMoneyRequest(report) || ReportUtils.isTrackExpenseReport(report) || ReportUtils.isInvoiceReport(report);
const icons = ReportUtils.getIcons(report, personalDetails, null, '', -1, policy);
const ownerPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(report?.ownerAccountID ? [report.ownerAccountID] : [], personalDetails);
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(Object.values(ownerPersonalDetails) as PersonalDetails[], false);
Expand Down
9 changes: 7 additions & 2 deletions src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report);
const isChatRoom = ReportUtils.isChatRoom(report);
const isSelfDM = ReportUtils.isSelfDM(report);
const isDefault = !(isChatRoom || isPolicyExpenseChat || isSelfDM);
const isInvoiceRoom = ReportUtils.isInvoiceRoom(report);
const isDefault = !(isChatRoom || isPolicyExpenseChat || isSelfDM || isInvoiceRoom);
const participantAccountIDs = report?.participantAccountIDs ?? [];
const isMultipleParticipant = participantAccountIDs.length > 1;
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(OptionsListUtils.getPersonalDetailsForAccountIDs(participantAccountIDs, personalDetails), isMultipleParticipant);
Expand All @@ -58,6 +59,10 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP
};

const welcomeHeroText = useMemo(() => {
if (isInvoiceRoom) {
return translate('reportActionsView.sayHello');
}

if (isChatRoom) {
return translate('reportActionsView.welcomeToRoom', {roomName: reportName});
}
Expand All @@ -67,7 +72,7 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP
}

return translate('reportActionsView.sayHello');
}, [isChatRoom, isSelfDM, translate, reportName]);
}, [isChatRoom, isInvoiceRoom, isSelfDM, translate, reportName]);

return (
<>
Expand Down
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ export default {
beginningOfChatHistoryAnnounceRoomPartTwo: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomPartTwo) => ` to chat about anything ${workspaceName} related.`,
beginningOfChatHistoryUserRoomPartOne: 'Collaboration starts here! 🎉\nUse this space to chat about anything ',
beginningOfChatHistoryUserRoomPartTwo: ' related.',
beginningOfChatHistoryInvoiceRoom: 'Collaboration starts here! 🎉 Use this room to view, discuss, and pay invoices.',
beginningOfChatHistory: 'This is the beginning of your chat with ',
beginningOfChatHistoryPolicyExpenseChatPartOne: 'Collaboration between ',
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' and ',
Expand All @@ -519,6 +520,7 @@ export default {
split: 'split an expense',
submit: 'submit an expense',
track: 'track an expense',
invoice: 'invoice an expense',
},
},
reportAction: {
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ export default {
beginningOfChatHistoryAnnounceRoomPartTwo: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomPartTwo) => ` para chatear sobre cualquier cosa relacionada con ${workspaceName}.`,
beginningOfChatHistoryUserRoomPartOne: '¡Este es el lugar para colaborar! 🎉\nUsa este espacio para chatear sobre cualquier cosa relacionada con ',
beginningOfChatHistoryUserRoomPartTwo: '.',
beginningOfChatHistoryInvoiceRoom: '¡Este es el lugar para colaborar! 🎉 Utilice esta sala para ver, discutir y pagar facturas.',
beginningOfChatHistory: 'Aquí comienzan tus conversaciones con ',
beginningOfChatHistoryPolicyExpenseChatPartOne: '¡La colaboración entre ',
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' y ',
Expand All @@ -512,6 +513,7 @@ export default {
split: 'dividir un gasto',
submit: 'presentar un gasto',
track: 'rastrear un gasto',
invoice: 'facturar un gasto',
},
},
reportAction: {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ function isTransactionThread(parentReportAction: OnyxEntry<ReportAction> | Empty
* Returns the reportID for the transaction thread associated with a report by iterating over the reportActions and identifying the IOU report actions with a childReportID. Returns a reportID if there is exactly one transaction thread for the report, and null otherwise.
*/
function getOneTransactionThreadReportID(reportID: string, reportActions: OnyxEntry<ReportActions> | ReportAction[], isOffline: boolean | undefined = undefined): string | null {
// If the report is not an IOU or Expense report, it shouldn't be treated as one-transaction report.
// If the report is not an IOU, Expense report or an Invoice, it shouldn't be treated as one-transaction report.
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
if (report?.type !== CONST.REPORT.TYPE.IOU && report?.type !== CONST.REPORT.TYPE.EXPENSE) {
if (report?.type !== CONST.REPORT.TYPE.IOU && report?.type !== CONST.REPORT.TYPE.EXPENSE && report?.type !== CONST.REPORT.TYPE.INVOICE) {
return null;
}

Expand Down
Loading