Skip to content

Commit

Permalink
remove SIGN_IN_UPDATES_V1
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn committed Sep 2, 2024
1 parent 2fad43d commit 7fbe21b
Show file tree
Hide file tree
Showing 21 changed files with 464 additions and 1,095 deletions.
429 changes: 135 additions & 294 deletions src/app/authorize/components/form-authorize/form-authorize.component.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { Title } from '@angular/platform-browser'
preserveWhitespaces: true,
})
export class FormAuthorizeComponent implements OnInit, OnDestroy {
@Input() signInUpdatesV1Togglz: boolean
environment = environment
$destroy: Subject<boolean> = new Subject<boolean>()
orcidUrl: string
Expand Down Expand Up @@ -97,15 +96,13 @@ export class FormAuthorizeComponent implements OnInit, OnDestroy {

ngOnInit(): void {
setTimeout(() => {
if (this.signInUpdatesV1Togglz) {
this._titleService.setTitle(
this.authorizeAccessFor +
' ' +
this.oauthRequest.clientName +
' ' +
this.orcid
)
}
this._titleService.setTitle(
this.authorizeAccessFor +
' ' +
this.oauthRequest.clientName +
' ' +
this.orcid
)
}, 1000)
}

Expand Down Expand Up @@ -174,21 +171,15 @@ export class FormAuthorizeComponent implements OnInit, OnDestroy {
}

if (scope === '/person/update') {
return !this.signInUpdatesV1Togglz
? $localize`:@@authorize.addUpdateInformation:Add/update information about you (country, keywords, etc.)`
: $localize`:@@authorize.addUpdateInformation:Add/update information about you (country, keywords, etc.)`
return $localize`:@@authorize.addUpdateInformation:Add/update information about you (country, keywords, etc.)`
}

if (scope === '/activities/update') {
return !this.signInUpdatesV1Togglz
? $localize`:@@authorize.activitiesUpdate:Add/update your research activities (works, affiliations, etc)`
: $localize`:@@authorize.addUpdateReseachActivities:Add/update your research activities (works, affiliations, etc.)`
return $localize`:@@authorize.addUpdateReseachActivities:Add/update your research activities (works, affiliations, etc.)`
}

if (scope === '/read-limited') {
return !this.signInUpdatesV1Togglz
? $localize`:@@authorize.readLimited:Read your information with visibility set to Trusted Organizations`
: $localize`:@@authorize.readInfomationVisibilityTrustedParties:Read your information with visibility set to Trusted parties`
return $localize`:@@authorize.readInfomationVisibilityTrustedParties:Read your information with visibility set to Trusted parties`
}

// For any unreconized scope just use the description from the backend
Expand Down
15 changes: 3 additions & 12 deletions src/app/authorize/pages/authorize/authorize.component.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<main id="main" *ngIf="!loading">
<main id="main">
<div class="container">
<div class="row space-around">
<div
class="col m6 s4"
[ngClass]="{
'l5': !signInUpdatesV1Togglz,
'l6': signInUpdatesV1Togglz,
}"
>
<div class="col m6 s4 l6">
<mat-card
class="orcid-wizard authorize-wrapper"
[ngClass]="{
'orcid-wizard-2': !signInUpdatesV1Togglz,
'orcid-wizard': signInUpdatesV1Togglz,
'authorize-wrapper': signInUpdatesV1Togglz,
mobile: platform.columns4
}"
>
<app-form-authorize
[signInUpdatesV1Togglz]="signInUpdatesV1Togglz"
*ngIf="showAuthorizationComponent"
></app-form-authorize>
<app-oauth-error
Expand Down
25 changes: 3 additions & 22 deletions src/app/authorize/pages/authorize/authorize.component.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import { Component, OnInit } from '@angular/core'
import { Title } from '@angular/platform-browser'
import { take } from 'rxjs/operators'
import { Component } from '@angular/core'
import { PlatformInfo, PlatformInfoService } from 'src/app/cdk/platform-info'
import { UserService } from 'src/app/core'
import { TogglzService } from 'src/app/core/togglz/togglz.service'

