OSDN Git Service

fixed the confilict merge from master
authorZhiting Lin <zlin035@uottawa.ca>
Thu, 19 Apr 2018 01:44:55 +0000 (09:44 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Thu, 19 Apr 2018 01:44:55 +0000 (09:44 +0800)
1  2 
src/features/assets/components/AssetShow.jsx
src/features/mockhsm/components/List.jsx
src/features/mockhsm/components/Show.jsx
src/features/transactions/components/New/New.jsx
src/features/transactions/components/Show.jsx
src/features/transactions/components/Summary/Summary.jsx

@@@ -36,10 -36,10 +36,10 @@@ class AssetShow extends BaseShow 
              ]}
              items={[
                {label: 'ID', value: item.id},
-               {label: ( lang === 'zh' ? '别名' : 'Alias' ), value: item.alias},
 -              {label: 'Alias', value: item.alias, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/alias`},
 -              {label: 'Definition', value: item.definition},
 -              {label: 'xpubs', value: (item.xpubs || []).length},
 -              {label: 'Quorum', value: item.quorum},
++              {label: ( lang === 'zh' ? '别名' : 'Alias' ), value: item.alias, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/alias`},
 +              {label: ( lang === 'zh' ? '定义' : 'Definition'), value: item.definition},
 +              {label: ( lang === 'zh' ? '扩展公钥数' : 'xpubs' ), value: (item.xpubs || []).length},
 +              {label: ( lang === 'zh' ? '签名数' : 'Quorum' ), value: item.quorum},
              ]}
              lang={lang}
            />
@@@ -6,51 -4,17 +4,30 @@@ import ListItem from './ListItem
  const type = 'key'
  
  class KeyList extends BaseList.ItemList {
-   constructor(props) {
-     super(props)
-     const client = chainClient()
-     this.setStat = () => client.mockHsm.keys.progress().then(({data}) => {
-       store.dispatch({
-         type: 'RECEIVED_IMPORT_STATUS',
-         data
-       })
-       const isImporting = item => {
-         return typeof item.percent === 'number' && item.percent < 100
-       }
-       if ((data || []).filter(isImporting).length > 0) {
-         window.setTimeout(this.setStat, 5000)
-       }
-     })
-     this.setStat()
-   }
  }
  
 +const mapStateToProps = (state) => {
 +  let titles
 +  if(state.core.lang === 'zh'){
 +    titles = ['别名','扩展公钥']
 +  }else{
 +    titles = ['Alias', 'xpub']
 +  }
 +
 +  return {
 +    ...BaseList.mapStateToProps(type, ListItem, {
 +      skipQuery: true,
 +      label: 'Keys',
 +      wrapperComponent: TableList,
 +      wrapperProps: {
 +        titles: titles
 +      }
 +    })(state)
 +  }
 +}
 +
  export default BaseList.connect(
 -  BaseList.mapStateToProps(type, ListItem, {
 -    skipQuery: true,
 -    label: 'Keys',
 -    wrapperComponent: TableList,
 -    wrapperProps: {
 -      titles: ['Alias', 'xpub']
 -    }
 -  }),
 +  mapStateToProps,
    BaseList.mapDispatchToProps(type),
    KeyList
  )
@@@ -61,10 -62,10 +62,10 @@@ class Show extends BaseShow 
              title={lang === 'zh' ? '详情' : 'Details'}
              items={[
                {label: 'ID', value: item.id},
 -              {label: 'Timestamp', value: moment.unix(item.timestamp).format()},
 -              {label: 'Block ID', value: item.blockId},
 -              {label: 'Block Height', value: (item.blockHeight + `(${confirmation} confirmation${confirmation > 1 ? 's' : ''})`)},
 -              {label: 'Position', value: item.position},
 +              {label: (lang === 'zh' ? '时间戳' : 'Timestamp'), value: moment.unix(item.timestamp).format()},
 +              {label: (lang === 'zh' ? '区块ID' : 'Block ID'), value: item.blockId},
-               {label: (lang === 'zh' ? '区块高度': 'Block Height'), value: (item.blockHeight + `(${this.props.highestBlock - item.blockHeight + 1} confirmations)`)},
++              {label: (lang === 'zh' ? '区块高度': 'Block Height'), value: (item.blockHeight + `(${confirmation} confirmation${confirmation > 1 ? 's' : ''})`)},
 +              {label: (lang === 'zh' ? '位置' : 'Position'), value: item.position},
                {label: 'Gas', value: gas},
              ]}
            />
@@@ -121,8 -123,16 +124,16 @@@ class Summary extends React.Component 
        <tbody>
          {items.map((item, index) =>
            <tr key={index}>
-             <td className={styles.colAction}>{item.type}</td>
-             <td className={styles.colLabel}>{ lang === 'zh' ? '数量' : 'amount' }</td>
+             {
+               !isCoinbase && <td className={styles.colAction}>{item.type}</td>
+             }
+             {
+               isCoinbase && <td className={styles.colAction}>
+                 Coinbase
+                 {!mature && <small className={styles.immature}>immature</small>}
+               </td>
+             }
 -            <td className={styles.colLabel}>amount</td>
++            <td className={styles.colLabel}>{ lang === 'zh' ? '数量' : 'amount' }t</td>
              <td className={styles.colAmount}>
                <code className={styles.amount}>{item.amount}</code>
              </td>