@backstage-community/plugin-ilert 0.7.1 → 0.8.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 (95) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/ILertIcon.esm.js +63 -56
  3. package/dist/ILertIcon.esm.js.map +1 -1
  4. package/dist/components/Alert/AlertActionsMenu.esm.js +49 -42
  5. package/dist/components/Alert/AlertActionsMenu.esm.js.map +1 -1
  6. package/dist/components/Alert/AlertAssignModal.esm.js +68 -60
  7. package/dist/components/Alert/AlertAssignModal.esm.js.map +1 -1
  8. package/dist/components/Alert/AlertLink.esm.js +5 -2
  9. package/dist/components/Alert/AlertLink.esm.js.map +1 -1
  10. package/dist/components/Alert/AlertNewModal.esm.js +109 -87
  11. package/dist/components/Alert/AlertNewModal.esm.js.map +1 -1
  12. package/dist/components/AlertSource/AlertSourceLink.esm.js +19 -16
  13. package/dist/components/AlertSource/AlertSourceLink.esm.js.map +1 -1
  14. package/dist/components/AlertsPage/AlertsPage.esm.js +44 -36
  15. package/dist/components/AlertsPage/AlertsPage.esm.js.map +1 -1
  16. package/dist/components/AlertsPage/AlertsTable.esm.js +15 -15
  17. package/dist/components/AlertsPage/AlertsTable.esm.js.map +1 -1
  18. package/dist/components/AlertsPage/StatusChip.esm.js +5 -5
  19. package/dist/components/AlertsPage/StatusChip.esm.js.map +1 -1
  20. package/dist/components/AlertsPage/TableTitle.esm.js +30 -24
  21. package/dist/components/AlertsPage/TableTitle.esm.js.map +1 -1
  22. package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js +6 -6
  23. package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js.map +1 -1
  24. package/dist/components/ILertCard/ILertCard.esm.js +63 -51
  25. package/dist/components/ILertCard/ILertCard.esm.js.map +1 -1
  26. package/dist/components/ILertCard/ILertCardActionsHeader.esm.js +42 -33
  27. package/dist/components/ILertCard/ILertCardActionsHeader.esm.js.map +1 -1
  28. package/dist/components/ILertCard/ILertCardEmptyState.esm.js +28 -20
  29. package/dist/components/ILertCard/ILertCardEmptyState.esm.js.map +1 -1
  30. package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js +3 -3
  31. package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js.map +1 -1
  32. package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js +36 -27
  33. package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js.map +1 -1
  34. package/dist/components/ILertCard/ILertCardOnCall.esm.js +34 -28
  35. package/dist/components/ILertCard/ILertCardOnCall.esm.js.map +1 -1
  36. package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js +6 -6
  37. package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js.map +1 -1
  38. package/dist/components/ILertCard/ILertCardOnCallItem.esm.js +41 -31
  39. package/dist/components/ILertCard/ILertCardOnCallItem.esm.js.map +1 -1
  40. package/dist/components/ILertPage/ILertPage.esm.js +25 -17
  41. package/dist/components/ILertPage/ILertPage.esm.js.map +1 -1
  42. package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js +45 -35
  43. package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js.map +1 -1
  44. package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js +14 -11
  45. package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js.map +1 -1
  46. package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js +31 -23
  47. package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js.map +1 -1
  48. package/dist/components/Service/ServiceActionsMenu.esm.js +29 -25
  49. package/dist/components/Service/ServiceActionsMenu.esm.js.map +1 -1
  50. package/dist/components/Service/ServiceLink.esm.js +5 -2
  51. package/dist/components/Service/ServiceLink.esm.js.map +1 -1
  52. package/dist/components/ServicesPage/ServicesPage.esm.js +17 -14
  53. package/dist/components/ServicesPage/ServicesPage.esm.js.map +1 -1
  54. package/dist/components/ServicesPage/ServicesTable.esm.js +9 -9
  55. package/dist/components/ServicesPage/ServicesTable.esm.js.map +1 -1
  56. package/dist/components/ServicesPage/StatusChip.esm.js +7 -7
  57. package/dist/components/ServicesPage/StatusChip.esm.js.map +1 -1
  58. package/dist/components/Shift/ShiftOverrideModal.esm.js +83 -74
  59. package/dist/components/Shift/ShiftOverrideModal.esm.js.map +1 -1
  60. package/dist/components/StatusPage/StatusPageActionsMenu.esm.js +32 -26
  61. package/dist/components/StatusPage/StatusPageActionsMenu.esm.js.map +1 -1
  62. package/dist/components/StatusPage/StatusPageLink.esm.js +5 -2
  63. package/dist/components/StatusPage/StatusPageLink.esm.js.map +1 -1
  64. package/dist/components/StatusPage/StatusPageURL.esm.js +2 -2
  65. package/dist/components/StatusPage/StatusPageURL.esm.js.map +1 -1
  66. package/dist/components/StatusPagePage/StatusChip.esm.js +7 -7
  67. package/dist/components/StatusPagePage/StatusChip.esm.js.map +1 -1
  68. package/dist/components/StatusPagePage/StatusPagesPage.esm.js +17 -14
  69. package/dist/components/StatusPagePage/StatusPagesPage.esm.js.map +1 -1
  70. package/dist/components/StatusPagePage/StatusPagesTable.esm.js +10 -10
  71. package/dist/components/StatusPagePage/StatusPagesTable.esm.js.map +1 -1
  72. package/dist/components/StatusPagePage/VisibilityChip.esm.js +4 -4
  73. package/dist/components/StatusPagePage/VisibilityChip.esm.js.map +1 -1
  74. package/dist/hooks/useAlertActions.esm.js +3 -5
  75. package/dist/hooks/useAlertActions.esm.js.map +1 -1
  76. package/dist/hooks/useAlertSource.esm.js +3 -5
  77. package/dist/hooks/useAlertSource.esm.js.map +1 -1
  78. package/dist/hooks/useAlertSourceOnCalls.esm.js +3 -3
  79. package/dist/hooks/useAlertSourceOnCalls.esm.js.map +1 -1
  80. package/dist/hooks/useAlerts.esm.js +6 -9
  81. package/dist/hooks/useAlerts.esm.js.map +1 -1
  82. package/dist/hooks/useAssignAlert.esm.js +6 -4
  83. package/dist/hooks/useAssignAlert.esm.js.map +1 -1
  84. package/dist/hooks/useNewAlert.esm.js +6 -10
  85. package/dist/hooks/useNewAlert.esm.js.map +1 -1
  86. package/dist/hooks/useOnCallSchedules.esm.js +5 -3
  87. package/dist/hooks/useOnCallSchedules.esm.js.map +1 -1
  88. package/dist/hooks/useServices.esm.js +4 -4
  89. package/dist/hooks/useServices.esm.js.map +1 -1
  90. package/dist/hooks/useShiftOverride.esm.js +4 -4
  91. package/dist/hooks/useShiftOverride.esm.js.map +1 -1
  92. package/dist/hooks/useStatusPages.esm.js +4 -6
  93. package/dist/hooks/useStatusPages.esm.js.map +1 -1
  94. package/dist/index.d.ts +6 -8
  95. package/package.json +13 -6
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import Card from '@material-ui/core/Card';
2
3
  import CardContent from '@material-ui/core/CardContent';
3
4
  import CardHeader from '@material-ui/core/CardHeader';
@@ -5,7 +6,6 @@ import Button from '@material-ui/core/Button';
5
6
  import Divider from '@material-ui/core/Divider';
6
7
  import Typography from '@material-ui/core/Typography';
