From 6a9fdd7518bc2932876e0b44944366bf7909269d Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Fri, 14 Jul 2023 11:55:33 -0600 Subject: [PATCH 1/2] fix/batch-fixes-14-jul-2023 --- src/app/app-routing.module.ts | 7 ++++++- .../panel/panel-source/panel-source.component.html | 12 ++---------- .../panel/panel-source/panel-source.component.ts | 1 + .../terms-of-use/terms-of-use.component.html | 1 - .../terms-of-use/terms-of-use.component.ts | 2 -- .../developer-tools/developer-tools.component.html | 1 - .../developer-tools/developer-tools.component.ts | 14 +++++++++++--- .../affiliation-stack.component.html | 1 + .../funding-stack/funding-stack.component.html | 1 + .../peer-review-stack.component.html | 1 + .../research-resource-stack.component.html | 1 + .../work-stack/work-stack.component.html | 1 + 12 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 202d02309a..6ed4ad7a80 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -168,7 +168,12 @@ const routes: Routes = [ ] @NgModule({ - imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })], + imports: [ + RouterModule.forRoot(routes, { + relativeLinkResolution: 'legacy', + anchorScrolling: 'enabled', + }), + ], exports: [RouterModule], }) export class AppRoutingModule {} diff --git a/src/app/cdk/panel/panel-source/panel-source.component.html b/src/app/cdk/panel/panel-source/panel-source.component.html index 63f2b1015c..c5bb2b4263 100644 --- a/src/app/cdk/panel/panel-source/panel-source.component.html +++ b/src/app/cdk/panel/panel-source/panel-source.component.html @@ -14,22 +14,14 @@ Source:

() $destroy = new Subject() @@ -54,7 +53,6 @@ export class TermsOfUseComponent implements OnInit, OnDestroy { if (primaryEmail?.verified) { this.emailAlreadyVerified = true this._changeDetectorRef.detectChanges() - this.firstInput?.focus() } }) } diff --git a/src/app/developer-tools/pages/developer-tools/developer-tools.component.html b/src/app/developer-tools/pages/developer-tools/developer-tools.component.html index 1cf04c69b1..ace05d21e8 100644 --- a/src/app/developer-tools/pages/developer-tools/developer-tools.component.html +++ b/src/app/developer-tools/pages/developer-tools/developer-tools.component.html @@ -94,7 +94,6 @@ formControlName="displayName" type="text" id="displayName" - #firstInput /> { + window.scrollTo(0, 0) + history.replaceState({}, document.title, "/developer-tools") + }) + } + save() { this.formWasSummited = true diff --git a/src/app/record/components/affiliation-stack/affiliation-stack.component.html b/src/app/record/components/affiliation-stack/affiliation-stack.component.html index 31fec131e8..3a2dd3a208 100644 --- a/src/app/record/components/affiliation-stack/affiliation-stack.component.html +++ b/src/app/record/components/affiliation-stack/affiliation-stack.component.html @@ -74,6 +74,7 @@

[sourceName]="affiliation.sourceName || affiliation.source" [assertionOriginName]="affiliation.assertionOriginName" [assertionOriginOrcid]="affiliation.assertionOriginOrcid" + [assertionOriginClientId]="affiliation.assertionOriginClientId" [stackLength]="affiliationStack.affiliations.length" [(displayTheStack)]="displayTheStack" (makePrimary)="makePrimaryCard(affiliation)" diff --git a/src/app/record/components/funding-stack/funding-stack.component.html b/src/app/record/components/funding-stack/funding-stack.component.html index ce22149cba..4fe3b4683d 100644 --- a/src/app/record/components/funding-stack/funding-stack.component.html +++ b/src/app/record/components/funding-stack/funding-stack.component.html @@ -45,6 +45,7 @@

[isPreferred]="isPreferred(funding)" [sourceName]="funding.sourceName || funding.source" [assertionOriginName]="funding.assertionOriginName" + [assertionOriginClientId]="funding.assertionOriginClientId" [assertionOriginOrcid]="funding.assertionOriginOrcid" [stackLength]="fundingStack.fundings.length" [(displayTheStack)]="displayTheStack" diff --git a/src/app/record/components/peer-review-stack/peer-review-stack.component.html b/src/app/record/components/peer-review-stack/peer-review-stack.component.html index 1958268db6..b35e12ef50 100644 --- a/src/app/record/components/peer-review-stack/peer-review-stack.component.html +++ b/src/app/record/components/peer-review-stack/peer-review-stack.component.html @@ -117,6 +117,7 @@ [isPreferred]="isPreferred(subPeerReview)" [sourceName]="subPeerReview.sourceName || subPeerReview.source" [assertionOriginName]="subPeerReview.assertionOriginName" + [assertionOriginClientId]="subPeerReview.assertionOriginClientId" [assertionOriginOrcid]="subPeerReview.assertionOriginOrcid" [stackLength]="peerReviewStack.peerReviews.length" [(displayTheStack)]="displayTheStack" diff --git a/src/app/record/components/research-resource-stack/research-resource-stack.component.html b/src/app/record/components/research-resource-stack/research-resource-stack.component.html index d6bbf04953..124f1ffaaa 100644 --- a/src/app/record/components/research-resource-stack/research-resource-stack.component.html +++ b/src/app/record/components/research-resource-stack/research-resource-stack.component.html @@ -44,6 +44,7 @@

[sourceName]="research.sourceName || research.source" [assertionOriginName]="research.assertionOriginName" [assertionOriginOrcid]="research.assertionOriginOrcid" + [assertionOriginClientId]="research.assertionOriginClientId" [stackLength]="researchResourceStack.researchResources.length" [(displayTheStack)]="displayTheStack" (makePrimary)="makePrimaryCard(research)" diff --git a/src/app/record/components/work-stack/work-stack.component.html b/src/app/record/components/work-stack/work-stack.component.html index 104e15caec..5fa528e875 100644 --- a/src/app/record/components/work-stack/work-stack.component.html +++ b/src/app/record/components/work-stack/work-stack.component.html @@ -54,6 +54,7 @@

{{ work.title.value }}

[isPreferred]="isPreferred(work)" [sourceName]="work.sourceName || work.source" [assertionOriginName]="work.assertionOriginName" + [assertionOriginClientId]="work.assertionOriginClientId" [assertionOriginOrcid]="work.assertionOriginOrcid" [stackLength]="workStack.works.length" [(displayTheStack)]="displayTheStack" From d81543efc21f862cac5b7c335728657d42e57194 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Date: Fri, 14 Jul 2023 11:57:13 -0600 Subject: [PATCH 2/2] Use service window --- .../pages/developer-tools/developer-tools.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts b/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts index b150b68d95..9901b44077 100644 --- a/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts +++ b/src/app/developer-tools/pages/developer-tools/developer-tools.component.ts @@ -76,7 +76,7 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy { private recordService: RecordService, private _changeDetectorRef: ChangeDetectorRef, @Inject(WINDOW) private window: Window, - private _platform: PlatformInfoService, + private _platform: PlatformInfoService ) {} ngOnDestroy(): void { this.destroy$.next(true) @@ -144,10 +144,10 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy { } private setFocusToTheMainDiv() { - location.href = '/developer-tools' + '#main' + this.window.location.href = '/developer-tools' + '#main' setTimeout(() => { - window.scrollTo(0, 0) - history.replaceState({}, document.title, "/developer-tools") + this.window.window.scrollTo(0, 0) + this.window.history.replaceState({}, this.window.document.title, '/developer-tools') }) }