diff --git a/src/js/modules/orcid/widget/templates/container-template.html b/src/js/modules/orcid/widget/templates/container-template.html index e7e740466..3d7b61d60 100644 --- a/src/js/modules/orcid/widget/templates/container-template.html +++ b/src/js/modules/orcid/widget/templates/container-template.html @@ -1,44 +1,49 @@ -
-
- -
- the ORCID logo combined with ADS logo -
+
+ + +
+
+

+ orcid-ads logo + My ORCID Papers +

{{#if loading}} -

Loading...

+

Loading ORCID data...

{{else}} -

You are signed in to ORCID as {{orcidUserName}}

-

- Learn more about using ORCID with ADS. -

-
+

ORCID Username: {{ orcidUserName }}

+

ORCID ID: {{orcidID}}

+ +

To share this list of your ORCID papers: +

+

+

+ To claim papers in ORCID and add to this list, + {{#if orcidUserName}} + + {{else}} + search your name in ADS + {{/if}} +

+ +

Further instructions on using ORCID with ADS

+
+
+ {{/if}}
-
- -
- -
- -
- {{#unless loading}} -

My ORCID Papers

- {{#if orcidUserName}} -
To claim papers in ORCID and add to this list,
- {{else}} -
To claim papers in ORCID and add to this list, search your name in ADS
- {{/if}} - {{/unless}} -
- -
-
- +
diff --git a/src/js/modules/orcid/widget/widget.js b/src/js/modules/orcid/widget/widget.js index 1d0c66348..fc84a09b7 100644 --- a/src/js/modules/orcid/widget/widget.js +++ b/src/js/modules/orcid/widget/widget.js @@ -267,6 +267,7 @@ define([ response.setApiQuery(new ApiQuery(params)); self.processResponse(response); self.model.set({ + orcidID : params.orcid, orcidUserName : params.firstName + " " + params.lastName, orcidFirstName : params.firstName, orcidLastName : params.lastName, diff --git a/test/mocha/js/modules/orcid/orcid_widget.spec.js b/test/mocha/js/modules/orcid/orcid_widget.spec.js index 145f320fa..df82d5549 100644 --- a/test/mocha/js/modules/orcid/orcid_widget.spec.js +++ b/test/mocha/js/modules/orcid/orcid_widget.spec.js @@ -368,13 +368,6 @@ define([ }; }; - it("should display a loading view before orcid profile promise returns", function(){ - - - - - - }); it("Should display records coming from ORCID and has methods to filter/sort them", function (done) { @@ -444,7 +437,7 @@ define([ var orcidApi = getOrcidApi(); orcidApi.saveAccessData({access: true}); orcidApi.getUserProfile = function() { - expect($("#test .s-results-control-row-container").text().trim()).to.eql("Loading..."); + expect($("#test .s-results-control-row-container").text().trim()).to.eql('My ORCID Papers\n \n \n \n Loading ORCID data...'); var d = $.Deferred(); d.resolve(defaultResponse()['orcid-profile']); return d; @@ -459,7 +452,7 @@ define([ widget.onShow(); - expect($("#test .s-results-control-row-container").text().trim()).to.eql( 'You are signed in to ORCID as Roman Chyla\n \n Learn more about using ORCID with ADS.') + expect($("#test .s-results-control-row-container").text().replace(/\s{2,}/g, "")).to.eql("My ORCID PapersORCID Username: Roman ChylaORCID ID: 0000-0001-8178-9506To share this list of your ORCID papers:You can share this link: https://ui.adsabs.harvard.edu/#search/q=orcid%3A0000-0001-8178-9506&sort=date+descOr searchorcid:0000-0001-8178-9506in the ADS interface at any time.To claim papers in ORCID and add to this list,click here to search your name in ADSFurther instructions on using ORCID with ADS") });