@pagerduty/backstage-plugin 0.15.9-next.5 → 0.15.10-next.0

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.
Files changed (93) hide show
  1. package/package.json +23 -34
  2. package/assets/PD-Green.svg +0 -21
  3. package/assets/PD-Icon.svg +0 -13
  4. package/assets/PD-White.svg +0 -21
  5. package/assets/emptystate.svg +0 -6
  6. package/assets/forbiddenstate.svg +0 -25
  7. package/dist/alpha.d.ts +0 -8
  8. package/dist/alpha.esm.js +0 -67
  9. package/dist/alpha.esm.js.map +0 -1
  10. package/dist/api/client.esm.js +0 -225
  11. package/dist/api/client.esm.js.map +0 -1
  12. package/dist/assets/PD-Green.svg +0 -21
  13. package/dist/assets/PD-Icon.svg +0 -13
  14. package/dist/assets/PD-White.svg +0 -21
  15. package/dist/assets/emptystate.svg +0 -6
  16. package/dist/assets/forbiddenstate.svg +0 -25
  17. package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js +0 -29
  18. package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js.map +0 -1
  19. package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js +0 -29
  20. package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js.map +0 -1
  21. package/dist/components/ChangeEvents/ChangeEventListItem.esm.js +0 -85
  22. package/dist/components/ChangeEvents/ChangeEventListItem.esm.js.map +0 -1
  23. package/dist/components/ChangeEvents/ChangeEvents.esm.js +0 -60
  24. package/dist/components/ChangeEvents/ChangeEvents.esm.js.map +0 -1
  25. package/dist/components/EntityPagerDutyCard/index.esm.js +0 -29
  26. package/dist/components/EntityPagerDutyCard/index.esm.js.map +0 -1
  27. package/dist/components/EntityPagerDutySmallCard/index.esm.js +0 -29
  28. package/dist/components/EntityPagerDutySmallCard/index.esm.js.map +0 -1
  29. package/dist/components/Errors/ForbiddenError.esm.js +0 -24
  30. package/dist/components/Errors/ForbiddenError.esm.js.map +0 -1
  31. package/dist/components/Errors/MissingTokenError.esm.js +0 -24
  32. package/dist/components/Errors/MissingTokenError.esm.js.map +0 -1
  33. package/dist/components/Errors/ServiceNotFoundError.esm.js +0 -24
  34. package/dist/components/Errors/ServiceNotFoundError.esm.js.map +0 -1
  35. package/dist/components/Escalation/EscalationPolicy.esm.js +0 -53
  36. package/dist/components/Escalation/EscalationPolicy.esm.js.map +0 -1
  37. package/dist/components/Escalation/EscalationUser.esm.js +0 -97
  38. package/dist/components/Escalation/EscalationUser.esm.js.map +0 -1
  39. package/dist/components/Escalation/EscalationUsersEmptyState.esm.js +0 -23
  40. package/dist/components/Escalation/EscalationUsersEmptyState.esm.js.map +0 -1
  41. package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js +0 -23
  42. package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js.map +0 -1
  43. package/dist/components/HomePagePagerDutyCard/Content.esm.js +0 -9
  44. package/dist/components/HomePagePagerDutyCard/Content.esm.js.map +0 -1
  45. package/dist/components/HomePagePagerDutyCard/index.esm.js +0 -2
  46. package/dist/components/HomePagePagerDutyCard/index.esm.js.map +0 -1
  47. package/dist/components/Icons/index.esm.js +0 -9
  48. package/dist/components/Icons/index.esm.js.map +0 -1
  49. package/dist/components/Incident/IncidentEmptyState.esm.js +0 -29
  50. package/dist/components/Incident/IncidentEmptyState.esm.js.map +0 -1
  51. package/dist/components/Incident/IncidentForbiddenState.esm.js +0 -29
  52. package/dist/components/Incident/IncidentForbiddenState.esm.js.map +0 -1
  53. package/dist/components/Incident/IncidentListItem.esm.js +0 -128
  54. package/dist/components/Incident/IncidentListItem.esm.js.map +0 -1
  55. package/dist/components/Incident/Incidents.esm.js +0 -54
  56. package/dist/components/Incident/Incidents.esm.js.map +0 -1
  57. package/dist/components/PagerDutyCard/index.esm.js +0 -231
  58. package/dist/components/PagerDutyCard/index.esm.js.map +0 -1
  59. package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js +0 -42
  60. package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js.map +0 -1
  61. package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js +0 -43
  62. package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js.map +0 -1
  63. package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js +0 -134
  64. package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js.map +0 -1
  65. package/dist/components/PagerDutyCardCommon/StatusCard.esm.js +0 -109
  66. package/dist/components/PagerDutyCardCommon/StatusCard.esm.js.map +0 -1
  67. package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js +0 -66
  68. package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js.map +0 -1
  69. package/dist/components/PagerDutyPage/MappingTable.esm.js +0 -282
  70. package/dist/components/PagerDutyPage/MappingTable.esm.js.map +0 -1
  71. package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js +0 -50
  72. package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js.map +0 -1
  73. package/dist/components/PagerDutyPage/index.esm.js +0 -117
  74. package/dist/components/PagerDutyPage/index.esm.js.map +0 -1
  75. package/dist/components/PagerDutySmallCard/index.esm.js +0 -227
  76. package/dist/components/PagerDutySmallCard/index.esm.js.map +0 -1
  77. package/dist/components/TriggerButton/index.esm.js +0 -51
  78. package/dist/components/TriggerButton/index.esm.js.map +0 -1
  79. package/dist/components/TriggerDialog/TriggerDialog.esm.js +0 -120
  80. package/dist/components/TriggerDialog/TriggerDialog.esm.js.map +0 -1
  81. package/dist/components/constants.esm.js +0 -6
  82. package/dist/components/constants.esm.js.map +0 -1
  83. package/dist/components/pagerDutyEntity.esm.js +0 -14
  84. package/dist/components/pagerDutyEntity.esm.js.map +0 -1
  85. package/dist/deprecated.esm.js +0 -10
  86. package/dist/deprecated.esm.js.map +0 -1
  87. package/dist/hooks/index.esm.js +0 -10
  88. package/dist/hooks/index.esm.js.map +0 -1
  89. package/dist/index.d.ts +0 -184
  90. package/dist/index.esm.js +0 -9
  91. package/dist/index.esm.js.map +0 -1
  92. package/dist/plugin.esm.js +0 -78
  93. package/dist/plugin.esm.js.map +0 -1
