Skip to content

Commit

Permalink
Release 0.2.16 (#1583)
Browse files Browse the repository at this point in the history
* Loosen nvmrc (#1524)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* bugfix/check for sai method (#1545)

* update docs link in readme (#1521)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Add settings to nav bar (#1544)

* Add settings to nav bar

* Remove settings Icon

* Add icons for all drawer links

* Improvement/tx status notification (#1475)

* simple not update

* text update

* wip

* delete old details

* delete old confirm

* almost done withtx details

* modal working

* modal title

* rm transfer element

* clean

* fix transfer

* transfer and payment channel

* decodeTransferFromTx

* decodeDeploymentTx

* decodeConfirmTx

* onpress

* status

* close on view web

* more cleanup

* payment

* showing not

* closer?

* comment

* tx details and not

* animated

* tx not

* enable access view on not

* animated

* rename

* using txnnot manager

* working

* receive

* rm unused

* rm logs

* handle browser not

* parse date

* handle asset details

* tx summary rename props

* Refactor names in details

* handle primary currency

* missing props

* almost there

* working but browser

* finally

* one more thing

* done

* snaps

* missing locales

* update ethereum address

* snaps

* handle instapay txs

* snaps

* feeless tx

* data check

* No fee

* instance._hideTransactionNotification

* fix instapay notifications

* elevation

* fix remaining issues

* apeed up cancel

* transaction modal

* speed cancel

* speedup cancel ui

* working

* added engine methods

* done

* snaps

* fix qaing

* fix ios build

* one snap

* remove test

* status text fix

* cancelled

* margin

* snaps

* fix insufficient funds

* doc

* Transaction Header Component (#1487)

* Remove redundant imports, remove redundant styles, comment typo correction, remove renderPageInformation(), split props line by line in render(), swap rendering renderPageInformation() with TransactionHeader component, pass props

* added lock and warning icons

* removed domain prop

* new TransactionHeader component, imports, styling, prop types, lock/warning icon change based on URL protocol, network status indicator (color) changes if network is online/not online

* re-generated snapshot for SignatureRequest, created new test for TransactionHeader

* network changes based on selected network

* update snapshot

* update snapshot

* remove function, use css for network capitalization

* move network status logic to renderNetworkStatusIndicator()

* render icon logic moved to renderSecureIcon()

* add comments

* update snapshot

* remove redundant getTrackingParams, use props directly

* remove png icons from image dir, use react native svg icons (FontAwesome), update snapshot

* TransactionHeader: use 'Ethereum' instead of 'Mainnet'

* Add shortnames to networks util, TransactionHeader: use networks util to display network name, update snapshot

* Remove redundant imports, remove redundant styles, comment typo correction, remove renderPageInformation(), split props line by line in render(), swap rendering renderPageInformation() with TransactionHeader component, pass props

* added lock and warning icons

* removed domain prop

* new TransactionHeader component, imports, styling, prop types, lock/warning icon change based on URL protocol, network status indicator (color) changes if network is online/not online

* re-generated snapshot for SignatureRequest, created new test for TransactionHeader

* network changes based on selected network

* update snapshot

* update snapshot

* remove function, use css for network capitalization

* move network status logic to renderNetworkStatusIndicator()

* render icon logic moved to renderSecureIcon()

* add comments

* update snapshot

* remove redundant getTrackingParams, use props directly

* remove png icons from image dir, use react native svg icons (FontAwesome), update snapshot

* TransactionHeader: use 'Ethereum' instead of 'Mainnet'

* Add shortnames to networks util, TransactionHeader: use networks util to display network name, update snapshot

* fixed import error

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Feature/block screenshots (#1495)

* native

* test on wallet

* block in some screens

* ios check

* rm asyncs

* helper

* missing places

* Detect if site has been added to Favorites (#1538)

* Detect if site has been added to Favorites

Previously we were `Alert`ing after attempting to `addBookmark`.

Instead, we remove the option from the menu entirely.

closes: #1511

* Rename isFavorite -> isBookmark

* Use "web-search" keyboardType on iOS (#1539)

* Use web-search keyboard

Use web-search for the omnibar keyboard

* Add new mobile provider (#1517)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Sig request design fixed (#1493)

* new folder for AccountInfoCard component, remove signature_request.title from message, personal & typed sign components, remove redundant style

* SignatureRequest: remove account information from top, proptypes, props, styles, imports

* SignatureRequest: change signing message to 'Sign this message?', make bold and larger

* remove keyboard aware scroll view

* Add AccountInfoCard component to SignatureRequest

* AccountInfoCard: implement proper styling

* AccountInfoCard: use renderShortAddress, fix styles, use conversionRate to display $ amount

* ActionView: add isSigning prop, disables scroll when true, SignatureRequest: pass isSigning=true to ActionView

* AccountInfoCard: remove top level view

* SignatureRequest: apply styles & layout, add website + arrow icons

* Signing components: update styling, rename informationRow --> informationCol

* remove message style

* TypedSign: put back message style, add messageWrapper style, ensure data fits in box and hides overflow

* AccountInfoCard: add snapshot test

* update snapshots

* styling of 'sign this message'

* update snapshot

* update snapshot

* SignatureRequest: Always render arrow if children coming from TypedSign

* SignatureRequest: change to regular component with state to show expanded message content, wrap touchableWithoutFeedback around the message children and move rendering to renderActionViewChildren, tapping the message currently does nothing

* fix dapp icon style, fix render inf loop

* remove textwrap for typed sign. Now renders properly for V1, V3 & V4

* AccountInfoCard: fix paddings, identicon style, use widths instead of flex, float address to left, fix font weights

* TypedSign: use width instead of flex

* SignatureRequest: remove website icon wrapper, fix arrow positioning, remove assetLogo style

* temp disable warning to match style, ensure message fits within box

* PersonalSign: create message wrapper, ensure message fits within box

* Message & Personal Sign: use ellipses mode for text wrapper, drop messageWrapper styles

* SignatureRequest: remove shouldRenderArrow, add shouldRenderArrow prop

* MessageSign: change to stateful component, add renderArrow state, decides if should render arrow upon text component layout, then adjusts the text accordingly

* PersonalSign: change to stateful component, add renderArrow state, decides if should render arrow upon text component layout, then adjusts the text accordingly

* TypedSign: shouldRenderArrow always passes down as true. Will never be a situation where an entire typed message fits in the box

* SignatureRequest: change back to pure component, change handleMessageTap into prop

* change handleMessageTap to toggleExpandedMessage

* TypedSign: implement message expansion and retraction

* modify message, add message_from

* new ExpandedMessage component, rendered by typed, personal & regular message components

* TypedSign: use ExpandedMessage component

* ExpandedMessage: test

* SignatureRequest: add renderArrow prop, make box not expandable if false

* MessageSign: implement message expanding and retracting

* PersonalSign: implement message expand & retract

* ExpandedMessage: add mock fns, update all snapshots

* ActionView: get rid of top border

* new button styles

* signing components: ensure a top left and right rounded border

* change Cancel & Sign to lowercase

* snapshot update

* adjust style for android

* use unique button style for signing components, fix percentage in stylesheet

* change isSigning prop to noScroll

* snapshot update

* update more snapshots

* Signing components: revert to pure component

* AccountInfoCard: use weiToFiat & hexToBn helpers to display fiat value, add currentCurrency prop

* Signing components: shift renderRootView() contents into render()

* update snapshot

* AccountInfoCard, SignatureRequest: fix paddings per design

* AccountInfoCard: remove bottom margin

* TransactionHeader: remove margins, use padding

* MessageSign: larger min height, showWarning prop

* WarningMessage: use flexstart alignment for bell icon

* locales: change eth_sign_warning

* WarningMessage: add object as secondary prop type for warning message

* SignatureRequest: use WarningMessage component, fix paddings, use renderWarning as prop for WarningMessage

* snapshot update yo

* SignatureRequest: move AccountInfoCard ontop of message children

* snapshot update

* AccountInfoCard: remove width

* ActionView: remove no scroll - small devices

* Signing Components: remove root style, move to SignatureRequest

* SignatureRequest: remove style redundancies, add in root style

* SignatureRequest: fix height of modal based on screen height

* ExpandedMessage: fix styling, move scrollview to signing components renderMessage

* ExpandedMessage: Put the scroll back

* PersonalSign: remove expandedMessage text wrapper

* SignatureRequest: fix up styling, add more overhead (reduced from signing components)

* Signing components: reduce view hierarchy, move to SignatureRequest

* Locales: add Read more to signature_request

* AccountInfoCard: add operation prop, if operation is signing, only display the account name and address

* TypedSign: add shouldTruncateMessage & truncateMessage in state

* PersonalSign: remove console log

* Signing components: change renderArrow to truncateMessage

* Nav/Main: add showExpandedMessage to state, add toggleExpandedMessage, configure expanded signing modal to go back on android back button press, pass down props to signing components

* Signing Components: move showExpandedMessage out of state, move out toggleExpandedMessage

* TypedSign: create different messageWrapper height for iOS & Android, fix text clipping mid-line

* ExpandedMessage: fix scrollview

* snapshot update

* AccountInfoCard: use getTicker

* Signing components: change margin bottom from 5 to 4

* Device: new getMediumDevice, SignatureRequest: use getMediumDevice

* ActionView, styledButtonStyles: add cancel button style for signing components

* snapshot update

* SignatureRequest: fix the domain logo not being a circle

* update snapshot

* Use gaba@1.11.0 (#1552)

* Fix settings everywhere (#1556)

* Fix day and month numbers in toDateFormat (#1557)

* Make send flows consistent (#1465)

* Move components and styles from Confirm into TransactionReview

* Add ActionView back in

* Add missing styles

* Revert TransactionReview changes

* Update send screen: from accounts editable and redesign gas edit link

* Use sendflow confirm for payment requests and when editing

* Update sendflow/confirm tests

* Use new send flow designs for instapayment / payment channel transactions

* Use existing send flow screens for deep link transactions

* Fix editing of payment request transactions

* Fix unit tests on consistent-send-flow branch

* Fix navigation for deep link tx edits on the amount screen.

* Refactor: combine transaction and newTransaction reducers

* Fix bugs on consistent-send-flow

* Fix confirm and edit of transactions created from dapps

* Update transaction edit text color

* Only allow changing from field on confirm screen of payment requests

* Fix amount validation for payment channel transactions

* Fix qr payment requests, payment channel payment requests, and token payment requests; plus other small fixes

* Fix token approvals

* Fix sending of decimals on payment channles

* Show correct error messages when accounts are changed and/or token balances are insufficient

* Update navbar options in edit mode

* Ensure tokens cannot be sent in cases where user has not added the token

* Correctly validate payment channel transaction on mount/update

* Use sai.svg instead of dai.svg

Co-authored-by: Dan Miller <danjm.com@gmail.com>
Co-authored-by: Esteban Miño <efmino@uc.cl>

* Use setTimeout hack (again) to get paste context in token search (#1548)

* Use setTimeout hack (again) to get paste context in token search

* Update test

Co-authored-by: Esteban Miño <efmino@uc.cl>

* V0.2.16 (#1561)

* bump

* changelog

* rm entry

* Fix amount validation for large token payment requests (#1572)

* Fix validating of amount when sending a collectible (#1565)

* Fix validating of amount when sending a collectible

* Validate collectible ownership on amount screen.

* Ensure correct updating of collectible transaction after edit on the amount screen

* Ensure collectibles that use 'transfer' method show a fee in tx history list (#1574)

Co-authored-by: Esteban Miño <efmino@uc.cl>

* Disable confirm screen edit button when no tokens of a payment request (#1570)

* Disable confirm screen edit button when account has no tokens of a payment request

* Ensure account switching from undefined token balance accounts enables edit on pay reqs

* Improve logic in componentDidUpdate of send/index.js

* v0.2.16 changelog (#1575)

* Instapay deposit navbar cancel (#1582)

* fix

* works

* rm log

* add this to changelog and update date

* amount title

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Co-authored-by: Jenny Pollack <jennypollack3@gmail.com>
Co-authored-by: ricky <ricky.miller@gmail.com>
Co-authored-by: Etienne Dusseault <etienne.dusseault@gmail.com>
Co-authored-by: Whymarrh Whitby <whymarrh.whitby@gmail.com>
Co-authored-by: Ibrahim Taveras <ibrahimtaveras00@gmail.com>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
  • Loading branch information
8 people authored May 15, 2020
1 parent 7a9a81b commit 558a600
Show file tree
Hide file tree
Showing 117 changed files with 5,065 additions and 3,215 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.16.3
v10
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

## Current Develop Branch

## v0.2.16 - May 15 2020
- [#1582](https://github.com/MetaMask/metamask-mobile/pull/1582): Instapay deposit navbar cancel (#1582)
- [#1570](https://github.com/MetaMask/metamask-mobile/pull/1570): Disable confirm screen edit button when no tokens of a payment request (#1570)
- [#1574](https://github.com/MetaMask/metamask-mobile/pull/1574): Ensure collectibles that use 'transfer' method show a fee in tx history list (#1574)
- [#1565](https://github.com/MetaMask/metamask-mobile/pull/1565): Fix validating of amount when sending a collectible (#1565)
- [#1572](https://github.com/MetaMask/metamask-mobile/pull/1572): Fix amount validation for large token payment requests (#1572)
- [#1561](https://github.com/MetaMask/metamask-mobile/pull/1561): V0.2.16 (#1561)
- [#1548](https://github.com/MetaMask/metamask-mobile/pull/1548): Use setTimeout hack (again) to get paste context in token search (#1548)
- [#1465](https://github.com/MetaMask/metamask-mobile/pull/1465): Make send flows consistent (#1465)
- [#1557](https://github.com/MetaMask/metamask-mobile/pull/1557): Fix day and month numbers in toDateFormat (#1557)
- [#1556](https://github.com/MetaMask/metamask-mobile/pull/1556): Fix settings everywhere (#1556)
- [#1552](https://github.com/MetaMask/metamask-mobile/pull/1552): Use gaba@1.11.0 (#1552)
- [#1493](https://github.com/MetaMask/metamask-mobile/pull/1493): Sig request design fixed (#1493)
- [#1517](https://github.com/MetaMask/metamask-mobile/pull/1517): Add new mobile provider (#1517)
- [#1539](https://github.com/MetaMask/metamask-mobile/pull/1539): Use "web-search" keyboardType on iOS (#1539)
- [#1538](https://github.com/MetaMask/metamask-mobile/pull/1538): Detect if site has been added to Favorites (#1538)
- [#1495](https://github.com/MetaMask/metamask-mobile/pull/1495): Feature/block screenshots (#1495)
- [#1487](https://github.com/MetaMask/metamask-mobile/pull/1487): Transaction Header Component (#1487)
- [#1475](https://github.com/MetaMask/metamask-mobile/pull/1475): Improvement/tx status notification (#1475)
- [#1544](https://github.com/MetaMask/metamask-mobile/pull/1544): Add settings to nav bar (#1544)
- [#1521](https://github.com/MetaMask/metamask-mobile/pull/1521): update docs link in readme (#1521)
- [#1545](https://github.com/MetaMask/metamask-mobile/pull/1545): bugfix/check for sai method (#1545)
- [#1524](https://github.com/MetaMask/metamask-mobile/pull/1524): Loosen nvmrc (#1524)

## v0.2.15 - May 1 2020
- [#1529](https://github.com/MetaMask/metamask-mobile/pull/1529): sentry android production (#1529)
- [#1528](https://github.com/MetaMask/metamask-mobile/pull/1528): Bugfix/sentry in circle ci (#1528)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ MetaMask is a mobile web browser that provides easy access to websites that use

For up to the minute news, follow our [Twitter](https://twitter.com/metamask_io) or [Medium](https://medium.com/metamask) pages.

To learn how to develop MetaMask-compatible applications, visit our [Developer Docs](https://metamask.github.io/metamask-docs/).
To learn how to develop MetaMask-compatible applications, visit our [Developer Docs](https://docs.metamask.io).

## MetaMask Mobile

Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 28
versionName "0.2.15"
versionCode 29
versionName "0.2.16"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy "minReactNative", "minReactNative46"
Expand Down
4 changes: 3 additions & 1 deletion android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.branch.rnbranch.RNBranchPackage;
import io.branch.rnbranch.RNBranchModule;
import io.metamask.nativeModules.RCTAnalyticsPackage;
import io.metamask.nativeModules.PreventScreenshotPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import cl.json.RNSharePackage;
import com.bitgo.randombytes.RandomBytesPackage;
Expand Down Expand Up @@ -74,7 +75,8 @@ protected List<ReactPackage> getPackages() {
new RNOSModule(),
new RNSharePackage(),
new VectorIconsPackage(),
new RCTAnalyticsPackage()
new RCTAnalyticsPackage(),
new PreventScreenshotPackage()
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package io.metamask.nativeModules;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Promise;

import android.view.WindowManager;

import static com.facebook.react.bridge.UiThreadUtil.runOnUiThread;

public class PreventScreenshot extends ReactContextBaseJavaModule {
private static final String PREVENT_SCREENSHOT_ERROR_CODE = "PREVENT_SCREENSHOT_ERROR_CODE";
private final ReactApplicationContext reactContext;

PreventScreenshot(ReactApplicationContext context) {
super(context);
reactContext = context;
}

@Override
public String getName() {
return "PreventScreenshot";
}

@ReactMethod
public void forbid(Promise promise) {
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
getCurrentActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
promise.resolve("Done. Screenshot taking locked.");
} catch(Exception e) {
promise.reject(PREVENT_SCREENSHOT_ERROR_CODE, "Forbid screenshot taking failure.");
}
}
});
}

@ReactMethod
public void allow(Promise promise) {
runOnUiThread(new Runnable() {
@Override
public void run() {
try {
getCurrentActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
promise.resolve("Done. Screenshot taking unlocked.");
} catch (Exception e) {
promise.reject(PREVENT_SCREENSHOT_ERROR_CODE, "Allow screenshot taking failure.");
}
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.metamask.nativeModules;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class PreventScreenshotPackage implements ReactPackage {

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}

@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(new PreventScreenshot(reactContext));
}
}
72 changes: 0 additions & 72 deletions app/actions/newTransaction/index.js

This file was deleted.

98 changes: 96 additions & 2 deletions app/actions/transaction/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,103 @@
import TransactionTypes from '../../core/TransactionTypes';

const {
ASSET: { ETH, ERC20, ERC721 }
} = TransactionTypes;

/**
* Clears transaction object completely
*/
export function newTransaction() {
export function resetTransaction() {
return {
type: 'RESET_TRANSACTION'
};
}

/**
* Starts a new transaction state with an asset
*
* @param {object} selectedAsset - Asset to start the transaction with
*/
export function newAssetTransaction(selectedAsset) {
return {
type: 'NEW_ASSET_TRANSACTION',
selectedAsset,
assetType: selectedAsset.isETH ? ETH : selectedAsset.tokenId ? ERC721 : ERC20
};
}

/**
* Sets transaction to address and ensRecipient in case is available
*
* @param {string} from - Address to send the transaction from
* @param {string} to - Address to send the transaction to
* @param {string} ensRecipient - Resolved ens name to send the transaction to
* @param {string} transactionToName - Resolved address book name for to address
* @param {string} transactionFromName - Resolved address book name for from address
*/
export function setRecipient(from, to, ensRecipient, transactionToName, transactionFromName) {
return {
type: 'SET_RECIPIENT',
from,
to,
ensRecipient,
transactionToName,
transactionFromName
};
}

/**
* Sets asset as selectedAsset
*
* @param {object} selectedAsset - Asset to start the transaction with
*/
export function setSelectedAsset(selectedAsset) {
return {
type: 'SET_SELECTED_ASSET',
selectedAsset,
assetType: selectedAsset.isETH ? ETH : selectedAsset.tokenId ? ERC721 : ERC20
};
}

/**
* Sets transaction object to be sent
*
* @param {object} transaction - Transaction object with from, to, data, gas, gasPrice, value
*/
export function prepareTransaction(transaction) {
return {
type: 'PREPARE_TRANSACTION',
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: 'NEW_TRANSACTION'
type: 'PREPARE_FULL_TRANSACTION',
transaction,
ensRecipient,
transactionToName,
transactionFromName,
selectedAsset,
assetType
};
}

Expand Down
15 changes: 15 additions & 0 deletions app/actions/transactionNotification/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function hideTransactionNotification() {
return {
type: 'HIDE_TRANSACTION_NOTIFICATION'
};
}

export function showTransactionNotification({ autodismiss, transaction, status }) {
return {
type: 'SHOW_TRANSACTION_NOTIFICATION',
isVisible: true,
autodismiss,
transaction,
status
};
}
Loading

0 comments on commit 558a600

Please sign in to comment.