@backstage-community/plugin-splunk-on-call 0.4.24 → 0.4.26

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 (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/client.esm.js +114 -0
  3. package/dist/api/client.esm.js.map +1 -0
  4. package/dist/components/EntitySplunkOnCallCard.esm.js +189 -0
  5. package/dist/components/EntitySplunkOnCallCard.esm.js.map +1 -0
  6. package/dist/components/Errors/MissingApiKeyOrApiIdError.esm.js +24 -0
  7. package/dist/components/Errors/MissingApiKeyOrApiIdError.esm.js.map +1 -0
  8. package/dist/components/Escalation/EscalationPolicy.esm.js +65 -0
  9. package/dist/components/Escalation/EscalationPolicy.esm.js.map +1 -0
  10. package/dist/components/Escalation/EscalationUser.esm.js +30 -0
  11. package/dist/components/Escalation/EscalationUser.esm.js.map +1 -0
  12. package/dist/components/Escalation/EscalationUsersEmptyState.esm.js +23 -0
  13. package/dist/components/Escalation/EscalationUsersEmptyState.esm.js.map +1 -0
  14. package/dist/components/Incident/IncidentEmptyState.esm.js +28 -0
  15. package/dist/components/Incident/IncidentEmptyState.esm.js.map +1 -0
  16. package/dist/components/Incident/IncidentListItem.esm.js +189 -0
  17. package/dist/components/Incident/IncidentListItem.esm.js.map +1 -0
  18. package/dist/components/Incident/Incidents.esm.js +72 -0
  19. package/dist/components/Incident/Incidents.esm.js.map +1 -0
  20. package/dist/components/SplunkOnCallPage.esm.js +24 -0
  21. package/dist/components/SplunkOnCallPage.esm.js.map +1 -0
  22. package/dist/components/TriggerDialog/TriggerDialog.esm.js +205 -0
  23. package/dist/components/TriggerDialog/TriggerDialog.esm.js.map +1 -0
  24. package/dist/index.esm.js +3 -43
  25. package/dist/index.esm.js.map +1 -1
  26. package/dist/plugin.esm.js +37 -0
  27. package/dist/plugin.esm.js.map +1 -0
  28. package/package.json +14 -10
  29. package/dist/esm/SplunkOnCallPage-D9lfarwB.esm.js +0 -62
  30. package/dist/esm/SplunkOnCallPage-D9lfarwB.esm.js.map +0 -1
  31. package/dist/esm/index-D8KSFXg5.esm.js +0 -912
  32. package/dist/esm/index-D8KSFXg5.esm.js.map +0 -1
@@ -0,0 +1,189 @@
1
+ import React, { useEffect } from 'react';
2
+ import ListItem from '@material-ui/core/ListItem';
3
+ import ListItemIcon from '@material-ui/core/ListItemIcon';
4
+ import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
5
+ import Tooltip from '@material-ui/core/Tooltip';
6
+ import ListItemText from '@material-ui/core/ListItemText';
7
+ import IconButton from '@material-ui/core/IconButton';
8
+ import Typography from '@material-ui/core/Typography';
9
+ import { makeStyles } from '@material-ui/core/styles';
10
+ import DoneIcon from '@material-ui/icons/Done';
11
+ import DoneAllIcon from '@material-ui/icons/DoneAll';
12
+ import { DateTime, Duration } from 'luxon';
13
+ import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
14
+ import { splunkOnCallApiRef } from '../../api/client.esm.js';
15
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
16
+ import { StatusOK, StatusWarning, StatusError } from '@backstage/core-components';
17
+ import { useApi, alertApiRef } from '@backstage/core-plugin-api';
18
+
19
+ const useStyles = makeStyles({
20
+ denseListIcon: {
21
+ marginRight: 0,
22
+ display: "flex",
23
+ flexDirection: "column",
24
+ alignItems: "center",
25
+ justifyContent: "center"
26
+ },
27
+ listItemPrimary: {
28
+ fontWeight: "bold"
29
+ },
30
+ listItemIcon: {
31
+ minWidth: "1em"
32
+ },
33
+ secondaryAction: {
34
+ paddingRight: 48
35
+ }
36
+ });
37
+ const IncidentPhaseStatus = ({
38
+ currentPhase
39
+ }) => {
40
+ switch (currentPhase) {
41
+ case "UNACKED":
42
+ return /* @__PURE__ */ React.createElement(StatusError, null);
43
+ case "ACKED":
44
+ return /* @__PURE__ */ React.createElement(StatusWarning, null);
45
+ default:
46
+ return /* @__PURE__ */ React.createElement(StatusOK, null);
47
+ }
48
+ };
49
+ const incidentPhaseTooltip = (currentPhase) => {
50
+ switch (currentPhase) {
51
+ case "UNACKED":
52
+ return "Triggered";
53
+ case "ACKED":
54
+ return "Acknowledged";
55
+ default:
56
+ return "Resolved";
57
+ }
58
+ };
59
+ const IncidentAction = ({
60
+ currentPhase,
61
+ incidentId,
62
+ resolveAction,
63
+ acknowledgeAction
64
+ }) => {
65
+ switch (currentPhase) {
66
+ case "UNACKED":
67
+ return /* @__PURE__ */ React.createElement(Tooltip, { title: "Acknowledge", placement: "top" }, /* @__PURE__ */ React.createElement(
68
+ IconButton,
69
+ {
70
+ onClick: () => acknowledgeAction({ incidentId, incidentType: "ACKNOWLEDGEMENT" })
71
+ },
72
+ /* @__PURE__ */ React.createElement(DoneIcon, null)
73
+ ));
74
+ case "ACKED":
75
+ return /* @__PURE__ */ React.createElement(Tooltip, { title: "Resolve", placement: "top" }, /* @__PURE__ */ React.createElement(
76
+ IconButton,
77
+ {
78
+ onClick: () => resolveAction({ incidentId, incidentType: "RECOVERY" })
79
+ },
80
+ /* @__PURE__ */ React.createElement(DoneAllIcon, null)
81
+ ));
82
+ default:
83
+ return /* @__PURE__ */ React.createElement(React.Fragment, null);
84
+ }
85
+ };
86
+ const IncidentListItem = ({
87
+ incident,
88
+ readOnly,
89
+ onIncidentAction,
90
+ team
91
+ }) => {
92
+ const classes = useStyles();
93
+ const duration = (/* @__PURE__ */ new Date()).getTime() - new Date(incident.startTime).getTime();
94
+ const createdAt = DateTime.local().minus(Duration.fromMillis(duration)).toRelative({ locale: "en" });
95
+ const alertApi = useApi(alertApiRef);
96
+ const api = useApi(splunkOnCallApiRef);
97
+ const hasBeenManuallyTriggered = incident.monitorName?.includes("vouser-");
98
+ const source = () => {
99
+ if (hasBeenManuallyTriggered) {
100
+ return incident.monitorName?.replace("vouser-", "");
101
+ }
102
+ if (incident.monitorType === "API") {
103
+ return "{ REST }";
104
+ }
105
+ return incident.monitorName;
106
+ };
107
+ const [{ value: resolveValue, error: resolveError }, handleResolveIncident] = useAsyncFn(
108
+ async ({ incidentId, incidentType }) => await api.incidentAction({
109
+ routingKey: team,
110
+ incidentType,
111
+ incidentId
112
+ })
113
+ );
114
+ const [
115
+ { value: acknowledgeValue, error: acknowledgeError },
116
+ handleAcknowledgeIncident
117
+ ] = useAsyncFn(
118
+ async ({ incidentId, incidentType }) => await api.incidentAction({
119
+ routingKey: team,
120
+ incidentType,
121
+ incidentId
122
+ })
123
+ );
124
+ useEffect(() => {
125
+ if (acknowledgeValue) {
126
+ alertApi.post({
127
+ message: `Incident successfully acknowledged`
128
+ });
129
+ }
130
+ if (resolveValue) {
131
+ alertApi.post({
132
+ message: `Incident successfully resolved`
133
+ });
134
+ }
135
+ if (resolveValue || acknowledgeValue) {
136
+ onIncidentAction();
137
+ }
138
+ }, [acknowledgeValue, resolveValue, alertApi, onIncidentAction]);
139
+ if (acknowledgeError) {
140
+ alertApi.post({
141
+ message: `Failed to acknowledge incident. ${acknowledgeError.message}`,
142
+ severity: "error"
143
+ });
144
+ }
145
+ if (resolveError) {
146
+ alertApi.post({
147
+ message: `Failed to resolve incident. ${resolveError.message}`,
148
+ severity: "error"
149
+ });
150
+ }
151
+ return /* @__PURE__ */ React.createElement(ListItem, { dense: true, key: incident.entityId }, /* @__PURE__ */ React.createElement(ListItemIcon, { className: classes.listItemIcon }, /* @__PURE__ */ React.createElement(
152
+ Tooltip,
153
+ {
154
+ title: incidentPhaseTooltip(incident.currentPhase),
155
+ placement: "top"
156
+ },
157
+ /* @__PURE__ */ React.createElement("div", { className: classes.denseListIcon }, /* @__PURE__ */ React.createElement(IncidentPhaseStatus, { currentPhase: incident.currentPhase }))
158
+ )), /* @__PURE__ */ React.createElement(
159
+ ListItemText,
160
+ {
161
+ primary: incident.entityDisplayName,
162
+ primaryTypographyProps: {
163
+ variant: "body1",
164
+ className: classes.listItemPrimary
165
+ },
166
+ secondary: /* @__PURE__ */ React.createElement(Typography, { noWrap: true, variant: "body2", color: "textSecondary" }, "#", incident.incidentNumber, " - Created ", createdAt, " ", source() && `by ${source()}`)
167
+ }
168
+ ), incident.incidentLink && incident.incidentNumber && /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, !readOnly && /* @__PURE__ */ React.createElement(
169
+ IncidentAction,
170
+ {
171
+ currentPhase: incident.currentPhase || "",
172
+ incidentId: incident.entityId,
173
+ resolveAction: handleResolveIncident,
174
+ acknowledgeAction: handleAcknowledgeIncident
175
+ }
176
+ ), /* @__PURE__ */ React.createElement(Tooltip, { title: "View in Splunk On-Call", placement: "top" }, /* @__PURE__ */ React.createElement(
177
+ IconButton,
178
+ {
179
+ href: incident.incidentLink,
180
+ target: "_blank",
181
+ rel: "noopener noreferrer",
182
+ color: "primary"
183
+ },
184
+ /* @__PURE__ */ React.createElement(OpenInBrowserIcon, null)
185
+ ))));
186
+ };
187
+
188
+ export { IncidentListItem };
189
+ //# sourceMappingURL=IncidentListItem.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IncidentListItem.esm.js","sources":["../../../src/components/Incident/IncidentListItem.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, { useEffect } from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport DoneIcon from '@material-ui/icons/Done';\nimport DoneAllIcon from '@material-ui/icons/DoneAll';\nimport { DateTime, Duration } from 'luxon';\nimport { Incident, IncidentPhase } from '../types';\nimport OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';\nimport { splunkOnCallApiRef } from '../../api/client';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { TriggerAlarmRequest } from '../../api/types';\n\nimport {\n StatusError,\n StatusWarning,\n StatusOK,\n} from '@backstage/core-components';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\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 listItemIcon: {\n minWidth: '1em',\n },\n secondaryAction: {\n paddingRight: 48,\n },\n});\n\ntype Props = {\n team: string;\n incident: Incident;\n onIncidentAction: () => void;\n readOnly: boolean;\n};\n\nconst IncidentPhaseStatus = ({\n currentPhase,\n}: {\n currentPhase: IncidentPhase;\n}) => {\n switch (currentPhase) {\n case 'UNACKED':\n return <StatusError />;\n case 'ACKED':\n return <StatusWarning />;\n default:\n return <StatusOK />;\n }\n};\n\nconst incidentPhaseTooltip = (currentPhase: IncidentPhase) => {\n switch (currentPhase) {\n case 'UNACKED':\n return 'Triggered';\n case 'ACKED':\n return 'Acknowledged';\n default:\n return 'Resolved';\n }\n};\n\nconst IncidentAction = ({\n currentPhase,\n incidentId,\n resolveAction,\n acknowledgeAction,\n}: {\n currentPhase: string;\n incidentId: string;\n resolveAction: (args: TriggerAlarmRequest) => void;\n acknowledgeAction: (args: TriggerAlarmRequest) => void;\n}) => {\n switch (currentPhase) {\n case 'UNACKED':\n return (\n <Tooltip title=\"Acknowledge\" placement=\"top\">\n <IconButton\n onClick={() =>\n acknowledgeAction({ incidentId, incidentType: 'ACKNOWLEDGEMENT' })\n }\n >\n <DoneIcon />\n </IconButton>\n </Tooltip>\n );\n case 'ACKED':\n return (\n <Tooltip title=\"Resolve\" placement=\"top\">\n <IconButton\n onClick={() =>\n resolveAction({ incidentId, incidentType: 'RECOVERY' })\n }\n >\n <DoneAllIcon />\n </IconButton>\n </Tooltip>\n );\n default:\n return <></>;\n }\n};\n\nexport const IncidentListItem = ({\n incident,\n readOnly,\n onIncidentAction,\n team,\n}: Props) => {\n const classes = useStyles();\n const duration =\n new Date().getTime() - new Date(incident.startTime!).getTime();\n const createdAt = DateTime.local()\n .minus(Duration.fromMillis(duration))\n .toRelative({ locale: 'en' });\n const alertApi = useApi(alertApiRef);\n const api = useApi(splunkOnCallApiRef);\n\n const hasBeenManuallyTriggered = incident.monitorName?.includes('vouser-');\n\n const source = () => {\n if (hasBeenManuallyTriggered) {\n return incident.monitorName?.replace('vouser-', '');\n }\n if (incident.monitorType === 'API') {\n return '{ REST }';\n }\n\n return incident.monitorName;\n };\n\n const [{ value: resolveValue, error: resolveError }, handleResolveIncident] =\n useAsyncFn(\n async ({ incidentId, incidentType }: TriggerAlarmRequest) =>\n await api.incidentAction({\n routingKey: team,\n incidentType,\n incidentId,\n }),\n );\n\n const [\n { value: acknowledgeValue, error: acknowledgeError },\n handleAcknowledgeIncident,\n ] = useAsyncFn(\n async ({ incidentId, incidentType }: TriggerAlarmRequest) =>\n await api.incidentAction({\n routingKey: team,\n incidentType,\n incidentId,\n }),\n );\n\n useEffect(() => {\n if (acknowledgeValue) {\n alertApi.post({\n message: `Incident successfully acknowledged`,\n });\n }\n\n if (resolveValue) {\n alertApi.post({\n message: `Incident successfully resolved`,\n });\n }\n if (resolveValue || acknowledgeValue) {\n onIncidentAction();\n }\n }, [acknowledgeValue, resolveValue, alertApi, onIncidentAction]);\n\n if (acknowledgeError) {\n alertApi.post({\n message: `Failed to acknowledge incident. ${acknowledgeError.message}`,\n severity: 'error',\n });\n }\n\n if (resolveError) {\n alertApi.post({\n message: `Failed to resolve incident. ${resolveError.message}`,\n severity: 'error',\n });\n }\n\n return (\n <ListItem dense key={incident.entityId}>\n <ListItemIcon className={classes.listItemIcon}>\n <Tooltip\n title={incidentPhaseTooltip(incident.currentPhase)}\n placement=\"top\"\n >\n <div className={classes.denseListIcon}>\n <IncidentPhaseStatus currentPhase={incident.currentPhase} />\n </div>\n </Tooltip>\n </ListItemIcon>\n <ListItemText\n primary={incident.entityDisplayName}\n primaryTypographyProps={{\n variant: 'body1',\n className: classes.listItemPrimary,\n }}\n secondary={\n <Typography noWrap variant=\"body2\" color=\"textSecondary\">\n #{incident.incidentNumber} - Created {createdAt}{' '}\n {source() && `by ${source()}`}\n </Typography>\n }\n />\n\n {incident.incidentLink && incident.incidentNumber && (\n <ListItemSecondaryAction>\n {!readOnly && (\n <IncidentAction\n currentPhase={incident.currentPhase || ''}\n incidentId={incident.entityId}\n resolveAction={handleResolveIncident}\n acknowledgeAction={handleAcknowledgeIncident}\n />\n )}\n <Tooltip title=\"View in Splunk On-Call\" placement=\"top\">\n <IconButton\n href={incident.incidentLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n color=\"primary\"\n >\n <OpenInBrowserIcon />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n )}\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,aAAe,EAAA;AAAA,IACb,WAAa,EAAA,CAAA;AAAA,IACb,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,QAAA;AAAA,IACf,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA,QAAA;AAAA,GAClB;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,UAAY,EAAA,MAAA;AAAA,GACd;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,QAAU,EAAA,KAAA;AAAA,GACZ;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,YAAc,EAAA,EAAA;AAAA,GAChB;AACF,CAAC,CAAA,CAAA;AASD,MAAM,sBAAsB,CAAC;AAAA,EAC3B,YAAA;AACF,CAEM,KAAA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IAAA,QAAA,CAAS,kCAChC,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,IAAA,EACE,CAAC,QACA,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,YAAA,EAAc,SAAS,YAAgB,IAAA,EAAA;AAAA,MACvC,YAAY,QAAS,CAAA,QAAA;AAAA,MACrB,aAAe,EAAA,qBAAA;AAAA,MACf,iBAAmB,EAAA,yBAAA;AAAA,KAAA;AAAA,qBAGtB,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,KAAM,EAAA,wBAAA,EAAyB,WAAU,KAChD,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,MAAM,QAAS,CAAA,YAAA;AAAA,MACf,MAAO,EAAA,QAAA;AAAA,MACP,GAAI,EAAA,qBAAA;AAAA,MACJ,KAAM,EAAA,SAAA;AAAA,KAAA;AAAA,wCAEL,iBAAkB,EAAA,IAAA,CAAA;AAAA,GAEvB,CACF,CAEJ,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,72 @@
1
+ import React, { useEffect } from 'react';
2
+ import List from '@material-ui/core/List';
3
+ import ListSubheader from '@material-ui/core/ListSubheader';
4
+ import { makeStyles, createStyles } from '@material-ui/core/styles';
5
+ import { IncidentListItem } from './IncidentListItem.esm.js';
6
+ import { IncidentsEmptyState } from './IncidentEmptyState.esm.js';
7
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
8
+ import { splunkOnCallApiRef } from '../../api/client.esm.js';
9
+ import Alert from '@material-ui/lab/Alert';
10
+ import { useApi } from '@backstage/core-plugin-api';
11
+ import { Progress } from '@backstage/core-components';
12
+
13
+ const useStyles = makeStyles(
14
+ (theme) => createStyles({
15
+ root: {
16
+ maxHeight: "400px",
17
+ overflow: "auto"
18
+ },
19
+ subheader: {
20
+ backgroundColor: theme.palette.background.paper
21
+ },
22
+ progress: {
23
+ margin: theme.spacing(0, 2)
24
+ }
25
+ })
26
+ );
27
+ const Incidents = ({ readOnly, refreshIncidents, team }) => {
28
+ const classes = useStyles();
29
+ const api = useApi(splunkOnCallApiRef);
30
+ const [{ value: incidents, loading, error }, getIncidents] = useAsyncFn(
31
+ async () => {
32
+ await new Promise((resolve) => setTimeout(resolve, 2e3));
33
+ const allIncidents = await api.getIncidents();
34
+ const teams = await api.getTeams();
35
+ const teamSlug = teams.find((teamValue) => teamValue.name === team)?.slug;
36
+ const filteredIncidents = teamSlug ? allIncidents.filter(
37
+ (incident) => incident.pagedTeams?.includes(teamSlug)
38
+ ) : [];
39
+ return filteredIncidents;
40
+ }
41
+ );
42
+ useEffect(() => {
43
+ getIncidents();
44
+ }, [refreshIncidents, getIncidents]);
45
+ if (error) {
46
+ return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Error encountered while fetching information. ", error.message);
47
+ }
48
+ if (!loading && !incidents?.length) {
49
+ return /* @__PURE__ */ React.createElement(IncidentsEmptyState, null);
50
+ }
51
+ return /* @__PURE__ */ React.createElement(
52
+ List,
53
+ {
54
+ className: classes.root,
55
+ dense: true,
56
+ subheader: /* @__PURE__ */ React.createElement(ListSubheader, { className: classes.subheader }, "CRITICAL INCIDENTS")
57
+ },
58
+ loading ? /* @__PURE__ */ React.createElement(Progress, { className: classes.progress }) : incidents.map((incident, index) => /* @__PURE__ */ React.createElement(
59
+ IncidentListItem,
60
+ {
61
+ onIncidentAction: () => getIncidents(),
62
+ key: index,
63
+ team,
64
+ incident,
65
+ readOnly
66
+ }
67
+ ))
68
+ );
69
+ };
70
+
71
+ export { Incidents };
72
+ //# sourceMappingURL=Incidents.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Incidents.esm.js","sources":["../../../src/components/Incident/Incidents.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, { useEffect } from 'react';\nimport List from '@material-ui/core/List';\nimport ListSubheader from '@material-ui/core/ListSubheader';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport { IncidentListItem } from './IncidentListItem';\nimport { IncidentsEmptyState } from './IncidentEmptyState';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { splunkOnCallApiRef } from '../../api';\nimport Alert from '@material-ui/lab/Alert';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Progress } from '@backstage/core-components';\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n maxHeight: '400px',\n overflow: 'auto',\n },\n subheader: {\n backgroundColor: theme.palette.background.paper,\n },\n progress: {\n margin: theme.spacing(0, 2),\n },\n }),\n);\n\ntype Props = {\n refreshIncidents: boolean;\n team: string;\n readOnly: boolean;\n};\n\nexport const Incidents = ({ readOnly, refreshIncidents, team }: Props) => {\n const classes = useStyles();\n const api = useApi(splunkOnCallApiRef);\n\n const [{ value: incidents, loading, error }, getIncidents] = useAsyncFn(\n async () => {\n // For some reason the changes applied to incidents (trigger-resolve-acknowledge)\n // may take some time to actually be applied after receiving the response from the server.\n // The timeout compensates for this latency.\n await new Promise(resolve => setTimeout(resolve, 2000));\n const allIncidents = await api.getIncidents();\n const teams = await api.getTeams();\n const teamSlug = teams.find(teamValue => teamValue.name === team)?.slug;\n const filteredIncidents = teamSlug\n ? allIncidents.filter(incident =>\n incident.pagedTeams?.includes(teamSlug),\n )\n : [];\n return filteredIncidents;\n },\n );\n\n useEffect(() => {\n getIncidents();\n }, [refreshIncidents, getIncidents]);\n\n if (error) {\n return (\n <Alert severity=\"error\">\n Error encountered while fetching information. {error.message}\n </Alert>\n );\n }\n\n if (!loading && !incidents?.length) {\n return <IncidentsEmptyState />;\n }\n\n return (\n <List\n className={classes.root}\n dense\n subheader={\n <ListSubheader className={classes.subheader}>\n CRITICAL INCIDENTS\n </ListSubheader>\n }\n >\n {loading ? (\n <Progress className={classes.progress} />\n ) : (\n incidents!.map((incident, index) => (\n <IncidentListItem\n onIncidentAction={() => getIncidents()}\n key={index}\n team={team}\n incident={incident}\n readOnly={readOnly}\n />\n ))\n )}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,IAAM,EAAA;AAAA,MACJ,SAAW,EAAA,OAAA;AAAA,MACX,QAAU,EAAA,MAAA;AAAA,KACZ;AAAA,IACA,SAAW,EAAA;AAAA,MACT,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA,KAAA;AAAA,KAC5C;AAAA,IACA,QAAU,EAAA;AAAA,MACR,MAAQ,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,EAAG,CAAC,CAAA;AAAA,KAC5B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAQO,MAAM,YAAY,CAAC,EAAE,QAAU,EAAA,gBAAA,EAAkB,MAAkB,KAAA;AACxE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,GAAA,GAAM,OAAO,kBAAkB,CAAA,CAAA;AAErC,EAAM,MAAA,CAAC,EAAE,KAAO,EAAA,SAAA,EAAW,SAAS,KAAM,EAAA,EAAG,YAAY,CAAI,GAAA,UAAA;AAAA,IAC3D,YAAY;AAIV,MAAA,MAAM,IAAI,OAAQ,CAAA,CAAA,OAAA,KAAW,UAAW,CAAA,OAAA,EAAS,GAAI,CAAC,CAAA,CAAA;AACtD,MAAM,MAAA,YAAA,GAAe,MAAM,GAAA,CAAI,YAAa,EAAA,CAAA;AAC5C,MAAM,MAAA,KAAA,GAAQ,MAAM,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AA,QACC,gBAAA,EAAkB,MAAM,YAAa,EAAA;AAAA,QACrC,GAAK,EAAA,KAAA;AAAA,QACL,IAAA;AAAA,QACA,QAAA;AAAA,QACA,QAAA;AAAA,OAAA;AAAA,KAEH,CAAA;AAAA,GAEL,CAAA;AAEJ;;;;"}
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import Grid from '@material-ui/core/Grid';
3
+ import { makeStyles } from '@material-ui/core/styles';
4
+ import { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard.esm.js';
5
+ import { Page, Header, Content, ContentHeader, SupportButton } from '@backstage/core-components';
6
+
7
+ const useStyles = makeStyles(() => ({
8
+ overflowXScroll: {
9
+ overflowX: "scroll"
10
+ }
11
+ }));
12
+ const SplunkOnCallPage = (props) => {
13
+ const { title, subtitle, pageTitle } = props;
14
+ const classes = useStyles();
15
+ return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Header, { title, subtitle }), /* @__PURE__ */ React.createElement(Content, { className: classes.overflowXScroll }, /* @__PURE__ */ React.createElement(ContentHeader, { title: pageTitle }, /* @__PURE__ */ React.createElement(SupportButton, null, "This is used to help you automate incident management.")), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "row" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, sm: 6, md: 4 }, /* @__PURE__ */ React.createElement(EntitySplunkOnCallCard, null)))));
16
+ };
17
+ SplunkOnCallPage.defaultProps = {
18
+ title: "Splunk On-Call",
19
+ subtitle: "Automate incident management",
20
+ pageTitle: "Dashboard"
21
+ };
22
+
23
+ export { SplunkOnCallPage };
24
+ //# sourceMappingURL=SplunkOnCallPage.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplunkOnCallPage.esm.js","sources":["../../src/components/SplunkOnCallPage.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 Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { EntitySplunkOnCallCard } from './EntitySplunkOnCallCard';\nimport {\n Content,\n ContentHeader,\n Page,\n Header,\n SupportButton,\n} from '@backstage/core-components';\n\nconst useStyles = makeStyles(() => ({\n overflowXScroll: {\n overflowX: 'scroll',\n },\n}));\n\n/** @public */\nexport type SplunkOnCallPageProps = {\n title?: string;\n subtitle?: string;\n pageTitle?: string;\n};\n\nexport const SplunkOnCallPage = (props: SplunkOnCallPageProps): JSX.Element => {\n const { title, subtitle, pageTitle } = props;\n const classes = useStyles();\n\n return (\n <Page themeId=\"tool\">\n <Header title={title} subtitle={subtitle} />\n <Content className={classes.overflowXScroll}>\n <ContentHeader title={pageTitle}>\n <SupportButton>\n This is used to help you automate incident management.\n </SupportButton>\n </ContentHeader>\n <Grid container spacing={3} direction=\"row\">\n <Grid item xs={12} sm={6} md={4}>\n <EntitySplunkOnCallCard />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n\nSplunkOnCallPage.defaultProps = {\n title: 'Splunk On-Call',\n subtitle: 'Automate incident management',\n pageTitle: 'Dashboard',\n};\n"],"names":[],"mappings":";;;;;;AA4BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,eAAiB,EAAA;AAAA,IACf,SAAW,EAAA,QAAA;AAAA,GACb;AACF,CAAE,CAAA,CAAA,CAAA;AASW,MAAA,gBAAA,GAAmB,CAAC,KAA8C,KAAA;AAC7E,EAAA,MAAM,EAAE,KAAA,EAAO,QAAU,EAAA,SAAA,EAAc,GAAA,KAAA,CAAA;AACvC,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,OAAQ,EAAA,MAAA,EAAA,sCACX,MAAO,EAAA,EAAA,KAAA,EAAc,UAAoB,CAC1C,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAQ,SAAW,EAAA,OAAA,CAAQ,mCACzB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,OAAO,SACpB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,IAAA,EAAA,wDAEf,CACF,CAAA,sCACC,IAAK,EAAA,EAAA,SAAA,EAAS,MAAC,OAAS,EAAA,CAAA,EAAG,WAAU,KACpC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EAAI,EAAA,EAAA,EAAI,GAAG,EAAI,EAAA,CAAA,EAAA,sCAC3B,sBAAuB,EAAA,IAAA,CAC1B,CACF,CACF,CACF,CAAA,CAAA;AAEJ,EAAA;AAEA,gBAAA,CAAiB,YAAe,GAAA;AAAA,EAC9B,KAAO,EAAA,gBAAA;AAAA,EACP,QAAU,EAAA,8BAAA;AAAA,EACV,SAAW,EAAA,WAAA;AACb,CAAA;;;;"}
@@ -0,0 +1,205 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import Dialog from '@material-ui/core/Dialog';
3
+ import DialogTitle from '@material-ui/core/DialogTitle';
4
+ import TextField from '@material-ui/core/TextField';
5
+ import DialogActions from '@material-ui/core/DialogActions';
6
+ import Button from '@material-ui/core/Button';
7
+ import DialogContent from '@material-ui/core/DialogContent';
8
+ import Typography from '@material-ui/core/Typography';
9
+ import CircularProgress from '@material-ui/core/CircularProgress';
10
+ import Select from '@material-ui/core/Select';
11
+ import MenuItem from '@material-ui/core/MenuItem';
12
+ import FormControl from '@material-ui/core/FormControl';
13
+ import InputLabel from '@material-ui/core/InputLabel';
14
+ import { makeStyles, createStyles } from '@material-ui/core/styles';
15
+ import useAsyncFn from 'react-use/esm/useAsyncFn';
16
+ import { splunkOnCallApiRef } from '../../api/client.esm.js';
17
+ import Alert from '@material-ui/lab/Alert';
18
+ import { useApi, alertApiRef } from '@backstage/core-plugin-api';
19
+
20
+ const useStyles = makeStyles(
21
+ (theme) => createStyles({
22
+ chips: {
23
+ display: "flex",
24
+ flexWrap: "wrap"
25
+ },
26
+ chip: {
27
+ margin: 2
28
+ },
29
+ formControl: {
30
+ margin: theme.spacing(1),
31
+ display: "flex",
32
+ flexDirection: "row",
33
+ alignItems: "center",
34
+ minWidth: `calc(100% - ${theme.spacing(2)}px)`
35
+ },
36
+ formHeader: {
37
+ width: "50%"
38
+ },
39
+ incidentType: {
40
+ width: "90%"
41
+ },
42
+ targets: {
43
+ display: "flex",
44
+ flexDirection: "column",
45
+ width: "100%"
46
+ }
47
+ })
48
+ );
49
+ const TriggerDialog = ({
50
+ routingKey,
51
+ showDialog,
52
+ handleDialog,
53
+ onIncidentCreated
54
+ }) => {
55
+ const alertApi = useApi(alertApiRef);
56
+ const api = useApi(splunkOnCallApiRef);
57
+ const classes = useStyles();
58
+ const [incidentType, setIncidentType] = useState("");
59
+ const [incidentId, setIncidentId] = useState();
60
+ const [incidentDisplayName, setIncidentDisplayName] = useState("");
61
+ const [incidentMessage, setIncidentMessage] = useState("");
62
+ const [incidentStartTime, setIncidentStartTime] = useState();
63
+ const [
64
+ { value, loading: triggerLoading, error: triggerError },
65
+ handleTriggerAlarm
66
+ ] = useAsyncFn(
67
+ async (params) => await api.incidentAction(params)
68
+ );
69
+ const handleIncidentType = (event) => {
70
+ setIncidentType(event.target.value);
71
+ };
72
+ const handleIncidentId = (event) => {
73
+ setIncidentId(event.target.value);
74
+ };
75
+ const handleIncidentDisplayName = (event) => {
76
+ setIncidentDisplayName(event.target.value);
77
+ };
78
+ const handleIncidentMessage = (event) => {
79
+ setIncidentMessage(event.target.value);
80
+ };
81
+ const handleIncidentStartTime = (event) => {
82
+ const dateTime = new Date(event.target.value).getTime();
83
+ const dateTimeInSeconds = Math.floor(dateTime / 1e3);
84
+ setIncidentStartTime(dateTimeInSeconds);
85
+ };
86
+ useEffect(() => {
87
+ if (value) {
88
+ alertApi.post({
89
+ message: `Alarm successfully triggered`
90
+ });
91
+ onIncidentCreated();
92
+ handleDialog();
93
+ }
94
+ }, [value, alertApi, handleDialog, onIncidentCreated]);
95
+ if (triggerError) {
96
+ alertApi.post({
97
+ message: `Failed to trigger alarm. ${triggerError.message}`,
98
+ severity: "error"
99
+ });
100
+ }
101
+ return /* @__PURE__ */ React.createElement(Dialog, { maxWidth: "md", open: showDialog, onClose: handleDialog, fullWidth: true }, /* @__PURE__ */ React.createElement(DialogTitle, null, "This action will trigger an incident"), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(Typography, { variant: "subtitle1", gutterBottom: true, align: "justify" }, "Created by: ", /* @__PURE__ */ React.createElement("b", null, `{ REST } Endpoint`)), /* @__PURE__ */ React.createElement(Alert, { severity: "info" }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", align: "justify" }, `If the issue you are seeing does not need urgent attention, please get in touch with the responsible team using their preferred communications channel. You can find information about the owner of this entity in the "About" card. If the issue is urgent, please don't hesitate to trigger the alert.`)), /* @__PURE__ */ React.createElement(
102
+ Typography,
103
+ {
104
+ variant: "body1",
105
+ style: { marginTop: "1em" },
106
+ gutterBottom: true,
107
+ align: "justify"
108
+ },
109
+ "Please describe the problem you want to report. Be as descriptive as possible. ",
110
+ /* @__PURE__ */ React.createElement("br", null),
111
+ "Note that only the ",
112
+ /* @__PURE__ */ React.createElement("b", null, "Incident type"),
113
+ ", ",
114
+ /* @__PURE__ */ React.createElement("b", null, "Incident display name"),
115
+ " ",
116
+ "and the ",
117
+ /* @__PURE__ */ React.createElement("b", null, "Incident message"),
118
+ " fields are ",
119
+ /* @__PURE__ */ React.createElement("b", null, "required"),
120
+ "."
121
+ ), /* @__PURE__ */ React.createElement(FormControl, { className: classes.formControl }, /* @__PURE__ */ React.createElement("div", { className: classes.formHeader }, /* @__PURE__ */ React.createElement(InputLabel, { id: "demo-simple-select-label" }, "Incident type"), /* @__PURE__ */ React.createElement(
122
+ Select,
123
+ {
124
+ id: "incident-type",
125
+ className: classes.incidentType,
126
+ value: incidentType,
127
+ onChange: handleIncidentType,
128
+ inputProps: { "data-testid": "trigger-incident-type" }
129
+ },
130
+ /* @__PURE__ */ React.createElement(MenuItem, { value: "CRITICAL" }, "Critical"),
131
+ /* @__PURE__ */ React.createElement(MenuItem, { value: "WARNING" }, "Warning"),
132
+ /* @__PURE__ */ React.createElement(MenuItem, { value: "INFO" }, "Info")
133
+ )), /* @__PURE__ */ React.createElement(
134
+ TextField,
135
+ {
136
+ className: classes.formHeader,
137
+ id: "datetime-local",
138
+ label: "Incident start time",
139
+ type: "datetime-local",
140
+ onChange: handleIncidentStartTime,
141
+ InputLabelProps: {
142
+ shrink: true
143
+ }
144
+ }
145
+ )), /* @__PURE__ */ React.createElement(
146
+ TextField,
147
+ {
148
+ inputProps: { "data-testid": "trigger-incident-id" },
149
+ id: "summary",
150
+ fullWidth: true,
151
+ margin: "normal",
152
+ label: "Incident id",
153
+ variant: "outlined",
154
+ onChange: handleIncidentId
155
+ }
156
+ ), /* @__PURE__ */ React.createElement(
157
+ TextField,
158
+ {
159
+ required: true,
160
+ inputProps: { "data-testid": "trigger-incident-displayName" },
161
+ id: "summary",
162
+ fullWidth: true,
163
+ margin: "normal",
164
+ label: "Incident display name",
165
+ variant: "outlined",
166
+ onChange: handleIncidentDisplayName
167
+ }
168
+ ), /* @__PURE__ */ React.createElement(
169
+ TextField,
170
+ {
171
+ required: true,
172
+ inputProps: { "data-testid": "trigger-incident-message" },
173
+ id: "details",
174
+ multiline: true,
175
+ fullWidth: true,
176
+ minRows: "2",
177
+ margin: "normal",
178
+ label: "Incident message",
179
+ variant: "outlined",
180
+ onChange: handleIncidentMessage
181
+ }
182
+ )), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(
183
+ Button,
184
+ {
185
+ "data-testid": "trigger-button",
186
+ id: "trigger",
187
+ color: "secondary",
188
+ disabled: !incidentType.length || !incidentDisplayName || !incidentMessage || triggerLoading,
189
+ variant: "contained",
190
+ onClick: () => handleTriggerAlarm({
191
+ routingKey,
192
+ incidentType,
193
+ incidentDisplayName,
194
+ incidentMessage,
195
+ ...incidentId ? { incidentId } : {},
196
+ ...incidentStartTime ? { incidentStartTime } : {}
197
+ }),
198
+ endIcon: triggerLoading && /* @__PURE__ */ React.createElement(CircularProgress, { size: 16 })
199
+ },
200
+ "Trigger Incident"
201
+ ), /* @__PURE__ */ React.createElement(Button, { id: "close", color: "primary", onClick: handleDialog }, "Close")));
202
+ };
203
+
204
+ export { TriggerDialog };
205
+ //# sourceMappingURL=TriggerDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerDialog.esm.js","sources":["../../../src/components/TriggerDialog/TriggerDialog.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, { useState, useEffect } from 'react';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport TextField from '@material-ui/core/TextField';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Button from '@material-ui/core/Button';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Typography from '@material-ui/core/Typography';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { splunkOnCallApiRef } from '../../api';\nimport Alert from '@material-ui/lab/Alert';\nimport { TriggerAlarmRequest } from '../../api';\nimport { useApi, alertApiRef } from '@backstage/core-plugin-api';\n\ntype Props = {\n routingKey: string;\n showDialog: boolean;\n handleDialog: () => void;\n onIncidentCreated: () => void;\n};\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n chips: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n chip: {\n margin: 2,\n },\n formControl: {\n margin: theme.spacing(1),\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n minWidth: `calc(100% - ${theme.spacing(2)}px)`,\n },\n formHeader: {\n width: '50%',\n },\n incidentType: {\n width: '90%',\n },\n targets: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n },\n }),\n);\n\nexport const TriggerDialog = ({\n routingKey,\n showDialog,\n handleDialog,\n onIncidentCreated: onIncidentCreated,\n}: Props) => {\n const alertApi = useApi(alertApiRef);\n const api = useApi(splunkOnCallApiRef);\n const classes = useStyles();\n\n const [incidentType, setIncidentType] = useState<string>('');\n const [incidentId, setIncidentId] = useState<string>();\n const [incidentDisplayName, setIncidentDisplayName] = useState<string>('');\n const [incidentMessage, setIncidentMessage] = useState<string>('');\n const [incidentStartTime, setIncidentStartTime] = useState<number>();\n\n const [\n { value, loading: triggerLoading, error: triggerError },\n handleTriggerAlarm,\n ] = useAsyncFn(\n async (params: TriggerAlarmRequest) => await api.incidentAction(params),\n );\n\n const handleIncidentType = (event: React.ChangeEvent<{ value: unknown }>) => {\n setIncidentType(event.target.value as string);\n };\n\n const handleIncidentId = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n setIncidentId(event.target.value as string);\n };\n\n const handleIncidentDisplayName = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n setIncidentDisplayName(event.target.value);\n };\n\n const handleIncidentMessage = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n setIncidentMessage(event.target.value);\n };\n\n const handleIncidentStartTime = (\n event: React.ChangeEvent<HTMLTextAreaElement>,\n ) => {\n const dateTime = new Date(event.target.value).getTime();\n const dateTimeInSeconds = Math.floor(dateTime / 1000);\n setIncidentStartTime(dateTimeInSeconds);\n };\n\n useEffect(() => {\n if (value) {\n alertApi.post({\n message: `Alarm successfully triggered`,\n });\n onIncidentCreated();\n handleDialog();\n }\n }, [value, alertApi, handleDialog, onIncidentCreated]);\n\n if (triggerError) {\n alertApi.post({\n message: `Failed to trigger alarm. ${triggerError.message}`,\n severity: 'error',\n });\n }\n\n return (\n <Dialog maxWidth=\"md\" open={showDialog} onClose={handleDialog} fullWidth>\n <DialogTitle>This action will trigger an incident</DialogTitle>\n <DialogContent>\n <Typography variant=\"subtitle1\" gutterBottom align=\"justify\">\n Created by: <b>{`{ REST } Endpoint`}</b>\n </Typography>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n If the issue you are seeing does not need urgent attention, please\n get in touch with the responsible team using their preferred\n communications channel. You can find information about the owner of\n this entity in the \"About\" card. If the issue is urgent, please\n don't hesitate to trigger the alert.\n </Typography>\n </Alert>\n <Typography\n variant=\"body1\"\n style={{ marginTop: '1em' }}\n gutterBottom\n align=\"justify\"\n >\n Please describe the problem you want to report. Be as descriptive as\n possible. <br />\n Note that only the <b>Incident type</b>, <b>Incident display name</b>{' '}\n and the <b>Incident message</b> fields are <b>required</b>.\n </Typography>\n <FormControl className={classes.formControl}>\n <div className={classes.formHeader}>\n <InputLabel id=\"demo-simple-select-label\">Incident type</InputLabel>\n <Select\n id=\"incident-type\"\n className={classes.incidentType}\n value={incidentType}\n onChange={handleIncidentType}\n inputProps={{ 'data-testid': 'trigger-incident-type' }}\n >\n <MenuItem value=\"CRITICAL\">Critical</MenuItem>\n <MenuItem value=\"WARNING\">Warning</MenuItem>\n <MenuItem value=\"INFO\">Info</MenuItem>\n </Select>\n </div>\n <TextField\n className={classes.formHeader}\n id=\"datetime-local\"\n label=\"Incident start time\"\n type=\"datetime-local\"\n onChange={handleIncidentStartTime}\n InputLabelProps={{\n shrink: true,\n }}\n />\n </FormControl>\n <TextField\n inputProps={{ 'data-testid': 'trigger-incident-id' }}\n id=\"summary\"\n fullWidth\n margin=\"normal\"\n label=\"Incident id\"\n variant=\"outlined\"\n onChange={handleIncidentId}\n />\n <TextField\n required\n inputProps={{ 'data-testid': 'trigger-incident-displayName' }}\n id=\"summary\"\n fullWidth\n margin=\"normal\"\n label=\"Incident display name\"\n variant=\"outlined\"\n onChange={handleIncidentDisplayName}\n />\n <TextField\n required\n inputProps={{ 'data-testid': 'trigger-incident-message' }}\n id=\"details\"\n multiline\n fullWidth\n minRows=\"2\"\n margin=\"normal\"\n label=\"Incident message\"\n variant=\"outlined\"\n onChange={handleIncidentMessage}\n />\n </DialogContent>\n <DialogActions>\n <Button\n data-testid=\"trigger-button\"\n id=\"trigger\"\n color=\"secondary\"\n disabled={\n !incidentType.length ||\n !incidentDisplayName ||\n !incidentMessage ||\n triggerLoading\n }\n variant=\"contained\"\n onClick={() =>\n handleTriggerAlarm({\n routingKey,\n incidentType,\n incidentDisplayName,\n incidentMessage,\n ...(incidentId ? { incidentId } : {}),\n ...(incidentStartTime ? { incidentStartTime } : {}),\n } as TriggerAlarmRequest)\n }\n endIcon={triggerLoading && <CircularProgress size={16} />}\n >\n Trigger Incident\n </Button>\n <Button id=\"close\" color=\"primary\" onClick={handleDialog}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,KAAO,EAAA;AAAA,MACL,OAAS,EAAA,MAAA;AAAA,MACT,QAAU,EAAA,MAAA;AAAA,KACZ;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,MA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GAEd,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,aAAY,EAAA,gBAAA;AAAA,MACZ,EAAG,EAAA,SAAA;AAAA,MACH,KAAM,EAAA,WAAA;AAAA,MACN,UACE,CAAC,YAAA,CAAa,UACd,CAAC,mBAAA,IACD,CAAC,eACD,IAAA,cAAA;AAAA,MAEF,OAAQ,EAAA,WAAA;AAAA,MACR,OAAA,EAAS,MACP,kBAAmB,CAAA;AAAA,QACjB,UAAA;AAAA,QACA,YAAA;AAAA,QACA,mBAAA;AAAA,QACA,eAAA;AAAA,QACA,GAAI,UAAA,GAAa,EAAE,UAAA,KAAe,EAAC;AAAA,QACnC,GAAI,iBAAA,GAAoB,EAAE,iBAAA,KAAsB,EAAC;AAAA,OAC3B,CAAA;AAAA,MAE1B,OAAS,EAAA,cAAA,oBAAmB,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EAAiB,MAAM,EAAI,EAAA,CAAA;AAAA,KAAA;AAAA,IACxD,kBAAA;AAAA,GAED,kBACC,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,EAAG,EAAA,OAAA,EAAQ,KAAM,EAAA,SAAA,EAAU,OAAS,EAAA,YAAA,EAAA,EAAc,OAE1D,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,44 +1,4 @@
1
- export { a as EntitySplunkOnCallCard, b as SplunkOnCallClient, S as SplunkOnCallPage, U as UnauthorizedError, i as isSplunkOnCallAvailable, s as plugin, c as splunkOnCallApiRef, s as splunkOnCallPlugin } from './esm/index-D8KSFXg5.esm.js';
2
- import '@backstage/core-plugin-api';
3
- import 'react';
4
- import 'react-use/esm/useAsync';
5
- import '@backstage/plugin-catalog-react';
6
- import '@material-ui/core/Card';
7
- import '@material-ui/core/CardContent';
8
- import '@material-ui/core/CardHeader';
9
- import '@material-ui/core/Divider';
10
- import '@material-ui/core/Typography';
11
- import '@material-ui/core/styles';
12
- import '@material-ui/icons/AlarmAdd';
13
- import '@material-ui/icons/Web';
14
- import '@material-ui/lab/Alert';
15
- import '@material-ui/core/Button';
16
- import '@backstage/core-components';
17
- import '@material-ui/core/List';
18
- import '@material-ui/core/ListSubheader';
19
- import '@material-ui/core/ListItem';
20
- import '@material-ui/core/ListItemIcon';
21
- import '@material-ui/core/ListItemText';
22
- import '@material-ui/core/ListItemSecondaryAction';
23
- import '@material-ui/core/Tooltip';
24
- import '@material-ui/core/IconButton';
25
- import '@material-ui/core/Avatar';
26
- import '@material-ui/icons/Email';
27
- import '@material-ui/icons/Done';
28
- import '@material-ui/icons/DoneAll';
29
- import 'luxon';
30
- import '@material-ui/icons/OpenInBrowser';
31
- import 'react-use/esm/useAsyncFn';
32
- import '@material-ui/core/Grid';
33
- import './assets/emptystate.svg';
34
- import '@material-ui/core/Dialog';
35
- import '@material-ui/core/DialogTitle';
36
- import '@material-ui/core/TextField';
37
- import '@material-ui/core/DialogActions';
38
- import '@material-ui/core/DialogContent';
39
- import '@material-ui/core/CircularProgress';
40
- import '@material-ui/core/Select';
41
- import '@material-ui/core/MenuItem';
42
- import '@material-ui/core/FormControl';
43
- import '@material-ui/core/InputLabel';
1
+ export { EntitySplunkOnCallCard, SplunkOnCallPage, splunkOnCallPlugin as plugin, splunkOnCallPlugin } from './plugin.esm.js';
2
+ export { isSplunkOnCallAvailable } from './components/EntitySplunkOnCallCard.esm.js';
3
+ export { SplunkOnCallClient, UnauthorizedError, splunkOnCallApiRef } from './api/client.esm.js';
44
4
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}