1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Standardize CoaVerify route across apps

This commit is contained in:
Brett Sun 2016-01-29 11:20:43 +01:00
parent 5cfbe5cc39
commit 2661f2ba57
2 changed files with 46 additions and 49 deletions

View File

@ -27,7 +27,7 @@ let CoaVerifyContainer = React.createClass({
return (
<div className="ascribe-login-wrapper">
<br/>
<br />
<div className="ascribe-login-text ascribe-login-header">
{getLangText('Verify your Certificate of Authenticity')}
</div>
@ -37,7 +37,7 @@ let CoaVerifyContainer = React.createClass({
signature={signature}/>
<br />
<br />
{getLangText('ascribe is using the following public key for verification')}:
{getLangText('ascribe is using the following public key for verification')}:
<br />
<pre>
-----BEGIN PUBLIC KEY-----
@ -60,9 +60,8 @@ let CoaVerifyForm = React.createClass({
},
handleSuccess(response){
let notification = null;
if (response.verdict) {
notification = new GlobalNotificationModel(getLangText('Certificate of Authenticity successfully verified'), 'success');
const notification = new GlobalNotificationModel(getLangText('Certificate of Authenticity successfully verified'), 'success');
GlobalNotificationActions.appendGlobalNotification(notification);
}
},
@ -71,46 +70,44 @@ let CoaVerifyForm = React.createClass({
const { message, signature } = this.props;
return (
<div>
<Form
url={ApiUrls.coa_verify}
handleSuccess={this.handleSuccess}
buttons={
<button
type="submit"
className="btn btn-default btn-wide">
{getLangText('Verify your Certificate of Authenticity')}
</button>}
spinner={
<span className="btn btn-default btn-wide btn-spinner">
<AscribeSpinner color="dark-blue" size="md" />
</span>
}>
<Property
name='message'
label={getLangText('Message')}>
<input
type="text"
placeholder={getLangText('Copy paste the message on the bottom of your Certificate of Authenticity')}
autoComplete="on"
defaultValue={message}
name="username"
required/>
</Property>
<Property
name='signature'
label="Signature"
editable={true}
overrideForm={true}>
<InputTextAreaToggable
rows={3}
placeholder={getLangText('Copy paste the signature on the bottom of your Certificate of Authenticity')}
defaultValue={signature}
required/>
</Property>
<hr />
</Form>
</div>
<Form
url={ApiUrls.coa_verify}
handleSuccess={this.handleSuccess}
buttons={
<button
type="submit"
className="btn btn-default btn-wide">
{getLangText('Verify your Certificate of Authenticity')}
</button>
}
spinner={
<span className="btn btn-default btn-wide btn-spinner">
<AscribeSpinner color="dark-blue" size="md" />
</span>
}>
<Property
name='message'
label={getLangText('Message')}>
<input
type="text"
placeholder={getLangText('Copy paste the message on the bottom of your Certificate of Authenticity')}
autoComplete="on"
defaultValue={message}
required />
</Property>
<Property
name='signature'
label="Signature"
editable={true}
overrideForm={true}>
<InputTextAreaToggable
rows={3}
placeholder={getLangText('Copy paste the signature on the bottom of your Certificate of Authenticity')}
defaultValue={signature}
required />
</Property>
<hr />
</Form>
);
}
});

View File

@ -78,7 +78,7 @@ let ROUTES = {
headerTitle='COLLECTION'
disableOn='noPieces' />
<Route path='editions/:editionId' component={EditionContainer} />
<Route path='verify' component={CoaVerifyContainer} />
<Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='pieces/:pieceId' component={CylandPieceContainer} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
@ -114,7 +114,7 @@ let ROUTES = {
disableOn='noPieces' />
<Route path='pieces/:pieceId' component={PieceContainer} />
<Route path='editions/:editionId' component={EditionContainer} />
<Route path='verify' component={CoaVerifyContainer} />
<Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
),
@ -159,7 +159,7 @@ let ROUTES = {
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvContractNotifications)} />
<Route path='pieces/:pieceId' component={IkonotvPieceContainer} />
<Route path='editions/:editionId' component={EditionContainer} />
<Route path='verify' component={CoaVerifyContainer} />
<Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
),
@ -196,7 +196,7 @@ let ROUTES = {
disableOn='noPieces' />
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
<Route path='editions/:editionId' component={MarketEditionContainer} />
<Route path='verify' component={CoaVerifyContainer} />
<Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
),
@ -233,7 +233,7 @@ let ROUTES = {
disableOn='noPieces' />
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
<Route path='editions/:editionId' component={MarketEditionContainer} />
<Route path='verify' component={CoaVerifyContainer} />
<Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} />
</Route>
)