Skip to content

Commit

Permalink
Merge branch 'main' into feat/display-snap-name
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/components/UI/Notification/ResetNotificationsModal/index.tsx
#	app/components/Views/AccountConnect/AccountConnect.tsx
#	app/components/Views/Settings/NotificationsSettings/index.test.tsx
#	app/components/Views/Settings/NotificationsSettings/index.tsx
#	app/components/Views/confirmations/Confirm/Confirm.styles.ts
#	app/components/Views/confirmations/components/Confirm/Info/PersonalSign/PersonalSign.styles.ts
#	app/components/Views/confirmations/components/UI/Tooltip/Tooltip.tsx
  • Loading branch information
k-g-j committed Oct 15, 2024
2 parents f110340 + b416eac commit 4e8701e
Show file tree
Hide file tree
Showing 286 changed files with 14,036 additions and 6,681 deletions.
2 changes: 1 addition & 1 deletion .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
ignores:
- '@metamask/oss-attribution-generator'
- 'webpack-cli'
- '@react-native-community/datetimepicker'
- '@react-native-community/slider'
- 'patch-package'
- '@lavamoat/allow-scripts'
- 'babel-plugin-inline-import'
# This is used on the patch for TokenRatesController of Assets controllers, for we to be able to use the last version of it
- cockatiel

