-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.23.0' of https://github.com/dpc-sdp/ripple-fr…
…amework into feature/SD-403-decoupled-map-search-stretch-image # Conflicts: # packages/ripple-tide-search/components/global/TideSearchAddressLookup.vue
- Loading branch information
Showing
57 changed files
with
2,586 additions
and
1,744 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-37.6 KB
(77%)
...test/features/maps/__image_snapshots__/map-initial-location-results-hook #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "2.21.0", | ||
"version": "2.22.0", | ||
"npmClient": "pnpm", | ||
"exact": true, | ||
"command": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/nuxt-ripple-analytics/composables/useNewRelicBrowserAgent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { IRplFeatureFlags } from '@dpc-sdp/ripple-tide-api/types' | ||
|
||
export default () => { | ||
const config = useRuntimeConfig() | ||
const browserAgentConfig = config?.public?.newRelic?.browser | ||
|
||
if (!browserAgentConfig.enabled) { | ||
return | ||
} | ||
|
||
const featureFlags: IRplFeatureFlags = inject('featureFlags', { | ||
newRelicBrowserBeacon: 'bam.nr-data.net', | ||
newRelicBrowserJSErrorsEnabled: true, | ||
newRelicBrowserCookiesEnabled: false, | ||
newRelicBrowserDistributedTracingEnabled: false, | ||
newRelicBrowserAjaxDenyList: ['bam.nr-data.net'] | ||
}) | ||
|
||
// Scripts from new relic need to be dynamically imported, otherwise they will throw an error | ||
const initBrowserAgent = async () => { | ||
// Error module has to be manually added when using new relic via npm | ||
const { JSErrors } = await import( | ||
'@newrelic/browser-agent/features/jserrors' | ||
) | ||
|
||
const options = { | ||
info: { | ||
beacon: featureFlags.newRelicBrowserBeacon, | ||
licenseKey: browserAgentConfig.licenseKey, | ||
applicationID: browserAgentConfig.applicationID, | ||
sa: 1 // 'sa' stands for 'standalone' https://github.com/newrelic/newrelic-browser-agent/blob/bbf414c0d6a483141f32e2dd31b1f8a23ad1dda5/src/features/logging/aggregate/index.js#L100 | ||
}, | ||
init: { | ||
distributed_tracing: { | ||
enabled: featureFlags.newRelicBrowserDistributedTracingEnabled | ||
}, | ||
privacy: { | ||
cookies_enabled: featureFlags.newRelicBrowserCookiesEnabled | ||
}, | ||
jserrors: { enabled: featureFlags.newRelicBrowserJSErrorsEnabled }, | ||
ajax: { deny_list: featureFlags.newRelicBrowserAjaxDenyList } | ||
}, | ||
loader_config: { | ||
accountID: browserAgentConfig.accountID, | ||
trustKey: browserAgentConfig.trustKey, | ||
agentID: browserAgentConfig.agentID, | ||
licenseKey: browserAgentConfig.licenseKey, | ||
applicationID: browserAgentConfig.applicationID | ||
}, | ||
features: [JSErrors] | ||
} | ||
|
||
const { BrowserAgent } = await import( | ||
'@newrelic/browser-agent/loaders/browser-agent' | ||
) | ||
|
||
new BrowserAgent(options) | ||
} | ||
|
||
if (process.client) { | ||
initBrowserAgent() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { defineNuxtPlugin } from '#app' | ||
import trackError from '../utils/trackError' | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
/* @ts-ignore process is extended by webpack */ | ||
if (process.client) { | ||
nuxtApp.vueApp.use({ | ||
install(app: any) { | ||
useNewRelicBrowserAgent() | ||
|
||
const existingErrorHandler = app.config.errorHandler | ||
|
||
// Catch all vue errors | ||
app.config.errorHandler = (error: Error) => { | ||
console.error(error) | ||
trackError(error) | ||
|
||
// Allow multiple error handlers to run | ||
if ( | ||
existingErrorHandler && | ||
typeof existingErrorHandler === 'function' | ||
) { | ||
existingErrorHandler(error) | ||
} | ||
} | ||
} | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
declare global { | ||
interface Window { | ||
newrelic?: { | ||
noticeError: (error: any) => void | ||
} | ||
} | ||
} | ||
|
||
const trackError = (error: any) => { | ||
if (window?.newrelic?.noticeError) { | ||
window.newrelic.noticeError(error) | ||
} | ||
} | ||
|
||
export default trackError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.