7
8
  import { makeStyles } from '@material-ui/core/styles';
8
- import React from 'react';
9
9
  import { CodeSnippet } from '@backstage/core-components';
10
10
 
11
11
  const ENTITY_YAML = `apiVersion: backstage.io/v1alpha1
@@ -32,25 +32,33 @@ const useStyles = makeStyles((theme) => ({
32
32
  }));
33
33
  const ILertCardEmptyState = () => {
34
34
  const classes = useStyles();
35
- return /* @__PURE__ */ React.createElement(Card, { "data-testid": "ilert-empty-card" }, /* @__PURE__ */ React.createElement(CardHeader, { title: "iLert", className: classes.header }), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "No integration key defined for this entity. You can add integration key to your entity YAML as shown in the highlighted example below:"), /* @__PURE__ */ React.createElement("div", { className: classes.code }, /* @__PURE__ */ React.createElement(
36
- CodeSnippet,
37
- {
38
- text: ENTITY_YAML,
39
- language: "yaml",
40
- showLineNumbers: true,
41
- highlightedNumbers: [6, 7],
42
- customStyle: { background: "inherit", fontSize: "115%" }
43
- }
44
- )), /* @__PURE__ */ React.createElement(
45
- Button,
46
- {
47
- variant: "contained",
48
- color: "primary",
49
- target: "_blank",
50
- href: "https://github.com/backstage/backstage/blob/master/plugins/ilert/README.md"
51
- },
52
- "Read more"
53
- )));
35
+ return /* @__PURE__ */ jsxs(Card, { "data-testid": "ilert-empty-card", children: [
36
+ /* @__PURE__ */ jsx(CardHeader, { title: "iLert", className: classes.header }),
37
+ /* @__PURE__ */ jsx(Divider, {}),
38
+ /* @__PURE__ */ jsxs(CardContent, { children: [
39
+ /* @__PURE__ */ jsx(Typography, { variant: "body1", children: "No integration key defined for this entity. You can add integration key to your entity YAML as shown in the highlighted example below:" }),
40
+ /* @__PURE__ */ jsx("div", { className: classes.code, children: /* @__PURE__ */ jsx(
41
+ CodeSnippet,
42
+ {
43
+ text: ENTITY_YAML,
44
+ language: "yaml",
45
+ showLineNumbers: true,
46
+ highlightedNumbers: [6, 7],
47
+ customStyle: { background: "inherit", fontSize: "115%" }
48
+ }
49
+ ) }),
50
+ /* @__PURE__ */ jsx(
51
+ Button,
52
+ {
53
+ variant: "contained",
54
+ color: "primary",
55
+ target: "_blank",
56
+ href: "https://github.com/backstage/backstage/blob/master/plugins/ilert/README.md",
57
+ children: "Read more"
58
+ }
59
+ )
60
+ ] })
61
+ ] });
54
62
  };
55
63
 
56
64
  export { ILertCardEmptyState };
@@ -1 +1 @@
1
- {"version":3,"file":"ILertCardEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardEmptyState.tsx"],"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 */\n\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Button from '@material-ui/core/Button';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: example\n description: example.com\n annotations:\n ilert.com/integration-key: [INTEGRATION_KEY]\nspec:\n type: website\n lifecycle: production\n owner: guest`;\n\nconst useStyles = makeStyles(theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n header: {\n display: 'inline-block',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n}));\n\nexport const ILertCardEmptyState = () => {\n const classes = useStyles();\n\n return (\n <Card data-testid=\"ilert-empty-card\">\n <CardHeader title=\"iLert\" className={classes.header} />\n <Divider />\n <CardContent>\n <Typography variant=\"body1\">\n No integration key defined for this entity. You can add integration\n key to your entity YAML as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[6, 7]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/backstage/backstage/blob/master/plugins/ilert/README.md\"\n >\n Read more\n </Button>\n </CardContent>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA0BA,MAAM,WAAc,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,CAAA;AAYpB,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAA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GAE3D,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,WAAA;AAAA,MACR,KAAM,EAAA,SAAA;AAAA,MACN,MAAO,EAAA,QAAA;AAAA,MACP,IAAK,EAAA;AAAA,KAAA;AAAA,IACN;AAAA,GAGH,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ILertCardEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardEmptyState.tsx"],"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 */\n\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Button from '@material-ui/core/Button';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: example\n description: example.com\n annotations:\n ilert.com/integration-key: [INTEGRATION_KEY]\nspec:\n type: website\n lifecycle: production\n owner: guest`;\n\nconst useStyles = makeStyles(theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n header: {\n display: 'inline-block',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n}));\n\nexport const ILertCardEmptyState = () => {\n const classes = useStyles();\n\n return (\n <Card data-testid=\"ilert-empty-card\">\n <CardHeader title=\"iLert\" className={classes.header} />\n <Divider />\n <CardContent>\n <Typography variant=\"body1\">\n No integration key defined for this entity. You can add integration\n key to your entity YAML as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[6, 7]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/backstage/backstage/blob/master/plugins/ilert/README.md\"\n >\n Read more\n </Button>\n </CardContent>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,WAAc,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,CAAA;AAYpB,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,YAAc,EAAA,CAAA;AAAA,IACd,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA,IAC1B,UAAA,EACE,MAAM,OAAQ,CAAA,IAAA,KAAS,SAAS,MAAS,GAAA,KAAA,CAAM,QAAQ,MAAO,CAAA;AAAA,GAClE;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,cAAA;AAAA,IACT,SAAS,KAAM,CAAA,OAAA,CAAQ,CAAG,EAAA,CAAA,EAAG,GAAG,GAAG;AAAA;AAEvC,CAAE,CAAA,CAAA;AAEK,MAAM,sBAAsB,MAAM;AACvC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,aAAA,EAAY,kBAChB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,KAAA,EAAM,OAAQ,EAAA,SAAA,EAAW,QAAQ,MAAQ,EAAA,CAAA;AAAA,wBACpD,OAAQ,EAAA,EAAA,CAAA;AAAA,yBACR,WACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAQ,QAG5B,EAAA,wIAAA,EAAA,CAAA;AAAA,sBACC,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,IACtB,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,IAAM,EAAA,WAAA;AAAA,UACN,QAAS,EAAA,MAAA;AAAA,UACT,eAAe,EAAA,IAAA;AAAA,UACf,kBAAA,EAAoB,CAAC,CAAA,EAAG,CAAC,CAAA;AAAA,UACzB,WAAa,EAAA,EAAE,UAAY,EAAA,SAAA,EAAW,UAAU,MAAO;AAAA;AAAA,OAE3D,EAAA,CAAA;AAAA,sBACA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,KAAM,EAAA,SAAA;AAAA,UACN,MAAO,EAAA,QAAA;AAAA,UACP,IAAK,EAAA,4EAAA;AAAA,UACN,QAAA,EAAA;AAAA;AAAA;AAED,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import Chip from '@material-ui/core/Chip';
3
3
  import { withStyles } from '@material-ui/core/styles';
4
4
 
@@ -17,9 +17,9 @@ const ILertCardHeaderStatus = ({
17
17
  }
18
18
  switch (alertSource.status) {
19
19
  case "IN_MAINTENANCE":
20
- return /* @__PURE__ */ React.createElement(MaintenanceChip, { label: "MAINTENANCE", size: "small" });
20
+ return /* @__PURE__ */ jsx(MaintenanceChip, { label: "MAINTENANCE", size: "small" });
21
21
  case "DISABLED":
22
- return /* @__PURE__ */ React.createElement(MaintenanceChip, { label: "INACTIVE", size: "small" });
22
+ return /* @__PURE__ */ jsx(MaintenanceChip, { label: "INACTIVE", size: "small" });
23
23
  default:
24
24
  return null;
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ILertCardHeaderStatus.esm.js","sources":["../../../src/components/ILertCard/ILertCardHeaderStatus.tsx"],"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 */\nimport React from 'react';\nimport Chip from '@material-ui/core/Chip';\nimport { withStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\n\nconst MaintenanceChip = withStyles(theme => ({\n root: {\n backgroundColor: '#92949c',\n color: theme.palette.common.white,\n marginTop: 8,\n },\n}))(Chip);\n\nexport const ILertCardHeaderStatus = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n if (!alertSource) {\n return null;\n }\n\n switch (alertSource.status) {\n case 'IN_MAINTENANCE':\n return <MaintenanceChip label=\"MAINTENANCE\" size=\"small\" />;\n case 'DISABLED':\n return <MaintenanceChip label=\"INACTIVE\" size=\"small\" />;\n default:\n return null;\n }\n};\n"],"names":[],"mappings":";;;;AAoBA,MAAM,eAAA,GAAkB,WAAW,CAAU,KAAA,MAAA;AAAA,EAC3C,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA,SAAA;AAAA,IACjB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,IAC5B,SAAW,EAAA;AAAA;AAEf,CAAA,CAAE,EAAE,IAAI,CAAA;AAED,MAAM,wBAAwB,CAAC;AAAA,EACpC;AACF,CAEM,KAAA;AACJ,EAAA,IAAI,CAAC,WAAa,EAAA;AAChB,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,QAAQ,YAAY,MAAQ;AAAA,IAC1B,KAAK,gBAAA;AACH,MAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,KAAM,EAAA,aAAA,EAAc,MAAK,OAAQ,EAAA,CAAA;AAAA,IAC3D,KAAK,UAAA;AACH,MAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,KAAM,EAAA,UAAA,EAAW,MAAK,OAAQ,EAAA,CAAA;AAAA,IACxD;AACE,MAAO,OAAA,IAAA;AAAA;AAEb;;;;"}
1
+ {"version":3,"file":"ILertCardHeaderStatus.esm.js","sources":["../../../src/components/ILertCard/ILertCardHeaderStatus.tsx"],"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 */\nimport Chip from '@material-ui/core/Chip';\nimport { withStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\n\nconst MaintenanceChip = withStyles(theme => ({\n root: {\n backgroundColor: '#92949c',\n color: theme.palette.common.white,\n marginTop: 8,\n },\n}))(Chip);\n\nexport const ILertCardHeaderStatus = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n if (!alertSource) {\n return null;\n }\n\n switch (alertSource.status) {\n case 'IN_MAINTENANCE':\n return <MaintenanceChip label=\"MAINTENANCE\" size=\"small\" />;\n case 'DISABLED':\n return <MaintenanceChip label=\"INACTIVE\" size=\"small\" />;\n default:\n return null;\n }\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,eAAA,GAAkB,WAAW,CAAU,KAAA,MAAA;AAAA,EAC3C,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA,SAAA;AAAA,IACjB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,IAC5B,SAAW,EAAA;AAAA;AAEf,CAAA,CAAE,EAAE,IAAI,CAAA;AAED,MAAM,wBAAwB,CAAC;AAAA,EACpC;AACF,CAEM,KAAA;AACJ,EAAA,IAAI,CAAC,WAAa,EAAA;AAChB,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,QAAQ,YAAY,MAAQ;AAAA,IAC1B,KAAK,gBAAA;AACH,MAAA,uBAAQ,GAAA,CAAA,eAAA,EAAA,EAAgB,KAAM,EAAA,aAAA,EAAc,MAAK,OAAQ,EAAA,CAAA;AAAA,IAC3D,KAAK,UAAA;AACH,MAAA,uBAAQ,GAAA,CAAA,eAAA,EAAA,EAAgB,KAAM,EAAA,UAAA,EAAW,MAAK,OAAQ,EAAA,CAAA;AAAA,IACxD;AACE,MAAO,OAAA,IAAA;AAAA;AAEb;;;;"}
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import Button from '@material-ui/core/Button';
3
4
  import Dialog from '@material-ui/core/Dialog';
4
5
  import DialogActions from '@material-ui/core/DialogActions';
@@ -18,7 +19,7 @@ const ILertCardMaintenanceModal = ({
18
19
  }) => {
19
20
  const ilertApi = useApi(ilertApiRef);
20
21
  const alertApi = useApi(alertApiRef);
21
- const [minutes, setMinutes] = React.useState(5);
22
+ const [minutes, setMinutes] = useState(5);
22
23
  const handleClose = () => {
23
24
  setIsModalOpened(false);
24
25
  };
@@ -65,35 +66,43 @@ const ILertCardMaintenanceModal = ({
65
66
  if (!alertSource) {
66
67
  return null;
67
68
  }
68
- return /* @__PURE__ */ React.createElement(
69
+ return /* @__PURE__ */ jsxs(
69
70
  Dialog,
70
71
  {
71
72
  open: isModalOpened,
72
73
  onClose: handleClose,
73
- "aria-labelledby": "maintenance-form-title"
74
- },
75
- /* @__PURE__ */ React.createElement(DialogTitle, { id: "maintenance-form-title" }, "New maintenance window"),
76
- /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(DialogContentText, null, "Keep your alert sources quiet, when your systems are under maintenance."), /* @__PURE__ */ React.createElement(
77
- TextField,
78
- {
79
- select: true,
80
- label: "Duration",
81
- value: minutes,
82
- onChange: handleMinutesChange,
83
- variant: "outlined",
84
- fullWidth: true
85
- },
86
- minuteOptions.map((option) => /* @__PURE__ */ React.createElement(MenuItem, { key: option.value, value: option.value }, option.label))
87
- )),
88
- /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(
89
- Button,
90
- {
91
- onClick: handleImmediateMaintenance,
92
- color: "primary",
93
- variant: "contained"
94
- },
95
- "Create"
96
- ), /* @__PURE__ */ React.createElement(Button, { onClick: handleClose, color: "primary" }, "Cancel"))
74
+ "aria-labelledby": "maintenance-form-title",
75
+ children: [
76
+ /* @__PURE__ */ jsx(DialogTitle, { id: "maintenance-form-title", children: "New maintenance window" }),
77
+ /* @__PURE__ */ jsxs(DialogContent, { children: [
78
+ /* @__PURE__ */ jsx(DialogContentText, { children: "Keep your alert sources quiet, when your systems are under maintenance." }),
79
+ /* @__PURE__ */ jsx(
80
+ TextField,
81
+ {
82
+ select: true,
83
+ label: "Duration",
84
+ value: minutes,
85
+ onChange: handleMinutesChange,
86
+ variant: "outlined",
87
+ fullWidth: true,
88
+ children: minuteOptions.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option.value, children: option.label }, option.value))
89
+ }
90
+ )
91
+ ] }),
92
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
93
+ /* @__PURE__ */ jsx(
94
+ Button,
95
+ {
96
+ onClick: handleImmediateMaintenance,
97
+ color: "primary",
98
+ variant: "contained",
99
+ children: "Create"
100
+ }
101
+ ),
102
+ /* @__PURE__ */ jsx(Button, { onClick: handleClose, color: "primary", children: "Cancel" })
103
+ ] })
104
+ ]
105
+ }
97
106
  );
