OSDN Git Service

update the asset page
authorZhiting Lin <zlin035@uottawa.ca>
Wed, 10 Apr 2019 05:54:03 +0000 (13:54 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Wed, 10 Apr 2019 05:54:03 +0000 (13:54 +0800)
src/features/assets/components/AssetShow.jsx
src/features/assets/components/AssetUpdate.jsx
src/features/assets/components/New.jsx
src/features/assets/components/New.scss

index 1b04163..c2e2d68 100644 (file)
@@ -29,9 +29,6 @@ class AssetShow extends BaseShow {
             object='asset'
             title={t('form.detail')}
             actions={[
-              // <button key='show-circulation' className='btn btn-link' onClick={this.props.showCirculation.bind(this, item)}>
-              //  Circulation
-              // </button>,
               <RawJsonButton key='raw-json' item={item} />
             ]}
             items={[
@@ -39,7 +36,7 @@ class AssetShow extends BaseShow {
               {label: t('form.alias'), value: item.alias, editUrl: item.alias === 'BTM' ? null : `/assets/${item.id}/alias`},
               {label: t('form.symbol'), value: item.definition.symbol},
               {label: t('form.decimals'), value: item.definition.decimals},
-              {label: t('form.reissueTitle'), value: item.definition.reissue === undefined?'-':item.definition.reissue.toString()},
+              {label: t('form.reissueTitle'), value:  (item.alias === 'BTM' || item.limitHeight > 0)? 'false': 'true'},
               {label: t('form.xpubs'), value: (item.xpubs || []).length},
               {label: t('form.quorum'), value: item.quorum},
               {label: t('asset.additionInfo'), value: item.definition.description},
index 2ff2472..ff11506 100644 (file)
@@ -7,12 +7,12 @@ class Form extends React.Component {
   constructor(props) {
     super(props)
 
-    this.submitWithErrors = this.submitWithErrors.bind(this)
+    this.submitWithValidations = this.submitWithValidations.bind(this)
 
     this.state = {}
   }
 
-  submitWithErrors(data) {
+  submitWithValidations(data) {
     return this.props.submitForm(data, this.props.item.id).catch(err => {
       throw {_error: err}
     })
@@ -52,7 +52,7 @@ class Form extends React.Component {
     return <FormContainer
       error={error}
       label={title}
-      onSubmit={handleSubmit(this.submitWithErrors)}
+      onSubmit={handleSubmit(this.submitWithValidations)}
       submitting={submitting}
       >
 
index 04c4ae9..4d49d07 100644 (file)
@@ -8,7 +8,7 @@ import { destroy } from 'redux-form';
 class Form extends React.Component {
   constructor(props) {
     super(props)
-    this.submitWithErrors = this.submitWithErrors.bind(this)
+    this.submitWithValidations = this.submitWithValidations.bind(this)
     this.nextPage = this.nextPage.bind(this)
     this.previousPage = this.previousPage.bind(this)
     this.state = {
@@ -20,15 +20,15 @@ class Form extends React.Component {
     this.props.destroyForm()
   }
 
-  submitWithErrors(data) {
+  submitWithValidations(data) {
     const resultData = {
       alias: data.alias,
       quorum: data.quorum,
       xpubs: data.xpubs,
+      limit_height: data.reissue === 'true'? 0 : this.props.blockHeight+3,
       definition:{
         name: data.alias,
         symbol: data.symbol,
-        reissue: data.reissue === 'true',
         decimals: data.decimals,
         description: data.description
       }
@@ -56,7 +56,7 @@ class Form extends React.Component {
     return (
       <div>
         {page === 1 && <NewAssetInfo onSubmit={this.nextPage}/>}
-        {page === 2 && <NewKeyAndSign previousPage={this.previousPage} onSubmit={this.submitWithErrors}/>}
+        {page === 2 && <NewKeyAndSign previousPage={this.previousPage} onSubmit={this.submitWithValidations}/>}
       </div>
     )
   }
@@ -67,8 +67,13 @@ const mapDispatchToProps = ( dispatch ) => ({
   destroyForm: () => dispatch(destroy('newAssetForm')),
 })
 
+const mapStateToProps = ( state ) => ({
+  ...BaseNew.mapStateToProps('asset'),
+  blockHeight: state.core.blockHeight
+})
+
 export default withNamespaces('translations') ( BaseNew.connect(
-  BaseNew.mapStateToProps('asset'),
+  mapStateToProps,
   mapDispatchToProps,
   Form
 ))
index ac9b739..0093c79 100644 (file)
@@ -1,6 +1,6 @@
 .subjectField {
   display: flex;
-  align-items: center;
+  align-items: flex-start;
 
   :global {
     .form-group {
@@ -8,6 +8,10 @@
       margin-right: $gutter-size/2;
     }
   }
+
+  button{
+    margin-top: 35px;
+  }
 }
 
 .receiverBtn{