From 9a999fd2ea366583e220100ef526f076d4f118f4 Mon Sep 17 00:00:00 2001 From: mmv Date: Wed, 10 Jul 2019 18:25:54 +0400 Subject: [PATCH] add modify safe settings type --- .../screens/ThresholdForm/index.jsx | 10 ++--- .../ExpandedTx/TxDescription/index.jsx | 39 ++++++++++++------- .../TransactionsNew/TxsTable/columns.js | 5 +-- .../safe/store/actions/fetchTransactions.js | 1 + src/routes/safe/store/models/transaction.js | 2 + 5 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx index 2d15e999..3cb584eb 100644 --- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx +++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/ThresholdForm/index.jsx @@ -56,12 +56,12 @@ const ThresholdForm = ({ - Set the required owner confirmations: + Set the required owner confirmations: - Any transaction over any daily limit requires the confirmation of: + Any transaction over any daily limit requires the confirmation of: @@ -90,7 +90,7 @@ const ThresholdForm = ({ - out of + out of {' '} {owners.size + 1} {' '} @@ -102,7 +102,7 @@ owner(s) diff --git a/src/routes/safe/components/TransactionsNew/TxsTable/ExpandedTx/TxDescription/index.jsx b/src/routes/safe/components/TransactionsNew/TxsTable/ExpandedTx/TxDescription/index.jsx index 0dbaa0b7..f425d8c6 100644 --- a/src/routes/safe/components/TransactionsNew/TxsTable/ExpandedTx/TxDescription/index.jsx +++ b/src/routes/safe/components/TransactionsNew/TxsTable/ExpandedTx/TxDescription/index.jsx @@ -27,6 +27,9 @@ const getTxData = (tx: Transaction) => { } else if (Number(tx.value) > 0) { txData.recipient = tx.recipient txData.value = fromWei(toBN(tx.value), 'ether') + } else if (tx.modifySettingsTx) { + txData.recipient = tx.recipient + txData.modifySettingsTx = true } return txData @@ -44,25 +47,31 @@ type Props = { } const TxDescription = ({ tx, classes }: Props) => { - const { recipient, value } = getTxData(tx) + const { recipient, value, modifySettingsTx } = getTxData(tx) return ( - - Send - {' '} - {value} - {' '} - {tx.symbol} - {' '} - to: - -
- - {shortVersionOf(recipient, 4)} - - + {modifySettingsTx ? ( + Modify Safe Settings + ) : ( + <> + + Send + {' '} + {value} + {' '} + {tx.symbol} + {' '} +to: + +
+ + {shortVersionOf(recipient, 4)} + + + + )}
) diff --git a/src/routes/safe/components/TransactionsNew/TxsTable/columns.js b/src/routes/safe/components/TransactionsNew/TxsTable/columns.js index a752bf53..d2e04f36 100644 --- a/src/routes/safe/components/TransactionsNew/TxsTable/columns.js +++ b/src/routes/safe/components/TransactionsNew/TxsTable/columns.js @@ -46,10 +46,9 @@ export const getTxTableData = (transactions: List): List { const txDate = tx.isExecuted ? tx.executionDate : tx.submissionDate - return { [TX_TABLE_NONCE_ID]: tx.nonce, - [TX_TABLE_TYPE_ID]: 'Outgoing transfer', + [TX_TABLE_TYPE_ID]: tx.modifySettingsTx ? 'Modify Safe Settings' : 'Outgoing transfer', [TX_TABLE_DATE_ID]: formatDate(tx.isExecuted ? tx.executionDate : tx.submissionDate), [buildOrderFieldFrom(TX_TABLE_DATE_ID)]: getTime(txDate), [TX_TABLE_AMOUNT_ID]: getTxAmount(tx), @@ -77,7 +76,7 @@ export const generateColumns = () => { disablePadding: false, label: 'Type', custom: false, - width: 150, + width: 200, } const valueColumn: Column = { diff --git a/src/routes/safe/store/actions/fetchTransactions.js b/src/routes/safe/store/actions/fetchTransactions.js index 2c309450..a0e5031a 100644 --- a/src/routes/safe/store/actions/fetchTransactions.js +++ b/src/routes/safe/store/actions/fetchTransactions.js @@ -90,6 +90,7 @@ const buildTransactionFrom = async (safeAddress: string, tx: TxServiceModel, saf creationTxHash, isTokenTransfer, decodedParams, + modifySettingsTx: tx.to === safeAddress, }) } diff --git a/src/routes/safe/store/models/transaction.js b/src/routes/safe/store/models/transaction.js index 582f2b1e..4cf07a6b 100644 --- a/src/routes/safe/store/models/transaction.js +++ b/src/routes/safe/store/models/transaction.js @@ -16,6 +16,7 @@ export type TransactionProps = { submissionDate: Date, executionDate: Date, symbol: string, + modifySettingsTx: boolean, creationTxHash: string, executionTxHash?: string, cancelled?: boolean, @@ -38,6 +39,7 @@ export const makeTransaction: RecordFactory = Record({ executionTxHash: undefined, creationTxHash: '', cancelled: false, + modifySettingsTx: false, status: 'awaiting', isTokenTransfer: false, decodedParams: {},