From 35ca70def1a6c8bd56bcff37681b5d0f48950e6f Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Mon, 31 Jul 2023 16:01:19 -0600 Subject: [PATCH 1/3] Add git functionality --- .../side-bar/side-bar/side-bar.component.html | 3 +- .../side-bar/side-bar/side-bar.component.ts | 7 +- .../pages/my-orcid/my-orcid.component.ts | 57 ++++++++++- .../trusted-summary.component.html | 97 +++++++++---------- .../trusted-summary.component.ts | 1 + 5 files changed, 108 insertions(+), 57 deletions(-) diff --git a/src/app/cdk/side-bar/side-bar/side-bar.component.html b/src/app/cdk/side-bar/side-bar/side-bar.component.html index d54cc35d53..055235588c 100644 --- a/src/app/cdk/side-bar/side-bar/side-bar.component.html +++ b/src/app/cdk/side-bar/side-bar/side-bar.component.html @@ -120,9 +120,10 @@

[isPublicRecord]="isPublicRecord" [type]="'side-bar'" class="side-bar" - id="personal-identifiers-panel" + id="other-identifiers" [(openState)]="externalIdentifierOpenState" [userRecord]="userRecord" + >

Other IDs

{ + if (fragment) { + this.fragment = fragment + this._router.navigate([], { fragment: '' }) + } + }) + this._platform.get().subscribe((value) => (this.platform = value)) this._record .getRecord({ @@ -140,6 +156,41 @@ export class MyOrcidComponent implements OnInit, OnDestroy { } this._openGraph.addOpenGraphData(userRecord, { force: true }) + + console.log('NOT READY ', userRecord) + + // Add back fragment when items have loaded + if ( + userRecord.works && + userRecord.fundings && + userRecord.peerReviews && + userRecord.researchResources && + userRecord.affiliations && + userRecord.externalIdentifier && + [ + 'works', + 'affiliations', + 'peer-reviews', + 'funding', + 'professional-activities', + ].find((x) => x === this.fragment) + ) { + console.log('READY ', JSON.stringify(userRecord)) + setTimeout(() => { + document.querySelector('#' + this.fragment).scrollIntoView() + this._router.navigate([], { fragment: this.fragment }) + }) + } + if ( + userRecord.externalIdentifier && + this.fragment === 'other-identifiers' + ) { + console.log('READY ', JSON.stringify(userRecord)) + setTimeout(() => { + document.querySelector('#' + this.fragment).scrollIntoView() + this._router.navigate([], { fragment: this.fragment }) + }) + } }), switchMap(() => this._togglz.getTogglz().pipe(first())), tap((togglz) => { diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html index b8d4ce041d..ebbb7e7a9f 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html @@ -63,7 +63,7 @@

{{ trustedSummary.name }}

> @@ -75,54 +75,47 @@

[url]="trustedSummary?.orcid" [activitySummary]="trustedSummary.employmentAffiliations" > - -

- KEY DATES -

-
-
-
    -
  • -
    + +

    KEY DATES

    +
    +
      +
    • +
      + - - Record created - - -
      -
    • -
    • -
      + +
      +
    • +
    • +
      + - - Last updated - - -
      -
    • -
    -
    - + Last updated + + +
    +
  • +
+
> @@ -143,7 +136,7 @@

WORKS

@@ -157,7 +150,7 @@

@@ -178,7 +171,7 @@

FUNDING

>
@@ -197,7 +190,7 @@

FUNDING

diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts index 718f239eba..9be35f02d0 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts @@ -67,6 +67,7 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy { this.orcid = this._router.url.split('/')[1] this._trustedSummary.getSummary(this.orcid).subscribe((data) => { this.trustedSummary = data + this.trustedSummary.orcid = 'http://localhost:4200/0000-0002-6108-9550' if (this.trustedSummary.selfAssertedWorks) { this.works.push({ verified: false, From ad46c23dc6012dbd47fbb94ec9d78f52a2341c3f Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Mon, 31 Jul 2023 16:08:33 -0600 Subject: [PATCH 2/3] Add fragment navigation --- src/app/cdk/side-bar/side-bar/side-bar.component.html | 1 - src/app/record/pages/my-orcid/my-orcid.component.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/app/cdk/side-bar/side-bar/side-bar.component.html b/src/app/cdk/side-bar/side-bar/side-bar.component.html index 055235588c..007bf37dd5 100644 --- a/src/app/cdk/side-bar/side-bar/side-bar.component.html +++ b/src/app/cdk/side-bar/side-bar/side-bar.component.html @@ -123,7 +123,6 @@

id="other-identifiers" [(openState)]="externalIdentifierOpenState" [userRecord]="userRecord" - >

Other IDs

x === this.fragment) ) { - console.log('READY ', JSON.stringify(userRecord)) setTimeout(() => { document.querySelector('#' + this.fragment).scrollIntoView() this._router.navigate([], { fragment: this.fragment }) @@ -185,7 +183,6 @@ export class MyOrcidComponent implements OnInit, OnDestroy { userRecord.externalIdentifier && this.fragment === 'other-identifiers' ) { - console.log('READY ', JSON.stringify(userRecord)) setTimeout(() => { document.querySelector('#' + this.fragment).scrollIntoView() this._router.navigate([], { fragment: this.fragment }) From b0f04a4a228b155416e6c47b938bfe325b802d01 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Mon, 31 Jul 2023 16:11:17 -0600 Subject: [PATCH 3/3] remove test data --- .../pages/trusted-summary/trusted-summary.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts index 9be35f02d0..718f239eba 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts @@ -67,7 +67,6 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy { this.orcid = this._router.url.split('/')[1] this._trustedSummary.getSummary(this.orcid).subscribe((data) => { this.trustedSummary = data - this.trustedSummary.orcid = 'http://localhost:4200/0000-0002-6108-9550' if (this.trustedSummary.selfAssertedWorks) { this.works.push({ verified: false,