Skip to content

Commit

Permalink
Merge branch 'main' into add-api-t&c-notice-panel-to-dev-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn authored Nov 15, 2024
2 parents 94a0770 + 4269708 commit 68e59cc
Show file tree
Hide file tree
Showing 17 changed files with 375 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/bld_test_rel_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
required: false
default: "default"
type: string
rel_tag:
description: Whether to tag the code
type: boolean
required: false
default: true

workflow_dispatch:
inputs:
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
- uses: actions/cache@v3
with:
path: ~/.cache
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
# lockdown all 3rd party repos to git shas
#- uses: cloudposse/github-action-pre-commit@32acf3179b9eda817c0f549e8057477d320827db
# migrate to standard pre-commit
- uses: pre-commit/action@5f528da5c95691c4cf42ff76a4d10854b62cbb82
- uses: pre-commit/action@576ff52938d158a24ac7e009dfa94b1455e7df99
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
## v2.107.12 - 2024-11-15

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.107.11...v2.107.12)

## v2.107.11 - 2024-11-13

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.107.10...v2.107.11)

## v2.107.10 - 2024-11-13

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.107.9...v2.107.10)

- [#2396](https://github.com/ORCID/orcid-angular/pull/2396): 9497 resolve the issues integrators are having when embedding summaries into iframes
- [#2393](https://github.com/ORCID/orcid-angular/pull/2393): Bump rollup from 3.29.4 to 3.29.5
- [#2395](https://github.com/ORCID/orcid-angular/pull/2395): scroll to top on email interstitial
- [#2394](https://github.com/ORCID/orcid-angular/pull/2394): convert to matrix format and bump all action versions for node version

### Fix

- bump linting action versions

## 2.108.0 - 2024-11-13

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.107.9...2.108.0)

- [#2395](https://github.com/ORCID/orcid-angular/pull/2395): scroll to top on email interstitial
- [#2394](https://github.com/ORCID/orcid-angular/pull/2394): convert to matrix format and bump all action versions for node version

### Fix

- bump linting action versions

## 2.107.10 - 2024-11-12

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.107.9...2.107.10)

- [#2395](https://github.com/ORCID/orcid-angular/pull/2395): scroll to top on email interstitial
- [#2394](https://github.com/ORCID/orcid-angular/pull/2394): convert to matrix format and bump all action versions for node version

## v2.107.9 - 2024-11-12

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.107.8...v2.107.9)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { ShareEmailsDomainsComponent } from './share-emails-domains.component'
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'
import { RecordEmailsService } from 'src/app/core/record-emails/record-emails.service'
import { PlatformInfoService } from '../../platform-info'
import { WINDOW_PROVIDERS } from '../../window'
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'

describe('ShareEmailsDomainsComponent', () => {
let component: ShareEmailsDomainsComponent
Expand All @@ -28,7 +30,9 @@ describe('ShareEmailsDomainsComponent', () => {
provide: RecordEmailsService,
useValue: {},
},
WINDOW_PROVIDERS,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
fixture = TestBed.createComponent(ShareEmailsDomainsComponent)
component = fixture.componentInstance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, EventEmitter, Input, Output } from '@angular/core'
import { Component, EventEmitter, Inject, Input, Output } from '@angular/core'
import { PlatformInfoService } from '../../platform-info'
import { AssertionVisibilityString, EmailsEndpoint } from 'src/app/types'
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'
import { RecordEmailsService } from 'src/app/core/record-emails/record-emails.service'
import { error } from 'console'
import { WINDOW } from '../../window'

@Component({
selector: 'app-share-emails-domains',
Expand All @@ -23,12 +24,14 @@ export class ShareEmailsDomainsComponent {
constructor(
public platformInfo: PlatformInfoService,
private fb: FormBuilder,
private recordEmailsService: RecordEmailsService
private recordEmailsService: RecordEmailsService,
@Inject(WINDOW) private window: Window
) {}
public loadingEmails = true
@Output() finish = new EventEmitter<void>()

ngOnInit() {
this.window.scrollTo(0, 0)
this.userPrivateDomains = this.getTop3MostRecentPrivateDomains(
this.userEmailsJson
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
width: 100%;
display: flex;
justify-content: center;
height: 100vh;
}

main.stand-alone-mode {
Expand All @@ -17,6 +16,7 @@ main.inside-iframe {
align-content: start;
grid-gap: 0;
box-sizing: border-box;
height: 100vh;

.panel-body {
padding-top: 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,25 @@ <h2 class="orc-font-body-large" i18n="@@developerTools.additionalResources">
</ng-container>
</p>

<app-alert-message *ngIf="!hasVerifiedEmailAddress">
<strong class="orc-font-body" i18n="@@developerTools.noVerifiedEmailAddresses"
>No verified email addresses found</strong
>

<p class="orc-font-body-small">
<ng-container i18n="@@developerTools.youMustHaveAtLeastOneVerifiedEmail"
>You must have at least one verified email address in your ORCID account
to register for your Public API credentials. Manage your email addresses
in the</ng-container
>
<a
(click)="openEmailModal()"
i18n="@@developerTools.emailsAndDomainsSection"
>Emails and domains section of your ORCID record</a
>.
</p>
</app-alert-message>

<div class="info" *ngIf="!checked && dirty">
<div class="col">
<mat-icon class="large-material-icon outline">warning</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ h2 {
.mat-button-wrap-text {
margin-bottom: 32px;
}

app-alert-message {
line-height: 21px;
margin-top: 16px;
a {
text-decoration: underline;
}
p {
margin-bottom: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { RecordService } from 'src/app/core/record/record.service'
import { of } from 'rxjs'

import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'
import { MatLegacyDialog } from '@angular/material/legacy-dialog'
import { useAnimation } from '@angular/animations'

describe('TermsOfUseComponent', () => {
let component: TermsOfUseComponent
Expand All @@ -19,6 +21,7 @@ describe('TermsOfUseComponent', () => {
{ provide: DeveloperToolsService, useValue: {} },
{ provide: PlatformInfoService, useValue: {} },
{ provide: RecordService, useValue: { getRecord: () => of() } },
{ provide: MatLegacyDialog, useValue: {} },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import {
ViewChild,
} from '@angular/core'
import { MatLegacyCheckbox as MatCheckbox } from '@angular/material/legacy-checkbox'
import { MatLegacyDialog } from '@angular/material/legacy-dialog'
import { Subject } from 'rxjs'
import { takeUntil } from 'rxjs/operators'
import { PlatformInfoService } from 'src/app/cdk/platform-info'
import { ModalEmailComponent } from 'src/app/cdk/side-bar/modals/modal-email/modal-email.component'
import { DeveloperToolsService } from 'src/app/core/developer-tools/developer-tools.service'
import { RecordService } from 'src/app/core/record/record.service'

Expand All @@ -31,10 +33,12 @@ export class TermsOfUseComponent implements OnInit, OnDestroy {
@Output() developerToolsEnable = new EventEmitter<boolean>()
$destroy = new Subject<boolean>()
emailAlreadyVerified: boolean
hasVerifiedEmailAddress: boolean

constructor(
private developerToolsService: DeveloperToolsService,
private _record: RecordService,
private _dialog: MatLegacyDialog,
private _changeDetectorRef: ChangeDetectorRef
) {}
ngOnDestroy(): void {
Expand All @@ -50,13 +54,27 @@ export class TermsOfUseComponent implements OnInit, OnDestroy {
const primaryEmail = userRecord?.emails?.emails?.filter(
(email) => email.primary
)[0]
this.hasVerifiedEmailAddress = userRecord.emails.emails.some(
(email) => email.verified
)
if (primaryEmail?.verified) {
this.emailAlreadyVerified = true
this._changeDetectorRef.detectChanges()
}
})
}

openEmailModal() {
return this._dialog
.open(ModalEmailComponent, {
width: '850px',
maxWidth: '99%',
// data: this.userRecord,
// ariaLabel: getAriaLabel(this.editModalComponent, this.type),
})
.afterClosed()
}

registerForPublicApi() {
this.dirty = true
if (!this.checked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ export class EnvironmentBannerComponent implements OnInit {
canDismiss = environment['CAN_DISABLE_TEST_WARNING_BANNER']
@HostBinding('style.display') display = 'none'
labelWarning = $localize`:@@environmentBanner.ariaLabelWarning:Warning, testing website`
notInsideIframe: boolean
constructor(
@Inject(WINDOW) private window: Window,
private _cookieService: CookieService
) {
this.notInsideIframe = window.self === window.top
this.hostUrl = window.location.host
if (!this._cookieService.get('testWarningCookie') || !this.canDismiss) {
if (
(!this._cookieService.get('testWarningCookie') || !this.canDismiss) &&
this.notInsideIframe
) {
this.display = 'auto'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ developerTools.publicClientApplicationsAreGranted2=If you need access to an ORCI
developerTools.memberApi=Member API
developerTools.mayBeMoreAppropriate=is available to ORCID member organizations.
developerTools.byRegisteringForPublicApi=By “non-commercial” we mean that you may not charge any re-use fees for the Public API, and you may not make use of the Public API in connection with any revenue-generating product or service.
developerTools.noVerifiedEmailAddresses=No verified email addresses found
developerTools.youMustHaveAtLeastOneVerifiedEmail=You must have at least one verified email address in your ORCID account to register for your Public API credentials. Manage your email addresses in the
developerTools.emailsAndDomainsSection=Emails and domains section of your ORCID record
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ developerTools.publicClientApplicationsAreGranted2=LR
developerTools.memberApi=LR
developerTools.mayBeMoreAppropriate=LR
developerTools.byRegisteringForPublicApi=LR
developerTools.noVerifiedEmailAddresses=LR
developerTools.youMustHaveAtLeastOneVerifiedEmail=LR
developerTools.emailsAndDomainsSection=LR
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ developerTools.publicClientApplicationsAreGranted2=RL
developerTools.memberApi=RL
developerTools.mayBeMoreAppropriate=RL
developerTools.byRegisteringForPublicApi=RL
developerTools.noVerifiedEmailAddresses=RL
developerTools.youMustHaveAtLeastOneVerifiedEmail=RL
developerTools.emailsAndDomainsSection=RL
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ developerTools.publicClientApplicationsAreGranted2=X
developerTools.memberApi=X
developerTools.mayBeMoreAppropriate=X
developerTools.byRegisteringForPublicApi=X
developerTools.noVerifiedEmailAddresses=X
developerTools.youMustHaveAtLeastOneVerifiedEmail=X
developerTools.emailsAndDomainsSection=X
Loading

0 comments on commit 68e59cc

Please sign in to comment.