Skip to content

Commit f8db853

Browse files
Merge branch 'main' into TAT-1879-tp-sl-of-open-limit-orders-are-displayed-on-the-chart-2
2 parents bd159db + 1d37689 commit f8db853

File tree

211 files changed

+12598
-5442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+12598
-5442
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- cron: '0 2-6 * * *'
1212

1313
concurrency:
14-
group: ${{ github.workflow }}-${{ github.ref }}
14+
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.sha || github.ref }}
1515
cancel-in-progress: ${{ !(contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/stable')) }}
1616

1717
jobs:
@@ -470,30 +470,9 @@ jobs:
470470
- name: Check workflow files
471471
run: ${{ steps.download-actionlint.outputs.executable }} -color -config-file .github/actionlint.yaml
472472
shell: bash
473-
all-jobs-pass-merge-pr:
474-
name: All jobs pass
475-
runs-on: ubuntu-latest
476-
if: ${{ github.event_name != 'merge_group' }}
477-
needs:
478-
[
479-
check-diff,
480-
dedupe,
481-
scripts,
482-
unit-tests,
483-
check-workflows,
484-
js-bundle-size-check,
485-
sonar-cloud-quality-gate-status,
486-
]
487-
outputs:
488-
ALL_JOBS_PASSED: ${{ steps.jobs-passed-status.outputs.ALL_JOBS_PASSED }}
489-
steps:
490-
- name: Set jobs passed status
491-
id: jobs-passed-status
492-
run: echo "ALL_JOBS_PASSED=true" >> "$GITHUB_OUTPUT"
493473
all-jobs-pass:
494-
name: All jobs pass (merge_group)
474+
name: All jobs pass
495475
runs-on: ubuntu-latest
496-
if: ${{ github.event_name == 'merge_group' }}
497476
needs:
498477
[
499478
check-diff,
@@ -510,19 +489,19 @@ jobs:
510489
- name: Set jobs passed status
511490
id: jobs-passed-status
512491
run: echo "ALL_JOBS_PASSED=true" >> "$GITHUB_OUTPUT"
513-
check-all-jobs-pass-merge-pr:
492+
check-all-jobs-pass:
514493
name: Check all jobs pass
515-
if: ${{ github.event_name != 'merge_group' && always() }}
494+
if: ${{ always() }}
516495
runs-on: ubuntu-latest
517496
needs:
518-
- all-jobs-pass-merge-pr
497+
- all-jobs-pass
519498
- needs_e2e_build
520499
- e2e-smoke-tests-android
521500
- e2e-smoke-tests-ios
522501
steps:
523502
- run: |
524503
# Check if all non-E2E jobs passed
525-
if [[ "${{ needs.all-jobs-pass-merge-pr.outputs.ALL_JOBS_PASSED }}" != "true" ]]; then
504+
if [[ "${{ needs.all-jobs-pass.outputs.ALL_JOBS_PASSED }}" != "true" ]]; then
526505
echo "Non-E2E jobs failed"
527506
exit 1
528507
fi
@@ -540,19 +519,6 @@ jobs:
540519
fi
541520
542521
echo "All required jobs passed"
543-
check-all-jobs-pass:
544-
name: Check all jobs pass (merge_group)
545-
runs-on: ubuntu-latest
546-
needs: all-jobs-pass
547-
if: ${{ github.event_name == 'merge_group' && always() }}
548-
steps:
549-
- run: |
550-
if [[ "${{ needs.all-jobs-pass.outputs.ALL_JOBS_PASSED }}" == "true" ]]; then
551-
echo "All jobs passed. Unblock PR."
552-
else
553-
echo "All jobs passed step skipped. Block PR."
554-
exit 1
555-
fi
556522
557523
log-merge-group-failure:
558524
name: Log merge group failure

.github/workflows/run-e2e-regression-tests-android.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
contents: read
2424
id-token: write
2525
uses: ./.github/workflows/build-android-e2e.yml
26+
with:
27+
build_type: 'main'
28+
metamask_environment: 'e2e'
29+
keystore_target: 'qa'
2630
secrets: inherit
2731

2832
regression-confirmations-android:

.husky/pre-push

Lines changed: 0 additions & 104 deletions
This file was deleted.

app/components/Nav/App/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import FundActionMenu from '../../UI/FundActionMenu';
7272
import NetworkSelector from '../../../components/Views/NetworkSelector';
7373
import ReturnToAppNotification from '../../Views/ReturnToAppNotification';
7474
import EditAccountName from '../../Views/EditAccountName/EditAccountName';
75+
import CardNotification from '../../Views/CardNotification';
7576
import LegacyEditMultichainAccountName from '../../Views/MultichainAccounts/sheets/EditAccountName';
7677
import { EditMultichainAccountName } from '../../Views/MultichainAccounts/sheets/EditMultichainAccountName';
7778
import { PPOMView } from '../../../lib/ppom/PPOMView';
@@ -573,6 +574,10 @@ const RootModalFlow = (props: RootModalFlowProps) => (
573574
component={ReturnToAppNotification}
574575
initialParams={{ ...props.route.params }}
575576
/>
577+
<Stack.Screen
578+
name={Routes.CARD.NOTIFICATION}
579+
component={CardNotification}
580+
/>
576581
</Stack.Navigator>
577582
);
578583

app/components/UI/AssetOverview/AssetOverview.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import { isNonEvmChainId } from '../../../core/Multichain/utils';
9797
import { selectTronResourcesBySelectedAccountGroup } from '../../../selectors/assets/assets-list';
9898
import { createStakedTrxAsset } from './utils/createStakedTrxAsset';
9999
///: END:ONLY_INCLUDE_IF
100+
import { getDetectedGeolocation } from '../../../reducers/fiatOrders';
100101

101102
interface AssetOverviewProps {
102103
asset: TokenI;
@@ -146,6 +147,8 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({
146147
const tokenResult = useSelector((state: RootState) =>
147148
selectTokenDisplayData(state, asset.chainId as Hex, asset.address as Hex),
148149
);
150+
151+
const rampGeodetectedRegion = useSelector(getDetectedGeolocation);
149152
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
150153
const multichainAssetsRates = useSelector(selectMultichainAssetsRates);
151154

@@ -346,6 +349,7 @@ const AssetOverview: React.FC<AssetOverviewProps> = ({
346349
text: 'Buy',
347350
location: 'TokenDetails',
348351
chain_id_destination: getDecimalChainId(chainId),
352+
region: rampGeodetectedRegion,
349353
})
350354
.build(),
351355
);

app/components/UI/BalanceEmptyState/BalanceEmptyState.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { trace, TraceName } from '../../../util/trace';
2424
import { createBuyNavigationDetails } from '../Ramp/Aggregator/routes/utils';
2525
import { BalanceEmptyStateProps } from './BalanceEmptyState.types';
2626
import bankTransferImage from '../../../images/bank-transfer.png';
27+
import { getDetectedGeolocation } from '../../../reducers/fiatOrders';
2728

2829
/**
2930
* BalanceEmptyState smart component displays an empty state for wallet balance
@@ -37,6 +38,7 @@ const BalanceEmptyState: React.FC<BalanceEmptyStateProps> = ({
3738
const chainId = useSelector(selectChainId);
3839
const navigation = useNavigation();
3940
const { trackEvent, createEventBuilder } = useMetrics();
41+
const rampGeodetectedRegion = useSelector(getDetectedGeolocation);
4042

4143
const handleAction = () => {
4244
navigation.navigate(...createBuyNavigationDetails());
@@ -52,6 +54,7 @@ const BalanceEmptyState: React.FC<BalanceEmptyStateProps> = ({
5254
location: 'BalanceEmptyState',
5355
chain_id_destination: getDecimalChainId(chainId),
5456
ramp_type: 'BUY',
57+
region: rampGeodetectedRegion,
5558
})
5659
.build(),
5760
);

app/components/UI/Card/components/AddFundsBottomSheet/AddFundsBottomSheet.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useCallback } from 'react';
2+
import { useSelector } from 'react-redux';
23
import { NavigationProp, ParamListBase } from '@react-navigation/native';
34
import BottomSheet, {
45
BottomSheetRef,
@@ -32,6 +33,7 @@ import { strings } from '../../../../../../locales/i18n';
3233
import { CardHomeSelectors } from '../../../../../../e2e/selectors/Card/CardHome.selectors';
3334
import { createDepositNavigationDetails } from '../../../Ramp/Deposit/routes/utils';
3435
import { safeFormatChainIdToHex } from '../../util/safeFormatChainIdToHex';
36+
import { getDetectedGeolocation } from '../../../../../reducers/fiatOrders';
3537

3638
export interface AddFundsBottomSheetProps {
3739
setOpenAddFundsBottomSheet: (open: boolean) => void;
@@ -53,6 +55,7 @@ const AddFundsBottomSheet: React.FC<AddFundsBottomSheetProps> = ({
5355
priorityToken,
5456
});
5557
const { trackEvent, createEventBuilder } = useMetrics();
58+
const rampGeodetectedRegion = useSelector(getDetectedGeolocation);
5659

5760
const closeBottomSheetAndNavigate = useCallback(
5861
(navigateFunc: () => void) => {
@@ -85,6 +88,7 @@ const AddFundsBottomSheet: React.FC<AddFundsBottomSheetProps> = ({
8588
location: 'CardHome',
8689
chain_id_destination: getDecimalChainId(priorityToken?.caipChainId),
8790
ramp_type: 'DEPOSIT',
91+
region: rampGeodetectedRegion,
8892
})
8993
.build(),
9094
);
@@ -93,6 +97,7 @@ const AddFundsBottomSheet: React.FC<AddFundsBottomSheetProps> = ({
9397
name: TraceName.LoadDepositExperience,
9498
});
9599
}, [
100+
rampGeodetectedRegion,
96101
closeBottomSheetAndNavigate,
97102
navigate,
98103
trackEvent,

app/components/UI/Card/components/Onboarding/OnboardingStep.test.tsx

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { render, screen } from '@testing-library/react-native';
2+
import { render } from '@testing-library/react-native';
33
import { Text, View, TouchableOpacity, Image } from 'react-native';
44
import OnboardingStep from './OnboardingStep';
55

@@ -61,25 +61,6 @@ jest.mock('@metamask/design-system-react-native', () => {
6161
};
6262
});
6363

64-
// Mock react-native-safe-area-context
65-
jest.mock('react-native-safe-area-context', () => ({
66-
SafeAreaView: ({
67-
children,
68-
...props
69-
}: {
70-
children: React.ReactNode;
71-
[key: string]: unknown;
72-
}) => {
73-
const ReactActual = jest.requireActual('react');
74-
const { View } = jest.requireActual('react-native');
75-
return ReactActual.createElement(
76-
View,
77-
{ testID: 'safe-area-view', ...props },
78-
children,
79-
);
80-
},
81-
}));
82-
8364
// Mock the FOX logo image
8465
jest.mock('../../../../../images/branding/fox.png', () => 'fox-logo');
8566

@@ -96,12 +77,6 @@ describe('OnboardingStep Component', () => {
9677
});
9778

9879
describe('Component Rendering', () => {
99-
it('renders without crashing with required props', () => {
100-
render(<OnboardingStep {...defaultProps} />);
101-
102-
expect(screen.getByTestId('safe-area-view')).toBeDefined();
103-
});
104-
10580
it('renders with all required props provided', () => {
10681
const { getByText } = render(<OnboardingStep {...defaultProps} />);
10782

@@ -284,22 +259,12 @@ describe('OnboardingStep Component', () => {
284259
});
285260

286261
describe('Layout Structure', () => {
287-
it('renders with proper container structure', () => {
288-
const { getByTestId } = render(<OnboardingStep {...defaultProps} />);
289-
290-
// Verify SafeAreaView is rendered with correct props
291-
const safeAreaView = getByTestId('safe-area-view');
292-
expect(safeAreaView).toBeDefined();
293-
expect(safeAreaView.props.edges).toEqual(['bottom']);
294-
});
295-
296262
it('maintains proper component hierarchy', () => {
297263
const { getByText, getByTestId } = render(
298264
<OnboardingStep {...defaultProps} />,
299265
);
300266

301267
// Verify all main elements are present in the component tree
302-
expect(getByTestId('safe-area-view')).toBeDefined();
303268
expect(getByText('Test Title')).toBeDefined();
304269
expect(getByText('Test Description')).toBeDefined();
305270
expect(getByTestId('test-form-fields')).toBeDefined();

0 commit comments

Comments
 (0)