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

chore: merge main into release 7.1.0 branch #6648

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 6 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ jobs:
echo "Working tree dirty at end of job"
exit 1
fi
pr-linter:
runs-on: ubuntu-latest
steps:
# v5.2.0
- name: Conventional Commit Validation PR Title
uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
scripts:
runs-on: ubuntu-20.04
needs: setup
Expand Down Expand Up @@ -77,19 +69,18 @@ jobs:
- run: yarn test:unit --forceExit --silent
env:
NODE_OPTIONS: --max_old_space_size=20480
- name: SonarCloud Scan
# v1.9.1
uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
# Enable when team has access
# call-sonar-workflow:
# needs: tests
# uses: ./.github/workflows/sonar.yml
# secrets:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
check-workflows:
name: Check workflows
runs-on: ubuntu-latest
Expand All @@ -105,6 +96,6 @@ jobs:
all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-20.04
needs: [setup, scripts, tests, check-workflows, pr-linter]
needs: [setup, scripts, tests, check-workflows]
steps:
- run: echo "Great success!"
15 changes: 15 additions & 0 deletions .github/workflows/pr-title-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Conventional Commit Validation PR Title"
on:
pull_request:
branches:
- main
types: [opened,edited]

jobs:
pr-title-linter:
runs-on: ubuntu-latest
steps:
# v5.2.0
- uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/remove_labels_after_pr_closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Remove labels after issue (or PR) closed

on:
issues:
types: [closed]
pull_request:
types: [closed]

jobs:
cleanup:
runs-on: ubuntu-latest

steps:
- name: Remove labels
env:
REPO: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

run: |
LABELS=(
"product-backlog"
"needs-design"
"design-in-progress"
"ready-for-dev"
"sprint-backlog"
"in-progress"
"blocked"
"needs-dev-review"
"needs-qa"
"issues-found"
"ready-for-release"
)