98
107
  };
99
108
 
@@ -1 +1 @@
1
- {"version":3,"file":"ILertCardMaintenanceModal.esm.js","sources":["../../../src/components/ILertCard/ILertCardMaintenanceModal.tsx"],"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 */\nimport React from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport { ilertApiRef } from '../../api';\nimport { AlertSource } from '../../types';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nexport const ILertCardMaintenanceModal = ({\n alertSource,\n refetchAlertSource,\n isModalOpened,\n setIsModalOpened,\n}: {\n alertSource: AlertSource | null;\n refetchAlertSource: () => void;\n isModalOpened: boolean;\n setIsModalOpened: (isModalOpened: boolean) => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const alertApi = useApi(alertApiRef);\n const [minutes, setMinutes] = React.useState(5);\n\n const handleClose = () => {\n setIsModalOpened(false);\n };\n\n const handleImmediateMaintenance = () => {\n if (!alertSource) {\n return;\n }\n setIsModalOpened(false);\n setTimeout(async () => {\n try {\n await ilertApi.addImmediateMaintenance(alertSource.id, minutes);\n alertApi.post({ message: 'Maintenance started.' });\n refetchAlertSource();\n } catch (err) {\n alertApi.post({ message: err, severity: 'error' });\n }\n }, 250);\n };\n\n const handleMinutesChange = (event: any) => {\n setMinutes(event.target.value);\n };\n\n const minuteOptions = [\n {\n value: 5,\n label: '5 minutes',\n },\n {\n value: 10,\n label: '10 minutes',\n },\n {\n value: 15,\n label: '15 minutes',\n },\n {\n value: 30,\n label: '30 minutes',\n },\n {\n value: 60,\n label: '60 minutes',\n },\n ];\n\n if (!alertSource) {\n return null;\n }\n\n return (\n <Dialog\n open={isModalOpened}\n onClose={handleClose}\n aria-labelledby=\"maintenance-form-title\"\n >\n <DialogTitle id=\"maintenance-form-title\">\n New maintenance window\n </DialogTitle>\n <DialogContent>\n <DialogContentText>\n Keep your alert sources quiet, when your systems are under\n maintenance.\n </DialogContentText>\n <TextField\n select\n label=\"Duration\"\n value={minutes}\n onChange={handleMinutesChange}\n variant=\"outlined\"\n fullWidth\n >\n {minuteOptions.map(option => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </TextField>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={handleImmediateMaintenance}\n color=\"primary\"\n variant=\"contained\"\n >\n Create\n </Button>\n <Button onClick={handleClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA,kBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAKM,KAAA;AACJ,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AAE9C,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,gBAAA,CAAiB,KAAK,CAAA;AAAA,GACxB;AAEA,EAAA,MAAM,6BAA6B,MAAM;AACvC,IAAA,IAAI,CAAC,W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,WAAA,EAAA,EAAY,EAAG,EAAA,wBAAA,EAAA,EAAyB,wBAEzC,CAAA;AAAA,oBACC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAA,EAAkB,yEAGnB,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,MAAM,EAAA,IAAA;AAAA,QACN,KAAM,EAAA,UAAA;AAAA,QACN,KAAO,EAAA,OAAA;AAAA,QACP,QAAU,EAAA,mBAAA;AAAA,QACV,OAAQ,EAAA,UAAA;AAAA,QACR,SAAS,EAAA;AAAA,OAAA;AAAA,MAER,aAAc,CAAA,GAAA,CAAI,CACjB,MAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,QAAS,EAAA,EAAA,GAAA,EAAK,MAAO,CAAA,KAAA,EAAO,KAAO,EAAA,MAAA,CAAO,KACxC,EAAA,EAAA,MAAA,CAAO,KACV,CACD;AAAA,KAEL,CAAA;AAAA,wCACC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAS,EAAA,0BAAA;AAAA,QACT,KAAM,EAAA,SAAA;AAAA,QACN,OAAQ,EAAA;AAAA,OAAA;AAAA,MACT;AAAA,KAED,sCACC,MAAO,EAAA,EAAA,OAAA,EAAS,aAAa,KAAM,EAAA,SAAA,EAAA,EAAU,QAE9C,CACF;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ILertCardMaintenanceModal.esm.js","sources":["../../../src/components/ILertCard/ILertCardMaintenanceModal.tsx"],"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 */\nimport { useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport { ilertApiRef } from '../../api';\nimport { AlertSource } from '../../types';\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\n\nexport const ILertCardMaintenanceModal = ({\n alertSource,\n refetchAlertSource,\n isModalOpened,\n setIsModalOpened,\n}: {\n alertSource: AlertSource | null;\n refetchAlertSource: () => void;\n isModalOpened: boolean;\n setIsModalOpened: (isModalOpened: boolean) => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const alertApi = useApi(alertApiRef);\n const [minutes, setMinutes] = useState(5);\n\n const handleClose = () => {\n setIsModalOpened(false);\n };\n\n const handleImmediateMaintenance = () => {\n if (!alertSource) {\n return;\n }\n setIsModalOpened(false);\n setTimeout(async () => {\n try {\n await ilertApi.addImmediateMaintenance(alertSource.id, minutes);\n alertApi.post({ message: 'Maintenance started.' });\n refetchAlertSource();\n } catch (err) {\n alertApi.post({ message: err, severity: 'error' });\n }\n }, 250);\n };\n\n const handleMinutesChange = (event: any) => {\n setMinutes(event.target.value);\n };\n\n const minuteOptions = [\n {\n value: 5,\n label: '5 minutes',\n },\n {\n value: 10,\n label: '10 minutes',\n },\n {\n value: 15,\n label: '15 minutes',\n },\n {\n value: 30,\n label: '30 minutes',\n },\n {\n value: 60,\n label: '60 minutes',\n },\n ];\n\n if (!alertSource) {\n return null;\n }\n\n return (\n <Dialog\n open={isModalOpened}\n onClose={handleClose}\n aria-labelledby=\"maintenance-form-title\"\n >\n <DialogTitle id=\"maintenance-form-title\">\n New maintenance window\n </DialogTitle>\n <DialogContent>\n <DialogContentText>\n Keep your alert sources quiet, when your systems are under\n maintenance.\n </DialogContentText>\n <TextField\n select\n label=\"Duration\"\n value={minutes}\n onChange={handleMinutesChange}\n variant=\"outlined\"\n fullWidth\n >\n {minuteOptions.map(option => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </TextField>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={handleImmediateMaintenance}\n color=\"primary\"\n variant=\"contained\"\n >\n Create\n </Button>\n <Button onClick={handleClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA4BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA,kBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAKM,KAAA;AACJ,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,CAAC,CAAA;AAExC,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,gBAAA,CAAiB,KAAK,CAAA;AAAA,GACxB;AAEA,EAAA,MAAM,6BAA6B,MAAM;AACvC,IAAA,IAAI,CAAC,WAAa,EAAA;AAChB,MAAA;AAAA;AAEF,IAAA,gBAAA,CAAiB,KAAK,CAAA;AACtB,IAAA,UAAA,CAAW,YAAY;AACrB,MAAI,IAAA;AACF,QAAA,MAAM,QAAS,CAAA,uBAAA,CAAwB,WAAY,CAAA,EAAA,EAAI,OAAO,CAAA;AAC9D,QAAA,QAAA,CAAS,IAAK,CAAA,EAAE,OAAS,EAAA,sBAAA,EAAwB,CAAA;AACjD,QAAmB,kBAAA,EAAA;AAAA,eACZ,GAAK,EAAA;AACZ,QAAA,QAAA,CAAS,KAAK,EAAE,OAAA,E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EAAA,UAAA;AAAA,cACR,SAAS,EAAA,IAAA;AAAA,cAER,QAAc,EAAA,aAAA,CAAA,GAAA,CAAI,CACjB,MAAA,qBAAA,GAAA,CAAC,QAA4B,EAAA,EAAA,KAAA,EAAO,MAAO,CAAA,KAAA,EACxC,QAAO,EAAA,MAAA,CAAA,KAAA,EAAA,EADK,MAAO,CAAA,KAEtB,CACD;AAAA;AAAA;AACH,SACF,EAAA,CAAA;AAAA,6BACC,aACC,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,OAAS,EAAA,0BAAA;AAAA,cACT,KAAM,EAAA,SAAA;AAAA,cACN,OAAQ,EAAA,WAAA;AAAA,cACT,QAAA,EAAA;AAAA;AAAA,WAED;AAAA,8BACC,MAAO,EAAA,EAAA,OAAA,EAAS,WAAa,EAAA,KAAA,EAAM,WAAU,QAE9C,EAAA,QAAA,EAAA;AAAA,SACF,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import List from '@material-ui/core/List';
3
3
  import ListItem from '@material-ui/core/ListItem';
4
4
  import ListItemIcon from '@material-ui/core/ListItemIcon';
@@ -26,7 +26,7 @@ const ILertCardOnCall = ({
26
26
  const classes = useStyles();
27
27
  const [{ onCalls, isLoading }, {}] = useAlertSourceOnCalls(alertSource);
28
28
  if (isLoading) {
29
- return /* @__PURE__ */ React.createElement(Progress, null);
29
+ return /* @__PURE__ */ jsx(Progress, {});
30
30
  }
31
31
  if (!alertSource || !onCalls) {
32
32
  return null;
@@ -35,43 +35,49 @@ const ILertCardOnCall = ({
35
35
  if (!alertSource || !alertSource.escalationPolicy || !alertSource.escalationPolicy.repeating || !alertSource.escalationPolicy.frequency) {
36
36
  return null;
37
37
  }
38
- return /* @__PURE__ */ React.createElement(ListItem, { key: "repeat" }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(ReplayIcon, { className: classes.repeatIcon, fontSize: "small" })), /* @__PURE__ */ React.createElement(
39
- ListItemText,
40
- {
41
- primary: /* @__PURE__ */ React.createElement(
42
- Typography,
43
- {
44
- variant: "body2",
45
- color: "textSecondary",
46
- className: classes.repeatText
47
- },
48
- `Repeat ${alertSource.escalationPolicy.frequency} times`
49
- )
50
- }
51
- ));
38
+ return /* @__PURE__ */ jsxs(ListItem, { children: [
39
+ /* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(ReplayIcon, { className: classes.repeatIcon, fontSize: "small" }) }),
40
+ /* @__PURE__ */ jsx(
41
+ ListItemText,
42
+ {
43
+ primary: /* @__PURE__ */ jsx(
44
+ Typography,
45
+ {
46
+ variant: "body2",
47
+ color: "textSecondary",
48
+ className: classes.repeatText,
49
+ children: `Repeat ${alertSource.escalationPolicy.frequency} times`
50
+ }
51
+ )
52
+ }
53
+ )
54
+ ] }, "repeat");
52
55
  };
53
56
  if (!onCalls.length) {
54
- return /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL") }, /* @__PURE__ */ React.createElement(ILertCardOnCallEmptyState, null));
57
+ return /* @__PURE__ */ jsx(List, { dense: true, subheader: /* @__PURE__ */ jsx(ListSubheader, { children: "ON CALL" }), children: /* @__PURE__ */ jsx(ILertCardOnCallEmptyState, {}) });
55
58
  }
56
59
  if (onCalls.length === 1) {
57
- /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL") }, /* @__PURE__ */ React.createElement(
60
+ /* @__PURE__ */ jsx(List, { dense: true, subheader: /* @__PURE__ */ jsx(ListSubheader, { children: "ON CALL" }), children: /* @__PURE__ */ jsx(
58
61
  ILertCardOnCallItem,
59
62
  {
60
63
  onCall: onCalls[0],
61
64
  fistItem: false,
62
65
  lastItem: false
63
66
  }
64
- ));
67
+ ) });
65
68
  }
66
- return /* @__PURE__ */ React.createElement(List, { dense: true, subheader: /* @__PURE__ */ React.createElement(ListSubheader, null, "ON CALL") }, onCalls.map((onCall, index) => /* @__PURE__ */ React.createElement(
67
- ILertCardOnCallItem,
68
- {
69
- key: index,
70
- onCall,
71
- fistItem: index === 0,
72
- lastItem: index === onCalls.length - 1
73
- }
74
- )), repeatInfo());
69
+ return /* @__PURE__ */ jsxs(List, { dense: true, subheader: /* @__PURE__ */ jsx(ListSubheader, { children: "ON CALL" }), children: [
70
+ onCalls.map((onCall, index) => /* @__PURE__ */ jsx(
71
+ ILertCardOnCallItem,
72
+ {
73
+ onCall,
74
+ fistItem: index === 0,
75
+ lastItem: index === onCalls.length - 1
76
+ },
77
+ index
78
+ )),
79
+ repeatInfo()
80
+ ] });
75
81
  };
76
82
 
77
83
  export { ILertCardOnCall };
@@ -1 +1 @@
1
- {"version":3,"file":"ILertCardOnCall.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCall.tsx"],"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 */\nimport React from 'react';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListSubheader from '@material-ui/core/ListSubheader';\nimport Typography from '@material-ui/core/Typography';\nimport ReplayIcon from '@material-ui/icons/Replay';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\nimport { useAlertSourceOnCalls } from '../../hooks/useAlertSourceOnCalls';\nimport { ILertCardOnCallEmptyState } from './ILertCardOnCallEmptyState';\nimport { ILertCardOnCallItem } from './ILertCardOnCallItem';\nimport { Progress } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n repeatText: {\n fontStyle: 'italic',\n },\n repeatIcon: {\n marginLeft: theme.spacing(1),\n },\n}));\n\nexport const ILertCardOnCall = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n const classes = useStyles();\n const [{ onCalls, isLoading }, {}] = useAlertSourceOnCalls(alertSource);\n\n if (isLoading) {\n return <Progress />;\n }\n\n if (!alertSource || !onCalls) {\n return null;\n }\n\n const repeatInfo = () => {\n if (\n !alertSource ||\n !alertSource.escalationPolicy ||\n !alertSource.escalationPolicy.repeating ||\n !alertSource.escalationPolicy.frequency\n ) {\n return null;\n }\n\n return (\n <ListItem key=\"repeat\">\n <ListItemIcon>\n <ReplayIcon className={classes.repeatIcon} fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={classes.repeatText}\n >\n {`Repeat ${alertSource.escalationPolicy.frequency} times`}\n </Typography>\n }\n />\n </ListItem>\n );\n };\n\n if (!onCalls.length) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallEmptyState />\n </List>\n );\n }\n\n if (onCalls.length === 1) {\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallItem\n onCall={onCalls[0]}\n fistItem={false}\n lastItem={false}\n />\n </List>;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n {onCalls.map((onCall, index) => (\n <ILertCardOnCallItem\n key={index}\n onCall={onCall}\n fistItem={index === 0}\n lastItem={index === onCalls.length - 1}\n />\n ))}\n {repeatInfo()}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,UAA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","sources":["../../../src/components/ILertCard/ILertCardOnCall.tsx"],"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 */\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListSubheader from '@material-ui/core/ListSubheader';\nimport Typography from '@material-ui/core/Typography';\nimport ReplayIcon from '@material-ui/icons/Replay';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\nimport { useAlertSourceOnCalls } from '../../hooks/useAlertSourceOnCalls';\nimport { ILertCardOnCallEmptyState } from './ILertCardOnCallEmptyState';\nimport { ILertCardOnCallItem } from './ILertCardOnCallItem';\nimport { Progress } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n repeatText: {\n fontStyle: 'italic',\n },\n repeatIcon: {\n marginLeft: theme.spacing(1),\n },\n}));\n\nexport const ILertCardOnCall = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n const classes = useStyles();\n const [{ onCalls, isLoading }, {}] = useAlertSourceOnCalls(alertSource);\n\n if (isLoading) {\n return <Progress />;\n }\n\n if (!alertSource || !onCalls) {\n return null;\n }\n\n const repeatInfo = () => {\n if (\n !alertSource ||\n !alertSource.escalationPolicy ||\n !alertSource.escalationPolicy.repeating ||\n !alertSource.escalationPolicy.frequency\n ) {\n return null;\n }\n\n return (\n <ListItem key=\"repeat\">\n <ListItemIcon>\n <ReplayIcon className={classes.repeatIcon} fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={classes.repeatText}\n >\n {`Repeat ${alertSource.escalationPolicy.frequency} times`}\n </Typography>\n }\n />\n </ListItem>\n );\n };\n\n if (!onCalls.length) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallEmptyState />\n </List>\n );\n }\n\n if (onCalls.length === 1) {\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallItem\n onCall={onCalls[0]}\n fistItem={false}\n lastItem={false}\n />\n </List>;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n {onCalls.map((onCall, index) => (\n <ILertCardOnCallItem\n key={index}\n onCall={onCall}\n fistItem={index === 0}\n lastItem={index === onCalls.length - 1}\n />\n ))}\n {repeatInfo()}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,UAAY,EAAA;AAAA,IACV,SAAW,EAAA;AAAA,GACb;AAAA,EACA,UAAY,EAAA;AAAA,IACV,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE/B,CAAE,CAAA,CAAA;AAEK,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AACF,CAEM,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,CAAC,EAAE,OAAS,EAAA,SAAA,IAAa,EAAE,CAAI,GAAA,qBAAA,CAAsB,WAAW,CAAA;AAEtE,EAAA,IAAI,SAAW,EAAA;AACb,IAAA,2BAAQ,QAAS,EAAA,EAAA,CAAA;AAAA;AAGnB,EAAI,IAAA,CAAC,WAAe,IAAA,CAAC,OAAS,EAAA;AAC5B,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,MAAM,aAAa,MAAM;AACvB,IAAA,IACE,CAAC,WAAA,IACD,CAAC,WAAA,CAAY,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A;AAAA,QACV,QAAU,EAAA;AAAA;AAAA,KAEd,EAAA,CAAA;AAAA;AAGF,EACE,uBAAA,IAAA,CAAC,QAAK,KAAK,EAAA,IAAA,EAAC,2BAAY,GAAA,CAAA,aAAA,EAAA,EAAc,qBAAO,CAC1C,EAAA,QAAA,EAAA;AAAA,IAAQ,OAAA,CAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,KACpB,qBAAA,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QAEC,MAAA;AAAA,QACA,UAAU,KAAU,KAAA,CAAA;AAAA,QACpB,QAAA,EAAU,KAAU,KAAA,OAAA,CAAQ,MAAS,GAAA;AAAA,OAAA;AAAA,MAHhC;AAAA,KAKR,CAAA;AAAA,IACA,UAAW;AAAA,GACd,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { makeStyles } from '@material-ui/core/styles';
3
3
  import ListItem from '@material-ui/core/ListItem';
4
4
  import ListItemText from '@material-ui/core/ListItemText';
@@ -11,15 +11,15 @@ const useStyles = makeStyles({
11
11
  });
12
12
  const ILertCardOnCallEmptyState = () => {
13
13
  const classes = useStyles();
14
- return /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemText, null, /* @__PURE__ */ React.createElement(
14
+ return /* @__PURE__ */ jsx(ListItem, { children: /* @__PURE__ */ jsx(ListItemText, { children: /* @__PURE__ */ jsx(
15
15
  Typography,
16
16
  {
17
17
  variant: "subtitle1",
18
18
  color: "textSecondary",
19
- className: classes.text
20
- },
21
- "Nobody"
22
- )));
19
+ className: classes.text,
20
+ children: "Nobody"
21
+ }
22
+ ) }) });
23
23
  };
