Skip to content

Commit

Permalink
don't save givenName and familyName for nameType organizational. #192
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 22, 2019
1 parent f6aa93e commit 4db897e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/components/doi-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ export default Component.extend({
this.set('nameType', value);

if (this.fragment.get('nameType') === "Personal") {
//this.setValidationClass();
this.set('isReadonly', true);
} else {
this.setValidationClass();
this.set('isReadonly', false);
}
},
Expand Down
7 changes: 7 additions & 0 deletions app/controllers/clients/show/dois/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default Controller.extend({
creator.set('affiliation', creator.get('affiliation').filter(function(affiliation) {
return !isBlank(affiliation);
}));
if (creator.nameType === 'Organizational') {
creator.set('givenName', null);
creator.set('familyName', null);
}
});

// only store descriptions with a description text
Expand Down Expand Up @@ -63,6 +67,9 @@ export default Controller.extend({
cancel() {
this.transitionToRoute('clients.show.dois', this.get('model.client.id'));
},
setCreatorValidations(value) {
console.log(value)
},
setTitleValidations(value) {
console.log(value)
}
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/clients/show/dois/show/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default Controller.extend({
creator.set('affiliation', creator.get('affiliation').filter(function(affiliation) {
return !isBlank(affiliation);
}));
if (creator.nameType === 'Organizational') {
creator.set('givenName', null);
creator.set('familyName', null);
}
});

// only store descriptions with a description text
Expand Down

0 comments on commit 4db897e

Please sign in to comment.