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-of-fixes-13-jul-2023 #2016

Merged
merged 2 commits into from
Jul 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ <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
@@ -1,10 +1,14 @@
import {
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
OnDestroy,
OnInit,
Output,
ViewChild,
} from '@angular/core'
import { MatCheckbox } from '@angular/material/checkbox'
import { Subject } from 'rxjs'
import { takeUntil } from 'rxjs/operators'
import { PlatformInfoService } from 'src/app/cdk/platform-info'
Expand All @@ -23,13 +27,16 @@ 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>()
emailAlreadyVerified: boolean

constructor(
private developerToolsService: DeveloperToolsService,
private _record: RecordService
private _record: RecordService,
private _changeDetectorRef: ChangeDetectorRef
) {}
ngOnDestroy(): void {
this.$destroy.next(true)
Expand All @@ -46,6 +53,8 @@ export class TermsOfUseComponent implements OnInit, OnDestroy {
)[0]
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 @@ -11,7 +11,6 @@
Developer tools
</h1>
<a
#firstInput
routerLink="/my-orcid"
i18n="@@developerTools.backToMyRecod"
cdkFocusInitial
Expand Down Expand Up @@ -95,6 +94,7 @@
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 @@ -66,7 +66,7 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy {
baseURL: string
isMobile: boolean

@ViewChild('firstInput') firstInput: ElementRef
@ViewChild('firstInput', { static: false }) firstInput: ElementRef

constructor(
private fb: FormBuilder,
Expand Down Expand Up @@ -138,10 +138,9 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy {
])
)
})
this._changeDetectorRef.detectChanges()
this.firstInput.nativeElement.focus()
})
this._changeDetectorRef.detectChanges()

this.firstInput.nativeElement.focus()
}

save() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"
>
<!-- A PANEL COMPONENT FOR EACH FUNDING ON THE STACK -->

<app-panel
panelId="funding-stack"
[userRecord]="userRecord"
Expand All @@ -20,7 +19,7 @@
[visibility]="fundingStack.defaultFunding.visibility.visibility"
[isPublicRecord]="isPublicRecord"
[putCode]="funding.putCode.value"
[isUserSource]="funding.userIsSource"
[isUserSource]="userIsSource(funding)"
[hasExternalIds]="hasExternalIds"
[userVersionPresent]="fundingStack.userVersionPresent"
[(displayTheStack)]="displayTheStack"
Expand Down
16 changes: 0 additions & 16 deletions src/app/record/components/funding-stack/funding-stack.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ export class FundingStackComponent implements OnInit {
set fundingStack(value: FundingGroup) {
this.hasExternalIds = !!value.externalIdentifiers.length
this._fundingStack = value
this._fundingStack.fundings = this._fundingStack.fundings.map((funding) => {
return {
...funding,
userIsSource: this.userIsSource(funding),
}
})
this.setFundingsInitialStates(value)
}
get fundingStack(): FundingGroup {
Expand All @@ -54,16 +48,6 @@ export class FundingStackComponent implements OnInit {
@Input()
set userInfo(userInfo: UserInfo) {
this._userInfo = userInfo
if (this._fundingStack.fundings) {
this._fundingStack.fundings = this._fundingStack.fundings.map(
(funding) => {
return {
...funding,
userIsSource: this.userIsSource(funding),
}
}
)
}
}
get userInfo(): UserInfo {
return this._userInfo
Expand Down
1 change: 0 additions & 1 deletion src/app/types/record-funding.endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export interface Funding extends AssertionBase {
typeForDisplay?: string
dateSortString?: MonthDayYearDate
fullyLoaded?: boolean
userIsSource?: boolean
}

export enum FundingTypes {
Expand Down