Skip to content

Commit

Permalink
handle remove affiliation #246
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Nov 26, 2019
1 parent 2f48e4a commit a22f617
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions app/components/doi-affiliation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ export default Component.extend({
organizations: [],

updateAffiliation(organizationRecord) {
this.fragment.set('name', organizationRecord.name);
this.fragment.set('affiliationIdentifier', organizationRecord.id);
this.fragment.set('schemeUri', 'https://ror.org');
this.fragment.set('affiliationIdentifierScheme', 'ROR');

this.setCreatorValidationClass();
if (organizationRecord) {
this.fragment.set('name', organizationRecord.name);
this.fragment.set('affiliationIdentifier', organizationRecord.id);
this.fragment.set('schemeUri', 'https://ror.org');
this.fragment.set('affiliationIdentifierScheme', 'ROR');

this.setCreatorValidationClass();
} else {
this.fragment.set('name', null);
this.fragment.set('affiliationIdentifier', null);
this.fragment.set('schemeUri', 'https://ror.org');
this.fragment.set('affiliationIdentifierScheme', 'ROR');

// this.setCreatorValidationClass();
}
},

actions: {
Expand All @@ -23,11 +32,7 @@ export default Component.extend({
});
},
selectRor(ror) {
if (ror) {
this.updateAffiliation(ror);
} else {
this.updateAffiliation(null);
}
this.updateAffiliation(ror);
},
deleteAffiliation() {
this.creator.get('affiliation').removeObject(this.fragment);
Expand Down

0 comments on commit a22f617

Please sign in to comment.