@@ -1,6 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="282" height="173" fill="none" viewBox="0 0 282 173">
2
- <path fill="#000" fill-opacity=".05" fill-rule="evenodd" d="M16.4571 45.1637C11.0514 46.1711 7.48574 51.3699 8.49306 56.7756C9.50039 62.1814 14.6992 65.747 20.105 64.7397L27.5528 63.3518C25.4791 65.5835 24.4525 68.7347 25.0535 71.9596C26.0608 77.3653 31.2596 80.931 36.6654 79.9236L89.691 70.0427C89.7016 70.1067 89.7129 70.1708 89.7249 70.2349C90.3258 73.4598 92.4185 76.0298 95.1569 77.3647L91.9031 77.971C86.4974 78.9784 82.9318 84.1772 83.9391 89.583C84.9464 94.9887 90.1452 98.5543 95.551 97.547L250.098 68.7482C255.504 67.7409 259.069 62.5421 258.062 57.1363C257.461 53.9114 255.368 51.3414 252.63 50.0065L257.835 49.0366C263.241 48.0292 266.807 42.8304 265.799 37.4247C264.792 32.0189 259.593 28.4533 254.187 29.4606L161.492 46.7338C161.481 46.6697 161.47 46.6056 161.458 46.5415C160.857 43.3166 158.764 40.7466 156.026 39.4117L165.025 37.7347C170.431 36.7274 173.997 31.5286 172.989 26.1228C171.982 20.7171 166.783 17.1514 161.378 18.1588L16.4571 45.1637ZM24.3031 122.54C23.2958 117.134 26.8614 111.936 32.2672 110.928L190.856 81.3762C196.262 80.3688 201.461 83.9345 202.468 89.3402C203.476 94.746 199.91 99.9448 194.504 100.952L189.963 101.798C190.493 102.057 190.999 102.362 191.474 102.708L246.43 92.4677C251.835 91.4604 257.034 95.026 258.041 100.432C258.642 103.657 257.616 106.808 255.542 109.04L256.649 108.833C262.055 107.826 267.253 111.392 268.261 116.797C269.268 122.203 265.702 127.402 260.297 128.409L95.5591 159.107C90.1534 160.114 84.9545 156.549 83.9472 151.143C82.9399 145.737 86.5055 140.538 91.9113 139.531L103.94 137.29C103.41 137.031 102.904 136.726 102.429 136.38L29.1002 150.044C23.6944 151.051 18.4956 147.486 17.4882 142.08C16.4809 136.674 20.0465 131.475 25.4523 130.468L29.7352 129.67C26.9967 128.335 24.904 125.765 24.3031 122.54Z" clip-rule="evenodd"/>
3
- <circle cx="188" cy="55" r="6" fill="#69DDC7"/>
4
- <circle cx="91" cy="92" r="6" fill="#69DDC7"/>
5
- <path fill="#69DDC7" d="M121 114L95.5 88L86.5 96L121 130L192.5 59L183.5 51L121 114Z"/>
6
- </svg>
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="282" height="173" viewBox="0 0 282 173" xml:space="preserve">
4
- <desc>Created with Fabric.js 5.2.4</desc>
5
- <defs>
6
- </defs>
7
- <rect x="0" y="0" width="100%" height="100%" fill="transparent"></rect>
8
- <g transform="matrix(0 0 0 0 0 0)" id="2b1916c6-4e64-42b8-a068-40dfaeac470d" >
9
- </g>
10
- <g transform="matrix(1 0 0 1 141 86.5)" id="d4776813-b848-4f62-9c52-8ddfbba6efba" >
11
- <rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-141" y="-86.5" rx="0" ry="0" width="282" height="173" />
12
- </g>
13
- <g transform="matrix(0.61 0 0 0.61 85 63.93)" >
14
- <rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-opacity: 0; fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" x="-50" y="-50" rx="0" ry="0" width="100" height="100" />
15
- </g>
16
- <g transform="matrix(0.61 0 0 0.61 140.51 86.19)" id="be8065ed-9284-45d5-81ea-976e87d93517" >
17
- <rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-141" y="-86.5" rx="0" ry="0" width="282" height="173" />
18
- </g>
19
- <g transform="matrix(1 0 0 1 141 86.5)" >
20
- <path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-opacity: 0.05; fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-138.38, -88.63)" d="M 16.4571 45.1637 C 11.0514 46.1711 7.48574 51.3699 8.49306 56.7756 C 9.50039 62.1814 14.6992 65.747 20.105 64.7397 L 27.5528 63.3518 C 25.4791 65.5835 24.4525 68.7347 25.0535 71.9596 C 26.0608 77.3653 31.2596 80.931 36.6654 79.9236 L 89.691 70.0427 C 89.7016 70.1067 89.7129 70.1708 89.7249 70.2349 C 90.3258 73.4598 92.4185 76.0298 95.1569 77.3647 L 91.9031 77.971 C 86.4974 78.9784 82.9318 84.1772 83.9391 89.583 C 84.9464 94.9887 90.1452 98.5543 95.551 97.547 L 250.098 68.7482 C 255.504 67.7409 259.069 62.5421 258.062 57.1363 C 257.461 53.9114 255.368 51.3414 252.63 50.0065 L 257.835 49.0366 C 263.241 48.0292 266.807 42.8304 265.799 37.4247 C 264.792 32.0189 259.593 28.4533 254.187 29.4606 L 161.492 46.7338 C 161.481 46.6697 161.47 46.6056 161.458 46.5415 C 160.857 43.3166 158.764 40.7466 156.026 39.4117 L 165.025 37.7347 C 170.431 36.7274 173.997 31.5286 172.989 26.1228 C 171.982 20.7171 166.783 17.1514 161.378 18.1588 L 16.4571 45.1637 Z M 24.3031 122.54 C 23.2958 117.134 26.8614 111.936 32.2672 110.928 L 190.856 81.3762 C 196.262 80.3688 201.461 83.9345 202.468 89.3402 C 203.476 94.746 199.91 99.9448 194.504 100.952 L 189.963 101.798 C 190.493 102.057 190.999 102.362 191.474 102.708 L 246.43 92.4677 C 251.835 91.4604 257.034 95.026 258.041 100.432 C 258.642 103.657 257.616 106.808 255.542 109.04 L 256.649 108.833 C 262.055 107.826 267.253 111.392 268.261 116.797 C 269.268 122.203 265.702 127.402 260.297 128.409 L 95.5591 159.107 C 90.1534 160.114 84.9545 156.549 83.9472 151.143 C 82.9399 145.737 86.5055 140.538 91.9113 139.531 L 103.94 137.29 C 103.41 137.031 102.904 136.726 102.429 136.38 L 29.1002 150.044 C 23.6944 151.051 18.4956 147.486 17.4882 142.08 C 16.4809 136.674 20.0465 131.475 25.4523 130.468 L 29.7352 129.67 C 26.9967 128.335 24.904 125.765 24.3031 122.54 Z" stroke-linecap="round" />
21
- </g>
22
- <g transform="matrix(1 0 0 1 141 86.5)" id="7793582c-664f-4d1a-af79-18f2f165cded" >
23
- <path style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(179,73,73); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-50, -50)" d="M 24.442 24.417 C 38.551 10.306000000000001 61.448 10.306000000000001 75.557 24.417 C 89.718 38.576 89.718 61.473 75.557 75.584 C 61.448 89.694 38.551 89.694 24.442 75.584 C 10.281 61.473 10.281 38.576 24.442 24.417 z M 34.835 29.637 L 70.388 65.188 C 77.768 55.196 76.965 41.087 67.977 32.048 C 58.94 23.01 44.779 22.208 34.835 29.637 z M 65.164 70.361 L 29.615 34.86 C 22.232 44.803 23.034 58.963 32.022999999999996 67.951 C 41.063 76.99 55.225 77.793 65.164 70.361 z" stroke-linecap="round" />
24
- </g>
25
- </svg>
@@ -1,29 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { Grid, Typography } from '@material-ui/core';
3
- import EmptyStateImage from '../../assets/emptystate.svg';
4
-
5
- const ChangeEventEmptyState = () => {
6
- return /* @__PURE__ */ jsxs(
7
- Grid,
8
- {
9
- container: true,
10
- justifyContent: "center",
11
- direction: "column",
12
- alignItems: "center",
13
- children: [
14
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: "No change events to display yet." }) }),
15
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
16
- "img",
17
- {
18
- src: EmptyStateImage,
19
- alt: "EmptyState",
20
- "data-testid": "emptyStateImg"
21
- }
22
- ) })
23
- ]
24
- }
25
- );
26
- };
27
-
28
- export { ChangeEventEmptyState };
29
- //# sourceMappingURL=ChangeEventEmptyState.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChangeEventEmptyState.esm.js","sources":["../../../src/components/ChangeEvents/ChangeEventEmptyState.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\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { Grid, Typography } from '@material-ui/core';\nimport EmptyStateImage from '../../assets/emptystate.svg';\n\nexport const ChangeEventEmptyState = () => {\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\">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"],"names":[],"mappings":";;;;AAoBO,MAAM,wBAAwB,MAAM;AACzC,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,cAAA,EAAe,QAAA;AAAA,MACf,SAAA,EAAU,QAAA;AAAA,MACV,UAAA,EAAW,QAAA;AAAA,MAEX,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACb,8BAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,QAAA,EAAA,kCAAA,EAAgC,CAAA,EAC3D,CAAA;AAAA,wBACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,IAAI,EAAA,EACb,QAAA,kBAAA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,eAAA;AAAA,YACL,GAAA,EAAI,YAAA;AAAA,YACJ,aAAA,EAAY;AAAA;AAAA,SACd,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,29 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { Grid, Typography } from '@material-ui/core';
3
- import ForbiddenStateImage from '../../assets/forbiddenstate.svg';
4
-
5
- const ChangeEventForbiddenState = () => {
6
- return /* @__PURE__ */ jsxs(
7
- Grid,
8
- {
9
- container: true,
10
- justifyContent: "center",
11
- direction: "column",
12
- alignItems: "center",
13
- children: [
14
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: "Feature not available with your account or token." }) }),
15
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
16
- "img",
17
- {
18
- src: ForbiddenStateImage,
19
- alt: "ForbiddenState",
20
- "data-testid": "forbiddenStateImg"
21
- }
22
- ) })
23
- ]
24
- }
25
- );
26
- };
27
-
28
- export { ChangeEventForbiddenState };
29
- //# sourceMappingURL=ChangeEventForbiddenState.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChangeEventForbiddenState.esm.js","sources":["../../../src/components/ChangeEvents/ChangeEventForbiddenState.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\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { Grid, Typography } from '@material-ui/core';\nimport ForbiddenStateImage from '../../assets/forbiddenstate.svg';\n\nexport const ChangeEventForbiddenState = () => {\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\">\n Feature not available with your account or token.\n </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"],"names":[],"mappings":";;;;AAoBO,MAAM,4BAA4B,MAAM;AAC7C,EAAA,uBACE,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAS,IAAA;AAAA,MACT,cAAA,EAAe,QAAA;AAAA,MACf,SAAA,EAAU,QAAA;AAAA,MACV,UAAA,EAAW,QAAA;AAAA,MAEX,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,EAAA,EAAI,EAAA,EACb,8BAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,QAAA,EAAA,mDAAA,EAEzB,CAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,IAAI,EAAA,EACb,QAAA,kBAAA,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,GAAA,EAAK,mBAAA;AAAA,YACL,GAAA,EAAI,gBAAA;AAAA,YACJ,aAAA,EAAY;AAAA;AAAA,SACd,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,85 +0,0 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { makeStyles, ListItem, ListItemText, Typography, ListItemSecondaryAction } from '@material-ui/core';
3
- import { TooltipTrigger, ButtonIcon, Tooltip } from '@backstage/ui';
4
- import { DateTime, Duration } from 'luxon';
5
- import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
6
- import LinkIcon from '@material-ui/icons/Link';
7
-
8
- const useStyles = makeStyles(() => ({
9
- denseListIcon: {
10
- marginRight: 0,
11
- display: "flex",
12
- flexDirection: "column",
13
- alignItems: "center",
14
- justifyContent: "center"
15
- },
16
- listItemPrimary: {
17
- fontWeight: "bold"
18
- }
19
- }));
20
- const ChangeEventListItem = ({ changeEvent }) => {
21
- const classes = useStyles();
22
- const duration = (/* @__PURE__ */ new Date()).getTime() - new Date(changeEvent.timestamp).getTime();
23
- const changedAt = DateTime.local().minus(Duration.fromMillis(duration)).toRelative({ locale: "en" });
24
- const handleExternalLinkClick = (url) => {
25
- window.open(url, "_blank", "noopener,noreferrer");
26
- };
27
- const handlePagerDutyClick = () => {
28
- if (changeEvent.html_url) {
29
- window.open(changeEvent.html_url, "_blank", "noopener,noreferrer");
30
- }
31
- };
32
- let externalLinkElem;
33
- if (changeEvent.links.length > 0 && changeEvent.links[0]?.href) {
34
- const text = changeEvent.links[0].text;
35
- const linkHref = changeEvent.links[0].href;
36
- externalLinkElem = /* @__PURE__ */ jsxs(TooltipTrigger, { children: [
37
- /* @__PURE__ */ jsx(
38
- ButtonIcon,
39
- {
40
- icon: /* @__PURE__ */ jsx(LinkIcon, {}),
41
- variant: "tertiary",
42
- onClick: () => handleExternalLinkClick(linkHref)
43
- }
44
- ),
45
- /* @__PURE__ */ jsx(Tooltip, { children: text })
46
- ] });
47
- }
48
- return /* @__PURE__ */ jsxs(ListItem, { dense: true, children: [
49
- /* @__PURE__ */ jsx(
50
- ListItemText,
51
- {
52
- primary: /* @__PURE__ */ jsx(Fragment, { children: changeEvent.summary }),
53
- primaryTypographyProps: {
54
- variant: "body1",
55
- className: classes.listItemPrimary
56
- },
57
- secondary: /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "textSecondary", children: [
58
- "Triggered from ",
59
- changeEvent.source,
60
- " ",
61
- changedAt,
62
- "."
63
- ] })
64
- }
65
- ),
66
- /* @__PURE__ */ jsxs(ListItemSecondaryAction, { children: [
67
- externalLinkElem,
68
- changeEvent.html_url === void 0 ? null : /* @__PURE__ */ jsxs(TooltipTrigger, { children: [
69
- /* @__PURE__ */ jsx(
70
- ButtonIcon,
71
- {
72
- "aria-label": "view-in-pd-button",
73
- icon: /* @__PURE__ */ jsx(OpenInBrowserIcon, { className: classes.smallIconStyle }),
74
- variant: "tertiary",
75
- onClick: handlePagerDutyClick
76
- }
77
- ),
78
- /* @__PURE__ */ jsx(Tooltip, { children: "View in PagerDuty" })
79
- ] })
80
- ] })
81
- ] }, changeEvent.id);
82
- };
83
-
84
- export { ChangeEventListItem };
85
- //# sourceMappingURL=ChangeEventListItem.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChangeEventListItem.esm.js","sources":["../../../src/components/ChangeEvents/ChangeEventListItem.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\nimport {\n ListItem,\n ListItemSecondaryAction,\n ListItemText,\n makeStyles,\n Typography,\n} from '@material-ui/core';\nimport { ButtonIcon, Tooltip, TooltipTrigger } from '@backstage/ui';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyChangeEvent } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport LinkIcon from '@material-ui/icons/Link';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>(() => ({\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\n const handleExternalLinkClick = (url: string) => {\n window.open(url, '_blank', 'noopener,noreferrer');\n };\n\n const handlePagerDutyClick = () => {\n if (changeEvent.html_url) {\n window.open(changeEvent.html_url, '_blank', 'noopener,noreferrer');\n }\n };\n\n let externalLinkElem: JSX.Element | undefined;\n if (changeEvent.links.length > 0 && changeEvent.links[0]?.href) {\n const text: string = changeEvent.links[0].text;\n const linkHref = changeEvent.links[0].href;\n externalLinkElem = (\n <TooltipTrigger>\n <ButtonIcon\n icon={<LinkIcon />}\n variant=\"tertiary\"\n onClick={() => handleExternalLinkClick(linkHref)}\n />\n <Tooltip>{text}</Tooltip>\n </TooltipTrigger>\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 <TooltipTrigger>\n <ButtonIcon\n aria-label=\"view-in-pd-button\"\n icon={<OpenInBrowserIcon className={classes.smallIconStyle} />}\n variant=\"tertiary\"\n onClick={handlePagerDutyClick}\n />\n <Tooltip>View in PagerDuty</Tooltip>\n </TooltipTrigger>\n )}\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":[],"mappings":"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"}
@@ -1,60 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useEffect } from 'react';
3
- import { makeStyles, List, createStyles } from '@material-ui/core';
4
- import { ChangeEventListItem } from './ChangeEventListItem.esm.js';
5
- import { ChangeEventEmptyState } from './ChangeEventEmptyState.esm.js';
6
- import { ChangeEventForbiddenState } from './ChangeEventForbiddenState.esm.js';
7
- import useAsyncFn from 'react-use/lib/useAsyncFn';
8
- import { pagerDutyApiRef } from '../../api/client.esm.js';
9
- import { useApi } from '@backstage/core-plugin-api';
10
- import { Progress } from '@backstage/core-components';
11
- import { Alert } from '@material-ui/lab';
12
-
13
- const useStyles = makeStyles(
14
- () => createStyles({
15
- loadingStyles: {
16
- height: "253px"
17
- }
18
- })
19
- );
20
- const ChangeEvents = ({ serviceId, account, refreshEvents }) => {
21
- const api = useApi(pagerDutyApiRef);
22
- const { loadingStyles } = useStyles();
23
- const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(
24
- async () => {
25
- const { change_events } = await api.getChangeEventsByServiceId(
26
- serviceId,
27
- account
28
- );
29
- return change_events;
30
- }
31
- );
32
- useEffect(() => {
33
- getChangeEvents();
34
- }, [refreshEvents, getChangeEvents]);
35
- if (error) {
36
- if (error.message.includes("Forbidden")) {
37
- return /* @__PURE__ */ jsx(ChangeEventForbiddenState, {});
38
- }
39
- return /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
40
- "Error encountered while fetching information. ",
41
- error.message
42
- ] });
43
- }
44
- if (loading) {
45
- return /* @__PURE__ */ jsx("div", { className: loadingStyles, children: /* @__PURE__ */ jsx(Progress, {}) });
46
- }
47
- if (!changeEvents?.length) {
48
- return /* @__PURE__ */ jsx(ChangeEventEmptyState, {});
49
- }
50
- return /* @__PURE__ */ jsx(List, { dense: true, children: changeEvents.map((changeEvent, index) => /* @__PURE__ */ jsx(
51
- ChangeEventListItem,
52
- {
53
- changeEvent
54
- },
55
- changeEvent.id + index
56
- )) });
57
- };
58
-
59
- export { ChangeEvents };
60
- //# sourceMappingURL=ChangeEvents.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChangeEvents.esm.js","sources":["../../../src/components/ChangeEvents/ChangeEvents.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\nimport { useEffect } from 'react';\nimport { createStyles, List, makeStyles } 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';\nimport { BackstageTheme } from '@backstage/theme';\n\ntype Props = {\n serviceId: string;\n account?: string;\n refreshEvents: boolean;\n};\n\nconst useStyles = makeStyles<BackstageTheme>(() =>\n createStyles({\n loadingStyles: {\n height: '253px',\n },\n }),\n);\n\nexport const ChangeEvents = ({ serviceId, account, refreshEvents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n const { loadingStyles } = useStyles();\n\n const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(\n async () => {\n const { change_events } = await api.getChangeEventsByServiceId(\n serviceId,\n account,\n );\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 (\n <div className={loadingStyles}>\n <Progress />\n </div>\n );\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"],"names":[],"mappings":";;;;;;;;;;;;AAkCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAA2B,MAC3C,YAAA,CAAa;AAAA,IACX,aAAA,EAAe;AAAA,MACb,MAAA,EAAQ;AAAA;AACV,GACD;AACH,CAAA;AAEO,MAAM,eAAe,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,eAAc,KAAa;AAC5E,EAAA,MAAM,GAAA,GAAM,OAAO,eAAe,CAAA;AAClC,EAAA,MAAM,EAAE,aAAA,EAAc,GAAI,SAAA,EAAU;AAEpC,EAAA,MAAM,CAAC,EAAE,KAAA,EAAO,YAAA,EAAc,SAAS,KAAA,EAAM,EAAG,eAAe,CAAA,GAAI,UAAA;AAAA,IACjE,YAAY;AACV,MAAA,MAAM,EAAE,aAAA,EAAc,GAAI,MAAM,GAAA,CAAI,0BAAA;AAAA,QAClC,SAAA;AAAA,QACA;AAAA,OACF;AACA,MAAA,OAAO,aAAA;AAAA,IACT;AAAA,GACF;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,eAAA,EAAgB;AAAA,EAClB,CAAA,EAAG,CAAC,aAAA,EAAe,eAAe,CAAC,CAAA;AAEnC,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,QAAA,CAAS,WAAW,CAAA,EAAG;AACvC,MAAA,2BAAQ,yBAAA,EAAA,EAA0B,CAAA;AAAA,IACpC;AAEA,IAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAM,QAAA,EAAS,OAAA,EAAQ,QAAA,EAAA;AAAA,MAAA,gDAAA;AAAA,MACyB,KAAA,CAAM;AAAA,KAAA,EACvD,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,aAAA,EACd,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,CAAC,cAAc,MAAA,EAAQ;AACzB,IAAA,2BAAQ,qBAAA,EAAA,EAAsB,CAAA;AAAA,EAChC;AAEA,EAAA,uBACE,GAAA,CAAC,QAAK,KAAA,EAAK,IAAA,EACR,uBAAc,GAAA,CAAI,CAAC,aAAa,KAAA,qBAC/B,GAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MAEC;AAAA,KAAA;AAAA,IADK,YAAY,EAAA,GAAK;AAAA,GAGzB,CAAA,EACH,CAAA;AAEJ;;;;"}
@@ -1,29 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from '../constants.esm.js';
3
- import { useEntity } from '@backstage/plugin-catalog-react';
4
- import { getPagerDutyEntity } from '../pagerDutyEntity.esm.js';
5
- import { PagerDutyCard } from '../PagerDutyCard/index.esm.js';
6
-
7
- const isPluginApplicableToEntity = (entity) => Boolean(
8
- entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] || entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID]
9
- );
10
- const EntityPagerDutyCard = (props) => {
11
- const { readOnly, disableChangeEvents, disableOnCall } = props;
12
- const { entity } = useEntity();
13
- if (isPluginApplicableToEntity(entity)) {
14
- const pagerDutyEntity = getPagerDutyEntity(entity);
15
- return /* @__PURE__ */ jsx(
16
- PagerDutyCard,
17
- {
18
- ...pagerDutyEntity,
19
- readOnly,
20
- disableChangeEvents,
21
- disableOnCall
22
- }
23
- );
24
- }
25
- return null;
26
- };
27
-
28
- export { EntityPagerDutyCard, isPluginApplicableToEntity };
29
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/components/EntityPagerDutyCard/index.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 { 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 disableOnCall?: boolean;\n};\n\n/** @public */\nexport const EntityPagerDutyCard = (props: EntityPagerDutyCardProps) => {\n const { readOnly, disableChangeEvents, disableOnCall } = props;\n const { entity } = useEntity();\n\n if (isPluginApplicableToEntity(entity)) {\n const pagerDutyEntity = getPagerDutyEntity(entity);\n\n return (\n <PagerDutyCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableChangeEvents={disableChangeEvents}\n disableOnCall={disableOnCall}\n />\n );\n }\n\n return null;\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,0BAAA,GAA6B,CAAC,MAAA,KACzC,OAAA;AAAA,EACE,MAAA,CAAO,SAAS,WAAA,GAAc,yBAAyB,KACrD,MAAA,CAAO,QAAA,CAAS,cAAc,oBAAoB;AACtD;AAUK,MAAM,mBAAA,GAAsB,CAAC,KAAA,KAAoC;AACtE,EAAA,MAAM,EAAE,QAAA,EAAU,mBAAA,EAAqB,aAAA,EAAc,GAAI,KAAA;AACzD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,IAAI,0BAAA,CAA2B,MAAM,CAAA,EAAG;AACtC,IAAA,MAAM,eAAA,GAAkB,mBAAmB,MAAM,CAAA;AAEjD,IAAA,uBACE,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACE,GAAG,eAAA;AAAA,QACJ,QAAA;AAAA,QACA,mBAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,EAEJ;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
@@ -1,29 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { PAGERDUTY_INTEGRATION_KEY, PAGERDUTY_SERVICE_ID } from '../constants.esm.js';
3
- import { useEntity } from '@backstage/plugin-catalog-react';
4
- import { getPagerDutyEntity } from '../pagerDutyEntity.esm.js';
5
- import { PagerDutySmallCard } from '../PagerDutySmallCard/index.esm.js';
6
-
7
- const isPluginApplicableToEntity = (entity) => Boolean(
8
- entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] || entity.metadata.annotations?.[PAGERDUTY_SERVICE_ID]
9
- );
10
- const EntityPagerDutySmallCard = (props) => {
11
- const { readOnly, disableInsights, disableOnCall } = props;
12
- const { entity } = useEntity();
13
- if (isPluginApplicableToEntity(entity)) {
14
- const pagerDutyEntity = getPagerDutyEntity(entity);
15
- return /* @__PURE__ */ jsx(
16
- PagerDutySmallCard,
17
- {
18
- ...pagerDutyEntity,
19
- readOnly,
20
- disableInsights,
21
- disableOnCall
22
- }
23
- );
24
- }
25
- return null;
26
- };
27
-
28
- export { EntityPagerDutySmallCard, isPluginApplicableToEntity };
29
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/components/EntityPagerDutySmallCard/index.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\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 { PagerDutySmallCard } from '../PagerDutySmallCard';\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 EntityPagerDutySmallCardProps = {\n readOnly?: boolean;\n disableInsights?: boolean;\n disableOnCall?: boolean;\n};\n\n/** @public */\nexport const EntityPagerDutySmallCard = (\n props: EntityPagerDutySmallCardProps,\n) => {\n const { readOnly, disableInsights, disableOnCall } = props;\n const { entity } = useEntity();\n\n if (isPluginApplicableToEntity(entity)) {\n const pagerDutyEntity = getPagerDutyEntity(entity);\n\n return (\n <PagerDutySmallCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableInsights={disableInsights}\n disableOnCall={disableOnCall}\n />\n );\n }\n\n return null;\n};\n"],"names":[],"mappings":";;;;;;AAuBO,MAAM,0BAAA,GAA6B,CAAC,MAAA,KACzC,OAAA;AAAA,EACE,MAAA,CAAO,SAAS,WAAA,GAAc,yBAAyB,KACrD,MAAA,CAAO,QAAA,CAAS,cAAc,oBAAoB;AACtD;AAUK,MAAM,wBAAA,GAA2B,CACtC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,QAAA,EAAU,eAAA,EAAiB,aAAA,EAAc,GAAI,KAAA;AACrD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,IAAI,0BAAA,CAA2B,MAAM,CAAA,EAAG;AACtC,IAAA,MAAM,eAAA,GAAkB,mBAAmB,MAAM,CAAA;AAEjD,IAAA,uBACE,GAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACE,GAAG,eAAA;AAAA,QACJ,QAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA;AAAA,KACF;AAAA,EAEJ;AAEA,EAAA,OAAO,IAAA;AACT;;;;"}
@@ -1,24 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Button } from '@material-ui/core';
3
- import { EmptyState } from '@backstage/core-components';
4
-
5
- const ForbiddenError = () => /* @__PURE__ */ jsx(
6
- EmptyState,
7
- {
8
- missing: "info",
9
- title: "Unauthorized",
10
- description: "You don't have the required permissions to perform this action. See README for more details.",
11
- action: /* @__PURE__ */ jsx(
12
- Button,
13
- {
14
- color: "primary",
15
- variant: "contained",
16
- href: "https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/",
17
- children: "Read More"
18
- }
19
- )
20
- }
21
- );
22
-
23
- export { ForbiddenError };
24
- //# sourceMappingURL=ForbiddenError.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForbiddenError.esm.js","sources":["../../../src/components/Errors/ForbiddenError.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 { 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"],"names":[],"mappings":";;;;AAmBO,MAAM,iBAAiB,sBAC5B,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAA,EAAQ,MAAA;AAAA,IACR,KAAA,EAAM,cAAA;AAAA,IACN,WAAA,EAAY,8FAAA;AAAA,IACZ,MAAA,kBACE,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAM,SAAA;AAAA,QACN,OAAA,EAAQ,WAAA;AAAA,QACR,IAAA,EAAK,8EAAA;AAAA,QACN,QAAA,EAAA;AAAA;AAAA;AAED;AAEJ;;;;"}
@@ -1,24 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Button } from '@material-ui/core';
3
- import { EmptyState } from '@backstage/core-components';
4
-
5
- const MissingTokenError = () => /* @__PURE__ */ jsx(
6
- EmptyState,
7
- {
8
- missing: "info",
9
- title: "Missing or invalid PagerDuty Token",
10
- description: "The request to fetch data needs a valid token. See README for more details.",
11
- action: /* @__PURE__ */ jsx(
12
- Button,
13
- {
14
- color: "primary",
15
- variant: "contained",
16
- href: "https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/",
17
- children: "Read More"
18
- }
19
- )
20
- }
21
- );
22
-
23
- export { MissingTokenError };
24
- //# sourceMappingURL=MissingTokenError.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MissingTokenError.esm.js","sources":["../../../src/components/Errors/MissingTokenError.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 { 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"],"names":[],"mappings":";;;;AAmBO,MAAM,oBAAoB,sBAC/B,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAA,EAAQ,MAAA;AAAA,IACR,KAAA,EAAM,oCAAA;AAAA,IACN,WAAA,EAAY,6EAAA;AAAA,IACZ,MAAA,kBACE,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAM,SAAA;AAAA,QACN,OAAA,EAAQ,WAAA;AAAA,QACR,IAAA,EAAK,8EAAA;AAAA,QACN,QAAA,EAAA;AAAA;AAAA;AAED;AAEJ;;;;"}
@@ -1,24 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Button } from '@material-ui/core';
3
- import { EmptyState } from '@backstage/core-components';
4
-
5
- const ServiceNotFoundError = () => /* @__PURE__ */ jsx(
6
- EmptyState,
7
- {
8
- missing: "data",
9
- title: "PagerDuty Service Not Found",
10
- description: "A service could not be found within PagerDuty based on the provided service id. Please verify your configuration.",
11
- action: /* @__PURE__ */ jsx(
12
- Button,
13
- {
14
- color: "primary",
15
- variant: "contained",
16
- href: "https://pagerduty.github.io/backstage-plugin-docs/getting-started/pagerduty/",
17
- children: "Read More"
18
- }
19
- )
20
- }
21
- );
22
-
23
- export { ServiceNotFoundError };
24
- //# sourceMappingURL=ServiceNotFoundError.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServiceNotFoundError.esm.js","sources":["../../../src/components/Errors/ServiceNotFoundError.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 { 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"],"names":[],"mappings":";;;;AAmBO,MAAM,uBAAuB,sBAClC,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAA,EAAQ,MAAA;AAAA,IACR,KAAA,EAAM,6BAAA;AAAA,IACN,WAAA,EAAY,mHAAA;AAAA,IACZ,MAAA,kBACE,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAM,SAAA;AAAA,QACN,OAAA,EAAQ,WAAA;AAAA,QACR,IAAA,EAAK,8EAAA;AAAA,QACN,QAAA,EAAA;AAAA;AAAA;AAED;AAEJ;;;;"}
@@ -1,53 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { List, ListSubheader } from '@material-ui/core';
3
- import { EscalationUsersEmptyState } from './EscalationUsersEmptyState.esm.js';
4
- import { EscalationUsersForbiddenState } from './EscalationUsersForbiddenState.esm.js';
5
- import { EscalationUser } from './EscalationUser.esm.js';
6
- import useAsync from 'react-use/lib/useAsync';
7
- import { pagerDutyApiRef } from '../../api/client.esm.js';
8
- import { Alert } from '@material-ui/lab';
9
- import { useApi } from '@backstage/core-plugin-api';
10
- import { Progress } from '@backstage/core-components';
11
-
12
- const EscalationPolicy = ({
13
- policyId,
14
- policyUrl,
15
- policyName,
16
- account
17
- }) => {
18
- const api = useApi(pagerDutyApiRef);
19
- const {
20
- value: users,
21
- loading,
22
- error
23
- } = useAsync(async () => {
24
- return await api.getOnCallByPolicyId(policyId, account);
25
- });
26
- if (error) {
27
- if (error.message.includes("Forbidden")) {
28
- return /* @__PURE__ */ jsx(List, { dense: true, subheader: /* @__PURE__ */ jsx(ListSubheader, { children: "ON CALL" }), children: /* @__PURE__ */ jsx(EscalationUsersForbiddenState, {}) });
29
- }
30
- return /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
31
- "Error encountered while fetching information. ",
32
- error.message
33
- ] });
34
- }
35
- if (loading) {
36
- return /* @__PURE__ */ jsx(Progress, { "data-testid": "escalation-progress" });
37
- }
38
- if (!users?.length) {
39
- return /* @__PURE__ */ jsx(EscalationUsersEmptyState, {});
40
- }
41
- return /* @__PURE__ */ jsx(List, { dense: true, children: users.map((user, index) => /* @__PURE__ */ jsx(
42
- EscalationUser,
43
- {
44
- user,
45
- policyUrl,
46
- policyName
47
- },
48
- index
49
- )) });
50
- };
51
-
52
- export { EscalationPolicy };
53
- //# sourceMappingURL=EscalationPolicy.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EscalationPolicy.esm.js","sources":["../../../src/components/Escalation/EscalationPolicy.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 */\nimport { List, ListSubheader } from '@material-ui/core';\nimport { EscalationUsersEmptyState } from './EscalationUsersEmptyState';\nimport { EscalationUsersForbiddenState } from './EscalationUsersForbiddenState';\nimport { EscalationUser } from './EscalationUser';\nimport useAsync from 'react-use/lib/useAsync';\nimport { pagerDutyApiRef } from '../../api';\nimport { Alert } from '@material-ui/lab';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\n\ntype Props = {\n policyId: string;\n policyUrl: string;\n policyName: string;\n account?: string;\n};\n\nexport const EscalationPolicy = ({\n policyId,\n policyUrl,\n policyName,\n account,\n}: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const {\n value: users,\n loading,\n error,\n } = useAsync(async () => {\n return await api.getOnCallByPolicyId(policyId, account);\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 data-testid=\"escalation-progress\" />;\n }\n\n if (!users?.length) {\n return <EscalationUsersEmptyState />;\n }\n\n return (\n <List dense>\n {users!.map((user, index) => (\n <EscalationUser\n key={index}\n user={user}\n policyUrl={policyUrl}\n policyName={policyName}\n />\n ))}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAiCO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,KAAa;AACX,EAAA,MAAM,GAAA,GAAM,OAAO,eAAe,CAAA;AAElC,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,KAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,OAAO,CAAA;AAAA,EACxD,CAAC,CAAA;AAED,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,QAAA,CAAS,WAAW,CAAA,EAAG;AACvC,MAAA,uBACE,GAAA,CAAC,IAAA,EAAA,EAAK,KAAA,EAAK,IAAA,EAAC,SAAA,kBAAW,GAAA,CAAC,aAAA,EAAA,EAAc,QAAA,EAAA,SAAA,EAAO,CAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,6BAAA,EAAA,EAA8B,CAAA,EACjC,CAAA;AAAA,IAEJ;AAEA,IAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAM,QAAA,EAAS,OAAA,EAAQ,QAAA,EAAA;AAAA,MAAA,gDAAA;AAAA,MACyB,KAAA,CAAM;AAAA,KAAA,EACvD,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAS,aAAA,EAAY,qBAAA,EAAsB,CAAA;AAAA,EACrD;AAEA,EAAA,IAAI,CAAC,OAAO,MAAA,EAAQ;AAClB,IAAA,2BAAQ,yBAAA,EAAA,EAA0B,CAAA;AAAA,EACpC;AAEA,EAAA,uBACE,GAAA,CAAC,QAAK,KAAA,EAAK,IAAA,EACR,gBAAO,GAAA,CAAI,CAAC,MAAM,KAAA,qBACjB,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MAEC,IAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA,KAAA;AAAA,IAHK;AAAA,GAKR,CAAA,EACH,CAAA;AAEJ;;;;"}
@@ -1,97 +0,0 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { makeStyles, ListItem, ListItemIcon, ListItemText, Typography, Tooltip } from '@material-ui/core';
3
- import NotificationsIcon from '@material-ui/icons/Notifications';
4
- import { Avatar, Button } from '@backstage/ui';
5
-
6
- const useStyles = makeStyles(() => ({
7
- listItemPrimary: {
8
- fontWeight: "bold"
9
- },
10
- listItemSecondary: {
11
- fontWeight: "normal",
12
- textDecoration: "underline",
13
- marginTop: "-5px",
14
- paddingLeft: "5px"
15
- },
16
- buttonStyle: {
17
- fontSize: "15px",
18
- "&:hover": {
19
- textDecoration: "underline"
20
- }
21
- },
22
- userTextButtonStyle: {
23
- fontSize: "15px",
24
- "&:hover": {
25
- backgroundColor: "transparent",
26
- textDecoration: "underline"
27
- }
28
- },
29
- containerStyle: {
30
- display: "flex",
31
- alignItems: "center",
32
- fontWeight: "bold"
33
- },
34
- iconStyle: {
35
- fontSize: "25px",
36
- marginLeft: "-4px"
37
- },
38
- avatarStyle: {
39
- marginTop: "-30px"
40
- }
41
- }));
42
- function navigateToUrl(url) {
43
- window.open(url, "_blank");
44
- }
45
- const EscalationUser = ({ user, policyUrl, policyName }) => {
46
- const classes = useStyles();
47
- return /* @__PURE__ */ jsxs(ListItem, { children: [
48
- /* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(
49
- Avatar,
50
- {
51
- name: user.name,
52
- src: user.avatar_url,
53
- className: classes.avatarStyle
54
- }
55
- ) }),
56
- /* @__PURE__ */ jsx(
57
- ListItemText,
58
- {
59
- primary: /* @__PURE__ */ jsxs(Fragment, { children: [
60
- /* @__PURE__ */ jsx(Tooltip, { title: "Open user in PagerDuty", placement: "top", children: /* @__PURE__ */ jsx(
61
- Button,
62
- {
63
- variant: "tertiary",
64
- "aria-label": "open-user-in-browser",
65
- onClick: () => navigateToUrl(user.html_url),
66
- className: classes.userTextButtonStyle,
67
- children: /* @__PURE__ */ jsx(Typography, { className: classes.containerStyle, children: user.name })
68
- }
69
- ) }),
70
- /* @__PURE__ */ jsx(
71
- Typography,
72
- {
73
- className: classes.listItemSecondary,
74
- color: "textSecondary",
75
- children: user.email
76
- }
77
- )
78
- ] }),
79
- secondary: /* @__PURE__ */ jsx(
80
- Button,
81
- {
82
- "aria-label": "open-escalation-policy-in-browser",
83
- onClick: () => navigateToUrl(policyUrl),
84
- variant: "tertiary",
85
- size: "small",
86
- className: classes.buttonStyle,
87
- iconStart: /* @__PURE__ */ jsx(NotificationsIcon, { className: classes.iconStyle }),
88
- children: /* @__PURE__ */ jsx(Typography, { className: classes.containerStyle, children: policyName })
89
- }
90
- )
91
- }
92
- )
93
- ] });
94
- };
95
-
96
- export { EscalationUser };
97
- //# sourceMappingURL=EscalationUser.esm.js.map