for LABEL in "${LABELS[@]}"; do
curl \
-X DELETE \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/labels/$LABEL"
done
23 changes: 0 additions & 23 deletions .github/workflows/sonar.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/stale-issue-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
with:
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.'
stale-issue-label: 'stale'
only-issue-labels: 'type-bug'
exempt-issue-labels: 'type-security, type-pinned, feature-request, awaiting-metamask'
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.'
stale-pr-label: 'stale'
Expand All @@ -24,4 +25,5 @@ jobs:
days-before-pr-stale: 90
days-before-issue-close: 7
days-before-pr-close: 7
operations-per-run: 200

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
- [#6228](https://github.com/MetaMask/metamask-mobile/pull/6228): [UPDATE] Checkbox component
- [#6226](https://github.com/MetaMask/metamask-mobile/pull/6226): [UPDATE] Button's icon props and button org


## 6.5.0 - May 4, 2023
- [#5743](https://github.com/MetaMask/metamask-mobile/pull/5743): [FEATURE] On-ramp: Add buy-crypto deeplink
- [#6201](https://github.com/MetaMask/metamask-mobile/pull/6201): [FIX] [SDK] Missing redirect breaking backward compatibility
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ GEM
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.2.4)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
Expand All @@ -87,6 +87,7 @@ GEM

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
cocoapods (>= 1.11.3)
Expand Down
7 changes: 0 additions & 7 deletions app/actions/modals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ export function toggleDappTransactionModal(show) {
};
}

export function toggleApproveModal(show) {
return {
type: 'TOGGLE_APPROVE_MODAL',
show,
};
}

export function toggleInfoNetworkModal(show) {
return {
type: 'TOGGLE_INFO_NETWORK_MODAL',
Expand Down
30 changes: 0 additions & 30 deletions app/actions/transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,6 @@ export function prepareTransaction(transaction) {
};
}

/**
* Sets transaction object to be sent. All properties can be updated
*
* @param {object} config
* @param {object} config.transaction - Transaction object with from, to, data, gas, gasPrice, value
* @param {string} config.ensRecipient - Resolved ens name to send the transaction to
* @param {string} config.transactionToName - Resolved address book name for to address
* @param {string} config.transactionFromName - Resolved address book name for from address
* @param {object} config.selectedAsset - Asset to start the transaction with
* @param {string} config.assetType - The selectedAsset's type
*/
export function prepareFullTransaction({
transaction,
ensRecipient,
transactionToName,
transactionFromName,
selectedAsset,
assetType,
}) {
return {
type: 'PREPARE_FULL_TRANSACTION',
transaction,
ensRecipient,
transactionToName,
transactionFromName,
selectedAsset,
assetType,
};
}

/**
* Sets any attribute in transaction object
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';
import { AccountBalanceProps } from './AccountBalance.types';

import Card from '../../../components/Cards/Card';
import AccountBase from '../AccountBase/AccountBase';
import { ACCOUNT_BALANCE_TEST_ID } from './AccountBalance.constants';
import styles from './AccountBalance.styles';
import { AccountBalanceProps } from './AccountBalance.types';

const AccountBalance = ({
accountBalance,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import { View } from 'react-native';
import { AccountBaseProps } from './AccountBase.types';
import Text, { TextVariant } from '../../../components/Texts/Text';
import BadgeWrapper from '../../../components/Badges/BadgeWrapper';

import Badge from '../../../../component-library/components/Badges/Badge';
import Avatar, { AvatarVariants } from '../../../components/Avatars/Avatar';
import { AvatarAccountType } from '../../../components/Avatars/Avatar/variants/AvatarAccount';
import BadgeWrapper from '../../../components/Badges/BadgeWrapper';
import Text, { TextVariant } from '../../../components/Texts/Text';
import {
ACCOUNT_BALANCE_AVATAR_TEST_ID,
ACCOUNT_BASE_TEST_ID,
} from './AccountBase.constants';
import styles from './AccountBase.styles';
import { AccountBaseProps } from './AccountBase.types';

const AccountBase = ({
accountBalance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const styleSheet = (params: { theme: Theme }) => {
flexDirection: 'row',
justifyContent: 'space-between',
},
fixedPadding: {
padding: 0,
},
body: {
flexDirection: 'row',
flex: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { shallow } from 'enzyme';
// Third party dependencies.
import React from 'react';
import { shallow } from 'enzyme';

// External dependencies.
import { TICKER } from '../CustomSpendCap.constants';

// Internal dependencies.
import CustomInput from './CustomInput';
import { CustomInputProps } from './CustomInput.types';
Expand All @@ -16,9 +15,9 @@ describe('CustomInput', () => {
props = {
ticker: TICKER,
value: '123',
inputDisabled: true,
isInputGreaterThanBalance: false,
isEditDisabled: false,
setMaxSelected: jest.fn(),
defaultValueSelected: true,
setValue: jest.fn(),
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
import React from 'react';
import { TextInput, View } from 'react-native';

// External dependencies.
import { useStyles } from '../../../hooks';
import formatNumber from '../../../../util/formatNumber';
import { strings } from '../../../../../locales/i18n';
import formatNumber from '../../../../util/formatNumber';
import Text, { TextVariant } from '../../../components/Texts/Text';

// Internal dependencies.
import { CustomInputProps } from './CustomInput.types';
// External dependencies.
import { useStyles } from '../../../hooks';
import CUSTOM_INPUT_TEST_ID from './CustomInput.constants';
import stylesheet from './CustomInput.styles';
// Internal dependencies.
import { CustomInputProps } from './CustomInput.types';

const CustomInput = ({
ticker,
value,
inputDisabled,
setMaxSelected,
defaultValueSelected,
isInputGreaterThanBalance,
setValue,
isEditDisabled,
}: CustomInputProps) => {
const handleUpdate = (text: string) => {
setValue(text);
Expand All @@ -29,33 +28,50 @@ const CustomInput = ({
setMaxSelected(true);
};

const { styles } = useStyles(stylesheet, {});
const {
styles,
theme: { colors },
} = useStyles(stylesheet, {});

const onChangeValueText = (text: string) => {
handleUpdate(text);
setMaxSelected(false);
};

return (
<View style={styles.container} testID={CUSTOM_INPUT_TEST_ID}>
<View
style={[
styles.container,
isEditDisabled && {
...styles.container,
...styles.fixedPadding,
backgroundColor: colors.background.alternative,
},
]}
testID={CUSTOM_INPUT_TEST_ID}
>
<View style={styles.body}>
{inputDisabled ? (
{!isEditDisabled ? (
<TextInput
multiline
onChangeText={onChangeValueText}
value={value}
placeholder={`Enter a number here (${ticker})`}
placeholder={strings(
'contract_allowance.custom_spend_cap.enter_number',
)}
keyboardType="numeric"
style={styles.input}
style={[
styles.input,
isInputGreaterThanBalance && styles.warningValue,
]}
/>
) : defaultValueSelected ? (
) : (
<Text
variant={TextVariant.BodyMD}
style={styles.warningValue}
style={isInputGreaterThanBalance && styles.warningValue}
>{`${formatNumber(value)} ${ticker}`}</Text>
) : null}
)}
</View>
{inputDisabled && (
{!isEditDisabled && (
<Text
variant={TextVariant.BodySM}
style={styles.maxValueText}
Expand Down
Loading