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

[UPGRADE] - update dependencies #4568

Merged
merged 27 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4002b27
5.3.0
metamaskbot Jun 16, 2022
b6dece6
update changelog
cortisiko Jun 16, 2022
fa74f37
update change log
cortisiko Jun 16, 2022
b124853
Update changelog
Jun 16, 2022
ef6af09
Merge branch 'release/5.3.0' of https://github.com/MetaMask/metamask-…
Jun 16, 2022
dc5e493
Update changelog
Jun 16, 2022
add16fb
Update changelog
Jun 16, 2022
341258a
Update CHANGELOG.md
cortisiko Jun 17, 2022
7e96d91
Update CHANGELOG.md
cortisiko Jun 17, 2022
d25a124
Fix onramp error loop by providing payment method change (#4528)
wachunei Jun 20, 2022
c1042e8
Add resolution for shell-quote & got (#4559)
gantunesr Jun 21, 2022
987504b
[5.3] BugFix missing close button in popular network (#4545)
blackdevelopa Jun 22, 2022
ef04558
[5.3] bugfix: for network asset education modal when network is added…
blackdevelopa Jun 22, 2022
b4d6d79
added regex to validate contract allowance contains only integers or …
sethkfman Jun 22, 2022
9d06d05
[5.3] Feature/4479 update whats new modal (#4480)
Cal-L Jun 22, 2022
142b1b9
Bump build number
gantunesr Jun 22, 2022
283f1ff
Merge branch 'release/5.3.0' of https://github.com/MetaMask/metamask-…
gantunesr Jun 22, 2022
0a43236
[5.3] Change Whats New CTA (#4566)
wachunei Jun 22, 2022
e9787f1
update got dependency and test cases
sethkfman Jun 22, 2022
8300248
Merge branch 'release/5.3.0' into fix/dependency-update-got
sethkfman Jun 22, 2022
31794b4
updated with release branch and added heremes resolution
sethkfman Jun 22, 2022
1481beb
merge conflict with release in yarn lock file
sethkfman Jun 22, 2022
bff09d4
removed 1075647 from audit exclusions
sethkfman Jun 22, 2022
a2726db
updated App test
sethkfman Jun 22, 2022
80782f9
removed e2e updates
sethkfman Jun 22, 2022
f04ce35
Solve conflicts with main
gantunesr Jun 22, 2022
e47eff6
Update yarn lock
gantunesr Jun 22, 2022
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
2 changes: 1 addition & 1 deletion .iyarc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# improved-yarn-audit advisory exclusions
# improved-yarn-audit advisory exclusions
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Changelog

## Current Main Branch
- [#4506](https://github.com/MetaMask/metamask-mobile/pull/4506): [IMPROVEMENT] Add OnRamp aggregator translations
- [#4389](https://github.com/MetaMask/metamask-mobile/pull/4389): [FEAT] Easy delete data
- [#4510](https://github.com/MetaMask/metamask-mobile/pull/4510): [IMPROVEMENT] Update RPC URL for xDai
- [#4269](https://github.com/MetaMask/metamask-mobile/pull/4269): [IMPROVEMENT] Show amount being approved by default on approval screens
- [#4495](https://github.com/MetaMask/metamask-mobile/pull/4495): [FIX] WalletConnect Icon on connect screen
- [#4505](https://github.com/MetaMask/metamask-mobile/pull/4505): [FIX] Updated new rpcUrl of gnosischain on test file
- [#4442](https://github.com/MetaMask/metamask-mobile/pull/4442): [FIX] Skip to amount to buy when region is selected
- [#4501](https://github.com/MetaMask/metamask-mobile/pull/4501): [FIX] Add accesible false to pressable group preventing VoiceOver interaction
- [#4247](https://github.com/MetaMask/metamask-mobile/pull/4247): [IMPROVEMENT] Add rounded corners to svg NFTs
- [#4470](https://github.com/MetaMask/metamask-mobile/pull/4470): [FIX] Add minimum required params to orders
- [#4469](https://github.com/MetaMask/metamask-mobile/pull/4469): [FIX] Displaying notification when state changes
- [#4443](https://github.com/MetaMask/metamask-mobile/pull/4443): [FIX] Wrong analytics property for region event
- [#4468](https://github.com/MetaMask/metamask-mobile/pull/4468): [FIX] Wrong amount out for onramp analytics
- [#4418](https://github.com/MetaMask/metamask-mobile/pull/4418): [IMPROVEMENT] Address Verification
- [#3783](https://github.com/MetaMask/metamask-mobile/pull/3783): [FEAT] Add custom networks
- [#4131](https://github.com/MetaMask/metamask-mobile/pull/4131): [FIX] Add method for crypto that are not in ISO4217
- [#4187](https://github.com/MetaMask/metamask-mobile/pull/4187): [IMPROVEMENT] Update copy in Edit & Advance Screens
- [#4060](https://github.com/MetaMask/metamask-mobile/pull/4060): [FIX] Avoid canceling transactions after submission
- [#4478](https://github.com/MetaMask/metamask-mobile/pull/4478): [IMPROVEMENT] Video subtitles
- [#4429](https://github.com/MetaMask/metamask-mobile/pull/4429): [FIX] Prompt camera permission
- [#4440](https://github.com/MetaMask/metamask-mobile/pull/4440): [FIX] Updating instances of "Metamask" to "MetaMask"
- [#4438](https://github.com/MetaMask/metamask-mobile/pull/4438): [FIX] Resolved spelling mistake
- [#4445](https://github.com/MetaMask/metamask-mobile/pull/4445): [FIX] Adding resolutions for security critical packages
- [#3943](https://github.com/MetaMask/metamask-mobile/pull/3943): [FIX] Remove old gas estimation
- [#4070](https://github.com/MetaMask/metamask-mobile/pull/4070): [IMPROVEMENT] Update SelectQRAccounts UI
- [#4178](https://github.com/MetaMask/metamask-mobile/pull/4178): [FIX] Prevent crash when funds warning is pressed
- [#4367](https://github.com/MetaMask/metamask-mobile/pull/4367): [IMPROVEMENT] Make text hex data selectable

## 5.2.0 - May 17, 2022
- [#4349](https://github.com/MetaMask/metamask-mobile/pull/4349): [FIX] Subtitle mapping
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 913
versionName "5.2.0"
versionCode 926
versionName "5.3.0"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Device from '../../../../util/device';
import ErrorMessage from '../../../Views/SendFlow/ErrorMessage';
import { useAppThemeFromContext, mockTheme } from '../../../../util/theme';
import formatNumber from '../../../../util/formatNumber';
import { INTEGER_OR_FLOAT_REGEX } from '../../../../util/number';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -120,7 +121,8 @@ function EditPermission({

const displayErrorMessage = useMemo(
() =>
!spendLimitUnlimitedSelected &&
(!spendLimitUnlimitedSelected &&
!INTEGER_OR_FLOAT_REGEX.test(spendLimitCustomValue)) ||
Number(minimumSpendLimit) > spendLimitCustomValue,
[spendLimitUnlimitedSelected, spendLimitCustomValue, minimumSpendLimit],
);
Expand Down
24 changes: 16 additions & 8 deletions app/components/UI/DrawerView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ class DrawerView extends PureComponent {
currentRoute,
networkOnboarding,
networkOnboardedState,
switchedNetwork,
switchedNetwork: { networkUrl, networkStatus },
networkModalVisible,
} = this.props;
const colors = this.context.colors || mockTheme.colors;
Expand Down Expand Up @@ -1196,9 +1196,19 @@ class DrawerView extends PureComponent {
const fiatBalanceStr = renderFiat(this.currentBalance, currentCurrency);
const accountName = isDefaultAccountName(name) && ens ? ens : name;
const checkIfCustomNetworkExists = networkOnboardedState.filter(
(item) => item.network === sanitizeUrl(switchedNetwork.networkUrl),
(item) => item.network === sanitizeUrl(networkUrl),
);

const networkSwitchedAndInWalletView =
currentRoute === 'WalletView' &&
networkStatus &&
checkIfCustomNetworkExists.length === 0;

const canShowNetworkInfoModal =
showModal ||
networkOnboarding.showNetworkOnboarding ||
networkSwitchedAndInWalletView;

return (
<View style={styles.wrapper} testID={'drawer-screen'}>
<ScrollView>
Expand Down Expand Up @@ -1365,19 +1375,17 @@ class DrawerView extends PureComponent {
isVisible={
networkModalVisible || networkOnboarding.showNetworkOnboarding
}
onBackdropPress={showModal ? null : this.toggleNetworksModal}
onBackdropPress={
canShowNetworkInfoModal ? null : this.toggleNetworksModal
}
onBackButtonPress={showModal ? null : this.toggleNetworksModa}
onSwipeComplete={showModal ? null : this.toggleNetworksModa}
swipeDirection={'down'}
propagateSwipe
backdropColor={colors.overlay.default}
backdropOpacity={1}
>
{showModal ||
networkOnboarding.showNetworkOnboarding ||
(currentRoute === 'WalletView' &&
switchedNetwork.networkStatus &&
checkIfCustomNetworkExists.length === 0) ? (
{canShowNetworkInfoModal ? (
<NetworkInfo
onClose={this.onInfoNetworksModalClose}
type={networkType || networkOnboarding.networkType}
Expand Down
21 changes: 12 additions & 9 deletions app/components/UI/FiatOnRampAggregator/Views/AmountToBuy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -722,24 +722,27 @@ const AmountToBuy = () => {
<ScreenLayout>
<ScreenLayout.Body>
<ErrorView
icon="info"
title={strings('fiat_on_ramp_aggregator.no_tokens_available_title')}
description={strings(
'fiat_on_ramp_aggregator.no_tokens_available',
{
network: NETWORKS_NAMES[selectedChainId],
region: selectedRegion?.name,
},
)}
ctaLabel={strings('fiat_on_ramp_aggregator.try_different_region')}
ctaOnPress={toggleRegionModal as () => void}
ctaLabel={strings('fiat_on_ramp_aggregator.change_payment_method')}
ctaOnPress={showPaymentMethodsModal as () => void}
/>
</ScreenLayout.Body>
<RegionModal
isVisible={isRegionModalVisible}
title={strings('fiat_on_ramp_aggregator.region.title')}
description={strings('fiat_on_ramp_aggregator.region.description')}
data={countries}
dismiss={hideRegionModal as () => void}
onRegionPress={handleRegionPress}
<PaymentMethodModal
isVisible={isPaymentMethodModalVisible}
dismiss={hidePaymentMethodModal as () => void}
title={strings('fiat_on_ramp_aggregator.select_payment_method')}
paymentMethods={filteredPaymentMethods}
selectedPaymentMethodId={selectedPaymentMethodId}
onItemPress={handleChangePaymentMethod}
location={'Amount to Buy Screen'}
/>
</ScreenLayout>
);
Expand Down
46 changes: 39 additions & 7 deletions app/components/UI/FiatOnRampAggregator/components/ErrorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { Colors } from '../../../../util/theme/models';
const Text = BaseText as any;
const Title = BaseTitle as any;

type IconType = 'error' | 'info';

const createStyles = (colors: Colors) =>
StyleSheet.create({
screen: {
Expand All @@ -31,22 +33,55 @@ const createStyles = (colors: Colors) =>
row: {
marginVertical: 1,
},
errorIcon: {
color: colors.error.default,
icon: {
fontSize: 38,
marginVertical: 4,
textAlign: 'center',
},
errorIcon: {
color: colors.error.default,
},
infoIcon: {
color: colors.primary.default,
},
});

interface Props {
description: string; // The error description (Required)
title?: string; // The error title, default will be "Error" if not provided (Optional)
ctaLabel?: string; // The CTA button label, default will be "Try again" (Optional)
ctaOnPress?: () => any; // The optional callback to be invoked when pressing the CTA button (Optional)
icon?: IconType;
}

function ErrorIcon({ icon }: { icon: IconType }) {
const { colors } = useTheme();
const styles = createStyles(colors);
let name, style;
switch (icon) {
case 'info': {
name = 'information-outline';
style = styles.infoIcon;
break;
}
case 'error':
default: {
name = 'close-circle-outline';
style = styles.errorIcon;
break;
}
}

return <MaterialCommunityIcons name={name} style={[styles.icon, style]} />;
}

function ErrorView({ description, title, ctaLabel, ctaOnPress }: Props) {
function ErrorView({
description,
title,
ctaLabel,
ctaOnPress,
icon = 'error',
}: Props) {
const { colors } = useTheme();
const styles = createStyles(colors);

Expand All @@ -58,10 +93,7 @@ function ErrorView({ description, title, ctaLabel, ctaOnPress }: Props) {
<View style={styles.screen}>
<View style={styles.content}>
<View style={styles.row}>
<MaterialCommunityIcons
name="close-circle-outline"
style={styles.errorIcon}
/>
<ErrorIcon icon={icon} />
</View>

<View style={styles.row}>
Expand Down
2 changes: 0 additions & 2 deletions app/components/UI/NetworkModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ const NetworkModals = (props: NetworkProps) => {
isVisible
toggleModal={showToolTip}
message={strings('networks.provider')}
clickText={undefined}
clickPress={undefined}
/>
)}
<View style={styles.nameWrapper} testID={APPROVE_NETWORK_MODAL_ID}>
Expand Down
66 changes: 41 additions & 25 deletions app/components/UI/Swaps/components/InfoModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ const createStyles = (colors) =>
paddingHorizontal: 20,
},
messageLimit: {
width: '90%',
marginVertical: 10,
width: '80%',
},
infoContainer: {
flexDirection: 'row',
justifyContent: 'space-between',
width: '100%',
},
});

Expand All @@ -62,12 +66,41 @@ function InfoModal({
toggleModal,
message,
propagateSwipe,
clickText,
clickPress,
urlText,
url,
}) {
const { colors } = useAppThemeFromContext() || mockTheme;
const styles = createStyles(colors);

const CloseButton = () => (
<TouchableOpacity
onPress={toggleModal}
hitSlop={{ top: 20, left: 20, right: 20, bottom: 20 }}
>
<IonicIcon name="ios-close" style={styles.closeIcon} size={30} />
</TouchableOpacity>
);

const InfoView = () => {
if (!message) {
return <CloseButton />;
}

return (
<View style={styles.infoContainer}>
<Text style={styles.messageLimit}>
<Text>{message} </Text>
{urlText && (
<Text link onPress={url}>
{urlText}
</Text>
)}
</Text>
<CloseButton />
</View>
);
};

return (
<Modal
isVisible={isVisible}
Expand All @@ -78,29 +111,12 @@ function InfoModal({
style={styles.modal}
propagateSwipe={propagateSwipe}
backdropColor={colors.overlay.default}
backdropOpacity={clickText ? 0.2 : 1}
backdropOpacity={1}
>
<SafeAreaView style={styles.modalView}>
<View style={styles.title}>
{title && <Title>{title}</Title>}
{message && (
<Text style={styles.messageLimit}>
<Text>{message} </Text>
{clickText && (
<Text link onPress={clickPress}>
{clickText}
</Text>
)}
</Text>
)}
{!message && (
<TouchableOpacity
onPress={toggleModal}
hitSlop={{ top: 20, left: 20, right: 20, bottom: 20 }}
>
<IonicIcon name="ios-close" style={styles.closeIcon} size={30} />
</TouchableOpacity>
)}
<InfoView />
</View>
{body && <View style={styles.body}>{body}</View>}
</SafeAreaView>
Expand All @@ -114,8 +130,8 @@ InfoModal.propTypes = {
toggleModal: PropTypes.func,
propagateSwipe: PropTypes.bool,
message: PropTypes.string,
clickText: PropTypes.string,
clickPress: PropTypes.func,
urlText: PropTypes.string,
url: PropTypes.func,
};

export default InfoModal;
Loading