Skip to content

Commit ad0aa3a

Browse files
authored
Merge pull request #423 from PagerDuty/release/0.12.2-beta.0
2 parents 2896b5e + f497042 commit ad0aa3a

File tree

7 files changed

+43
-28
lines changed

7 files changed

+43
-28
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pd-live-react",
33
"homepage": "https://pagerduty.github.io/pd-live-react",
4-
"version": "0.12.1-beta.0",
4+
"version": "0.12.2-beta.0",
55
"private": true,
66
"dependencies": {
77
"@chakra-ui/icons": "^2.1.1",
@@ -56,7 +56,7 @@
5656
"styled-components": "^6.0.4",
5757
"use-debounce": "^9.0.3",
5858
"validator": "^13.11.0",
59-
"web-vitals": "^3.4.0"
59+
"web-vitals": "^3.5.2"
6060
},
6161
"scripts": {
6262
"start": "vite",
@@ -110,7 +110,7 @@
110110
"@welldone-software/why-did-you-render": "^7.0.1",
111111
"babel-jest": "^29.6.3",
112112
"cypress": "^13.5.1",
113-
"cypress-fail-fast": "^7.0.3",
113+
"cypress-fail-fast": "^7.1.0",
114114
"cypress-real-events": "^1.11.0",
115115
"dotenv": "^16.4.4",
116116
"eslint": "^8.43.0",

src/config/column-generator.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,11 @@ export const customAlertColumnForSavedColumn = (savedColumn) => {
773773
return null;
774774
}
775775
const accessor = (incident) => {
776-
const path = `alerts[*].body.cef_details.${accessorPath}`;
776+
// custom details are in both body.cef_details.details and body.details for events
777+
// but only body.details is guaranteed to exist, and won't be null
778+
// body.cef_details.details can be null if the alert is from an email
779+
// const path = `alerts[*].body.cef_details.${accessorPath}`;
780+
const path = `alerts[*].body.${accessorPath}`;
777781
let result = null;
778782
try {
779783
result = JSONPath({

src/config/version.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/mocks/incidents.test.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ const generateMockAlert = () => {
2222
const message = faker.commerce.productDescription();
2323
const uuid = faker.string.uuid();
2424
const link = faker.internet.url();
25+
const customDetails = {
26+
quote,
27+
'some obsecure field': uuid,
28+
link,
29+
object_details: {
30+
key1: 'value1',
31+
},
32+
};
2533
return {
2634
type: 'alert',
2735
id: alertId,
@@ -30,18 +38,15 @@ const generateMockAlert = () => {
3038
created_at: createdAt,
3139
body: {
3240
contexts: [],
41+
// custom details are in both body.cef_details.details and body.details for events
42+
// but only body.details is guaranteed to exist, and won't be null
43+
// body.cef_details.details can be null if the alert is from an email
44+
details: customDetails,
3345
cef_details: {
3446
contexts: [],
3547
dedup_key: alertId,
3648
description: title,
37-
details: {
38-
quote,
39-
'some obsecure field': uuid,
40-
link,
41-
object_details: {
42-
key1: 'value1',
43-
},
44-
},
49+
details: customDetails,
4550
event_class: jobType,
4651
message,
4752
mutations: [

src/redux/incidents/sagas.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,10 @@ export function* filterIncidentsImpl() {
498498
// Handle case when '[*]' accessors are used
499499
const strippedAccessor = col.accessorPath.replace(/([[*\]])/g, '.');
500500
return (
501-
`alerts.body.cef_details.${strippedAccessor}`
501+
// custom details are in both body.cef_details.details and body.details for events
502+
// but only body.details is guaranteed to exist, and won't be null
503+
// body.cef_details.details can be null if the alert is from an email
504+
`alerts.body.${strippedAccessor}`
502505
.split('.')
503506
// Handle case when special character is wrapped in quotation marks
504507
.map((a) => (a.includes("'") ? a.replaceAll("'", '') : a))
@@ -523,8 +526,11 @@ export function* filterIncidentsImpl() {
523526
const incidentAlertsForSearch = incidentAlerts[incident.id] instanceof Array ? incidentAlerts[incident.id] : [];
524527
const incidentAlertsForSearchWithFlattedCustomDetails = incidentAlertsForSearch.map(
525528
(alert) => {
526-
const flattedCustomDetails = alert.body?.cef_details
527-
? Object.values(flattenObject(alert.body.cef_details)).join(' ')
529+
// custom details are in both body.cef_details.details and body.details for events
530+
// but only body.details is guaranteed to exist, and won't be null
531+
// body.cef_details.details can be null if the alert is from an email
532+
const flattedCustomDetails = alert.body?.details
533+
? Object.values(flattenObject(alert.body.details)).join(' ')
528534
: '';
529535
return {
530536
...alert,

src/redux/incidents/sagas.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ describe('Sagas: Incidents', () => {
154154
it('filterIncidents: Search by Alert Custom Detail Field', () => {
155155
const mockIncident = mockIncidents[0];
156156
const customField = 'some obsecure field';
157-
const customFieldValue = mockIncident.alerts[0].body.cef_details.details[customField];
157+
const customFieldValue = mockIncident.alerts[0].body.details[customField];
158158
const expectedIncidentResult = [mockIncident];
159159
return expectSaga(filterIncidents)
160160
.withReducer(incidents)

yarn.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5278,10 +5278,10 @@ csstype@^3.0.11, csstype@^3.0.2, csstype@^3.1.2:
52785278
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b"
52795279
integrity sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==
52805280

5281-
cypress-fail-fast@^7.0.3:
5282-
version "7.0.3"
5283-
resolved "https://registry.yarnpkg.com/cypress-fail-fast/-/cypress-fail-fast-7.0.3.tgz#85ac2861c155611939f0bad03a09e561891f9ddf"
5284-
integrity sha512-IYVDZ+ykfTd2DFBK3N6NnWXc2gix7VwSi9Vg4zv40jm6PLknZTD4cZoRmh7uvpoQAIKNIFbx5V81qQD5pLHLSQ==
5281+
cypress-fail-fast@^7.1.0:
5282+
version "7.1.0"
5283+
resolved "https://registry.yarnpkg.com/cypress-fail-fast/-/cypress-fail-fast-7.1.0.tgz#36e28e39fffaacf852b4866c8459e5274eb8326d"
5284+
integrity sha512-OnN5WqSP49yHKoitq+FmMG/+nUvat6NdFLNUQgVJYbmDdgyiiS1aI33S8+AuRb4zRZR5+5/eq53p/oL+a/m2Tw==
52855285
dependencies:
52865286
chalk "4.1.2"
52875287

@@ -6614,9 +6614,9 @@ focus-lock@^0.11.6:
66146614
tslib "^2.0.3"
66156615

66166616
follow-redirects@^1.15.4:
6617-
version "1.15.5"
6618-
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020"
6619-
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
6617+
version "1.15.6"
6618+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
6619+
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
66206620

66216621
font-awesome@^4.7.0:
66226622
version "4.7.0"
@@ -10961,10 +10961,10 @@ warning@^4.0.0, warning@^4.0.2, warning@^4.0.3:
1096110961
dependencies:
1096210962
loose-envify "^1.0.0"
1096310963

10964-
web-vitals@^3.4.0:
10965-
version "3.4.0"
10966-
resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-3.4.0.tgz#45ed33a3a2e029dc38d36547eb5d71d1c7e2552d"
10967-
integrity sha512-n9fZ5/bG1oeDkyxLWyep0eahrNcPDF6bFqoyispt7xkW0xhDzpUBTgyDKqWDi1twT0MgH4HvvqzpUyh0ZxZV4A==
10964+
web-vitals@^3.5.2:
10965+
version "3.5.2"
10966+
resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-3.5.2.tgz#5bb58461bbc173c3f00c2ddff8bfe6e680999ca9"
10967+
integrity sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg==
1096810968

1096910969
webidl-conversions@^3.0.0:
1097010970
version "3.0.1"

0 commit comments

Comments
 (0)