@backstage-community/plugin-ilert 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/ILertIcon.esm.js +63 -56
- package/dist/ILertIcon.esm.js.map +1 -1
- package/dist/components/Alert/AlertActionsMenu.esm.js +49 -42
- package/dist/components/Alert/AlertActionsMenu.esm.js.map +1 -1
- package/dist/components/Alert/AlertAssignModal.esm.js +68 -60
- package/dist/components/Alert/AlertAssignModal.esm.js.map +1 -1
- package/dist/components/Alert/AlertLink.esm.js +5 -2
- package/dist/components/Alert/AlertLink.esm.js.map +1 -1
- package/dist/components/Alert/AlertNewModal.esm.js +109 -87
- package/dist/components/Alert/AlertNewModal.esm.js.map +1 -1
- package/dist/components/AlertSource/AlertSourceLink.esm.js +19 -16
- package/dist/components/AlertSource/AlertSourceLink.esm.js.map +1 -1
- package/dist/components/AlertsPage/AlertsPage.esm.js +44 -36
- package/dist/components/AlertsPage/AlertsPage.esm.js.map +1 -1
- package/dist/components/AlertsPage/AlertsTable.esm.js +15 -15
- package/dist/components/AlertsPage/AlertsTable.esm.js.map +1 -1
- package/dist/components/AlertsPage/StatusChip.esm.js +5 -5
- package/dist/components/AlertsPage/StatusChip.esm.js.map +1 -1
- package/dist/components/AlertsPage/TableTitle.esm.js +30 -24
- package/dist/components/AlertsPage/TableTitle.esm.js.map +1 -1
- package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js +6 -6
- package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCard.esm.js +63 -51
- package/dist/components/ILertCard/ILertCard.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardActionsHeader.esm.js +42 -33
- package/dist/components/ILertCard/ILertCardActionsHeader.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardEmptyState.esm.js +28 -20
- package/dist/components/ILertCard/ILertCardEmptyState.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js +3 -3
- package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js +36 -27
- package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCall.esm.js +34 -28
- package/dist/components/ILertCard/ILertCardOnCall.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js +6 -6
- package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCallItem.esm.js +41 -31
- package/dist/components/ILertCard/ILertCardOnCallItem.esm.js.map +1 -1
- package/dist/components/ILertPage/ILertPage.esm.js +25 -17
- package/dist/components/ILertPage/ILertPage.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js +45 -35
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js +14 -11
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js +31 -23
- package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js.map +1 -1
- package/dist/components/Service/ServiceActionsMenu.esm.js +29 -25
- package/dist/components/Service/ServiceActionsMenu.esm.js.map +1 -1
- package/dist/components/Service/ServiceLink.esm.js +5 -2
- package/dist/components/Service/ServiceLink.esm.js.map +1 -1
- package/dist/components/ServicesPage/ServicesPage.esm.js +17 -14
- package/dist/components/ServicesPage/ServicesPage.esm.js.map +1 -1
- package/dist/components/ServicesPage/ServicesTable.esm.js +9 -9
- package/dist/components/ServicesPage/ServicesTable.esm.js.map +1 -1
- package/dist/components/ServicesPage/StatusChip.esm.js +7 -7
- package/dist/components/ServicesPage/StatusChip.esm.js.map +1 -1
- package/dist/components/Shift/ShiftOverrideModal.esm.js +83 -74
- package/dist/components/Shift/ShiftOverrideModal.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageActionsMenu.esm.js +32 -26
- package/dist/components/StatusPage/StatusPageActionsMenu.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageLink.esm.js +5 -2
- package/dist/components/StatusPage/StatusPageLink.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageURL.esm.js +2 -2
- package/dist/components/StatusPage/StatusPageURL.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusChip.esm.js +7 -7
- package/dist/components/StatusPagePage/StatusChip.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusPagesPage.esm.js +17 -14
- package/dist/components/StatusPagePage/StatusPagesPage.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusPagesTable.esm.js +10 -10
- package/dist/components/StatusPagePage/StatusPagesTable.esm.js.map +1 -1
- package/dist/components/StatusPagePage/VisibilityChip.esm.js +4 -4
- package/dist/components/StatusPagePage/VisibilityChip.esm.js.map +1 -1
- package/dist/hooks/useAlertActions.esm.js +3 -5
- package/dist/hooks/useAlertActions.esm.js.map +1 -1
- package/dist/hooks/useAlertSource.esm.js +3 -5
- package/dist/hooks/useAlertSource.esm.js.map +1 -1
- package/dist/hooks/useAlertSourceOnCalls.esm.js +3 -3
- package/dist/hooks/useAlertSourceOnCalls.esm.js.map +1 -1
- package/dist/hooks/useAlerts.esm.js +6 -9
- package/dist/hooks/useAlerts.esm.js.map +1 -1
- package/dist/hooks/useAssignAlert.esm.js +6 -4
- package/dist/hooks/useAssignAlert.esm.js.map +1 -1
- package/dist/hooks/useNewAlert.esm.js +6 -10
- package/dist/hooks/useNewAlert.esm.js.map +1 -1
- package/dist/hooks/useOnCallSchedules.esm.js +5 -3
- package/dist/hooks/useOnCallSchedules.esm.js.map +1 -1
- package/dist/hooks/useServices.esm.js +4 -4
- package/dist/hooks/useServices.esm.js.map +1 -1
- package/dist/hooks/useShiftOverride.esm.js +4 -4
- package/dist/hooks/useShiftOverride.esm.js.map +1 -1
- package/dist/hooks/useStatusPages.esm.js +4 -6
- package/dist/hooks/useStatusPages.esm.js.map +1 -1
- package/dist/index.d.ts +6 -8
- package/package.json +13 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { Page, Header, HeaderLabel, HeaderTabs, Content } from '@backstage/core-components';
|
|
2
|
-
import
|
|
3
|
+
import { useState } from 'react';
|
|
3
4
|
import { AlertsPage } from '../AlertsPage/AlertsPage.esm.js';
|
|
4
5
|
import '../AlertsPage/AlertsTable.esm.js';
|
|
5
6
|
import { OnCallSchedulesPage } from '../OnCallSchedulesPage/OnCallSchedulesPage.esm.js';
|
|
@@ -10,7 +11,7 @@ import { StatusPagesPage } from '../StatusPagePage/StatusPagesPage.esm.js';
|
|
|
10
11
|
import '../StatusPagePage/StatusPagesTable.esm.js';
|
|
11
12
|
|
|
12
13
|
const ILertPage = () => {
|
|
13
|
-
const [selectedTab, setSelectedTab] =
|
|
14
|
+
const [selectedTab, setSelectedTab] = useState(0);
|
|
14
15
|
const tabs = [
|
|
15
16
|
{ label: "Who is on call?" },
|
|
16
17
|
{ label: "Alerts" },
|
|
@@ -20,28 +21,35 @@ const ILertPage = () => {
|
|
|
20
21
|
const renderTab = () => {
|
|
21
22
|
switch (selectedTab) {
|
|
22
23
|
case 0:
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ jsx(OnCallSchedulesPage, {});
|
|
24
25
|
case 1:
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsx(AlertsPage, {});
|
|
26
27
|
case 2:
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsx(ServicesPage, {});
|
|
28
29
|
case 3:
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx(StatusPagesPage, {});
|
|
30
31
|
default:
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
return /* @__PURE__ */ jsxs(Page, { themeId: "website", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs(Header, { title: "iLert", type: "tool", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(HeaderLabel, { label: "Owner", value: "iLert" }),
|
|
38
|
+
/* @__PURE__ */ jsx(HeaderLabel, { label: "Lifecycle", value: "Alpha" })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
HeaderTabs,
|
|
42
|
+
{
|
|
43
|
+
selectedIndex: selectedTab,
|
|
44
|
+
onChange: (index) => setSelectedTab(index),
|
|
45
|
+
tabs: tabs.map(({ label }, index) => ({
|
|
46
|
+
id: index.toString(),
|
|
47
|
+
label
|
|
48
|
+
}))
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(Content, { noPadding: true, children: renderTab() })
|
|
52
|
+
] });
|
|
45
53
|
};
|
|
46
54
|
|
|
47
55
|
export { ILertPage, ILertPage as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertPage.esm.js","sources":["../../../src/components/ILertPage/ILertPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Content,\n Header,\n HeaderLabel,\n HeaderTabs,\n Page,\n} from '@backstage/core-components';\nimport
|
|
1
|
+
{"version":3,"file":"ILertPage.esm.js","sources":["../../../src/components/ILertPage/ILertPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Content,\n Header,\n HeaderLabel,\n HeaderTabs,\n Page,\n} from '@backstage/core-components';\nimport { useState } from 'react';\nimport { AlertsPage } from '../AlertsPage';\nimport { OnCallSchedulesPage } from '../OnCallSchedulesPage';\nimport { ServicesPage } from '../ServicesPage';\nimport { StatusPagesPage } from '../StatusPagePage';\n\n/** @public */\nexport const ILertPage = () => {\n const [selectedTab, setSelectedTab] = useState<number>(0);\n const tabs = [\n { label: 'Who is on call?' },\n { label: 'Alerts' },\n { label: 'Services' },\n { label: 'Status pages' },\n ];\n const renderTab = () => {\n switch (selectedTab) {\n case 0:\n return <OnCallSchedulesPage />;\n case 1:\n return <AlertsPage />;\n case 2:\n return <ServicesPage />;\n case 3:\n return <StatusPagesPage />;\n default:\n return null;\n }\n };\n\n return (\n <Page themeId=\"website\">\n <Header title=\"iLert\" type=\"tool\">\n <HeaderLabel label=\"Owner\" value=\"iLert\" />\n <HeaderLabel label=\"Lifecycle\" value=\"Alpha\" />\n </Header>\n <HeaderTabs\n selectedIndex={selectedTab}\n onChange={index => setSelectedTab(index)}\n tabs={tabs.map(({ label }, index) => ({\n id: index.toString(),\n label,\n }))}\n />\n\n <Content noPadding>{renderTab()}</Content>\n </Page>\n );\n};\n\nexport default ILertPage;\n"],"names":[],"mappings":";;;;;;;;;;;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,CAAA,GAAA,CAAI,CAAC,EAAE,KAAA,IAAS,KAAW,MAAA;AAAA,UACpC,EAAA,EAAI,MAAM,QAAS,EAAA;AAAA,UACnB;AAAA,SACA,CAAA;AAAA;AAAA,KACJ;AAAA,oBAEC,GAAA,CAAA,OAAA,EAAA,EAAQ,SAAS,EAAA,IAAA,EAAE,qBAAY,EAAA;AAAA,GAClC,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
3
|
import Card from '@material-ui/core/Card';
|
|
4
4
|
import CardContent from '@material-ui/core/CardContent';
|
|
@@ -91,44 +91,54 @@ const OnCallSchedulesGrid = ({
|
|
|
91
91
|
const ilertApi = useApi(ilertApiRef);
|
|
92
92
|
const classes = useStyles();
|
|
93
93
|
if (isLoading) {
|
|
94
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
95
95
|
}
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
classes: { content: classes.cardHeader },
|
|
100
|
-
title: /* @__PURE__ */ React.createElement(
|
|
101
|
-
Link,
|
|
102
|
-
{
|
|
103
|
-
to: ilertApi.getScheduleDetailsURL(schedule),
|
|
104
|
-
className: classes.link
|
|
105
|
-
},
|
|
106
|
-
schedule.name
|
|
107
|
-
)
|
|
108
|
-
}
|
|
109
|
-
), /* @__PURE__ */ React.createElement(CardContent, { className: classes.cardContent }, /* @__PURE__ */ React.createElement("div", { className: classes.indicatorCurrent }), /* @__PURE__ */ React.createElement(
|
|
110
|
-
OnCallShiftItem,
|
|
111
|
-
{
|
|
112
|
-
shift: schedule.currentShift,
|
|
113
|
-
scheduleId: schedule.id,
|
|
114
|
-
refetchOnCallSchedules
|
|
115
|
-
}
|
|
116
|
-
), /* @__PURE__ */ React.createElement(Typography, { className: classes.beforeText, variant: "body2" }, "On call now")), /* @__PURE__ */ React.createElement(
|
|
117
|
-
CardContent,
|
|
118
|
-
{
|
|
119
|
-
className: `${classes.cardContent} ${classes.marginBottom}`
|
|
120
|
-
},
|
|
121
|
-
/* @__PURE__ */ React.createElement("div", { className: classes.indicatorNext }),
|
|
122
|
-
/* @__PURE__ */ React.createElement(
|
|
123
|
-
OnCallShiftItem,
|
|
96
|
+
return /* @__PURE__ */ jsx(ItemCardGrid, { "data-testid": "docs-explore", children: !onCallSchedules?.length ? null : onCallSchedules.map((schedule, index) => /* @__PURE__ */ jsxs(Card, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
CardHeader,
|
|
124
99
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
100
|
+
classes: { content: classes.cardHeader },
|
|
101
|
+
title: /* @__PURE__ */ jsx(
|
|
102
|
+
Link,
|
|
103
|
+
{
|
|
104
|
+
to: ilertApi.getScheduleDetailsURL(schedule),
|
|
105
|
+
className: classes.link,
|
|
106
|
+
children: schedule.name
|
|
107
|
+
}
|
|
108
|
+
)
|
|
128
109
|
}
|
|
129
110
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
111
|
+
/* @__PURE__ */ jsxs(CardContent, { className: classes.cardContent, children: [
|
|
112
|
+
/* @__PURE__ */ jsx("div", { className: classes.indicatorCurrent }),
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
OnCallShiftItem,
|
|
115
|
+
{
|
|
116
|
+
shift: schedule.currentShift,
|
|
117
|
+
scheduleId: schedule.id,
|
|
118
|
+
refetchOnCallSchedules
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx(Typography, { className: classes.beforeText, variant: "body2", children: "On call now" })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsxs(
|
|
124
|
+
CardContent,
|
|
125
|
+
{
|
|
126
|
+
className: `${classes.cardContent} ${classes.marginBottom}`,
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsx("div", { className: classes.indicatorNext }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
OnCallShiftItem,
|
|
131
|
+
{
|
|
132
|
+
shift: schedule.nextShift,
|
|
133
|
+
scheduleId: schedule.id,
|
|
134
|
+
refetchOnCallSchedules
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsx(Typography, { className: classes.beforeText, variant: "body2", children: "Next on call" })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] }, index)) });
|
|
132
142
|
};
|
|
133
143
|
|
|
134
144
|
export { OnCallSchedulesGrid };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnCallSchedulesGrid.esm.js","sources":["../../../src/components/OnCallSchedulesPage/OnCallSchedulesGrid.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"OnCallSchedulesGrid.esm.js","sources":["../../../src/components/OnCallSchedulesPage/OnCallSchedulesGrid.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { makeStyles } from '@material-ui/core/styles';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Typography from '@material-ui/core/Typography';\nimport { Schedule } from '../../types';\nimport { ilertApiRef } from '../../api';\nimport { OnCallShiftItem } from './OnCallShiftItem';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ItemCardGrid, Progress, Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles(() => ({\n card: {\n margin: 16,\n width: 'calc(100% - 32px)',\n },\n\n cardHeader: {\n maxWidth: '100%',\n },\n\n cardContent: {\n marginLeft: 80,\n borderLeft: '1px #808289 solid',\n position: 'relative',\n },\n\n indicatorNext: {\n position: 'absolute',\n top: 'calc(40% - 10px)',\n left: -6,\n width: 12,\n height: 12,\n background: '#92949c !important',\n borderRadius: '50%',\n },\n\n indicatorCurrent: {\n position: 'absolute',\n top: 'calc(40% - 10px)',\n left: -6,\n width: 12,\n height: 12,\n background: '#ffb74d !important',\n color: '#ffb74d !important',\n borderRadius: '50%',\n '&::after': {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n borderRadius: '50%',\n animation: '$ripple 1.2s infinite ease-in-out',\n border: '1px solid currentColor',\n content: '\"\"',\n },\n },\n '@keyframes ripple': {\n '0%': {\n transform: 'scale(.8)',\n opacity: 1,\n },\n '100%': {\n transform: 'scale(2.4)',\n opacity: 0,\n },\n },\n\n beforeText: {\n position: 'absolute',\n top: 'calc(31% - 10px)',\n left: -78,\n width: 65,\n height: 20,\n textAlign: 'center',\n color: '#808289',\n },\n\n marginBottom: {\n marginBottom: 16,\n },\n\n link: {\n fontSize: '1.5rem',\n fontWeight: 700,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n display: 'block',\n },\n}));\n\nexport const OnCallSchedulesGrid = ({\n onCallSchedules,\n isLoading,\n refetchOnCallSchedules,\n}: {\n onCallSchedules: Schedule[];\n isLoading: boolean;\n refetchOnCallSchedules: () => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const classes = useStyles();\n\n if (isLoading) {\n return <Progress />;\n }\n return (\n <ItemCardGrid data-testid=\"docs-explore\">\n {!onCallSchedules?.length\n ? null\n : onCallSchedules.map((schedule, index) => (\n <Card key={index}>\n <CardHeader\n classes={{ content: classes.cardHeader }}\n title={\n <Link\n to={ilertApi.getScheduleDetailsURL(schedule)}\n className={classes.link}\n >\n {schedule.name}\n </Link>\n }\n />\n\n <CardContent className={classes.cardContent}>\n <div className={classes.indicatorCurrent} />\n <OnCallShiftItem\n shift={schedule.currentShift}\n scheduleId={schedule.id}\n refetchOnCallSchedules={refetchOnCallSchedules}\n />\n <Typography className={classes.beforeText} variant=\"body2\">\n On call now\n </Typography>\n </CardContent>\n\n <CardContent\n className={`${classes.cardContent} ${classes.marginBottom}`}\n >\n <div className={classes.indicatorNext} />\n <OnCallShiftItem\n shift={schedule.nextShift}\n scheduleId={schedule.id}\n refetchOnCallSchedules={refetchOnCallSchedules}\n />\n <Typography className={classes.beforeText} variant=\"body2\">\n Next on call\n </Typography>\n </CardContent>\n </Card>\n ))}\n </ItemCardGrid>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,SAAA,GAAY,WAAW,OAAO;AAAA,EAClC,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,EAAA;AAAA,IACR,KAAO,EAAA;AAAA,GACT;AAAA,EAEA,UAAY,EAAA;AAAA,IACV,QAAU,EAAA;AAAA,GACZ;AAAA,EAEA,WAAa,EAAA;AAAA,IACX,UAAY,EAAA,EAAA;AAAA,IACZ,UAAY,EAAA,mBAAA;AAAA,IACZ,QAAU,EAAA;AAAA,GACZ;AAAA,EAEA,aAAe,EAAA;AAAA,IACb,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,kBAAA;AAAA,IACL,IAAM,EAAA,CAAA,CAAA;AAAA,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,QAAS,CAAA,YAAA;AAAA,UAChB,YAAY,QAAS,CAAA,EAAA;AAAA,UACrB;AAAA;AAAA,OACF;AAAA,0BACC,UAAW,EAAA,EAAA,SAAA,EAAW,QAAQ,UAAY,EAAA,OAAA,EAAQ,SAAQ,QAE3D,EAAA,aAAA,EAAA;AAAA,KACF,EAAA,CAAA;AAAA,oBAEA,IAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,WAAW,CAAG,EAAA,OAAA,CAAQ,WAAW,CAAA,CAAA,EAAI,QAAQ,YAAY,CAAA,CAAA;AAAA,QAEzD,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,aAAe,EAAA,CAAA;AAAA,0BACvC,GAAA;AAAA,YAAC,eAAA;AAAA,YAAA;AAAA,cACC,OAAO,QAAS,CAAA,SAAA;AAAA,cAChB,YAAY,QAAS,CAAA,EAAA;AAAA,cACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAW,EAAA,EAAA,SAAA,EAAW,QAAQ,UAAY,EAAA,OAAA,EAAQ,SAAQ,QAE3D,EAAA,cAAA,EAAA;AAAA;AAAA;AAAA;AACF,GArCS,EAAA,EAAA,KAsCX,CACD,CACP,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { AuthenticationError } from '@backstage/errors';
|
|
3
3
|
import { OnCallSchedulesGrid } from './OnCallSchedulesGrid.esm.js';
|
|
4
4
|
import { MissingAuthorizationHeaderError } from '../Errors/MissingAuthorizationHeaderError.esm.js';
|
|
@@ -9,18 +9,21 @@ const OnCallSchedulesPage = () => {
|
|
|
9
9
|
const [{ onCallSchedules, isLoading, error }, { refetchOnCallSchedules }] = useOnCallSchedules();
|
|
10
10
|
if (error) {
|
|
11
11
|
if (error instanceof AuthenticationError) {
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(MissingAuthorizationHeaderError, {}) });
|
|
13
13
|
}
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(ResponseErrorPanel, { error }) });
|
|
15
15
|
}
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
return /* @__PURE__ */ jsxs(Content, { children: [
|
|
17
|
+
/* @__PURE__ */ jsx(ContentHeader, { title: "Who is on call?", children: /* @__PURE__ */ jsx(SupportButton, { children: "This helps you to bring iLert into your developer portal." }) }),
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
OnCallSchedulesGrid,
|
|
20
|
+
{
|
|
21
|
+
onCallSchedules,
|
|
22
|
+
isLoading,
|
|
23
|
+
refetchOnCallSchedules
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export { OnCallSchedulesPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnCallSchedulesPage.esm.js","sources":["../../../src/components/OnCallSchedulesPage/OnCallSchedulesPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"OnCallSchedulesPage.esm.js","sources":["../../../src/components/OnCallSchedulesPage/OnCallSchedulesPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { AuthenticationError } from '@backstage/errors';\nimport { OnCallSchedulesGrid } from './OnCallSchedulesGrid';\nimport { MissingAuthorizationHeaderError } from '../Errors';\nimport { useOnCallSchedules } from '../../hooks/useOnCallSchedules';\nimport {\n Content,\n ContentHeader,\n SupportButton,\n ResponseErrorPanel,\n} from '@backstage/core-components';\n\nexport const OnCallSchedulesPage = () => {\n const [{ onCallSchedules, isLoading, error }, { refetchOnCallSchedules }] =\n useOnCallSchedules();\n\n if (error) {\n if (error instanceof AuthenticationError) {\n return (\n <Content>\n <MissingAuthorizationHeaderError />\n </Content>\n );\n }\n\n return (\n <Content>\n <ResponseErrorPanel error={error} />\n </Content>\n );\n }\n\n return (\n <Content>\n <ContentHeader title=\"Who is on call?\">\n <SupportButton>\n This helps you to bring iLert into your developer portal.\n </SupportButton>\n </ContentHeader>\n <OnCallSchedulesGrid\n onCallSchedules={onCallSchedules}\n isLoading={isLoading}\n refetchOnCallSchedules={refetchOnCallSchedules}\n />\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA0BO,MAAM,sBAAsB,MAAM;AACvC,EAAM,MAAA,CAAC,EAAE,eAAA,EAAiB,SAAW,EAAA,KAAA,IAAS,EAAE,sBAAA,EAAwB,CAAA,GACtE,kBAAmB,EAAA;AAErB,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,IAAI,iBAAiB,mBAAqB,EAAA;AACxC,MAAA,uBACG,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,+BAAA,EAAA,EAAgC,CACnC,EAAA,CAAA;AAAA;AAIJ,IAAA,uBACG,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,kBAAA,EAAA,EAAmB,OAAc,CACpC,EAAA,CAAA;AAAA;AAIJ,EAAA,4BACG,OACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAc,KAAM,EAAA,iBAAA,EACnB,QAAC,kBAAA,GAAA,CAAA,aAAA,EAAA,EAAc,uEAEf,CACF,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,eAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AAAA;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useApi } from '@backstage/core-plugin-api';
|
|
2
3
|
import Button from '@material-ui/core/Button';
|
|
3
4
|
import Grid from '@material-ui/core/Grid';
|
|
@@ -5,7 +6,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
5
6
|
import Typography from '@material-ui/core/Typography';
|
|
6
7
|
import RepeatIcon from '@material-ui/icons/Repeat';
|
|
7
8
|
import { DateTime } from 'luxon';
|
|
8
|
-
import
|
|
9
|
+
import { useState } from 'react';
|
|
9
10
|
import { ilertApiRef } from '../../api/client.esm.js';
|
|
10
11
|
import { ShiftOverrideModal } from '../Shift/ShiftOverrideModal.esm.js';
|
|
11
12
|
|
|
@@ -30,33 +31,40 @@ const OnCallShiftItem = ({
|
|
|
30
31
|
}) => {
|
|
31
32
|
const classes = useStyles();
|
|
32
33
|
const ilertApi = useApi(ilertApiRef);
|
|
33
|
-
const [isModalOpened, setIsModalOpened] =
|
|
34
|
+
const [isModalOpened, setIsModalOpened] = useState(false);
|
|
34
35
|
const handleOverride = () => {
|
|
35
36
|
setIsModalOpened(true);
|
|
36
37
|
};
|
|
37
38
|
if (!shift || !shift.start) {
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, spacing: 0, children: /* @__PURE__ */ jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", color: "textSecondary", children: "Nobody" }) }) });
|
|
39
40
|
}
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
41
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 0, children: [
|
|
42
|
+
shift && shift.user ? /* @__PURE__ */ jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", noWrap: true, children: ilertApi.getUserInitials(shift.user) }) }) : null,
|
|
43
|
+
/* @__PURE__ */ jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", color: "textSecondary", children: `${DateTime.fromISO(shift.start).toFormat("D MMM, HH:mm")} - ${DateTime.fromISO(shift.end).toFormat("D MMM, HH:mm")}` }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, sm: 12, children: [
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
Button,
|
|
47
|
+
{
|
|
48
|
+
color: "primary",
|
|
49
|
+
size: "small",
|
|
50
|
+
className: classes.button,
|
|
51
|
+
startIcon: /* @__PURE__ */ jsx(RepeatIcon, {}),
|
|
52
|
+
onClick: handleOverride,
|
|
53
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "overline", children: "Override shift" })
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
ShiftOverrideModal,
|
|
58
|
+
{
|
|
59
|
+
scheduleId,
|
|
60
|
+
shift,
|
|
61
|
+
refetchOnCallSchedules,
|
|
62
|
+
isModalOpened,
|
|
63
|
+
setIsModalOpened
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] })
|
|
67
|
+
] });
|
|
60
68
|
};
|
|
61
69
|
|
|
62
70
|
export { OnCallShiftItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnCallShiftItem.esm.js","sources":["../../../src/components/OnCallSchedulesPage/OnCallShiftItem.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApi } from '@backstage/core-plugin-api';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport RepeatIcon from '@material-ui/icons/Repeat';\nimport { DateTime as dt } from 'luxon';\nimport
|
|
1
|
+
{"version":3,"file":"OnCallShiftItem.esm.js","sources":["../../../src/components/OnCallSchedulesPage/OnCallShiftItem.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApi } from '@backstage/core-plugin-api';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport RepeatIcon from '@material-ui/icons/Repeat';\nimport { DateTime as dt } from 'luxon';\nimport { useState } from 'react';\nimport { ilertApiRef } from '../../api';\nimport { Shift } from '../../types';\nimport { ShiftOverrideModal } from '../Shift/ShiftOverrideModal';\n\nconst useStyles = makeStyles({\n button: {\n marginTop: 4,\n padding: 0,\n lineHeight: 1.8,\n '& span': {\n lineHeight: 1.8,\n fontSize: '0.65rem',\n },\n '& svg': {\n fontSize: '0.85rem !important',\n },\n },\n});\n\nexport const OnCallShiftItem = ({\n scheduleId,\n shift,\n refetchOnCallSchedules,\n}: {\n scheduleId: number;\n shift: Shift;\n refetchOnCallSchedules: () => void;\n}) => {\n const classes = useStyles();\n const ilertApi = useApi(ilertApiRef);\n const [isModalOpened, setIsModalOpened] = useState(false);\n\n const handleOverride = () => {\n setIsModalOpened(true);\n };\n\n if (!shift || !shift.start) {\n return (\n <Grid container spacing={0}>\n <Grid item sm={12}>\n <Typography variant=\"subtitle1\" color=\"textSecondary\">\n Nobody\n </Typography>\n </Grid>\n </Grid>\n );\n }\n\n return (\n <Grid container spacing={0}>\n {shift && shift.user ? (\n <Grid item sm={12}>\n <Typography variant=\"subtitle1\" noWrap>\n {ilertApi.getUserInitials(shift.user)}\n </Typography>\n </Grid>\n ) : null}\n <Grid item sm={12}>\n <Typography variant=\"subtitle2\" color=\"textSecondary\">\n {`${dt.fromISO(shift.start).toFormat('D MMM, HH:mm')} - ${dt\n .fromISO(shift.end)\n .toFormat('D MMM, HH:mm')}`}\n </Typography>\n </Grid>\n <Grid item sm={12}>\n <Button\n color=\"primary\"\n size=\"small\"\n className={classes.button}\n startIcon={<RepeatIcon />}\n onClick={handleOverride}\n >\n <Typography variant=\"overline\">Override shift</Typography>\n </Button>\n <ShiftOverrideModal\n scheduleId={scheduleId}\n shift={shift}\n refetchOnCallSchedules={refetchOnCallSchedules}\n isModalOpened={isModalOpened}\n setIsModalOpened={setIsModalOpened}\n />\n </Grid>\n </Grid>\n );\n};\n"],"names":["dt"],"mappings":";;;;;;;;;;;;AA2BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA,CAAA;AAAA,IACX,OAAS,EAAA,CAAA;AAAA,IACT,UAAY,EAAA,GAAA;AAAA,IACZ,QAAU,EAAA;AAAA,MACR,UAAY,EAAA,GAAA;AAAA,MACZ,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,OAAS,EAAA;AAAA,MACP,QAAU,EAAA;AAAA;AACZ;AAEJ,CAAC,CAAA;AAEM,MAAM,kBAAkB,CAAC;AAAA,EAC9B,UAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAIM,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,KAAK,CAAA;AAExD,EAAA,MAAM,iBAAiB,MAAM;AAC3B,IAAA,gBAAA,CAAiB,IAAI,CAAA;AAAA,GACvB;AAEA,EAAA,IAAI,CAAC,KAAA,IAAS,CAAC,KAAA,CAAM,KAAO,EAAA;AAC1B,IACE,uBAAA,GAAA,CAAC,QAAK,SAAS,EAAA,IAAA,EAAC,SAAS,CACvB,EAAA,QAAA,kBAAA,GAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAI,EACb,EAAA,QAAA,kBAAA,GAAA,CAAC,cAAW,OAAQ,EAAA,WAAA,EAAY,OAAM,eAAgB,EAAA,QAAA,EAAA,QAAA,EAEtD,GACF,CACF,EAAA,CAAA;AAAA;AAIJ,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA,EAAK,SAAS,EAAA,IA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AAAA,UACA,aAAA;AAAA,UACA;AAAA;AAAA;AACF,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,46 +1,50 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import IconButton from '@material-ui/core/IconButton';
|
|
2
3
|
import Menu from '@material-ui/core/Menu';
|
|
3
4
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
4
5
|
import Typography from '@material-ui/core/Typography';
|
|
5
6
|
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
|
6
|
-
import
|
|
7
|
+
import { useState } from 'react';
|
|
7
8
|
import { ilertApiRef } from '../../api/client.esm.js';
|
|
8
9
|
import { Link } from '@backstage/core-components';
|
|
9
10
|
import { useApi } from '@backstage/core-plugin-api';
|
|
10
11
|
|
|
11
12
|
const ServiceActionsMenu = ({ service }) => {
|
|
12
13
|
const ilertApi = useApi(ilertApiRef);
|
|
13
|
-
const [anchorEl, setAnchorEl] =
|
|
14
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
14
15
|
const handleClick = (event) => {
|
|
15
16
|
setAnchorEl(event.currentTarget);
|
|
16
17
|
};
|
|
17
18
|
const handleCloseMenu = () => {
|
|
18
19
|
setAnchorEl(null);
|
|
19
20
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
), /* @__PURE__ */ React.createElement(
|
|
31
|
-
Menu,
|
|
32
|
-
{
|
|
33
|
-
id: `service-actions-menu-${service.id}`,
|
|
34
|
-
anchorEl,
|
|
35
|
-
keepMounted: true,
|
|
36
|
-
open: Boolean(anchorEl),
|
|
37
|
-
onClose: handleCloseMenu,
|
|
38
|
-
PaperProps: {
|
|
39
|
-
style: { maxHeight: 48 * 5.5 }
|
|
21
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
IconButton,
|
|
24
|
+
{
|
|
25
|
+
"aria-label": "more",
|
|
26
|
+
"aria-controls": "long-menu",
|
|
27
|
+
"aria-haspopup": "true",
|
|
28
|
+
onClick: handleClick,
|
|
29
|
+
size: "small",
|
|
30
|
+
children: /* @__PURE__ */ jsx(MoreVertIcon, {})
|
|
40
31
|
}
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
Menu,
|
|
35
|
+
{
|
|
36
|
+
id: `service-actions-menu-${service.id}`,
|
|
37
|
+
anchorEl,
|
|
38
|
+
keepMounted: true,
|
|
39
|
+
open: Boolean(anchorEl),
|
|
40
|
+
onClose: handleCloseMenu,
|
|
41
|
+
PaperProps: {
|
|
42
|
+
style: { maxHeight: 48 * 5.5 }
|
|
43
|
+
},
|
|
44
|
+
children: /* @__PURE__ */ jsx(MenuItem, { onClick: handleCloseMenu, children: /* @__PURE__ */ jsx(Typography, { variant: "inherit", noWrap: true, children: /* @__PURE__ */ jsx(Link, { to: ilertApi.getServiceDetailsURL(service), children: "View in iLert" }) }) }, "details")
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
export { ServiceActionsMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceActionsMenu.esm.js","sources":["../../../src/components/Service/ServiceActionsMenu.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Typography from '@material-ui/core/Typography';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport
|
|
1
|
+
{"version":3,"file":"ServiceActionsMenu.esm.js","sources":["../../../src/components/Service/ServiceActionsMenu.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport IconButton from '@material-ui/core/IconButton';\nimport Menu from '@material-ui/core/Menu';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Typography from '@material-ui/core/Typography';\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\nimport type { MouseEvent } from 'react';\nimport { useState } from 'react';\nimport { ilertApiRef } from '../../api';\nimport { Service } from '../../types';\n\nimport { Link } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const ServiceActionsMenu = ({ service }: { service: Service }) => {\n const ilertApi = useApi(ilertApiRef);\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleCloseMenu = () => {\n setAnchorEl(null);\n };\n\n return (\n <>\n <IconButton\n aria-label=\"more\"\n aria-controls=\"long-menu\"\n aria-haspopup=\"true\"\n onClick={handleClick}\n size=\"small\"\n >\n <MoreVertIcon />\n </IconButton>\n <Menu\n id={`service-actions-menu-${service.id}`}\n anchorEl={anchorEl}\n keepMounted\n open={Boolean(anchorEl)}\n onClose={handleCloseMenu}\n PaperProps={{\n style: { maxHeight: 48 * 5.5 },\n }}\n >\n <MenuItem key=\"details\" onClick={handleCloseMenu}>\n <Typography variant=\"inherit\" noWrap>\n <Link to={ilertApi.getServiceDetailsURL(service)}>\n View in iLert\n </Link>\n </Typography>\n </MenuItem>\n </Menu>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA4BO,MAAM,kBAAqB,GAAA,CAAC,EAAE,OAAA,EAAoC,KAAA;AACvE,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAA6B,IAAI,CAAA;AAEjE,EAAM,MAAA,WAAA,GAAc,CAAC,KAAmC,KAAA;AACtD,IAAA,WAAA,CAAY,MAAM,aAAa,CAAA;AAAA,GACjC;AAEA,EAAA,MAAM,kBAAkB,MAAM;AAC5B,IAAA,WAAA,CAAY,IAAI,CAAA;AAAA,GAClB;AAEA,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,YAAW,EAAA,MAAA;AAAA,QACX,eAAc,EAAA,WAAA;AAAA,QACd,eAAc,EAAA,MAAA;AAAA,QACd,OAAS,EAAA,WAAA;AAAA,QACT,IAAK,EAAA,OAAA;AAAA,QAEL,8BAAC,YAAa,EAAA,EAAA;AAAA;AAAA,KAChB;AAAA,oBACA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,CAAwB,qBAAA,EAAA,OAAA,CAAQ,EAAE,CAAA,CAAA;AAAA,QACtC,QAAA;AAAA,QACA,WAAW,EAAA,IAAA;AAAA,QACX,IAAA,EAAM,QAAQ,QAAQ,CAAA;AAAA,QACtB,OAAS,EAAA,eAAA;AAAA,QACT,UAAY,EAAA;AAAA,UACV,KAAO,EAAA,EAAE,SAAW,EAAA,EAAA,GAAK,GAAI;AAAA,SAC/B;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,YAAuB,OAAS,EAAA,eAAA,EAC/B,8BAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,WAAU,MAAM,EAAA,IAAA,EAClC,8BAAC,IAAK,EAAA,EAAA,EAAA,EAAI,SAAS,oBAAqB,CAAA,OAAO,GAAG,QAElD,EAAA,eAAA,EAAA,CAAA,EACF,KALY,SAMd;AAAA;AAAA;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { ilertApiRef } from '../../api/client.esm.js';
|
|
3
3
|
import { Link } from '@backstage/core-components';
|
|
4
4
|
import { useApi } from '@backstage/core-plugin-api';
|
|
@@ -8,7 +8,10 @@ const ServiceLink = ({ service }) => {
|
|
|
8
8
|
if (!service) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsxs(Link, { to: ilertApi.getServiceDetailsURL(service), children: [
|
|
12
|
+
"#",
|
|
13
|
+
service.id
|
|
14
|
+
] });
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
export { ServiceLink };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceLink.esm.js","sources":["../../../src/components/Service/ServiceLink.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"ServiceLink.esm.js","sources":["../../../src/components/Service/ServiceLink.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ilertApiRef } from '../../api';\nimport { Service } from '../../types';\n\nimport { Link } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nexport const ServiceLink = ({ service }: { service: Service | null }) => {\n const ilertApi = useApi(ilertApiRef);\n\n if (!service) {\n return null;\n }\n\n return <Link to={ilertApi.getServiceDetailsURL(service)}>#{service.id}</Link>;\n};\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,WAAc,GAAA,CAAC,EAAE,OAAA,EAA2C,KAAA;AACvE,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAO,OAAA,IAAA;AAAA;AAGT,EAAA,4BAAQ,IAAK,EAAA,EAAA,EAAA,EAAI,QAAS,CAAA,oBAAA,CAAqB,OAAO,CAAG,EAAA,QAAA,EAAA;AAAA,IAAA,GAAA;AAAA,IAAE,OAAQ,CAAA;AAAA,GAAG,EAAA,CAAA;AACxE;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { Content, ResponseErrorPanel, ContentHeader, SupportButton } from '@backstage/core-components';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { useServices } from '../../hooks/useServices.esm.js';
|
|
4
4
|
import { MissingAuthorizationHeaderError } from '../Errors/MissingAuthorizationHeaderError.esm.js';
|
|
5
5
|
import { ServicesTable } from './ServicesTable.esm.js';
|
|
@@ -11,21 +11,24 @@ const ServicesPage = () => {
|
|
|
11
11
|
] = useServices(true);
|
|
12
12
|
if (error) {
|
|
13
13
|
if (error.name === "AuthenticationError") {
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(MissingAuthorizationHeaderError, {}) });
|
|
15
15
|
}
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(ResponseErrorPanel, { error }) });
|
|
17
17
|
}
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
return /* @__PURE__ */ jsxs(Content, { children: [
|
|
19
|
+
/* @__PURE__ */ jsx(ContentHeader, { title: "Services", children: /* @__PURE__ */ jsx(SupportButton, { children: "This helps you to bring iLert into your developer portal." }) }),
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
ServicesTable,
|
|
22
|
+
{
|
|
23
|
+
services,
|
|
24
|
+
tableState,
|
|
25
|
+
onChangePage,
|
|
26
|
+
onChangeRowsPerPage,
|
|
27
|
+
isLoading,
|
|
28
|
+
setIsLoading
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] });
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export { ServicesPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServicesPage.esm.js","sources":["../../../src/components/ServicesPage/ServicesPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Content,\n ContentHeader,\n ResponseErrorPanel,\n SupportButton,\n} from '@backstage/core-components';\nimport
|
|
1
|
+
{"version":3,"file":"ServicesPage.esm.js","sources":["../../../src/components/ServicesPage/ServicesPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Content,\n ContentHeader,\n ResponseErrorPanel,\n SupportButton,\n} from '@backstage/core-components';\nimport { useServices } from '../../hooks/useServices';\nimport { MissingAuthorizationHeaderError } from '../Errors';\nimport { ServicesTable } from './ServicesTable';\n\nexport const ServicesPage = () => {\n const [\n { tableState, services, isLoading, error },\n { onChangePage, onChangeRowsPerPage, setIsLoading },\n ] = useServices(true);\n\n if (error) {\n if (error.name === 'AuthenticationError') {\n return (\n <Content>\n <MissingAuthorizationHeaderError />\n </Content>\n );\n }\n\n return (\n <Content>\n <ResponseErrorPanel error={error} />\n </Content>\n );\n }\n\n return (\n <Content>\n <ContentHeader title=\"Services\">\n <SupportButton>\n This helps you to bring iLert into your developer portal.\n </SupportButton>\n </ContentHeader>\n <ServicesTable\n services={services}\n tableState={tableState}\n onChangePage={onChangePage}\n onChangeRowsPerPage={onChangeRowsPerPage}\n isLoading={isLoading}\n setIsLoading={setIsLoading}\n />\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;AAyBO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA;AAAA,IACJ,EAAE,UAAA,EAAY,QAAU,EAAA,SAAA,EAAW,KAAM,EAAA;AAAA,IACzC,EAAE,YAAc,EAAA,mBAAA,EAAqB,YAAa;AAAA,GACpD,GAAI,YAAY,IAAI,CAAA;AAEpB,EAAA,IAAI,KAAO,EAAA;AACT,IAAI,IAAA,KAAA,CAAM,SAAS,qBAAuB,EAAA;AACxC,MAAA,uBACG,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,+BAAA,EAAA,EAAgC,CACnC,EAAA,CAAA;AAAA;AAIJ,IAAA,uBACG,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,kBAAA,EAAA,EAAmB,OAAc,CACpC,EAAA,CAAA;AAAA;AAIJ,EAAA,4BACG,OACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAc,KAAM,EAAA,UAAA,EACnB,QAAC,kBAAA,GAAA,CAAA,aAAA,EAAA,EAAc,uEAEf,CACF,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,QAAA;AAAA,QACA,UAAA;AAAA,QACA,YAAA;AAAA,QACA,mBAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AAAA;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
|