24
24
 
25
25
  export { ILertCardOnCallEmptyState };
@@ -1 +1 @@
1
- {"version":3,"file":"ILertCardOnCallEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallEmptyState.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 React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Typography from '@material-ui/core/Typography';\n\nconst useStyles = makeStyles({\n text: {\n fontStyle: 'italic',\n },\n});\n\nexport const ILertCardOnCallEmptyState = () => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemText>\n <Typography\n variant=\"subtitle1\"\n color=\"textSecondary\"\n className={classes.text}\n >\n Nobody\n </Typography>\n </ListItemText>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA;AAEM,MAAM,4BAA4B,MAAM;AAC7C,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,YACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,WAAA;AAAA,MACR,KAAM,EAAA,eAAA;AAAA,MACN,WAAW,OAAQ,CAAA;AAAA,KAAA;AAAA,IACpB;AAAA,GAGH,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ILertCardOnCallEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallEmptyState.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 { makeStyles } from '@material-ui/core/styles';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Typography from '@material-ui/core/Typography';\n\nconst useStyles = makeStyles({\n text: {\n fontStyle: 'italic',\n },\n});\n\nexport const ILertCardOnCallEmptyState = () => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemText>\n <Typography\n variant=\"subtitle1\"\n color=\"textSecondary\"\n className={classes.text}\n >\n Nobody\n </Typography>\n </ListItemText>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA;AAEM,MAAM,4BAA4B,MAAM;AAC7C,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,GAAA,CAAC,QACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,YACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,WAAA;AAAA,MACR,KAAM,EAAA,eAAA;AAAA,MACN,WAAW,OAAQ,CAAA,IAAA;AAAA,MACpB,QAAA,EAAA;AAAA;AAAA,KAGH,CACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import Divider from '@material-ui/core/Divider';
3
3
  import ListItem from '@material-ui/core/ListItem';
4
4
  import ListItemIcon from '@material-ui/core/ListItemIcon';
@@ -69,40 +69,50 @@ const ILertCardOnCallItem = ({
69
69
  }
70
70
  }
71
71
  }
