Skip to content
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

[No QA]Add new workflow to validate that HybridApp builds on every commit #55328

Merged
merged 27 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d3bd9f5
Add new workflow to validate that HybridApp builds on every commit
AndrewGable Jan 15, 2025
45b6c98
Add flags
AndrewGable Jan 16, 2025
8a5620e
Merge branch 'main' into andrew-verify-hybrid
AndrewGable Jan 22, 2025
b7ad7f0
Use fastlane
AndrewGable Jan 22, 2025
5a5acf5
Install ruby on Android runner
AndrewGable Jan 22, 2025
7f2f3ab
Switch task
AndrewGable Jan 22, 2025
3622a01
Use debug scheme
AndrewGable Jan 22, 2025
8c5b4ad
Use configuration instead of scheme for iOS
AndrewGable Jan 22, 2025
05e4a29
Use xcodebuild and gradle manually
AndrewGable Jan 22, 2025
9fc9001
Tweak commands
AndrewGable Jan 22, 2025
621b112
Add RCT_NO_LAUNCH_PACKAGER
AndrewGable Jan 22, 2025
84fbe76
Try setting differently
AndrewGable Jan 22, 2025
63b5dd0
Merge branch 'main' into andrew-verify-hybrid
AndrewGable Jan 22, 2025
51e1482
Update submodule
AndrewGable Jan 23, 2025
1822133
Checkout commit manually
AndrewGable Jan 23, 2025
7ff0979
Use main
AndrewGable Jan 23, 2025
c64c1f5
Install shared js
AndrewGable Jan 23, 2025
c126731
Build ios code
AndrewGable Jan 23, 2025
b636925
Merge branch 'main' into andrew-verify-hybrid
AndrewGable Jan 23, 2025
dcff2a2
Remove bad iOS build code
AndrewGable Jan 23, 2025
ed20005
Fix shell lint
AndrewGable Jan 23, 2025
90e4525
Fix Android shell check lint issues
AndrewGable Jan 23, 2025
a30b7ed
Add paths for HybridApp build to limit number of builds
AndrewGable Jan 24, 2025
bb58023
Merge branch 'main' into andrew-verify-hybrid
AndrewGable Jan 24, 2025
a0b05da
Revert unused changes
AndrewGable Jan 24, 2025
17427b3
Clean up code
AndrewGable Jan 24, 2025
0319348
Update paths
AndrewGable Jan 24, 2025
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
Prev Previous commit
Next Next commit
Merge branch 'main' into andrew-verify-hybrid
  • Loading branch information
AndrewGable committed Jan 22, 2025
commit 63b5dd03992222ef38887d270eb1f1fd780de266
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/TooltipsTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: 'Tooltips Template'
about: Create this issue when adding a new tooltip to New Expensify
labels: Daily, Design, WaitingForCopy
title: 'Tooltips Template'
---
Refer to https://stackoverflowteams.com/c/expensify/questions/20762 for the full process to add a tooltip.

### Problem
Enter the problem that currently exists without the tooltip.

### Solution
Enter the solution that implementing the tooltip will achieve.

### What is the purpose of the tooltip?
Enter the purpose.

### How should the tooltip look
Add the Figma Mock Up that Design builds.

### Condition
We should show this tooltip to:

### Decide the prioritisation

Priority score:

NOTE: Only one tooltip is shown at a time.
2 changes: 1 addition & 1 deletion Mobile-Expensify
Binary file added docs/assets/images/travel-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/travel-soft-approval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 11 additions & 9 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import {
isCurrentUserSubmitter,
isInvoiceReport,
navigateBackOnDeleteTransaction,
reportTransactionsSelector,
} from '@libs/ReportUtils';
import {
allHavePendingRTERViolation,
getAllReportTransactions,
isDuplicate as isDuplicateTransactionUtils,
isExpensifyCardTransaction,
isOnHold as isOnHoldTransactionUtils,
Expand Down Expand Up @@ -115,12 +115,13 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
}
return reportActions.find((action): action is OnyxTypes.ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.IOU> => action.reportActionID === transactionThreadReport.parentReportActionID);
}, [reportActions, transactionThreadReport?.parentReportActionID]);
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION);
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {
selector: (_transactions) => reportTransactionsSelector(_transactions, moneyRequestReport?.reportID),
initialValue: [],
});
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${isMoneyRequestAction(requestParentReportAction) && getOriginalMessage(requestParentReportAction)?.IOUTransactionID}`);
const [dismissedHoldUseExplanation, dismissedHoldUseExplanationResult] = useOnyx(ONYXKEYS.NVP_DISMISSED_HOLD_USE_EXPLANATION, {initialValue: true});
const isLoadingHoldUseExplained = isLoadingOnyxValue(dismissedHoldUseExplanationResult);
const transaction =
transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${isMoneyRequestAction(requestParentReportAction) && getOriginalMessage(requestParentReportAction)?.IOUTransactionID}`] ??
undefined;

