diff --git a/src/app/authorize/components/form-authorize/form-authorize.component.scss-theme.scss b/src/app/authorize/components/form-authorize/form-authorize.component.scss-theme.scss index 4480c2877..70fc3b3c8 100644 --- a/src/app/authorize/components/form-authorize/form-authorize.component.scss-theme.scss +++ b/src/app/authorize/components/form-authorize/form-authorize.component.scss-theme.scss @@ -8,7 +8,7 @@ $foreground: map-get($theme, foreground); $background: map-get($theme, background); - .authorize-button { + .authorize-button { color: $orcid-light-primary-text; background: mat.get-color-from-palette($primary, 700); } diff --git a/src/app/authorize/pages/authorize/authorize.component.ts b/src/app/authorize/pages/authorize/authorize.component.ts index c127b6a0a..3cc104ae5 100644 --- a/src/app/authorize/pages/authorize/authorize.component.ts +++ b/src/app/authorize/pages/authorize/authorize.component.ts @@ -27,6 +27,7 @@ export class AuthorizeComponent { organizationName: string domainInterstitialHasBeenViewed: boolean userIsNotImpersonating: boolean + insidePopUpWindows: boolean constructor( _user: UserService, @@ -50,6 +51,7 @@ export class AuthorizeComponent { } ngOnInit() { + this.insidePopUpWindows = this.window.opener !== null this._userInfo.getUserSession().subscribe((userInfo) => { this.userIsNotImpersonating = userInfo.userInfo.REAL_USER_ORCID === @@ -85,13 +87,13 @@ export class AuthorizeComponent { handleRedirect(url: string) { this.redirectUrl = url - if ( url && this.userHasPrivateDomains && this.oauthDomainsInterstitialEnabled && !this.domainInterstitialHasBeenViewed && - this.userIsNotImpersonating + this.userIsNotImpersonating && + !this.insidePopUpWindows ) { this.showAuthorizationComponent = false this.showInterstital = true diff --git a/src/app/cdk/interstitials/interstitials.module.ts b/src/app/cdk/interstitials/interstitials.module.ts index 72dc6cf73..969ef55ae 100644 --- a/src/app/cdk/interstitials/interstitials.module.ts +++ b/src/app/cdk/interstitials/interstitials.module.ts @@ -11,6 +11,7 @@ import { MatCheckboxModule } from '@angular/material/checkbox' import { MatLegacyCheckboxModule } from '@angular/material/legacy-checkbox' import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button' import { InfoPanelModule } from '../info-panel/info-panel.module' +import { A11yLinkModule } from '../a11y-link/a11y-link.module' @NgModule({ declarations: [ShareEmailsDomainsComponent], @@ -26,6 +27,7 @@ import { InfoPanelModule } from '../info-panel/info-panel.module' MatLegacyCheckboxModule, MatButtonModule, InfoPanelModule, + A11yLinkModule, ], exports: [ShareEmailsDomainsComponent], }) diff --git a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.html b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.html index 6e4f8d4a7..9899b566c 100644 --- a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.html +++ b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.html @@ -65,6 +65,7 @@ i18n="@@interstitial.makeSelectedDomainsPublic" (click)="accept(true)" id="authorize-button" + [disabled]="!domainToMakePublic.length" > Make selected domains public diff --git a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.scss-theme.scss b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.scss-theme.scss index d6828643e..29118ca77 100644 --- a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.scss-theme.scss +++ b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.scss-theme.scss @@ -8,7 +8,7 @@ $foreground: map-get($theme, foreground); $background: map-get($theme, background); - .mat-raised-button.mat-primary { + .mat-raised-button.mat-primary:not(.mat-raised-button.mat-primary) { background-color: mat.get-color-from-palette($primary, 700); } diff --git a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts index 5f8245ec1..37394b38c 100644 --- a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts +++ b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts @@ -20,7 +20,6 @@ export class ShareEmailsDomainsComponent { @Input() userEmailsJson: EmailsEndpoint @Input() organizationName: string form: any - domainToMakePublic: string[] constructor( public platformInfo: PlatformInfoService, private fb: FormBuilder, @@ -58,11 +57,15 @@ export class ShareEmailsDomainsComponent { }) } - accept(answear: boolean) { - this.domainToMakePublic = this.form.value.items - .filter((item) => item.selected) - .map((item) => item.email) + get domainToMakePublic(): string[] { + return ( + this.form?.value?.items + ?.filter((item: any) => item.selected) + .map((item: any) => item.email) || [] + ) + } + accept(answear: boolean) { if (answear && this.domainToMakePublic.length > 0) { this.userEmailsJson.emailDomains.forEach((domain) => { if (this.domainToMakePublic.includes(domain.value)) {