Expand Down
28 changes: 8 additions & 20 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
configurations: {
'ios.sim.apiSpecs': {
device: 'ios.simulator',
app: 'ios.debug',
app: 'ios.qa',
testRunner: {
args: {
"$0": "node e2e/api-specs/run-api-spec-tests.js",
Expand All @@ -41,10 +41,9 @@ module.exports = {
device: 'ios.simulator',
app: 'ios.release',
},
// because e2e run on debug mode in bitrise
'android.emu.bitrise.debug': {
device: 'android.bitrise.emulator',
app: 'android.bitrise.debug',
'ios.sim.qa': {
device: 'ios.simulator',
app: 'ios.qa',
},

'android.emu.debug': {
Expand Down Expand Up @@ -86,32 +85,21 @@ module.exports = {
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/MetaMask.app',
build: 'yarn start:ios:e2e',
},
'ios.release': {
'ios.qa': {
type: 'ios.app',
binaryPath:
'ios/build/Build/Products/Release-iphonesimulator/MetaMask.app',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:ios:release:e2e",
},
'android.bitrise.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
build: 'yarn start:android:e2e',
'ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:ios:qa",
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
build: 'yarn start:android:e2e',
},
'android.release': {
type: 'android.apk',
binaryPath:
'android/app/build/outputs/apk/prod/release/app-prod-release.apk',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:android:release:e2e",
},
'android.qa': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/qa/release/app-qa-release.apk',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa:e2e",
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa",
},
},
};
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @MetaMask/mobile-devs

# Design System Team
app/component-library/ @MetaMask/design-system-engineers @MetaMask/mobile-platform
app/component-library/ @MetaMask/design-system-engineers

# Platform Team
patches/ @MetaMask/mobile-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ VERSION_BRANCHES=$(git branch -r | grep -o 'release/[0-9]*\.[0-9]*\.[0-9]*' | gr
VERSION_TAGS=$(git tag | grep -o 'v[0-9]*\.[0-9]*\.[0-9]*' | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | sort --version-sort | tail -n 1)

# Get the version from package.json
VERSION_PACKAGE=$(node -p "require('./package.json').version")
VERSION_PACKAGE=$(node -p "require('../../package.json').version")

# Compare versions and keep the highest one
HIGHEST_VERSION=$(printf "%s\n%s\n%s" "$VERSION_BRANCHES" "$VERSION_TAGS" "$VERSION_PACKAGE" | sort --version-sort | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: get-next-semver-version
env:
FORCE_NEXT_SEMVER_VERSION: ${{ vars.FORCE_NEXT_SEMVER_VERSION }}
run: ./scripts/get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION"
run: ./get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION"
working-directory: '.github/scripts'

- name: Add release label to PR and linked issues
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ jobs:
bundler-cache: true
env:
BUNDLE_GEMFILE: ios/Gemfile
- name: Determine whether the current PR is a draft
id: set-is-draft
if: github.event_name == 'pull_request' && github.event.pull_request.number
run: echo "IS_DRAFT=$(gh pr view --json isDraft --jq '.isDraft' "${PR_NUMBER}")" >> "$GITHUB_OUTPUT"
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup registry config for using package previews on draft PRs
if: github.event_name == 'pull_request' && steps.set-is-draft.outputs.IS_DRAFT == 'true'
run: printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${PACKAGE_READ_TOKEN}" > .npmrc
env:
PACKAGE_READ_TOKEN: ${{ secrets.PACKAGE_READ_TOKEN }}
- run: yarn setup
- name: Require clean working directory
shell: bash
Expand Down Expand Up @@ -179,14 +167,14 @@ jobs:
with:
name: ios-bundle
path: ios/main.jsbundle

ship-js-bundle-size-check:
runs-on: ubuntu-latest
needs: [js-bundle-size-check]
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4

- name: Download iOS bundle
uses: actions/download-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .storybook/storybook.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const getStories = () => {
"./app/components/Views/confirmations/components/UI/InfoRow/InfoRow.stories.tsx": require("../app/components/Views/confirmations/components/UI/InfoRow/InfoRow.stories.tsx"),
"./app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx": require("../app/components/Views/confirmations/components/UI/ExpandableSection/ExpandableSection.stories.tsx"),
"./app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx": require("../app/components/Views/confirmations/components/UI/Tooltip/Tooltip.stories.tsx"),
"./app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx": require("../app/components/Views/confirmations/components/UI/CopyButton/CopyButton.stories.tsx"),
};
};

Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ android {
release {
manifestPlaceholders.isDebug = false
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules.pro"
}
}

Expand Down
1 change: 1 addition & 0 deletions app/actions/notification/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum notificationsErrors {
UPDATE_TRIGGER_PUSH_NOTIFICATIONS = 'Error while trying to update trigger push notifications',
ENABLE_NOTIFICATIONS_SERVICES = 'Error while trying to enable notifications services',
DISABLE_NOTIFICATIONS_SERVICES = 'Error while trying to disable notifications services',
DELETE_STORAGE_KEY = 'Error while trying to delete storage key',
}

export default notificationsErrors;
17 changes: 17 additions & 0 deletions app/actions/notification/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,20 @@ export const markMetamaskNotificationsAsRead = async (
return getErrorMessage(error);
}
};
/**
* Perform the deletion of the notifications storage key and the creation of on chain triggers to reset the notifications.
*
* @returns {Promise<string | undefined>} A promise that resolves to a string error message or undefined if successful.
*/
export const performDeleteStorage = async (): Promise<string | undefined> => {
try {
await Engine.context.UserStorageController.performDeleteStorage(
'notifications.notification_settings',
);
await Engine.context.NotificationServicesController.createOnChainTriggers({
resetNotifications: true,
});
} catch (error) {
return getErrorMessage(error);
}
};
16 changes: 15 additions & 1 deletion app/actions/security/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum ActionType {
SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN = 'SET_AUTOMATIC_SECURITY_CHECKS_MODAL_OPEN',
SET_DATA_COLLECTION_FOR_MARKETING = 'SET_DATA_COLLECTION_FOR_MARKETING',
SET_NFT_AUTO_DETECTION_MODAL_OPEN = 'SET_NFT_AUTO_DETECTION_MODAL_OPEN',
SET_MULTI_RPC_MIGRATION_MODAL_OPEN = 'SET_MULTI_RPC_MIGRATION_MODAL_OPEN',
}

export interface AllowLoginWithRememberMeUpdated
Expand Down Expand Up @@ -35,6 +36,11 @@ export interface SetNftAutoDetectionModalOpen
open: boolean;
}

export interface SetMultiRpcMigrationModalOpen
extends ReduxAction<ActionType.SET_MULTI_RPC_MIGRATION_MODAL_OPEN> {
open: boolean;
}

export interface SetDataCollectionForMarketing
extends ReduxAction<ActionType.SET_DATA_COLLECTION_FOR_MARKETING> {
enabled: boolean;
Expand All @@ -46,7 +52,8 @@ export type Action =
| UserSelectedAutomaticSecurityChecksOptions
| SetAutomaticSecurityChecksModalOpen
| SetDataCollectionForMarketing
| SetNftAutoDetectionModalOpen;
| SetNftAutoDetectionModalOpen
| SetMultiRpcMigrationModalOpen;

export const setAllowLoginWithRememberMe = (
enabled: boolean,
Expand Down Expand Up @@ -82,6 +89,13 @@ export const setNftAutoDetectionModalOpen = (
open,
});

export const setMultiRpcMigrationModalOpen = (
open: boolean,
): SetMultiRpcMigrationModalOpen => ({
type: ActionType.SET_MULTI_RPC_MIGRATION_MODAL_OPEN,
open,
});

export const setDataCollectionForMarketing = (enabled: boolean) => ({
type: ActionType.SET_DATA_COLLECTION_FOR_MARKETING,
enabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const CellSelectWithMenu = ({
tagLabel,
isSelected = false,
children,
withAvatar = true,
...props
}: CellSelectWithMenuProps) => {
const { styles } = useStyles(styleSheet, { style });
Expand All @@ -46,12 +47,15 @@ const CellSelectWithMenu = ({
>
<View style={styles.cellBase}>
{/* DEV Note: Account Avatar should be replaced with Avatar with Badge whenever available */}
<Avatar
style={styles.avatar}
testID={CellModalSelectorsIDs.BASE_AVATAR}
size={DEFAULT_CELLBASE_AVATAR_SIZE}
{...avatarProps}
/>
{withAvatar ? (
<Avatar
style={styles.avatar}
testID={CellModalSelectorsIDs.BASE_AVATAR}
size={DEFAULT_CELLBASE_AVATAR_SIZE}
{...avatarProps}
/>
) : null}

<View style={styles.cellBaseInfo}>
<Text
numberOfLines={1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] =
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
"paddingRight": 20,
"width": "100%",
}
}
>
<TouchableOpacity
disabled={false}
style={
{
"flex": 1,
"opacity": 1,
"padding": 16,
"position": "relative",
"width": "95%",
"zIndex": 1,
}
}
Expand Down Expand Up @@ -287,7 +285,13 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] =
</View>
</View>
</TouchableOpacity>
<View>
<View
style={
{
"paddingHorizontal": 20,
}
}
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ListItemMultiSelectButtonProps } from './ListItemMultiSelectButton.type
// Defaults
export const DEFAULT_LISTITEMMULTISELECT_GAP = 16;
export const BUTTON_TEST_ID = 'button-menu-select-test-id';
export const BUTTON_TEXT_TEST_ID = 'button-text-select-test-id';

// Sample consts
export const SAMPLE_LISTITEMMULTISELECT_PROPS: ListItemMultiSelectButtonProps =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const styleSheet = (params: {
return StyleSheet.create({
base: Object.assign(
{
flex: 1,
position: 'relative',
opacity: isDisabled ? 0.5 : 1,
padding: 16,
width: '95%',
zIndex: 1,
} as ViewStyle,
style,
Expand Down Expand Up @@ -71,10 +71,8 @@ const styleSheet = (params: {
backgroundColor: isSelected
? colors.primary.muted
: colors.background.default,
paddingRight: 20,
flexDirection: 'row',
alignItems: 'center',
width: '100%',
},
itemColumn: {
display: 'flex',
Expand All @@ -86,6 +84,9 @@ const styleSheet = (params: {
paddingLeft: 8,
paddingTop: 32,
},
buttonIcon: {
paddingHorizontal: 20,
},
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ describe('ListItemMultiSelectButton', () => {
const { getByRole } = render(
<ListItemMultiSelectButton
onPress={mockOnPress}
onButtonClick={mockOnPress}
buttonProps={{
onButtonClick: mockOnPress,
}}
>
<View />
</ListItemMultiSelectButton>,
Expand All @@ -64,7 +66,9 @@ describe('ListItemMultiSelectButton', () => {
const { getByTestId } = render(
<ListItemMultiSelectButton
buttonIcon={IconName.Check}
onButtonClick={mockOnButtonClick}
buttonProps={{
onButtonClick: mockOnButtonClick,
}}
>
<View />
</ListItemMultiSelectButton>,
Expand Down
Loading

0 comments on commit 4e8701e

Please sign in to comment.