Skip to content
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
20 changes: 10 additions & 10 deletions SUPPORTED_BROWSERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

> This file is auto-generated from `.browserslistrc` during the prebuild step. Do not edit manually.

| Browser | Minimum version |
| ---------------- | --------------- |
| Android WebView | 145 or newer |
| Apple Safari | 17 or newer |
| Google Chrome | 117 or newer |
| Microsoft Edge | 117 or newer |
| Mozilla Firefox | 116 or newer |
| Opera | 103 or newer |
| Opera Mobile | 80 or newer |
| Samsung Internet | 24 or newer |
| Browser | Minimum version |
|---------|-----------------|
| Android WebView | 145 or newer |
| Apple Safari | 17 or newer |
| Google Chrome | 117 or newer |
| Microsoft Edge | 117 or newer |
| Mozilla Firefox | 116 or newer |
| Opera | 103 or newer |
| Opera Mobile | 80 or newer |
| Samsung Internet | 24 or newer |
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ <h3 class="import-works-dialog__card-title">{{ link.name }}</h3>
</div>
<div class="import-works-dialog__card-actions">
<ng-container *ngIf="link.connected; else connectCertified">
<span
<button
type="button"
class="import-works-dialog__connected"
[attr.aria-label]="getConnectedAriaLabel(link.name)"
(click)="openInNewTab(link.url)"
>
<span
class="import-works-dialog__connected-dot"
aria-hidden="true"
></span>
{{ connectedLabel }}
</span>
</button>
</ng-container>
<ng-template #connectCertified>
<button
Expand Down
47 changes: 21 additions & 26 deletions scripts/new-relic.postbuild.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,41 @@
import { readFileSync, writeFileSync } from 'fs'
import { join } from 'path'
import { createHash } from 'crypto'

// fingerprint: orcid-angular/new-relic.postbuild.ts:v1
const newRelicSourcePath = join(__dirname, 'new-relic.runtime.js')

let minifiedNewRelicJs: string | undefined
let newRelicCode: string | undefined
let newRelicContentHash: string | undefined

function getMinifiedNewRelicJs(): string {
if (minifiedNewRelicJs !== undefined) {
return minifiedNewRelicJs
function getNewRelicCode(): string {
if (newRelicCode !== undefined) {
return newRelicCode
}
const { minify_sync } = require('terser') as {
minify_sync: (
code: string,
options?: Record<string, unknown>
) => { code?: string; error?: Error }
}
const source = readFileSync(newRelicSourcePath, 'utf8')
const result = minify_sync(source, {
compress: true,
mangle: true,
format: { comments: false },
})
if (result.error) {
throw result.error
}
if (!result.code) {
throw new Error('terser returned empty code for new-relic.runtime.js')
newRelicCode = readFileSync(newRelicSourcePath, 'utf8')
return newRelicCode
}

function getNewRelicContentHash(): string {
if (newRelicContentHash !== undefined) {
return newRelicContentHash
}
minifiedNewRelicJs = result.code
return minifiedNewRelicJs
const code = getNewRelicCode()
newRelicContentHash = createHash('sha256').update(code).digest('hex').slice(0, 16)
return newRelicContentHash
}

export function newRelic(
indexHtml: string,
options: { folder: string; languageCode: string }
) {
const hash = getNewRelicContentHash()
writeFileSync(
join(options.folder, 'new-relic.runtime.js'),
getMinifiedNewRelicJs(),
join(options.folder, `new-relic.runtime.${hash}.js`),
getNewRelicCode(),
'utf8'
)
const src = `new-relic.runtime-${options.languageCode}.js`
const src = `new-relic.runtime.${hash}-${options.languageCode}.js`
return indexHtml.replace(
'<!-- NEW_RELIC_PLACEHOLDER -->',
`<script type="text/javascript" src="${src}"></script>`
Expand Down
4 changes: 0 additions & 4 deletions scripts/new-relic.runtime.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
window.NREUM || (NREUM = {})
// Cost-saving: disable session replay and session trace (high $). We still record
// all app events (addPageAction: registration journey, record expand, errors, etc.).
// autoStart: false so no data is sent until NewRelicService calls newrelic.start()
// only for users who are sampled (RUM togglz percentage).
NREUM.init = {
performance: { capture_measures: true },
browser_consent_mode: { enabled: false },
Expand Down
5 changes: 4 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { TitleService } from './core/title-service/title.service'
import { ZendeskService } from './core/zendesk/zendesk.service'
import { ERROR_REPORT } from './errors'
import { NewRelicService } from './core/new-relic/new-relic.service'
import { OneTrustAccessibilityService } from './core/onetrust/onetrust-accessibility.service'

@Component({
selector: 'app-root',
Expand Down Expand Up @@ -51,7 +52,8 @@ export class AppComponent {
private _errorHandler: ErrorHandlerService,
@Inject(WINDOW) private _window: Window,
_titleService: TitleService,
_newRelicService: NewRelicService
_newRelicService: NewRelicService,
_oneTrustAccessibilityService: OneTrustAccessibilityService
) {
_titleService.init()
_platformInfo
Expand Down Expand Up @@ -84,6 +86,7 @@ export class AppComponent {
.subscribe()

_newRelicService.init()
_oneTrustAccessibilityService.init()

_router.events.subscribe((event) => {
if (event instanceof NavigationStart) {
Expand Down
5 changes: 3 additions & 2 deletions src/app/core/announcer/announcer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class AnnouncerService {
thereAreLabel = $localize`:@@shared.thereAre:There are`
onEachPageLabel = $localize`:@@shared.onEachPage:on each page`
showingLabel = $localize`:@@shared.showing:Showing`
oneTrustFocusAnnouncement = $localize`:@@layout.oneTrustFocusAnnouncement:Cookie settings dialog opened. Focus moved to this dialog. Please review the options and make a choice to continue.`
lastAnnouncement: string

liveAnnouncePagination(paginatorLabel: PageEvent, itemType: string) {
Expand Down Expand Up @@ -48,11 +49,11 @@ export class AnnouncerService {

if (this.lastAnnouncement !== announcement) {
this.lastAnnouncement = announcement
this.announce(announcement)
this.liveAnnounce(announcement)
}
}

private announce(announcement: string) {
liveAnnounce(announcement: string) {
if (runtimeEnvironment.debugger) {
console.debug('📢' + announcement)
}
Expand Down
Loading
Loading