Standardize CoaVerify route across apps

This commit is contained in:
Brett Sun 2016-01-29 11:20:43 +01:00
parent 01217318a4
commit 7383fbb1f6
2 changed files with 46 additions and 49 deletions

View File

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

View File

@ -77,7 +77,7 @@ let ROUTES = {
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CylandPieceList)} component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CylandPieceList)}
headerTitle='COLLECTION' /> headerTitle='COLLECTION' />
<Route path='editions/:editionId' component={EditionContainer} /> <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='pieces/:pieceId' component={CylandPieceContainer} />
<Route path='*' component={ErrorNotFoundPage} /> <Route path='*' component={ErrorNotFoundPage} />
</Route> </Route>
@ -112,7 +112,7 @@ let ROUTES = {
headerTitle='COLLECTION' /> headerTitle='COLLECTION' />
<Route path='pieces/:pieceId' component={PieceContainer} /> <Route path='pieces/:pieceId' component={PieceContainer} />
<Route path='editions/:editionId' component={EditionContainer} /> <Route path='editions/:editionId' component={EditionContainer} />
<Route path='verify' component={CoaVerifyContainer} /> <Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} /> <Route path='*' component={ErrorNotFoundPage} />
</Route> </Route>
), ),
@ -156,7 +156,7 @@ let ROUTES = {
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvContractNotifications)} /> component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvContractNotifications)} />
<Route path='pieces/:pieceId' component={IkonotvPieceContainer} /> <Route path='pieces/:pieceId' component={IkonotvPieceContainer} />
<Route path='editions/:editionId' component={EditionContainer} /> <Route path='editions/:editionId' component={EditionContainer} />
<Route path='verify' component={CoaVerifyContainer} /> <Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} /> <Route path='*' component={ErrorNotFoundPage} />
</Route> </Route>
), ),
@ -192,7 +192,7 @@ let ROUTES = {
headerTitle='COLLECTION' /> headerTitle='COLLECTION' />
<Route path='pieces/:pieceId' component={MarketPieceContainer} /> <Route path='pieces/:pieceId' component={MarketPieceContainer} />
<Route path='editions/:editionId' component={MarketEditionContainer} /> <Route path='editions/:editionId' component={MarketEditionContainer} />
<Route path='verify' component={CoaVerifyContainer} /> <Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} /> <Route path='*' component={ErrorNotFoundPage} />
</Route> </Route>
), ),
@ -228,7 +228,7 @@ let ROUTES = {
headerTitle='COLLECTION' /> headerTitle='COLLECTION' />
<Route path='pieces/:pieceId' component={MarketPieceContainer} /> <Route path='pieces/:pieceId' component={MarketPieceContainer} />
<Route path='editions/:editionId' component={MarketEditionContainer} /> <Route path='editions/:editionId' component={MarketEditionContainer} />
<Route path='verify' component={CoaVerifyContainer} /> <Route path='coa_verify' component={CoaVerifyContainer} />
<Route path='*' component={ErrorNotFoundPage} /> <Route path='*' component={ErrorNotFoundPage} />
</Route> </Route>
) )