Merge pull request #276 from gnosis/development

Development
This commit is contained in:
Germán Martínez 2019-11-19 14:28:36 +01:00 committed by GitHub
commit ad6cc77607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1093 additions and 93 deletions

View File

@ -36,14 +36,14 @@
"@material-ui/core": "4.6.1",
"@material-ui/icons": "4.5.1",
"@portis/web3": "^2.0.0-beta.45",
"@testing-library/jest-dom": "4.2.3",
"@testing-library/jest-dom": "4.2.4",
"@toruslabs/torus-embed": "0.2.6",
"@walletconnect/web3-provider": "^1.0.0-beta.37",
"@welldone-software/why-did-you-render": "3.3.9",
"axios": "0.19.0",
"bignumber.js": "9.0.0",
"connected-react-router": "6.5.2",
"date-fns": "2.7.0",
"connected-react-router": "6.6.0",
"date-fns": "2.8.0",
"ethereum-ens": "0.7.8",
"final-form": "4.18.6",
"history": "4.10.1",
@ -53,11 +53,11 @@
"notistack": "https://github.com/gnosis/notistack.git#v0.9.4",
"optimize-css-assets-webpack-plugin": "5.0.3",
"qrcode.react": "1.0.0",
"react": "16.11.0",
"react-dom": "16.11.0",
"react-final-form": "6.3.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-final-form": "6.3.2",
"react-final-form-listeners": "^1.0.2",
"react-hot-loader": "4.12.17",
"react-hot-loader": "4.12.18",
"react-qr-reader": "^2.2.1",
"react-redux": "7.1.3",
"react-router-dom": "5.1.2",
@ -68,7 +68,7 @@
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"squarelink": "^1.1.3",
"web3": "1.2.2",
"web3": "1.2.4",
"web3connect": "^1.0.0-beta.23"
},
"devDependencies": {
@ -102,7 +102,7 @@
"@storybook/addon-links": "5.2.6",
"@storybook/react": "5.2.6",
"@testing-library/react": "9.3.2",
"autoprefixer": "9.7.1",
"autoprefixer": "9.7.2",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "10.0.3",
"babel-jest": "24.9.0",
@ -118,7 +118,7 @@
"eslint-config-airbnb": "18.0.1",
"eslint-plugin-flowtype": "4.4.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jest": "23.0.3",
"eslint-plugin-jest": "23.0.4",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.16.0",
"ethereumjs-abi": "0.6.8",

View File

@ -31,10 +31,6 @@ type CopyBtnProps = {
}
const CopyBtn = ({ content, increaseZindex = false }: CopyBtnProps) => {
if (!navigator.clipboard) {
return null
}
const [clicked, setClicked] = useState<boolean>(false)
const classes = useStyles()
const customClasses = increaseZindex ? { popper: classes.inreasedPopperZindex } : {}

View File

@ -106,6 +106,7 @@ const Sidebar = ({
searchIcon={<div />}
onChange={handleFilterChange}
onCancelSearch={handleFilterCancel}
value={filter}
/>
<Spacer />
<Divider />

View File

@ -60,10 +60,11 @@ export const maxValue = (max: number | string) => (value: string) => {
export const ok = () => undefined
export const mustBeEthereumAddress = simpleMemoize((address: Field) => {
export const mustBeEthereumAddress = simpleMemoize((address: string) => {
const startsWith0x = address.startsWith('0x')
const isAddress: boolean = getWeb3().utils.isAddress(address)
return isAddress ? undefined : 'Address should be a valid Ethereum address or ENS name'
return startsWith0x && isAddress ? undefined : 'Address should be a valid Ethereum address or ENS name'
})
export const mustBeEthereumContractAddress = simpleMemoize(async (address: string) => {

View File

@ -34,8 +34,8 @@ const confirmationTxNotificationsQueue: NotificationsQueue = {
pendingExecution: NOTIFICATIONS.TX_CONFIRMATION_PENDING_MSG,
afterRejection: NOTIFICATIONS.TX_REJECTED_MSG,
afterExecution: {
noMoreConfirmationsNeeded: NOTIFICATIONS.TX_CONFIRMATION_EXECUTED_MSG,
moreConfirmationsNeeded: null,
noMoreConfirmationsNeeded: NOTIFICATIONS.TX_EXECUTED_MSG,
moreConfirmationsNeeded: NOTIFICATIONS.TX_CONFIRMATION_EXECUTED_MSG,
},
afterExecutionError: NOTIFICATIONS.TX_CONFIRMATION_FAILED_MSG,
}

View File

@ -129,7 +129,7 @@ export const NOTIFICATIONS: Notifications = {
options: { variant: INFO, persist: true },
},
TX_CONFIRMATION_EXECUTED_MSG: {
message: 'Confirmation transaction succesful',
message: 'Confirmation transaction was successful',
options: { variant: SUCCESS, persist: false, autoHideDuration: longDuration },
},
TX_CONFIRMATION_FAILED_MSG: {

View File

@ -108,6 +108,7 @@ const createTransaction = (
return receipt.transactionHash
})
} catch (err) {
console.error(err)
closeSnackbar(beforeExecutionKey)
closeSnackbar(pendingExecutionKey)
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)
@ -116,7 +117,7 @@ const createTransaction = (
.execTransaction(to, valueInWei, txData, CALL, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs)
.encodeABI()
const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, from)
console.error(`Error executing the TX: ${errMsg}`)
console.error(`Error creating the TX: ${errMsg}`)
}
return txHash

View File

@ -143,6 +143,7 @@ const processTransaction = (
return receipt.transactionHash
})
} catch (err) {
console.error(err)
closeSnackbar(beforeExecutionKey)
closeSnackbar(pendingExecutionKey)
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)

View File

@ -46,9 +46,9 @@ export default handleActions<SafeReducerState, *>(
const tokenAddress = action.payload
const newState = state.withMutations((map) => {
map.keySeq().forEach((safeAddress) => {
const safeActiveTokens = map.getIn([safeAddress, 'activeTokens'])
const activeTokens = safeActiveTokens.push(tokenAddress)
map.get('safes').keySeq().forEach((safeAddress) => {
const safeActiveTokens = map.getIn(['safes', safeAddress, 'activeTokens'])
const activeTokens = safeActiveTokens.add(tokenAddress)
map.updateIn(['safes', safeAddress], (prevSafe) => prevSafe.merge({ activeTokens }))
})

View File

@ -1,13 +1,17 @@
// @flow
export const copyToClipboard = (text: string) => {
if (!navigator.clipboard) {
return
}
export const copyToClipboard = (text: string): void => {
const range = document.createRange()
range.selectNodeContents(document.body)
document.getSelection().addRange(range)
try {
navigator.clipboard.writeText(text)
} catch (err) {
console.error(err.message)
function listener(e: ClipboardEvent) {
e.clipboardData.setData('text/plain', text)
e.preventDefault()
}
document.addEventListener('copy', listener)
document.execCommand('copy')
document.removeEventListener('copy', listener)
document.getSelection().removeAllRanges()
}

1120
yarn.lock

File diff suppressed because it is too large Load Diff