@pagerduty/backstage-plugin 0.9.4-next.4 → 0.9.4-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/{index-5db6e0a5.esm.js → index-02ffa0de.esm.js} +4 -4
- package/dist/esm/{index-5db6e0a5.esm.js.map → index-02ffa0de.esm.js.map} +1 -1
- package/dist/esm/{index-d288bb3d.esm.js → index-76653f8d.esm.js} +188 -93
- package/dist/esm/index-76653f8d.esm.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.esm.js +3 -3
- package/package.json +5 -4
- package/dist/esm/index-d288bb3d.esm.js.map +0 -1
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { P as PagerDutyCard } from './index-
|
|
2
|
+
import { P as PagerDutyCard } from './index-76653f8d.esm.js';
|
|
3
3
|
import '@backstage/core-plugin-api';
|
|
4
4
|
import '@backstage/errors';
|
|
5
5
|
import '@backstage/plugin-home-react';
|
|
6
6
|
import '@backstage/plugin-catalog-react';
|
|
7
7
|
import '@material-ui/core';
|
|
8
|
-
import '@material-ui/icons/Done';
|
|
9
|
-
import '@material-ui/icons/Warning';
|
|
10
8
|
import 'luxon';
|
|
11
9
|
import '@material-ui/icons/OpenInBrowser';
|
|
12
10
|
import '@backstage/core-components';
|
|
@@ -18,15 +16,17 @@ import '@material-ui/core/Avatar';
|
|
|
18
16
|
import '@material-ui/icons/Notifications';
|
|
19
17
|
import '@material-ui/icons/MailOutline';
|
|
20
18
|
import 'react-use/lib/useAsync';
|
|
19
|
+
import '@material-ui/icons/Link';
|
|
21
20
|
import '../assets/PD-Green.svg';
|
|
22
21
|
import '../assets/PD-White.svg';
|
|
23
22
|
import '@backstage/catalog-model';
|
|
24
23
|
import '@material-ui/icons/AddAlert';
|
|
25
24
|
import '@material-ui/core/styles';
|
|
25
|
+
import 'validate-color';
|
|
26
26
|
|
|
27
27
|
const Content = (props) => {
|
|
28
28
|
return /* @__PURE__ */ React.createElement(PagerDutyCard, { ...props });
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export { Content };
|
|
32
|
-
//# sourceMappingURL=index-
|
|
32
|
+
//# sourceMappingURL=index-02ffa0de.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-02ffa0de.esm.js","sources":["../../src/components/HomePagePagerDutyCard/Content.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\n\nimport { PagerDutyEntity } from '../../types';\nimport { PagerDutyCard } from '../PagerDutyCard';\n\n/** @public */\nexport type HomePagePagerDutyCardProps = PagerDutyEntity & {\n readOnly?: boolean;\n};\n\n/** @public */\nexport const Content = (props: HomePagePagerDutyCardProps) => {\n return <PagerDutyCard {...props} />;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2Ba,MAAA,OAAA,GAAU,CAAC,KAAsC,KAAA;AAC5D,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAe,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACnC;;;;"}
|
|
@@ -4,8 +4,6 @@ import { createCardExtension } from '@backstage/plugin-home-react';
|
|
|
4
4
|
import React, { useEffect, useState, useCallback } from 'react';
|
|
5
5
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
6
6
|
import { makeStyles, ListItem, ListItemText, Chip, Typography, ListItemSecondaryAction, Tooltip, IconButton, Grid, List, ListItemIcon, ListSubheader, Button, Dialog, DialogTitle, DialogContent, TextField, DialogActions, CircularProgress, Card, withStyles, LinearProgress, CardHeader, Divider, CardContent } from '@material-ui/core';
|
|
7
|
-
import Done from '@material-ui/icons/Done';
|
|
8
|
-
import Warning from '@material-ui/icons/Warning';
|
|
9
7
|
import { DateTime, Duration } from 'luxon';
|
|
10
8
|
import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
|
|
11
9
|
import { Link, Progress, StatusWarning, StatusError, EmptyState, TabbedCard, CardTab, InfoCard } from '@backstage/core-components';
|
|
@@ -17,11 +15,13 @@ import Avatar from '@material-ui/core/Avatar';
|
|
|
17
15
|
import NotificationsIcon from '@material-ui/icons/Notifications';
|
|
18
16
|
import MailOutline from '@material-ui/icons/MailOutline';
|
|
19
17
|
import useAsync from 'react-use/lib/useAsync';
|
|
18
|
+
import LinkIcon from '@material-ui/icons/Link';
|
|
20
19
|
import PDGreenImage from '../assets/PD-Green.svg';
|
|
21
20
|
import PDWhiteImage from '../assets/PD-White.svg';
|
|
22
21
|
import { parseEntityRef, DEFAULT_NAMESPACE } from '@backstage/catalog-model';
|
|
23
22
|
import AddAlert from '@material-ui/icons/AddAlert';
|
|
24
23
|
import { makeStyles as makeStyles$1, createStyles, useTheme } from '@material-ui/core/styles';
|
|
24
|
+
import validateColor from 'validate-color';
|
|
25
25
|
|
|
26
26
|
const PAGERDUTY_INTEGRATION_KEY = "pagerduty.com/integration-key";
|
|
27
27
|
const PAGERDUTY_SERVICE_ID = "pagerduty.com/service-id";
|
|
@@ -93,6 +93,12 @@ class PagerDutyClient {
|
|
|
93
93
|
)}/services/${serviceId}/change-events`;
|
|
94
94
|
return await this.findByUrl(url);
|
|
95
95
|
}
|
|
96
|
+
async getServiceStandardsByServiceId(serviceId) {
|
|
97
|
+
const url = `${await this.config.discoveryApi.getBaseUrl(
|
|
98
|
+
"pagerduty"
|
|
99
|
+
)}/services/${serviceId}/standards`;
|
|
100
|
+
return await this.findByUrl(url);
|
|
101
|
+
}
|
|
96
102
|
async getOnCallByPolicyId(policyId) {
|
|
97
103
|
const params = `escalation_policy_ids[]=${policyId}`;
|
|
98
104
|
const url = `${await this.config.discoveryApi.getBaseUrl(
|
|
@@ -193,7 +199,7 @@ const HomePagePagerDutyCard = pagerDutyPlugin.provide(
|
|
|
193
199
|
createCardExtension({
|
|
194
200
|
name: "HomePagePagerDutyCard",
|
|
195
201
|
title: "PagerDuty Homepage Card",
|
|
196
|
-
components: () => import('./index-
|
|
202
|
+
components: () => import('./index-02ffa0de.esm.js'),
|
|
197
203
|
settings: {
|
|
198
204
|
schema: {
|
|
199
205
|
title: "PagerDuty",
|
|
@@ -229,18 +235,33 @@ const useStyles$8 = makeStyles((theme) => ({
|
|
|
229
235
|
fontWeight: "bold"
|
|
230
236
|
},
|
|
231
237
|
warning: {
|
|
232
|
-
borderColor: theme.palette.
|
|
233
|
-
color:
|
|
238
|
+
borderColor: theme.palette.warning.main,
|
|
239
|
+
color: "#fff",
|
|
240
|
+
backgroundColor: theme.palette.warning.main,
|
|
241
|
+
boxShadow: "0 8px 16px 0 rgba(0,0,0,0.2)",
|
|
242
|
+
textTransform: "uppercase",
|
|
234
243
|
"& *": {
|
|
235
|
-
color:
|
|
244
|
+
color: "#fff"
|
|
236
245
|
}
|
|
237
246
|
},
|
|
238
247
|
error: {
|
|
239
|
-
|
|
240
|
-
|
|
248
|
+
marginTop: "2px",
|
|
249
|
+
borderColor: theme.palette.error.main,
|
|
250
|
+
color: "#fff",
|
|
251
|
+
backgroundColor: theme.palette.error.main,
|
|
252
|
+
boxShadow: "0 8px 16px 0 rgba(0,0,0,0.2)",
|
|
253
|
+
textTransform: "uppercase",
|
|
241
254
|
"& *": {
|
|
242
|
-
color:
|
|
255
|
+
color: "#fff"
|
|
243
256
|
}
|
|
257
|
+
},
|
|
258
|
+
textContainer: {
|
|
259
|
+
display: "flex",
|
|
260
|
+
alignItems: "baseline"
|
|
261
|
+
},
|
|
262
|
+
smallIconStyle: {
|
|
263
|
+
color: theme.palette.text.primary,
|
|
264
|
+
marginRight: "-20px"
|
|
244
265
|
}
|
|
245
266
|
}));
|
|
246
267
|
const IncidentListItem = ({ incident }) => {
|
|
@@ -252,14 +273,13 @@ const IncidentListItem = ({ incident }) => {
|
|
|
252
273
|
return /* @__PURE__ */ React.createElement(ListItem, { dense: true, key: incident.id }, /* @__PURE__ */ React.createElement(
|
|
253
274
|
ListItemText,
|
|
254
275
|
{
|
|
255
|
-
primary: /* @__PURE__ */ React.createElement(
|
|
276
|
+
primary: /* @__PURE__ */ React.createElement("div", { className: classes.textContainer }, /* @__PURE__ */ React.createElement(
|
|
256
277
|
Chip,
|
|
257
278
|
{
|
|
258
279
|
"data-testid": `chip-${incident.status}`,
|
|
259
280
|
label: incident.status,
|
|
260
281
|
size: "small",
|
|
261
282
|
variant: "outlined",
|
|
262
|
-
icon: incident.status === "acknowledged" ? /* @__PURE__ */ React.createElement(Done, null) : /* @__PURE__ */ React.createElement(Warning, null),
|
|
263
283
|
className: incident.status === "triggered" ? classes.error : classes.warning
|
|
264
284
|
}
|
|
265
285
|
), incident.title),
|
|
@@ -275,7 +295,7 @@ const IncidentListItem = ({ incident }) => {
|
|
|
275
295
|
href: incident.html_url,
|
|
276
296
|
target: "_blank",
|
|
277
297
|
rel: "noopener noreferrer",
|
|
278
|
-
|
|
298
|
+
className: classes.smallIconStyle
|
|
279
299
|
},
|
|
280
300
|
/* @__PURE__ */ React.createElement(OpenInBrowserIcon, null)
|
|
281
301
|
))));
|
|
@@ -400,11 +420,17 @@ const useStyles$5 = makeStyles((theme) => ({
|
|
|
400
420
|
},
|
|
401
421
|
smallIconStyle: {
|
|
402
422
|
color: theme.palette.text.primary
|
|
423
|
+
},
|
|
424
|
+
avatarStyle: {
|
|
425
|
+
marginTop: "-20px"
|
|
403
426
|
}
|
|
404
427
|
}));
|
|
405
|
-
|
|
428
|
+
function navigateToEscalationPolicy(url) {
|
|
429
|
+
window.open(url, "_blank");
|
|
430
|
+
}
|
|
431
|
+
const EscalationUser = ({ user, policyUrl, policyName }) => {
|
|
406
432
|
const classes = useStyles$5();
|
|
407
|
-
return /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Avatar, { alt: user.name, src: user.avatar_url })), /* @__PURE__ */ React.createElement(
|
|
433
|
+
return /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Avatar, { alt: user.name, src: user.avatar_url, className: classes.avatarStyle })), /* @__PURE__ */ React.createElement(
|
|
408
434
|
ListItemText,
|
|
409
435
|
{
|
|
410
436
|
primary: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { className: classes.listItemPrimary }, user.name), /* @__PURE__ */ React.createElement(
|
|
@@ -419,9 +445,10 @@ const EscalationUser = ({ user }) => {
|
|
|
419
445
|
IconButton,
|
|
420
446
|
{
|
|
421
447
|
"aria-label": "open-service-in-browser",
|
|
448
|
+
onClick: () => navigateToEscalationPolicy(policyUrl),
|
|
422
449
|
className: classes.buttonStyle
|
|
423
450
|
},
|
|
424
|
-
/* @__PURE__ */ React.createElement("span", { className: classes.containerStyle }, /* @__PURE__ */ React.createElement(NotificationsIcon, { className: classes.iconStyle }),
|
|
451
|
+
/* @__PURE__ */ React.createElement("span", { className: classes.containerStyle }, /* @__PURE__ */ React.createElement(NotificationsIcon, { className: classes.iconStyle }), policyName)
|
|
425
452
|
)
|
|
426
453
|
}
|
|
427
454
|
), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(Tooltip, { title: "Send e-mail to user", placement: "top" }, /* @__PURE__ */ React.createElement(IconButton, { href: `mailto:${user.email}` }, /* @__PURE__ */ React.createElement(MailOutline, { className: classes.smallIconStyle }))), /* @__PURE__ */ React.createElement(Tooltip, { title: "View in PagerDuty", placement: "top" }, /* @__PURE__ */ React.createElement(
|
|
@@ -436,7 +463,7 @@ const EscalationUser = ({ user }) => {
|
|
|
436
463
|
))));
|
|
437
464
|
};
|
|
438
465
|
|
|
439
|
-
const EscalationPolicy = ({ policyId }) => {
|
|
466
|
+
const EscalationPolicy = ({ policyId, policyUrl, policyName }) => {
|
|
440
467
|
const api = useApi(pagerDutyApiRef);
|
|
441
468
|
const {
|
|
442
469
|
value: users,
|
|
@@ -457,7 +484,7 @@ const EscalationPolicy = ({ policyId }) => {
|
|
|
457
484
|
if (!(users == null ? void 0 : users.length)) {
|
|
458
485
|
return /* @__PURE__ */ React.createElement(EscalationUsersEmptyState, null);
|
|
459
486
|
}
|
|
460
|
-
return /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL"), style: { marginLeft: "-15px" } }, users.map((user, index) => /* @__PURE__ */ React.createElement(EscalationUser, { key: index, user })));
|
|
487
|
+
return /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL"), style: { marginLeft: "-15px" } }, users.map((user, index) => /* @__PURE__ */ React.createElement(EscalationUser, { key: index, user, policyUrl, policyName })));
|
|
461
488
|
};
|
|
462
489
|
|
|
463
490
|
const MissingTokenError = () => /* @__PURE__ */ React.createElement(
|
|
@@ -496,7 +523,7 @@ const ServiceNotFoundError = () => /* @__PURE__ */ React.createElement(
|
|
|
496
523
|
}
|
|
497
524
|
);
|
|
498
525
|
|
|
499
|
-
const useStyles$4 = makeStyles({
|
|
526
|
+
const useStyles$4 = makeStyles((theme) => ({
|
|
500
527
|
denseListIcon: {
|
|
501
528
|
marginRight: 0,
|
|
502
529
|
display: "flex",
|
|
@@ -506,8 +533,15 @@ const useStyles$4 = makeStyles({
|
|
|
506
533
|
},
|
|
507
534
|
listItemPrimary: {
|
|
508
535
|
fontWeight: "bold"
|
|
536
|
+
},
|
|
537
|
+
smallExternalLinkIconStyle: {
|
|
538
|
+
color: theme.palette.text.primary
|
|
539
|
+
},
|
|
540
|
+
smallIconStyle: {
|
|
541
|
+
color: theme.palette.text.primary,
|
|
542
|
+
marginRight: "-20px"
|
|
509
543
|
}
|
|
510
|
-
});
|
|
544
|
+
}));
|
|
511
545
|
const ChangeEventListItem = ({ changeEvent }) => {
|
|
512
546
|
const classes = useStyles$4();
|
|
513
547
|
const duration = (/* @__PURE__ */ new Date()).getTime() - new Date(changeEvent.timestamp).getTime();
|
|
@@ -520,9 +554,9 @@ const ChangeEventListItem = ({ changeEvent }) => {
|
|
|
520
554
|
{
|
|
521
555
|
component: Link,
|
|
522
556
|
to: changeEvent.links[0].href,
|
|
523
|
-
|
|
557
|
+
className: classes.smallExternalLinkIconStyle
|
|
524
558
|
},
|
|
525
|
-
/* @__PURE__ */ React.createElement(
|
|
559
|
+
/* @__PURE__ */ React.createElement(LinkIcon, null)
|
|
526
560
|
));
|
|
527
561
|
}
|
|
528
562
|
return /* @__PURE__ */ React.createElement(ListItem, { dense: true, key: changeEvent.id }, /* @__PURE__ */ React.createElement(
|
|
@@ -540,7 +574,7 @@ const ChangeEventListItem = ({ changeEvent }) => {
|
|
|
540
574
|
{
|
|
541
575
|
component: Link,
|
|
542
576
|
to: changeEvent.html_url,
|
|
543
|
-
|
|
577
|
+
className: classes.smallIconStyle
|
|
544
578
|
},
|
|
545
579
|
/* @__PURE__ */ React.createElement(OpenInBrowserIcon, null)
|
|
546
580
|
))));
|
|
@@ -792,22 +826,53 @@ function OpenServiceButton(props) {
|
|
|
792
826
|
));
|
|
793
827
|
}
|
|
794
828
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
829
|
+
function labelFromStatus(status) {
|
|
830
|
+
let label;
|
|
831
|
+
switch (status) {
|
|
832
|
+
case "active":
|
|
833
|
+
label = "OK";
|
|
834
|
+
break;
|
|
835
|
+
case "warning":
|
|
836
|
+
label = "ACTIVE";
|
|
837
|
+
break;
|
|
838
|
+
case "critical":
|
|
839
|
+
label = "ALARM";
|
|
840
|
+
break;
|
|
841
|
+
case "maintenance":
|
|
842
|
+
label = "MAINTENANCE";
|
|
843
|
+
break;
|
|
844
|
+
case "disabled":
|
|
845
|
+
label = "DISABLED";
|
|
846
|
+
break;
|
|
847
|
+
default:
|
|
848
|
+
label = "OK";
|
|
849
|
+
break;
|
|
850
|
+
}
|
|
851
|
+
return label;
|
|
852
|
+
}
|
|
802
853
|
function colorFromStatus(theme, status) {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
854
|
+
let color;
|
|
855
|
+
switch (status) {
|
|
856
|
+
case "active":
|
|
857
|
+
color = theme.palette.success.main;
|
|
858
|
+
break;
|
|
859
|
+
case "warning":
|
|
860
|
+
color = theme.palette.warningBackground;
|
|
861
|
+
break;
|
|
862
|
+
case "critical":
|
|
863
|
+
color = theme.palette.error.main;
|
|
864
|
+
break;
|
|
865
|
+
case "maintenance":
|
|
866
|
+
color = "#ebdc00";
|
|
867
|
+
break;
|
|
868
|
+
case "disabled":
|
|
869
|
+
color = "#A9A9A9";
|
|
870
|
+
break;
|
|
871
|
+
default:
|
|
872
|
+
color = theme.palette.success.main;
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
return color;
|
|
811
876
|
}
|
|
812
877
|
function StatusCard({ status }) {
|
|
813
878
|
const useStyles = makeStyles$1((theme) => ({
|
|
@@ -816,56 +881,18 @@ function StatusCard({ status }) {
|
|
|
816
881
|
display: "flex",
|
|
817
882
|
alignItems: "center",
|
|
818
883
|
justifyContent: "center",
|
|
819
|
-
backgroundColor: colorFromStatus(theme, status),
|
|
884
|
+
backgroundColor: status !== void 0 ? colorFromStatus(theme, status) : colorFromStatus(theme, "active"),
|
|
820
885
|
marginRight: "10px"
|
|
821
886
|
},
|
|
822
887
|
largeTextStyle: {
|
|
823
888
|
color: "white",
|
|
824
889
|
fontWeight: "bold",
|
|
825
|
-
fontSize: "20px"
|
|
890
|
+
fontSize: "20px",
|
|
891
|
+
wordWrap: "break-word"
|
|
826
892
|
}
|
|
827
893
|
}));
|
|
828
894
|
const { cardStyle, largeTextStyle } = useStyles();
|
|
829
|
-
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle },
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
const cardLabels = {
|
|
833
|
-
triggered: "TRIGGERED",
|
|
834
|
-
acknowledged: "ACKNOWLEDGED",
|
|
835
|
-
resolved: "RESOLVED"
|
|
836
|
-
};
|
|
837
|
-
function colorFromLabel(theme, label) {
|
|
838
|
-
const cardColors = {
|
|
839
|
-
triggered: theme.palette.error.main,
|
|
840
|
-
acknowledged: theme.palette.warning.main,
|
|
841
|
-
resolved: theme.palette.success.main
|
|
842
|
-
};
|
|
843
|
-
return cardColors[label];
|
|
844
|
-
}
|
|
845
|
-
function IncidentCounterCard({ count, label }) {
|
|
846
|
-
const useStyles = makeStyles((theme) => ({
|
|
847
|
-
cardStyle: {
|
|
848
|
-
marginRight: "10px",
|
|
849
|
-
height: "120px",
|
|
850
|
-
display: "flex",
|
|
851
|
-
alignItems: "center",
|
|
852
|
-
justifyContent: "center",
|
|
853
|
-
backgroundColor: "rgba(0, 0, 0, 0.03)"
|
|
854
|
-
},
|
|
855
|
-
largeTextStyle: {
|
|
856
|
-
color: colorFromLabel(theme, label),
|
|
857
|
-
fontSize: "40px",
|
|
858
|
-
marginTop: "-20px"
|
|
859
|
-
},
|
|
860
|
-
smallTextStyle: {
|
|
861
|
-
color: colorFromLabel(theme, label),
|
|
862
|
-
fontWeight: "bold",
|
|
863
|
-
fontSize: "10px",
|
|
864
|
-
marginTop: "-10px"
|
|
865
|
-
}
|
|
866
|
-
}));
|
|
867
|
-
const { cardStyle, largeTextStyle, smallTextStyle } = useStyles();
|
|
868
|
-
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, count), /* @__PURE__ */ React.createElement(Typography, { className: smallTextStyle }, cardLabels[label]));
|
|
895
|
+
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, status !== void 0 ? /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, labelFromStatus(status)) : /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, "Unable to get status"));
|
|
869
896
|
}
|
|
870
897
|
|
|
871
898
|
function colorFromPercentage(theme, percentage) {
|
|
@@ -890,18 +917,17 @@ function ServiceStandardsCard({ total, completed }) {
|
|
|
890
917
|
},
|
|
891
918
|
largeTextStyle: {
|
|
892
919
|
fontSize: "50px",
|
|
893
|
-
color: colorFromPercentage(theme, completed / total),
|
|
894
|
-
fontWeight: "bold",
|
|
920
|
+
color: completed !== void 0 && total !== void 0 ? colorFromPercentage(theme, completed / total) : colorFromPercentage(theme, 0),
|
|
895
921
|
alignSelf: "center",
|
|
896
922
|
justifyContent: "center"
|
|
897
923
|
},
|
|
898
924
|
smallTextStyle: {
|
|
899
|
-
color: theme.palette.
|
|
900
|
-
fontSize: "
|
|
925
|
+
color: theme.palette.textSubtle,
|
|
926
|
+
fontSize: "14px",
|
|
901
927
|
fontWeight: "bold",
|
|
902
928
|
alignSelf: "center",
|
|
903
929
|
justifyContent: "center",
|
|
904
|
-
marginLeft: "
|
|
930
|
+
marginLeft: "-2px",
|
|
905
931
|
marginTop: "25px"
|
|
906
932
|
}
|
|
907
933
|
}));
|
|
@@ -916,17 +942,46 @@ function ServiceStandardsCard({ total, completed }) {
|
|
|
916
942
|
},
|
|
917
943
|
bar: {
|
|
918
944
|
borderRadius: 5,
|
|
919
|
-
backgroundColor: colorFromPercentage(theme, completed / total)
|
|
945
|
+
backgroundColor: completed !== void 0 && total !== void 0 ? colorFromPercentage(theme, completed / total) : colorFromPercentage(theme, 0)
|
|
920
946
|
}
|
|
921
947
|
}))(LinearProgress);
|
|
922
948
|
const { cardStyle, containerStyle, largeTextStyle, smallTextStyle } = useStyles();
|
|
923
|
-
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, /* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, completed), /* @__PURE__ */ React.createElement(Typography, { className: smallTextStyle }, "/", total)), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
949
|
+
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, completed !== void 0 && total !== void 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, completed), /* @__PURE__ */ React.createElement(Typography, { className: smallTextStyle }, "/", total)), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
924
950
|
BorderLinearProgress,
|
|
925
951
|
{
|
|
926
952
|
variant: "determinate",
|
|
927
953
|
value: completed / total * 100
|
|
928
954
|
}
|
|
929
|
-
)));
|
|
955
|
+
))) : /* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, "Unable to retrieve Scores")));
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
function IncidentCounterCard({ count, label, color }) {
|
|
959
|
+
const textColor = color && validateColor(color) ? color : "black";
|
|
960
|
+
const useStyles = makeStyles(() => ({
|
|
961
|
+
cardStyle: {
|
|
962
|
+
marginRight: "10px",
|
|
963
|
+
height: "120px",
|
|
964
|
+
display: "flex",
|
|
965
|
+
alignItems: "center",
|
|
966
|
+
justifyContent: "center",
|
|
967
|
+
backgroundColor: "rgba(0, 0, 0, 0.03)"
|
|
968
|
+
},
|
|
969
|
+
largeTextStyle: {
|
|
970
|
+
color: textColor,
|
|
971
|
+
fontSize: "40px",
|
|
972
|
+
marginTop: "-20px"
|
|
973
|
+
},
|
|
974
|
+
smallTextStyle: {
|
|
975
|
+
color: textColor,
|
|
976
|
+
fontWeight: "bold",
|
|
977
|
+
fontSize: "10px",
|
|
978
|
+
marginTop: "-10px",
|
|
979
|
+
textTransform: "uppercase",
|
|
980
|
+
flexWrap: "wrap"
|
|
981
|
+
}
|
|
982
|
+
}));
|
|
983
|
+
const { cardStyle, largeTextStyle, smallTextStyle } = useStyles();
|
|
984
|
+
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, /* @__PURE__ */ React.createElement(Typography, { className: largeTextStyle }, count), /* @__PURE__ */ React.createElement(Typography, { className: smallTextStyle }, label));
|
|
930
985
|
}
|
|
931
986
|
|
|
932
987
|
const useStyles$1 = makeStyles$1(
|
|
@@ -959,6 +1014,7 @@ const useStyles$1 = makeStyles$1(
|
|
|
959
1014
|
);
|
|
960
1015
|
const BasicCard = ({ children }) => /* @__PURE__ */ React.createElement(InfoCard, { title: "PagerDuty" }, children);
|
|
961
1016
|
const PagerDutyCard$1 = (props) => {
|
|
1017
|
+
var _a, _b;
|
|
962
1018
|
const classes = useStyles$1();
|
|
963
1019
|
const theme = useTheme();
|
|
964
1020
|
const { readOnly, disableChangeEvents, integrationKey, name } = props;
|
|
@@ -981,13 +1037,18 @@ const PagerDutyCard$1 = (props) => {
|
|
|
981
1037
|
const { service: foundService } = await api.getServiceByPagerDutyEntity(
|
|
982
1038
|
props
|
|
983
1039
|
);
|
|
984
|
-
|
|
1040
|
+
const { standards: serviceStandards } = await api.getServiceStandardsByServiceId(foundService.id);
|
|
1041
|
+
const result = {
|
|
985
1042
|
id: foundService.id,
|
|
986
1043
|
name: foundService.name,
|
|
987
1044
|
url: foundService.html_url,
|
|
988
1045
|
policyId: foundService.escalation_policy.id,
|
|
989
|
-
policyLink: foundService.escalation_policy.html_url
|
|
1046
|
+
policyLink: foundService.escalation_policy.html_url,
|
|
1047
|
+
policyName: foundService.escalation_policy.name,
|
|
1048
|
+
status: foundService.status,
|
|
1049
|
+
standardsScore: serviceStandards.score
|
|
990
1050
|
};
|
|
1051
|
+
return result;
|
|
991
1052
|
}, [props]);
|
|
992
1053
|
if (error) {
|
|
993
1054
|
let errorNode;
|
|
@@ -1014,7 +1075,34 @@ const PagerDutyCard$1 = (props) => {
|
|
|
1014
1075
|
title: theme.palette.type === "dark" ? /* @__PURE__ */ React.createElement("img", { src: PDWhiteImage, alt: "PagerDuty", height: "35" }) : /* @__PURE__ */ React.createElement("img", { src: PDGreenImage, alt: "PagerDuty", height: "35" }),
|
|
1015
1076
|
action: !readOnly ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TriggerIncidentButton, null), /* @__PURE__ */ React.createElement(OpenServiceButton, { serviceUrl: service.url })) : /* @__PURE__ */ React.createElement(OpenServiceButton, { serviceUrl: service.url })
|
|
1016
1077
|
}
|
|
1017
|
-
), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, className: classes.overviewHeaderContainerStyle }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "STATUS")), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6 }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "
|
|
1078
|
+
), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, className: classes.overviewHeaderContainerStyle }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "STATUS")), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6 }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "INSIGHTS")), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "STANDARDS"))), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, className: classes.overviewCardsContainerStyle }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(StatusCard, { status: service == null ? void 0 : service.status })), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6, className: classes.incidentMetricsContainerStyle }, /* @__PURE__ */ React.createElement(Grid, { md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1079
|
+
IncidentCounterCard,
|
|
1080
|
+
{
|
|
1081
|
+
count: 29,
|
|
1082
|
+
label: "interruptions",
|
|
1083
|
+
color: theme.palette.textSubtle
|
|
1084
|
+
}
|
|
1085
|
+
)), /* @__PURE__ */ React.createElement(Grid, { md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1086
|
+
IncidentCounterCard,
|
|
1087
|
+
{
|
|
1088
|
+
count: 29,
|
|
1089
|
+
label: "high urgency",
|
|
1090
|
+
color: theme.palette.warning.main
|
|
1091
|
+
}
|
|
1092
|
+
)), /* @__PURE__ */ React.createElement(Grid, { md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1093
|
+
IncidentCounterCard,
|
|
1094
|
+
{
|
|
1095
|
+
count: 32,
|
|
1096
|
+
label: "incidents",
|
|
1097
|
+
color: theme.palette.error.main
|
|
1098
|
+
}
|
|
1099
|
+
))), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(
|
|
1100
|
+
ServiceStandardsCard,
|
|
1101
|
+
{
|
|
1102
|
+
total: (_a = service == null ? void 0 : service.standardsScore) == null ? void 0 : _a.total,
|
|
1103
|
+
completed: (_b = service == null ? void 0 : service.standardsScore) == null ? void 0 : _b.passing
|
|
1104
|
+
}
|
|
1105
|
+
))), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(TabbedCard, null, /* @__PURE__ */ React.createElement(CardTab, { label: "Incidents" }, /* @__PURE__ */ React.createElement(
|
|
1018
1106
|
Incidents,
|
|
1019
1107
|
{
|
|
1020
1108
|
serviceId: service.id,
|
|
@@ -1026,7 +1114,14 @@ const PagerDutyCard$1 = (props) => {
|
|
|
1026
1114
|
serviceId: service.id,
|
|
1027
1115
|
refreshEvents: refreshChangeEvents
|
|
1028
1116
|
}
|
|
1029
|
-
)) : /* @__PURE__ */ React.createElement(React.Fragment, null)), /* @__PURE__ */ React.createElement(
|
|
1117
|
+
)) : /* @__PURE__ */ React.createElement(React.Fragment, null)), /* @__PURE__ */ React.createElement(
|
|
1118
|
+
EscalationPolicy,
|
|
1119
|
+
{
|
|
1120
|
+
policyId: service.policyId,
|
|
1121
|
+
policyUrl: service.policyLink,
|
|
1122
|
+
policyName: service.policyName
|
|
1123
|
+
}
|
|
1124
|
+
))), !createIncidentDisabled && /* @__PURE__ */ React.createElement(
|
|
1030
1125
|
TriggerDialog,
|
|
1031
1126
|
{
|
|
1032
1127
|
"data-testid": "trigger-dialog",
|
|
@@ -1094,7 +1189,7 @@ function TriggerButton(props) {
|
|
|
1094
1189
|
className: disabled ? "" : buttonStyle,
|
|
1095
1190
|
disabled
|
|
1096
1191
|
},
|
|
1097
|
-
integrationKey ? (_a = props.children) != null ? _a : "Create
|
|
1192
|
+
integrationKey ? (_a = props.children) != null ? _a : "Create new incident" : "Missing integration key"
|
|
1098
1193
|
), integrationKey && /* @__PURE__ */ React.createElement(
|
|
1099
1194
|
TriggerDialog,
|
|
1100
1195
|
{
|
|
@@ -1109,4 +1204,4 @@ function TriggerButton(props) {
|
|
|
1109
1204
|
const PagerDutyCard = EntityPagerDutyCard;
|
|
1110
1205
|
|
|
1111
1206
|
export { EntityPagerDutyCard$1 as E, HomePagePagerDutyCard as H, PagerDutyCard$1 as P, TriggerButton as T, UnauthorizedError as U, PagerDutyClient as a, pagerDutyApiRef as b, PagerDutyCard as c, isPluginApplicableToEntity as i, pagerDutyPlugin as p };
|
|
1112
|
-
//# sourceMappingURL=index-
|
|
1207
|
+
//# sourceMappingURL=index-76653f8d.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-76653f8d.esm.js","sources":["../../src/components/constants.ts","../../src/components/pagerDutyEntity.ts","../../src/api/client.ts","../../src/plugin.ts","../../src/components/Incident/IncidentListItem.tsx","../../src/components/Incident/IncidentEmptyState.tsx","../../src/components/Incident/IncidentForbiddenState.tsx","../../src/components/Incident/Incidents.tsx","../../src/components/Escalation/EscalationUsersEmptyState.tsx","../../src/components/Escalation/EscalationUsersForbiddenState.tsx","../../src/components/Escalation/EscalationUser.tsx","../../src/components/Escalation/EscalationPolicy.tsx","../../src/components/Errors/MissingTokenError.tsx","../../src/components/Errors/ServiceNotFoundError.tsx","../../src/components/ChangeEvents/ChangeEventListItem.tsx","../../src/components/ChangeEvents/ChangeEventEmptyState.tsx","../../src/components/ChangeEvents/ChangeEventForbiddenState.tsx","../../src/components/ChangeEvents/ChangeEvents.tsx","../../src/components/Errors/ForbiddenError.tsx","../../src/hooks/index.ts","../../src/components/TriggerDialog/TriggerDialog.tsx","../../src/components/PagerDutyCard/TriggerIncidentButton.tsx","../../src/components/PagerDutyCard/OpenServiceButton.tsx","../../src/components/PagerDutyCard/StatusCard.tsx","../../src/components/PagerDutyCard/ServiceStandardsCard.tsx","../../src/components/PagerDutyCard/InsightsCard.tsx","../../src/components/PagerDutyCard/index.tsx","../../src/components/EntityPagerDutyCard/index.tsx","../../src/components/TriggerButton/index.tsx","../../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const PAGERDUTY_INTEGRATION_KEY = 'pagerduty.com/integration-key';\nexport const PAGERDUTY_SERVICE_ID = 'pagerduty.com/service-id';\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { PagerDutyEntity } from '../types';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from './constants';\n\nexport function getPagerDutyEntity(entity: Entity): PagerDutyEntity {\n const {\n [PAGERDUTY_INTEGRATION_KEY]: integrationKey,\n [PAGERDUTY_SERVICE_ID]: serviceId,\n } = entity.metadata.annotations || ({} as Record<string, string>);\n const name = entity.metadata.name;\n\n return { integrationKey, serviceId, name };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n PagerDutyApi,\n PagerDutyTriggerAlarmRequest,\n PagerDutyClientApiDependencies,\n PagerDutyClientApiConfig,\n RequestOptions,\n} from './types';\nimport { PagerDutyChangeEventsResponse, \n PagerDutyOnCallUsersResponse, \n PagerDutyUser, \n PagerDutyServiceResponse,\n PagerDutyIncidentsResponse,\n PagerDutyServiceStandardsResponse\n} from '@pagerduty/backstage-plugin-common';\nimport { createApiRef, ConfigApi } from '@backstage/core-plugin-api';\nimport { NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\nimport { PagerDutyEntity } from '../types';\n\n/** @public */\nexport class UnauthorizedError extends Error {}\n\n/** @public */\nexport class ForbiddenError extends Error { }\n\n/** @public */\nexport const pagerDutyApiRef = createApiRef<PagerDutyApi>({\n id: 'plugin.pagerduty.api',\n});\n\n/** @public */\nexport class PagerDutyClient implements PagerDutyApi {\n static fromConfig(\n configApi: ConfigApi,\n dependencies: PagerDutyClientApiDependencies,\n ) {\n const { discoveryApi, fetchApi } = dependencies;\n\n const eventsBaseUrl: string =\n configApi.getOptionalString('pagerDuty.eventsBaseUrl') ??\n 'https://events.pagerduty.com/v2';\n\n return new PagerDutyClient({\n eventsBaseUrl,\n discoveryApi,\n fetchApi,\n });\n }\n\n constructor(private readonly config: PagerDutyClientApiConfig) {}\n\n async getServiceByPagerDutyEntity(\n pagerDutyEntity: PagerDutyEntity,\n ): Promise<PagerDutyServiceResponse> {\n const { integrationKey, serviceId } = pagerDutyEntity;\n\n let response: PagerDutyServiceResponse;\n let url: string;\n\n if (integrationKey) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services?integration_key=${integrationKey}`;\n const serviceResponse = await this.findByUrl<PagerDutyServiceResponse>(url);\n\n if (serviceResponse.service === undefined) throw new NotFoundError();\n\n response = serviceResponse;\n } else if (serviceId) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}`;\n\n response = await this.findByUrl<PagerDutyServiceResponse>(url);\n } else {\n throw new NotFoundError();\n }\n\n return response;\n }\n\n async getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse> {\n return await this.getServiceByPagerDutyEntity(getPagerDutyEntity(entity));\n }\n async getIncidentsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyIncidentsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/incidents`;\n\n return await this.findByUrl<PagerDutyIncidentsResponse>(url);\n }\n\n async getChangeEventsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyChangeEventsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/change-events`;\n\n return await this.findByUrl<PagerDutyChangeEventsResponse>(url);\n }\n\n async getServiceStandardsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyServiceStandardsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/standards`;\n\n return await this.findByUrl<PagerDutyServiceStandardsResponse>(url);\n }\n\n async getOnCallByPolicyId(\n policyId: string,\n ): Promise<PagerDutyUser[]> {\n const params = `escalation_policy_ids[]=${policyId}`;\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/oncall-users?${params}`;\n\n const response: PagerDutyOnCallUsersResponse = await this.findByUrl<PagerDutyOnCallUsersResponse>(url);\n return response.users;\n }\n\n triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response> {\n const { integrationKey, source, description, userName } = request;\n\n const body = JSON.stringify({\n event_action: 'trigger',\n routing_key: integrationKey,\n client: 'Backstage',\n client_url: source,\n payload: {\n summary: description,\n source: source,\n severity: 'error',\n class: 'manual trigger',\n custom_details: {\n user: userName,\n },\n },\n });\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8',\n Accept: 'application/json, text/plain, */*',\n },\n body,\n };\n\n const url = this.config.eventsBaseUrl ?? 'https://events.pagerduty.com/v2';\n\n return this.request(`${url}/enqueue`, options);\n }\n\n private async findByUrl<T>(url: string): Promise<T> {\n const options = {\n method: 'GET',\n headers: {\n Accept: 'application/vnd.pagerduty+json;version=2',\n 'Content-Type': 'application/json',\n },\n };\n const response = await this.request(url, options);\n return response.json();\n }\n\n private async request(\n url: string,\n options: RequestOptions,\n ): Promise<Response> {\n const response = await this.config.fetchApi.fetch(url, options);\n if (response.status === 401) {\n throw new UnauthorizedError(\"Unauthorized: You don't have access to this resource\");\n }\n\n if (response.status === 403) {\n throw new ForbiddenError(\"Forbidden: You are not allowed to perform this action\");\n }\n\n if (response.status === 404) {\n throw new NotFoundError(\"Not Found: Resource not found\");\n }\n\n if (!response.ok) {\n const payload = await response.json();\n const errors = payload.errors.map((error: string) => error).join(' ');\n const message = `Request failed with ${response.status}, ${errors}`;\n throw new Error(message);\n }\n return response;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pagerDutyApiRef, PagerDutyClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n configApiRef,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\nimport { createCardExtension } from '@backstage/plugin-home-react';\nimport { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';\n\nexport const rootRouteRef = createRouteRef({\n id: 'pagerduty',\n});\n\n/** @public */\nexport const pagerDutyPlugin = createPlugin({\n id: 'pagerduty',\n apis: [\n createApiFactory({\n api: pagerDutyApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const EntityPagerDutyCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutyCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutyCard').then(\n m => m.EntityPagerDutyCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const HomePagePagerDutyCard = pagerDutyPlugin.provide(\n createCardExtension<HomePagePagerDutyCardProps>({\n name: 'HomePagePagerDutyCard',\n title: 'PagerDuty Homepage Card',\n components: () => import('./components/HomePagePagerDutyCard'),\n settings: {\n schema: {\n title: 'PagerDuty',\n type: 'object',\n properties: {\n integrationKey: {\n title: 'PagerDuty integration key',\n type: 'string',\n },\n serviceId: {\n title: 'PagerDuty service id',\n type: 'string',\n },\n name: {\n title: 'PagerDuty service name',\n type: 'string',\n },\n },\n },\n },\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n Chip,\n} from '@material-ui/core';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyIncident } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n denseListIcon: {\n marginRight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n listItemPrimary: {\n fontWeight: \"bold\",\n },\n warning: {\n borderColor: theme.palette.warning.main,\n color: \"#fff\",\n backgroundColor: theme.palette.warning.main,\n boxShadow: \"0 8px 16px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: \"#fff\",\n },\n },\n error: {\n marginTop: \"2px\",\n borderColor: theme.palette.error.main,\n color: \"#fff\",\n backgroundColor: theme.palette.error.main,\n boxShadow: \"0 8px 16px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: \"#fff\",\n },\n },\n textContainer: {\n display: \"flex\",\n alignItems: \"baseline\",\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n marginRight: \"-20px\",\n },\n}));\n\ntype Props = {\n incident: PagerDutyIncident;\n};\n\nexport const IncidentListItem = ({ incident }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(incident.created_at).getTime();\n const createdAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n const user = incident.assignments[0]?.assignee;\n\n return (\n <ListItem dense key={incident.id}>\n <ListItemText\n primary={\n <div className={classes.textContainer}>\n <Chip\n data-testid={`chip-${incident.status}`}\n label={incident.status}\n size=\"small\"\n variant=\"outlined\"\n className={\n incident.status === \"triggered\"\n ? classes.error\n : classes.warning\n }\n />\n {incident.title}\n </div>\n }\n primaryTypographyProps={{\n variant: \"body1\",\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography noWrap variant=\"body2\" color=\"textSecondary\">\n Created {createdAt} and assigned to{\" \"}\n <Link to={user?.html_url ?? \"#\"}>{user?.summary ?? \"nobody\"}</Link>\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={incident.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={classes.smallIconStyle}\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from \"../../assets/emptystate.svg\";\n\nexport const IncidentsEmptyState = () => {\n return (\n <Grid\n container\n justifyContent=\"center\"\n direction=\"column\"\n alignItems=\"center\"\n >\n <Grid item xs={12}>\n <Typography variant=\"h5\">Nice! No incidents found!</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const IncidentForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { IncidentListItem } from './IncidentListItem';\nimport { IncidentsEmptyState } from './IncidentEmptyState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { IncidentForbiddenState } from './IncidentForbiddenState';\n\ntype Props = {\n serviceId: string;\n refreshIncidents: boolean;\n};\n\nexport const Incidents = ({ serviceId, refreshIncidents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: incidents, loading, error }, getIncidents] = useAsyncFn(\n async () => {\n const { incidents: foundIncidents } = await api.getIncidentsByServiceId(\n serviceId,\n );\n return foundIncidents;\n },\n );\n\n useEffect(() => {\n getIncidents();\n }, [refreshIncidents, getIncidents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <IncidentForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!incidents?.length) {\n return <IncidentsEmptyState />;\n }\n\n return (\n <List dense>\n {incidents!.map((incident, index) => (\n <IncidentListItem key={incident.id + index} incident={incident} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusWarning } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersEmptyState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusWarning />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"No one is on-call. Update the escalation policy.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusError } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersForbiddenState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusError />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"You don't permissions to list on-calls. Check your OAuth token permissions.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport Avatar from '@material-ui/core/Avatar';\nimport { PagerDutyUser } from '@pagerduty/backstage-plugin-common';\nimport NotificationsIcon from \"@material-ui/icons/Notifications\";\nimport { BackstageTheme } from '@backstage/theme';\nimport MailOutline from '@material-ui/icons/MailOutline';\nimport OpenInBrowser from '@material-ui/icons/OpenInBrowser';\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n listItemPrimary: {\n fontWeight: \"bold\",\n },\n listItemSecondary: {\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n marginTop: \"-5px\",\n },\n buttonStyle: {\n marginLeft: \"-11px\",\n marginTop: \"-10px\",\n fontSize: \"15px\",\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n display: \"flex\",\n alignItems: \"center\",\n fontWeight: \"bold\",\n },\n iconStyle: {\n fontSize: \"25px\",\n marginLeft: \"-4px\",\n color: theme.palette.text.primary,\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n },\n avatarStyle: {\n marginTop: \"-20px\"\n },\n}));\n\ntype Props = {\n user: PagerDutyUser;\n policyUrl: string;\n policyName: string;\n};\n\nfunction navigateToEscalationPolicy(url: string) {\n // open url in new browser window\n window.open(url, \"_blank\");\n}\n\nexport const EscalationUser = ({ user, policyUrl, policyName }: Props) => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemIcon>\n <Avatar alt={user.name} src={user.avatar_url} className={classes.avatarStyle} />\n </ListItemIcon>\n <ListItemText\n primary={\n <>\n <Typography className={classes.listItemPrimary}>\n {user.name}\n </Typography>\n <Typography\n className={classes.listItemSecondary}\n color=\"textSecondary\"\n >\n {user.email}\n </Typography>\n </>\n }\n secondary={\n <IconButton\n aria-label=\"open-service-in-browser\"\n onClick={() => navigateToEscalationPolicy(policyUrl)} \n className={classes.buttonStyle}\n >\n <span className={classes.containerStyle}>\n <NotificationsIcon className={classes.iconStyle} />\n {policyName}\n </span>\n </IconButton>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"Send e-mail to user\" placement=\"top\">\n <IconButton href={`mailto:${user.email}`}>\n <MailOutline className={classes.smallIconStyle} />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={user.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={classes.smallIconStyle}\n >\n <OpenInBrowser />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { List, ListSubheader } from '@material-ui/core';\nimport { EscalationUsersEmptyState } from './EscalationUsersEmptyState';\nimport { EscalationUsersForbiddenState } from './EscalationUsersForbiddenState';\nimport { EscalationUser } from './EscalationUser';\nimport useAsync from 'react-use/lib/useAsync';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\n\ntype Props = {\n policyId: string;\n policyUrl: string;\n policyName: string;\n};\n\nexport const EscalationPolicy = ({ policyId, policyUrl, policyName }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const {\n value: users,\n loading,\n error,\n } = useAsync(async () => {\n return await api.getOnCallByPolicyId(policyId);\n });\n\n if (error) {\n if (error.message.includes(\"Forbidden\")) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <EscalationUsersForbiddenState />\n </List>\n );\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!users?.length) {\n return <EscalationUsersEmptyState />;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>} style={{marginLeft: \"-15px\"}}>\n {users!.map((user, index) => (\n <EscalationUser key={index} user={user} policyUrl={policyUrl} policyName={policyName} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const MissingTokenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Missing or invalid PagerDuty Token\"\n description=\"The request to fetch data needs a valid token. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ServiceNotFoundError = () => (\n <EmptyState\n missing=\"data\"\n title=\"PagerDuty Service Not Found\"\n description=\"A service could not be found within PagerDuty based on the provided service id. Please verify your configuration.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyChangeEvent } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport LinkIcon from '@material-ui/icons/Link';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n denseListIcon: {\n marginRight: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n listItemPrimary: {\n fontWeight: \"bold\",\n },\n smallExternalLinkIconStyle: {\n color: theme.palette.text.primary\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n marginRight: \"-20px\"\n },\n}));\n\ntype Props = {\n changeEvent: PagerDutyChangeEvent;\n};\n\nexport const ChangeEventListItem = ({ changeEvent }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(changeEvent.timestamp).getTime();\n const changedAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n let externalLinkElem: JSX.Element | undefined;\n if (changeEvent.links.length > 0) {\n const text: string = changeEvent.links[0].text;\n externalLinkElem = (\n <Tooltip title={text} placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.links[0].href}\n className={classes.smallExternalLinkIconStyle}\n >\n <LinkIcon />\n </IconButton>\n </Tooltip>\n );\n }\n\n return (\n <ListItem dense key={changeEvent.id}>\n <ListItemText\n primary={<>{changeEvent.summary}</>}\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography variant=\"body2\" color=\"textSecondary\">\n Triggered from {changeEvent.source} {changedAt}.\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n {externalLinkElem}\n {changeEvent.html_url === undefined ? null : (\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.html_url}\n className={classes.smallIconStyle}\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n )}\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from '../../assets/emptystate.svg';\n\nexport const ChangeEventEmptyState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">No change events to display yet.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const ChangeEventForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { ChangeEventListItem } from './ChangeEventListItem';\nimport { ChangeEventEmptyState } from './ChangeEventEmptyState';\nimport { ChangeEventForbiddenState } from './ChangeEventForbiddenState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { Alert } from '@material-ui/lab';\n\ntype Props = {\n serviceId: string;\n refreshEvents: boolean;\n};\n\nexport const ChangeEvents = ({ serviceId, refreshEvents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(\n async () => {\n const { change_events } = await api.getChangeEventsByServiceId(serviceId);\n return change_events;\n },\n );\n\n useEffect(() => {\n getChangeEvents();\n }, [refreshEvents, getChangeEvents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <ChangeEventForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!changeEvents?.length) {\n return <ChangeEventEmptyState />;\n }\n\n return (\n <List dense>\n {changeEvents!.map((changeEvent, index) => (\n <ChangeEventListItem\n key={changeEvent.id + index}\n changeEvent={changeEvent}\n />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ForbiddenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Unauthorized\"\n description=\"You don't have the required permissions to perform this action. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { PagerDutyEntity } from '../types';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\n\nexport function usePagerdutyEntity(): PagerDutyEntity {\n const { entity } = useEntity();\n\n return getPagerDutyEntity(entity);\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useState, useEffect } from 'react';\nimport {\n Dialog,\n DialogTitle,\n TextField,\n DialogActions,\n Button,\n DialogContent,\n Typography,\n CircularProgress,\n} from '@material-ui/core';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\nimport {\n useApi,\n alertApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { DEFAULT_NAMESPACE, parseEntityRef } from '@backstage/catalog-model';\n\ntype Props = {\n showDialog: boolean;\n handleDialog: () => void;\n onIncidentCreated?: () => void;\n name: string;\n integrationKey: string;\n};\n\nexport const TriggerDialog = ({\n showDialog,\n handleDialog,\n onIncidentCreated: onIncidentCreated,\n name,\n integrationKey,\n}: Props) => {\n const alertApi = useApi(alertApiRef);\n const identityApi = useApi(identityApiRef);\n const api = useApi(pagerDutyApiRef);\n const [description, setDescription] = useState<string>('');\n\n const [{ value, loading, error }, handleTriggerAlarm] = useAsyncFn(\n async (descriptions: string) => {\n const { userEntityRef } = await identityApi.getBackstageIdentity();\n const { name: userName } = parseEntityRef(userEntityRef, {\n defaultKind: 'User',\n defaultNamespace: DEFAULT_NAMESPACE,\n });\n return await api.triggerAlarm({\n integrationKey: integrationKey as string,\n source: window.location.toString(),\n description: descriptions,\n userName,\n });\n },\n );\n\n const descriptionChanged = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n setDescription(event.target.value);\n };\n\n useEffect(() => {\n if (value) {\n (async () => {\n alertApi.post({\n message: `Alarm successfully triggered`,\n });\n\n handleDialog();\n\n // The pager duty API isn't always returning the newly created alarm immediately\n await new Promise(resolve => setTimeout(resolve, 1000));\n onIncidentCreated?.();\n })();\n }\n }, [value, alertApi, handleDialog, onIncidentCreated]);\n\n if (error) {\n alertApi.post({\n message: `Failed to trigger alarm. ${error.message}`,\n severity: 'error',\n });\n }\n\n return (\n <Dialog maxWidth=\"md\" open={showDialog} onClose={handleDialog} fullWidth>\n <DialogTitle>\n This action will trigger an incident for <strong>\"{name}\"</strong>.\n </DialogTitle>\n <DialogContent>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n If the issue you are seeing does not need urgent attention, please\n get in touch with the responsible team using their preferred\n communications channel. You can find information about the owner of\n this entity in the \"About\" card. If the issue is urgent, please\n don't hesitate to trigger the alert.\n </Typography>\n </Alert>\n <Typography\n variant=\"body1\"\n style={{ marginTop: '1em' }}\n gutterBottom\n align=\"justify\"\n >\n Please describe the problem you want to report. Be as descriptive as\n possible. Your signed in user and a reference to the current page will\n automatically be amended to the alarm so that the receiver can reach\n out to you if necessary.\n </Typography>\n <TextField\n inputProps={{ 'data-testid': 'trigger-input' }}\n id=\"description\"\n multiline\n fullWidth\n rows=\"4\"\n margin=\"normal\"\n label=\"Problem description\"\n variant=\"outlined\"\n onChange={descriptionChanged}\n />\n </DialogContent>\n <DialogActions>\n <Button\n data-testid=\"trigger-button\"\n id=\"trigger\"\n color=\"secondary\"\n disabled={!description || loading}\n variant=\"contained\"\n onClick={() => handleTriggerAlarm(description)}\n endIcon={loading && <CircularProgress size={16} />}\n >\n Trigger Incident\n </Button>\n <Button id=\"close\" color=\"primary\" onClick={handleDialog}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, useState } from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\nimport { usePagerdutyEntity } from \"../../hooks\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport AddAlert from \"@material-ui/icons/AddAlert\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex !important\",\n fontSize: \"14px\",\n width: \"80px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\"\n }\n}));\n\n/** @public */\nexport function TriggerIncidentButton() {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <IconButton\n aria-label=\"create-incident\"\n onClick={showDialog}\n className={disabled ? \"\" : buttonStyle}\n disabled={disabled}\n >\n <div className={containerStyle}>\n <AddAlert className={iconStyle} />\n <p>Create new incident</p>\n </div>\n </IconButton>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\n// import React, { useCallback, useState } from \"react\";\nimport React from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\n// import { usePagerdutyEntity } from \"../../hooks\";\n// import { TriggerDialog } from \"../TriggerDialog\";\nimport OpenInBrowser from \"@material-ui/icons/OpenInBrowser\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex\",\n fontSize: \"14px\",\n width: \"85px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\",\n },\n}));\n\n/** @public */\nexport function OpenServiceButton(props: { serviceUrl: string}) {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n // const { integrationKey, name } = usePagerdutyEntity();\n // const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n // const hideDialog = useCallback(() => {\n // setDialogShown(false);\n // }, [setDialogShown]);\n\n function navigateToService() {\n window.open(props.serviceUrl, \"_blank\");\n }\n\n return (\n <>\n <IconButton\n aria-label=\"open-service-in-browser\"\n onClick={navigateToService}\n className={buttonStyle}\n >\n <div className={containerStyle}>\n <OpenInBrowser className={iconStyle} />\n <p>Open service in PagerDuty</p>\n </div>\n </IconButton>\n {/* {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )} */}\n </>\n );\n}\n","import { Card, Typography } from \"@material-ui/core\";\nimport React from \"react\";\nimport { Theme, makeStyles } from \"@material-ui/core/styles\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\ntype Props = {\n status: string | undefined;\n};\n\nfunction labelFromStatus(status: string) {\n let label;\n switch (status) {\n case \"active\":\n label = \"OK\";\n break;\n case \"warning\":\n label = \"ACTIVE\";\n break;\n case \"critical\":\n label = \"ALARM\";\n break;\n case \"maintenance\":\n label = \"MAINTENANCE\";\n break;\n case \"disabled\":\n label = \"DISABLED\";\n break;\n default:\n label = \"OK\";\n break;\n }\n\n return label;\n}\n\nfunction colorFromStatus(theme: Theme, status: string) {\n let color;\n switch (status) {\n case \"active\":\n color = theme.palette.success.main;\n break;\n case \"warning\":\n color = theme.palette.warningBackground;\n break;\n case \"critical\":\n color = theme.palette.error.main;\n break;\n case \"maintenance\":\n color = \"#ebdc00\";\n break;\n case \"disabled\":\n color = \"#A9A9A9\";\n break;\n default:\n color = theme.palette.success.main;\n break;\n }\n\n return color;\n}\n\nfunction StatusCard({ status }: Props) {\n const useStyles = makeStyles<BackstageTheme>((theme) => ({\n cardStyle: {\n height: \"120px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor:\n status !== undefined\n ? colorFromStatus(theme, status)\n : colorFromStatus(theme, \"active\"),\n marginRight: \"10px\",\n },\n largeTextStyle: {\n color: \"white\",\n fontWeight: \"bold\",\n fontSize: \"20px\",\n wordWrap: \"break-word\",\n },\n }));\n\n const { cardStyle, largeTextStyle } = useStyles();\n\n return (\n <Card className={cardStyle}>\n {status !== undefined ? (\n <Typography className={largeTextStyle}>\n {labelFromStatus(status!)}\n </Typography>\n ) : (\n <Typography className={largeTextStyle}>Unable to get status</Typography>\n )}\n </Card>\n );\n}\n\nexport default StatusCard;\n","import { BackstageTheme } from \"@backstage/theme\";\nimport {\n Card,\n LinearProgress,\n Theme,\n Typography,\n makeStyles,\n withStyles,\n} from \"@material-ui/core\";\nimport React from \"react\";\n\ntype Props = {\n total: number | undefined;\n completed: number | undefined;\n};\n\nfunction colorFromPercentage(theme: Theme, percentage: number) {\n if (percentage < 0.5) {\n return theme.palette.error.main;\n } else if (percentage < 0.8) {\n return theme.palette.warning.main;\n }\n return theme.palette.success.main;\n}\n\nfunction ServiceStandardsCard({ total, completed }: Props) {\n const useStyles = makeStyles<BackstageTheme>((theme) => ({\n cardStyle: {\n height: \"120px\",\n display: \"grid\",\n gridTemplateRows: \"1fr auto auto\",\n backgroundColor: \"rgba(0, 0, 0, 0.03)\",\n },\n containerStyle: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n largeTextStyle: {\n fontSize: \"50px\",\n color:\n completed !== undefined && total !== undefined\n ? colorFromPercentage(theme, completed / total)\n : colorFromPercentage(theme, 0),\n alignSelf: \"center\",\n justifyContent: \"center\",\n },\n smallTextStyle: {\n color: theme.palette.textSubtle,\n fontSize: \"14px\",\n fontWeight: \"bold\",\n alignSelf: \"center\",\n justifyContent: \"center\",\n marginLeft: \"-2px\",\n marginTop: \"25px\",\n },\n }));\n\n const BorderLinearProgress = withStyles((theme) => ({\n root: {\n height: 10,\n borderRadius: 5,\n margin: 5,\n },\n colorPrimary: {\n backgroundColor:\n theme.palette.grey[theme.palette.type === \"light\" ? 200 : 700],\n },\n bar: {\n borderRadius: 5,\n backgroundColor:\n completed !== undefined && total !== undefined\n ? colorFromPercentage(theme, completed / total)\n : colorFromPercentage(theme, 0),\n },\n }))(LinearProgress);\n\n const { cardStyle, containerStyle, largeTextStyle, smallTextStyle } =\n useStyles();\n return (\n <Card className={cardStyle}>\n {completed !== undefined && total !== undefined ? (\n <>\n <div className={containerStyle}>\n <Typography className={largeTextStyle}>{completed}</Typography>\n <Typography className={smallTextStyle}>/{total}</Typography>\n </div>\n <div>\n <BorderLinearProgress\n variant=\"determinate\"\n value={(completed! / total!) * 100}\n />\n </div>\n </>\n ) : (\n <div className={containerStyle}>\n <Typography className={largeTextStyle}>\n Unable to retrieve Scores\n </Typography>\n </div>\n )}\n </Card>\n );\n}\n\nexport default ServiceStandardsCard;\n","import { BackstageTheme } from \"@backstage/theme\";\nimport { Card, Typography, makeStyles } from \"@material-ui/core\";\nimport React from \"react\";\nimport validateColor from \"validate-color\";\n\ntype Props = {\n count: number;\n label: string;\n color: string;\n};\n\nfunction IncidentCounterCard({ count, label, color }: Props) {\n\n const textColor = color && validateColor(color) ? color : \"black\";\n\n const useStyles = makeStyles<BackstageTheme>(() => ({\n cardStyle: {\n marginRight: \"10px\",\n height: \"120px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"rgba(0, 0, 0, 0.03)\",\n },\n largeTextStyle: {\n color: textColor,\n fontSize: \"40px\",\n marginTop: \"-20px\",\n },\n smallTextStyle: {\n color: textColor,\n fontWeight: \"bold\",\n fontSize: \"10px\",\n marginTop: \"-10px\",\n textTransform: \"uppercase\",\n flexWrap: \"wrap\",\n },\n }));\n\n const { cardStyle, largeTextStyle, smallTextStyle } = useStyles();\n\n return (\n <Card className={cardStyle}>\n <Typography className={largeTextStyle}>{count}</Typography>\n <Typography className={smallTextStyle}>{label}</Typography>\n </Card>\n );\n}\n\nexport default IncidentCounterCard;\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { ReactNode, useCallback, useState } from \"react\";\nimport {\n Card,\n CardHeader,\n Divider,\n CardContent,\n Grid,\n Typography,\n} from \"@material-ui/core\";\nimport { Incidents } from \"../Incident\";\nimport { EscalationPolicy } from \"../Escalation\";\nimport useAsync from \"react-use/lib/useAsync\";\nimport { pagerDutyApiRef, UnauthorizedError } from \"../../api\";\nimport { MissingTokenError, ServiceNotFoundError } from \"../Errors\";\nimport { ChangeEvents } from \"../ChangeEvents\";\nimport PDGreenImage from \"../../assets/PD-Green.svg\";\nimport PDWhiteImage from \"../../assets/PD-White.svg\";\n\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { NotFoundError } from \"@backstage/errors\";\nimport {\n Progress,\n TabbedCard,\n CardTab,\n InfoCard,\n} from \"@backstage/core-components\";\nimport { PagerDutyEntity } from \"../../types\";\nimport { ForbiddenError } from \"../Errors/ForbiddenError\";\nimport { TriggerIncidentButton } from \"./TriggerIncidentButton\";\nimport { OpenServiceButton } from \"./OpenServiceButton\";\nimport { createStyles, makeStyles, useTheme } from \"@material-ui/core/styles\";\nimport StatusCard from \"./StatusCard\";\nimport ServiceStandardsCard from \"./ServiceStandardsCard\";\nimport { BackstageTheme } from \"@backstage/theme\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport { PagerDutyCardServiceResponse } from \"../../api/types\";\nimport InsightsCard from \"./InsightsCard\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) =>\n createStyles({\n overviewHeaderTextStyle: {\n fontSize: \"14px\",\n fontWeight: 500,\n color:\n theme.palette.type === \"light\"\n ? \"rgba(0, 0, 0, 0.54)\"\n : \"rgba(255, 255, 255, 0.7)\",\n },\n headerStyle: {\n marginRight: \"1em\",\n },\n overviewHeaderContainerStyle: {\n display: \"flex\",\n margin: \"15px\",\n marginBottom: \"20px\",\n },\n overviewCardsContainerStyle: {\n display: \"flex\",\n margin: \"15px\",\n marginTop: \"-15px\",\n },\n incidentMetricsContainerStyle: {\n display: \"flex\",\n height: \"100%\",\n justifyContent: \"center\",\n columnSpan: \"all\",\n },\n })\n);\n\nconst BasicCard = ({ children }: { children: ReactNode }) => (\n <InfoCard title=\"PagerDuty\">{children}</InfoCard>\n);\n\n/** @public */\nexport type PagerDutyCardProps = PagerDutyEntity & {\n readOnly?: boolean;\n disableChangeEvents?: boolean;\n};\n\n/** @public */\nexport const PagerDutyCard = (props: PagerDutyCardProps) => {\n const classes = useStyles();\n\n const theme = useTheme();\n const { readOnly, disableChangeEvents, integrationKey, name } = props;\n const api = useApi(pagerDutyApiRef);\n const [refreshIncidents, setRefreshIncidents] = useState<boolean>(false);\n const [refreshChangeEvents, setRefreshChangeEvents] =\n useState<boolean>(false);\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const handleRefresh = useCallback(() => {\n setRefreshIncidents((x) => !x);\n setRefreshChangeEvents((x) => !x);\n }, []);\n\n const {\n value: service,\n loading,\n error,\n } = useAsync(async () => {\n const { service: foundService } = await api.getServiceByPagerDutyEntity(\n props\n );\n\n const { standards: serviceStandards } = await api.getServiceStandardsByServiceId(foundService.id);\n\n const result: PagerDutyCardServiceResponse = {\n id: foundService.id,\n name: foundService.name,\n url: foundService.html_url,\n policyId: foundService.escalation_policy.id,\n policyLink: foundService.escalation_policy.html_url as string,\n policyName: foundService.escalation_policy.name,\n status: foundService.status,\n standardsScore: serviceStandards.score,\n }\n\n return result;\n }, [props]);\n\n if (error) {\n let errorNode: ReactNode;\n\n switch (error.constructor) {\n case UnauthorizedError:\n errorNode = <MissingTokenError />;\n break;\n case NotFoundError:\n errorNode = <ServiceNotFoundError />;\n break;\n default:\n errorNode = <ForbiddenError />;\n }\n\n return <BasicCard>{errorNode}</BasicCard>;\n }\n\n if (loading) {\n return (\n <BasicCard>\n <Progress />\n </BasicCard>\n );\n }\n\n /**\n * In order to create incidents using the REST API, a valid user email address must be present.\n * There is no guarantee the current user entity has a valid email association, so instead just\n * only allow triggering incidents when an integration key is present.\n */\n const createIncidentDisabled = !integrationKey;\n\n return (\n <>\n <Card data-testid=\"pagerduty-card\">\n <CardHeader\n className={classes.headerStyle}\n title={\n theme.palette.type === \"dark\" ? (\n <img src={PDWhiteImage} alt=\"PagerDuty\" height=\"35\" />\n ) : (\n <img src={PDGreenImage} alt=\"PagerDuty\" height=\"35\" />\n )\n }\n action={\n !readOnly ? (\n <div>\n <TriggerIncidentButton />\n <OpenServiceButton serviceUrl={service!.url} />\n </div>\n ) : (\n <OpenServiceButton serviceUrl={service!.url} />\n )\n }\n />\n <Grid item md={12} className={classes.overviewHeaderContainerStyle}>\n <Grid item md={3}>\n <Typography className={classes.overviewHeaderTextStyle}>\n STATUS\n </Typography>\n </Grid>\n <Grid item md={6}>\n <Typography className={classes.overviewHeaderTextStyle}>\n INSIGHTS\n </Typography>\n </Grid>\n <Grid item md={3}>\n <Typography className={classes.overviewHeaderTextStyle}>\n STANDARDS\n </Typography>\n </Grid>\n </Grid>\n <Grid item md={12} className={classes.overviewCardsContainerStyle}>\n <Grid item md={3}>\n <StatusCard status={service?.status} />\n </Grid>\n <Grid item md={6} className={classes.incidentMetricsContainerStyle}>\n <Grid md={4}>\n <InsightsCard\n count={29}\n label=\"interruptions\"\n color={theme.palette.textSubtle}\n />\n </Grid>\n <Grid md={4}>\n <InsightsCard\n count={29}\n label=\"high urgency\"\n color={theme.palette.warning.main}\n />\n </Grid>\n <Grid md={4}>\n <InsightsCard\n count={32}\n label=\"incidents\"\n color={theme.palette.error.main}\n />\n </Grid>\n </Grid>\n <Grid item md={3}>\n <ServiceStandardsCard\n total={service?.standardsScore?.total}\n completed={service?.standardsScore?.passing}\n />\n </Grid>\n </Grid>\n\n <Divider />\n <CardContent>\n <TabbedCard>\n <CardTab label=\"Incidents\">\n <Incidents\n serviceId={service!.id}\n refreshIncidents={refreshIncidents}\n />\n </CardTab>\n {disableChangeEvents !== true ? (\n <CardTab label=\"Change Events\">\n <ChangeEvents\n serviceId={service!.id}\n refreshEvents={refreshChangeEvents}\n />\n </CardTab>\n ) : (\n <></>\n )}\n </TabbedCard>\n <EscalationPolicy\n policyId={service!.policyId}\n policyUrl={service!.policyLink}\n policyName={service!.policyName}\n />\n </CardContent>\n </Card>\n {!createIncidentDisabled && (\n <TriggerDialog\n data-testid=\"trigger-dialog\"\n showDialog={dialogShown}\n handleDialog={hideDialog}\n onIncidentCreated={handleRefresh}\n name={name}\n integrationKey={integrationKey}\n />\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from '../constants';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getPagerDutyEntity } from '../pagerDutyEntity';\nimport { PagerDutyCard } from '../PagerDutyCard';\n\n/** @public */\nexport const isPluginApplicableToEntity = (entity: Entity) =>\n Boolean(\n entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] ||\n entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID],\n );\n\n/** @public */\nexport type EntityPagerDutyCardProps = {\n readOnly?: boolean;\n disableChangeEvents?: boolean;\n};\n\n/** @public */\nexport const EntityPagerDutyCard = (props: EntityPagerDutyCardProps) => {\n const { readOnly, disableChangeEvents } = props;\n const { entity } = useEntity();\n const pagerDutyEntity = getPagerDutyEntity(entity);\n return (\n <PagerDutyCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableChangeEvents={disableChangeEvents}\n />\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, ReactNode, useState } from 'react';\nimport { makeStyles, Button } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\n\nimport { usePagerdutyEntity } from '../../hooks';\nimport { TriggerDialog } from '../TriggerDialog';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n buttonStyle: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText,\n '&:hover': {\n backgroundColor: theme.palette.error.dark,\n },\n },\n}));\n\n/** @public */\nexport function TriggerButton(props: { children?: ReactNode }) {\n const { buttonStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <Button\n onClick={showDialog}\n variant=\"contained\"\n className={disabled ? '' : buttonStyle}\n disabled={disabled}\n >\n {integrationKey\n ? props.children ?? 'Create new incident'\n : 'Missing integration key'}\n </Button>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EntityPagerDutyCardProps, EntityPagerDutyCard } from './components';\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCard\n */\nexport const PagerDutyCard = EntityPagerDutyCard;\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCardProps\n */\nexport type PagerDutyCardProps = EntityPagerDutyCardProps;\n"],"names":["ForbiddenError","EntityPagerDutyCard","useStyles","OpenInBrowser","makeStyles","PagerDutyCard","InsightsCard"],"mappings":";;;;;;;;;;;;;;;;;;;;;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,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,WAAA;AAAA,MACZ,YAAc,EAAA,UAAA;AAAA,MACd,cAAA;AAAA,MACA,IAAA;AAAA,KAAA;AAAA,GAGN,CAAA,CAAA;AAEJ;;AChDO,MAAM,aAAgB,GAAA;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import React__default, { ReactNode } from 'react';
|
|
|
5
5
|
import { Entity } from '@backstage/catalog-model';
|
|
6
6
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
7
7
|
import { DiscoveryApi, FetchApi, ConfigApi } from '@backstage/core-plugin-api';
|
|
8
|
-
import { PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyUser } from '@pagerduty/backstage-plugin-common';
|
|
8
|
+
import { PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyServiceStandardsResponse, PagerDutyUser } from '@pagerduty/backstage-plugin-common';
|
|
9
9
|
|
|
10
10
|
/** @public */
|
|
11
11
|
declare const isPluginApplicableToEntity: (entity: Entity) => boolean;
|
|
@@ -68,6 +68,11 @@ interface PagerDutyApi {
|
|
|
68
68
|
*
|
|
69
69
|
*/
|
|
70
70
|
getChangeEventsByServiceId(serviceId: string): Promise<PagerDutyChangeEventsResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Fetches a list of standards for a provided service.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
getServiceStandardsByServiceId(serviceId: string): Promise<PagerDutyServiceStandardsResponse>;
|
|
71
76
|
/**
|
|
72
77
|
* Fetches the list of users in an escalation policy.
|
|
73
78
|
*
|
|
@@ -102,6 +107,7 @@ declare class PagerDutyClient implements PagerDutyApi {
|
|
|
102
107
|
getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse>;
|
|
103
108
|
getIncidentsByServiceId(serviceId: string): Promise<PagerDutyIncidentsResponse>;
|
|
104
109
|
getChangeEventsByServiceId(serviceId: string): Promise<PagerDutyChangeEventsResponse>;
|
|
110
|
+
getServiceStandardsByServiceId(serviceId: string): Promise<PagerDutyServiceStandardsResponse>;
|
|
105
111
|
getOnCallByPolicyId(policyId: string): Promise<PagerDutyUser[]>;
|
|
106
112
|
triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
|
|
107
113
|
private findByUrl;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
export { E as EntityPagerDutyCard, H as HomePagePagerDutyCard, c as PagerDutyCard, a as PagerDutyClient, T as TriggerButton, U as UnauthorizedError, i as isPagerDutyAvailable, i as isPluginApplicableToEntity, b as pagerDutyApiRef, p as pagerDutyPlugin, p as plugin } from './esm/index-
|
|
1
|
+
export { E as EntityPagerDutyCard, H as HomePagePagerDutyCard, c as PagerDutyCard, a as PagerDutyClient, T as TriggerButton, U as UnauthorizedError, i as isPagerDutyAvailable, i as isPluginApplicableToEntity, b as pagerDutyApiRef, p as pagerDutyPlugin, p as plugin } from './esm/index-76653f8d.esm.js';
|
|
2
2
|
import '@backstage/core-plugin-api';
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import '@backstage/plugin-home-react';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '@backstage/plugin-catalog-react';
|
|
7
7
|
import '@material-ui/core';
|
|
8
|
-
import '@material-ui/icons/Done';
|
|
9
|
-
import '@material-ui/icons/Warning';
|
|
10
8
|
import 'luxon';
|
|
11
9
|
import '@material-ui/icons/OpenInBrowser';
|
|
12
10
|
import '@backstage/core-components';
|
|
@@ -18,9 +16,11 @@ import '@material-ui/core/Avatar';
|
|
|
18
16
|
import '@material-ui/icons/Notifications';
|
|
19
17
|
import '@material-ui/icons/MailOutline';
|
|
20
18
|
import 'react-use/lib/useAsync';
|
|
19
|
+
import '@material-ui/icons/Link';
|
|
21
20
|
import './assets/PD-Green.svg';
|
|
22
21
|
import './assets/PD-White.svg';
|
|
23
22
|
import '@backstage/catalog-model';
|
|
24
23
|
import '@material-ui/icons/AddAlert';
|
|
25
24
|
import '@material-ui/core/styles';
|
|
25
|
+
import 'validate-color';
|
|
26
26
|
//# sourceMappingURL=index.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagerduty/backstage-plugin",
|
|
3
3
|
"description": "A Backstage plugin that integrates towards PagerDuty",
|
|
4
|
-
"version": "0.9.4-next.
|
|
4
|
+
"version": "0.9.4-next.5",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
46
46
|
"classnames": "^2.2.6",
|
|
47
47
|
"luxon": "^3.4.1",
|
|
48
|
-
"react-use": "^17.2.4"
|
|
48
|
+
"react-use": "^17.2.4",
|
|
49
|
+
"validate-color": "^2.2.4"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@pagerduty/backstage-plugin-common": "^0.1.0",
|
|
52
|
+
"@pagerduty/backstage-plugin-common": "^0.1.2-next.0",
|
|
52
53
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
53
54
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
54
55
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"@backstage/test-utils": "^1.4.5",
|
|
61
62
|
"@commitlint/cli": "^17.7.1",
|
|
62
63
|
"@commitlint/config-conventional": "^17.7.0",
|
|
63
|
-
"@pagerduty/backstage-plugin-common": "^0.1.0",
|
|
64
|
+
"@pagerduty/backstage-plugin-common": "^0.1.2-next.0",
|
|
64
65
|
"@testing-library/dom": "^8.0.0",
|
|
65
66
|
"@testing-library/jest-dom": "^5.10.1",
|
|
66
67
|
"@testing-library/react": "^12.1.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-d288bb3d.esm.js","sources":["../../src/components/constants.ts","../../src/components/pagerDutyEntity.ts","../../src/api/client.ts","../../src/plugin.ts","../../src/components/Incident/IncidentListItem.tsx","../../src/components/Incident/IncidentEmptyState.tsx","../../src/components/Incident/IncidentForbiddenState.tsx","../../src/components/Incident/Incidents.tsx","../../src/components/Escalation/EscalationUsersEmptyState.tsx","../../src/components/Escalation/EscalationUsersForbiddenState.tsx","../../src/components/Escalation/EscalationUser.tsx","../../src/components/Escalation/EscalationPolicy.tsx","../../src/components/Errors/MissingTokenError.tsx","../../src/components/Errors/ServiceNotFoundError.tsx","../../src/components/ChangeEvents/ChangeEventListItem.tsx","../../src/components/ChangeEvents/ChangeEventEmptyState.tsx","../../src/components/ChangeEvents/ChangeEventForbiddenState.tsx","../../src/components/ChangeEvents/ChangeEvents.tsx","../../src/components/Errors/ForbiddenError.tsx","../../src/hooks/index.ts","../../src/components/TriggerDialog/TriggerDialog.tsx","../../src/components/PagerDutyCard/TriggerIncidentButton.tsx","../../src/components/PagerDutyCard/OpenServiceButton.tsx","../../src/components/PagerDutyCard/StatusCard.tsx","../../src/components/PagerDutyCard/IncidentCounterCard.tsx","../../src/components/PagerDutyCard/ServiceStandardsCard.tsx","../../src/components/PagerDutyCard/index.tsx","../../src/components/EntityPagerDutyCard/index.tsx","../../src/components/TriggerButton/index.tsx","../../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const PAGERDUTY_INTEGRATION_KEY = 'pagerduty.com/integration-key';\nexport const PAGERDUTY_SERVICE_ID = 'pagerduty.com/service-id';\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { PagerDutyEntity } from '../types';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from './constants';\n\nexport function getPagerDutyEntity(entity: Entity): PagerDutyEntity {\n const {\n [PAGERDUTY_INTEGRATION_KEY]: integrationKey,\n [PAGERDUTY_SERVICE_ID]: serviceId,\n } = entity.metadata.annotations || ({} as Record<string, string>);\n const name = entity.metadata.name;\n\n return { integrationKey, serviceId, name };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n PagerDutyApi,\n PagerDutyTriggerAlarmRequest,\n PagerDutyClientApiDependencies,\n PagerDutyClientApiConfig,\n RequestOptions,\n} from './types';\nimport { PagerDutyChangeEventsResponse, \n PagerDutyOnCallUsersResponse, \n PagerDutyUser, \n PagerDutyServiceResponse,\n PagerDutyIncidentsResponse \n} from '@pagerduty/backstage-plugin-common';\nimport { createApiRef, ConfigApi } from '@backstage/core-plugin-api';\nimport { NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\nimport { PagerDutyEntity } from '../types';\n\n/** @public */\nexport class UnauthorizedError extends Error {}\n\n/** @public */\nexport class ForbiddenError extends Error { }\n\n/** @public */\nexport const pagerDutyApiRef = createApiRef<PagerDutyApi>({\n id: 'plugin.pagerduty.api',\n});\n\n/** @public */\nexport class PagerDutyClient implements PagerDutyApi {\n static fromConfig(\n configApi: ConfigApi,\n dependencies: PagerDutyClientApiDependencies,\n ) {\n const { discoveryApi, fetchApi } = dependencies;\n\n const eventsBaseUrl: string =\n configApi.getOptionalString('pagerDuty.eventsBaseUrl') ??\n 'https://events.pagerduty.com/v2';\n\n return new PagerDutyClient({\n eventsBaseUrl,\n discoveryApi,\n fetchApi,\n });\n }\n\n constructor(private readonly config: PagerDutyClientApiConfig) {}\n\n async getServiceByPagerDutyEntity(\n pagerDutyEntity: PagerDutyEntity,\n ): Promise<PagerDutyServiceResponse> {\n const { integrationKey, serviceId } = pagerDutyEntity;\n\n let response: PagerDutyServiceResponse;\n let url: string;\n\n if (integrationKey) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services?integration_key=${integrationKey}`;\n const serviceResponse = await this.findByUrl<PagerDutyServiceResponse>(url);\n\n if (serviceResponse.service === undefined) throw new NotFoundError();\n\n response = serviceResponse;\n } else if (serviceId) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}`;\n\n response = await this.findByUrl<PagerDutyServiceResponse>(url);\n } else {\n throw new NotFoundError();\n }\n\n return response;\n }\n\n async getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse> {\n return await this.getServiceByPagerDutyEntity(getPagerDutyEntity(entity));\n }\n async getIncidentsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyIncidentsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/incidents`;\n\n return await this.findByUrl<PagerDutyIncidentsResponse>(url);\n }\n\n async getChangeEventsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyChangeEventsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/change-events`;\n\n return await this.findByUrl<PagerDutyChangeEventsResponse>(url);\n }\n\n async getOnCallByPolicyId(\n policyId: string,\n ): Promise<PagerDutyUser[]> {\n const params = `escalation_policy_ids[]=${policyId}`;\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/oncall-users?${params}`;\n\n const response: PagerDutyOnCallUsersResponse = await this.findByUrl<PagerDutyOnCallUsersResponse>(url);\n return response.users;\n }\n\n triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response> {\n const { integrationKey, source, description, userName } = request;\n\n const body = JSON.stringify({\n event_action: 'trigger',\n routing_key: integrationKey,\n client: 'Backstage',\n client_url: source,\n payload: {\n summary: description,\n source: source,\n severity: 'error',\n class: 'manual trigger',\n custom_details: {\n user: userName,\n },\n },\n });\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8',\n Accept: 'application/json, text/plain, */*',\n },\n body,\n };\n\n const url = this.config.eventsBaseUrl ?? 'https://events.pagerduty.com/v2';\n\n return this.request(`${url}/enqueue`, options);\n }\n\n private async findByUrl<T>(url: string): Promise<T> {\n const options = {\n method: 'GET',\n headers: {\n Accept: 'application/vnd.pagerduty+json;version=2',\n 'Content-Type': 'application/json',\n },\n };\n const response = await this.request(url, options);\n return response.json();\n }\n\n private async request(\n url: string,\n options: RequestOptions,\n ): Promise<Response> {\n const response = await this.config.fetchApi.fetch(url, options);\n if (response.status === 401) {\n throw new UnauthorizedError(\"Unauthorized: You don't have access to this resource\");\n }\n\n if (response.status === 403) {\n throw new ForbiddenError(\"Forbidden: You are not allowed to perform this action\");\n }\n\n if (response.status === 404) {\n throw new NotFoundError(\"Not Found: Resource not found\");\n }\n\n if (!response.ok) {\n const payload = await response.json();\n const errors = payload.errors.map((error: string) => error).join(' ');\n const message = `Request failed with ${response.status}, ${errors}`;\n throw new Error(message);\n }\n return response;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pagerDutyApiRef, PagerDutyClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n configApiRef,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\nimport { createCardExtension } from '@backstage/plugin-home-react';\nimport { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';\n\nexport const rootRouteRef = createRouteRef({\n id: 'pagerduty',\n});\n\n/** @public */\nexport const pagerDutyPlugin = createPlugin({\n id: 'pagerduty',\n apis: [\n createApiFactory({\n api: pagerDutyApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const EntityPagerDutyCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutyCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutyCard').then(\n m => m.EntityPagerDutyCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const HomePagePagerDutyCard = pagerDutyPlugin.provide(\n createCardExtension<HomePagePagerDutyCardProps>({\n name: 'HomePagePagerDutyCard',\n title: 'PagerDuty Homepage Card',\n components: () => import('./components/HomePagePagerDutyCard'),\n settings: {\n schema: {\n title: 'PagerDuty',\n type: 'object',\n properties: {\n integrationKey: {\n title: 'PagerDuty integration key',\n type: 'string',\n },\n serviceId: {\n title: 'PagerDuty service id',\n type: 'string',\n },\n name: {\n title: 'PagerDuty service name',\n type: 'string',\n },\n },\n },\n },\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n Chip,\n} from '@material-ui/core';\nimport Done from '@material-ui/icons/Done';\nimport Warning from '@material-ui/icons/Warning';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyIncident } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n warning: {\n borderColor: theme.palette.status.warning,\n color: theme.palette.status.warning,\n '& *': {\n color: theme.palette.status.warning,\n },\n },\n error: {\n borderColor: theme.palette.status.error,\n color: theme.palette.status.error,\n '& *': {\n color: theme.palette.status.error,\n },\n },\n}));\n\ntype Props = {\n incident: PagerDutyIncident;\n};\n\nexport const IncidentListItem = ({ incident }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(incident.created_at).getTime();\n const createdAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n const user = incident.assignments[0]?.assignee;\n\n return (\n <ListItem dense key={incident.id}>\n <ListItemText\n primary={\n <>\n <Chip\n data-testid={`chip-${incident.status}`}\n label={incident.status}\n size=\"small\"\n variant=\"outlined\"\n icon={incident.status === 'acknowledged' ? <Done /> : <Warning />}\n className={\n incident.status === 'triggered'\n ? classes.error\n : classes.warning\n }\n />\n {incident.title}\n </>\n }\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography noWrap variant=\"body2\" color=\"textSecondary\">\n Created {createdAt} and assigned to{' '}\n <Link to={user?.html_url ?? '#'}>{user?.summary ?? 'nobody'}</Link>\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={incident.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from \"../../assets/emptystate.svg\";\n\nexport const IncidentsEmptyState = () => {\n return (\n <Grid\n container\n justifyContent=\"center\"\n direction=\"column\"\n alignItems=\"center\"\n >\n <Grid item xs={12}>\n <Typography variant=\"h5\">Nice! No incidents found!</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const IncidentForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { IncidentListItem } from './IncidentListItem';\nimport { IncidentsEmptyState } from './IncidentEmptyState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { IncidentForbiddenState } from './IncidentForbiddenState';\n\ntype Props = {\n serviceId: string;\n refreshIncidents: boolean;\n};\n\nexport const Incidents = ({ serviceId, refreshIncidents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: incidents, loading, error }, getIncidents] = useAsyncFn(\n async () => {\n const { incidents: foundIncidents } = await api.getIncidentsByServiceId(\n serviceId,\n );\n return foundIncidents;\n },\n );\n\n useEffect(() => {\n getIncidents();\n }, [refreshIncidents, getIncidents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <IncidentForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!incidents?.length) {\n return <IncidentsEmptyState />;\n }\n\n return (\n <List dense>\n {incidents!.map((incident, index) => (\n <IncidentListItem key={incident.id + index} incident={incident} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusWarning } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersEmptyState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusWarning />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"No one is on-call. Update the escalation policy.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusError } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersForbiddenState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusError />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"You don't permissions to list on-calls. Check your OAuth token permissions.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport Avatar from '@material-ui/core/Avatar';\nimport { PagerDutyUser } from '@pagerduty/backstage-plugin-common';\nimport NotificationsIcon from \"@material-ui/icons/Notifications\";\nimport { BackstageTheme } from '@backstage/theme';\nimport MailOutline from '@material-ui/icons/MailOutline';\nimport OpenInBrowser from '@material-ui/icons/OpenInBrowser';\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n listItemPrimary: {\n fontWeight: \"bold\",\n },\n listItemSecondary: {\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n marginTop: \"-5px\",\n },\n buttonStyle: {\n marginLeft: \"-11px\",\n marginTop: \"-10px\",\n fontSize: \"15px\",\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n display: \"flex\",\n alignItems: \"center\",\n fontWeight: \"bold\",\n },\n iconStyle: {\n fontSize: \"25px\",\n marginLeft: \"-4px\",\n color: theme.palette.text.primary,\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n }\n}));\n\ntype Props = {\n user: PagerDutyUser;\n};\n\nexport const EscalationUser = ({ user }: Props) => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemIcon>\n <Avatar alt={user.name} src={user.avatar_url} />\n </ListItemIcon>\n <ListItemText\n primary={\n <>\n <Typography className={classes.listItemPrimary}>\n {user.name}\n </Typography>\n <Typography\n className={classes.listItemSecondary}\n color=\"textSecondary\"\n >\n {user.email}\n </Typography>\n </>\n }\n secondary={\n <IconButton\n aria-label=\"open-service-in-browser\"\n // onClick={navigateToService}\n className={classes.buttonStyle}\n >\n <span className={classes.containerStyle}>\n <NotificationsIcon className={classes.iconStyle} />\n Web Team\n </span>\n </IconButton>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"Send e-mail to user\" placement=\"top\">\n <IconButton href={`mailto:${user.email}`}>\n <MailOutline className={classes.smallIconStyle} />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={user.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={classes.smallIconStyle}\n >\n <OpenInBrowser />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { List, ListSubheader } from '@material-ui/core';\nimport { EscalationUsersEmptyState } from './EscalationUsersEmptyState';\nimport { EscalationUsersForbiddenState } from './EscalationUsersForbiddenState';\nimport { EscalationUser } from './EscalationUser';\nimport useAsync from 'react-use/lib/useAsync';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\n\ntype Props = {\n policyId: string;\n};\n\nexport const EscalationPolicy = ({ policyId }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const {\n value: users,\n loading,\n error,\n } = useAsync(async () => {\n return await api.getOnCallByPolicyId(policyId);\n });\n\n if (error) {\n if (error.message.includes(\"Forbidden\")) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <EscalationUsersForbiddenState />\n </List>\n );\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!users?.length) {\n return <EscalationUsersEmptyState />;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>} style={{marginLeft: \"-15px\"}}>\n {users!.map((user, index) => (\n <EscalationUser key={index} user={user} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const MissingTokenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Missing or invalid PagerDuty Token\"\n description=\"The request to fetch data needs a valid token. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ServiceNotFoundError = () => (\n <EmptyState\n missing=\"data\"\n title=\"PagerDuty Service Not Found\"\n description=\"A service could not be found within PagerDuty based on the provided service id. Please verify your configuration.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyChangeEvent } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n});\n\ntype Props = {\n changeEvent: PagerDutyChangeEvent;\n};\n\nexport const ChangeEventListItem = ({ changeEvent }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(changeEvent.timestamp).getTime();\n const changedAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n let externalLinkElem: JSX.Element | undefined;\n if (changeEvent.links.length > 0) {\n const text: string = changeEvent.links[0].text;\n externalLinkElem = (\n <Tooltip title={text} placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.links[0].href}\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n );\n }\n\n return (\n <ListItem dense key={changeEvent.id}>\n <ListItemText\n primary={<>{changeEvent.summary}</>}\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography variant=\"body2\" color=\"textSecondary\">\n Triggered from {changeEvent.source} {changedAt}.\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n {externalLinkElem}\n {changeEvent.html_url === undefined ? null : (\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.html_url}\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n )}\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from '../../assets/emptystate.svg';\n\nexport const ChangeEventEmptyState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">No change events to display yet.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const ChangeEventForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { ChangeEventListItem } from './ChangeEventListItem';\nimport { ChangeEventEmptyState } from './ChangeEventEmptyState';\nimport { ChangeEventForbiddenState } from './ChangeEventForbiddenState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { Alert } from '@material-ui/lab';\n\ntype Props = {\n serviceId: string;\n refreshEvents: boolean;\n};\n\nexport const ChangeEvents = ({ serviceId, refreshEvents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(\n async () => {\n const { change_events } = await api.getChangeEventsByServiceId(serviceId);\n return change_events;\n },\n );\n\n useEffect(() => {\n getChangeEvents();\n }, [refreshEvents, getChangeEvents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <ChangeEventForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!changeEvents?.length) {\n return <ChangeEventEmptyState />;\n }\n\n return (\n <List dense>\n {changeEvents!.map((changeEvent, index) => (\n <ChangeEventListItem\n key={changeEvent.id + index}\n changeEvent={changeEvent}\n />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ForbiddenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Unauthorized\"\n description=\"You don't have the required permissions to perform this action. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { PagerDutyEntity } from '../types';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\n\nexport function usePagerdutyEntity(): PagerDutyEntity {\n const { entity } = useEntity();\n\n return getPagerDutyEntity(entity);\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useState, useEffect } from 'react';\nimport {\n Dialog,\n DialogTitle,\n TextField,\n DialogActions,\n Button,\n DialogContent,\n Typography,\n CircularProgress,\n} from '@material-ui/core';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\nimport {\n useApi,\n alertApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { DEFAULT_NAMESPACE, parseEntityRef } from '@backstage/catalog-model';\n\ntype Props = {\n showDialog: boolean;\n handleDialog: () => void;\n onIncidentCreated?: () => void;\n name: string;\n integrationKey: string;\n};\n\nexport const TriggerDialog = ({\n showDialog,\n handleDialog,\n onIncidentCreated: onIncidentCreated,\n name,\n integrationKey,\n}: Props) => {\n const alertApi = useApi(alertApiRef);\n const identityApi = useApi(identityApiRef);\n const api = useApi(pagerDutyApiRef);\n const [description, setDescription] = useState<string>('');\n\n const [{ value, loading, error }, handleTriggerAlarm] = useAsyncFn(\n async (descriptions: string) => {\n const { userEntityRef } = await identityApi.getBackstageIdentity();\n const { name: userName } = parseEntityRef(userEntityRef, {\n defaultKind: 'User',\n defaultNamespace: DEFAULT_NAMESPACE,\n });\n return await api.triggerAlarm({\n integrationKey: integrationKey as string,\n source: window.location.toString(),\n description: descriptions,\n userName,\n });\n },\n );\n\n const descriptionChanged = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n setDescription(event.target.value);\n };\n\n useEffect(() => {\n if (value) {\n (async () => {\n alertApi.post({\n message: `Alarm successfully triggered`,\n });\n\n handleDialog();\n\n // The pager duty API isn't always returning the newly created alarm immediately\n await new Promise(resolve => setTimeout(resolve, 1000));\n onIncidentCreated?.();\n })();\n }\n }, [value, alertApi, handleDialog, onIncidentCreated]);\n\n if (error) {\n alertApi.post({\n message: `Failed to trigger alarm. ${error.message}`,\n severity: 'error',\n });\n }\n\n return (\n <Dialog maxWidth=\"md\" open={showDialog} onClose={handleDialog} fullWidth>\n <DialogTitle>\n This action will trigger an incident for <strong>\"{name}\"</strong>.\n </DialogTitle>\n <DialogContent>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n If the issue you are seeing does not need urgent attention, please\n get in touch with the responsible team using their preferred\n communications channel. You can find information about the owner of\n this entity in the \"About\" card. If the issue is urgent, please\n don't hesitate to trigger the alert.\n </Typography>\n </Alert>\n <Typography\n variant=\"body1\"\n style={{ marginTop: '1em' }}\n gutterBottom\n align=\"justify\"\n >\n Please describe the problem you want to report. Be as descriptive as\n possible. Your signed in user and a reference to the current page will\n automatically be amended to the alarm so that the receiver can reach\n out to you if necessary.\n </Typography>\n <TextField\n inputProps={{ 'data-testid': 'trigger-input' }}\n id=\"description\"\n multiline\n fullWidth\n rows=\"4\"\n margin=\"normal\"\n label=\"Problem description\"\n variant=\"outlined\"\n onChange={descriptionChanged}\n />\n </DialogContent>\n <DialogActions>\n <Button\n data-testid=\"trigger-button\"\n id=\"trigger\"\n color=\"secondary\"\n disabled={!description || loading}\n variant=\"contained\"\n onClick={() => handleTriggerAlarm(description)}\n endIcon={loading && <CircularProgress size={16} />}\n >\n Trigger Incident\n </Button>\n <Button id=\"close\" color=\"primary\" onClick={handleDialog}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, useState } from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\nimport { usePagerdutyEntity } from \"../../hooks\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport AddAlert from \"@material-ui/icons/AddAlert\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex !important\",\n fontSize: \"14px\",\n width: \"80px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\"\n }\n}));\n\n/** @public */\nexport function TriggerIncidentButton() {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <IconButton\n aria-label=\"create-incident\"\n onClick={showDialog}\n className={disabled ? \"\" : buttonStyle}\n disabled={disabled}\n >\n <div className={containerStyle}>\n <AddAlert className={iconStyle} />\n <p>Create new incident</p>\n </div>\n </IconButton>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\n// import React, { useCallback, useState } from \"react\";\nimport React from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\n// import { usePagerdutyEntity } from \"../../hooks\";\n// import { TriggerDialog } from \"../TriggerDialog\";\nimport OpenInBrowser from \"@material-ui/icons/OpenInBrowser\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex\",\n fontSize: \"14px\",\n width: \"85px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\",\n },\n}));\n\n/** @public */\nexport function OpenServiceButton(props: { serviceUrl: string}) {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n // const { integrationKey, name } = usePagerdutyEntity();\n // const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n // const hideDialog = useCallback(() => {\n // setDialogShown(false);\n // }, [setDialogShown]);\n\n function navigateToService() {\n window.open(props.serviceUrl, \"_blank\");\n }\n\n return (\n <>\n <IconButton\n aria-label=\"open-service-in-browser\"\n onClick={navigateToService}\n className={buttonStyle}\n >\n <div className={containerStyle}>\n <OpenInBrowser className={iconStyle} />\n <p>Open service in PagerDuty</p>\n </div>\n </IconButton>\n {/* {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )} */}\n </>\n );\n}\n","import { Card, Typography } from \"@material-ui/core\";\nimport React from \"react\";\nimport { Theme, makeStyles } from \"@material-ui/core/styles\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\ntype status = \"active\" | \"warning\" | \"critical\" | \"maintenance\" | \"disabled\";\n\n// array of status mapping to labels\nconst statusLabels = {\n active: \"OK\",\n warning: \"ACTIVE\",\n critical: \"ALARM\",\n maintenance: \"MAINTENANCE\",\n disabled: \"DISABLED\",\n};\n\ntype Props = {\n status: status;\n};\n\nfunction colorFromStatus(theme: Theme, status: status) {\n const statusColors = {\n active: theme.palette.success.main,\n warning: theme.palette.warning.main,\n critical: theme.palette.error.main,\n maintenance: \"#ebdc00\",\n disabled: \"#A9A9A9\",\n };\n return statusColors[status];\n }\n\nfunction StatusCard({ status }: Props) {\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n cardStyle: {\n height: \"120px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: colorFromStatus(theme, status),\n marginRight: \"10px\",\n },\n largeTextStyle: {\n color: \"white\",\n fontWeight: \"bold\",\n fontSize: \"20px\",\n },\n}));\n\n const { cardStyle, largeTextStyle } = useStyles();\n\n return (\n <Card className={cardStyle}>\n <Typography className={largeTextStyle}>{statusLabels[status]}</Typography>\n </Card>\n );\n}\n\nexport default StatusCard;\n","import { BackstageTheme } from \"@backstage/theme\";\nimport { Card, Typography, makeStyles } from \"@material-ui/core\";\nimport React from \"react\";\n\ntype cardLabel = \"triggered\" | \"acknowledged\" | \"resolved\";\n\nconst cardLabels = {\n triggered: \"TRIGGERED\",\n acknowledged: \"ACKNOWLEDGED\",\n resolved: \"RESOLVED\",\n};\n\ntype Props = {\n count: number;\n label: cardLabel;\n};\n\nfunction colorFromLabel(theme: BackstageTheme, label: cardLabel) {\n const cardColors = {\n triggered: theme.palette.error.main,\n acknowledged: theme.palette.warning.main,\n resolved: theme.palette.success.main,\n };\n\n return cardColors[label];\n}\n\nfunction IncidentCounterCard({ count, label }: Props) {\n\n const useStyles = makeStyles<BackstageTheme>((theme) => ({\n cardStyle: {\n marginRight: \"10px\",\n height: \"120px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n backgroundColor: \"rgba(0, 0, 0, 0.03)\",\n },\n largeTextStyle: {\n color: colorFromLabel(theme, label),\n fontSize: \"40px\",\n marginTop: \"-20px\",\n },\n smallTextStyle: {\n color: colorFromLabel(theme, label),\n fontWeight: \"bold\",\n fontSize: \"10px\",\n marginTop: \"-10px\",\n },\n }));\n\n const { cardStyle, largeTextStyle, smallTextStyle } = useStyles();\n\n return (\n <Card className={cardStyle}>\n <Typography className={largeTextStyle}>{count}</Typography>\n <Typography className={smallTextStyle}>{cardLabels[label]}</Typography>\n </Card>\n );\n}\n\nexport default IncidentCounterCard;\n","import { BackstageTheme } from \"@backstage/theme\";\nimport {\n Card,\n LinearProgress,\n Theme,\n Typography,\n makeStyles,\n withStyles,\n} from \"@material-ui/core\";\nimport React from \"react\";\n\ntype Props = {\n total: number;\n completed: number;\n};\n\nfunction colorFromPercentage(theme: Theme, percentage: number) {\n if (percentage < 0.5) {\n return theme.palette.error.main;\n } else if (percentage < 0.8) {\n return theme.palette.warning.main;\n }\n return theme.palette.success.main;\n}\n\nfunction ServiceStandardsCard({ total, completed }: Props) {\n const useStyles = makeStyles<BackstageTheme>((theme) => ({\n cardStyle: {\n height: \"120px\",\n display: \"grid\",\n gridTemplateRows: \"1fr auto auto\",\n backgroundColor: \"rgba(0, 0, 0, 0.03)\",\n },\n containerStyle: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n largeTextStyle: {\n fontSize: \"50px\",\n color: colorFromPercentage(theme, completed / total),\n fontWeight: \"bold\",\n alignSelf: \"center\",\n justifyContent: \"center\",\n },\n smallTextStyle: {\n color: theme.palette.text.primary,\n fontSize: \"16px\",\n fontWeight: \"bold\",\n alignSelf: \"center\",\n justifyContent: \"center\",\n marginLeft: \"1px\",\n marginTop: \"25px\",\n },\n }));\n\n const BorderLinearProgress = withStyles((theme) => ({\n root: {\n height: 10,\n borderRadius: 5,\n margin: 5,\n },\n colorPrimary: {\n backgroundColor:\n theme.palette.grey[theme.palette.type === \"light\" ? 200 : 700],\n },\n bar: {\n borderRadius: 5,\n backgroundColor: colorFromPercentage(theme, completed / total),\n },\n }))(LinearProgress);\n\n const { cardStyle, containerStyle, largeTextStyle, smallTextStyle } =\n useStyles();\n return (\n <Card className={cardStyle}>\n <div className={containerStyle}>\n <Typography className={largeTextStyle}>{completed}</Typography>\n <Typography className={smallTextStyle}>/{total}</Typography>\n </div>\n <div>\n <BorderLinearProgress\n variant=\"determinate\"\n value={(completed / total) * 100}\n />\n </div>\n </Card>\n );\n}\n\nexport default ServiceStandardsCard;\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { ReactNode, useCallback, useState } from \"react\";\nimport {\n Card,\n CardHeader,\n Divider,\n CardContent,\n Grid,\n Typography,\n} from \"@material-ui/core\";\nimport { Incidents } from \"../Incident\";\nimport { EscalationPolicy } from \"../Escalation\";\nimport useAsync from \"react-use/lib/useAsync\";\nimport { pagerDutyApiRef, UnauthorizedError } from \"../../api\";\nimport { MissingTokenError, ServiceNotFoundError } from \"../Errors\";\nimport { ChangeEvents } from \"../ChangeEvents\";\nimport PDGreenImage from \"../../assets/PD-Green.svg\";\nimport PDWhiteImage from \"../../assets/PD-White.svg\";\n\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { NotFoundError } from \"@backstage/errors\";\nimport {\n Progress,\n // HeaderIconLinkRow,\n // IconLinkVerticalProps,\n TabbedCard,\n CardTab,\n InfoCard,\n} from \"@backstage/core-components\";\nimport { PagerDutyEntity } from \"../../types\";\nimport { ForbiddenError } from \"../Errors/ForbiddenError\";\nimport { TriggerIncidentButton } from \"./TriggerIncidentButton\";\nimport { OpenServiceButton } from \"./OpenServiceButton\";\nimport {\n createStyles,\n makeStyles,\n useTheme,\n} from \"@material-ui/core/styles\";\nimport StatusCard from \"./StatusCard\";\nimport IncidentCounterCard from \"./IncidentCounterCard\";\nimport ServiceStandardsCard from \"./ServiceStandardsCard\";\nimport { BackstageTheme } from \"@backstage/theme\";\nimport { TriggerDialog } from \"../TriggerDialog\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) =>\n createStyles({\n overviewHeaderTextStyle: {\n fontSize: \"14px\",\n fontWeight: 500,\n color:\n theme.palette.type === \"light\"\n ? \"rgba(0, 0, 0, 0.54)\"\n : \"rgba(255, 255, 255, 0.7)\",\n },\n headerStyle: {\n marginRight: \"1em\",\n },\n overviewHeaderContainerStyle: {\n display: \"flex\",\n margin: \"15px\",\n marginBottom: \"20px\",\n },\n overviewCardsContainerStyle: {\n display: \"flex\",\n margin: \"15px\",\n marginTop: \"-15px\",\n },\n incidentMetricsContainerStyle: {\n display: \"flex\",\n height: \"100%\",\n justifyContent: \"center\",\n columnSpan: \"all\",\n },\n })\n);\n\nconst BasicCard = ({ children }: { children: ReactNode }) => (\n <InfoCard title=\"PagerDuty\">{children}</InfoCard>\n);\n\n/** @public */\nexport type PagerDutyCardProps = PagerDutyEntity & {\n readOnly?: boolean;\n disableChangeEvents?: boolean;\n};\n\n/** @public */\nexport const PagerDutyCard = (props: PagerDutyCardProps) => {\n const classes = useStyles();\n\n const theme = useTheme();\n const { readOnly, disableChangeEvents, integrationKey, name } = props;\n const api = useApi(pagerDutyApiRef);\n const [refreshIncidents, setRefreshIncidents] = useState<boolean>(false);\n const [refreshChangeEvents, setRefreshChangeEvents] =\n useState<boolean>(false);\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const handleRefresh = useCallback(() => {\n setRefreshIncidents((x) => !x);\n setRefreshChangeEvents((x) => !x);\n }, []);\n\n const {\n value: service,\n loading,\n error,\n } = useAsync(async () => {\n const { service: foundService } = await api.getServiceByPagerDutyEntity(\n props\n );\n\n return {\n id: foundService.id,\n name: foundService.name,\n url: foundService.html_url,\n policyId: foundService.escalation_policy.id,\n policyLink: foundService.escalation_policy.html_url,\n };\n }, [props]);\n\n if (error) {\n let errorNode: ReactNode;\n\n switch (error.constructor) {\n case UnauthorizedError:\n errorNode = <MissingTokenError />;\n break;\n case NotFoundError:\n errorNode = <ServiceNotFoundError />;\n break;\n default:\n errorNode = <ForbiddenError />;\n }\n\n return <BasicCard>{errorNode}</BasicCard>;\n }\n\n if (loading) {\n return (\n <BasicCard>\n <Progress />\n </BasicCard>\n );\n }\n\n /**\n * In order to create incidents using the REST API, a valid user email address must be present.\n * There is no guarantee the current user entity has a valid email association, so instead just\n * only allow triggering incidents when an integration key is present.\n */\n const createIncidentDisabled = !integrationKey;\n\n return (\n <>\n <Card data-testid=\"pagerduty-card\">\n <CardHeader\n className={classes.headerStyle}\n title={\n theme.palette.type === \"dark\" ? (\n <img src={PDWhiteImage} alt=\"PagerDuty\" height=\"35\" />\n ) : (\n <img src={PDGreenImage} alt=\"PagerDuty\" height=\"35\" />\n )\n }\n action={\n !readOnly ? (\n <div>\n <TriggerIncidentButton />\n <OpenServiceButton serviceUrl={service!.url} />\n </div>\n ) : (\n <OpenServiceButton serviceUrl={service!.url} />\n )\n }\n />\n <Grid item md={12} className={classes.overviewHeaderContainerStyle}>\n <Grid item md={3}>\n <Typography className={classes.overviewHeaderTextStyle}>\n STATUS\n </Typography>\n </Grid>\n <Grid item md={6}>\n <Typography className={classes.overviewHeaderTextStyle}>\n INCIDENT HISTORY\n </Typography>\n </Grid>\n <Grid item md={3}>\n <Typography className={classes.overviewHeaderTextStyle}>\n SERVICE STANDARDS\n </Typography>\n </Grid>\n </Grid>\n <Grid item md={12} className={classes.overviewCardsContainerStyle}>\n <Grid item md={3}>\n <StatusCard status=\"active\" />\n </Grid>\n <Grid item md={6} className={classes.incidentMetricsContainerStyle}>\n <Grid md={4}>\n <IncidentCounterCard count={1} label=\"triggered\" />\n </Grid>\n <Grid md={4}>\n <IncidentCounterCard count={1} label=\"acknowledged\" />\n </Grid>\n <Grid md={4}>\n <IncidentCounterCard count={43} label=\"resolved\" />\n </Grid>\n </Grid>\n <Grid item md={3}>\n <ServiceStandardsCard total={9} completed={8} />\n </Grid>\n </Grid>\n\n <Divider />\n <CardContent>\n <TabbedCard>\n <CardTab label=\"Incidents\">\n <Incidents\n serviceId={service!.id}\n refreshIncidents={refreshIncidents}\n />\n </CardTab>\n {disableChangeEvents !== true ? (\n <CardTab label=\"Change Events\">\n <ChangeEvents\n serviceId={service!.id}\n refreshEvents={refreshChangeEvents}\n />\n </CardTab>\n ) : (\n <></>\n )}\n </TabbedCard>\n <EscalationPolicy policyId={service!.policyId} />\n </CardContent>\n </Card>\n {!createIncidentDisabled && (\n <TriggerDialog\n data-testid=\"trigger-dialog\"\n showDialog={dialogShown}\n handleDialog={hideDialog}\n onIncidentCreated={handleRefresh}\n name={name}\n integrationKey={integrationKey}\n />\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from '../constants';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getPagerDutyEntity } from '../pagerDutyEntity';\nimport { PagerDutyCard } from '../PagerDutyCard';\n\n/** @public */\nexport const isPluginApplicableToEntity = (entity: Entity) =>\n Boolean(\n entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] ||\n entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID],\n );\n\n/** @public */\nexport type EntityPagerDutyCardProps = {\n readOnly?: boolean;\n disableChangeEvents?: boolean;\n};\n\n/** @public */\nexport const EntityPagerDutyCard = (props: EntityPagerDutyCardProps) => {\n const { readOnly, disableChangeEvents } = props;\n const { entity } = useEntity();\n const pagerDutyEntity = getPagerDutyEntity(entity);\n return (\n <PagerDutyCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableChangeEvents={disableChangeEvents}\n />\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, ReactNode, useState } from 'react';\nimport { makeStyles, Button } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\n\nimport { usePagerdutyEntity } from '../../hooks';\nimport { TriggerDialog } from '../TriggerDialog';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n buttonStyle: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText,\n '&:hover': {\n backgroundColor: theme.palette.error.dark,\n },\n },\n}));\n\n/** @public */\nexport function TriggerButton(props: { children?: ReactNode }) {\n const { buttonStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <Button\n onClick={showDialog}\n variant=\"contained\"\n className={disabled ? '' : buttonStyle}\n disabled={disabled}\n >\n {integrationKey\n ? props.children ?? 'Create Incident'\n : 'Missing integration key'}\n </Button>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EntityPagerDutyCardProps, EntityPagerDutyCard } from './components';\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCard\n */\nexport const PagerDutyCard = EntityPagerDutyCard;\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCardProps\n */\nexport type PagerDutyCardProps = EntityPagerDutyCardProps;\n"],"names":["ForbiddenError","EntityPagerDutyCard","useStyles","OpenInBrowser","makeStyles","PagerDutyCard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