Skip to content

Commit

Permalink
Merge pull request #1407 from thostetler/1404-orcid-duplicate-claims
Browse files Browse the repository at this point in the history
1404 orcid duplicate claims
  • Loading branch information
ehenneken authored Mar 14, 2018
2 parents addd500 + cc0a8f6 commit cb35893
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 30 deletions.
10 changes: 7 additions & 3 deletions src/js/modules/orcid/orcid_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,11 @@ define([
var oldWork = cacheEntry.work;

// check to see if the work is an error message, { error: {...} }
if (work.error) {
if (!work) {

// something weird going on with work, just reject
promise.reject();
} else if (work.error) {

// check to see if it's just a conflict
if (work.error['response-code'] === 409) {
Expand Down Expand Up @@ -1007,7 +1011,7 @@ define([
Then we can add some metadata like whether it was an ADS sourced
record or not
*/
var updateRecord = function (k, v, out) {
var updateRecord = function (v, k, out) {

// db is always 'identifier:xxx'
var key = ('identifier:' + v).toLowerCase();
Expand All @@ -1034,7 +1038,7 @@ define([
if (_.isArray(value)) {
_.each(value, updateRecord);
} else {
updateRecord(key, value, out);
updateRecord(value, key, out);
}
});

Expand Down
3 changes: 3 additions & 0 deletions src/js/modules/orcid/widget/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ define([
var start = 0;
var docs = PaginationMixin.addPaginationToDocs(docs, start);
_.each(docs, function (d,i) {

// let each doc know if it's on the orcid widget page
d.isOrcidWidget = true;
docs[i] = PapersUtilsMixin.prepareDocForViewing(d);
});
return docs;
Expand Down
57 changes: 30 additions & 27 deletions src/js/widgets/list_of_things/templates/item-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,34 +121,37 @@ <h3 class="s-results-title">{{{title}}}</h3>
<div class="row">
<div class="col-xs-10 col-xs-offset-1">

{{#if authorFormatted}}
<ul class="list-inline just-authors s-results-authors less-authors" aria-label="authors">
{{#each authorFormatted}}
<li class="article-author">{{this}}</li>
{{/each}}

{{#if extraAuthors}}
<li>
<a href="#" id="show-all-authors">
<em>and {{extraAuthors}} more</em>
</a>
</li>
{{#unless isOrcidWidget}}
{{#if authorFormatted}}
<ul class="list-inline just-authors s-results-authors less-authors" aria-label="authors">
{{#each authorFormatted}}
<li class="article-author">{{this}}</li>
{{/each}}

{{#if extraAuthors}}
<li>
<a href="#" id="show-all-authors">
<em>and {{extraAuthors}} more</em>
</a>
</li>
{{/if}}
</ul>

<ul class="list-inline just-authors s-results-authors all-authors hidden" aria-label="authors">
{{#each allAuthorFormatted}}
<li class="article-author">{{this}}</li>
{{/each}}
<li>
<a href="#" id="show-less-authors">
<em>show less</em>
</a>
</li>
</ul>
{{else}}
<span class="text-faded">no author information available</span>
{{/if}}
</ul>

<ul class="list-inline just-authors s-results-authors all-authors hidden" aria-label="authors">
{{#each allAuthorFormatted}}
<li class="article-author">{{this}}</li>
{{/each}}
<li>
<a href="#" id="show-less-authors">
<em>show less</em>
</a>
</li>
</ul>
{{else}}
<span class="text-faded">no author information available</span>
{{/if}}
{{/unless}}


</div>

Expand Down

0 comments on commit cb35893

Please sign in to comment.