@pagerduty/backstage-plugin 0.15.9 → 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.
- package/README.md +36 -0
- package/package.json +32 -19
- package/assets/PD-Green.svg +0 -21
- package/assets/PD-Icon.svg +0 -13
- package/assets/PD-White.svg +0 -21
- package/assets/emptystate.svg +0 -6
- package/assets/forbiddenstate.svg +0 -25
- package/dist/api/client.esm.js +0 -225
- package/dist/api/client.esm.js.map +0 -1
- package/dist/assets/PD-Green.svg +0 -21
- package/dist/assets/PD-Icon.svg +0 -13
- package/dist/assets/PD-White.svg +0 -21
- package/dist/assets/emptystate.svg +0 -6
- package/dist/assets/forbiddenstate.svg +0 -25
- package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js +0 -29
- package/dist/components/ChangeEvents/ChangeEventEmptyState.esm.js.map +0 -1
- package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js +0 -29
- package/dist/components/ChangeEvents/ChangeEventForbiddenState.esm.js.map +0 -1
- package/dist/components/ChangeEvents/ChangeEventListItem.esm.js +0 -82
- package/dist/components/ChangeEvents/ChangeEventListItem.esm.js.map +0 -1
- package/dist/components/ChangeEvents/ChangeEvents.esm.js +0 -52
- package/dist/components/ChangeEvents/ChangeEvents.esm.js.map +0 -1
- package/dist/components/EntityPagerDutyCard/index.esm.js +0 -26
- package/dist/components/EntityPagerDutyCard/index.esm.js.map +0 -1
- package/dist/components/EntityPagerDutySmallCard/index.esm.js +0 -26
- package/dist/components/EntityPagerDutySmallCard/index.esm.js.map +0 -1
- package/dist/components/Errors/ForbiddenError.esm.js +0 -24
- package/dist/components/Errors/ForbiddenError.esm.js.map +0 -1
- package/dist/components/Errors/MissingTokenError.esm.js +0 -24
- package/dist/components/Errors/MissingTokenError.esm.js.map +0 -1
- package/dist/components/Errors/ServiceNotFoundError.esm.js +0 -24
- package/dist/components/Errors/ServiceNotFoundError.esm.js.map +0 -1
- package/dist/components/Escalation/EscalationPolicy.esm.js +0 -61
- package/dist/components/Escalation/EscalationPolicy.esm.js.map +0 -1
- package/dist/components/Escalation/EscalationUser.esm.js +0 -107
- package/dist/components/Escalation/EscalationUser.esm.js.map +0 -1
- package/dist/components/Escalation/EscalationUsersEmptyState.esm.js +0 -23
- package/dist/components/Escalation/EscalationUsersEmptyState.esm.js.map +0 -1
- package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js +0 -23
- package/dist/components/Escalation/EscalationUsersForbiddenState.esm.js.map +0 -1
- package/dist/components/HomePagePagerDutyCard/Content.esm.js +0 -9
- package/dist/components/HomePagePagerDutyCard/Content.esm.js.map +0 -1
- package/dist/components/HomePagePagerDutyCard/index.esm.js +0 -2
- package/dist/components/HomePagePagerDutyCard/index.esm.js.map +0 -1
- package/dist/components/Icons/index.esm.js +0 -9
- package/dist/components/Icons/index.esm.js.map +0 -1
- package/dist/components/Incident/IncidentEmptyState.esm.js +0 -29
- package/dist/components/Incident/IncidentEmptyState.esm.js.map +0 -1
- package/dist/components/Incident/IncidentForbiddenState.esm.js +0 -29
- package/dist/components/Incident/IncidentForbiddenState.esm.js.map +0 -1
- package/dist/components/Incident/IncidentListItem.esm.js +0 -126
- package/dist/components/Incident/IncidentListItem.esm.js.map +0 -1
- package/dist/components/Incident/Incidents.esm.js +0 -46
- package/dist/components/Incident/Incidents.esm.js.map +0 -1
- package/dist/components/PagerDutyCard/index.esm.js +0 -239
- package/dist/components/PagerDutyCard/index.esm.js.map +0 -1
- package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js +0 -41
- package/dist/components/PagerDutyCardCommon/InsightsCard.esm.js.map +0 -1
- package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js +0 -48
- package/dist/components/PagerDutyCardCommon/OpenServiceButton.esm.js.map +0 -1
- package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js +0 -113
- package/dist/components/PagerDutyCardCommon/ServiceStandardsCard.esm.js.map +0 -1
- package/dist/components/PagerDutyCardCommon/StatusCard.esm.js +0 -109
- package/dist/components/PagerDutyCardCommon/StatusCard.esm.js.map +0 -1
- package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js +0 -71
- package/dist/components/PagerDutyCardCommon/TriggerIncidentButton.esm.js.map +0 -1
- package/dist/components/PagerDutyPage/MappingTable.esm.js +0 -271
- package/dist/components/PagerDutyPage/MappingTable.esm.js.map +0 -1
- package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js +0 -50
- package/dist/components/PagerDutyPage/ServiceMappingComponent.esm.js.map +0 -1
- package/dist/components/PagerDutyPage/index.esm.js +0 -152
- package/dist/components/PagerDutyPage/index.esm.js.map +0 -1
- package/dist/components/PagerDutySmallCard/index.esm.js +0 -247
- package/dist/components/PagerDutySmallCard/index.esm.js.map +0 -1
- package/dist/components/TriggerButton/index.esm.js +0 -51
- package/dist/components/TriggerButton/index.esm.js.map +0 -1
- package/dist/components/TriggerDialog/TriggerDialog.esm.js +0 -116
- package/dist/components/TriggerDialog/TriggerDialog.esm.js.map +0 -1
- package/dist/components/constants.esm.js +0 -6
- package/dist/components/constants.esm.js.map +0 -1
- package/dist/components/pagerDutyEntity.esm.js +0 -14
- package/dist/components/pagerDutyEntity.esm.js.map +0 -1
- package/dist/deprecated.esm.js +0 -10
- package/dist/deprecated.esm.js.map +0 -1
- package/dist/hooks/index.esm.js +0 -10
- package/dist/hooks/index.esm.js.map +0 -1
- package/dist/index.d.ts +0 -182
- package/dist/index.esm.js +0 -8
- package/dist/index.esm.js.map +0 -1
- package/dist/plugin.esm.js +0 -78
- package/dist/plugin.esm.js.map +0 -1
|
@@ -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,82 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Link } from '@backstage/core-components';
|
|
3
|
-
import { makeStyles, Tooltip, IconButton, ListItem, ListItemText, Typography, ListItemSecondaryAction } from '@material-ui/core';
|
|
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((theme) => ({
|
|
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
|
-
smallExternalLinkIconStyle: {
|
|
20
|
-
color: theme.palette.text.primary
|
|
21
|
-
},
|
|
22
|
-
smallExternalLinkWithoutMarginIconStyle: {
|
|
23
|
-
color: theme.palette.text.primary,
|
|
24
|
-
marginRight: "-20px"
|
|
25
|
-
},
|
|
26
|
-
smallIconStyle: {
|
|
27
|
-
color: theme.palette.text.primary,
|
|
28
|
-
marginRight: "-20px"
|
|
29
|
-
}
|
|
30
|
-
}));
|
|
31
|
-
const ChangeEventListItem = ({ changeEvent }) => {
|
|
32
|
-
const classes = useStyles();
|
|
33
|
-
const duration = (/* @__PURE__ */ new Date()).getTime() - new Date(changeEvent.timestamp).getTime();
|
|
34
|
-
const changedAt = DateTime.local().minus(Duration.fromMillis(duration)).toRelative({ locale: "en" });
|
|
35
|
-
let externalLinkElem;
|
|
36
|
-
if (changeEvent.links.length > 0) {
|
|
37
|
-
const text = changeEvent.links[0].text;
|
|
38
|
-
externalLinkElem = /* @__PURE__ */ jsx(Tooltip, { title: text, placement: "top", children: /* @__PURE__ */ jsx(
|
|
39
|
-
IconButton,
|
|
40
|
-
{
|
|
41
|
-
component: Link,
|
|
42
|
-
to: changeEvent.links[0].href,
|
|
43
|
-
className: changeEvent.html_url === void 0 ? classes.smallExternalLinkWithoutMarginIconStyle : classes.smallExternalLinkIconStyle,
|
|
44
|
-
children: /* @__PURE__ */ jsx(LinkIcon, {})
|
|
45
|
-
}
|
|
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__ */ jsx(Tooltip, { title: "View in PagerDuty", placement: "top", children: /* @__PURE__ */ jsx(
|
|
69
|
-
IconButton,
|
|
70
|
-
{
|
|
71
|
-
component: Link,
|
|
72
|
-
to: changeEvent.html_url,
|
|
73
|
-
className: classes.smallIconStyle,
|
|
74
|
-
children: /* @__PURE__ */ jsx(OpenInBrowserIcon, {})
|
|
75
|
-
}
|
|
76
|
-
) })
|
|
77
|
-
] })
|
|
78
|
-
] }, changeEvent.id);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export { ChangeEventListItem };
|
|
82
|
-
//# 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\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { Link } from '@backstage/core-components';\nimport {\n ListItem,\n ListItemSecondaryAction,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport { DateTime, Duration } from 'luxon';\nimport { PagerDutyChangeEvent } from '@pagerduty/backstage-plugin-common';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport LinkIcon from '@material-ui/icons/Link';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n listItemPrimary: {\n fontWeight: 'bold',\n },\n smallExternalLinkIconStyle: {\n color: theme.palette.text.primary,\n },\n smallExternalLinkWithoutMarginIconStyle: {\n color: theme.palette.text.primary,\n marginRight: '-20px',\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n marginRight: '-20px',\n },\n}));\n\ntype Props = {\n changeEvent: PagerDutyChangeEvent;\n};\n\nexport const ChangeEventListItem = ({ changeEvent }: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(changeEvent.timestamp).getTime();\n const changedAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n\n let externalLinkElem: JSX.Element | undefined;\n if (changeEvent.links.length > 0) {\n const text: string = changeEvent.links[0].text;\n externalLinkElem = (\n <Tooltip title={text} placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.links[0].href}\n className={\n changeEvent.html_url === undefined\n ? classes.smallExternalLinkWithoutMarginIconStyle\n : classes.smallExternalLinkIconStyle\n }\n >\n <LinkIcon />\n </IconButton>\n </Tooltip>\n );\n }\n\n return (\n <ListItem dense key={changeEvent.id}>\n <ListItemText\n primary={<>{changeEvent.summary}</>}\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography variant=\"body2\" color=\"textSecondary\">\n Triggered from {changeEvent.source} {changedAt}.\n </Typography>\n }\n />\n <ListItemSecondaryAction>\n {externalLinkElem}\n {changeEvent.html_url === undefined ? null : (\n <Tooltip title=\"View in PagerDuty\" placement=\"top\">\n <IconButton\n component={Link}\n to={changeEvent.html_url}\n className={classes.smallIconStyle}\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n )}\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAiCA,MAAM,SAAA,GAAY,WAA2B,CAAA,KAAA,MAAU;AAAA,EACrD,aAAA,EAAe;AAAA,IACb,WAAA,EAAa,CAAA;AAAA,IACb,OAAA,EAAS,MAAA;AAAA,IACT,aAAA,EAAe,QAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,UAAA,EAAY;AAAA,GACd;AAAA,EACA,0BAAA,EAA4B;AAAA,IAC1B,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,GAC5B;AAAA,EACA,uCAAA,EAAyC;AAAA,IACvC,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,WAAA,EAAa;AAAA,GACf;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,WAAA,EAAa;AAAA;AAEjB,CAAA,CAAE,CAAA;AAMK,MAAM,mBAAA,GAAsB,CAAC,EAAE,WAAA,EAAY,KAAa;AAC7D,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,QAAA,GAAA,iBACJ,IAAI,IAAA,EAAK,EAAE,OAAA,EAAQ,GAAI,IAAI,IAAA,CAAK,WAAA,CAAY,SAAS,CAAA,CAAE,OAAA,EAAQ;AACjE,EAAA,MAAM,SAAA,GAAY,QAAA,CAAS,KAAA,EAAM,CAC9B,MAAM,QAAA,CAAS,UAAA,CAAW,QAAQ,CAAC,CAAA,CACnC,UAAA,CAAW,EAAE,MAAA,EAAQ,MAAM,CAAA;AAE9B,EAAA,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aAAa,MAAA,GAAY,IAAA,uBACnC,OAAA,EAAA,EAAQ,KAAA,EAAM,mBAAA,EAAoB,SAAA,EAAU,KAAA,EAC3C,QAAA,kBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,SAAA,EAAW,IAAA;AAAA,UACX,IAAI,WAAA,CAAY,QAAA;AAAA,UAChB,WAAW,OAAA,CAAQ,cAAA;AAAA,UAEnB,8BAAC,iBAAA,EAAA,EAAkB;AAAA;AAAA,OACrB,EACF;AAAA,KAAA,EAEJ;AAAA,GAAA,EAAA,EA1BmB,YAAY,EA2BjC,CAAA;AAEJ;;;;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { List } 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 ChangeEvents = ({ serviceId, account, refreshEvents }) => {
|
|
14
|
-
const api = useApi(pagerDutyApiRef);
|
|
15
|
-
const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(
|
|
16
|
-
async () => {
|
|
17
|
-
const { change_events } = await api.getChangeEventsByServiceId(
|
|
18
|
-
serviceId,
|
|
19
|
-
account
|
|
20
|
-
);
|
|
21
|
-
return change_events;
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
getChangeEvents();
|
|
26
|
-
}, [refreshEvents, getChangeEvents]);
|
|
27
|
-
if (error) {
|
|
28
|
-
if (error.message.includes("Forbidden")) {
|
|
29
|
-
return /* @__PURE__ */ jsx(ChangeEventForbiddenState, {});
|
|
30
|
-
}
|
|
31
|
-
return /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
|
|
32
|
-
"Error encountered while fetching information. ",
|
|
33
|
-
error.message
|
|
34
|
-
] });
|
|
35
|
-
}
|
|
36
|
-
if (loading) {
|
|
37
|
-
return /* @__PURE__ */ jsx(Progress, {});
|
|
38
|
-
}
|
|
39
|
-
if (!changeEvents?.length) {
|
|
40
|
-
return /* @__PURE__ */ jsx(ChangeEventEmptyState, {});
|
|
41
|
-
}
|
|
42
|
-
return /* @__PURE__ */ jsx(List, { dense: true, children: changeEvents.map((changeEvent, index) => /* @__PURE__ */ jsx(
|
|
43
|
-
ChangeEventListItem,
|
|
44
|
-
{
|
|
45
|
-
changeEvent
|
|
46
|
-
},
|
|
47
|
-
changeEvent.id + index
|
|
48
|
-
)) });
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export { ChangeEvents };
|
|
52
|
-
//# 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\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { useEffect } from 'react';\nimport { List } from '@material-ui/core';\nimport { ChangeEventListItem } from './ChangeEventListItem';\nimport { ChangeEventEmptyState } from './ChangeEventEmptyState';\nimport { ChangeEventForbiddenState } from './ChangeEventForbiddenState';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\nimport { pagerDutyApiRef } from '../../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\nimport { Alert } from '@material-ui/lab';\n\ntype Props = {\n serviceId: string;\n account?: string;\n refreshEvents: boolean;\n};\n\nexport const ChangeEvents = ({ serviceId, account, refreshEvents }: Props) => {\n const api = useApi(pagerDutyApiRef);\n\n const [{ value: changeEvents, loading, error }, getChangeEvents] = useAsyncFn(\n async () => {\n const { change_events } = await api.getChangeEventsByServiceId(\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 <Progress />;\n }\n\n if (!changeEvents?.length) {\n return <ChangeEventEmptyState />;\n }\n\n return (\n <List dense>\n {changeEvents!.map((changeEvent, index) => (\n <ChangeEventListItem\n key={changeEvent.id + index}\n changeEvent={changeEvent}\n />\n ))}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAkCO,MAAM,eAAe,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,eAAc,KAAa;AAC5E,EAAA,MAAM,GAAA,GAAM,OAAO,eAAe,CAAA;AAElC,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,2BAAQ,QAAA,EAAA,EAAS,CAAA;AAAA,EACnB;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,26 +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
|
-
const pagerDutyEntity = getPagerDutyEntity(entity);
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
PagerDutyCard,
|
|
16
|
-
{
|
|
17
|
-
...pagerDutyEntity,
|
|
18
|
-
readOnly,
|
|
19
|
-
disableChangeEvents,
|
|
20
|
-
disableOnCall
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { EntityPagerDutyCard, isPluginApplicableToEntity };
|
|
26
|
-
//# 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 const pagerDutyEntity = getPagerDutyEntity(entity);\n return (\n <PagerDutyCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableChangeEvents={disableChangeEvents}\n disableOnCall={disableOnCall}\n />\n );\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;AAC7B,EAAA,MAAM,eAAA,GAAkB,mBAAmB,MAAM,CAAA;AACjD,EAAA,uBACE,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACE,GAAG,eAAA;AAAA,MACJ,QAAA;AAAA,MACA,mBAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,26 +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
|
-
const pagerDutyEntity = getPagerDutyEntity(entity);
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
PagerDutySmallCard,
|
|
16
|
-
{
|
|
17
|
-
...pagerDutyEntity,
|
|
18
|
-
readOnly,
|
|
19
|
-
disableInsights,
|
|
20
|
-
disableOnCall
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { EntityPagerDutySmallCard, isPluginApplicableToEntity };
|
|
26
|
-
//# 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// 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 { 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 const pagerDutyEntity = getPagerDutyEntity(entity);\n return (\n <PagerDutySmallCard\n {...pagerDutyEntity}\n readOnly={readOnly}\n disableInsights={disableInsights}\n disableOnCall={disableOnCall}\n />\n );\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;AAC7B,EAAA,MAAM,eAAA,GAAkB,mBAAmB,MAAM,CAAA;AACjD,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACE,GAAG,eAAA;AAAA,MACJ,QAAA;AAAA,MACA,eAAA;AAAA,MACA;AAAA;AAAA,GACF;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 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,61 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { makeStyles, List, ListSubheader, createStyles } 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 useStyles = makeStyles(
|
|
13
|
-
() => createStyles({
|
|
14
|
-
listStyle: {
|
|
15
|
-
marginLeft: "-15px"
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
);
|
|
19
|
-
const EscalationPolicy = ({
|
|
20
|
-
policyId,
|
|
21
|
-
policyUrl,
|
|
22
|
-
policyName,
|
|
23
|
-
account
|
|
24
|
-
}) => {
|
|
25
|
-
const api = useApi(pagerDutyApiRef);
|
|
26
|
-
const classes = useStyles();
|
|
27
|
-
const {
|
|
28
|
-
value: users,
|
|
29
|
-
loading,
|
|
30
|
-
error
|
|
31
|
-
} = useAsync(async () => {
|
|
32
|
-
return await api.getOnCallByPolicyId(policyId, account);
|
|
33
|
-
});
|
|
34
|
-
if (error) {
|
|
35
|
-
if (error.message.includes("Forbidden")) {
|
|
36
|
-
return /* @__PURE__ */ jsx(List, { dense: true, subheader: /* @__PURE__ */ jsx(ListSubheader, { children: "ON CALL" }), children: /* @__PURE__ */ jsx(EscalationUsersForbiddenState, {}) });
|
|
37
|
-
}
|
|
38
|
-
return /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
|
|
39
|
-
"Error encountered while fetching information. ",
|
|
40
|
-
error.message
|
|
41
|
-
] });
|
|
42
|
-
}
|
|
43
|
-
if (loading) {
|
|
44
|
-
return /* @__PURE__ */ jsx(Progress, { "data-testid": "escalation-progress" });
|
|
45
|
-
}
|
|
46
|
-
if (!users?.length) {
|
|
47
|
-
return /* @__PURE__ */ jsx(EscalationUsersEmptyState, {});
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ jsx(List, { dense: true, className: classes.listStyle, children: users.map((user, index) => /* @__PURE__ */ jsx(
|
|
50
|
-
EscalationUser,
|
|
51
|
-
{
|
|
52
|
-
user,
|
|
53
|
-
policyUrl,
|
|
54
|
-
policyName
|
|
55
|
-
},
|
|
56
|
-
index
|
|
57
|
-
)) });
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export { EscalationPolicy };
|
|
61
|
-
//# 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 */\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport {\n List,\n ListSubheader,\n createStyles,\n makeStyles,\n} 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';\nimport { BackstageTheme } from '@backstage/theme';\n\ntype Props = {\n policyId: string;\n policyUrl: string;\n policyName: string;\n account?: string;\n};\nconst useStyles = makeStyles<BackstageTheme>(() =>\n createStyles({\n listStyle: {\n marginLeft: '-15px',\n },\n }),\n);\n\nexport const EscalationPolicy = ({\n policyId,\n policyUrl,\n policyName,\n account,\n}: Props) => {\n const api = useApi(pagerDutyApiRef);\n const classes = useStyles();\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 className={classes.listStyle}>\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":";;;;;;;;;;;AAuCA,MAAM,SAAA,GAAY,UAAA;AAAA,EAA2B,MAC3C,YAAA,CAAa;AAAA,IACX,SAAA,EAAW;AAAA,MACT,UAAA,EAAY;AAAA;AACd,GACD;AACH,CAAA;AAEO,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;AAClC,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,KAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,OAAO,MAAM,GA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, ListItemText, IconButton, Typography, Tooltip } from '@material-ui/core';
|
|
3
|
-
import Avatar from '@material-ui/core/Avatar';
|
|
4
|
-
import NotificationsIcon from '@material-ui/icons/Notifications';
|
|
5
|
-
|
|
6
|
-
const useStyles = makeStyles((theme) => ({
|
|
7
|
-
listItemPrimary: {
|
|
8
|
-
fontWeight: "bold"
|
|
9
|
-
},
|
|
10
|
-
listItemSecondary: {
|
|
11
|
-
fontWeight: "normal",
|
|
12
|
-
textDecoration: "underline",
|
|
13
|
-
marginTop: "-5px"
|
|
14
|
-
},
|
|
15
|
-
buttonStyle: {
|
|
16
|
-
marginLeft: "-11px",
|
|
17
|
-
marginTop: "-10px",
|
|
18
|
-
fontSize: "15px",
|
|
19
|
-
color: theme.palette.text.primary,
|
|
20
|
-
"&:hover": {
|
|
21
|
-
backgroundColor: "transparent",
|
|
22
|
-
textDecoration: "underline"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
userTextButtonStyle: {
|
|
26
|
-
marginLeft: "-11px",
|
|
27
|
-
marginTop: "-10px",
|
|
28
|
-
marginBottom: "-10px",
|
|
29
|
-
fontSize: "15px",
|
|
30
|
-
color: theme.palette.text.primary,
|
|
31
|
-
"&:hover": {
|
|
32
|
-
backgroundColor: "transparent",
|
|
33
|
-
textDecoration: "underline"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
containerStyle: {
|
|
37
|
-
display: "flex",
|
|
38
|
-
alignItems: "center",
|
|
39
|
-
fontWeight: "bold"
|
|
40
|
-
},
|
|
41
|
-
iconStyle: {
|
|
42
|
-
fontSize: "25px",
|
|
43
|
-
marginLeft: "-4px",
|
|
44
|
-
color: theme.palette.text.primary
|
|
45
|
-
},
|
|
46
|
-
smallIconStyle: {
|
|
47
|
-
color: theme.palette.text.primary
|
|
48
|
-
},
|
|
49
|
-
avatarStyle: {
|
|
50
|
-
marginTop: "-20px"
|
|
51
|
-
}
|
|
52
|
-
}));
|
|
53
|
-
function navigateToUrl(url) {
|
|
54
|
-
window.open(url, "_blank");
|
|
55
|
-
}
|
|
56
|
-
const EscalationUser = ({ user, policyUrl, policyName }) => {
|
|
57
|
-
const classes = useStyles();
|
|
58
|
-
return /* @__PURE__ */ jsxs(ListItem, { children: [
|
|
59
|
-
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(
|
|
60
|
-
Avatar,
|
|
61
|
-
{
|
|
62
|
-
alt: user.name,
|
|
63
|
-
src: user.avatar_url,
|
|
64
|
-
className: classes.avatarStyle
|
|
65
|
-
}
|
|
66
|
-
) }),
|
|
67
|
-
/* @__PURE__ */ jsx(
|
|
68
|
-
ListItemText,
|
|
69
|
-
{
|
|
70
|
-
primary: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
-
/* @__PURE__ */ jsx(Tooltip, { title: "Open user in PagerDuty", placement: "top", children: /* @__PURE__ */ jsx(
|
|
72
|
-
IconButton,
|
|
73
|
-
{
|
|
74
|
-
"aria-label": "open-user-in-browser",
|
|
75
|
-
onClick: () => navigateToUrl(user.html_url),
|
|
76
|
-
className: classes.userTextButtonStyle,
|
|
77
|
-
children: /* @__PURE__ */ jsx(Typography, { className: classes.containerStyle, children: user.name })
|
|
78
|
-
}
|
|
79
|
-
) }),
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
Typography,
|
|
82
|
-
{
|
|
83
|
-
className: classes.listItemSecondary,
|
|
84
|
-
color: "textSecondary",
|
|
85
|
-
children: user.email
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
] }),
|
|
89
|
-
secondary: /* @__PURE__ */ jsx(
|
|
90
|
-
IconButton,
|
|
91
|
-
{
|
|
92
|
-
"aria-label": "open-escalation-policy-in-browser",
|
|
93
|
-
onClick: () => navigateToUrl(policyUrl),
|
|
94
|
-
className: classes.buttonStyle,
|
|
95
|
-
children: /* @__PURE__ */ jsxs(Typography, { className: classes.containerStyle, children: [
|
|
96
|
-
/* @__PURE__ */ jsx(NotificationsIcon, { className: classes.iconStyle }),
|
|
97
|
-
policyName
|
|
98
|
-
] })
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
] });
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export { EscalationUser };
|
|
107
|
-
//# sourceMappingURL=EscalationUser.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EscalationUser.esm.js","sources":["../../../src/components/Escalation/EscalationUser.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 {\n ListItem,\n ListItemIcon,\n Tooltip,\n ListItemText,\n makeStyles,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport Avatar from '@material-ui/core/Avatar';\nimport { PagerDutyUser } from '@pagerduty/backstage-plugin-common';\nimport NotificationsIcon from '@material-ui/icons/Notifications';\nimport { BackstageTheme } from '@backstage/theme';\n\nconst useStyles = makeStyles<BackstageTheme>(theme => ({\n listItemPrimary: {\n fontWeight: 'bold',\n },\n listItemSecondary: {\n fontWeight: 'normal',\n textDecoration: 'underline',\n marginTop: '-5px',\n },\n buttonStyle: {\n marginLeft: '-11px',\n marginTop: '-10px',\n fontSize: '15px',\n color: theme.palette.text.primary,\n '&:hover': {\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n },\n },\n userTextButtonStyle: {\n marginLeft: '-11px',\n marginTop: '-10px',\n marginBottom: '-10px',\n fontSize: '15px',\n color: theme.palette.text.primary,\n '&:hover': {\n backgroundColor: 'transparent',\n textDecoration: 'underline',\n },\n },\n containerStyle: {\n display: 'flex',\n alignItems: 'center',\n fontWeight: 'bold',\n },\n iconStyle: {\n fontSize: '25px',\n marginLeft: '-4px',\n color: theme.palette.text.primary,\n },\n smallIconStyle: {\n color: theme.palette.text.primary,\n },\n avatarStyle: {\n marginTop: '-20px',\n },\n}));\n\ntype Props = {\n user: PagerDutyUser;\n policyUrl: string;\n policyName: string;\n};\n\nfunction navigateToUrl(url: string) {\n // open url in new browser window\n window.open(url, '_blank');\n}\n\nexport const EscalationUser = ({ user, policyUrl, policyName }: Props) => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemIcon>\n <Avatar\n alt={user.name}\n src={user.avatar_url}\n className={classes.avatarStyle}\n />\n </ListItemIcon>\n <ListItemText\n primary={\n <>\n <Tooltip title=\"Open user in PagerDuty\" placement=\"top\">\n <IconButton\n aria-label=\"open-user-in-browser\"\n onClick={() => navigateToUrl(user.html_url)}\n className={classes.userTextButtonStyle}\n >\n <Typography className={classes.containerStyle}>\n {user.name}\n </Typography>\n </IconButton>\n </Tooltip>\n\n <Typography\n className={classes.listItemSecondary}\n color=\"textSecondary\"\n >\n {user.email}\n </Typography>\n </>\n }\n secondary={\n <IconButton\n aria-label=\"open-escalation-policy-in-browser\"\n onClick={() => navigateToUrl(policyUrl)}\n className={classes.buttonStyle}\n >\n <Typography className={classes.containerStyle}>\n <NotificationsIcon className={classes.iconStyle} />\n {policyName}\n </Typography>\n </IconButton>\n }\n />\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;AA8BA,MAAM,SAAA,GAAY,WAA2B,CAAA,KAAA,MAAU;AAAA,EACrD,eAAA,EAAiB;AAAA,IACf,UAAA,EAAY;AAAA,GACd;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB,WAAA;AAAA,IAChB,SAAA,EAAW;AAAA,GACb;AAAA,EACA,WAAA,EAAa;AAAA,IACX,UAAA,EAAY,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A,EAAkB,SAAA,EAAW,OAAA,CAAQ,SAAA,EAAW,CAAA;AAAA,cAChD;AAAA,aAAA,EACH;AAAA;AAAA;AACF;AAAA;AAEJ,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { makeStyles, ListItem, ListItemIcon, ListItemText } from '@material-ui/core';
|
|
3
|
-
import { StatusWarning } from '@backstage/core-components';
|
|
4
|
-
|
|
5
|
-
const useStyles = makeStyles({
|
|
6
|
-
denseListIcon: {
|
|
7
|
-
marginRight: 0,
|
|
8
|
-
display: "flex",
|
|
9
|
-
flexDirection: "column",
|
|
10
|
-
alignItems: "center",
|
|
11
|
-
justifyContent: "center"
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
const EscalationUsersEmptyState = () => {
|
|
15
|
-
const classes = useStyles();
|
|
16
|
-
return /* @__PURE__ */ jsxs(ListItem, { children: [
|
|
17
|
-
/* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx("div", { className: classes.denseListIcon, children: /* @__PURE__ */ jsx(StatusWarning, {}) }) }),
|
|
18
|
-
/* @__PURE__ */ jsx(ListItemText, { primary: "No one is on-call. Update the escalation policy." })
|
|
19
|
-
] });
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { EscalationUsersEmptyState };
|
|
23
|
-
//# sourceMappingURL=EscalationUsersEmptyState.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EscalationUsersEmptyState.esm.js","sources":["../../../src/components/Escalation/EscalationUsersEmptyState.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 {\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport { StatusWarning } from '@backstage/core-components';\n\nconst useStyles = makeStyles({\n denseListIcon: {\n marginRight: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport const EscalationUsersEmptyState = () => {\n const classes = useStyles();\n return (\n <ListItem>\n <ListItemIcon>\n <div className={classes.denseListIcon}>\n <StatusWarning />\n </div>\n </ListItemIcon>\n <ListItemText primary=\"No one is on-call. Update the escalation policy.\" />\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;AAwBA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,aAAA,EAAe;AAAA,IACb,WAAA,EAAa,CAAA;AAAA,IACb,OAAA,EAAS,MAAA;AAAA,IACT,aAAA,EAAe,QAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB;AAAA;AAEpB,CAAC,CAAA;AAEM,MAAM,4BAA4B,MAAM;AAC7C,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,4BACG,QAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAA,EAAA,EACC,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,QAAQ,aAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,CAAA,EACjB,CAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,YAAA,EAAA,EAAa,OAAA,EAAQ,kDAAA,EAAmD;AAAA,GAAA,EAC3E,CAAA;AAEJ;;;;"}
|