OSDN Git Service

update the warning label.
authorZhiting Lin <zlin035@uottawa.ca>
Mon, 22 Apr 2019 04:40:58 +0000 (12:40 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Mon, 22 Apr 2019 04:40:58 +0000 (12:40 +0800)
src/features/assets/components/AssetShow.jsx
src/features/assets/components/New.jsx
src/features/shared/components/KeyValueTable/KeyValueTable.jsx
src/locales/en/translation.json
src/locales/zh/translation.json

index e474092..34dcc5d 100644 (file)
@@ -22,6 +22,14 @@ class AssetShow extends BaseShow {
         <code>{item.alias ? item.alias :item.id}</code>
       </span>
 
+      const time = (item.limitHeight-this.props.blockHeight) *2.5
+      let assetLabel
+      if(this.props.blockHeight<item.limitHeight){
+        assetLabel = <span className='text-danger'>{t('asset.issuableLabel',{time:time})}</span>
+      }else if(item.limitHeight>0){
+        assetLabel = <span className='text-danger'>{t('asset.noIssuableLabel')}</span>
+      }
+
       view = <div className={componentClassNames(this)}>
         <PageTitle
           title={title}
@@ -43,7 +51,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.alias === 'BTM' || item.limitHeight > 0)? 'false': 'true'},
+              {label: t('form.reissueTitle'), value:  (item.alias === 'BTM' || item.limitHeight > 0)? 'false ': 'true', note: assetLabel},
               {label: t('form.xpubs'), value: (item.xpubs || []).length},
               {label: t('form.quorum'), value: item.quorum},
               {label: t('asset.additionInfo'), value: item.definition.description},
@@ -74,6 +82,7 @@ import actions from 'actions'
 
 const mapStateToProps = (state, ownProps) => ({
   item: state.asset.items[ownProps.params.id],
+  blockHeight: state.core.blockHeight
 })
 
 const mapDispatchToProps = ( dispatch ) => ({
index 41107e6..30ea13a 100644 (file)
@@ -27,8 +27,8 @@ class Form extends React.Component {
       xpubs: data.xpubs,
       limit_height: data.reissue === 'true'? 0 : this.props.blockHeight+3,
       definition:{
-        name: data.alias,
-        symbol: data.symbol,
+        name: data.alias.trim(),
+        symbol: data.symbol.trim(),
         decimals: data.decimals,
         quorum: data.quorum,
         reissue: data.reissue,
index 2466aff..dd71d03 100644 (file)
@@ -57,6 +57,7 @@ class KeyValueTable extends React.Component {
             return <tr key={item.label}>
               <td className={styles.label}>{item.label}</td>
               <td className={styles.value}>{this.renderValue(item)}
+                {item.note}
                 {item.editUrl && <Link to={item.editUrl} className={styles.edit}>
                   <span
                     className={`${styles.pencil} glyphicon glyphicon-pencil`}></span>{t('form.edit')}
index 9fc135e..7e35d7e 100644 (file)
@@ -26,7 +26,9 @@
     "additionInfoKey":"Description",
     "additionInfoValue":"Value",
     "additionInfoKeyError":"Description is required.",
-    "additionInfoValueError":"Value is required."
+    "additionInfoValueError":"Value is required.",
+    "issuableLabel":"(Please issue the asset within approx. __time__ mins.)",
+    "noIssuableLabel":"(The asset can't be issued anymore.)"
   },
   "commonWords": {
     "version": "Version",
index eda5ed2..f199475 100644 (file)
@@ -26,7 +26,9 @@
     "additionInfoKey":"描述",
     "additionInfoValue":"值",
     "additionInfoKeyError":"描述是必须项。",
-    "additionInfoValueError":"值是必须项。"
+    "additionInfoValueError":"值是必须项。",
+    "issuableLabel":"(请在大约__time__分钟内完成发布资产)",
+    "noIssuableLabel":"(资产不可发行)"
   },
   "commonWords": {
     "version": "版本号",