72
- return /* @__PURE__ */ React.createElement(ListItem, null, fistItem ? /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", className: classes.fistItemLine }) : null, lastItem ? /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", className: classes.lastItemLine }) : null, !fistItem && !lastItem ? /* @__PURE__ */ React.createElement(Divider, { orientation: "vertical", className: classes.itemLine }) : null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(
73
- Tooltip,
74
- {
75
- title: `Escalation level #${onCall.escalationLevel}`,
76
- placement: "top"
77
- },
78
- /* @__PURE__ */ React.createElement(Avatar, null, onCall.escalationLevel)
79
- )), onCall.schedule ? /* @__PURE__ */ React.createElement(
80
- Tooltip,
81
- {
82
- title: `On call shift ${DateTime.fromISO(onCall.start).toFormat("D MMM, HH:mm")} - ${DateTime.fromISO(onCall.end).toFormat("D MMM, HH:mm")}`,
83
- placement: "top-start"
84
- },
85
- /* @__PURE__ */ React.createElement(
72
+ return /* @__PURE__ */ jsxs(ListItem, { children: [
73
+ fistItem ? /* @__PURE__ */ jsx(Divider, { orientation: "vertical", className: classes.fistItemLine }) : null,
74
+ lastItem ? /* @__PURE__ */ jsx(Divider, { orientation: "vertical", className: classes.lastItemLine }) : null,
75
+ !fistItem && !lastItem ? /* @__PURE__ */ jsx(Divider, { orientation: "vertical", className: classes.itemLine }) : null,
76
+ /* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(
77
+ Tooltip,
78
+ {
79
+ title: `Escalation level #${onCall.escalationLevel}`,
80
+ placement: "top",
81
+ children: /* @__PURE__ */ jsx(Avatar, { children: onCall.escalationLevel })
82
+ }
83
+ ) }),
84
+ onCall.schedule ? /* @__PURE__ */ jsx(
85
+ Tooltip,
86
+ {
87
+ title: `On call shift ${DateTime.fromISO(onCall.start).toFormat("D MMM, HH:mm")} - ${DateTime.fromISO(onCall.end).toFormat("D MMM, HH:mm")}`,
88
+ placement: "top-start",
89
+ children: /* @__PURE__ */ jsx(
90
+ ListItemText,
91
+ {
92
+ primary: /* @__PURE__ */ jsx(Typography, { className: classes.listItemPrimary, children: ilertApi.getUserInitials(onCall.user) }),
93
+ secondary: escalationText
94
+ }
95
+ )
96
+ }
97
+ ) : /* @__PURE__ */ jsx(
86
98
  ListItemText,
87
99
  {
88
- primary: /* @__PURE__ */ React.createElement(Typography, { className: classes.listItemPrimary }, ilertApi.getUserInitials(onCall.user)),
100
+ primary: /* @__PURE__ */ jsx(Typography, { className: classes.listItemPrimary, children: ilertApi.getUserInitials(onCall.user) }),
89
101
  secondary: escalationText
90
102
  }
91
- )
92
- ) : /* @__PURE__ */ React.createElement(
93
- ListItemText,
94
- {
95
- primary: /* @__PURE__ */ React.createElement(Typography, { className: classes.listItemPrimary }, ilertApi.getUserInitials(onCall.user)),
96
- secondary: escalationText
97
- }
98
- ), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, phoneNumber ? /* @__PURE__ */ React.createElement(Tooltip, { title: "Call to user", placement: "top" }, /* @__PURE__ */ React.createElement(IconButton, { href: `tel:${phoneNumber}` }, /* @__PURE__ */ React.createElement(PhoneIcon, { color: "secondary" }))) : null, /* @__PURE__ */ React.createElement(
99
- Tooltip,
100
- {
101
- title: `Send e-mail to user ${onCall.user.email}`,
102
- placement: "top"
103
- },
104
- /* @__PURE__ */ React.createElement(IconButton, { href: `mailto:${onCall.user.email}` }, /* @__PURE__ */ React.createElement(EmailIcon, { color: "primary" }))
105
- )));
103
+ ),
104
+ /* @__PURE__ */ jsxs(ListItemSecondaryAction, { children: [
105
+ phoneNumber ? /* @__PURE__ */ jsx(Tooltip, { title: "Call to user", placement: "top", children: /* @__PURE__ */ jsx(IconButton, { href: `tel:${phoneNumber}`, children: /* @__PURE__ */ jsx(PhoneIcon, { color: "secondary" }) }) }) : null,
106
+ /* @__PURE__ */ jsx(
107
+ Tooltip,
108
+ {
109
+ title: `Send e-mail to user ${onCall.user.email}`,
110
+ placement: "top",
111
+ children: /* @__PURE__ */ jsx(IconButton, { href: `mailto:${onCall.user.email}`, children: /* @__PURE__ */ jsx(EmailIcon, { color: "primary" }) })
112
+ }
113
+ )
114
+ ] })
115
+ ] });
106
116
  };
