@pagerduty/backstage-plugin 0.9.4-next.16 → 0.9.4-next.17
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-e3f63dcf.esm.js → index-0fec9996.esm.js} +98 -61
- package/dist/esm/index-0fec9996.esm.js.map +1 -0
- package/dist/esm/{index-510118fe.esm.js → index-291e1428.esm.js} +2 -2
- package/dist/esm/{index-510118fe.esm.js.map → index-291e1428.esm.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +4 -4
- package/dist/esm/index-e3f63dcf.esm.js.map +0 -1
|
@@ -215,7 +215,7 @@ const HomePagePagerDutyCard = pagerDutyPlugin.provide(
|
|
|
215
215
|
createCardExtension({
|
|
216
216
|
name: "HomePagePagerDutyCard",
|
|
217
217
|
title: "PagerDuty Homepage Card",
|
|
218
|
-
components: () => import('./index-
|
|
218
|
+
components: () => import('./index-291e1428.esm.js'),
|
|
219
219
|
settings: {
|
|
220
220
|
schema: {
|
|
221
221
|
title: "PagerDuty",
|
|
@@ -367,7 +367,7 @@ const IncidentsEmptyState = () => {
|
|
|
367
367
|
};
|
|
368
368
|
|
|
369
369
|
const IncidentForbiddenState = () => {
|
|
370
|
-
return /* @__PURE__ */ React.createElement(Grid, { container: true,
|
|
370
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "center", direction: "column", alignItems: "center" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Feature not available with your account or token.")), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
371
371
|
"img",
|
|
372
372
|
{
|
|
373
373
|
src: ForbiddenStateImage,
|
|
@@ -507,7 +507,11 @@ const EscalationUser = ({ user, policyUrl, policyName }) => {
|
|
|
507
507
|
))));
|
|
508
508
|
};
|
|
509
509
|
|
|
510
|
-
const EscalationPolicy = ({
|
|
510
|
+
const EscalationPolicy = ({
|
|
511
|
+
policyId,
|
|
512
|
+
policyUrl,
|
|
513
|
+
policyName
|
|
514
|
+
}) => {
|
|
511
515
|
const api = useApi(pagerDutyApiRef);
|
|
512
516
|
const {
|
|
513
517
|
value: users,
|
|
@@ -528,7 +532,23 @@ const EscalationPolicy = ({ policyId, policyUrl, policyName }) => {
|
|
|
528
532
|
if (!(users == null ? void 0 : users.length)) {
|
|
529
533
|
return /* @__PURE__ */ React.createElement(EscalationUsersEmptyState, null);
|
|
530
534
|
}
|
|
531
|
-
return /* @__PURE__ */ React.createElement(
|
|
535
|
+
return /* @__PURE__ */ React.createElement(
|
|
536
|
+
List,
|
|
537
|
+
{
|
|
538
|
+
dense: true,
|
|
539
|
+
subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL"),
|
|
540
|
+
style: { marginLeft: "-15px" }
|
|
541
|
+
},
|
|
542
|
+
users.map((user, index) => /* @__PURE__ */ React.createElement(
|
|
543
|
+
EscalationUser,
|
|
544
|
+
{
|
|
545
|
+
key: index,
|
|
546
|
+
user,
|
|
547
|
+
policyUrl,
|
|
548
|
+
policyName
|
|
549
|
+
}
|
|
550
|
+
))
|
|
551
|
+
);
|
|
532
552
|
};
|
|
533
553
|
|
|
534
554
|
const MissingTokenError = () => /* @__PURE__ */ React.createElement(
|
|
@@ -625,7 +645,7 @@ const ChangeEventListItem = ({ changeEvent }) => {
|
|
|
625
645
|
};
|
|
626
646
|
|
|
627
647
|
const ChangeEventEmptyState = () => {
|
|
628
|
-
return /* @__PURE__ */ React.createElement(Grid, { container: true,
|
|
648
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "center", direction: "column", alignItems: "center" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "No change events to display yet.")), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
629
649
|
"img",
|
|
630
650
|
{
|
|
631
651
|
src: EmptyStateImage,
|
|
@@ -636,7 +656,7 @@ const ChangeEventEmptyState = () => {
|
|
|
636
656
|
};
|
|
637
657
|
|
|
638
658
|
const ChangeEventForbiddenState = () => {
|
|
639
|
-
return /* @__PURE__ */ React.createElement(Grid, { container: true,
|
|
659
|
+
return /* @__PURE__ */ React.createElement(Grid, { container: true, justifyContent: "center", direction: "column", alignItems: "center" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Feature not available with your account or token.")), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(
|
|
640
660
|
"img",
|
|
641
661
|
{
|
|
642
662
|
src: ForbiddenStateImage,
|
|
@@ -696,16 +716,11 @@ const ForbiddenError = () => /* @__PURE__ */ React.createElement(
|
|
|
696
716
|
}
|
|
697
717
|
);
|
|
698
718
|
|
|
699
|
-
function usePagerdutyEntity() {
|
|
700
|
-
const { entity } = useEntity();
|
|
701
|
-
return getPagerDutyEntity(entity);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
719
|
const TriggerDialog = ({
|
|
705
720
|
showDialog,
|
|
706
721
|
handleDialog,
|
|
707
722
|
onIncidentCreated,
|
|
708
|
-
|
|
723
|
+
serviceName,
|
|
709
724
|
integrationKey
|
|
710
725
|
}) => {
|
|
711
726
|
const alertApi = useApi(alertApiRef);
|
|
@@ -748,7 +763,7 @@ const TriggerDialog = ({
|
|
|
748
763
|
severity: "error"
|
|
749
764
|
});
|
|
750
765
|
}
|
|
751
|
-
return /* @__PURE__ */ React.createElement(Dialog, { maxWidth: "md", open: showDialog, onClose: handleDialog, fullWidth: true }, /* @__PURE__ */ React.createElement(DialogTitle, null, "This action will trigger an incident for ", /* @__PURE__ */ React.createElement("strong", null, '"',
|
|
766
|
+
return /* @__PURE__ */ React.createElement(Dialog, { maxWidth: "md", open: showDialog, onClose: handleDialog, fullWidth: true }, /* @__PURE__ */ React.createElement(DialogTitle, null, "This action will trigger an incident for ", /* @__PURE__ */ React.createElement("strong", null, '"', serviceName, '"'), "."), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(Alert, { severity: "info" }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", align: "justify" }, `If the issue you are seeing does not need urgent attention, please get in touch with the responsible team using their preferred communications channel. You can find information about the owner of this entity in the "About" card. If the issue is urgent, please don't hesitate to trigger the alert.`)), /* @__PURE__ */ React.createElement(
|
|
752
767
|
Typography,
|
|
753
768
|
{
|
|
754
769
|
variant: "body1",
|
|
@@ -764,7 +779,7 @@ const TriggerDialog = ({
|
|
|
764
779
|
id: "description",
|
|
765
780
|
multiline: true,
|
|
766
781
|
fullWidth: true,
|
|
767
|
-
|
|
782
|
+
minRows: 4,
|
|
768
783
|
margin: "normal",
|
|
769
784
|
label: "Problem description",
|
|
770
785
|
variant: "outlined",
|
|
@@ -794,19 +809,20 @@ const useStyles$3 = makeStyles((theme) => ({
|
|
|
794
809
|
}
|
|
795
810
|
},
|
|
796
811
|
containerStyle: {
|
|
797
|
-
|
|
798
|
-
fontSize: "14px",
|
|
812
|
+
fontSize: "12px",
|
|
799
813
|
width: "80px",
|
|
800
|
-
|
|
814
|
+
marginRight: "-10px"
|
|
801
815
|
},
|
|
802
816
|
iconStyle: {
|
|
803
|
-
fontSize: "
|
|
817
|
+
fontSize: "30px",
|
|
818
|
+
marginBottom: "-10px"
|
|
819
|
+
},
|
|
820
|
+
textStyle: {
|
|
804
821
|
marginBottom: "-10px"
|
|
805
822
|
}
|
|
806
823
|
}));
|
|
807
|
-
function TriggerIncidentButton({ handleRefresh }) {
|
|
808
|
-
const { buttonStyle, containerStyle, iconStyle } = useStyles$3();
|
|
809
|
-
const { integrationKey, name } = usePagerdutyEntity();
|
|
824
|
+
function TriggerIncidentButton({ integrationKey, entityName, handleRefresh }) {
|
|
825
|
+
const { buttonStyle, containerStyle, iconStyle, textStyle } = useStyles$3();
|
|
810
826
|
const [dialogShown, setDialogShown] = useState(false);
|
|
811
827
|
const showDialog = useCallback(() => {
|
|
812
828
|
setDialogShown(true);
|
|
@@ -823,14 +839,14 @@ function TriggerIncidentButton({ handleRefresh }) {
|
|
|
823
839
|
className: disabled ? "" : buttonStyle,
|
|
824
840
|
disabled
|
|
825
841
|
},
|
|
826
|
-
/* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(AddAlert, { className: iconStyle }), /* @__PURE__ */ React.createElement("p",
|
|
842
|
+
/* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(AddAlert, { className: iconStyle }), /* @__PURE__ */ React.createElement("p", { className: textStyle }, "Create new incident"))
|
|
827
843
|
), integrationKey && /* @__PURE__ */ React.createElement(
|
|
828
844
|
TriggerDialog,
|
|
829
845
|
{
|
|
830
846
|
showDialog: dialogShown,
|
|
831
847
|
handleDialog: hideDialog,
|
|
832
848
|
integrationKey,
|
|
833
|
-
|
|
849
|
+
serviceName: entityName,
|
|
834
850
|
onIncidentCreated: handleRefresh
|
|
835
851
|
}
|
|
836
852
|
));
|
|
@@ -845,18 +861,19 @@ const useStyles$2 = makeStyles((theme) => ({
|
|
|
845
861
|
}
|
|
846
862
|
},
|
|
847
863
|
containerStyle: {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
width: "85px",
|
|
851
|
-
lineHeight: "14px"
|
|
864
|
+
fontSize: "12px",
|
|
865
|
+
width: "85px"
|
|
852
866
|
},
|
|
853
867
|
iconStyle: {
|
|
854
|
-
fontSize: "
|
|
868
|
+
fontSize: "30px",
|
|
869
|
+
marginBottom: "-10px"
|
|
870
|
+
},
|
|
871
|
+
textStyle: {
|
|
855
872
|
marginBottom: "-10px"
|
|
856
873
|
}
|
|
857
874
|
}));
|
|
858
875
|
function OpenServiceButton(props) {
|
|
859
|
-
const { buttonStyle, containerStyle, iconStyle } = useStyles$2();
|
|
876
|
+
const { buttonStyle, containerStyle, iconStyle, textStyle } = useStyles$2();
|
|
860
877
|
function navigateToService() {
|
|
861
878
|
window.open(props.serviceUrl, "_blank");
|
|
862
879
|
}
|
|
@@ -867,7 +884,7 @@ function OpenServiceButton(props) {
|
|
|
867
884
|
onClick: navigateToService,
|
|
868
885
|
className: buttonStyle
|
|
869
886
|
},
|
|
870
|
-
/* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(OpenInBrowserIcon, { className: iconStyle }), /* @__PURE__ */ React.createElement("p",
|
|
887
|
+
/* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(OpenInBrowserIcon, { className: iconStyle }), /* @__PURE__ */ React.createElement("p", { className: textStyle }, "Open service in PagerDuty"))
|
|
871
888
|
));
|
|
872
889
|
}
|
|
873
890
|
|
|
@@ -1021,20 +1038,23 @@ function ServiceStandardsCard({ total, completed, standards }) {
|
|
|
1021
1038
|
backgroundColor: completed !== void 0 && total !== void 0 ? colorFromPercentage(theme, completed / total) : colorFromPercentage(theme, 0)
|
|
1022
1039
|
}
|
|
1023
1040
|
}))(LinearProgress);
|
|
1024
|
-
const {
|
|
1041
|
+
const {
|
|
1042
|
+
cardStyle,
|
|
1043
|
+
containerStyle,
|
|
1044
|
+
largeTextStyle,
|
|
1045
|
+
smallTextStyle,
|
|
1046
|
+
tooltipContainer,
|
|
1047
|
+
tooltipIcon,
|
|
1048
|
+
standardItem
|
|
1049
|
+
} = useStyles();
|
|
1050
|
+
if (standards === void 0 || completed === void 0 || total === void 0) {
|
|
1051
|
+
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, /* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: smallTextStyle }, "Unable to retrieve Scores")));
|
|
1052
|
+
}
|
|
1025
1053
|
return /* @__PURE__ */ React.createElement(Card, { className: cardStyle }, completed !== void 0 && total !== void 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: tooltipContainer }, /* @__PURE__ */ React.createElement(IconButton, null, /* @__PURE__ */ React.createElement(
|
|
1026
1054
|
Tooltip,
|
|
1027
1055
|
{
|
|
1028
1056
|
interactive: true,
|
|
1029
|
-
title: /* @__PURE__ */ React.createElement(React.Fragment, null, standards == null ? void 0 : standards.map((standard,
|
|
1030
|
-
"span",
|
|
1031
|
-
{
|
|
1032
|
-
className: standardItem
|
|
1033
|
-
},
|
|
1034
|
-
/* @__PURE__ */ React.createElement(CheckCircle, { className: tooltipIcon }),
|
|
1035
|
-
" ",
|
|
1036
|
-
standard.name
|
|
1037
|
-
) : /* @__PURE__ */ React.createElement("span", { className: standardItem }, /* @__PURE__ */ React.createElement(RadioButtonUncheckedIcon, { className: tooltipIcon }), " ", standard.name))))
|
|
1057
|
+
title: /* @__PURE__ */ React.createElement(React.Fragment, null, standards == null ? void 0 : standards.map((standard, key) => /* @__PURE__ */ React.createElement("p", { key }, standard.pass ? /* @__PURE__ */ React.createElement("span", { className: standardItem }, /* @__PURE__ */ React.createElement(CheckCircle, { className: tooltipIcon }), " ", standard.name) : /* @__PURE__ */ React.createElement("span", { className: standardItem }, /* @__PURE__ */ React.createElement(RadioButtonUncheckedIcon, { className: tooltipIcon }), " ", standard.name))))
|
|
1038
1058
|
},
|
|
1039
1059
|
/* @__PURE__ */ React.createElement(InfoIcon, null)
|
|
1040
1060
|
))), /* @__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(
|
|
@@ -1043,7 +1063,7 @@ function ServiceStandardsCard({ total, completed, standards }) {
|
|
|
1043
1063
|
variant: "determinate",
|
|
1044
1064
|
value: completed / total * 100
|
|
1045
1065
|
}
|
|
1046
|
-
))) : /* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(Typography, { className:
|
|
1066
|
+
))) : /* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: smallTextStyle }, "Unable to retrieve Scores")));
|
|
1047
1067
|
}
|
|
1048
1068
|
|
|
1049
1069
|
function IncidentCounterCard({ count, label, color }) {
|
|
@@ -1083,7 +1103,8 @@ const useStyles$1 = makeStyles$1(
|
|
|
1083
1103
|
color: theme.palette.type === "light" ? "rgba(0, 0, 0, 0.54)" : "rgba(255, 255, 255, 0.7)"
|
|
1084
1104
|
},
|
|
1085
1105
|
headerStyle: {
|
|
1086
|
-
|
|
1106
|
+
marginBottom: "0px",
|
|
1107
|
+
fontSize: "0px"
|
|
1087
1108
|
},
|
|
1088
1109
|
overviewHeaderContainerStyle: {
|
|
1089
1110
|
display: "flex",
|
|
@@ -1113,7 +1134,7 @@ const useStyles$1 = makeStyles$1(
|
|
|
1113
1134
|
);
|
|
1114
1135
|
const BasicCard = ({ children }) => /* @__PURE__ */ React.createElement(InfoCard, { title: "PagerDuty" }, children);
|
|
1115
1136
|
const PagerDutyCard$1 = (props) => {
|
|
1116
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1137
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1117
1138
|
const classes = useStyles$1();
|
|
1118
1139
|
const theme = useTheme();
|
|
1119
1140
|
const { readOnly, disableChangeEvents } = props;
|
|
@@ -1134,8 +1155,12 @@ const PagerDutyCard$1 = (props) => {
|
|
|
1134
1155
|
const { service: foundService } = await api.getServiceByPagerDutyEntity(
|
|
1135
1156
|
props
|
|
1136
1157
|
);
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1158
|
+
const serviceStandards = await api.getServiceStandardsByServiceId(
|
|
1159
|
+
foundService.id
|
|
1160
|
+
);
|
|
1161
|
+
const serviceMetrics = await api.getServiceMetricsByServiceId(
|
|
1162
|
+
foundService.id
|
|
1163
|
+
);
|
|
1139
1164
|
const result = {
|
|
1140
1165
|
id: foundService.id,
|
|
1141
1166
|
name: foundService.name,
|
|
@@ -1144,8 +1169,8 @@ const PagerDutyCard$1 = (props) => {
|
|
|
1144
1169
|
policyLink: foundService.escalation_policy.html_url,
|
|
1145
1170
|
policyName: foundService.escalation_policy.name,
|
|
1146
1171
|
status: foundService.status,
|
|
1147
|
-
standards: serviceStandards,
|
|
1148
|
-
metrics: serviceMetrics
|
|
1172
|
+
standards: serviceStandards !== void 0 ? serviceStandards.standards : void 0,
|
|
1173
|
+
metrics: serviceMetrics !== void 0 ? serviceMetrics.metrics : void 0
|
|
1149
1174
|
};
|
|
1150
1175
|
return result;
|
|
1151
1176
|
}, [props]);
|
|
@@ -1166,40 +1191,47 @@ const PagerDutyCard$1 = (props) => {
|
|
|
1166
1191
|
if (loading) {
|
|
1167
1192
|
return /* @__PURE__ */ React.createElement(BasicCard, null, /* @__PURE__ */ React.createElement(Progress, null));
|
|
1168
1193
|
}
|
|
1169
|
-
return /* @__PURE__ */ React.createElement(
|
|
1194
|
+
return /* @__PURE__ */ React.createElement(Card, { "data-testid": "pagerduty-card" }, /* @__PURE__ */ React.createElement(
|
|
1170
1195
|
CardHeader,
|
|
1171
1196
|
{
|
|
1172
1197
|
className: classes.headerStyle,
|
|
1173
1198
|
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" }),
|
|
1174
|
-
action: !readOnly ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
1199
|
+
action: !readOnly ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
1200
|
+
TriggerIncidentButton,
|
|
1201
|
+
{
|
|
1202
|
+
integrationKey: props.integrationKey,
|
|
1203
|
+
entityName: props.name,
|
|
1204
|
+
handleRefresh
|
|
1205
|
+
}
|
|
1206
|
+
), /* @__PURE__ */ React.createElement(OpenServiceButton, { serviceUrl: service.url })) : /* @__PURE__ */ React.createElement(OpenServiceButton, { serviceUrl: service.url })
|
|
1175
1207
|
}
|
|
1176
|
-
), /* @__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("span", { className: classes.headerWithSubheaderContainerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "INSIGHTS"), /* @__PURE__ */ React.createElement(Typography, { className: classes.subheaderTextStyle }, "(last 30 days)"))), /* @__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, { serviceId: service.id, refreshStatus })), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6, className: classes.incidentMetricsContainerStyle }, /* @__PURE__ */ React.createElement(Grid, { md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1208
|
+
), /* @__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("span", { className: classes.headerWithSubheaderContainerStyle }, /* @__PURE__ */ React.createElement(Typography, { className: classes.overviewHeaderTextStyle }, "INSIGHTS"), /* @__PURE__ */ React.createElement(Typography, { className: classes.subheaderTextStyle }, "(last 30 days)"))), /* @__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, { serviceId: service.id, refreshStatus })), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6, className: classes.incidentMetricsContainerStyle }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1177
1209
|
IncidentCounterCard,
|
|
1178
1210
|
{
|
|
1179
|
-
count: (service == null ? void 0 : service.metrics) !== void 0 &&
|
|
1211
|
+
count: (service == null ? void 0 : service.metrics) !== void 0 && service.metrics.length > 0 ? service == null ? void 0 : service.metrics[0].total_interruptions : void 0,
|
|
1180
1212
|
label: "interruptions",
|
|
1181
1213
|
color: theme.palette.textSubtle
|
|
1182
1214
|
}
|
|
1183
|
-
)), /* @__PURE__ */ React.createElement(Grid, { md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1215
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1184
1216
|
IncidentCounterCard,
|
|
1185
1217
|
{
|
|
1186
|
-
count: (service == null ? void 0 : service.metrics) !== void 0 &&
|
|
1218
|
+
count: (service == null ? void 0 : service.metrics) !== void 0 && service.metrics.length > 0 ? service == null ? void 0 : service.metrics[0].total_high_urgency_incidents : void 0,
|
|
1187
1219
|
label: "high urgency",
|
|
1188
1220
|
color: theme.palette.warning.main
|
|
1189
1221
|
}
|
|
1190
|
-
)), /* @__PURE__ */ React.createElement(Grid, { md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1222
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 4 }, /* @__PURE__ */ React.createElement(
|
|
1191
1223
|
IncidentCounterCard,
|
|
1192
1224
|
{
|
|
1193
|
-
count: (service == null ? void 0 : service.metrics) !== void 0 && ((
|
|
1225
|
+
count: (service == null ? void 0 : service.metrics) !== void 0 && ((_a = service == null ? void 0 : service.metrics) == null ? void 0 : _a.length) > 0 ? service == null ? void 0 : service.metrics[0].total_incident_count : void 0,
|
|
1194
1226
|
label: "incidents",
|
|
1195
1227
|
color: theme.palette.error.main
|
|
1196
1228
|
}
|
|
1197
1229
|
))), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(
|
|
1198
1230
|
ServiceStandardsCard,
|
|
1199
1231
|
{
|
|
1200
|
-
total: (_d = (_c = service == null ? void 0 : service.standards) == null ? void 0 : _c.score) == null ? void 0 : _d.total,
|
|
1201
|
-
completed: (
|
|
1202
|
-
standards: (
|
|
1232
|
+
total: (service == null ? void 0 : service.standards) !== void 0 && ((_b = service == null ? void 0 : service.standards) == null ? void 0 : _b.score) !== void 0 ? (_d = (_c = service == null ? void 0 : service.standards) == null ? void 0 : _c.score) == null ? void 0 : _d.total : void 0,
|
|
1233
|
+
completed: (service == null ? void 0 : service.standards) !== void 0 && ((_e = service == null ? void 0 : service.standards) == null ? void 0 : _e.score) !== void 0 ? (_g = (_f = service == null ? void 0 : service.standards) == null ? void 0 : _f.score) == null ? void 0 : _g.passing : void 0,
|
|
1234
|
+
standards: (service == null ? void 0 : service.standards) !== void 0 ? (_h = service == null ? void 0 : service.standards) == null ? void 0 : _h.standards : void 0
|
|
1203
1235
|
}
|
|
1204
1236
|
))), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(TabbedCard, null, /* @__PURE__ */ React.createElement(CardTab, { label: "Incidents" }, /* @__PURE__ */ React.createElement(
|
|
1205
1237
|
Incidents,
|
|
@@ -1220,7 +1252,7 @@ const PagerDutyCard$1 = (props) => {
|
|
|
1220
1252
|
policyUrl: service.policyLink,
|
|
1221
1253
|
policyName: service.policyName
|
|
1222
1254
|
}
|
|
1223
|
-
)))
|
|
1255
|
+
)));
|
|
1224
1256
|
};
|
|
1225
1257
|
|
|
1226
1258
|
const isPluginApplicableToEntity = (entity) => {
|
|
@@ -1249,6 +1281,11 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
1249
1281
|
EntityPagerDutyCard: EntityPagerDutyCard
|
|
1250
1282
|
});
|
|
1251
1283
|
|
|
1284
|
+
function usePagerdutyEntity() {
|
|
1285
|
+
const { entity } = useEntity();
|
|
1286
|
+
return getPagerDutyEntity(entity);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1252
1289
|
const useStyles = makeStyles((theme) => ({
|
|
1253
1290
|
buttonStyle: {
|
|
1254
1291
|
backgroundColor: theme.palette.error.main,
|
|
@@ -1285,7 +1322,7 @@ function TriggerButton(props) {
|
|
|
1285
1322
|
showDialog: dialogShown,
|
|
1286
1323
|
handleDialog: hideDialog,
|
|
1287
1324
|
integrationKey,
|
|
1288
|
-
name
|
|
1325
|
+
serviceName: name
|
|
1289
1326
|
}
|
|
1290
1327
|
));
|
|
1291
1328
|
}
|
|
@@ -1293,4 +1330,4 @@ function TriggerButton(props) {
|
|
|
1293
1330
|
const PagerDutyCard = EntityPagerDutyCard;
|
|
1294
1331
|
|
|
1295
1332
|
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 };
|
|
1296
|
-
//# sourceMappingURL=index-
|
|
1333
|
+
//# sourceMappingURL=index-0fec9996.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-0fec9996.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/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/hooks/index.ts","../../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 PagerDutyServiceMetricsResponse\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\n async getServiceById(serviceId: string): Promise<PagerDutyServiceResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}`;\n\n return await this.findByUrl<PagerDutyServiceResponse>(url);\n }\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 getServiceMetricsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyServiceMetricsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/metrics`;\n\n return await this.findByUrl<PagerDutyServiceMetricsResponse>(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 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: \"#fff\",\n },\n },\n error: {\n borderColor: theme.palette.error.main,\n color: \"#fff\",\n backgroundColor: theme.palette.error.main,\n boxShadow: \"0 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: \"#fff\",\n },\n },\n lowUrgency: {\n borderColor: theme.palette.warning.main,\n color: theme.palette.warning.main,\n backgroundColor: \"#fff\",\n boxShadow: \"0 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: theme.palette.warning.main,\n },\n },\n highUrgency: {\n borderColor: theme.palette.error.main,\n color: theme.palette.error.main,\n backgroundColor: \"#fff\",\n boxShadow: \"0 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: theme.palette.error.main,\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 <Chip\n data-testid={`chip-${incident.urgency}`}\n label={`${incident.urgency} urgency`}\n size=\"small\"\n variant=\"outlined\"\n className={\n incident.urgency === \"high\"\n ? classes.highUrgency\n : classes.lowUrgency\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 justifyContent=\"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 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=\"Open user 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 = ({\n policyId,\n policyUrl,\n policyName,\n}: 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\n dense\n subheader={<ListSubheader>ON CALL</ListSubheader>}\n style={{ marginLeft: \"-15px\" }}\n >\n {users!.map((user, index) => (\n <EscalationUser\n key={index}\n user={user}\n policyUrl={policyUrl}\n policyName={policyName}\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 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 justifyContent=\"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 justifyContent=\"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\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 serviceName: string;\n integrationKey: string;\n};\n\nexport const TriggerDialog = ({\n showDialog,\n handleDialog,\n onIncidentCreated: onIncidentCreated,\n serviceName,\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>\"{serviceName}\"</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 minRows={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 { 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 fontSize: \"12px\",\n width: \"80px\",\n marginRight: \"-10px\",\n },\n iconStyle: {\n fontSize: \"30px\",\n marginBottom: \"-10px\"\n },\n textStyle: {\n marginBottom: \"-10px\",\n }\n}));\n\n/** @public */\nexport type TriggerIncidentButtonProps = {\n integrationKey: string | undefined;\n entityName: string;\n handleRefresh: () => void;\n}\n\n/** @public */\nexport function TriggerIncidentButton({ integrationKey, entityName, handleRefresh } : TriggerIncidentButtonProps) {\n const { buttonStyle, containerStyle, iconStyle, textStyle } = useStyles();\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 \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 className={textStyle}>Create new incident</p>\n </div>\n </IconButton>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n serviceName={entityName}\n onIncidentCreated={handleRefresh}\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 fontSize: \"12px\",\n width: \"85px\",\n },\n iconStyle: {\n fontSize: \"30px\",\n marginBottom: \"-10px\",\n },\n textStyle: {\n marginBottom: \"-10px\",\n }\n}));\n\n/** @public */\nexport function OpenServiceButton(props: { serviceUrl: string}) {\n const { buttonStyle, containerStyle, iconStyle, textStyle } = useStyles();\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 className={textStyle}>Open service in PagerDuty</p>\n </div>\n </IconButton>\n </>\n );\n}\n","import { Card, Typography } from \"@material-ui/core\";\nimport React, { useEffect } from \"react\";\nimport { Theme, makeStyles } from \"@material-ui/core/styles\";\nimport { BackstageTheme } from \"@backstage/theme\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport { useAsyncFn } from \"react-use\";\nimport Alert from \"@material-ui/lab/Alert/Alert\";\nimport { Progress } from \"@backstage/core-components\";\n\ntype Props = {\n serviceId: string;\n refreshStatus: boolean;\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({ serviceId, refreshStatus }: Props) {\n const api = useApi(pagerDutyApiRef);\n const [{ value: status, loading, error }, getStatus] = useAsyncFn(\n async () => {\n const { service: foundService } = await api.getServiceById(serviceId);\n return foundService.status;\n }\n );\n\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 useEffect(() => {\n getStatus();\n }, [refreshStatus, getStatus]);\n\n if (error) {\n if (error.message.includes(\"Forbidden\")) {\n return <p>forbidden</p>;\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 (!status) {\n return <p>not found</p>;\n }\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 IconButton,\n LinearProgress,\n Theme,\n Tooltip,\n Typography,\n makeStyles,\n withStyles,\n} from \"@material-ui/core\";\nimport React from \"react\";\nimport InfoIcon from \"@material-ui/icons/Info\";\nimport { PagerDutyServiceStandard } from \"@pagerduty/backstage-plugin-common\";\nimport CheckCircle from \"@material-ui/icons/CheckCircle\";\nimport RadioButtonUncheckedIcon from \"@material-ui/icons/RadioButtonUnchecked\";\n\ntype Props = {\n total: number | undefined;\n completed: number | undefined;\n standards: PagerDutyServiceStandard[] | 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, standards }: 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 marginTop: \"-100px\",\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 tooltipContainer: {},\n tooltipIcon: {\n marginRight: \"5px\",\n },\n standardItem: {\n display: \"flex\",\n alignItems: \"center\",\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 {\n cardStyle,\n containerStyle,\n largeTextStyle,\n smallTextStyle,\n tooltipContainer,\n tooltipIcon,\n standardItem,\n } = useStyles();\n\n if (standards === undefined || completed === undefined || total === undefined) {\n return (\n <Card className={cardStyle}>\n <div className={containerStyle}>\n <Typography className={smallTextStyle}>\n Unable to retrieve Scores\n </Typography>\n </div>\n </Card>\n );\n }\n \n return (\n <Card className={cardStyle}>\n {completed !== undefined && total !== undefined ? (\n <>\n <div className={tooltipContainer}>\n <IconButton>\n <Tooltip\n interactive\n title={\n <>\n {standards?.map((standard, key) => (\n <p key={key}>\n {standard.pass ? (\n <span className={standardItem}>\n <CheckCircle className={tooltipIcon} />{\" \"}\n {standard.name}\n </span>\n ) : (\n <span className={standardItem}>\n <RadioButtonUncheckedIcon className={tooltipIcon} />{\" \"}\n {standard.name}\n </span>\n )}\n </p>\n ))}\n </>\n }\n >\n <InfoIcon />\n </Tooltip>\n </IconButton>\n </div>\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={smallTextStyle}>\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 | undefined;\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: \"30px\",\n marginTop: \"-10px\",\n },\n smallTextStyle: {\n color: textColor,\n fontWeight: \"bold\",\n fontSize: \"10px\",\n marginTop: \"-5px\",\n textTransform: \"uppercase\",\n flexWrap: \"wrap\",\n },\n }));\n\n const { cardStyle, largeTextStyle, smallTextStyle } = useStyles();\n\n return (\n <Card className={cardStyle}>\n {(count !== undefined) ? (\n <>\n <Typography className={largeTextStyle}>{count}</Typography>\n <Typography className={smallTextStyle}>{label}</Typography>\n </>\n ) : (\n <>\n <Typography className={largeTextStyle}>-</Typography>\n <Typography className={smallTextStyle}>{label}</Typography>\n </>\n )}\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 { 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 marginBottom: \"0px\",\n fontSize: \"0px\",\n },\n overviewHeaderContainerStyle: {\n display: \"flex\",\n margin: \"15px\",\n marginBottom: \"20px\",\n },\n headerWithSubheaderContainerStyle: {\n display: \"flex\",\n alignItems: \"center\",\n },\n subheaderTextStyle: {\n fontSize: \"10px\",\n marginLeft: \"5px\",\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 } = props;\n const api = useApi(pagerDutyApiRef);\n const [refreshIncidents, setRefreshIncidents] = useState<boolean>(false);\n const [refreshChangeEvents, setRefreshChangeEvents] =\n useState<boolean>(false);\n const [refreshStatus, setRefreshStatus] = useState<boolean>(false);\n\n const handleRefresh = useCallback(() => {\n setRefreshIncidents((x) => !x);\n setRefreshChangeEvents((x) => !x);\n setRefreshStatus((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 serviceStandards = await api.getServiceStandardsByServiceId(\n foundService.id\n );\n\n const serviceMetrics = await api.getServiceMetricsByServiceId(\n foundService.id\n );\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 standards:\n serviceStandards !== undefined ? serviceStandards.standards : undefined,\n metrics:\n serviceMetrics !== undefined ? serviceMetrics.metrics : undefined,\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 return (\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 integrationKey={props.integrationKey}\n entityName={props.name}\n handleRefresh={handleRefresh}\n />\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 <span className={classes.headerWithSubheaderContainerStyle}>\n <Typography className={classes.overviewHeaderTextStyle}>\n INSIGHTS\n </Typography>\n <Typography className={classes.subheaderTextStyle}>\n (last 30 days)\n </Typography>\n </span>\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 serviceId={service!.id} refreshStatus={refreshStatus} />\n </Grid>\n <Grid item md={6} className={classes.incidentMetricsContainerStyle}>\n <Grid item md={4}>\n <InsightsCard\n count={\n service?.metrics !== undefined && service.metrics.length > 0\n ? service?.metrics![0].total_interruptions\n : undefined\n }\n label=\"interruptions\"\n color={theme.palette.textSubtle}\n />\n </Grid>\n <Grid item md={4}>\n <InsightsCard\n count={\n service?.metrics !== undefined && service.metrics.length > 0\n ? service?.metrics![0].total_high_urgency_incidents\n : undefined\n }\n label=\"high urgency\"\n color={theme.palette.warning.main}\n />\n </Grid>\n <Grid item md={4}>\n <InsightsCard\n count={\n service?.metrics !== undefined && service?.metrics?.length > 0\n ? service?.metrics[0].total_incident_count\n : undefined\n }\n label=\"incidents\"\n color={theme.palette.error.main}\n />\n </Grid>\n </Grid>\n <Grid item md={3}>\n <ServiceStandardsCard\n total={\n service?.standards !== undefined &&\n service?.standards?.score !== undefined\n ? service?.standards?.score?.total\n : undefined\n }\n completed={\n service?.standards !== undefined &&\n service?.standards?.score !== undefined\n ? service?.standards?.score?.passing\n : undefined\n }\n standards={\n service?.standards !== undefined\n ? service?.standards?.standards\n : undefined\n }\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 );\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 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 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 serviceName={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","useAsyncFn","makeStyles","Alert","PagerDutyCard","InsightsCard"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,yBAA4B,GAAA,+BAAA,CAAA;AAClC,MAAM,oBAAuB,GAAA,0BAAA;;ACI7B,SAAS,mBAAmB,MAAiC,EAAA;AAClE,EAAM,MAAA;AAAA,IACJ,CAAC,yBAAyB,GAAG,cAAA;AAAA,IAC7B,CAAC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AAAA,MACA,WAAa,EAAA,IAAA;AAAA,KAAA;AAAA,GAGnB,CAAA,CAAA;AAEJ;;AChDO,MAAM,aAAgB,GAAA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { P as PagerDutyCard } from './index-
|
|
2
|
+
import { P as PagerDutyCard } from './index-0fec9996.esm.js';
|
|
3
3
|
import '@backstage/core-plugin-api';
|
|
4
4
|
import '@backstage/errors';
|
|
5
5
|
import '@backstage/plugin-home-react';
|
|
@@ -33,4 +33,4 @@ const Content = (props) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export { Content };
|
|
36
|
-
//# sourceMappingURL=index-
|
|
36
|
+
//# sourceMappingURL=index-291e1428.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-291e1428.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;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-0fec9996.esm.js';
|
|
2
2
|
import '@backstage/core-plugin-api';
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import '@backstage/plugin-home-react';
|
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.17",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"validate-color": "^2.2.4"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@pagerduty/backstage-plugin-common": "^0.1.2
|
|
52
|
+
"@pagerduty/backstage-plugin-common": "^0.1.2",
|
|
53
53
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
54
54
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
55
55
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"@backstage/cli": "^0.24.0",
|
|
59
59
|
"@backstage/core-app-api": "^1.11.1",
|
|
60
60
|
"@backstage/dev-utils": "^1.0.24",
|
|
61
|
-
"@backstage/test-utils": "^1.
|
|
61
|
+
"@backstage/test-utils": "^1.5.1",
|
|
62
62
|
"@commitlint/cli": "^17.7.1",
|
|
63
63
|
"@commitlint/config-conventional": "^17.7.0",
|
|
64
|
-
"@pagerduty/backstage-plugin-common": "^0.1.2
|
|
64
|
+
"@pagerduty/backstage-plugin-common": "^0.1.2",
|
|
65
65
|
"@testing-library/dom": "^8.0.0",
|
|
66
66
|
"@testing-library/jest-dom": "^5.10.1",
|
|
67
67
|
"@testing-library/react": "^12.1.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-e3f63dcf.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 PagerDutyServiceMetricsResponse\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\n async getServiceById(serviceId: string): Promise<PagerDutyServiceResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}`;\n\n return await this.findByUrl<PagerDutyServiceResponse>(url);\n }\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 getServiceMetricsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyServiceMetricsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/metrics`;\n\n return await this.findByUrl<PagerDutyServiceMetricsResponse>(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 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: \"#fff\",\n },\n },\n error: {\n borderColor: theme.palette.error.main,\n color: \"#fff\",\n backgroundColor: theme.palette.error.main,\n boxShadow: \"0 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: \"#fff\",\n },\n },\n lowUrgency: {\n borderColor: theme.palette.warning.main,\n color: theme.palette.warning.main,\n backgroundColor: \"#fff\",\n boxShadow: \"0 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: theme.palette.warning.main,\n },\n },\n highUrgency: {\n borderColor: theme.palette.error.main,\n color: theme.palette.error.main,\n backgroundColor: \"#fff\",\n boxShadow: \"0 4px 4px 0 rgba(0,0,0,0.2)\",\n textTransform: \"uppercase\",\n \"& *\": {\n color: theme.palette.error.main,\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 <Chip\n data-testid={`chip-${incident.urgency}`}\n label={`${incident.urgency} urgency`}\n size=\"small\"\n variant=\"outlined\"\n className={\n incident.urgency === \"high\"\n ? classes.highUrgency\n : classes.lowUrgency\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 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\n// function sendEmail(email: string) {\n \n// window.open(`mailto:${email}`, \"_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=\"Open user 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 type TriggerIncidentButtonProps = {\n handleRefresh: () => void;\n}\n\n/** @public */\nexport function TriggerIncidentButton({ handleRefresh } : TriggerIncidentButtonProps) {\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 onIncidentCreated={handleRefresh}\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, { useEffect } from \"react\";\nimport { Theme, makeStyles } from \"@material-ui/core/styles\";\nimport { BackstageTheme } from \"@backstage/theme\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport { useAsyncFn } from \"react-use\";\nimport Alert from \"@material-ui/lab/Alert/Alert\";\nimport { Progress } from \"@backstage/core-components\";\n\ntype Props = {\n serviceId: string;\n refreshStatus: boolean;\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({ serviceId, refreshStatus }: Props) {\n const api = useApi(pagerDutyApiRef);\n const [{ value: status, loading, error }, getStatus] = useAsyncFn(\n async () => {\n const { service: foundService } = await api.getServiceById(serviceId);\n return foundService.status;\n }\n );\n\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 useEffect(() => {\n getStatus();\n }, [refreshStatus, getStatus]);\n\n if (error) {\n if (error.message.includes(\"Forbidden\")) {\n return <p>forbidden</p>;\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 (!status) {\n return <p>not found</p>;\n }\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 IconButton,\n LinearProgress,\n Theme,\n Tooltip,\n Typography,\n makeStyles,\n withStyles,\n} from \"@material-ui/core\";\nimport React from \"react\";\nimport InfoIcon from \"@material-ui/icons/Info\"\nimport { PagerDutyServiceStandard } from \"@pagerduty/backstage-plugin-common\";\nimport CheckCircle from \"@material-ui/icons/CheckCircle\";\nimport RadioButtonUncheckedIcon from \"@material-ui/icons/RadioButtonUnchecked\";\n\ntype Props = {\n total: number | undefined;\n completed: number | undefined;\n standards: PagerDutyServiceStandard[] | 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, standards }: 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 marginTop: \"-100px\",\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 tooltipContainer: {\n \n },\n tooltipIcon: {\n marginRight: \"5px\",\n },\n standardItem: {\n display: \"flex\",\n alignItems: \"center\",\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, tooltipContainer, tooltipIcon, standardItem } =\n useStyles();\n return (\n <Card className={cardStyle}>\n {completed !== undefined && total !== undefined ? (\n <>\n <div className={tooltipContainer}>\n <IconButton>\n <Tooltip\n interactive\n title={\n <>\n {standards?.map((standard, _) => (\n <p>\n {standard.pass ? (\n <span className={standardItem}\n >\n <CheckCircle className={tooltipIcon} /> {standard.name}\n </span>\n ) : (\n <span className={standardItem}>\n <RadioButtonUncheckedIcon className={tooltipIcon} /> {standard.name}\n </span>\n )}\n </p>\n ))}\n </>\n }\n >\n <InfoIcon />\n </Tooltip>\n </IconButton>\n </div>\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 | undefined;\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: \"30px\",\n marginTop: \"-10px\",\n },\n smallTextStyle: {\n color: textColor,\n fontWeight: \"bold\",\n fontSize: \"10px\",\n marginTop: \"-5px\",\n textTransform: \"uppercase\",\n flexWrap: \"wrap\",\n },\n }));\n\n const { cardStyle, largeTextStyle, smallTextStyle } = useStyles();\n\n return (\n <Card className={cardStyle}>\n {(count !== undefined) ? (\n <>\n <Typography className={largeTextStyle}>{count}</Typography>\n <Typography className={smallTextStyle}>{label}</Typography>\n </>\n ) : (\n <>\n <Typography className={largeTextStyle}>-</Typography>\n <Typography className={smallTextStyle}>{label}</Typography>\n </>\n )}\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 { 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 headerWithSubheaderContainerStyle: {\n display: \"flex\",\n alignItems: \"center\",\n },\n subheaderTextStyle: {\n fontSize: \"10px\",\n marginLeft: \"5px\",\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 } = props;\n const api = useApi(pagerDutyApiRef);\n const [refreshIncidents, setRefreshIncidents] = useState<boolean>(false);\n const [refreshChangeEvents, setRefreshChangeEvents] =\n useState<boolean>(false);\n const [refreshStatus, setRefreshStatus] = useState<boolean>(false);\n\n const handleRefresh = useCallback(() => {\n setRefreshIncidents((x) => !x);\n setRefreshChangeEvents((x) => !x);\n setRefreshStatus((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 } =\n await api.getServiceStandardsByServiceId(foundService.id);\n\n const { metrics: serviceMetrics } = \n await api.getServiceMetricsByServiceId(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 standards: serviceStandards,\n metrics: serviceMetrics\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 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 handleRefresh={handleRefresh} />\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 <span className={classes.headerWithSubheaderContainerStyle}>\n <Typography className={classes.overviewHeaderTextStyle}>\n INSIGHTS\n </Typography>\n <Typography className={classes.subheaderTextStyle}>\n (last 30 days)\n </Typography>\n </span>\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 serviceId={service!.id} refreshStatus={refreshStatus} />\n </Grid>\n <Grid item md={6} className={classes.incidentMetricsContainerStyle}>\n <Grid md={4}>\n <InsightsCard\n count={service?.metrics !== undefined && service?.metrics.length > 0\n ? service.metrics[0].total_interruptions\n : undefined\n }\n label=\"interruptions\"\n color={theme.palette.textSubtle}\n />\n </Grid>\n <Grid md={4}>\n <InsightsCard\n count={service?.metrics !== undefined && service?.metrics?.length > 0\n ? service?.metrics[0].total_high_urgency_incidents\n : undefined\n }\n label=\"high urgency\"\n color={theme.palette.warning.main}\n />\n </Grid>\n <Grid md={4}>\n <InsightsCard\n count={\n service?.metrics !== undefined && service?.metrics?.length > 0\n ? service?.metrics[0].total_incident_count\n : undefined\n }\n label=\"incidents\"\n color={theme.palette.error.main}\n />\n </Grid>\n </Grid>\n <Grid item md={3}>\n <ServiceStandardsCard\n total={service?.standards?.score?.total}\n completed={service?.standards?.score?.passing}\n standards={service?.standards?.standards}\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 </>\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","useAsyncFn","makeStyles","Alert","PagerDutyCard","InsightsCard"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,yBAA4B,GAAA,+BAAA,CAAA;AAClC,MAAM,oBAAuB,GAAA,0BAAA;;ACI7B,SAAS,mBAAmB,MAAiC,EAAA;AAClE,EAAM,MAAA;AAAA,IACJ,CAAC,yBAAyB,GAAG,cAAA;AAAA,IAC7B,CAAC,oBAAoB,GAAG,SAAA;AAAA,GACtB,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,IAAgB,EAAC,CAAA;AACrC,EAAM,MAAA,IAAA,GAAO,OAAO,QAAS,CAAA,IAAA,CAAA;AAE7B,EAAO,OAAA,EAAE,cAAgB,EAAA,SAAA,EAAW,IAAK,EAAA,CAAA;AAC3C;;ACUO,MAAM,0BAA0B,KAAM,CAAA;AAAC,CAAA;AAGvC,MAAMA,yBAAuB,KAAM,CAAA;AAAE,CAAA;AAGrC,MAAM,kBAAkB,YAA2B,CAAA;AAAA,EACxD,EAAI,EAAA,sBAAA;AACN,CAAC,EAAA;AAGM,MAAM,eAAwC,CAAA;AAAA,EAkBnD,YAA6B,MAAkC,EAAA;AAAlC,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAAA,GAAmC;AAAA,EAjBhE,OAAO,UACL,CAAA,SAAA,EACA,YACA,EAAA;AArDJ,IAAA,IAAA,EAA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