const styles = useThemeStyles();
const theme = useTheme();
Expand All @@ -139,15 +140,16 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
const [isHoldMenuVisible, setIsHoldMenuVisible] = useState(false);
const [paymentType, setPaymentType] = useState<PaymentMethodType>();
const [requestType, setRequestType] = useState<ActionHandledType>();
const allTransactions = useMemo(() => getAllReportTransactions(moneyRequestReport?.reportID, transactions), [moneyRequestReport?.reportID, transactions]);
const canAllowSettlement = hasUpdatedTotal(moneyRequestReport, policy);
const policyType = policy?.type;
const connectedIntegration = getConnectedIntegration(policy);
const navigateBackToAfterDelete = useRef<Route>();
const hasHeldExpenses = hasHeldExpensesReportUtils(moneyRequestReport?.reportID);
const hasScanningReceipt = getTransactionsWithReceipts(moneyRequestReport?.reportID).some((t) => isReceiptBeingScanned(t));
const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every((t) => isExpensifyCardTransaction(t) && isPending(t));
const transactionIDs = allTransactions.map((t) => t.transactionID) ?? [];
const hasOnlyPendingTransactions = useMemo(() => {
return !!transactions && transactions.length > 0 && transactions.every((t) => isExpensifyCardTransaction(t) && isPending(t));
}, [transactions]);
const transactionIDs = transactions?.map((t) => t.transactionID) ?? [];
const hasAllPendingRTERViolations = allHavePendingRTERViolation(transactionIDs);
const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationTransactionUtils(transactionIDs, moneyRequestReport, policy);
const hasOnlyHeldExpenses = hasOnlyHeldExpensesReportUtils(moneyRequestReport?.reportID);
Expand Down Expand Up @@ -502,7 +504,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea
paymentType={paymentType}
chatReport={chatReport}
moneyRequestReport={moneyRequestReport}
transactionCount={transactionIDs.length}
transactionCount={transactionIDs?.length ?? 0}
/>
)}
<DelegateNoAccessModal
Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import AnimatedEmptyStateBackground from '@pages/home/report/AnimatedEmptyStateB
import {cleanUpMoneyRequest, updateMoneyRequestBillable} from '@userActions/IOU';
import {navigateToConciergeChatAndDeleteReport} from '@userActions/Report';
import {clearAllRelatedReportActionErrors} from '@userActions/ReportActions';
import {clearError} from '@userActions/Transaction';
import {clearError, getLastModifiedExpense, revert} from '@userActions/Transaction';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -510,6 +510,7 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
clearAllRelatedReportActionErrors(report.reportID, parentReportAction);
return;
}
revert(transaction?.transactionID ?? linkedTransactionID, getLastModifiedExpense(report?.reportID));
clearError(transaction.transactionID);
clearAllRelatedReportActionErrors(report.reportID, parentReportAction);
}}
Expand Down
29 changes: 16 additions & 13 deletions src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ import {
isReportApproved,
isReportOwner,
isSettled,
reportTransactionsSelector,
} from '@libs/ReportUtils';
import StringUtils from '@libs/StringUtils';
import {
getAllReportTransactions,
getDescription,
getMerchant,
getTransactionViolations,
Expand Down Expand Up @@ -143,7 +143,10 @@ function ReportPreview({
const policy = usePolicy(policyID);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`);
const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID}`);
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION);
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {
selector: (_transactions) => reportTransactionsSelector(_transactions, iouReportID),
initialValue: [],
});
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET);
const [invoiceReceiverPolicy] = useOnyx(
Expand All @@ -157,7 +160,6 @@ function ReportPreview({
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const allTransactions = useMemo(() => getAllReportTransactions(iouReportID, transactions), [iouReportID, transactions]);

const {hasMissingSmartscanFields, areAllRequestsBeingSmartScanned, hasOnlyTransactionsWithPendingRoutes, hasNonReimbursableTransactions} = useMemo(
() => ({
Expand All @@ -179,8 +181,8 @@ function ReportPreview({

const getCanIOUBePaid = useCallback(
(onlyShowPayElsewhere = false, shouldCheckApprovedState = true) =>
canIOUBePaidIOUActions(iouReport, chatReport, policy, allTransactions, onlyShowPayElsewhere, undefined, undefined, shouldCheckApprovedState),
[iouReport, chatReport, policy, allTransactions],
canIOUBePaidIOUActions(iouReport, chatReport, policy, transactions, onlyShowPayElsewhere, undefined, undefined, shouldCheckApprovedState),
[iouReport, chatReport, policy, transactions],
);

const canIOUBePaid = useMemo(() => getCanIOUBePaid(), [getCanIOUBePaid]);
Expand Down Expand Up @@ -217,7 +219,7 @@ function ReportPreview({
const isInvoiceRoom = isInvoiceRoomReportUtils(chatReport);

const canAllowSettlement = hasUpdatedTotal(iouReport, policy);
const numberOfRequests = allTransactions.length;
const numberOfRequests = transactions?.length ?? 0;
const transactionsWithReceipts = getTransactionsWithReceipts(iouReportID);
const numberOfScanningReceipts = transactionsWithReceipts.filter((transaction) => isReceiptBeingScanned(transaction)).length;
const numberOfPendingRequests = transactionsWithReceipts.filter((transaction) => isPending(transaction) && isCardTransaction(transaction)).length;
Expand All @@ -232,13 +234,14 @@ function ReportPreview({
hasWarningTypeViolations(iouReportID, transactionViolations, true) ||
(isReportOwner(iouReport) && hasReportViolations(iouReportID)) ||
hasActionsWithErrors(iouReportID);
const lastThreeTransactions = allTransactions.slice(-3);
const lastThreeTransactions = transactions?.slice(-3) ?? [];
const lastTransaction = transactions?.at(0);
const lastThreeReceipts = lastThreeTransactions.map((transaction) => ({...getThumbnailAndImageURIs(transaction), transaction}));
const showRTERViolationMessage = numberOfRequests === 1 && hasPendingUI(allTransactions.at(0), getTransactionViolations(allTransactions.at(0)?.transactionID, transactionViolations));
const transactionIDList = [allTransactions.at(0)?.transactionID].filter((transactionID): transactionID is string => transactionID !== undefined);
const showRTERViolationMessage = numberOfRequests === 1 && hasPendingUI(lastTransaction, getTransactionViolations(lastTransaction?.transactionID, transactionViolations));
const transactionIDList = [lastTransaction?.transactionID].filter((transactionID): transactionID is string => transactionID !== undefined);
const shouldShowBrokenConnectionViolation = numberOfRequests === 1 && shouldShowBrokenConnectionViolationTransactionUtils(transactionIDList, iouReport, policy);
let formattedMerchant = numberOfRequests === 1 ? getMerchant(allTransactions.at(0)) : null;
const formattedDescription = numberOfRequests === 1 ? getDescription(allTransactions.at(0)) : null;
let formattedMerchant = numberOfRequests === 1 ? getMerchant(lastTransaction) : null;
const formattedDescription = numberOfRequests === 1 ? getDescription(lastTransaction) : null;

if (isPartialMerchant(formattedMerchant ?? '')) {
formattedMerchant = null;
Expand Down Expand Up @@ -423,7 +426,7 @@ function ReportPreview({
const shouldShowScanningSubtitle = (numberOfScanningReceipts === 1 && numberOfRequests === 1) || (numberOfScanningReceipts >= 1 && Number(nonHeldAmount) === 0);
const shouldShowPendingSubtitle = numberOfPendingRequests === 1 && numberOfRequests === 1;

const isPayAtEndExpense = isPayAtEndExpenseReport(iouReportID, allTransactions);
const isPayAtEndExpense = isPayAtEndExpenseReport(iouReportID, transactions);
const [archiveReason] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReportID}`, {selector: getArchiveReason});

const getPendingMessageProps: () => PendingMessageProps = () => {
Expand Down Expand Up @@ -545,7 +548,7 @@ function ReportPreview({
{lastThreeReceipts.length > 0 && (
<ReportActionItemImages
images={lastThreeReceipts}
total={allTransactions.length}
total={numberOfRequests}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
/>
)}
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2659,6 +2659,7 @@ const translations = {
planType: 'Plan type',
submitExpense: 'Submit expenses using your workspace chat below:',
defaultCategory: 'Default category',
viewTransactions: 'View transactions',
},
perDiem: {
subtitle: 'Set per diem rates to control daily employee spend. ',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2683,6 +2683,7 @@ const translations = {
planType: 'Tipo de plan',
submitExpense: 'Envíe los gastos utilizando el chat de su espacio de trabajo:',
defaultCategory: 'Categoría predeterminada',
viewTransactions: 'Ver transacciones',
},
perDiem: {
subtitle: 'Establece las tasas per diem para controlar los gastos diarios de los empleados. ',
Expand Down
15 changes: 8 additions & 7 deletions src/libs/IOUUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import type {IOUAction, IOUType} from '@src/CONST';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {OnyxInputOrEntry, PersonalDetails, Report, Transaction} from '@src/types/onyx';
import type {OnyxInputOrEntry, PersonalDetails, Report} from '@src/types/onyx';
import type {Attendee} from '@src/types/onyx/IOU';
import type {IOURequestType} from './actions/IOU';
import * as CurrencyUtils from './CurrencyUtils';
import {getCurrencyUnit} from './CurrencyUtils';
import DateUtils from './DateUtils';
import Navigation from './Navigation/Navigation';
import * as TransactionUtils from './TransactionUtils';
import {getReportTransactions} from './ReportUtils';
import {getCurrency, getTagArrayFromName} from './TransactionUtils';

let lastLocationPermissionPrompt: string;
Onyx.connect({
Expand Down Expand Up @@ -47,7 +48,7 @@ function navigateToStartMoneyRequestStep(requestType: IOURequestType, iouType: I
function calculateAmount(numberOfParticipants: number, total: number, currency: string, isDefaultUser = false): number {
// Since the backend can maximum store 2 decimal places, any currency with more than 2 decimals
// has to be capped to 2 decimal places
const currencyUnit = Math.min(100, CurrencyUtils.getCurrencyUnit(currency));
const currencyUnit = Math.min(100, getCurrencyUnit(currency));
const totalInCurrencySubunit = (total / 100) * currencyUnit;
const totalParticipants = numberOfParticipants + 1;
const amountPerPerson = Math.round(totalInCurrencySubunit / totalParticipants);
Expand Down Expand Up @@ -118,8 +119,8 @@ function updateIOUOwnerAndTotal<TReport extends OnyxInputOrEntry<Report>>(
* that are either created or cancelled offline, and thus haven't been converted to the report's currency yet
*/
function isIOUReportPendingCurrencyConversion(iouReport: Report): boolean {
const reportTransactions: Transaction[] = TransactionUtils.getAllReportTransactions(iouReport.reportID);
const pendingRequestsInDifferentCurrency = reportTransactions.filter((transaction) => transaction.pendingAction && TransactionUtils.getCurrency(transaction) !== iouReport.currency);
const reportTransactions = getReportTransactions(iouReport.reportID);
const pendingRequestsInDifferentCurrency = reportTransactions.filter((transaction) => transaction.pendingAction && getCurrency(transaction) !== iouReport.currency);
return pendingRequestsInDifferentCurrency.length > 0;
}

Expand Down Expand Up @@ -150,7 +151,7 @@ function isValidMoneyRequestType(iouType: string): boolean {
* @returns
*/
function insertTagIntoTransactionTagsString(transactionTags: string, tag: string, tagIndex: number): string {
const tagArray = TransactionUtils.getTagArrayFromName(transactionTags);
const tagArray = getTagArrayFromName(transactionTags);
tagArray[tagIndex] = tag;

while (tagArray.length > 0 && !tagArray.at(-1)) {
Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.