@Component({
templateUrl: './authorize.component.html',
styleUrls: ['./authorize.component.scss'],
preserveWhitespaces: true,
})
export class AuthorizeComponent implements OnInit {
export class AuthorizeComponent {
platform: PlatformInfo
showAuthorizationComponent: boolean
signInUpdatesV1Togglz = false
loading = true

constructor(
_user: UserService,
private _platformInfo: PlatformInfoService,
private _togglz: TogglzService
) {
constructor(_user: UserService, private _platformInfo: PlatformInfoService) {
_user.getUserSession().subscribe((session) => {
if (session.oauthSession && session.oauthSession.error) {
this.showAuthorizationComponent = false
Expand All @@ -32,14 +23,4 @@ export class AuthorizeComponent implements OnInit {
this.platform = platformInfo
})
}

ngOnInit(): void {
this._togglz
.getStateOf('SIGN_IN_UPDATES_V1')
.pipe(take(1))
.subscribe((value) => {
this.loading = false
this.signInUpdatesV1Togglz = value
})
}
}
63 changes: 22 additions & 41 deletions src/app/cdk/info-drop-down/info-drop-down.component.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,25 @@
<ng-container *ngIf="!signInUpdatesV1Togglz">
<div
class="university-dropdown orc-font-body-large"
[ngClass]="{ active: show }"
<div class="row">
<b class="orc-font-body m-b-8">
{{ name }}
</b>
</div>
<div class="row">
<a
class="underline"
[ngClass]="{ 'm-b-16': show }"
(click)="show = !show"
[attr.aria-label]="
(!show ? ariaLabelShowDetailsFor : ariaLabelHideDetailsFor) + ' ' + name
"
>
<a class="mat-body-2 black-underline-url body-2 black-url" id="app-name">
{{ name }}
</a>
<mat-icon class="large-material-icon" role="presentation">help</mat-icon>
</div>

<div class="description-container" *ngIf="show">
{{ description }}
</div>
</ng-container>

<ng-container *ngIf="signInUpdatesV1Togglz">
<div class="row">
<b class="orc-font-body m-b-8">
{{ name }}
</b>
</div>
<div class="row">
<a
class="underline"
[ngClass]="{ 'm-b-16': show }"
(click)="show = !show"
[attr.aria-label]="
(!show ? ariaLabelShowDetailsFor : ariaLabelHideDetailsFor) + ' ' + name
"
<ng-container i18n="@@shared.showDetails" *ngIf="!show"
>Show details</ng-container
>
<ng-container i18n="@@shared.showDetails" *ngIf="!show"
>Show details</ng-container
>
<ng-container i18n="@@shared.hideDetails" *ngIf="show"
>Hide details</ng-container
>
</a>
</div>
<div class="description-container description-client" *ngIf="show">
{{ description }}
</div>
</ng-container>
<ng-container i18n="@@shared.hideDetails" *ngIf="show"
>Hide details</ng-container
>
</a>
</div>
<div class="description-container description-client" *ngIf="show">
{{ description }}
</div>
1 change: 0 additions & 1 deletion src/app/cdk/info-drop-down/info-drop-down.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Component, OnInit, Input } from '@angular/core'
export class InfoDropDownComponent implements OnInit {
@Input() name
@Input() description
@Input() signInUpdatesV1Togglz: boolean
show = false

ariaLabelShowDetailsFor = $localize`:@@shared.showDetailsFor:Show details for`
Expand Down
139 changes: 57 additions & 82 deletions src/app/cdk/my-orcid-alerts/my-orcid-alerts.component.html
Original file line number Diff line number Diff line change
@@ -1,91 +1,66 @@
<ng-container *ngIf="!signInUpdatesV1Togglz">
<mat-toolbar>
<mat-toolbar-row>
<div role="alert" aria-label="polite">
<p class="mat-body-2">
<ng-container
i18n="@@myOrcidAlerts.invalidVerifyUrl"
*ngIf="invalidVerifyUrl"
>
Your email couldn't be verified, please check the link you used to
verify it.
</ng-container>
<ng-container
i18n="@@myOrcidAlerts.emailVerified"
*ngIf="emailVerified"
>
Thank you for verifying your email
</ng-container>
</p>
</div>
</mat-toolbar-row>
</mat-toolbar>
</ng-container>
<ng-container *ngIf="signInUpdatesV1Togglz">
<ng-container *ngIf="emailVerified || invalidVerifyUrl">
<div
role="alert"
aria-labelledby="dialogTitle"
aria-describedby="dialogDescription"
[ngClass]="{
verification: emailVerified,
invalid: invalidVerifyUrl
}"
>
<ng-container *ngIf="emailVerified || invalidVerifyUrl">
<div
role="alert"
aria-labelledby="dialogTitle"
aria-describedby="dialogDescription"
[ngClass]="{
verification: emailVerified,
invalid: invalidVerifyUrl
}"
>
<div>
<mat-icon class="large-material-icon material-symbols-outlined">
<ng-container *ngIf="emailVerified">check_circle</ng-container>
<ng-container *ngIf="invalidVerifyUrl">warning</ng-container>
</mat-icon>
</div>
<div class="content">
<div>
<mat-icon class="large-material-icon material-symbols-outlined">
<ng-container *ngIf="emailVerified">check_circle</ng-container>
<ng-container *ngIf="invalidVerifyUrl">warning</ng-container>
</mat-icon>
<b id="dialogTitle" i18n="@@ngOrcid.signin.almostDone">
Almost done!
</b>
</div>
<div class="content">
<div>
<b id="dialogTitle" i18n="@@ngOrcid.signin.almostDone">
Almost done!
</b>
</div>
<div id="dialogDescription">
<ng-container
i18n="@@ngOrcid.signin.signInToComplete"
*ngIf="emailVerified"
>
Sign in to complete your email verification
</ng-container>
<ng-container
i18n="@@myOrcidAlerts.invalidVerifyUrl"
*ngIf="invalidVerifyUrl"
>
Your email couldn't be verified, please check the link you used to
verify it.
</ng-container>
</div>
<div id="dialogDescription">
<ng-container
i18n="@@ngOrcid.signin.signInToComplete"
*ngIf="emailVerified"
>
Sign in to complete your email verification
</ng-container>
<ng-container
i18n="@@myOrcidAlerts.invalidVerifyUrl"
*ngIf="invalidVerifyUrl"
>
Your email couldn't be verified, please check the link you used to
verify it.
</ng-container>
</div>
</div>
</ng-container>
<ng-container *ngIf="printError && badCredentials">
<div
class="invalid"
role="dialog"
aria-live="polite"
aria-labelledby="dialogTitle"
aria-describedby="dialogDescription"
>
</div>
</ng-container>
<ng-container *ngIf="printError && badCredentials">
<div
class="invalid"
role="dialog"
aria-live="polite"
aria-labelledby="dialogTitle"
aria-describedby="dialogDescription"
>
<div>
<mat-icon class="large-material-icon material-symbols-outlined"
>warning</mat-icon
>
</div>
<div class="content">
<div>
<mat-icon class="large-material-icon material-symbols-outlined"
>warning</mat-icon
>
<b id="dialogTitle" i18n="@@ngOrcid.signin.somethingNotQuiteRight">
Something's not quite right...
</b>
</div>
<div class="content">
<div>
<b id="dialogTitle" i18n="@@ngOrcid.signin.somethingNotQuiteRight">
Something's not quite right...
</b>
</div>
<div id="dialogDescription" i18n="@@ngOrcid.signin.checkYourSignIn">
Please check that your sign in details are correct and then try
signing in again.
</div>
<div id="dialogDescription" i18n="@@ngOrcid.signin.checkYourSignIn">
Please check that your sign in details are correct and then try signing
in again.
</div>
</div>
</ng-container>
</div>
</ng-container>
1 change: 0 additions & 1 deletion src/app/cdk/my-orcid-alerts/my-orcid-alerts.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Component, Input, OnInit } from '@angular/core'
export class MyOrcidAlertsComponent implements OnInit {
@Input() emailVerified: boolean
@Input() invalidVerifyUrl: boolean
@Input() signInUpdatesV1Togglz: boolean
@Input() printError: boolean
@Input() badCredentials: boolean

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<a
*ngIf="delegators?.length || switchToMeAccount"
[ngClass]="{
'mat-button-font': !signInUpdatesV1Togglz,
underline: signInUpdatesV1Togglz
}"
class="underline"
[matMenuTriggerFor]="menu"
i18n="@@delegators.switchAccount"
[attr.aria-label]="labelSwitchAccount"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class TrustedIndividualsDropdownComponent implements OnInit {
get trustedIndividuals() {
return this._trustedIndividuals
}
@Input() signInUpdatesV1Togglz: boolean
@Output() changeUser = new EventEmitter<Delegator>()
ngOnInit(): void {}

Expand Down
Loading

0 comments on commit 7fbe21b

Please sign in to comment.