Skip to content

Commit 2a1145f

Browse files
committed
Merge with main
2 parents 5b732ec + f6bd420 commit 2a1145f

File tree

172 files changed

+12082
-6509
lines changed

Some content is hidden

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

172 files changed

+12082
-6509
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/CollectibleModal/CollectibleModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const CollectibleModal = () => {
7272

7373
useEffect(() => {
7474
trackEvent(
75-
createEventBuilder(MetaMetricsEvents.COLLECTIBLE_DETAILS_OPENED)
75+
createEventBuilder(MetaMetricsEvents.NFT_DETAILS_OPENED)
7676
.addProperties({ chain_id: getDecimalChainId(chainId) })
7777
.build(),
7878
);

app/components/UI/Navbar/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ export function getPerpsMarketDetailsNavbar(navigation, title) {
19451945
},
19461946
});
19471947
// Always navigate back to markets page for consistent navigation
1948-
const leftAction = () => navigation.navigate(Routes.PERPS.MARKETS);
1948+
const leftAction = () => navigation.navigate(Routes.PERPS.PERPS_HOME);
19491949

19501950
return {
19511951
headerTitle: () => (
@@ -2021,16 +2021,16 @@ export function getDepositNavbarOptions(
20212021
/>
20222022
)
20232023
: showConfiguration
2024-
? () => (
2025-
<ButtonIcon
2026-
onPress={onConfigurationPress}
2027-
iconName={IconName.MoreHorizontal}
2028-
size={ButtonIconSize.Lg}
2029-
testID="deposit-configuration-menu-button"
2030-
style={styles.headerLeftButton}
2031-
/>
2032-
)
2033-
: null,
2024+
? () => (
2025+
<ButtonIcon
2026+
onPress={onConfigurationPress}
2027+
iconName={IconName.MoreHorizontal}
2028+
size={ButtonIconSize.Lg}
2029+
testID="deposit-configuration-menu-button"
2030+
style={styles.headerLeftButton}
2031+
/>
2032+
)
2033+
: null,
20342034
headerRight: showClose
20352035
? () => (
20362036
<ButtonIcon

app/components/UI/NftGrid/NftGridItemActionSheet.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ import { Alert } from 'react-native';
44
import ActionSheet from '@metamask/react-native-actionsheet';
55
import { strings } from '../../../../locales/i18n';
66
import Engine from '../../../core/Engine';
7-
import { MetaMetricsEvents, useMetrics } from '../../hooks/useMetrics';
8-
import { getDecimalChainId } from '../../../util/networks';
97
import { useTheme } from '../../../util/theme';
108
import { useSelector } from 'react-redux';
11-
import {
12-
selectChainId,
13-
selectSelectedNetworkClientId,
14-
} from '../../../selectors/networkController';
9+
import { selectSelectedNetworkClientId } from '../../../selectors/networkController';
1510

1611
const NftGridItemActionSheet = ({
1712
actionSheetRef,
@@ -20,9 +15,7 @@ const NftGridItemActionSheet = ({
2015
actionSheetRef: React.RefObject<typeof ActionSheet>;
2116
longPressedCollectible: Nft | null;
2217
}) => {
23-
const chainId = useSelector(selectChainId);
2418
const { themeAppearance } = useTheme();
25-
const { trackEvent, createEventBuilder } = useMetrics();
2619
const selectedNetworkClientId = useSelector(selectSelectedNetworkClientId);
2720

2821
const removeNft = () => {
@@ -36,13 +29,6 @@ const NftGridItemActionSheet = ({
3629
selectedNetworkClientId,
3730
);
3831

39-
trackEvent(
40-
createEventBuilder(MetaMetricsEvents.COLLECTIBLE_REMOVED)
41-
.addProperties({
42-
chain_id: getDecimalChainId(chainId),
43-
})
44-
.build(),
45-
);
4632
Alert.alert(
4733
strings('wallet.collectible_removed_title'),
4834
strings('wallet.collectible_removed_desc'),

app/components/UI/Notification/ResetNotificationsModal/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import React, { useContext, useEffect, useRef } from 'react';
33

44
// External dependencies.
5-
import { useMetrics } from '../../../hooks/useMetrics';
65
import BottomSheet, {
76
BottomSheetRef,
87
} from '../../../../component-library/components/BottomSheets/BottomSheet';
@@ -13,13 +12,12 @@ import {
1312
IconName,
1413
IconSize,
1514
} from '../../../../component-library/components/Icons/Icon';
16-
import { MetaMetricsEvents } from '../../../../core/Analytics';
1715
import { useResetNotifications } from '../../../../util/notifications/hooks/useNotifications';
1816
import ModalContent from '../Modal';
1917
import { ToastContext } from '../../../../component-library/components/Toast';
2018
import { ToastVariants } from '../../../../component-library/components/Toast/Toast.types';
19+
2120
const ResetNotificationsModal = () => {
22-
const { trackEvent, createEventBuilder } = useMetrics();
2321
const bottomSheetRef = useRef<BottomSheetRef>(null);
2422
const [isChecked, setIsChecked] = React.useState(false);
2523
const { resetNotifications, loading } = useResetNotifications();
@@ -42,11 +40,6 @@ const ResetNotificationsModal = () => {
4240
const handleCta = async () => {
4341
await resetNotifications().then(() => {
4442
showResultToast();
45-
trackEvent(
46-
createEventBuilder(MetaMetricsEvents.NOTIFICATION_STORAGE_KEY_DELETED)
47-
.addProperties({ settings_type: 'delete_notifications_storage_key' })
48-
.build(),
49-
);
5043
});
5144
};
5245

app/components/UI/Perps/Views/PerpsMarketDetailsView/PerpsMarketDetailsView.test.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ const mockNavigate = jest.fn();
5959
const mockGoBack = jest.fn();
6060
const mockCanGoBack = jest.fn();
6161

62+
// usePerpsNavigation mock functions
63+
const mockNavigateToHome = jest.fn();
64+
const mockNavigateToActivity = jest.fn();
65+
const mockNavigateToOrder = jest.fn();
66+
const mockNavigateToTutorial = jest.fn();
67+
const mockNavigateBack = jest.fn();
68+
6269
// Mock notification feature flag
6370
const mockIsNotificationsFeatureEnabled = jest.fn();
6471

@@ -118,6 +125,7 @@ jest.mock('../../hooks/stream/usePerpsLiveAccount', () => ({
118125
// Mock the selector module first
119126
jest.mock('../../selectors/perpsController', () => ({
120127
selectPerpsEligibility: jest.fn(),
128+
createSelectIsWatchlistMarket: jest.fn(() => jest.fn(() => false)),
121129
}));
122130

123131
// Mock react-redux
@@ -250,6 +258,14 @@ jest.mock('../../hooks', () => ({
250258
usePerpsNetworkManagement: jest.fn(() => ({
251259
ensureArbitrumNetworkExists: jest.fn().mockResolvedValue(undefined),
252260
})),
261+
usePerpsNavigation: jest.fn(() => ({
262+
navigateToHome: mockNavigateToHome,
263+
navigateToActivity: mockNavigateToActivity,
264+
navigateToOrder: mockNavigateToOrder,
265+
navigateToTutorial: mockNavigateToTutorial,
266+
navigateBack: mockNavigateBack,
267+
canGoBack: mockCanGoBack(),
268+
})),
253269
}));
254270

255271
// Mock PerpsMarketStatisticsCard to simplify the test
@@ -959,8 +975,8 @@ describe('PerpsMarketDetailsView', () => {
959975
fireEvent.press(longButton);
960976
});
961977

962-
expect(mockNavigate).toHaveBeenCalledTimes(1);
963-
expect(mockNavigate).toHaveBeenCalledWith(Routes.PERPS.ORDER, {
978+
expect(mockNavigateToOrder).toHaveBeenCalledTimes(1);
979+
expect(mockNavigateToOrder).toHaveBeenCalledWith({
964980
direction: 'long',
965981
asset: 'BTC',
966982
});
@@ -994,8 +1010,8 @@ describe('PerpsMarketDetailsView', () => {
9941010
fireEvent.press(shortButton);
9951011
});
9961012

997-
expect(mockNavigate).toHaveBeenCalledTimes(1);
998-
expect(mockNavigate).toHaveBeenCalledWith(Routes.PERPS.ORDER, {
1013+
expect(mockNavigateToOrder).toHaveBeenCalledTimes(1);
1014+
expect(mockNavigateToOrder).toHaveBeenCalledWith({
9991015
direction: 'short',
10001016
asset: 'BTC',
10011017
});

0 commit comments

Comments
 (0)