@pagerduty/backstage-plugin 0.9.4-next.1 → 0.9.4-next.3

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { P as PagerDutyCard } from './index-46807363.esm.js';
2
+ import { P as PagerDutyCard } from './index-b664ea6c.esm.js';
3
3
  import '@backstage/core-plugin-api';
4
4
  import '@backstage/errors';
5
5
  import '@backstage/plugin-home-react';
@@ -30,4 +30,4 @@ const Content = (props) => {
30
30
  };
31
31
 
32
32
  export { Content };
33
- //# sourceMappingURL=index-b2ba10a3.esm.js.map
33
+ //# sourceMappingURL=index-9209930a.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-b2ba10a3.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;;;;"}
1
+ {"version":3,"file":"index-9209930a.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;;;;"}
@@ -194,7 +194,7 @@ const HomePagePagerDutyCard = pagerDutyPlugin.provide(
194
194
  createCardExtension({
195
195
  name: "HomePagePagerDutyCard",
196
196
  title: "PagerDuty Homepage Card",
197
- components: () => import('./index-b2ba10a3.esm.js'),
197
+ components: () => import('./index-9209930a.esm.js'),
198
198
  settings: {
199
199
  schema: {
200
200
  title: "PagerDuty",
@@ -458,7 +458,7 @@ const EscalationPolicy = ({ policyId }) => {
458
458
  if (!(users == null ? void 0 : users.length)) {
459
459
  return /* @__PURE__ */ React.createElement(EscalationUsersEmptyState, null);
460
460
  }
461
- return /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL") }, users.map((user, index) => /* @__PURE__ */ React.createElement(EscalationUser, { key: index, user })));
461
+ return /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL"), style: { marginLeft: "-15px" } }, users.map((user, index) => /* @__PURE__ */ React.createElement(EscalationUser, { key: index, user })));
462
462
  };
463
463
 
464
464
  const MissingTokenError = () => /* @__PURE__ */ React.createElement(
@@ -849,13 +849,36 @@ const PagerDutyCard$1 = (props) => {
849
849
  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" }),
850
850
  action: !readOnly ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(TriggerIncidentButton, null), /* @__PURE__ */ React.createElement(OpenServiceButton, { serviceUrl: service.url })) : /* @__PURE__ */ React.createElement(OpenServiceButton, { serviceUrl: service.url })
851
851
  }
852
- ), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, style: { display: "flex", margin: "15px" } }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(Typography, { style: { fontSize: "16px", fontWeight: "bold" } }, "STATUS")), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6 }, /* @__PURE__ */ React.createElement(Typography, { style: { fontSize: "16px", fontWeight: "bold" } }, "INCIDENT HISTORY")), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(
852
+ ), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 12, style: { display: "flex", margin: "15px", marginBottom: "20px" } }, /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(
853
853
  Typography,
854
854
  {
855
855
  style: {
856
- fontSize: "16px",
857
- fontWeight: "bold",
858
- marginLeft: "10px"
856
+ fontSize: "14px",
857
+ fontWeight: "500",
858
+ color: "rgba(0, 0, 0, 0.54)"
859
+ // rgba(255, 255, 255, 0.7)
860
+ }
861
+ },
862
+ "STATUS"
863
+ )), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 6 }, /* @__PURE__ */ React.createElement(
864
+ Typography,
865
+ {
866
+ style: {
867
+ fontSize: "14px",
868
+ fontWeight: "500",
869
+ color: "rgba(0, 0, 0, 0.54)"
870
+ // rgba(255, 255, 255, 0.7)
871
+ }
872
+ },
873
+ "INCIDENT HISTORY"
874
+ )), /* @__PURE__ */ React.createElement(Grid, { item: true, md: 3 }, /* @__PURE__ */ React.createElement(
875
+ Typography,
876
+ {
877
+ style: {
878
+ fontSize: "14px",
879
+ fontWeight: "500",
880
+ color: "rgba(0, 0, 0, 0.54)"
881
+ // rgba(255, 255, 255, 0.7)
859
882
  }
860
883
  },
861
884
  "SERVICE STANDARDS"
@@ -870,9 +893,9 @@ const PagerDutyCard$1 = (props) => {
870
893
  Card,
871
894
  {
872
895
  style: {
873
- background: "darkRed",
874
- marginRight: "20px",
875
- height: "150px",
896
+ background: theme.palette.error.main,
897
+ marginRight: "10px",
898
+ height: "120px",
876
899
  display: "flex",
877
900
  alignItems: "center",
878
901
  justifyContent: "center"
@@ -885,20 +908,6 @@ const PagerDutyCard$1 = (props) => {
885
908
  style: { color: "white", fontWeight: "bold" }
886
909
  },
887
910
  "ALARM"
888
- ),
889
- /* @__PURE__ */ React.createElement(
890
- Typography,
891
- {
892
- style: {
893
- alignSelf: "start",
894
- position: "absolute",
895
- verticalAlign: "bottom",
896
- marginTop: "120px",
897
- marginLeft: "10px",
898
- color: "white"
899
- }
900
- },
901
- "Last triggered 8 minutes ago"
902
911
  )
903
912
  )),
904
913
  /* @__PURE__ */ React.createElement(
@@ -918,18 +927,19 @@ const PagerDutyCard$1 = (props) => {
918
927
  {
919
928
  style: {
920
929
  marginRight: "10px",
921
- height: "150px",
930
+ height: "120px",
922
931
  display: "flex",
923
932
  alignItems: "center",
924
- justifyContent: "center"
933
+ justifyContent: "center",
934
+ backgroundColor: "rgba(0, 0, 0, 0.03)"
925
935
  }
926
936
  },
927
937
  /* @__PURE__ */ React.createElement(
928
938
  Typography,
929
939
  {
930
940
  style: {
931
- color: "red",
932
- fontSize: "50px"
941
+ color: theme.palette.error.main,
942
+ fontSize: "40px"
933
943
  }
934
944
  },
935
945
  "1"
@@ -938,7 +948,7 @@ const PagerDutyCard$1 = (props) => {
938
948
  Typography,
939
949
  {
940
950
  style: {
941
- color: "red",
951
+ color: theme.palette.error.main,
942
952
  fontWeight: "bold",
943
953
  fontSize: "10px"
944
954
  }
@@ -951,18 +961,19 @@ const PagerDutyCard$1 = (props) => {
951
961
  {
952
962
  style: {
953
963
  marginRight: "10px",
954
- height: "150px",
964
+ height: "120px",
955
965
  display: "flex",
956
966
  alignItems: "center",
957
- justifyContent: "center"
967
+ justifyContent: "center",
968
+ backgroundColor: "rgba(0, 0, 0, 0.03)"
958
969
  }
959
970
  },
960
971
  /* @__PURE__ */ React.createElement(
961
972
  Typography,
962
973
  {
963
974
  style: {
964
- color: "orange",
965
- fontSize: "50px"
975
+ color: theme.palette.warning.main,
976
+ fontSize: "40px"
966
977
  }
967
978
  },
968
979
  "1"
@@ -971,7 +982,7 @@ const PagerDutyCard$1 = (props) => {
971
982
  Typography,
972
983
  {
973
984
  style: {
974
- color: "orange",
985
+ color: theme.palette.warning.main,
975
986
  fontWeight: "bold",
976
987
  fontSize: "10px"
977
988
  }
@@ -984,18 +995,19 @@ const PagerDutyCard$1 = (props) => {
984
995
  {
985
996
  style: {
986
997
  marginRight: "10px",
987
- height: "150px",
998
+ height: "120px",
988
999
  display: "flex",
989
1000
  alignItems: "center",
990
- justifyContent: "center"
1001
+ justifyContent: "center",
1002
+ backgroundColor: "rgba(0, 0, 0, 0.03)"
991
1003
  }
992
1004
  },
993
1005
  /* @__PURE__ */ React.createElement(
994
1006
  Typography,
995
1007
  {
996
1008
  style: {
997
- color: "green",
998
- fontSize: "50px"
1009
+ color: theme.palette.success.main,
1010
+ fontSize: "40px"
999
1011
  }
1000
1012
  },
1001
1013
  "43"
@@ -1004,7 +1016,7 @@ const PagerDutyCard$1 = (props) => {
1004
1016
  Typography,
1005
1017
  {
1006
1018
  style: {
1007
- color: "green",
1019
+ color: theme.palette.success.main,
1008
1020
  fontWeight: "bold",
1009
1021
  fontSize: "10px"
1010
1022
  }
@@ -1017,9 +1029,10 @@ const PagerDutyCard$1 = (props) => {
1017
1029
  Card,
1018
1030
  {
1019
1031
  style: {
1020
- height: "150px",
1032
+ height: "120px",
1021
1033
  display: "grid",
1022
- gridTemplateRows: "1fr auto auto"
1034
+ gridTemplateRows: "1fr auto auto",
1035
+ backgroundColor: "rgba(0, 0, 0, 0.03)"
1023
1036
  }
1024
1037
  },
1025
1038
  /* @__PURE__ */ React.createElement(
@@ -1027,8 +1040,7 @@ const PagerDutyCard$1 = (props) => {
1027
1040
  {
1028
1041
  style: {
1029
1042
  display: "flex",
1030
- justifyContent: "center",
1031
- marginTop: "30px"
1043
+ justifyContent: "center"
1032
1044
  }
1033
1045
  },
1034
1046
  /* @__PURE__ */ React.createElement(
@@ -1036,7 +1048,8 @@ const PagerDutyCard$1 = (props) => {
1036
1048
  {
1037
1049
  style: {
1038
1050
  fontSize: "50px",
1039
- color: "black",
1051
+ color: "rgba(0, 0, 0, 0.7)",
1052
+ // rgba(255, 255, 255, 0.7)
1040
1053
  fontWeight: "bold",
1041
1054
  alignSelf: "center",
1042
1055
  justifyContent: "center"
@@ -1049,7 +1062,9 @@ const PagerDutyCard$1 = (props) => {
1049
1062
  {
1050
1063
  variant: "body1",
1051
1064
  style: {
1052
- color: "black",
1065
+ fontWeight: "500",
1066
+ color: "rgba(0, 0, 0, 0.7)",
1067
+ // rgba(255, 255, 255, 0.7)
1053
1068
  alignSelf: "center",
1054
1069
  justifyContent: "center",
1055
1070
  marginLeft: "1px",
@@ -1059,18 +1074,6 @@ const PagerDutyCard$1 = (props) => {
1059
1074
  "/5"
1060
1075
  )
1061
1076
  ),
1062
- /* @__PURE__ */ React.createElement("div", { style: { display: "flex", flexDirection: "row-reverse" } }, /* @__PURE__ */ React.createElement(
1063
- Typography,
1064
- {
1065
- style: {
1066
- justifyContent: "end",
1067
- color: "gray",
1068
- textDecoration: "underline",
1069
- marginRight: "5px"
1070
- }
1071
- },
1072
- "See service standards"
1073
- )),
1074
1077
  /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
1075
1078
  LinearProgress,
1076
1079
  {
@@ -1179,4 +1182,4 @@ function TriggerButton(props) {
1179
1182
  const PagerDutyCard = EntityPagerDutyCard;
1180
1183
 
1181
1184
  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 };
1182
- //# sourceMappingURL=index-46807363.esm.js.map
1185
+ //# sourceMappingURL=index-b664ea6c.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-b664ea6c.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/TriggerDialog/TriggerDialog.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/PagerDutyCard/TriggerIncidentButton.tsx","../../src/components/PagerDutyCard/OpenServiceButton.tsx","../../src/components/PagerDutyCard/index.tsx","../../src/components/EntityPagerDutyCard/index.tsx","../../src/components/TriggerButton/index.tsx","../../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const PAGERDUTY_INTEGRATION_KEY = 'pagerduty.com/integration-key';\nexport const PAGERDUTY_SERVICE_ID = 'pagerduty.com/service-id';\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { PagerDutyEntity } from '../types';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from './constants';\n\nexport function getPagerDutyEntity(entity: Entity): PagerDutyEntity {\n const {\n [PAGERDUTY_INTEGRATION_KEY]: integrationKey,\n [PAGERDUTY_SERVICE_ID]: serviceId,\n } = entity.metadata.annotations || ({} as Record<string, string>);\n const name = entity.metadata.name;\n\n return { integrationKey, serviceId, name };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n PagerDutyApi,\n PagerDutyTriggerAlarmRequest,\n PagerDutyClientApiDependencies,\n PagerDutyClientApiConfig,\n RequestOptions,\n} from './types';\nimport { PagerDutyChangeEventsResponse, \n PagerDutyOnCallUsersResponse, \n PagerDutyUser, \n PagerDutyServiceResponse,\n PagerDutyIncidentsResponse \n} from '@pagerduty/backstage-plugin-common';\nimport { createApiRef, ConfigApi } from '@backstage/core-plugin-api';\nimport { NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\nimport { PagerDutyEntity } from '../types';\n\n/** @public */\nexport class UnauthorizedError extends Error {}\n\n/** @public */\nexport class ForbiddenError extends Error { }\n\n/** @public */\nexport const pagerDutyApiRef = createApiRef<PagerDutyApi>({\n id: 'plugin.pagerduty.api',\n});\n\n/** @public */\nexport class PagerDutyClient implements PagerDutyApi {\n static fromConfig(\n configApi: ConfigApi,\n dependencies: PagerDutyClientApiDependencies,\n ) {\n const { discoveryApi, fetchApi } = dependencies;\n\n const eventsBaseUrl: string =\n configApi.getOptionalString('pagerDuty.eventsBaseUrl') ??\n 'https://events.pagerduty.com/v2';\n\n return new PagerDutyClient({\n eventsBaseUrl,\n discoveryApi,\n fetchApi,\n });\n }\n\n constructor(private readonly config: PagerDutyClientApiConfig) {}\n\n async getServiceByPagerDutyEntity(\n pagerDutyEntity: PagerDutyEntity,\n ): Promise<PagerDutyServiceResponse> {\n const { integrationKey, serviceId } = pagerDutyEntity;\n\n let response: PagerDutyServiceResponse;\n let url: string;\n\n if (integrationKey) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services?integration_key=${integrationKey}`;\n const serviceResponse = await this.findByUrl<PagerDutyServiceResponse>(url);\n\n if (serviceResponse.service === undefined) throw new NotFoundError();\n\n response = serviceResponse;\n } else if (serviceId) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}`;\n\n response = await this.findByUrl<PagerDutyServiceResponse>(url);\n } else {\n throw new NotFoundError();\n }\n\n return response;\n }\n\n async getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse> {\n return await this.getServiceByPagerDutyEntity(getPagerDutyEntity(entity));\n }\n async getIncidentsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyIncidentsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/incidents`;\n\n return await this.findByUrl<PagerDutyIncidentsResponse>(url);\n }\n\n async getChangeEventsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyChangeEventsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/change-events`;\n\n return await this.findByUrl<PagerDutyChangeEventsResponse>(url);\n }\n\n async getOnCallByPolicyId(\n policyId: string,\n ): Promise<PagerDutyUser[]> {\n const params = `escalation_policy_ids[]=${policyId}`;\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/oncall-users?${params}`;\n\n const response: PagerDutyOnCallUsersResponse = await this.findByUrl<PagerDutyOnCallUsersResponse>(url);\n return response.users;\n }\n\n triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response> {\n const { integrationKey, source, description, userName } = request;\n\n const body = JSON.stringify({\n event_action: 'trigger',\n routing_key: integrationKey,\n client: 'Backstage',\n client_url: source,\n payload: {\n summary: description,\n source: source,\n severity: 'error',\n class: 'manual trigger',\n custom_details: {\n user: userName,\n },\n },\n });\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8',\n Accept: 'application/json, text/plain, */*',\n },\n body,\n };\n\n const url = this.config.eventsBaseUrl ?? 'https://events.pagerduty.com/v2';\n\n return this.request(`${url}/enqueue`, options);\n }\n\n private async findByUrl<T>(url: string): Promise<T> {\n const options = {\n method: 'GET',\n headers: {\n Accept: 'application/vnd.pagerduty+json;version=2',\n 'Content-Type': 'application/json',\n },\n };\n const response = await this.request(url, options);\n return response.json();\n }\n\n private async request(\n url: string,\n options: RequestOptions,\n ): Promise<Response> {\n const response = await this.config.fetchApi.fetch(url, options);\n if (response.status === 401) {\n throw new UnauthorizedError(\"Unauthorized: You don't have access to this resource\");\n }\n\n if (response.status === 403) {\n throw new ForbiddenError(\"Forbidden: You are not allowed to perform this action\");\n }\n\n if (response.status === 404) {\n throw new NotFoundError(\"Not Found: Resource not found\");\n }\n\n if (!response.ok) {\n const payload = await response.json();\n const errors = payload.errors.map((error: string) => error).join(' ');\n const message = `Request failed with ${response.status}, ${errors}`;\n throw new Error(message);\n }\n return response;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pagerDutyApiRef, PagerDutyClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n configApiRef,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\nimport { createCardExtension } from '@backstage/plugin-home-react';\nimport { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';\n\nexport const rootRouteRef = createRouteRef({\n id: 'pagerduty',\n});\n\n/** @public */\nexport const pagerDutyPlugin = createPlugin({\n id: 'pagerduty',\n apis: [\n createApiFactory({\n api: pagerDutyApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const EntityPagerDutyCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutyCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutyCard').then(\n m => m.EntityPagerDutyCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const HomePagePagerDutyCard = pagerDutyPlugin.provide(\n createCardExtension<HomePagePagerDutyCardProps>({\n name: 'HomePagePagerDutyCard',\n title: 'PagerDuty Homepage Card',\n components: () => import('./components/HomePagePagerDutyCard'),\n settings: {\n schema: {\n title: 'PagerDuty',\n type: 'object',\n properties: {\n integrationKey: {\n title: 'PagerDuty integration key',\n type: 'string',\n },\n serviceId: {\n title: 'PagerDuty service id',\n type: 'string',\n },\n name: {\n title: 'PagerDuty service name',\n type: 'string',\n },\n },\n },\n },\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n Chip,\n} from '@material-ui/core';\nimport Done from '@material-ui/icons/Done';\nimport Warning from '@material-ui/icons/Warning';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyIncident } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n warning: {\n borderColor: theme.palette.status.warning,\n color: theme.palette.status.warning,\n '& *': {\n color: theme.palette.status.warning,\n },\n },\n error: {\n borderColor: theme.palette.status.error,\n color: theme.palette.status.error,\n '& *': {\n color: theme.palette.status.error,\n },\n },\n}));\n\ntype Props = {\n incident: PagerDutyIncident;\n};\n\nexport const IncidentListItem = ({ incident }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(incident.created_at).getTime();\n const createdAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n const user = incident.assignments[0]?.assignee;\n\n return (\n <ListItem dense key={incident.id}>\n <ListItemText\n primary={\n <>\n <Chip\n data-testid={`chip-${incident.status}`}\n label={incident.status}\n size=\"small\"\n variant=\"outlined\"\n icon={incident.status === 'acknowledged' ? <Done /> : <Warning />}\n className={\n incident.status === 'triggered'\n ? classes.error\n : classes.warning\n }\n />\n {incident.title}\n </>\n }\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography noWrap variant=\"body2\" color=\"textSecondary\">\n Created {createdAt} and assigned to{' '}\n <Link to={user?.html_url ?? '#'}>{user?.summary ?? 'nobody'}</Link>\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={incident.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from \"../../assets/emptystate.svg\";\n\nexport const IncidentsEmptyState = () => {\n return (\n <Grid\n container\n justifyContent=\"center\"\n direction=\"column\"\n alignItems=\"center\"\n >\n <Grid item xs={12}>\n <Typography variant=\"h5\">Nice! No incidents found!</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const IncidentForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { IncidentListItem } from './IncidentListItem';\nimport { IncidentsEmptyState } from './IncidentEmptyState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { IncidentForbiddenState } from './IncidentForbiddenState';\n\ntype Props = {\n serviceId: string;\n refreshIncidents: boolean;\n};\n\nexport const Incidents = ({ serviceId, refreshIncidents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: incidents, loading, error }, getIncidents] = useAsyncFn(\n async () => {\n const { incidents: foundIncidents } = await api.getIncidentsByServiceId(\n serviceId,\n );\n return foundIncidents;\n },\n );\n\n useEffect(() => {\n getIncidents();\n }, [refreshIncidents, getIncidents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <IncidentForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!incidents?.length) {\n return <IncidentsEmptyState />;\n }\n\n return (\n <List dense>\n {incidents!.map((incident, index) => (\n <IncidentListItem key={incident.id + index} incident={incident} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusWarning } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersEmptyState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusWarning />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"No one is on-call. Update the escalation policy.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusError } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersForbiddenState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusError />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"You don't permissions to list on-calls. Check your OAuth token permissions.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport Avatar from '@material-ui/core/Avatar';\nimport { PagerDutyUser } from '@pagerduty/backstage-plugin-common';\nimport NotificationsIcon from \"@material-ui/icons/Notifications\";\nimport { BackstageTheme } from '@backstage/theme';\nimport MailOutline from '@material-ui/icons/MailOutline';\nimport OpenInBrowser from '@material-ui/icons/OpenInBrowser';\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n listItemPrimary: {\n fontWeight: \"bold\",\n },\n listItemSecondary: {\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n marginTop: \"-5px\",\n },\n buttonStyle: {\n marginLeft: \"-11px\",\n marginTop: \"-10px\",\n fontSize: \"15px\",\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n display: \"flex\",\n alignItems: \"center\",\n fontWeight: \"bold\",\n },\n iconStyle: {\n fontSize: \"25px\",\n marginLeft: \"-4px\",\n color: theme.palette.text.primary,\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n }\n}));\n\ntype Props = {\n user: PagerDutyUser;\n};\n\nexport const EscalationUser = ({ user }: Props) => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemIcon>\n <Avatar alt={user.name} src={user.avatar_url} />\n </ListItemIcon>\n <ListItemText\n primary={\n <>\n <Typography className={classes.listItemPrimary}>\n {user.name}\n </Typography>\n <Typography\n className={classes.listItemSecondary}\n color=\"textSecondary\"\n >\n {user.email}\n </Typography>\n </>\n }\n secondary={\n <IconButton\n aria-label=\"open-service-in-browser\"\n // onClick={navigateToService}\n className={classes.buttonStyle}\n >\n <span className={classes.containerStyle}>\n <NotificationsIcon className={classes.iconStyle} />\n Web Team\n </span>\n </IconButton>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"Send e-mail to user\" placement=\"top\">\n <IconButton href={`mailto:${user.email}`}>\n <MailOutline className={classes.smallIconStyle} />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={user.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={classes.smallIconStyle}\n >\n <OpenInBrowser />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { List, ListSubheader } from '@material-ui/core';\nimport { EscalationUsersEmptyState } from './EscalationUsersEmptyState';\nimport { EscalationUsersForbiddenState } from './EscalationUsersForbiddenState';\nimport { EscalationUser } from './EscalationUser';\nimport useAsync from 'react-use/lib/useAsync';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\n\ntype Props = {\n policyId: string;\n};\n\nexport const EscalationPolicy = ({ policyId }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const {\n value: users,\n loading,\n error,\n } = useAsync(async () => {\n return await api.getOnCallByPolicyId(policyId);\n });\n\n if (error) {\n if (error.message.includes(\"Forbidden\")) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <EscalationUsersForbiddenState />\n </List>\n );\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!users?.length) {\n return <EscalationUsersEmptyState />;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>} style={{marginLeft: \"-15px\"}}>\n {users!.map((user, index) => (\n <EscalationUser key={index} user={user} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const MissingTokenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Missing or invalid PagerDuty Token\"\n description=\"The request to fetch data needs a valid token. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ServiceNotFoundError = () => (\n <EmptyState\n missing=\"data\"\n title=\"PagerDuty Service Not Found\"\n description=\"A service could not be found within PagerDuty based on the provided service id. Please verify your configuration.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { 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 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyChangeEvent } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n});\n\ntype Props = {\n changeEvent: PagerDutyChangeEvent;\n};\n\nexport const ChangeEventListItem = ({ changeEvent }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(changeEvent.timestamp).getTime();\n const changedAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n let externalLinkElem: JSX.Element | undefined;\n if (changeEvent.links.length > 0) {\n const text: string = changeEvent.links[0].text;\n externalLinkElem = (\n <Tooltip title={text} placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.links[0].href}\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n );\n }\n\n return (\n <ListItem dense key={changeEvent.id}>\n <ListItemText\n primary={<>{changeEvent.summary}</>}\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography variant=\"body2\" color=\"textSecondary\">\n Triggered from {changeEvent.source} {changedAt}.\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n {externalLinkElem}\n {changeEvent.html_url === undefined ? null : (\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.html_url}\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n )}\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from '../../assets/emptystate.svg';\n\nexport const ChangeEventEmptyState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">No change events to display yet.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const ChangeEventForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { ChangeEventListItem } from './ChangeEventListItem';\nimport { ChangeEventEmptyState } from './ChangeEventEmptyState';\nimport { ChangeEventForbiddenState } from './ChangeEventForbiddenState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { Alert } from '@material-ui/lab';\n\ntype Props = {\n serviceId: string;\n refreshEvents: boolean;\n};\n\nexport const ChangeEvents = ({ serviceId, refreshEvents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(\n async () => {\n const { change_events } = await api.getChangeEventsByServiceId(serviceId);\n return change_events;\n },\n );\n\n useEffect(() => {\n getChangeEvents();\n }, [refreshEvents, getChangeEvents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <ChangeEventForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!changeEvents?.length) {\n return <ChangeEventEmptyState />;\n }\n\n return (\n <List dense>\n {changeEvents!.map((changeEvent, index) => (\n <ChangeEventListItem\n key={changeEvent.id + index}\n changeEvent={changeEvent}\n />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ForbiddenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Unauthorized\"\n description=\"You don't have the required permissions to perform this action. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { PagerDutyEntity } from '../types';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\n\nexport function usePagerdutyEntity(): PagerDutyEntity {\n const { entity } = useEntity();\n\n return getPagerDutyEntity(entity);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, useState } from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\nimport { usePagerdutyEntity } from \"../../hooks\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport AddAlert from \"@material-ui/icons/AddAlert\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex !important\",\n fontSize: \"14px\",\n width: \"80px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\"\n }\n}));\n\n/** @public */\nexport function TriggerIncidentButton() {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <IconButton\n aria-label=\"create-incident\"\n onClick={showDialog}\n className={disabled ? \"\" : buttonStyle}\n disabled={disabled}\n >\n <div className={containerStyle}>\n <AddAlert className={iconStyle} />\n <p>Create New Incident</p>\n </div>\n </IconButton>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\n// import React, { useCallback, useState } from \"react\";\nimport React from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\n// import { usePagerdutyEntity } from \"../../hooks\";\n// import { TriggerDialog } from \"../TriggerDialog\";\nimport OpenInBrowser from \"@material-ui/icons/OpenInBrowser\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex\",\n fontSize: \"14px\",\n width: \"85px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\",\n },\n}));\n\n/** @public */\nexport function OpenServiceButton(props: { serviceUrl: string}) {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n // const { integrationKey, name } = usePagerdutyEntity();\n // const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n // const hideDialog = useCallback(() => {\n // setDialogShown(false);\n // }, [setDialogShown]);\n\n function navigateToService() {\n window.open(props.serviceUrl, \"_blank\");\n }\n\n return (\n <>\n <IconButton\n aria-label=\"open-service-in-browser\"\n onClick={navigateToService}\n className={buttonStyle}\n >\n <div className={containerStyle}>\n <OpenInBrowser className={iconStyle} />\n <p>Open service in PagerDuty</p>\n </div>\n </IconButton>\n {/* {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )} */}\n </>\n );\n}\n","/*\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, useState, useCallback } from \"react\";\nimport {\n Card,\n CardHeader,\n Divider,\n CardContent,\n Grid,\n // Theme,\n // CardActionArea,\n // CardActions,\n // ThemeProvider,\n // IconButton,\n // IconButtonProps,\n Typography,\n // CardMedia,\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\";\n// import AlarmAddIcon from \"@material-ui/icons/AlarmAdd\";\nimport { MissingTokenError, ServiceNotFoundError } from \"../Errors\";\n// import WebIcon from \"@material-ui/icons/Web\";\n// import DateRangeIcon from \"@material-ui/icons/DateRange\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport { ChangeEvents } from \"../ChangeEvents\";\nimport PDGreenImage from \"../../assets/PD-Green.svg\";\nimport PDWhiteImage from \"../../assets/PD-White.svg\";\n\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { NotFoundError } from \"@backstage/errors\";\nimport {\n Progress,\n // HeaderIconLinkRow,\n // IconLinkVerticalProps,\n TabbedCard,\n CardTab,\n InfoCard,\n} from \"@backstage/core-components\";\nimport { PagerDutyEntity } from \"../../types\";\nimport { ForbiddenError } from \"../Errors/ForbiddenError\";\nimport { TriggerIncidentButton } from \"./TriggerIncidentButton\";\nimport { OpenServiceButton } from \"./OpenServiceButton\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport LinearProgress from \"@material-ui/core/LinearProgress\";\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 theme = useTheme();\n const { readOnly, disableChangeEvents, integrationKey, name } = props;\n const api = useApi(pagerDutyApiRef);\n const [refreshIncidents, setRefreshIncidents] = useState<boolean>(false);\n const [refreshChangeEvents, setRefreshChangeEvents] =\n useState<boolean>(false);\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const handleRefresh = useCallback(() => {\n setRefreshIncidents((x) => !x);\n setRefreshChangeEvents((x) => !x);\n }, []);\n\n const {\n value: service,\n loading,\n error,\n } = useAsync(async () => {\n const { service: foundService } = await api.getServiceByPagerDutyEntity(\n props\n );\n\n return {\n id: foundService.id,\n name: foundService.name,\n url: foundService.html_url,\n policyId: foundService.escalation_policy.id,\n policyLink: foundService.escalation_policy.html_url,\n };\n }, [props]);\n\n if (error) {\n let errorNode: ReactNode;\n\n switch (error.constructor) {\n case UnauthorizedError:\n errorNode = <MissingTokenError />;\n break;\n case NotFoundError:\n errorNode = <ServiceNotFoundError />;\n break;\n default:\n errorNode = <ForbiddenError />;\n }\n\n return <BasicCard>{errorNode}</BasicCard>;\n }\n\n if (loading) {\n return (\n <BasicCard>\n <Progress />\n </BasicCard>\n );\n }\n\n /**\n * In order to create incidents using the REST API, a valid user email address must be present.\n * There is no guarantee the current user entity has a valid email association, so instead just\n * only allow triggering incidents when an integration key is present.\n */\n const createIncidentDisabled = !integrationKey;\n\n return (\n <>\n <Card data-testid=\"pagerduty-card\">\n <CardHeader\n style={{ marginRight: \"1em\" }}\n title={\n theme.palette.type === \"dark\" ? (\n <img src={PDWhiteImage} alt=\"PagerDuty\" height=\"35\" />\n ) : (\n <img src={PDGreenImage} alt=\"PagerDuty\" height=\"35\" />\n )\n }\n action={\n !readOnly ? (\n <div>\n <TriggerIncidentButton />\n <OpenServiceButton serviceUrl={service!.url} />\n </div>\n ) : (\n <OpenServiceButton serviceUrl={service!.url} />\n )\n }\n />\n <Grid item md={12} style={{ display: \"flex\", margin: \"15px\", marginBottom: \"20px\" }}>\n <Grid item md={3}>\n <Typography\n style={{\n fontSize: \"14px\",\n fontWeight: \"500\",\n color: \"rgba(0, 0, 0, 0.54)\", // rgba(255, 255, 255, 0.7)\n }}\n >\n STATUS\n </Typography>\n </Grid>\n <Grid item md={6}>\n <Typography\n style={{\n fontSize: \"14px\",\n fontWeight: \"500\",\n color: \"rgba(0, 0, 0, 0.54)\", // rgba(255, 255, 255, 0.7)\n }}\n >\n INCIDENT HISTORY\n </Typography>\n </Grid>\n <Grid item md={3}>\n <Typography\n style={{\n fontSize: \"14px\",\n fontWeight: \"500\",\n color: \"rgba(0, 0, 0, 0.54)\", // rgba(255, 255, 255, 0.7)\n }}\n >\n SERVICE STANDARDS\n </Typography>\n </Grid>\n </Grid>\n <Grid\n item\n md={12}\n style={{ display: \"flex\", margin: \"15px\", marginTop: \"-15px\" }}\n >\n <Grid item md={3}>\n <Card\n style={{\n background: theme.palette.error.main,\n marginRight: \"10px\",\n height: \"120px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n variant=\"h3\"\n style={{ color: \"white\", fontWeight: \"bold\" }}\n >\n ALARM\n </Typography>\n </Card>\n </Grid>\n <Grid\n item\n md={6}\n style={{\n display: \"flex\",\n height: \"100%\",\n justifyContent: \"center\",\n columnSpan: \"all\",\n }}\n >\n <Grid md={4} style={{ height: \"100%\" }}>\n <Card\n style={{\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 >\n <Typography\n style={{\n color: theme.palette.error.main,\n fontSize: \"40px\",\n }}\n >\n 1\n </Typography>\n <Typography\n style={{\n color: theme.palette.error.main,\n fontWeight: \"bold\",\n fontSize: \"10px\",\n }}\n >\n TRIGGERED\n </Typography>\n </Card>\n </Grid>\n <Grid md={4}>\n <Card\n style={{\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 >\n <Typography\n style={{\n color: theme.palette.warning.main,\n fontSize: \"40px\",\n }}\n >\n 1\n </Typography>\n <Typography\n style={{\n color: theme.palette.warning.main,\n fontWeight: \"bold\",\n fontSize: \"10px\",\n }}\n >\n ACKNOWLEDGED\n </Typography>\n </Card>\n </Grid>\n <Grid md={4}>\n <Card\n style={{\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 >\n <Typography\n style={{\n color: theme.palette.success.main,\n fontSize: \"40px\",\n }}\n >\n 43\n </Typography>\n <Typography\n style={{\n color: theme.palette.success.main,\n fontWeight: \"bold\",\n fontSize: \"10px\",\n }}\n >\n RESOLVED\n </Typography>\n </Card>\n </Grid>\n </Grid>\n <Grid item md={3}>\n <Card\n style={{\n height: \"120px\",\n display: \"grid\",\n gridTemplateRows: \"1fr auto auto\",\n backgroundColor: \"rgba(0, 0, 0, 0.03)\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n style={{\n fontSize: \"50px\",\n color: \"rgba(0, 0, 0, 0.7)\", // rgba(255, 255, 255, 0.7)\n fontWeight: \"bold\",\n alignSelf: \"center\",\n justifyContent: \"center\",\n }}\n >\n 4\n </Typography>\n <Typography\n variant=\"body1\"\n style={{\n fontWeight: \"500\",\n color: \"rgba(0, 0, 0, 0.7)\", // rgba(255, 255, 255, 0.7)\n alignSelf: \"center\",\n justifyContent: \"center\",\n marginLeft: \"1px\",\n marginTop: \"20px\",\n }}\n >\n /5\n </Typography>\n </div>\n <div>\n <LinearProgress\n variant=\"determinate\"\n value={80}\n style={{\n margin: \"5px\",\n borderRadius: \"10px\",\n height: \"10px\",\n }}\n />\n </div>\n </Card>\n </Grid>\n </Grid>\n\n <Divider />\n <CardContent>\n <TabbedCard>\n <CardTab label=\"Incidents\">\n <Incidents\n serviceId={service!.id}\n refreshIncidents={refreshIncidents}\n />\n </CardTab>\n {disableChangeEvents !== true ? (\n <CardTab label=\"Change Events\">\n <ChangeEvents\n serviceId={service!.id}\n refreshEvents={refreshChangeEvents}\n />\n </CardTab>\n ) : (\n <></>\n )}\n </TabbedCard>\n <EscalationPolicy policyId={service!.policyId} />\n </CardContent>\n </Card>\n {!createIncidentDisabled && (\n <TriggerDialog\n data-testid=\"trigger-dialog\"\n showDialog={dialogShown}\n handleDialog={hideDialog}\n onIncidentCreated={handleRefresh}\n name={name}\n integrationKey={integrationKey}\n />\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from '../constants';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getPagerDutyEntity } from '../pagerDutyEntity';\nimport { PagerDutyCard } from '../PagerDutyCard';\n\n/** @public */\nexport const isPluginApplicableToEntity = (entity: Entity) =>\n Boolean(\n entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] ||\n entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID],\n );\n\n/** @public */\nexport type EntityPagerDutyCardProps = {\n readOnly?: boolean;\n disableChangeEvents?: boolean;\n};\n\n/** @public */\nexport const EntityPagerDutyCard = (props: EntityPagerDutyCardProps) => {\n const { readOnly, disableChangeEvents } = props;\n const { entity } = useEntity();\n const pagerDutyEntity = getPagerDutyEntity(entity);\n return (\n <PagerDutyCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableChangeEvents={disableChangeEvents}\n />\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, ReactNode, useState } from 'react';\nimport { makeStyles, Button } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\n\nimport { usePagerdutyEntity } from '../../hooks';\nimport { TriggerDialog } from '../TriggerDialog';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n buttonStyle: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText,\n '&:hover': {\n backgroundColor: theme.palette.error.dark,\n },\n },\n}));\n\n/** @public */\nexport function TriggerButton(props: { children?: ReactNode }) {\n const { buttonStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <Button\n onClick={showDialog}\n variant=\"contained\"\n className={disabled ? '' : buttonStyle}\n disabled={disabled}\n >\n {integrationKey\n ? props.children ?? 'Create Incident'\n : 'Missing integration key'}\n </Button>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EntityPagerDutyCardProps, EntityPagerDutyCard } from './components';\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCard\n */\nexport const PagerDutyCard = EntityPagerDutyCard;\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCardProps\n */\nexport type PagerDutyCardProps = EntityPagerDutyCardProps;\n"],"names":["ForbiddenError","EntityPagerDutyCard","useStyles","OpenInBrowser","PagerDutyCard"],"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;;ACQO,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;AAnDJ,IAAA,IAAA,EAAA,CAAA;AAoDI,IAAM,MAAA,EAAE,YAAc,EAAA,QAAA,EAAa,GAAA,YAAA,CAAA;AAEn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MAAM;AACnC,IAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAAA,GACrB,EAAG,CAAC,cAAc,CAAC,CAAA,CAAA;AACnB,EAAM,MAAA,UAAA,GAAa,YAAY,MAAM;AACnC,IAAA,cAAA,CAAe,KAAK,CAAA,CAAA;AAAA,GACtB,EAAG,CAAC,cAAc,CAAC,CAAA,CAAA;AAEnB,EAAA,MAAM,WAAW,CAAC,cAAA,CAAA;AAClB,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,UAAA;AAAA,MACT,OAAQ,EAAA,WAAA;AAAA,MACR,SAAA,EAAW,WAAW,EAAK,GAAA,WAAA;AAAA,MAC3B,QAAA;AAAA,KAAA;AAAA,IAEC,cACG,GAAA,CAAA,EAAA,GAAA,KAAA,CAAM,QAAN,KAAA,IAAA,GAAA,EAAA,GAAkB,iBAClB,GAAA,yBAAA;AAAA,KAEL,cACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,WAAA;AAAA,MACZ,YAAc,EAAA,UAAA;AAAA,MACd,cAAA;AAAA,MACA,IAAA;AAAA,KAAA;AAAA,GAGN,CAAA,CAAA;AAEJ;;AChDO,MAAM,aAAgB,GAAA;;;;"}
package/dist/index.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-46807363.esm.js';
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-b664ea6c.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.1",
4
+ "version": "0.9.4-next.3",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-46807363.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/TriggerDialog/TriggerDialog.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/PagerDutyCard/TriggerIncidentButton.tsx","../../src/components/PagerDutyCard/OpenServiceButton.tsx","../../src/components/PagerDutyCard/index.tsx","../../src/components/EntityPagerDutyCard/index.tsx","../../src/components/TriggerButton/index.tsx","../../src/deprecated.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const PAGERDUTY_INTEGRATION_KEY = 'pagerduty.com/integration-key';\nexport const PAGERDUTY_SERVICE_ID = 'pagerduty.com/service-id';\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { PagerDutyEntity } from '../types';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from './constants';\n\nexport function getPagerDutyEntity(entity: Entity): PagerDutyEntity {\n const {\n [PAGERDUTY_INTEGRATION_KEY]: integrationKey,\n [PAGERDUTY_SERVICE_ID]: serviceId,\n } = entity.metadata.annotations || ({} as Record<string, string>);\n const name = entity.metadata.name;\n\n return { integrationKey, serviceId, name };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n PagerDutyApi,\n PagerDutyTriggerAlarmRequest,\n PagerDutyClientApiDependencies,\n PagerDutyClientApiConfig,\n RequestOptions,\n} from './types';\nimport { PagerDutyChangeEventsResponse, \n PagerDutyOnCallUsersResponse, \n PagerDutyUser, \n PagerDutyServiceResponse,\n PagerDutyIncidentsResponse \n} from '@pagerduty/backstage-plugin-common';\nimport { createApiRef, ConfigApi } from '@backstage/core-plugin-api';\nimport { NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\nimport { PagerDutyEntity } from '../types';\n\n/** @public */\nexport class UnauthorizedError extends Error {}\n\n/** @public */\nexport class ForbiddenError extends Error { }\n\n/** @public */\nexport const pagerDutyApiRef = createApiRef<PagerDutyApi>({\n id: 'plugin.pagerduty.api',\n});\n\n/** @public */\nexport class PagerDutyClient implements PagerDutyApi {\n static fromConfig(\n configApi: ConfigApi,\n dependencies: PagerDutyClientApiDependencies,\n ) {\n const { discoveryApi, fetchApi } = dependencies;\n\n const eventsBaseUrl: string =\n configApi.getOptionalString('pagerDuty.eventsBaseUrl') ??\n 'https://events.pagerduty.com/v2';\n\n return new PagerDutyClient({\n eventsBaseUrl,\n discoveryApi,\n fetchApi,\n });\n }\n\n constructor(private readonly config: PagerDutyClientApiConfig) {}\n\n async getServiceByPagerDutyEntity(\n pagerDutyEntity: PagerDutyEntity,\n ): Promise<PagerDutyServiceResponse> {\n const { integrationKey, serviceId } = pagerDutyEntity;\n\n let response: PagerDutyServiceResponse;\n let url: string;\n\n if (integrationKey) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services?integration_key=${integrationKey}`;\n const serviceResponse = await this.findByUrl<PagerDutyServiceResponse>(url);\n\n if (serviceResponse.service === undefined) throw new NotFoundError();\n\n response = serviceResponse;\n } else if (serviceId) {\n url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}`;\n\n response = await this.findByUrl<PagerDutyServiceResponse>(url);\n } else {\n throw new NotFoundError();\n }\n\n return response;\n }\n\n async getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse> {\n return await this.getServiceByPagerDutyEntity(getPagerDutyEntity(entity));\n }\n async getIncidentsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyIncidentsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/incidents`;\n\n return await this.findByUrl<PagerDutyIncidentsResponse>(url);\n }\n\n async getChangeEventsByServiceId(\n serviceId: string,\n ): Promise<PagerDutyChangeEventsResponse> {\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/services/${serviceId}/change-events`;\n\n return await this.findByUrl<PagerDutyChangeEventsResponse>(url);\n }\n\n async getOnCallByPolicyId(\n policyId: string,\n ): Promise<PagerDutyUser[]> {\n const params = `escalation_policy_ids[]=${policyId}`;\n const url = `${await this.config.discoveryApi.getBaseUrl(\n 'pagerduty',\n )}/oncall-users?${params}`;\n\n const response: PagerDutyOnCallUsersResponse = await this.findByUrl<PagerDutyOnCallUsersResponse>(url);\n return response.users;\n }\n\n triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response> {\n const { integrationKey, source, description, userName } = request;\n\n const body = JSON.stringify({\n event_action: 'trigger',\n routing_key: integrationKey,\n client: 'Backstage',\n client_url: source,\n payload: {\n summary: description,\n source: source,\n severity: 'error',\n class: 'manual trigger',\n custom_details: {\n user: userName,\n },\n },\n });\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8',\n Accept: 'application/json, text/plain, */*',\n },\n body,\n };\n\n const url = this.config.eventsBaseUrl ?? 'https://events.pagerduty.com/v2';\n\n return this.request(`${url}/enqueue`, options);\n }\n\n private async findByUrl<T>(url: string): Promise<T> {\n const options = {\n method: 'GET',\n headers: {\n Accept: 'application/vnd.pagerduty+json;version=2',\n 'Content-Type': 'application/json',\n },\n };\n const response = await this.request(url, options);\n return response.json();\n }\n\n private async request(\n url: string,\n options: RequestOptions,\n ): Promise<Response> {\n const response = await this.config.fetchApi.fetch(url, options);\n if (response.status === 401) {\n throw new UnauthorizedError(\"Unauthorized: You don't have access to this resource\");\n }\n\n if (response.status === 403) {\n throw new ForbiddenError(\"Forbidden: You are not allowed to perform this action\");\n }\n\n if (response.status === 404) {\n throw new NotFoundError(\"Not Found: Resource not found\");\n }\n\n if (!response.ok) {\n const payload = await response.json();\n const errors = payload.errors.map((error: string) => error).join(' ');\n const message = `Request failed with ${response.status}, ${errors}`;\n throw new Error(message);\n }\n return response;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { pagerDutyApiRef, PagerDutyClient } from './api';\nimport {\n createApiFactory,\n createPlugin,\n createRouteRef,\n discoveryApiRef,\n fetchApiRef,\n configApiRef,\n createComponentExtension,\n} from '@backstage/core-plugin-api';\nimport { createCardExtension } from '@backstage/plugin-home-react';\nimport { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';\n\nexport const rootRouteRef = createRouteRef({\n id: 'pagerduty',\n});\n\n/** @public */\nexport const pagerDutyPlugin = createPlugin({\n id: 'pagerduty',\n apis: [\n createApiFactory({\n api: pagerDutyApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, discoveryApi, fetchApi }) =>\n PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const EntityPagerDutyCard = pagerDutyPlugin.provide(\n createComponentExtension({\n name: 'EntityPagerDutyCard',\n component: {\n lazy: () =>\n import('./components/EntityPagerDutyCard').then(\n m => m.EntityPagerDutyCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const HomePagePagerDutyCard = pagerDutyPlugin.provide(\n createCardExtension<HomePagePagerDutyCardProps>({\n name: 'HomePagePagerDutyCard',\n title: 'PagerDuty Homepage Card',\n components: () => import('./components/HomePagePagerDutyCard'),\n settings: {\n schema: {\n title: 'PagerDuty',\n type: 'object',\n properties: {\n integrationKey: {\n title: 'PagerDuty integration key',\n type: 'string',\n },\n serviceId: {\n title: 'PagerDuty service id',\n type: 'string',\n },\n name: {\n title: 'PagerDuty service name',\n type: 'string',\n },\n },\n },\n },\n }),\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n Chip,\n} from '@material-ui/core';\nimport Done from '@material-ui/icons/Done';\nimport Warning from '@material-ui/icons/Warning';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyIncident } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n warning: {\n borderColor: theme.palette.status.warning,\n color: theme.palette.status.warning,\n '& *': {\n color: theme.palette.status.warning,\n },\n },\n error: {\n borderColor: theme.palette.status.error,\n color: theme.palette.status.error,\n '& *': {\n color: theme.palette.status.error,\n },\n },\n}));\n\ntype Props = {\n incident: PagerDutyIncident;\n};\n\nexport const IncidentListItem = ({ incident }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(incident.created_at).getTime();\n const createdAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n const user = incident.assignments[0]?.assignee;\n\n return (\n <ListItem dense key={incident.id}>\n <ListItemText\n primary={\n <>\n <Chip\n data-testid={`chip-${incident.status}`}\n label={incident.status}\n size=\"small\"\n variant=\"outlined\"\n icon={incident.status === 'acknowledged' ? <Done /> : <Warning />}\n className={\n incident.status === 'triggered'\n ? classes.error\n : classes.warning\n }\n />\n {incident.title}\n </>\n }\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography noWrap variant=\"body2\" color=\"textSecondary\">\n Created {createdAt} and assigned to{' '}\n <Link to={user?.html_url ?? '#'}>{user?.summary ?? 'nobody'}</Link>\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={incident.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from \"../../assets/emptystate.svg\";\n\nexport const IncidentsEmptyState = () => {\n return (\n <Grid\n container\n justifyContent=\"center\"\n direction=\"column\"\n alignItems=\"center\"\n >\n <Grid item xs={12}>\n <Typography variant=\"h5\">Nice! No incidents found!</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const IncidentForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { IncidentListItem } from './IncidentListItem';\nimport { IncidentsEmptyState } from './IncidentEmptyState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { IncidentForbiddenState } from './IncidentForbiddenState';\n\ntype Props = {\n serviceId: string;\n refreshIncidents: boolean;\n};\n\nexport const Incidents = ({ serviceId, refreshIncidents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: incidents, loading, error }, getIncidents] = useAsyncFn(\n async () => {\n const { incidents: foundIncidents } = await api.getIncidentsByServiceId(\n serviceId,\n );\n return foundIncidents;\n },\n );\n\n useEffect(() => {\n getIncidents();\n }, [refreshIncidents, getIncidents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <IncidentForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!incidents?.length) {\n return <IncidentsEmptyState />;\n }\n\n return (\n <List dense>\n {incidents!.map((incident, index) => (\n <IncidentListItem key={incident.id + index} incident={incident} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusWarning } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersEmptyState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusWarning />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"No one is on-call. Update the escalation policy.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusError } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersForbiddenState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusError />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"You don't permissions to list on-calls. Check your OAuth token permissions.\" />\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport {\n ListItem,\n ListItemIcon,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport Avatar from '@material-ui/core/Avatar';\nimport { PagerDutyUser } from '@pagerduty/backstage-plugin-common';\nimport NotificationsIcon from \"@material-ui/icons/Notifications\";\nimport { BackstageTheme } from '@backstage/theme';\nimport MailOutline from '@material-ui/icons/MailOutline';\nimport OpenInBrowser from '@material-ui/icons/OpenInBrowser';\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n listItemPrimary: {\n fontWeight: \"bold\",\n },\n listItemSecondary: {\n fontWeight: \"normal\",\n textDecoration: \"underline\",\n marginTop: \"-5px\",\n },\n buttonStyle: {\n marginLeft: \"-11px\",\n marginTop: \"-10px\",\n fontSize: \"15px\",\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n display: \"flex\",\n alignItems: \"center\",\n fontWeight: \"bold\",\n },\n iconStyle: {\n fontSize: \"25px\",\n marginLeft: \"-4px\",\n color: theme.palette.text.primary,\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n }\n}));\n\ntype Props = {\n user: PagerDutyUser;\n};\n\nexport const EscalationUser = ({ user }: Props) => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemIcon>\n <Avatar alt={user.name} src={user.avatar_url} />\n </ListItemIcon>\n <ListItemText\n primary={\n <>\n <Typography className={classes.listItemPrimary}>\n {user.name}\n </Typography>\n <Typography\n className={classes.listItemSecondary}\n color=\"textSecondary\"\n >\n {user.email}\n </Typography>\n </>\n }\n secondary={\n <IconButton\n aria-label=\"open-service-in-browser\"\n // onClick={navigateToService}\n className={classes.buttonStyle}\n >\n <span className={classes.containerStyle}>\n <NotificationsIcon className={classes.iconStyle} />\n Web Team\n </span>\n </IconButton>\n }\n />\n <ListItemSecondaryAction>\n <Tooltip title=\"Send e-mail to user\" placement=\"top\">\n <IconButton href={`mailto:${user.email}`}>\n <MailOutline className={classes.smallIconStyle} />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n href={user.html_url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={classes.smallIconStyle}\n >\n <OpenInBrowser />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { List, ListSubheader } from '@material-ui/core';\nimport { EscalationUsersEmptyState } from './EscalationUsersEmptyState';\nimport { EscalationUsersForbiddenState } from './EscalationUsersForbiddenState';\nimport { EscalationUser } from './EscalationUser';\nimport useAsync from 'react-use/lib/useAsync';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\n\ntype Props = {\n policyId: string;\n};\n\nexport const EscalationPolicy = ({ policyId }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const {\n value: users,\n loading,\n error,\n } = useAsync(async () => {\n return await api.getOnCallByPolicyId(policyId);\n });\n\n if (error) {\n if (error.message.includes(\"Forbidden\")) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <EscalationUsersForbiddenState />\n </List>\n );\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!users?.length) {\n return <EscalationUsersEmptyState />;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n {users!.map((user, index) => (\n <EscalationUser key={index} user={user} />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const MissingTokenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Missing or invalid PagerDuty Token\"\n description=\"The request to fetch data needs a valid token. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ServiceNotFoundError = () => (\n <EmptyState\n missing=\"data\"\n title=\"PagerDuty Service Not Found\"\n description=\"A service could not be found within PagerDuty based on the provided service id. Please verify your configuration.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { 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 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyChangeEvent } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n});\n\ntype Props = {\n changeEvent: PagerDutyChangeEvent;\n};\n\nexport const ChangeEventListItem = ({ changeEvent }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(changeEvent.timestamp).getTime();\n const changedAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n let externalLinkElem: JSX.Element | undefined;\n if (changeEvent.links.length > 0) {\n const text: string = changeEvent.links[0].text;\n externalLinkElem = (\n <Tooltip title={text} placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.links[0].href}\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n );\n }\n\n return (\n <ListItem dense key={changeEvent.id}>\n <ListItemText\n primary={<>{changeEvent.summary}</>}\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography variant=\"body2\" color=\"textSecondary\">\n Triggered from {changeEvent.source} {changedAt}.\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n {externalLinkElem}\n {changeEvent.html_url === undefined ? null : (\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.html_url}\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n )}\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from '../../assets/emptystate.svg';\n\nexport const ChangeEventEmptyState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">No change events to display yet.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={EmptyStateImage}\n alt=\"EmptyState\"\n data-testid=\"emptyStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const ChangeEventForbiddenState = () => {\n return (\n <Grid container justify=\"center\" direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Typography variant=\"h5\">Feature not available with your account or token.</Typography>\n </Grid>\n <Grid item xs={12}>\n <img\n src={ForbiddenStateImage}\n alt=\"ForbiddenState\"\n data-testid=\"forbiddenStateImg\"\n />\n </Grid>\n </Grid>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { ChangeEventListItem } from './ChangeEventListItem';\nimport { ChangeEventEmptyState } from './ChangeEventEmptyState';\nimport { ChangeEventForbiddenState } from './ChangeEventForbiddenState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { Alert } from '@material-ui/lab';\n\ntype Props = {\n serviceId: string;\n refreshEvents: boolean;\n};\n\nexport const ChangeEvents = ({ serviceId, refreshEvents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(\n async () => {\n const { change_events } = await api.getChangeEventsByServiceId(serviceId);\n return change_events;\n },\n );\n\n useEffect(() => {\n getChangeEvents();\n }, [refreshEvents, getChangeEvents]);\n\n if (error) {\n if (error.message.includes('Forbidden')) {\n return <ChangeEventForbiddenState />;\n }\n\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (loading) {\n return <Progress />;\n }\n\n if (!changeEvents?.length) {\n return <ChangeEventEmptyState />;\n }\n\n return (\n <List dense>\n {changeEvents!.map((changeEvent, index) => (\n <ChangeEventListItem\n key={changeEvent.id + index}\n changeEvent={changeEvent}\n />\n ))}\n </List>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Button } from '@material-ui/core';\nimport { EmptyState } from '@backstage/core-components';\n\nexport const ForbiddenError = () => (\n <EmptyState\n missing=\"info\"\n title=\"Unauthorized\"\n description=\"You don't have the required permissions to perform this action. See README for more details.\"\n action={\n <Button\n color=\"primary\"\n variant=\"contained\"\n href=\"https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/\"\n >\n Read More\n </Button>\n }\n />\n);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { PagerDutyEntity } from '../types';\nimport { getPagerDutyEntity } from '../components/pagerDutyEntity';\n\nexport function usePagerdutyEntity(): PagerDutyEntity {\n const { entity } = useEntity();\n\n return getPagerDutyEntity(entity);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, useState } from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\nimport { usePagerdutyEntity } from \"../../hooks\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport AddAlert from \"@material-ui/icons/AddAlert\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex !important\",\n fontSize: \"14px\",\n width: \"80px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\"\n }\n}));\n\n/** @public */\nexport function TriggerIncidentButton() {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <IconButton\n aria-label=\"create-incident\"\n onClick={showDialog}\n className={disabled ? \"\" : buttonStyle}\n disabled={disabled}\n >\n <div className={containerStyle}>\n <AddAlert className={iconStyle} />\n <p>Create New Incident</p>\n </div>\n </IconButton>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\n// import React, { useCallback, useState } from \"react\";\nimport React from \"react\";\nimport { makeStyles, IconButton } from \"@material-ui/core\";\nimport { BackstageTheme } from \"@backstage/theme\";\n\n// import { usePagerdutyEntity } from \"../../hooks\";\n// import { TriggerDialog } from \"../TriggerDialog\";\nimport OpenInBrowser from \"@material-ui/icons/OpenInBrowser\";\n\nconst useStyles = makeStyles<BackstageTheme>((theme) => ({\n buttonStyle: {\n color: theme.palette.text.primary,\n \"&:hover\": {\n backgroundColor: \"transparent\",\n textDecoration: \"underline\",\n },\n },\n containerStyle: {\n flex: \"flex\",\n fontSize: \"14px\",\n width: \"85px\",\n lineHeight: \"14px\",\n },\n iconStyle: {\n fontSize: \"35px\",\n marginBottom: \"-10px\",\n },\n}));\n\n/** @public */\nexport function OpenServiceButton(props: { serviceUrl: string}) {\n const { buttonStyle, containerStyle, iconStyle } = useStyles();\n // const { integrationKey, name } = usePagerdutyEntity();\n // const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n // const hideDialog = useCallback(() => {\n // setDialogShown(false);\n // }, [setDialogShown]);\n\n function navigateToService() {\n window.open(props.serviceUrl, \"_blank\");\n }\n\n return (\n <>\n <IconButton\n aria-label=\"open-service-in-browser\"\n onClick={navigateToService}\n className={buttonStyle}\n >\n <div className={containerStyle}>\n <OpenInBrowser className={iconStyle} />\n <p>Open service in PagerDuty</p>\n </div>\n </IconButton>\n {/* {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )} */}\n </>\n );\n}\n","/*\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, useState, useCallback } from \"react\";\nimport {\n Card,\n CardHeader,\n Divider,\n CardContent,\n Grid,\n // Theme,\n // CardActionArea,\n // CardActions,\n // ThemeProvider,\n // IconButton,\n // IconButtonProps,\n Typography,\n // CardMedia,\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\";\n// import AlarmAddIcon from \"@material-ui/icons/AlarmAdd\";\nimport { MissingTokenError, ServiceNotFoundError } from \"../Errors\";\n// import WebIcon from \"@material-ui/icons/Web\";\n// import DateRangeIcon from \"@material-ui/icons/DateRange\";\nimport { TriggerDialog } from \"../TriggerDialog\";\nimport { ChangeEvents } from \"../ChangeEvents\";\nimport PDGreenImage from \"../../assets/PD-Green.svg\";\nimport PDWhiteImage from \"../../assets/PD-White.svg\";\n\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { NotFoundError } from \"@backstage/errors\";\nimport {\n Progress,\n // HeaderIconLinkRow,\n // IconLinkVerticalProps,\n TabbedCard,\n CardTab,\n InfoCard,\n} from \"@backstage/core-components\";\nimport { PagerDutyEntity } from \"../../types\";\nimport { ForbiddenError } from \"../Errors/ForbiddenError\";\nimport { TriggerIncidentButton } from \"./TriggerIncidentButton\";\nimport { OpenServiceButton } from \"./OpenServiceButton\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport LinearProgress from \"@material-ui/core/LinearProgress\";\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 theme = useTheme();\n const { readOnly, disableChangeEvents, integrationKey, name } = props;\n const api = useApi(pagerDutyApiRef);\n const [refreshIncidents, setRefreshIncidents] = useState<boolean>(false);\n const [refreshChangeEvents, setRefreshChangeEvents] =\n useState<boolean>(false);\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n // const showDialog = useCallback(() => {\n // setDialogShown(true);\n // }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const handleRefresh = useCallback(() => {\n setRefreshIncidents((x) => !x);\n setRefreshChangeEvents((x) => !x);\n }, []);\n\n const {\n value: service,\n loading,\n error,\n } = useAsync(async () => {\n const { service: foundService } = await api.getServiceByPagerDutyEntity(\n props\n );\n\n return {\n id: foundService.id,\n name: foundService.name,\n url: foundService.html_url,\n policyId: foundService.escalation_policy.id,\n policyLink: foundService.escalation_policy.html_url,\n };\n }, [props]);\n\n if (error) {\n let errorNode: ReactNode;\n\n switch (error.constructor) {\n case UnauthorizedError:\n errorNode = <MissingTokenError />;\n break;\n case NotFoundError:\n errorNode = <ServiceNotFoundError />;\n break;\n default:\n errorNode = <ForbiddenError />;\n }\n\n return <BasicCard>{errorNode}</BasicCard>;\n }\n\n if (loading) {\n return (\n <BasicCard>\n <Progress />\n </BasicCard>\n );\n }\n\n /**\n * In order to create incidents using the REST API, a valid user email address must be present.\n * There is no guarantee the current user entity has a valid email association, so instead just\n * only allow triggering incidents when an integration key is present.\n */\n const createIncidentDisabled = !integrationKey;\n\n return (\n <>\n <Card data-testid=\"pagerduty-card\">\n <CardHeader\n style={{ marginRight: \"1em\" }}\n title={\n theme.palette.type === \"dark\" ? (\n <img src={PDWhiteImage} alt=\"PagerDuty\" height=\"35\" />\n ) : (\n <img src={PDGreenImage} alt=\"PagerDuty\" height=\"35\" />\n )\n }\n action={\n !readOnly ? (\n <div>\n <TriggerIncidentButton />\n <OpenServiceButton serviceUrl={service!.url} />\n </div>\n ) : (\n <OpenServiceButton serviceUrl={service!.url} />\n )\n }\n />\n <Grid item md={12} style={{ display: \"flex\", margin: \"15px\" }}>\n <Grid item md={3}>\n <Typography style={{ fontSize: \"16px\", fontWeight: \"bold\" }}>\n STATUS\n </Typography>\n </Grid>\n <Grid item md={6}>\n <Typography style={{ fontSize: \"16px\", fontWeight: \"bold\" }}>\n INCIDENT HISTORY\n </Typography>\n </Grid>\n <Grid item md={3}>\n <Typography\n style={{\n fontSize: \"16px\",\n fontWeight: \"bold\",\n marginLeft: \"10px\",\n }}\n >\n SERVICE STANDARDS\n </Typography>\n </Grid>\n </Grid>\n <Grid\n item\n md={12}\n style={{ display: \"flex\", margin: \"15px\", marginTop: \"-15px\" }}\n >\n <Grid item md={3}>\n <Card\n style={{\n background: \"darkRed\",\n marginRight: \"20px\",\n height: \"150px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n variant=\"h3\"\n style={{ color: \"white\", fontWeight: \"bold\" }}\n >\n ALARM\n </Typography>\n <Typography\n style={{\n alignSelf: \"start\",\n position: \"absolute\",\n verticalAlign: \"bottom\",\n marginTop: \"120px\",\n marginLeft: \"10px\",\n color: \"white\",\n }}\n >\n Last triggered 8 minutes ago\n </Typography>\n </Card>\n </Grid>\n <Grid\n item\n md={6}\n style={{\n display: \"flex\",\n height: \"100%\",\n justifyContent: \"center\",\n columnSpan: \"all\",\n }}\n >\n <Grid md={4} style={{ height: \"100%\" }}>\n <Card\n style={{\n marginRight: \"10px\",\n height: \"150px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n style={{\n color: \"red\",\n fontSize: \"50px\",\n }}\n >\n 1\n </Typography>\n <Typography\n style={{\n color: \"red\",\n fontWeight: \"bold\",\n fontSize: \"10px\",\n }}\n >\n TRIGGERED\n </Typography>\n </Card>\n </Grid>\n <Grid md={4}>\n <Card\n style={{\n marginRight: \"10px\",\n height: \"150px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n style={{\n color: \"orange\",\n fontSize: \"50px\",\n }}\n >\n 1\n </Typography>\n <Typography\n style={{\n color: \"orange\",\n fontWeight: \"bold\",\n fontSize: \"10px\",\n }}\n >\n ACKNOWLEDGED\n </Typography>\n </Card>\n </Grid>\n <Grid md={4}>\n <Card\n style={{\n marginRight: \"10px\",\n height: \"150px\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Typography\n style={{\n color: \"green\",\n fontSize: \"50px\",\n }}\n >\n 43\n </Typography>\n <Typography\n style={{\n color: \"green\",\n fontWeight: \"bold\",\n fontSize: \"10px\",\n }}\n >\n RESOLVED\n </Typography>\n </Card>\n </Grid>\n </Grid>\n <Grid item md={3}>\n <Card\n style={{\n height: \"150px\",\n display: \"grid\",\n gridTemplateRows: \"1fr auto auto\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n marginTop: \"30px\",\n }}\n >\n <Typography \n style={{\n fontSize: \"50px\",\n color: \"black\",\n fontWeight: \"bold\",\n alignSelf: \"center\",\n justifyContent: \"center\",\n }}\n >\n 4\n </Typography>\n <Typography\n variant=\"body1\"\n style={{\n color: \"black\", \n alignSelf: \"center\",\n justifyContent: \"center\",\n marginLeft: \"1px\",\n marginTop: \"20px\",\n }}\n >\n /5\n </Typography>\n </div>\n <div style={{ display: \"flex\", flexDirection: \"row-reverse\" }}>\n <Typography\n style={{\n justifyContent: \"end\",\n color: \"gray\",\n textDecoration: \"underline\",\n marginRight: \"5px\",\n }}\n >\n See service standards\n </Typography>\n </div>\n <div>\n <LinearProgress\n variant=\"determinate\"\n value={80}\n style={{\n margin: \"5px\",\n borderRadius: \"10px\",\n height: \"10px\",\n }}\n />\n </div>\n </Card>\n </Grid>\n </Grid>\n\n <Divider />\n <CardContent>\n <TabbedCard>\n <CardTab label=\"Incidents\">\n <Incidents\n serviceId={service!.id}\n refreshIncidents={refreshIncidents}\n />\n </CardTab>\n {disableChangeEvents !== true ? (\n <CardTab label=\"Change Events\">\n <ChangeEvents\n serviceId={service!.id}\n refreshEvents={refreshChangeEvents}\n />\n </CardTab>\n ) : (\n <></>\n )}\n </TabbedCard>\n <EscalationPolicy policyId={service!.policyId} />\n </CardContent>\n </Card>\n {!createIncidentDisabled && (\n <TriggerDialog\n data-testid=\"trigger-dialog\"\n showDialog={dialogShown}\n handleDialog={hideDialog}\n onIncidentCreated={handleRefresh}\n name={name}\n integrationKey={integrationKey}\n />\n )}\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from '../constants';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { getPagerDutyEntity } from '../pagerDutyEntity';\nimport { PagerDutyCard } from '../PagerDutyCard';\n\n/** @public */\nexport const isPluginApplicableToEntity = (entity: Entity) =>\n Boolean(\n entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] ||\n entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID],\n );\n\n/** @public */\nexport type EntityPagerDutyCardProps = {\n readOnly?: boolean;\n disableChangeEvents?: boolean;\n};\n\n/** @public */\nexport const EntityPagerDutyCard = (props: EntityPagerDutyCardProps) => {\n const { readOnly, disableChangeEvents } = props;\n const { entity } = useEntity();\n const pagerDutyEntity = getPagerDutyEntity(entity);\n return (\n <PagerDutyCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableChangeEvents={disableChangeEvents}\n />\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport React, { useCallback, ReactNode, useState } from 'react';\nimport { makeStyles, Button } from '@material-ui/core';\nimport { BackstageTheme } from '@backstage/theme';\n\nimport { usePagerdutyEntity } from '../../hooks';\nimport { TriggerDialog } from '../TriggerDialog';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n buttonStyle: {\n backgroundColor: theme.palette.error.main,\n color: theme.palette.error.contrastText,\n '&:hover': {\n backgroundColor: theme.palette.error.dark,\n },\n },\n}));\n\n/** @public */\nexport function TriggerButton(props: { children?: ReactNode }) {\n const { buttonStyle } = useStyles();\n const { integrationKey, name } = usePagerdutyEntity();\n const [dialogShown, setDialogShown] = useState<boolean>(false);\n\n const showDialog = useCallback(() => {\n setDialogShown(true);\n }, [setDialogShown]);\n const hideDialog = useCallback(() => {\n setDialogShown(false);\n }, [setDialogShown]);\n\n const disabled = !integrationKey;\n return (\n <>\n <Button\n onClick={showDialog}\n variant=\"contained\"\n className={disabled ? '' : buttonStyle}\n disabled={disabled}\n >\n {integrationKey\n ? props.children ?? 'Create Incident'\n : 'Missing integration key'}\n </Button>\n {integrationKey && (\n <TriggerDialog\n showDialog={dialogShown}\n handleDialog={hideDialog}\n integrationKey={integrationKey}\n name={name}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EntityPagerDutyCardProps, EntityPagerDutyCard } from './components';\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCard\n */\nexport const PagerDutyCard = EntityPagerDutyCard;\n\n/**\n * @public\n * @deprecated Please use EntityPagerDutyCardProps\n */\nexport type PagerDutyCardProps = EntityPagerDutyCardProps;\n"],"names":["ForbiddenError","EntityPagerDutyCard","useStyles","OpenInBrowser","PagerDutyCard"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,yBAA4B,GAAA,+BAAA,CAAA;AAClC,MAAM,oBAAuB,GAAA,0BAAA;;ACI7B,SAAS,mBAAmB,MAAiC,E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