export default (store) => {
const loadGrants = () => store.dispatch(actions.fetchItems())
- const routes = makeRoutes(store, 'accessControl', AccessControlList, null, null, null, {
+ const routes = makeRoutes(store, 'accessControl', AccessControlList, null, null, {
path: 'access-control',
name: 'Access control',
name_zh: '访问控制'
if (data.status !== 'success') {
return
}
- this.setState({addresses: data.data})
+ const normalAddresses = data.data.filter(address => !address.change).map(address => address.address)
+ const changeAddresses = data.data.filter(address => address.change).map(address => address.address)
+ this.setState({addresses: normalAddresses, changeAddresses})
})
}
createReceiver() {
this.props.createReceiver({
- account_alias:this.props.item.alias
+ account_alias: this.props.item.alias
}).then(({data: receiver}) => this.props.showModal(<div>
<p>Copy this one-time use address to use in a transaction:</p>
<CopyableBlock value={JSON.stringify({
controlProgram: receiver.controlProgram,
expiresAt: receiver.expiresAt
- }, null, 1)} />
+ }, null, 1)}/>
</div>))
}
items={[
{label: 'ID', value: item.id},
{label: 'Alias', value: item.alias},
- {label: 'Tags', value: item.tags || {}, editUrl: `/accounts/${item.id}/tags`},
{label: 'xpubs', value: (item.xpubs || []).length},
{label: 'Quorum', value: item.quorum},
]}
)}
{(this.state.addresses || []).length > 0 &&
- <KeyValueTable title={'addresses'} items={(this.state.addresses || []).map((address, index) => ({
- label: index,
- value: address.address
- }))}/>
+ <KeyValueTable title={lang === 'zh' ? '地址' : 'ADDRESSES'}
+ items={this.state.addresses.map((address, index) => ({
+ label: index,
+ value: address
+ }))}/>
+ }
+
+ {(this.state.changeAddresses || []).length > 0 &&
+ <KeyValueTable title={lang === 'zh' ? '找零地址' : 'ADDRESSES FOR CHANGE'}
+ items={this.state.changeAddresses.map((address, index) => ({
+ label: index,
+ value: address
+ }))}/>
}
</PageContent>
</div>
-import React from 'react'
import { BaseList, TableList } from 'features/shared/components'
import ListItem from './ListItem'
render() {
const {
- fields: { alias, tags, xpubs, quorum },
+ fields: { alias, xpubs, quorum },
error,
handleSubmit,
submitting
<FormSection title={ lang === 'zh' ? '账户信息' : 'Account Information' }>
<TextField title='Alias' placeholder='Alias' fieldProps={alias} autoFocus={true} />
- <JsonField title='Tags' fieldProps={tags} lang={ lang } />
</FormSection>
<FormSection title={ lang === 'zh' ? '密钥和签名' : 'Keys and Signing' }>
const fields = [
'alias',
- 'tags',
'xpubs[].value',
'xpubs[].type',
'quorum'
fields,
validate,
initialValues: {
- tags: '{\n\t\n}',
quorum: 1,
}
})(Form)
-import { List, New, AccountShow, AccountUpdate } from './components'
+import { List, New, AccountShow } from './components'
import { makeRoutes } from 'features/shared'
-export default (store) => makeRoutes(store, 'account', List, New, AccountShow, AccountUpdate, {name_zh: '账户'})
+export default (store) => makeRoutes(store, 'account', List, New, AccountShow, {name_zh: '账户'})
items={[
{label: 'ID', value: item.id},
{label: 'Alias', value: item.alias},
- {label: 'Tags', value: item.tags || {}, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/tags`},
{label: 'Definition', value: item.definition},
{label: 'xpubs', value: (item.xpubs || []).length},
{label: 'Quorum', value: item.quorum},
<FormSection title={ lang === 'zh' ? '资产信息' : 'Asset Information'}>
<TextField title='Alias' placeholder='Alias' fieldProps={alias} autoFocus={true} />
- <JsonField title='Tags' fieldProps={tags} lang={lang}/>
<JsonField title={ lang === 'zh' ? '定义' : 'Definition' } fieldProps={definition} lang={lang}/>
</FormSection>
const validate = values => {
const errors = {}
- const jsonFields = ['tags', 'definition']
+ const jsonFields = ['definition']
jsonFields.forEach(key => {
const fieldError = JsonField.validator(values[key])
if (fieldError) { errors[key] = fieldError }
const fields = [
'alias',
- 'tags',
'definition',
'xpubs[].value',
'xpubs[].type',
fields,
validate,
initialValues: {
- tags: '{\n\t\n}',
definition: '{\n\t\n}',
quorum: 1,
}
-import { List, New, AssetShow, AssetUpdate } from './components'
+import { List, New, AssetShow } from './components'
import { makeRoutes } from 'features/shared'
-export default (store) => makeRoutes(store, 'asset', List, New, AssetShow, AssetUpdate, {name_zh: '资产'})
+export default (store) => makeRoutes(store, 'asset', List, New, AssetShow, {name_zh: '资产'})
import { List } from './components'
import { makeRoutes } from 'features/shared'
-export default (store) => makeRoutes(store, 'balance', List, null, null, null)
+export default (store) => makeRoutes(store, 'balance', List)
import { List, New, Show, ResetPassword } from './components'
import { makeRoutes } from 'features/shared'
-export default (store) => makeRoutes(store, 'key', List, New, Show, null,
+export default (store) => makeRoutes(store, 'key', List, New, Show,
{
childRoutes: [
{
import { humanize } from 'utility/string'
import actions from 'actions'
-const makeRoutes = (store, type, List, New, Show, Update, options = {}) => {
+const makeRoutes = (store, type, List, New, Show, options = {}) => {
const loadPage = () => {
store.dispatch(actions[type].fetchAll())
}
})
}
- if (Update) {
- childRoutes.push({
- path: ':id/tags',
- component: Update
- })
- }
-
return {
path: options.path || type + 's',
component: RoutingContainer,
import { makeRoutes } from 'features/shared'
export default (store) => makeRoutes(
- store, 'transactionFeed', List, New, null, null, { path: 'transaction-feeds', name: 'Transaction feeds'}
+ store, 'transactionFeed', List, New, null, { path: 'transaction-feeds', name: 'Transaction feeds'}
)
List,
New,
Show,
- null,
{
childRoutes: [
{
issuanceProgram: 'Issuance Program',
isLocal: 'Local?',
referenceData: 'Reference Data',
+ change: 'Change'
}
const txInputFields = [
'sourcePos',
'isLocal',
'referenceData',
+ 'change',
]
const balanceFields = Object.keys(mappings)
controlProgram: output.program,
programIndex: output.controlProgramIndex,
sourceId: output.sourceId,
- sourcePos: output.sourcePos
+ sourcePos: output.sourcePos,
+ change: output.change + ''
}
return buildDisplay(normalized, unspentFields, btmAmountUnit)
}