Skip to content

Commit 613f570

Browse files
authored
Merge pull request #119 from newrelic/fix/error_opening_page_details
fix: Error opening page details
2 parents f1b6d61 + e9dd419 commit 613f570

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [1.7.1](https://github.com/newrelic/nr1-browser-analyzer/compare/v1.7.0...v1.7.1) (2025-03-24)
2+
3+
4+
### Bug Fixes
5+
6+
* GraphQL response format ( [76135c1](https://github.com/newrelic/nr1-browser-analyzer/commit/76135c1e32461234056fbe9fd3442da80985aac8))
7+
18
# [1.7.0](https://github.com/newrelic/nr1-browser-analyzer/compare/v1.6.2...v1.7.0) (2024-02-16)
29

310

nerdlets/shared/components/stat-utils.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function buildSatisfied(cohorts, satisfied, bounceRate) {
4646
obj.raw = {};
4747
const SbounceRate = !bounceRate
4848
? null
49-
: bounceRate.results.find((r) => r.facet === 'S');
49+
: bounceRate.rawResponse.facets.find((r) => r.name === 'S');
5050
const S =
5151
cohorts && cohorts.results
5252
? cohorts.results.find((c) => c.facet === 'S')
@@ -60,7 +60,7 @@ function buildTolerated(cohorts, tolerated, bounceRate) {
6060
obj.raw = {};
6161
const TbounceRate = !bounceRate
6262
? null
63-
: bounceRate.results.find((r) => r.facet === 'T');
63+
: bounceRate.rawResponse.facets.find((r) => r.name === 'T');
6464
const T =
6565
cohorts && cohorts.results
6666
? cohorts.results.find((c) => c.facet === 'T')
@@ -74,7 +74,7 @@ function buildFrustrated(cohorts, frustrated, bounceRate) {
7474
obj.raw = {};
7575
const FbounceRate = !bounceRate
7676
? null
77-
: bounceRate.results.find((r) => r.facet === 'F');
77+
: bounceRate.rawResponse.facets.find((r) => r.name === 'F');
7878
const F =
7979
cohorts && cohorts.results
8080
? cohorts.results.find((c) => c.facet === 'F')
@@ -102,11 +102,15 @@ function fillObject(obj, sample, cohort, bounceCohort) {
102102
obj.bounces = calcBounces(sample.results);
103103
}
104104

105-
if (bounceCohort) {
106-
obj.raw.bounceCohort = { ...bounceCohort };
107-
obj.bounces = bounceCohort.steps[0] - bounceCohort.steps[1];
108-
obj.totalSamples = bounceCohort.steps[0];
105+
if (bounceCohort && bounceCohort.results && bounceCohort.results.length > 0) {
106+
bounceCohort = bounceCohort.results[0];
107+
if (bounceCohort.steps) {
108+
obj.raw.bounceCohort = { ...bounceCohort };
109+
obj.bounces = bounceCohort.steps[0] - bounceCohort.steps[1];
110+
obj.totalSamples = bounceCohort.steps[0];
111+
}
109112
}
113+
110114
return obj;
111115
}
112116

nerdlets/shared/nrql-factory/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ class SPAFactory extends NrqlFactory {
301301
targetUrl ? `WHERE targetUrl != '${targetUrl}'` : ''
302302
} as 'nextPage') ${facetCaseStmt}") {
303303
results
304+
rawResponse
304305
}`
305306
: ''
306307
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "nr1-browser-analyzer",
44
"description": "NR1 Nerdpack business value analysis of Browser data.",
5-
"version": "1.7.0",
5+
"version": "1.7.1",
66
"bugs": {
77
"email": "opensource+nr1-browser-analyzer@newrelic.com"
88
},

0 commit comments

Comments
 (0)