@backstage-community/plugin-ilert 0.19.0 → 0.20.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.map +1 -1
- package/dist/api/client.esm.js.map +1 -1
- package/dist/components/Alert/AlertActionsMenu.esm.js.map +1 -1
- package/dist/components/Alert/AlertAssignModal.esm.js.map +1 -1
- package/dist/components/Alert/AlertLink.esm.js.map +1 -1
- package/dist/components/Alert/AlertNewModal.esm.js.map +1 -1
- package/dist/components/AlertSource/AlertSourceLink.esm.js.map +1 -1
- package/dist/components/AlertsPage/AlertsPage.esm.js.map +1 -1
- package/dist/components/AlertsPage/AlertsTable.esm.js.map +1 -1
- package/dist/components/AlertsPage/StatusChip.esm.js +1 -1
- package/dist/components/AlertsPage/StatusChip.esm.js.map +1 -1
- package/dist/components/AlertsPage/TableTitle.esm.js.map +1 -1
- package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCard.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardActionsHeader.esm.js +1 -1
- package/dist/components/ILertCard/ILertCardActionsHeader.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardEmptyState.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCall.esm.js +1 -1
- package/dist/components/ILertCard/ILertCardOnCall.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCallItem.esm.js.map +1 -1
- package/dist/components/ILertCard/index.esm.js +6 -1
- package/dist/components/ILertCard/index.esm.js.map +1 -1
- package/dist/components/ILertPage/ILertPage.esm.js +1 -1
- package/dist/components/ILertPage/ILertPage.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js.map +1 -1
- package/dist/components/Service/ServiceActionsMenu.esm.js.map +1 -1
- package/dist/components/Service/ServiceLink.esm.js.map +1 -1
- package/dist/components/ServicesPage/ServicesPage.esm.js.map +1 -1
- package/dist/components/ServicesPage/ServicesTable.esm.js.map +1 -1
- package/dist/components/ServicesPage/StatusChip.esm.js.map +1 -1
- package/dist/components/Shift/ShiftOverrideModal.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageActionsMenu.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageLink.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageURL.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusChip.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusPagesPage.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusPagesTable.esm.js.map +1 -1
- package/dist/components/StatusPagePage/VisibilityChip.esm.js.map +1 -1
- package/dist/components/index.esm.js +5 -1
- package/dist/components/index.esm.js.map +1 -1
- package/dist/constants.esm.js.map +1 -1
- package/dist/hooks/index.esm.js.map +1 -1
- package/dist/hooks/useAlertActions.esm.js.map +1 -1
- package/dist/hooks/useAlertSource.esm.js.map +1 -1
- package/dist/hooks/useAlertSourceOnCalls.esm.js.map +1 -1
- package/dist/hooks/useAlerts.esm.js.map +1 -1
- package/dist/hooks/useAssignAlert.esm.js.map +1 -1
- package/dist/hooks/useNewAlert.esm.js.map +1 -1
- package/dist/hooks/useOnCallSchedules.esm.js.map +1 -1
- package/dist/hooks/useServices.esm.js.map +1 -1
- package/dist/hooks/useShiftOverride.esm.js.map +1 -1
- package/dist/hooks/useStatusPages.esm.js.map +1 -1
- package/dist/plugin.esm.js +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/route-refs.esm.js.map +1 -1
- package/dist/types.esm.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCard.esm.js","sources":["../../../src/components/ILertCard/ILertCard.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 { Entity } from '@backstage/catalog-model';\nimport { ResponseErrorPanel } from '@backstage/core-components';\nimport { AuthenticationError } from '@backstage/errors';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useState } from 'react';\nimport { ILERT_INTEGRATION_KEY_ANNOTATION } from '../../constants';\nimport { useILertEntity } from '../../hooks';\nimport { useAlerts } from '../../hooks/useAlerts';\nimport { useAlertSource } from '../../hooks/useAlertSource';\nimport { AlertNewModal } from '../Alert/AlertNewModal';\nimport { AlertsTable } from '../AlertsPage';\nimport { MissingAuthorizationHeaderError } from '../Errors';\nimport { ILertCardActionsHeader } from './ILertCardActionsHeader';\nimport { ILertCardEmptyState } from './ILertCardEmptyState';\nimport { ILertCardHeaderStatus } from './ILertCardHeaderStatus';\nimport { ILertCardMaintenanceModal } from './ILertCardMaintenanceModal';\nimport { ILertCardOnCall } from './ILertCardOnCall';\n\n/** @public */\nexport const isPluginApplicableToEntity = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[ILERT_INTEGRATION_KEY_ANNOTATION]);\n\nconst useStyles = makeStyles({\n content: {\n paddingLeft: '0 !important',\n paddingRight: '0 !important',\n paddingBottom: '0 !important',\n paddingTop: '0 !important',\n '& div div': {\n boxShadow: 'none !important',\n },\n },\n});\n\n/** @public */\nexport const ILertCard = () => {\n const classes = useStyles();\n const { integrationKey, name } = useILertEntity();\n const [{ alertSource }, { setAlertSource, refetchAlertSource }] =\n useAlertSource(integrationKey);\n const [\n { tableState, states, alerts, alertsCount, isLoading, error },\n {\n onAlertStatesChange,\n onChangePage,\n onChangeRowsPerPage,\n onAlertChanged,\n refetchAlerts,\n setIsLoading,\n },\n ] = useAlerts(false, true, alertSource);\n\n const [isNewAlertModalOpened, setIsNewAlertModalOpened] = useState(false);\n const [isMaintenanceModalOpened, setIsMaintenanceModalOpened] =\n useState(false);\n\n if (error) {\n if (error instanceof AuthenticationError) {\n return <MissingAuthorizationHeaderError />;\n }\n\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!integrationKey) {\n return <ILertCardEmptyState />;\n }\n\n return (\n <>\n <Card data-testid=\"ilert-card\">\n <CardHeader\n title=\"iLert\"\n subheader={\n <ILertCardActionsHeader\n alertSource={alertSource}\n setAlertSource={setAlertSource}\n setIsNewAlertModalOpened={setIsNewAlertModalOpened}\n setIsMaintenanceModalOpened={setIsMaintenanceModalOpened}\n />\n }\n action={<ILertCardHeaderStatus alertSource={alertSource} />}\n />\n <Divider />\n <CardContent className={classes.content}>\n <ILertCardOnCall alertSource={alertSource} />\n <AlertsTable\n alerts={alerts}\n alertsCount={alertsCount}\n tableState={tableState}\n states={states}\n onAlertChanged={onAlertChanged}\n onAlertStatesChange={onAlertStatesChange}\n onChangePage={onChangePage}\n onChangeRowsPerPage={onChangeRowsPerPage}\n isLoading={isLoading}\n setIsLoading={setIsLoading}\n compact\n />\n </CardContent>\n </Card>\n <AlertNewModal\n isModalOpened={isNewAlertModalOpened}\n setIsModalOpened={setIsNewAlertModalOpened}\n refetchAlerts={refetchAlerts}\n initialAlertSource={alertSource}\n entityName={name}\n />\n <ILertCardMaintenanceModal\n alertSource={alertSource}\n refetchAlertSource={refetchAlertSource}\n isModalOpened={isMaintenanceModalOpened}\n setIsModalOpened={setIsMaintenanceModalOpened}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ILertCard.esm.js","sources":["../../../src/components/ILertCard/ILertCard.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 { Entity } from '@backstage/catalog-model';\nimport { ResponseErrorPanel } from '@backstage/core-components';\nimport { AuthenticationError } from '@backstage/errors';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useState } from 'react';\nimport { ILERT_INTEGRATION_KEY_ANNOTATION } from '../../constants';\nimport { useILertEntity } from '../../hooks';\nimport { useAlerts } from '../../hooks/useAlerts';\nimport { useAlertSource } from '../../hooks/useAlertSource';\nimport { AlertNewModal } from '../Alert/AlertNewModal';\nimport { AlertsTable } from '../AlertsPage';\nimport { MissingAuthorizationHeaderError } from '../Errors';\nimport { ILertCardActionsHeader } from './ILertCardActionsHeader';\nimport { ILertCardEmptyState } from './ILertCardEmptyState';\nimport { ILertCardHeaderStatus } from './ILertCardHeaderStatus';\nimport { ILertCardMaintenanceModal } from './ILertCardMaintenanceModal';\nimport { ILertCardOnCall } from './ILertCardOnCall';\n\n/** @public */\nexport const isPluginApplicableToEntity = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[ILERT_INTEGRATION_KEY_ANNOTATION]);\n\nconst useStyles = makeStyles({\n content: {\n paddingLeft: '0 !important',\n paddingRight: '0 !important',\n paddingBottom: '0 !important',\n paddingTop: '0 !important',\n '& div div': {\n boxShadow: 'none !important',\n },\n },\n});\n\n/** @public */\nexport const ILertCard = () => {\n const classes = useStyles();\n const { integrationKey, name } = useILertEntity();\n const [{ alertSource }, { setAlertSource, refetchAlertSource }] =\n useAlertSource(integrationKey);\n const [\n { tableState, states, alerts, alertsCount, isLoading, error },\n {\n onAlertStatesChange,\n onChangePage,\n onChangeRowsPerPage,\n onAlertChanged,\n refetchAlerts,\n setIsLoading,\n },\n ] = useAlerts(false, true, alertSource);\n\n const [isNewAlertModalOpened, setIsNewAlertModalOpened] = useState(false);\n const [isMaintenanceModalOpened, setIsMaintenanceModalOpened] =\n useState(false);\n\n if (error) {\n if (error instanceof AuthenticationError) {\n return <MissingAuthorizationHeaderError />;\n }\n\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!integrationKey) {\n return <ILertCardEmptyState />;\n }\n\n return (\n <>\n <Card data-testid=\"ilert-card\">\n <CardHeader\n title=\"iLert\"\n subheader={\n <ILertCardActionsHeader\n alertSource={alertSource}\n setAlertSource={setAlertSource}\n setIsNewAlertModalOpened={setIsNewAlertModalOpened}\n setIsMaintenanceModalOpened={setIsMaintenanceModalOpened}\n />\n }\n action={<ILertCardHeaderStatus alertSource={alertSource} />}\n />\n <Divider />\n <CardContent className={classes.content}>\n <ILertCardOnCall alertSource={alertSource} />\n <AlertsTable\n alerts={alerts}\n alertsCount={alertsCount}\n tableState={tableState}\n states={states}\n onAlertChanged={onAlertChanged}\n onAlertStatesChange={onAlertStatesChange}\n onChangePage={onChangePage}\n onChangeRowsPerPage={onChangeRowsPerPage}\n isLoading={isLoading}\n setIsLoading={setIsLoading}\n compact\n />\n </CardContent>\n </Card>\n <AlertNewModal\n isModalOpened={isNewAlertModalOpened}\n setIsModalOpened={setIsNewAlertModalOpened}\n refetchAlerts={refetchAlerts}\n initialAlertSource={alertSource}\n entityName={name}\n />\n <ILertCardMaintenanceModal\n alertSource={alertSource}\n refetchAlertSource={refetchAlertSource}\n isModalOpened={isMaintenanceModalOpened}\n setIsModalOpened={setIsMaintenanceModalOpened}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsCO,MAAM,0BAAA,GAA6B,CAAC,MAAA,KACzC,OAAA,CAAQ,OAAO,QAAA,CAAS,WAAA,GAAc,gCAAgC,CAAC;AAEzE,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,OAAA,EAAS;AAAA,IACP,WAAA,EAAa,cAAA;AAAA,IACb,YAAA,EAAc,cAAA;AAAA,IACd,aAAA,EAAe,cAAA;AAAA,IACf,UAAA,EAAY,cAAA;AAAA,IACZ,WAAA,EAAa;AAAA,MACX,SAAA,EAAW;AAAA;AACb;AAEJ,CAAC,CAAA;AAGM,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,EAAE,cAAA,EAAgB,IAAA,EAAK,GAAI,cAAA,EAAe;AAChD,EAAA,MAAM,CAAC,EAAE,WAAA,EAAY,EAAG,EAAE,gBAAgB,kBAAA,EAAoB,CAAA,GAC5D,cAAA,CAAe,cAAc,CAAA;AAC/B,EAAA,MAAM;AAAA,IACJ,EAAE,UAAA,EAAY,MAAA,EAAQ,MAAA,EAAQ,WAAA,EAAa,WAAW,KAAA,EAAM;AAAA,IAC5D;AAAA,MACE,mBAAA;AAAA,MACA,YAAA;AAAA,MACA,mBAAA;AAAA,MACA,cAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA;AACF,GACF,GAAI,SAAA,CAAU,KAAA,EAAO,IAAA,EAAM,WAAW,CAAA;AAEtC,EAAA,MAAM,CAAC,qBAAA,EAAuB,wBAAwB,CAAA,GAAI,SAAS,KAAK,CAAA;AACxE,EAAA,MAAM,CAAC,wBAAA,EAA0B,2BAA2B,CAAA,GAC1D,SAAS,KAA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,oBACA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAe,qBAAA;AAAA,QACf,gBAAA,EAAkB,wBAAA;AAAA,QAClB,aAAA;AAAA,QACA,kBAAA,EAAoB,WAAA;AAAA,QACpB,UAAA,EAAY;AAAA;AAAA,KACd;AAAA,oBACA,GAAA;AAAA,MAAC,yBAAA;AAAA,MAAA;AAAA,QACC,WAAA;AAAA,QACA,kBAAA;AAAA,QACA,aAAA,EAAe,wBAAA;AAAA,QACf,gBAAA,EAAkB;AAAA;AAAA;AACpB,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
import Dialog from '@material-ui/core/Dialog';
|
|
4
4
|
import DialogActions from '@material-ui/core/DialogActions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardActionsHeader.esm.js","sources":["../../../src/components/ILertCard/ILertCardActionsHeader.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 Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Typography from '@material-ui/core/Typography';\nimport AlarmAddIcon from '@material-ui/icons/AlarmAdd';\nimport BuildIcon from '@material-ui/icons/Build';\nimport PauseIcon from '@material-ui/icons/Pause';\nimport PlayArrowIcon from '@material-ui/icons/PlayArrow';\nimport WebIcon from '@material-ui/icons/Web';\nimport Alert from '@material-ui/lab/Alert';\nimport { useState } from 'react';\nimport { ilertApiRef } from '../../api';\nimport { AlertSource } from '../../types';\n\nimport {\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { toastApiRef } from '@backstage/frontend-plugin-api';\n\nexport const ILertCardActionsHeader = ({\n alertSource,\n setAlertSource,\n setIsNewAlertModalOpened,\n setIsMaintenanceModalOpened,\n}: {\n alertSource: AlertSource | null;\n setAlertSource: (alertSource: AlertSource) => void;\n setIsNewAlertModalOpened: (isOpen: boolean) => void;\n setIsMaintenanceModalOpened: (isOpen: boolean) => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const alertApi = useApi(toastApiRef);\n const [isLoading, setIsLoading] = useState(false);\n const [isDisableModalOpened, setIsDisableModalOpened] = useState(false);\n\n const handleCreateNewAlert = () => {\n setIsNewAlertModalOpened(true);\n };\n\n const handleEnableAlertSource = async () => {\n try {\n if (!alertSource) {\n return;\n }\n setIsLoading(true);\n const newAlertSource = await ilertApi.enableAlertSource(alertSource);\n alertApi.post({ title: 'Alert source enabled.' });\n setIsLoading(false);\n setAlertSource(newAlertSource);\n } catch (err) {\n setIsLoading(false);\n alertApi.post({ title: err, status: 'danger' });\n }\n };\n const handleDisableAlertSource = async () => {\n try {\n if (!alertSource) {\n return;\n }\n setIsDisableModalOpened(false);\n setIsLoading(true);\n const newAlertSource = await ilertApi.disableAlertSource(alertSource);\n alertApi.post({ title: 'Alert source disabled.' });\n setIsLoading(false);\n setAlertSource(newAlertSource);\n } catch (err) {\n setIsLoading(false);\n alertApi.post({ title: err, status: 'danger' });\n }\n };\n\n const handleDisableAlertSourceWarningOpen = () => {\n setIsDisableModalOpened(true);\n };\n\n const handleDisableAlertSourceWarningClose = () => {\n setIsDisableModalOpened(false);\n };\n\n const handleMaintenanceAlertSource = () => {\n setIsMaintenanceModalOpened(true);\n };\n\n const alertSourceLink: IconLinkVerticalProps = {\n label: 'Alert Source',\n href: ilertApi.getAlertSourceDetailsURL(alertSource),\n icon: <WebIcon />,\n };\n\n const createAlertLink: IconLinkVerticalProps = {\n label: 'Create Alert',\n onClick: handleCreateNewAlert,\n icon: <AlarmAddIcon />,\n color: 'secondary',\n disabled:\n !alertSource ||\n alertSource.status === 'DISABLED' ||\n alertSource.status === 'IN_MAINTENANCE',\n };\n\n const enableAlertSourceLink: IconLinkVerticalProps = {\n label: 'Enable',\n onClick: handleEnableAlertSource,\n icon: <PlayArrowIcon />,\n disabled: !alertSource || isLoading,\n };\n\n const disableAlertSourceLink: IconLinkVerticalProps = {\n label: 'Disable',\n onClick: handleDisableAlertSourceWarningOpen,\n icon: <PauseIcon />,\n disabled: !alertSource || isLoading,\n };\n\n const maintenanceAlertSourceLink: IconLinkVerticalProps = {\n label: 'Immediate maintenance',\n onClick: handleMaintenanceAlertSource,\n icon: <BuildIcon />,\n disabled: !alertSource || isLoading,\n };\n\n const links: IconLinkVerticalProps[] = [\n alertSourceLink,\n createAlertLink,\n alertSource && alertSource.active\n ? disableAlertSourceLink\n : enableAlertSourceLink,\n ];\n\n if (alertSource && alertSource.status !== 'IN_MAINTENANCE') {\n links.push(maintenanceAlertSourceLink);\n }\n\n return (\n <>\n <HeaderIconLinkRow links={links} />\n <Dialog\n open={isDisableModalOpened}\n onClose={handleDisableAlertSourceWarningClose}\n aria-labelledby=\"alert-source-disable-form-title\"\n >\n <DialogTitle id=\"alert-source-disable-form-title\">\n Disable alert source\n </DialogTitle>\n <DialogContent>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n Do you really want to disable this alert source? A disabled alert\n source cannot create new alerts.\n </Typography>\n </Alert>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={handleDisableAlertSource}\n color=\"secondary\"\n variant=\"contained\"\n >\n Disable\n </Button>\n <Button\n onClick={handleDisableAlertSourceWarningClose}\n color=\"primary\"\n >\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAsCO,MAAM,yBAAyB,CAAC;AAAA,EACrC,WAAA;AAAA,EACA,cAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,
|
|
1
|
+
{"version":3,"file":"ILertCardActionsHeader.esm.js","sources":["../../../src/components/ILertCard/ILertCardActionsHeader.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 Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Typography from '@material-ui/core/Typography';\nimport AlarmAddIcon from '@material-ui/icons/AlarmAdd';\nimport BuildIcon from '@material-ui/icons/Build';\nimport PauseIcon from '@material-ui/icons/Pause';\nimport PlayArrowIcon from '@material-ui/icons/PlayArrow';\nimport WebIcon from '@material-ui/icons/Web';\nimport Alert from '@material-ui/lab/Alert';\nimport { useState } from 'react';\nimport { ilertApiRef } from '../../api';\nimport { AlertSource } from '../../types';\n\nimport {\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { toastApiRef } from '@backstage/frontend-plugin-api';\n\nexport const ILertCardActionsHeader = ({\n alertSource,\n setAlertSource,\n setIsNewAlertModalOpened,\n setIsMaintenanceModalOpened,\n}: {\n alertSource: AlertSource | null;\n setAlertSource: (alertSource: AlertSource) => void;\n setIsNewAlertModalOpened: (isOpen: boolean) => void;\n setIsMaintenanceModalOpened: (isOpen: boolean) => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const alertApi = useApi(toastApiRef);\n const [isLoading, setIsLoading] = useState(false);\n const [isDisableModalOpened, setIsDisableModalOpened] = useState(false);\n\n const handleCreateNewAlert = () => {\n setIsNewAlertModalOpened(true);\n };\n\n const handleEnableAlertSource = async () => {\n try {\n if (!alertSource) {\n return;\n }\n setIsLoading(true);\n const newAlertSource = await ilertApi.enableAlertSource(alertSource);\n alertApi.post({ title: 'Alert source enabled.' });\n setIsLoading(false);\n setAlertSource(newAlertSource);\n } catch (err) {\n setIsLoading(false);\n alertApi.post({ title: err, status: 'danger' });\n }\n };\n const handleDisableAlertSource = async () => {\n try {\n if (!alertSource) {\n return;\n }\n setIsDisableModalOpened(false);\n setIsLoading(true);\n const newAlertSource = await ilertApi.disableAlertSource(alertSource);\n alertApi.post({ title: 'Alert source disabled.' });\n setIsLoading(false);\n setAlertSource(newAlertSource);\n } catch (err) {\n setIsLoading(false);\n alertApi.post({ title: err, status: 'danger' });\n }\n };\n\n const handleDisableAlertSourceWarningOpen = () => {\n setIsDisableModalOpened(true);\n };\n\n const handleDisableAlertSourceWarningClose = () => {\n setIsDisableModalOpened(false);\n };\n\n const handleMaintenanceAlertSource = () => {\n setIsMaintenanceModalOpened(true);\n };\n\n const alertSourceLink: IconLinkVerticalProps = {\n label: 'Alert Source',\n href: ilertApi.getAlertSourceDetailsURL(alertSource),\n icon: <WebIcon />,\n };\n\n const createAlertLink: IconLinkVerticalProps = {\n label: 'Create Alert',\n onClick: handleCreateNewAlert,\n icon: <AlarmAddIcon />,\n color: 'secondary',\n disabled:\n !alertSource ||\n alertSource.status === 'DISABLED' ||\n alertSource.status === 'IN_MAINTENANCE',\n };\n\n const enableAlertSourceLink: IconLinkVerticalProps = {\n label: 'Enable',\n onClick: handleEnableAlertSource,\n icon: <PlayArrowIcon />,\n disabled: !alertSource || isLoading,\n };\n\n const disableAlertSourceLink: IconLinkVerticalProps = {\n label: 'Disable',\n onClick: handleDisableAlertSourceWarningOpen,\n icon: <PauseIcon />,\n disabled: !alertSource || isLoading,\n };\n\n const maintenanceAlertSourceLink: IconLinkVerticalProps = {\n label: 'Immediate maintenance',\n onClick: handleMaintenanceAlertSource,\n icon: <BuildIcon />,\n disabled: !alertSource || isLoading,\n };\n\n const links: IconLinkVerticalProps[] = [\n alertSourceLink,\n createAlertLink,\n alertSource && alertSource.active\n ? disableAlertSourceLink\n : enableAlertSourceLink,\n ];\n\n if (alertSource && alertSource.status !== 'IN_MAINTENANCE') {\n links.push(maintenanceAlertSourceLink);\n }\n\n return (\n <>\n <HeaderIconLinkRow links={links} />\n <Dialog\n open={isDisableModalOpened}\n onClose={handleDisableAlertSourceWarningClose}\n aria-labelledby=\"alert-source-disable-form-title\"\n >\n <DialogTitle id=\"alert-source-disable-form-title\">\n Disable alert source\n </DialogTitle>\n <DialogContent>\n <Alert severity=\"info\">\n <Typography variant=\"body1\" align=\"justify\">\n Do you really want to disable this alert source? A disabled alert\n source cannot create new alerts.\n </Typography>\n </Alert>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={handleDisableAlertSource}\n color=\"secondary\"\n variant=\"contained\"\n >\n Disable\n </Button>\n <Button\n onClick={handleDisableAlertSourceWarningClose}\n color=\"primary\"\n >\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAsCO,MAAM,yBAAyB,CAAC;AAAA,EACrC,WAAA;AAAA,EACA,cAAA;AAAA,EACA,wBAAA;AAAA,EACA;AACF,CAAA,KAKM;AACJ,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAA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AAAA,gBACT,QAAA,EAAA;AAAA;AAAA,aAED;AAAA,4BACA,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,oCAAA;AAAA,gBACT,KAAA,EAAM,SAAA;AAAA,gBACP,QAAA,EAAA;AAAA;AAAA;AAED,WAAA,EACF;AAAA;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardEmptyState.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Button from '@material-ui/core/Button';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: example\n description: example.com\n annotations:\n ilert.com/integration-key: [INTEGRATION_KEY]\nspec:\n type: website\n lifecycle: production\n owner: guest`;\n\nconst useStyles = makeStyles(theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n header: {\n display: 'inline-block',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n}));\n\nexport const ILertCardEmptyState = () => {\n const classes = useStyles();\n\n return (\n <Card data-testid=\"ilert-empty-card\">\n <CardHeader title=\"iLert\" className={classes.header} />\n <Divider />\n <CardContent>\n <Typography variant=\"body1\">\n No integration key defined for this entity. You can add integration\n key to your entity YAML as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[6, 7]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/backstage/backstage/blob/master/plugins/ilert/README.md\"\n >\n Read more\n </Button>\n </CardContent>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,
|
|
1
|
+
{"version":3,"file":"ILertCardEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardEmptyState.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Button from '@material-ui/core/Button';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: example\n description: example.com\n annotations:\n ilert.com/integration-key: [INTEGRATION_KEY]\nspec:\n type: website\n lifecycle: production\n owner: guest`;\n\nconst useStyles = makeStyles(theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n header: {\n display: 'inline-block',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n}));\n\nexport const ILertCardEmptyState = () => {\n const classes = useStyles();\n\n return (\n <Card data-testid=\"ilert-empty-card\">\n <CardHeader title=\"iLert\" className={classes.header} />\n <Divider />\n <CardContent>\n <Typography variant=\"body1\">\n No integration key defined for this entity. You can add integration\n key to your entity YAML as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[6, 7]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/backstage/backstage/blob/master/plugins/ilert/README.md\"\n >\n Read more\n </Button>\n </CardContent>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,MAAM,WAAA,GAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,CAAA;AAYpB,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,IAAA,EAAM;AAAA,IACJ,YAAA,EAAc,CAAA;AAAA,IACd,MAAA,EAAQ,KAAA,CAAM,OAAA,CAAQ,CAAA,EAAG,CAAC,CAAA;AAAA,IAC1B,UAAA,EACE,MAAM,OAAA,CAAQ,IAAA,KAAS,SAAS,MAAA,GAAS,KAAA,CAAM,QAAQ,MAAA,CAAO;AAAA,GAClE;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,cAAA;AAAA,IACT,SAAS,KAAA,CAAM,OAAA,CAAQ,CAAA,EAAG,CAAA,EAAG,GAAG,GAAG;AAAA;AAEvC,CAAA,CAAE,CAAA;AAEK,MAAM,sBAAsB,MAAM;AACvC,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,aAAA,EAAY,kBAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAM,OAAA,EAAQ,SAAA,EAAW,QAAQ,MAAA,EAAQ,CAAA;AAAA,wBACpD,OAAA,EAAA,EAAQ,CAAA;AAAA,yBACR,WAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EAAQ,QAAA,EAAA,wIAAA,EAG5B,CAAA;AAAA,sBACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,IAAA,EACtB,QAAA,kBAAA,GAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAM,WAAA;AAAA,UACN,QAAA,EAAS,MAAA;AAAA,UACT,eAAA,EAAe,IAAA;AAAA,UACf,kBAAA,EAAoB,CAAC,CAAA,EAAG,CAAC,CAAA;AAAA,UACzB,WAAA,EAAa,EAAE,UAAA,EAAY,SAAA,EAAW,UAAU,MAAA;AAAO;AAAA,OACzD,EACF,CAAA;AAAA,sBACA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,WAAA;AAAA,UACR,KAAA,EAAM,SAAA;AAAA,UACN,MAAA,EAAO,QAAA;AAAA,UACP,IAAA,EAAK,4EAAA;AAAA,UACN,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardHeaderStatus.esm.js","sources":["../../../src/components/ILertCard/ILertCardHeaderStatus.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Chip from '@material-ui/core/Chip';\nimport { withStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\n\nconst MaintenanceChip = withStyles(theme => ({\n root: {\n backgroundColor: '#92949c',\n color: theme.palette.common.white,\n marginTop: 8,\n },\n}))(Chip);\n\nexport const ILertCardHeaderStatus = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n if (!alertSource) {\n return null;\n }\n\n switch (alertSource.status) {\n case 'IN_MAINTENANCE':\n return <MaintenanceChip label=\"MAINTENANCE\" size=\"small\" />;\n case 'DISABLED':\n return <MaintenanceChip label=\"INACTIVE\" size=\"small\" />;\n default:\n return null;\n }\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,eAAA,GAAkB,WAAW,
|
|
1
|
+
{"version":3,"file":"ILertCardHeaderStatus.esm.js","sources":["../../../src/components/ILertCard/ILertCardHeaderStatus.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Chip from '@material-ui/core/Chip';\nimport { withStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\n\nconst MaintenanceChip = withStyles(theme => ({\n root: {\n backgroundColor: '#92949c',\n color: theme.palette.common.white,\n marginTop: 8,\n },\n}))(Chip);\n\nexport const ILertCardHeaderStatus = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n if (!alertSource) {\n return null;\n }\n\n switch (alertSource.status) {\n case 'IN_MAINTENANCE':\n return <MaintenanceChip label=\"MAINTENANCE\" size=\"small\" />;\n case 'DISABLED':\n return <MaintenanceChip label=\"INACTIVE\" size=\"small\" />;\n default:\n return null;\n }\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,eAAA,GAAkB,WAAW,CAAA,KAAA,MAAU;AAAA,EAC3C,IAAA,EAAM;AAAA,IACJ,eAAA,EAAiB,SAAA;AAAA,IACjB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,KAAA;AAAA,IAC5B,SAAA,EAAW;AAAA;AAEf,CAAA,CAAE,EAAE,IAAI,CAAA;AAED,MAAM,wBAAwB,CAAC;AAAA,EACpC;AACF,CAAA,KAEM;AACJ,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,QAAQ,YAAY,MAAA;AAAQ,IAC1B,KAAK,gBAAA;AACH,MAAA,uBAAO,GAAA,CAAC,eAAA,EAAA,EAAgB,KAAA,EAAM,aAAA,EAAc,MAAK,OAAA,EAAQ,CAAA;AAAA,IAC3D,KAAK,UAAA;AACH,MAAA,uBAAO,GAAA,CAAC,eAAA,EAAA,EAAgB,KAAA,EAAM,UAAA,EAAW,MAAK,OAAA,EAAQ,CAAA;AAAA,IACxD;AACE,MAAA,OAAO,IAAA;AAAA;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardMaintenanceModal.esm.js","sources":["../../../src/components/ILertCard/ILertCardMaintenanceModal.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport { ilertApiRef } from '../../api';\nimport { AlertSource } from '../../types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { toastApiRef } from '@backstage/frontend-plugin-api';\n\nexport const ILertCardMaintenanceModal = ({\n alertSource,\n refetchAlertSource,\n isModalOpened,\n setIsModalOpened,\n}: {\n alertSource: AlertSource | null;\n refetchAlertSource: () => void;\n isModalOpened: boolean;\n setIsModalOpened: (isModalOpened: boolean) => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const alertApi = useApi(toastApiRef);\n const [minutes, setMinutes] = useState(5);\n\n const handleClose = () => {\n setIsModalOpened(false);\n };\n\n const handleImmediateMaintenance = () => {\n if (!alertSource) {\n return;\n }\n setIsModalOpened(false);\n setTimeout(async () => {\n try {\n await ilertApi.addImmediateMaintenance(alertSource.id, minutes);\n alertApi.post({ title: 'Maintenance started.' });\n refetchAlertSource();\n } catch (err) {\n alertApi.post({ title: err, status: 'danger' });\n }\n }, 250);\n };\n\n const handleMinutesChange = (event: any) => {\n setMinutes(event.target.value);\n };\n\n const minuteOptions = [\n {\n value: 5,\n label: '5 minutes',\n },\n {\n value: 10,\n label: '10 minutes',\n },\n {\n value: 15,\n label: '15 minutes',\n },\n {\n value: 30,\n label: '30 minutes',\n },\n {\n value: 60,\n label: '60 minutes',\n },\n ];\n\n if (!alertSource) {\n return null;\n }\n\n return (\n <Dialog\n open={isModalOpened}\n onClose={handleClose}\n aria-labelledby=\"maintenance-form-title\"\n >\n <DialogTitle id=\"maintenance-form-title\">\n New maintenance window\n </DialogTitle>\n <DialogContent>\n <DialogContentText>\n Keep your alert sources quiet, when your systems are under\n maintenance.\n </DialogContentText>\n <TextField\n select\n label=\"Duration\"\n value={minutes}\n onChange={handleMinutesChange}\n variant=\"outlined\"\n fullWidth\n >\n {minuteOptions.map(option => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </TextField>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={handleImmediateMaintenance}\n color=\"primary\"\n variant=\"contained\"\n >\n Create\n </Button>\n <Button onClick={handleClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA,kBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,
|
|
1
|
+
{"version":3,"file":"ILertCardMaintenanceModal.esm.js","sources":["../../../src/components/ILertCard/ILertCardMaintenanceModal.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport { ilertApiRef } from '../../api';\nimport { AlertSource } from '../../types';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { toastApiRef } from '@backstage/frontend-plugin-api';\n\nexport const ILertCardMaintenanceModal = ({\n alertSource,\n refetchAlertSource,\n isModalOpened,\n setIsModalOpened,\n}: {\n alertSource: AlertSource | null;\n refetchAlertSource: () => void;\n isModalOpened: boolean;\n setIsModalOpened: (isModalOpened: boolean) => void;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const alertApi = useApi(toastApiRef);\n const [minutes, setMinutes] = useState(5);\n\n const handleClose = () => {\n setIsModalOpened(false);\n };\n\n const handleImmediateMaintenance = () => {\n if (!alertSource) {\n return;\n }\n setIsModalOpened(false);\n setTimeout(async () => {\n try {\n await ilertApi.addImmediateMaintenance(alertSource.id, minutes);\n alertApi.post({ title: 'Maintenance started.' });\n refetchAlertSource();\n } catch (err) {\n alertApi.post({ title: err, status: 'danger' });\n }\n }, 250);\n };\n\n const handleMinutesChange = (event: any) => {\n setMinutes(event.target.value);\n };\n\n const minuteOptions = [\n {\n value: 5,\n label: '5 minutes',\n },\n {\n value: 10,\n label: '10 minutes',\n },\n {\n value: 15,\n label: '15 minutes',\n },\n {\n value: 30,\n label: '30 minutes',\n },\n {\n value: 60,\n label: '60 minutes',\n },\n ];\n\n if (!alertSource) {\n return null;\n }\n\n return (\n <Dialog\n open={isModalOpened}\n onClose={handleClose}\n aria-labelledby=\"maintenance-form-title\"\n >\n <DialogTitle id=\"maintenance-form-title\">\n New maintenance window\n </DialogTitle>\n <DialogContent>\n <DialogContentText>\n Keep your alert sources quiet, when your systems are under\n maintenance.\n </DialogContentText>\n <TextField\n select\n label=\"Duration\"\n value={minutes}\n onChange={handleMinutesChange}\n variant=\"outlined\"\n fullWidth\n >\n {minuteOptions.map(option => (\n <MenuItem key={option.value} value={option.value}>\n {option.label}\n </MenuItem>\n ))}\n </TextField>\n </DialogContent>\n <DialogActions>\n <Button\n onClick={handleImmediateMaintenance}\n color=\"primary\"\n variant=\"contained\"\n >\n Create\n </Button>\n <Button onClick={handleClose} color=\"primary\">\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BO,MAAM,4BAA4B,CAAC;AAAA,EACxC,WAAA;AAAA,EACA,kBAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAKM;AACJ,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,CAAC,CAAA;AAExC,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,gBAAA,CAAiB,KAAK,CAAA;AAAA,EACxB,CAAA;AAEA,EAAA,MAAM,6BAA6B,MAAM;AACvC,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA;AAAA,IACF;AACA,IAAA,gBAAA,CAAiB,KAAK,CAAA;AACtB,IAAA,UAAA,CAAW,YAAY;AACrB,MAAA,IAAI;AACF,QAAA,MAAM,QAAA,CAAS,uBAAA,CAAwB,WAAA,CAAY,EAAA,EAAI,OAAO,CAAA;AAC9D,QAAA,QAAA,CAAS,IAAA,CAAK,EAAE,KAAA,EAAO,sBAAA,EAAwB,CAAA;AAC/C,QAAA,kBAAA,EAAmB;AAAA,MACrB,SAAS,GAAA,EAAK;AACZ,QAAA,QAAA,CAAS,KAAK,EAAE,KAAA,EAAO,GAAA,EAAK,MAAA,EAAQ,UAAU,CAAA;AAAA,MAChD;AAAA,IACF,GAAG,GAAG,CAAA;AAAA,EACR,CAAA;AAEA,EAAA,MAAM,mBAAA,GAAsB,CAAC,KAAA,KAAe;AAC1C,IAAA,UAAA,CAAW,KAAA,CAAM,OAAO,KAAK,CAAA;AAAA,EAC/B,CAAA;AAEA,EAAA,MAAM,aAAA,GAAgB;AAAA,IACpB;AAAA,MACE,KAAA,EAAO,CAAA;AAAA,MACP,KAAA,E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aAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAS,0BAAA;AAAA,cACT,KAAA,EAAM,SAAA;AAAA,cACN,OAAA,EAAQ,WAAA;AAAA,cACT,QAAA,EAAA;AAAA;AAAA,WAED;AAAA,8BACC,MAAA,EAAA,EAAO,OAAA,EAAS,WAAA,EAAa,KAAA,EAAM,WAAU,QAAA,EAAA,QAAA,EAE9C;AAAA,SAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -24,7 +24,7 @@ const ILertCardOnCall = ({
|
|
|
24
24
|
alertSource
|
|
25
25
|
}) => {
|
|
26
26
|
const classes = useStyles();
|
|
27
|
-
const [{ onCalls, isLoading }
|
|
27
|
+
const [{ onCalls, isLoading }] = useAlertSourceOnCalls(alertSource);
|
|
28
28
|
if (isLoading) {
|
|
29
29
|
return /* @__PURE__ */ jsx(Progress, {});
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardOnCall.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCall.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListSubheader from '@material-ui/core/ListSubheader';\nimport Typography from '@material-ui/core/Typography';\nimport ReplayIcon from '@material-ui/icons/Replay';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\nimport { useAlertSourceOnCalls } from '../../hooks/useAlertSourceOnCalls';\nimport { ILertCardOnCallEmptyState } from './ILertCardOnCallEmptyState';\nimport { ILertCardOnCallItem } from './ILertCardOnCallItem';\nimport { Progress } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n repeatText: {\n fontStyle: 'italic',\n },\n repeatIcon: {\n marginLeft: theme.spacing(1),\n },\n}));\n\nexport const ILertCardOnCall = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n const classes = useStyles();\n const [{ onCalls, isLoading }, {}] = useAlertSourceOnCalls(alertSource);\n\n if (isLoading) {\n return <Progress />;\n }\n\n if (!alertSource || !onCalls) {\n return null;\n }\n\n const repeatInfo = () => {\n if (\n !alertSource ||\n !alertSource.escalationPolicy ||\n !alertSource.escalationPolicy.repeating ||\n !alertSource.escalationPolicy.frequency\n ) {\n return null;\n }\n\n return (\n <ListItem key=\"repeat\">\n <ListItemIcon>\n <ReplayIcon className={classes.repeatIcon} fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={classes.repeatText}\n >\n {`Repeat ${alertSource.escalationPolicy.frequency} times`}\n </Typography>\n }\n />\n </ListItem>\n );\n };\n\n if (!onCalls.length) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallEmptyState />\n </List>\n );\n }\n\n if (onCalls.length === 1) {\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallItem\n onCall={onCalls[0]}\n fistItem={false}\n lastItem={false}\n />\n </List>;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n {onCalls.map((onCall, index) => (\n <ILertCardOnCallItem\n key={index}\n onCall={onCall}\n fistItem={index === 0}\n lastItem={index === onCalls.length - 1}\n />\n ))}\n {repeatInfo()}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,
|
|
1
|
+
{"version":3,"file":"ILertCardOnCall.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCall.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListSubheader from '@material-ui/core/ListSubheader';\nimport Typography from '@material-ui/core/Typography';\nimport ReplayIcon from '@material-ui/icons/Replay';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { AlertSource } from '../../types';\nimport { useAlertSourceOnCalls } from '../../hooks/useAlertSourceOnCalls';\nimport { ILertCardOnCallEmptyState } from './ILertCardOnCallEmptyState';\nimport { ILertCardOnCallItem } from './ILertCardOnCallItem';\nimport { Progress } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n repeatText: {\n fontStyle: 'italic',\n },\n repeatIcon: {\n marginLeft: theme.spacing(1),\n },\n}));\n\nexport const ILertCardOnCall = ({\n alertSource,\n}: {\n alertSource: AlertSource | null;\n}) => {\n const classes = useStyles();\n const [{ onCalls, isLoading }, {}] = useAlertSourceOnCalls(alertSource);\n\n if (isLoading) {\n return <Progress />;\n }\n\n if (!alertSource || !onCalls) {\n return null;\n }\n\n const repeatInfo = () => {\n if (\n !alertSource ||\n !alertSource.escalationPolicy ||\n !alertSource.escalationPolicy.repeating ||\n !alertSource.escalationPolicy.frequency\n ) {\n return null;\n }\n\n return (\n <ListItem key=\"repeat\">\n <ListItemIcon>\n <ReplayIcon className={classes.repeatIcon} fontSize=\"small\" />\n </ListItemIcon>\n <ListItemText\n primary={\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={classes.repeatText}\n >\n {`Repeat ${alertSource.escalationPolicy.frequency} times`}\n </Typography>\n }\n />\n </ListItem>\n );\n };\n\n if (!onCalls.length) {\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallEmptyState />\n </List>\n );\n }\n\n if (onCalls.length === 1) {\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n <ILertCardOnCallItem\n onCall={onCalls[0]}\n fistItem={false}\n lastItem={false}\n />\n </List>;\n }\n\n return (\n <List dense subheader={<ListSubheader>ON CALL</ListSubheader>}>\n {onCalls.map((onCall, index) => (\n <ILertCardOnCallItem\n key={index}\n onCall={onCall}\n fistItem={index === 0}\n lastItem={index === onCalls.length - 1}\n />\n ))}\n {repeatInfo()}\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,UAAA,EAAY;AAAA,IACV,SAAA,EAAW;AAAA,GACb;AAAA,EACA,UAAA,EAAY;AAAA,IACV,UAAA,EAAY,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA;AAE/B,CAAA,CAAE,CAAA;AAEK,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AACF,CAAA,KAEM;AACJ,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,CAAC,EAAE,OAAA,EAAS,SAAA,EAAe,CAAA,GAAI,qBAAA,CAAsB,WAAW,CAAA;AAEtE,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,2BAAQ,QAAA,EAAA,EAAS,CAAA;AAAA,EACnB;AAEA,EAAA,IAAI,CAAC,WAAA,IAAe,CAAC,OAAA,EAAS;AAC5B,IAAA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,QAAA,kBAAA,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,MAAA,EAAQ,QAAQ,CAAC,CAAA;AAAA,QACjB,QAAA,EAAU,KAAA;AAAA,QACV,QAAA,EAAU;AAAA;AAAA,KACZ,EACF,CAAA;AAAA,EACF;AAEA,EAAA,uBACE,IAAA,CAAC,QAAK,KAAA,EAAK,IAAA,EAAC,2BAAW,GAAA,CAAC,aAAA,EAAA,EAAc,qBAAO,CAAA,EAC1C,QAAA,EAAA;AAAA,IAAA,OAAA,CAAQ,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,qBACpB,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QAEC,MAAA;AAAA,QACA,UAAU,KAAA,KAAU,CAAA;AAAA,QACpB,QAAA,EAAU,KAAA,KAAU,OAAA,CAAQ,MAAA,GAAS;AAAA,OAAA;AAAA,MAHhC;AAAA,KAKR,CAAA;AAAA,IACA,UAAA;AAAW,GAAA,EACd,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardOnCallEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallEmptyState.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Typography from '@material-ui/core/Typography';\n\nconst useStyles = makeStyles({\n text: {\n fontStyle: 'italic',\n },\n});\n\nexport const ILertCardOnCallEmptyState = () => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemText>\n <Typography\n variant=\"subtitle1\"\n color=\"textSecondary\"\n className={classes.text}\n >\n Nobody\n </Typography>\n </ListItemText>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ILertCardOnCallEmptyState.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallEmptyState.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Typography from '@material-ui/core/Typography';\n\nconst useStyles = makeStyles({\n text: {\n fontStyle: 'italic',\n },\n});\n\nexport const ILertCardOnCallEmptyState = () => {\n const classes = useStyles();\n\n return (\n <ListItem>\n <ListItemText>\n <Typography\n variant=\"subtitle1\"\n color=\"textSecondary\"\n className={classes.text}\n >\n Nobody\n </Typography>\n </ListItemText>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,SAAA,EAAW;AAAA;AAEf,CAAC,CAAA;AAEM,MAAM,4BAA4B,MAAM;AAC7C,EAAA,MAAM,UAAU,SAAA,EAAU;AAE1B,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,YAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,WAAA;AAAA,MACR,KAAA,EAAM,eAAA;AAAA,MACN,WAAW,OAAA,CAAQ,IAAA;AAAA,MACpB,QAAA,EAAA;AAAA;AAAA,KAGH,CAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILertCardOnCallItem.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallItem.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Divider from '@material-ui/core/Divider';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Avatar from '@material-ui/core/Avatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport EmailIcon from '@material-ui/icons/Email';\nimport PhoneIcon from '@material-ui/icons/Phone';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { OnCall } from '../../types';\nimport { ilertApiRef } from '../../api';\nimport { DateTime as dt } from 'luxon';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n listItemPrimary: {\n fontWeight: 'bold',\n },\n fistItemLine: {\n position: 'absolute',\n bottom: 0,\n height: '50%',\n left: 36,\n },\n lastItemLine: {\n position: 'absolute',\n top: 0,\n height: '50%',\n left: 36,\n },\n itemLine: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n height: '100%',\n left: 36,\n },\n});\n\nexport const ILertCardOnCallItem = ({\n onCall,\n fistItem = false,\n lastItem = false,\n}: {\n onCall: OnCall;\n fistItem?: boolean;\n lastItem?: boolean;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const classes = useStyles();\n\n if (!onCall || !onCall.user) {\n return null;\n }\n\n const phoneNumber = ilertApi.getUserPhoneNumber(onCall.user);\n const escalationRepeating = onCall.escalationPolicy.repeating;\n const escalationSeconds =\n onCall.escalationPolicy.escalationRules[onCall.escalationLevel - 1]\n .escalationTimeout;\n const escalationHoursOnly = Math.floor(escalationSeconds / 60);\n const escalationMinutesOnly = escalationSeconds % 60;\n\n let escalationText = '';\n if (!lastItem || (lastItem && escalationRepeating)) {\n escalationText = 'escalate';\n if (escalationSeconds === 0) {\n escalationText += ' immediately';\n } else {\n escalationText += ' after';\n if (escalationHoursOnly > 0) {\n escalationText += ` ${escalationHoursOnly} ${\n escalationHoursOnly === 1 ? 'hour' : 'hours'\n }`;\n }\n if (escalationMinutesOnly > 0 || escalationSeconds === 0) {\n escalationText += ` ${escalationMinutesOnly} ${\n escalationMinutesOnly === 1 ? 'minute' : 'minutes'\n }`;\n }\n }\n }\n\n return (\n <ListItem>\n {fistItem ? (\n <Divider orientation=\"vertical\" className={classes.fistItemLine} />\n ) : null}\n {lastItem ? (\n <Divider orientation=\"vertical\" className={classes.lastItemLine} />\n ) : null}\n {!fistItem && !lastItem ? (\n <Divider orientation=\"vertical\" className={classes.itemLine} />\n ) : null}\n <ListItemIcon>\n <Tooltip\n title={`Escalation level #${onCall.escalationLevel}`}\n placement=\"top\"\n >\n <Avatar>{onCall.escalationLevel}</Avatar>\n </Tooltip>\n </ListItemIcon>\n {onCall.schedule ? (\n <Tooltip\n title={\n 'On call shift ' +\n `${dt.fromISO(onCall.start).toFormat('D MMM, HH:mm')} - ` +\n `${dt.fromISO(onCall.end).toFormat('D MMM, HH:mm')}`\n }\n placement=\"top-start\"\n >\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n </Tooltip>\n ) : (\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n )}\n <ListItemSecondaryAction>\n {phoneNumber ? (\n <Tooltip title=\"Call to user\" placement=\"top\">\n <IconButton href={`tel:${phoneNumber}`}>\n <PhoneIcon color=\"secondary\" />\n </IconButton>\n </Tooltip>\n ) : null}\n <Tooltip\n title={`Send e-mail to user ${onCall.user.email}`}\n placement=\"top\"\n >\n <IconButton href={`mailto:${onCall.user.email}`}>\n <EmailIcon color=\"primary\" />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":["dt"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ILertCardOnCallItem.esm.js","sources":["../../../src/components/ILertCard/ILertCardOnCallItem.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Divider from '@material-ui/core/Divider';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport Avatar from '@material-ui/core/Avatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport EmailIcon from '@material-ui/icons/Email';\nimport PhoneIcon from '@material-ui/icons/Phone';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { OnCall } from '../../types';\nimport { ilertApiRef } from '../../api';\nimport { DateTime as dt } from 'luxon';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n listItemPrimary: {\n fontWeight: 'bold',\n },\n fistItemLine: {\n position: 'absolute',\n bottom: 0,\n height: '50%',\n left: 36,\n },\n lastItemLine: {\n position: 'absolute',\n top: 0,\n height: '50%',\n left: 36,\n },\n itemLine: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n height: '100%',\n left: 36,\n },\n});\n\nexport const ILertCardOnCallItem = ({\n onCall,\n fistItem = false,\n lastItem = false,\n}: {\n onCall: OnCall;\n fistItem?: boolean;\n lastItem?: boolean;\n}) => {\n const ilertApi = useApi(ilertApiRef);\n const classes = useStyles();\n\n if (!onCall || !onCall.user) {\n return null;\n }\n\n const phoneNumber = ilertApi.getUserPhoneNumber(onCall.user);\n const escalationRepeating = onCall.escalationPolicy.repeating;\n const escalationSeconds =\n onCall.escalationPolicy.escalationRules[onCall.escalationLevel - 1]\n .escalationTimeout;\n const escalationHoursOnly = Math.floor(escalationSeconds / 60);\n const escalationMinutesOnly = escalationSeconds % 60;\n\n let escalationText = '';\n if (!lastItem || (lastItem && escalationRepeating)) {\n escalationText = 'escalate';\n if (escalationSeconds === 0) {\n escalationText += ' immediately';\n } else {\n escalationText += ' after';\n if (escalationHoursOnly > 0) {\n escalationText += ` ${escalationHoursOnly} ${\n escalationHoursOnly === 1 ? 'hour' : 'hours'\n }`;\n }\n if (escalationMinutesOnly > 0 || escalationSeconds === 0) {\n escalationText += ` ${escalationMinutesOnly} ${\n escalationMinutesOnly === 1 ? 'minute' : 'minutes'\n }`;\n }\n }\n }\n\n return (\n <ListItem>\n {fistItem ? (\n <Divider orientation=\"vertical\" className={classes.fistItemLine} />\n ) : null}\n {lastItem ? (\n <Divider orientation=\"vertical\" className={classes.lastItemLine} />\n ) : null}\n {!fistItem && !lastItem ? (\n <Divider orientation=\"vertical\" className={classes.itemLine} />\n ) : null}\n <ListItemIcon>\n <Tooltip\n title={`Escalation level #${onCall.escalationLevel}`}\n placement=\"top\"\n >\n <Avatar>{onCall.escalationLevel}</Avatar>\n </Tooltip>\n </ListItemIcon>\n {onCall.schedule ? (\n <Tooltip\n title={\n 'On call shift ' +\n `${dt.fromISO(onCall.start).toFormat('D MMM, HH:mm')} - ` +\n `${dt.fromISO(onCall.end).toFormat('D MMM, HH:mm')}`\n }\n placement=\"top-start\"\n >\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n </Tooltip>\n ) : (\n <ListItemText\n primary={\n <Typography className={classes.listItemPrimary}>\n {ilertApi.getUserInitials(onCall.user)}\n </Typography>\n }\n secondary={escalationText}\n />\n )}\n <ListItemSecondaryAction>\n {phoneNumber ? (\n <Tooltip title=\"Call to user\" placement=\"top\">\n <IconButton href={`tel:${phoneNumber}`}>\n <PhoneIcon color=\"secondary\" />\n </IconButton>\n </Tooltip>\n ) : null}\n <Tooltip\n title={`Send e-mail to user ${onCall.user.email}`}\n placement=\"top\"\n >\n <IconButton href={`mailto:${onCall.user.email}`}>\n <EmailIcon color=\"primary\" />\n </IconButton>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":["dt"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,eAAA,EAAiB;AAAA,IACf,UAAA,EAAY;AAAA,GACd;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,QAAA,EAAU,UAAA;AAAA,IACV,MAAA,EAAQ,CAAA;AAAA,IACR,MAAA,EAAQ,KAAA;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,QAAA,EAAU,UAAA;AAAA,IAC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CAAK,KAAK,CAAA,CAAA,EAC3C,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,KAAA,EAAM,SAAA,EAAU,CAAA,EAC7B;AAAA;AAAA;AACF,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -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 { 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":";;;;;;;;;;;;AA6BO,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAiB,CAAC,CAAA;AACxD,EAAA,MAAM,
|
|
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":";;;;;;;;;;;;AA6BO,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAiB,CAAC,CAAA;AACxD,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,EAAE,OAAO,iBAAA,EAAkB;AAAA,IAC3B,EAAE,OAAO,QAAA,EAAS;AAAA,IAClB,EAAE,OAAO,UAAA,EAAW;AAAA,IACpB,EAAE,OAAO,cAAA;AAAe,GAC1B;AACA,EAAA,MAAM,YAAY,MAAM;AACtB,IAAA,QAAQ,WAAA;AAAa,MACnB,KAAK,CAAA;AACH,QAAA,2BAAQ,mBAAA,EAAA,EAAoB,CAAA;AAAA,MAC9B,KAAK,CAAA;AACH,QAAA,2BAAQ,UAAA,EAAA,EAAW,CAAA;AAAA,MACrB,KAAK,CAAA;AACH,QAAA,2BAAQ,YAAA,EAAA,EAAa,CAAA;AAAA,MACvB,KAAK,CAAA;AACH,QAAA,2BAAQ,eAAA,EAAA,EAAgB,CAAA;AAAA,MAC1B;AACE,QAAA,OAAO,IAAA;AAAA;AACX,EACF,CAAA;AAEA,EAAA,uBACE,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,SAAA,EACZ,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,MAAA,EAAA,EAAO,KAAA,EAAM,OAAA,EAAQ,IAAA,EAAK,MAAA,EACzB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAM,OAAA,EAAQ,KAAA,EAAM,OAAA,EAAQ,CAAA;AAAA,sBACzC,GAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAM,WAAA,EAAY,OAAM,OAAA,EAAQ;AAAA,KAAA,EAC/C,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAe,WAAA;AAAA,QACf,QAAA,EAAU,CAAA,KAAA,KAAS,cAAA,CAAe,KAAK,CAAA;AAAA,QACvC,MAAM,IAAA,CAAK,GAAA,CAAI,CAAC,EAAE,KAAA,IAAS,KAAA,MAAW;AAAA,UACpC,EAAA,EAAI,MAAM,QAAA,EAAS;AAAA,UACnB;AAAA,SACF,CAAE;AAAA;AAAA,KACJ;AAAA,oBAEA,GAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAS,IAAA,EAAE,qBAAU,EAAE;AAAA,GAAA,EAClC,CAAA;AAEJ;;;;"}
|
|
@@ -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 { 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,
|
|
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,IAAA,EAAM;AAAA,IACJ,MAAA,EAAQ,EAAA;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AAAA,EAEA,UAAA,EAAY;AAAA,IACV,QAAA,EAAU;AAAA,GACZ;AAAA,EAEA,WAAA,EAAa;AAAA,IACX,UAAA,EAAY,EAAA;AAAA,IACZ,UAAA,EAAY,mBAAA;AAAA,IACZ,QAAA,EAAU;AAAA,GACZ;AAAA,EAEA,aAAA,EAAe;AAAA,IACb,QAAA,EAAU,UAAA;AAAA,IACV,GAAA,EAAK,kBAAA;AAAA,IACL,IAAA,EAAM,EAAA;AAAA,IACN,KAAA,EAAO,EAAA;AAAA,IACP,MAAA,EAAQ,EAAA;AAAA,IACR,UAAA,EAAY,oBAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,EAEA,gBAAA,EAAkB;AAAA,IAChB,QAAA,EAAU,UAAA;AAAA,IACV,GAAA,EAAK,kBAAA;AAAA,IACL,IAAA,EAAM,EAAA;AAAA,IACN,KAA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MAAA;AAAA,QACC,WAAW,CAAA,EAAG,OAAA,CAAQ,WAAW,CAAA,CAAA,EAAI,QAAQ,YAAY,CAAA,CAAA;AAAA,QAEzD,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,aAAA,EAAe,CAAA;AAAA,0BACvC,GAAA;AAAA,YAAC,eAAA;AAAA,YAAA;AAAA,cACC,OAAO,QAAA,CAAS,SAAA;AAAA,cAChB,YAAY,QAAA,CAAS,EAAA;AAAA,cACrB;AAAA;AAAA,WACF;AAAA,8BACC,UAAA,EAAA,EAAW,SAAA,EAAW,QAAQ,UAAA,EAAY,OAAA,EAAQ,SAAQ,QAAA,EAAA,cAAA,EAE3D;AAAA;AAAA;AAAA;AACF,GAAA,EAAA,EArCS,KAsCX,CACD,CAAA,EACP,CAAA;AAEJ;;;;"}
|
|
@@ -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 { 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,
|
|
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,EAAA,MAAM,CAAC,EAAE,eAAA,EAAiB,SAAA,EAAW,KAAA,IAAS,EAAE,sBAAA,EAAwB,CAAA,GACtE,kBAAA,EAAmB;AAErB,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,IAAI,iBAAiB,mBAAA,EAAqB;AACxC,MAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,+BAAA,EAAA,EAAgC,CAAA,EACnC,CAAA;AAAA,IAEJ;AAEA,IAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,OAAc,CAAA,EACpC,CAAA;AAAA,EAEJ;AAEA,EAAA,4BACG,OAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAc,KAAA,EAAM,iBAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,uEAEf,CAAA,EACF,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,eAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -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 { 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,
|
|
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,UAAA,CAAW;AAAA,EAC3B,MAAA,EAAQ;AAAA,IACN,SAAA,EAAW,CAAA;AAAA,IACX,OAAA,EAAS,CAAA;AAAA,IACT,UAAA,EAAY,GAAA;AAAA,IACZ,QAAA,EAAU;AAAA,MACR,UAAA,EAAY,GAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,OAAA,EAAS;AAAA,MACP,QAAA,EAAU;AAAA;AACZ;AAEJ,CAAC,CAAA;AAEM,MAAM,kBAAkB,CAAC;AAAA,EAC9B,UAAA;AAA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,KAAA,CAAM,KAAK,CAAA,CAAE,QAAA,CAAS,cAAc,CAAC,MAAMA,QAAA,CACvD,OAAA,CAAQ,KAAA,CAAM,GAAG,CAAA,CACjB,QAAA,CAAS,cAAc,CAAC,IAC7B,CAAA,EACF,CAAA;AAAA,oBACA,IAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,IAAI,EAAA,EACb,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAM,SAAA;AAAA,UACN,IAAA,EAAK,OAAA;AAAA,UACL,WAAW,OAAA,CAAQ,MAAA;AAAA,UACnB,SAAA,sBAAY,UAAA,EAAA,EAAW,CAAA;AAAA,UACvB,OAAA,EAAS,cAAA;AAAA,UAET,QAAA,kBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,UAAA,EAAW,QAAA,EAAA,gBAAA,EAAc;AAAA;AAAA,OAC/C;AAAA,sBACA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,UAAA;AAAA,UACA,KAAA;AAAA,UACA,sBAAA;AAAA,UACA,aAAA;AAAA,UACA;AAAA;AAAA;AACF,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -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 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,
|
|
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,kBAAA,GAAqB,CAAC,EAAE,OAAA,EAAQ,KAA4B;AACvE,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAA6B,IAAI,CAAA;AAEjE,EAAA,MAAM,WAAA,GAAc,CAAC,KAAA,KAAmC;AACtD,IAAA,WAAA,CAAY,MAAM,aAAa,CAAA;AAAA,EACjC,CAAA;AAEA,EAAA,MAAM,kBAAkB,MAAM;AAC5B,IAAA,WAAA,CAAY,IAAI,CAAA;AAAA,EAClB,CAAA;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,YAAA,EAAW,MAAA;AAAA,QACX,eAAA,EAAc,WAAA;AAAA,QACd,eAAA,EAAc,MAAA;AAAA,QACd,OAAA,EAAS,WAAA;AAAA,QACT,IAAA,EAAK,OAAA;AAAA,QAEL,8BAAC,YAAA,EAAA,EAAa;AAAA;AAAA,KAChB;AAAA,oBACA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,CAAA,qBAAA,EAAwB,OAAA,CAAQ,EAAE,CAAA,CAAA;AAAA,QACtC,QAAA;AAAA,QACA,WAAA,EAAW,IAAA;AAAA,QACX,IAAA,EAAM,QAAQ,QAAQ,CAAA;AAAA,QACtB,OAAA,EAAS,eAAA;AAAA,QACT,UAAA,EAAY;AAAA,UACV,KAAA,EAAO,EAAE,SAAA,EAAW,EAAA,GAAK,GAAA;AAAI,SAC/B;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,YAAuB,OAAA,EAAS,eAAA,EAC/B,8BAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,WAAU,MAAA,EAAM,IAAA,EAClC,8BAAC,IAAA,EAAA,EAAK,EAAA,EAAI,SAAS,oBAAA,CAAqB,OAAO,GAAG,QAAA,EAAA,eAAA,EAElD,CAAA,EACF,KALY,SAMd;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -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 { 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,
|
|
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,WAAA,GAAc,CAAC,EAAE,OAAA,EAAQ,KAAmC;AACvE,EAAA,MAAM,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,4BAAQ,IAAA,EAAA,EAAK,EAAA,EAAI,QAAA,CAAS,oBAAA,CAAqB,OAAO,CAAA,EAAG,QAAA,EAAA;AAAA,IAAA,GAAA;AAAA,IAAE,OAAA,CAAQ;AAAA,GAAA,EAAG,CAAA;AACxE;;;;"}
|
|
@@ -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 { 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,
|
|
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,EAAA,MAAM;AAAA,IACJ,EAAE,UAAA,EAAY,QAAA,EAAU,SAAA,EAAW,KAAA,EAAM;AAAA,IACzC,EAAE,YAAA,EAAc,mBAAA,EAAqB,YAAA;AAAa,GACpD,GAAI,YAAY,IAAI,CAAA;AAEpB,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,IAAI,KAAA,CAAM,SAAS,qBAAA,EAAuB;AACxC,MAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,+BAAA,EAAA,EAAgC,CAAA,EACnC,CAAA;AAAA,IAEJ;AAEA,IAAA,uBACE,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,OAAc,CAAA,EACpC,CAAA;AAAA,EAEJ;AAEA,EAAA,4BACG,OAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,iBAAc,KAAA,EAAM,UAAA,EACnB,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,uEAEf,CAAA,EACF,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,GAAA,EACF,CAAA;AAEJ;;;;"}
|