1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Merge branch 'AD-290-coa-buttons-and-usage-esp-verify' of github.com:ascribe/onion into AD-290-coa-buttons-and-usage-esp-verify

This commit is contained in:
diminator 2015-12-08 18:17:30 +01:00
commit 4e3cf47d3f
3 changed files with 23 additions and 13 deletions

View File

@ -269,6 +269,8 @@ let CoaDetails = React.createClass({
return (
<div className="text-center">
<AscribeSpinner color='dark-blue' size='lg'/>
<p>{getLangText("Just a sec, we\'re generating your COA")}</p>
<p>{getLangText('(you may leave the page)')}</p>
</div>
);
}

View File

@ -64,8 +64,7 @@ let EditionContainer = React.createClass({
componentDidUpdate() {
const { editionMeta } = this.state;
if(editionMeta.err && editionMeta.err.status === 404) {
if(editionMeta.err && editionMeta.err.json && editionMeta.err.json.status === 404) {
this.throws(new ResourceNotFoundError(getLangText("Oops, the edition you're looking for doesn't exist.")));
}
},

View File

@ -29,21 +29,30 @@ class EditionStore {
}
}
onSuccessFetchEdition({ edition }) {
onSuccessFetchEdition(res) {
if(res && res.edition) {
this.edition = res.edition;
this.editionMeta.err = null;
this.editionMeta.idToFetch = null;
this.edition = edition;
if(this.edition && this.edition.coa && typeof this.edition.coa.constructor !== Object) {
if (this.edition.coa && this.edition.acl.acl_coa &&
typeof this.edition.coa.constructor !== Object) {
this.getInstance().lookupCoa();
} else if(this.edition && !this.edition.coa && this.edition.acl.acl_coa) {
} else if(!this.edition.coa && this.edition.acl.acl_coa) {
this.getInstance().performCreateCoa();
}
} else {
this.editionMeta.err = new Error('Problem fetching the edition');
}
}
onSuccessFetchCoa({ coa }) {
onSuccessFetchCoa(res) {
if (res && res.coa && this.edition) {
this.edition.coa = res.coa;
this.coaMeta.err = null;
this.edition.coa = coa;
} else {
this.coaMeta.err = new Error('Problem generating/fetching the COA');
}
}
onFlushEdition() {