107
117
 
108
118
  export { ILertCardOnCallItem };
@@ -1 +1 @@
1
- {"version":3,"file":"ILertCardOnCallItem.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallItem.tsx"],"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 */\nimport React from 'react';\nimport Divider from '@material-ui/core/Divider';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Avatar from '@material-ui/core/Avatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport EmailIcon from '@material-ui/icons/Email';\nimport PhoneIcon from '@material-ui/icons/Phone';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { OnCall } from '../../types';\nimport { ilertApiRef } from '../../api';\nimport { DateTime as dt } from 'luxon';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n listItemPrimary: {\n fontWeight: 'bold',\n },\n fistItemLine: {\n position: 'absolute',\n bottom: 0,\n height: '50%',\n left: 36,\n },\n lastItemLine: {\n position: 'absolute',\n top: 0,\n height: '50%',\n left: 36,\n },\n itemLine: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n height: '100%',\n left: 36,\n },\n});\n\nexport const ILertCardOnCallItem = ({\n onCall,\n fistItem = false,\n lastItem = false,\n}: {\n onCall: OnCall;\n fistItem?: boolean;\n lastItem?: boolean;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const classes = useStyles();\n\n if (!onCall || !onCall.user) {\n return null;\n }\n\n const phoneNumber = ilertApi.getUserPhoneNumber(onCall.user);\n const escalationRepeating = onCall.escalationPolicy.repeating;\n const escalationSeconds =\n onCall.escalationPolicy.escalationRules[onCall.escalationLevel - 1]\n .escalationTimeout;\n const escalationHoursOnly = Math.floor(escalationSeconds / 60);\n const escalationMinutesOnly = escalationSeconds % 60;\n\n let escalationText = '';\n if (!lastItem || (lastItem && escalationRepeating)) {\n escalationText = 'escalate';\n if (escalationSeconds === 0) {\n escalationText += ' immediately';\n } else {\n escalationText += ' after';\n if (escalationHoursOnly > 0) {\n escalationText += ` ${escalationHoursOnly} ${\n escalationHoursOnly === 1 ? 'hour' : 'hours'\n }`;\n }\n if (escalationMinutesOnly > 0 || escalationSeconds === 0) {\n escalationText += ` ${escalationMinutesOnly} ${\n escalationMinutesOnly === 1 ? 'minute' : 'minutes'\n }`;\n }\n }\n }\n\n return (\n <ListItem>\n {fistItem ? (\n <Divider orientation=\"vertical\" className={classes.fistItemLine} />\n ) : null}\n {lastItem ? (\n <Divider orientation=\"vertical\" className={classes.lastItemLine} />\n ) : null}\n {!fistItem && !lastItem ? (\n <Divider orientation=\"vertical\" className={classes.itemLine} />\n ) : null}\n <ListItemIcon>\n <Tooltip\n title={`Escalation level #${onCall.escalationLevel}`}\n placement=\"top\"\n >\n <Avatar>{onCall.escalationLevel}</Avatar>\n </Tooltip>\n </ListItemIcon>\n {onCall.schedule ? (\n <Tooltip\n title={\n 'On call shift ' +\n `${dt.fromISO(onCall.start).toFormat('D MMM, HH:mm')} - ` +\n `${dt.fromISO(onCall.end).toFormat('D MMM, HH:mm')}`\n }\n placement=\"top-start\"\n >\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n </Tooltip>\n ) : (\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n )}\n <ListItemSecondaryAction>\n {phoneNumber ? (\n <Tooltip title=\"Call to user\" placement=\"top\">\n <IconButton href={`tel:${phoneNumber}`}>\n <PhoneIcon color=\"secondary\" />\n </IconButton>\n </Tooltip>\n ) : null}\n <Tooltip\n title={`Send e-mail to user ${onCall.user.email}`}\n placement=\"top\"\n >\n <IconButton href={`mailto:${onCall.user.email}`}>\n <EmailIcon color=\"primary\" />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":["dt"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,eAAiB,EAAA;AAAA,IACf,UAAY,EAAA;AAAA,GACd;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,QAAU,EAAA,UAAA;AAAA,IACV,MAAQ,EAAA,CAAA;AAAA,IACR,MAAQ,EAAA,KAAA;AAAA,IACR,IAAM,EAAA;AAAA,GACR;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,CAAA;AAAA,IACL,MAAQ,EAAA,KAAA;AAAA,IACR,IAAM,EAAA;AAAA,GACR;AAAA,EACA,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,CAAA;AAAA,IACL,MAAQ,EAAA,CAAA;AAAA,IACR,MAAQ,EAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA;AAEM,MAAM,sBAAsB,CAAC;AAAA,E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S,CAAA,eAAA,CAAgB,MAAO,CAAA,IAAI,CACvC,CAAA;AAAA,QAEF,SAAW,EAAA;AAAA;AAAA;AACb,GAGF,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,OAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,OAAA,CAAQ,mBAC5B,QAAS,CAAA,eAAA,CAAgB,MAAO,CAAA,IAAI,CACvC,CAAA;AAAA,MAEF,SAAW,EAAA;AAAA;AAAA,GACb,sCAED,uBACE,EAAA,IAAA,EAAA,WAAA,uCACE,OAAQ,EAAA,EAAA,KAAA,EAAM,cAAe,EAAA,SAAA,EAAU,KACtC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,IAAM,EAAA,CAAA,IAAA,EAAO,WAAW,CAAA,CAAA,EAAA,kBACjC,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,OAAM,WAAY,EAAA,CAC/B,CACF,CAAA,GACE,IACJ,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,CAAA,oBAAA,EAAuB,MAAO,CAAA,IAAA,CAAK,KAAK,CAAA,CAAA;AAAA,MAC/C,SAAU,EAAA;AAAA,KAAA;AAAA,oBAET,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,IAAM,EAAA,CAAA,OAAA,EAAU,MAAO,CAAA,IAAA,CAAK,KAAK,CAAA,CAAA,EAAA,kBAC1C,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,KAAM,EAAA,SAAA,EAAU,CAC7B;AAAA,GAEJ,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ILertCardOnCallItem.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallItem.tsx"],"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 */\nimport Divider from '@material-ui/core/Divider';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Avatar from '@material-ui/core/Avatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport EmailIcon from '@material-ui/icons/Email';\nimport PhoneIcon from '@material-ui/icons/Phone';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { OnCall } from '../../types';\nimport { ilertApiRef } from '../../api';\nimport { DateTime as dt } from 'luxon';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n listItemPrimary: {\n fontWeight: 'bold',\n },\n fistItemLine: {\n position: 'absolute',\n bottom: 0,\n height: '50%',\n left: 36,\n },\n lastItemLine: {\n position: 'absolute',\n top: 0,\n height: '50%',\n left: 36,\n },\n itemLine: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n height: '100%',\n left: 36,\n },\n});\n\nexport const ILertCardOnCallItem = ({\n onCall,\n fistItem = false,\n lastItem = false,\n}: {\n onCall: OnCall;\n fistItem?: boolean;\n lastItem?: boolean;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const classes = useStyles();\n\n if (!onCall || !onCall.user) {\n return null;\n }\n\n const phoneNumber = ilertApi.getUserPhoneNumber(onCall.user);\n const escalationRepeating = onCall.escalationPolicy.repeating;\n const escalationSeconds =\n onCall.escalationPolicy.escalationRules[onCall.escalationLevel - 1]\n .escalationTimeout;\n const escalationHoursOnly = Math.floor(escalationSeconds / 60);\n const escalationMinutesOnly = escalationSeconds % 60;\n\n let escalationText = '';\n if (!lastItem || (lastItem && escalationRepeating)) {\n escalationText = 'escalate';\n if (escalationSeconds === 0) {\n escalationText += ' immediately';\n } else {\n escalationText += ' after';\n if (escalationHoursOnly > 0) {\n escalationText += ` ${escalationHoursOnly} ${\n escalationHoursOnly === 1 ? 'hour' : 'hours'\n }`;\n }\n if (escalationMinutesOnly > 0 || escalationSeconds === 0) {\n escalationText += ` ${escalationMinutesOnly} ${\n escalationMinutesOnly === 1 ? 'minute' : 'minutes'\n }`;\n }\n }\n }\n\n return (\n <ListItem>\n {fistItem ? (\n <Divider orientation=\"vertical\" className={classes.fistItemLine} />\n ) : null}\n {lastItem ? (\n <Divider orientation=\"vertical\" className={classes.lastItemLine} />\n ) : null}\n {!fistItem && !lastItem ? (\n <Divider orientation=\"vertical\" className={classes.itemLine} />\n ) : null}\n <ListItemIcon>\n <Tooltip\n title={`Escalation level #${onCall.escalationLevel}`}\n placement=\"top\"\n >\n <Avatar>{onCall.escalationLevel}</Avatar>\n </Tooltip>\n </ListItemIcon>\n {onCall.schedule ? (\n <Tooltip\n title={\n 'On call shift ' +\n `${dt.fromISO(onCall.start).toFormat('D MMM, HH:mm')} - ` +\n `${dt.fromISO(onCall.end).toFormat('D MMM, HH:mm')}`\n }\n placement=\"top-start\"\n >\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n </Tooltip>\n ) : (\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n )}\n <ListItemSecondaryAction>\n {phoneNumber ? (\n <Tooltip title=\"Call to user\" placement=\"top\">\n <IconButton href={`tel:${phoneNumber}`}>\n <PhoneIcon color=\"secondary\" />\n </IconButton>\n </Tooltip>\n ) : null}\n <Tooltip\n title={`Send e-mail to user ${onCall.user.email}`}\n placement=\"top\"\n >\n <IconButton href={`mailto:${onCall.user.email}`}>\n <EmailIcon color=\"primary\" />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":["dt"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,eAAiB,EAAA;AAAA,IACf,UAAY,EAAA;AAAA,GACd;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,QAAU,EAAA,UAAA;AAAA,IACV,MAAQ,EAAA,CAAA;AAAA,IACR,MAAQ,EAAA,KAAA;AAAA,IACR,IAAM,EAAA;AAAA,GACR;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,CAAA;AAAA,IACL,MAAQ,EAAA,KAAA;AAAA,IACR,IAAM,EAAA;AAAA,GACR;AAAA,EACA,QAAU,EAAA;AAAA,IACR,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,CAAA;AAAA,IACL,MAAQ,EAAA,CAAA;AAAA,IACR,MAAQ,EAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA;AAEM,MAAM,sBAAsB,CAAC;AAAA,EAClC,MAAA;AAAA,EACA,QAAW,GAAA,KAAA;AAAA,EACX,QAAW,GAAA;AACb,CAIM,KAAA;AACJ,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,MAAA,CAAO,IAAM,EAAA;AAC3B,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,MAAM,WAAc,GAAA,QAAA,CAAS,kBAAmB,CAAA,MAAA,CAAO,IAAI,CAAA;AAC3D,EAAM,MAAA,mBAAA,GAAsB,OAAO,gBAAiB,CAAA,SAAA;AACpD,EAAA,MAAM,oBACJ,MAAO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