Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/batch-fixes-14-jul-2023 #2018

Merged
merged 3 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
12 changes: 2 additions & 10 deletions src/app/cdk/panel/panel-source/panel-source.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,14 @@
<strong i18n="@@shared.source">Source</strong>:
<ng-container *ngIf="recordOnDisplayIsTheSource !== undefined">
<ng-container
*ngIf="
recordOnDisplayIsTheSource ||
assertionOriginName ||
assertionOriginOrcid
"
*ngIf="assertionOriginOrcid || (recordOnDisplayIsTheSource && !assertionOriginClientId)"
>
<mat-icon [attr.aria-label]="selftAssertedSource"
><img src="./assets/vectors/profile-not-verified.svg" />
</mat-icon>
</ng-container>
<ng-container
*ngIf="
!recordOnDisplayIsTheSource &&
!assertionOriginName &&
!assertionOriginOrcid
"
*ngIf="assertionOriginClientId || (!recordOnDisplayIsTheSource && !assertionOriginOrcid)"
>
<mat-icon
[attr.aria-label]="validatedSourceAriaLabel"
Expand Down
1 change: 1 addition & 0 deletions src/app/cdk/panel/panel-source/panel-source.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class PanelSourceComponent implements OnInit {
@Input() sourceName
@Input() assertionOriginOrcid
@Input() assertionOriginName
@Input() assertionOriginClientId
@Input() stackLength
@Input() type:
| 'employment'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ <h2 class="orc-font-body-large" i18n="@@developerTools.additionalResources">

<p class="checkbox-container">
<mat-checkbox
#firstInput
class="mat-checkbox orcid-checkbox-baseline"
[(ngModel)]="checked"
[disabled]="!emailAlreadyVerified"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { RecordService } from 'src/app/core/record/record.service'
export class TermsOfUseComponent implements OnInit, OnDestroy {
checked
dirty: boolean
@ViewChild('firstInput', { static: false }) firstInput: MatCheckbox

@Output() developerToolsEnable = new EventEmitter<boolean>()
$destroy = new Subject<boolean>()
Expand All @@ -54,7 +53,6 @@ export class TermsOfUseComponent implements OnInit, OnDestroy {
if (primaryEmail?.verified) {
this.emailAlreadyVerified = true
this._changeDetectorRef.detectChanges()
this.firstInput?.focus()
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
formControlName="displayName"
type="text"
id="displayName"
#firstInput
/>
<mat-error
*ngIf="form.hasError('required', 'displayName')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.setFocusToTheMainDiv()

this._platform
.get()
.pipe(takeUntil(this.destroy$))
Expand Down Expand Up @@ -138,11 +140,17 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy {
])
)
})
this._changeDetectorRef.detectChanges()
this.firstInput.nativeElement.focus()
})
}

private setFocusToTheMainDiv() {
this.window.location.href = '/developer-tools' + '#main'
setTimeout(() => {
this.window.window.scrollTo(0, 0)
this.window.history.replaceState({}, this.window.document.title, '/developer-tools')
})
}

save() {
this.formWasSummited = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ <h4 header class="affiliation-title orc-font-body">
[sourceName]="affiliation.sourceName || affiliation.source"
[assertionOriginName]="affiliation.assertionOriginName"
[assertionOriginOrcid]="affiliation.assertionOriginOrcid"
[assertionOriginClientId]="affiliation.assertionOriginClientId"
[stackLength]="affiliationStack.affiliations.length"
[(displayTheStack)]="displayTheStack"
(makePrimary)="makePrimaryCard(affiliation)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ <h4 header class="funding-title orc-font-body">
[isPreferred]="isPreferred(funding)"
[sourceName]="funding.sourceName || funding.source"
[assertionOriginName]="funding.assertionOriginName"
[assertionOriginClientId]="funding.assertionOriginClientId"
[assertionOriginOrcid]="funding.assertionOriginOrcid"
[stackLength]="fundingStack.fundings.length"
[(displayTheStack)]="displayTheStack"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h4 header class="research-resources-title">
[sourceName]="research.sourceName || research.source"
[assertionOriginName]="research.assertionOriginName"
[assertionOriginOrcid]="research.assertionOriginOrcid"
[assertionOriginClientId]="research.assertionOriginClientId"
[stackLength]="researchResourceStack.researchResources.length"
[(displayTheStack)]="displayTheStack"
(makePrimary)="makePrimaryCard(research)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ <h4 header class="work-title orc-font-body">{{ work.title.value }}</h4>
[isPreferred]="isPreferred(work)"
[sourceName]="work.sourceName || work.source"
[assertionOriginName]="work.assertionOriginName"
[assertionOriginClientId]="work.assertionOriginClientId"
[assertionOriginOrcid]="work.assertionOriginOrcid"
[stackLength]="workStack.works.length"
[(displayTheStack)]="displayTheStack"
Expand Down