OSDN Git Service
(root)
/
bytom
/
bytom-dashboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5976e4c
)
update the new asset page style.
author
Zhiting Lin
<zlin035@uottawa.ca>
Mon, 8 Apr 2019 06:06:35 +0000
(14:06 +0800)
committer
Zhiting Lin
<zlin035@uottawa.ca>
Mon, 8 Apr 2019 06:06:35 +0000
(14:06 +0800)
src/features/assets/components/New.jsx
patch
|
blob
|
history
src/features/assets/components/NewAssetInfo.jsx
patch
|
blob
|
history
src/features/assets/components/NewKeyAndSign.jsx
patch
|
blob
|
history
src/features/shared/components/FormContainer/FormContainer.jsx
patch
|
blob
|
history
src/locales/en/translation.json
patch
|
blob
|
history
src/locales/zh/translation.json
patch
|
blob
|
history
diff --git
a/src/features/assets/components/New.jsx
b/src/features/assets/components/New.jsx
index
2bc844a
..
04c4ae9
100644
(file)
--- a/
src/features/assets/components/New.jsx
+++ b/
src/features/assets/components/New.jsx
@@
-16,6
+16,10
@@
class Form extends React.Component {
}
}
}
}
+ componentWillUnmount(){
+ this.props.destroyForm()
+ }
+
submitWithErrors(data) {
const resultData = {
alias: data.alias,
submitWithErrors(data) {
const resultData = {
alias: data.alias,
diff --git
a/src/features/assets/components/NewAssetInfo.jsx
b/src/features/assets/components/NewAssetInfo.jsx
index
266550d
..
3fd58f5
100644
(file)
--- a/
src/features/assets/components/NewAssetInfo.jsx
+++ b/
src/features/assets/components/NewAssetInfo.jsx
@@
-1,5
+1,5
@@
import React from 'react'
import React from 'react'
-import {
BaseNew,
FormContainer, FormSection, TextField, RadioField } from 'features/shared/components'
+import { FormContainer, FormSection, TextField, RadioField } from 'features/shared/components'
import { reduxForm } from 'redux-form'
import {withNamespaces} from 'react-i18next'
import styles from './New.scss'
import { reduxForm } from 'redux-form'
import {withNamespaces} from 'react-i18next'
import styles from './New.scss'
@@
-39,7
+39,7
@@
class NewAssetInfo extends React.Component {
label= { t('asset.new') }
onSubmit={handleSubmit}
submitting={submitting}
label= { t('asset.new') }
onSubmit={handleSubmit}
submitting={submitting}
- submitLabel={
'N'
}
+ submitLabel={
t('commonWords.next')
}
>
<FormSection title={t('asset.information')}>
>
<FormSection title={t('asset.information')}>
@@
-47,20
+47,20
@@
class NewAssetInfo extends React.Component {
<TextField title={t('form.symbol')} placeholder={t('asset.symbolPlaceholder')} fieldProps={symbol} />
<TextField title={t('form.decimals')} placeholder={t('asset.decimalPlaceholder')} fieldProps={decimals} />
<RadioField title={t('form.reissueTitle')} options={options} fieldProps={reissue} />
<TextField title={t('form.symbol')} placeholder={t('asset.symbolPlaceholder')} fieldProps={symbol} />
<TextField title={t('form.decimals')} placeholder={t('asset.decimalPlaceholder')} fieldProps={decimals} />
<RadioField title={t('form.reissueTitle')} options={options} fieldProps={reissue} />
- <label >
adition info
</label>
+ <label >
{t('asset.additionInfo')}
</label>
<div className={styles.panel}>
{description.map((descript, index) =>
<div className={styles.subjectField}>
<div className={styles.panel}>
{description.map((descript, index) =>
<div className={styles.subjectField}>
- <TextField title={
'key'
} fieldProps={descript.key}/>
- <TextField title={
'value'
} fieldProps={descript.value}/>
+ <TextField title={
t('asset.additionInfoKey')
} fieldProps={descript.key}/>
+ <TextField title={
t('asset.additionInfoValue')
} fieldProps={descript.value}/>
<button
className='btn btn-danger btn-xs'
tabIndex='-1'
type='button'
onClick={() => this.removeReceiverItem(index)}
>
<button
className='btn btn-danger btn-xs'
tabIndex='-1'
type='button'
onClick={() => this.removeReceiverItem(index)}
>
- Remove
+ {t('commonWords.remove')}
</button>
</div>
</button>
</div>
@@
-70,7
+70,7
@@
class NewAssetInfo extends React.Component {
className='btn btn-default'
onClick={this.addReceiverItem}
>
className='btn btn-default'
onClick={this.addReceiverItem}
>
- Add Field
+ {t('commonWords.addField')}
</button>
</div>
</FormSection>
</button>
</div>
</FormSection>
@@
-105,10
+105,10
@@
const validate = (values, props) => {
values.description.forEach((descr, index) => {
if (!values.description[index].value) {
values.description.forEach((descr, index) => {
if (!values.description[index].value) {
- errors.description[index] = {...errors.description[index], value: t('asset.
keys
Error')}
+ errors.description[index] = {...errors.description[index], value: t('asset.
additionInfoValue
Error')}
}
if (!values.description[index].key) {
}
if (!values.description[index].key) {
- errors.description[index] = {...errors.description[index], key: t('asset.
keys
Error')}
+ errors.description[index] = {...errors.description[index], key: t('asset.
additionInfoKey
Error')}
}
})
}
})
diff --git
a/src/features/assets/components/NewKeyAndSign.jsx
b/src/features/assets/components/NewKeyAndSign.jsx
index
4143bf3
..
062951a
100644
(file)
--- a/
src/features/assets/components/NewKeyAndSign.jsx
+++ b/
src/features/assets/components/NewKeyAndSign.jsx
@@
-39,6
+39,7
@@
class NewKeyAndSign extends React.Component {
label= { t('asset.new') }
onSubmit={handleSubmit}
submitting={submitting}
label= { t('asset.new') }
onSubmit={handleSubmit}
submitting={submitting}
+ secondaryAction={prev}
>
<FormSection title={t('form.keyAndSign')}>
>
<FormSection title={t('form.keyAndSign')}>
@@
-47,9
+48,6
@@
class NewKeyAndSign extends React.Component {
quorum={quorum}
quorumHint={t('asset.quorumHint')} />
</FormSection>
quorum={quorum}
quorumHint={t('asset.quorumHint')} />
</FormSection>
- <button type='button' onClick={prev}>
- <i/> Previous
- </button>
</FormContainer>
)
</FormContainer>
)
diff --git
a/src/features/shared/components/FormContainer/FormContainer.jsx
b/src/features/shared/components/FormContainer/FormContainer.jsx
index
7c1a236
..
e05a423
100644
(file)
--- a/
src/features/shared/components/FormContainer/FormContainer.jsx
+++ b/
src/features/shared/components/FormContainer/FormContainer.jsx
@@
-31,6
+31,9
@@
class FormContainer extends React.Component {
success={this.props.success} />}
<div className={styles.submit}>
success={this.props.success} />}
<div className={styles.submit}>
+ {this.props.secondaryAction && <button type='button' className='btn btn-link' onClick={this.props.secondaryAction }>
+ { this.props.secondaryLabel ||t('commonWords.previous')}
+ </button>}
<button type='submit' className='btn btn-primary' disabled={this.props.submitting || this.props.disabled}>
{this.props.submitLabel || (t('form.submit'))}
</button>
<button type='submit' className='btn btn-primary' disabled={this.props.submitting || this.props.disabled}>
{this.props.submitLabel || (t('form.submit'))}
</button>
diff --git
a/src/locales/en/translation.json
b/src/locales/en/translation.json
index
1192c57
..
f2cf8a2
100644
(file)
--- a/
src/locales/en/translation.json
+++ b/
src/locales/en/translation.json
@@
-21,7
+21,12
@@
"aliasPlaceholder":"Please entered asset alias",
"decimalsError":"Decimals is required.",
"decimalsTypeError":"Please enter a number.",
"aliasPlaceholder":"Please entered asset alias",
"decimalsError":"Decimals is required.",
"decimalsTypeError":"Please enter a number.",
- "decimalsRangeError":"Please enter a decimals number smaller or equal to 16."
+ "decimalsRangeError":"Please enter a decimals number smaller or equal to 16.",
+ "additionInfo":"Additional Info",
+ "additionInfoKey":"Description",
+ "additionInfoValue":"Value",
+ "additionInfoKeyError":"Description is required.",
+ "additionInfoValueError":"Value is required."
},
"commonWords": {
"version": "Version",
},
"commonWords": {
"version": "Version",
@@
-36,7
+41,8
@@
"cancel": "Cancel",
"continue":"Continue",
"next":"Next",
"cancel": "Cancel",
"continue":"Continue",
"next":"Next",
- "previous":"Previous"
+ "previous":"Previous",
+ "addField":"Add Field"
},
"crumbName":{
"transaction": "transactions",
},
"crumbName":{
"transaction": "transactions",
diff --git
a/src/locales/zh/translation.json
b/src/locales/zh/translation.json
index
d6348c9
..
56724ee
100644
(file)
--- a/
src/locales/zh/translation.json
+++ b/
src/locales/zh/translation.json
@@
-21,7
+21,12
@@
"aliasPlaceholder":"请输入资产别名",
"decimalsError":"精度是必须项",
"decimalsTypeError":"请输入数字",
"aliasPlaceholder":"请输入资产别名",
"decimalsError":"精度是必须项",
"decimalsTypeError":"请输入数字",
- "decimalsRangeError":"精度的最大值是16。"
+ "decimalsRangeError":"精度的最大值是16。",
+ "additionInfo":"附加信息",
+ "additionInfoKey":"描述",
+ "additionInfoValue":"值",
+ "additionInfoKeyError":"描述是必须项。",
+ "additionInfoValueError":"值是必须项。"
},
"commonWords": {
"version": "版本号",
},
"commonWords": {
"version": "版本号",
@@
-36,7
+41,8
@@
"cancel": "返回",
"continue":"继续",
"next":"向后",
"cancel": "返回",
"continue":"继续",
"next":"向后",
- "previous":"向前"
+ "previous":"向前",
+ "addField":"添加项"
},
"crumbName":{
"transaction": "交易",
},
"crumbName":{
"transaction": "交易",