add modify safe settings type

This commit is contained in:
mmv 2019-07-10 18:25:54 +04:00
parent 9b709f8e29
commit 9a999fd2ea
5 changed files with 34 additions and 23 deletions

View File

@ -56,12 +56,12 @@ const ThresholdForm = ({
<Block className={classes.formContainer}>
<Row>
<Paragraph weight="bolder" className={classes.headingText}>
Set the required owner confirmations:
Set the required owner confirmations:
</Paragraph>
</Row>
<Row>
<Paragraph weight="bolder">
Any transaction over any daily limit requires the confirmation of:
Any transaction over any daily limit requires the confirmation of:
</Paragraph>
</Row>
<Row margin="xl" align="center" className={classes.inputRow}>
@ -90,7 +90,7 @@ const ThresholdForm = ({
</Col>
<Col xs={10}>
<Paragraph size="lg" color="primary" noMargin className={classes.ownersText}>
out of
out of
{' '}
{owners.size + 1}
{' '}
@ -102,7 +102,7 @@ owner(s)
<Hairline />
<Row align="center" className={classes.buttonRow}>
<Button className={classes.button} minWidth={140} onClick={onClickBack}>
Back
Back
</Button>
<Button
type="submit"
@ -112,7 +112,7 @@ owner(s)
color="primary"
testId={ADD_OWNER_THRESHOLD_NEXT_BTN_TESTID}
>
Review
Review
</Button>
</Row>
</React.Fragment>

View File

@ -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 (
<Block className={classes.txDataContainer}>
<Paragraph noMargin>
<Bold>
Send
{' '}
{value}
{' '}
{tx.symbol}
{' '}
to:
</Bold>
<br />
<a href={getEtherScanLink(recipient, 'rinkeby')} target="_blank" rel="noopener noreferrer">
{shortVersionOf(recipient, 4)}
<OpenInNew style={openIconStyle} />
</a>
{modifySettingsTx ? (
<Bold>Modify Safe Settings</Bold>
) : (
<>
<Bold>
Send
{' '}
{value}
{' '}
{tx.symbol}
{' '}
to:
</Bold>
<br />
<a href={getEtherScanLink(recipient, 'rinkeby')} target="_blank" rel="noopener noreferrer">
{shortVersionOf(recipient, 4)}
<OpenInNew style={openIconStyle} />
</a>
</>
)}
</Paragraph>
</Block>
)

View File

@ -46,10 +46,9 @@ export const getTxTableData = (transactions: List<Transaction>): List<Transactio
const rows = transactions.map((tx: Transaction) => {
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 = {

View File

@ -90,6 +90,7 @@ const buildTransactionFrom = async (safeAddress: string, tx: TxServiceModel, saf
creationTxHash,
isTokenTransfer,
decodedParams,
modifySettingsTx: tx.to === safeAddress,
})
}

View File

@ -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<TransactionProps> = Record({
executionTxHash: undefined,
creationTxHash: '',
cancelled: false,
modifySettingsTx: false,
status: 'awaiting',
isTokenTransfer: false,
decodedParams: {},