Rename again to match module name
Signed-off-by: Jonathan Mezach <jonathan.mezach@rr-wfm.com>
This commit is contained in:
+31
-2
@@ -107,7 +107,36 @@ export class NewRelicBrowser implements AnalyticsApi {
|
||||
}
|
||||
|
||||
captureEvent(event: AnalyticsEvent) {
|
||||
const { action, ...rest } = event;
|
||||
this.agent.addPageAction(action, rest);
|
||||
const { context, action, subject, value, attributes } = event;
|
||||
if (action === 'navigate' && context.extension === 'App') {
|
||||
const interaction = this.agent.interaction();
|
||||
interaction.setName(subject);
|
||||
Object.keys(context).forEach(key => {
|
||||
if (context[key]) {
|
||||
interaction.setAttribute(`context.${key}`, context[key]);
|
||||
}
|
||||
});
|
||||
if (attributes) {
|
||||
Object.keys(attributes).forEach(key => {
|
||||
interaction.setAttribute(`attributes.${key}`, attributes[key]);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const customAttributes: {
|
||||
[x: string]: string | number | boolean | undefined;
|
||||
} = {};
|
||||
Object.keys(context).forEach(key => {
|
||||
if (context[key]) {
|
||||
customAttributes[`context.${key}`] = context[key];
|
||||
}
|
||||
});
|
||||
if (attributes) {
|
||||
Object.keys(attributes).forEach(key => {
|
||||
customAttributes[`attributes.${key}`] = attributes[key];
|
||||
});
|
||||
}
|
||||
|
||||
this.agent.addPageAction(action, customAttributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4794,9 +4794,9 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@backstage/plugin-analytics-module-newrelic-browser@workspace:plugins/analytics-module-new-relic":
|
||||
"@backstage/plugin-analytics-module-newrelic-browser@workspace:plugins/analytics-module-newrelic-browser":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@backstage/plugin-analytics-module-newrelic-browser@workspace:plugins/analytics-module-new-relic"
|
||||
resolution: "@backstage/plugin-analytics-module-newrelic-browser@workspace:plugins/analytics-module-newrelic-browser"
|
||||
dependencies:
|
||||
"@backstage/cli": "workspace:^"
|
||||
"@backstage/config": "workspace:^"
|
||||
|
||||
Reference in New Issue
Block a user