@backstage-community/plugin-ilert 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/ILertIcon.esm.js +63 -56
- package/dist/ILertIcon.esm.js.map +1 -1
- package/dist/components/Alert/AlertActionsMenu.esm.js +49 -42
- package/dist/components/Alert/AlertActionsMenu.esm.js.map +1 -1
- package/dist/components/Alert/AlertAssignModal.esm.js +68 -60
- package/dist/components/Alert/AlertAssignModal.esm.js.map +1 -1
- package/dist/components/Alert/AlertLink.esm.js +5 -2
- package/dist/components/Alert/AlertLink.esm.js.map +1 -1
- package/dist/components/Alert/AlertNewModal.esm.js +109 -87
- package/dist/components/Alert/AlertNewModal.esm.js.map +1 -1
- package/dist/components/AlertSource/AlertSourceLink.esm.js +19 -16
- package/dist/components/AlertSource/AlertSourceLink.esm.js.map +1 -1
- package/dist/components/AlertsPage/AlertsPage.esm.js +44 -36
- package/dist/components/AlertsPage/AlertsPage.esm.js.map +1 -1
- package/dist/components/AlertsPage/AlertsTable.esm.js +15 -15
- package/dist/components/AlertsPage/AlertsTable.esm.js.map +1 -1
- package/dist/components/AlertsPage/StatusChip.esm.js +5 -5
- package/dist/components/AlertsPage/StatusChip.esm.js.map +1 -1
- package/dist/components/AlertsPage/TableTitle.esm.js +30 -24
- package/dist/components/AlertsPage/TableTitle.esm.js.map +1 -1
- package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js +6 -6
- package/dist/components/Errors/MissingAuthorizationHeaderError.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCard.esm.js +63 -51
- package/dist/components/ILertCard/ILertCard.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardActionsHeader.esm.js +42 -33
- package/dist/components/ILertCard/ILertCardActionsHeader.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardEmptyState.esm.js +28 -20
- package/dist/components/ILertCard/ILertCardEmptyState.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js +3 -3
- package/dist/components/ILertCard/ILertCardHeaderStatus.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js +36 -27
- package/dist/components/ILertCard/ILertCardMaintenanceModal.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCall.esm.js +34 -28
- package/dist/components/ILertCard/ILertCardOnCall.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js +6 -6
- package/dist/components/ILertCard/ILertCardOnCallEmptyState.esm.js.map +1 -1
- package/dist/components/ILertCard/ILertCardOnCallItem.esm.js +41 -31
- package/dist/components/ILertCard/ILertCardOnCallItem.esm.js.map +1 -1
- package/dist/components/ILertPage/ILertPage.esm.js +25 -17
- package/dist/components/ILertPage/ILertPage.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js +45 -35
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesGrid.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js +14 -11
- package/dist/components/OnCallSchedulesPage/OnCallSchedulesPage.esm.js.map +1 -1
- package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js +31 -23
- package/dist/components/OnCallSchedulesPage/OnCallShiftItem.esm.js.map +1 -1
- package/dist/components/Service/ServiceActionsMenu.esm.js +29 -25
- package/dist/components/Service/ServiceActionsMenu.esm.js.map +1 -1
- package/dist/components/Service/ServiceLink.esm.js +5 -2
- package/dist/components/Service/ServiceLink.esm.js.map +1 -1
- package/dist/components/ServicesPage/ServicesPage.esm.js +17 -14
- package/dist/components/ServicesPage/ServicesPage.esm.js.map +1 -1
- package/dist/components/ServicesPage/ServicesTable.esm.js +9 -9
- package/dist/components/ServicesPage/ServicesTable.esm.js.map +1 -1
- package/dist/components/ServicesPage/StatusChip.esm.js +7 -7
- package/dist/components/ServicesPage/StatusChip.esm.js.map +1 -1
- package/dist/components/Shift/ShiftOverrideModal.esm.js +83 -74
- package/dist/components/Shift/ShiftOverrideModal.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageActionsMenu.esm.js +32 -26
- package/dist/components/StatusPage/StatusPageActionsMenu.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageLink.esm.js +5 -2
- package/dist/components/StatusPage/StatusPageLink.esm.js.map +1 -1
- package/dist/components/StatusPage/StatusPageURL.esm.js +2 -2
- package/dist/components/StatusPage/StatusPageURL.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusChip.esm.js +7 -7
- package/dist/components/StatusPagePage/StatusChip.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusPagesPage.esm.js +17 -14
- package/dist/components/StatusPagePage/StatusPagesPage.esm.js.map +1 -1
- package/dist/components/StatusPagePage/StatusPagesTable.esm.js +10 -10
- package/dist/components/StatusPagePage/StatusPagesTable.esm.js.map +1 -1
- package/dist/components/StatusPagePage/VisibilityChip.esm.js +4 -4
- package/dist/components/StatusPagePage/VisibilityChip.esm.js.map +1 -1
- package/dist/hooks/useAlertActions.esm.js +3 -5
- package/dist/hooks/useAlertActions.esm.js.map +1 -1
- package/dist/hooks/useAlertSource.esm.js +3 -5
- package/dist/hooks/useAlertSource.esm.js.map +1 -1
- package/dist/hooks/useAlertSourceOnCalls.esm.js +3 -3
- package/dist/hooks/useAlertSourceOnCalls.esm.js.map +1 -1
- package/dist/hooks/useAlerts.esm.js +6 -9
- package/dist/hooks/useAlerts.esm.js.map +1 -1
- package/dist/hooks/useAssignAlert.esm.js +6 -4
- package/dist/hooks/useAssignAlert.esm.js.map +1 -1
- package/dist/hooks/useNewAlert.esm.js +6 -10
- package/dist/hooks/useNewAlert.esm.js.map +1 -1
- package/dist/hooks/useOnCallSchedules.esm.js +5 -3
- package/dist/hooks/useOnCallSchedules.esm.js.map +1 -1
- package/dist/hooks/useServices.esm.js +4 -4
- package/dist/hooks/useServices.esm.js.map +1 -1
- package/dist/hooks/useShiftOverride.esm.js +4 -4
- package/dist/hooks/useShiftOverride.esm.js.map +1 -1
- package/dist/hooks/useStatusPages.esm.js +4 -6
- package/dist/hooks/useStatusPages.esm.js.map +1 -1
- package/dist/index.d.ts +6 -8
- package/package.json +13 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useServices.esm.js","sources":["../../src/hooks/useServices.ts"],"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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { AuthenticationError } from '@backstage/errors';\nimport
|
|
1
|
+
{"version":3,"file":"useServices.esm.js","sources":["../../src/hooks/useServices.ts"],"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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { AuthenticationError } from '@backstage/errors';\nimport { useState } from 'react';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { GetServicesOpts, ilertApiRef, TableState } from '../api';\nimport { Service } from '../types';\n\nexport const useServices = (paging: boolean) => {\n const ilertApi = useApi(ilertApiRef);\n const errorApi = useApi(errorApiRef);\n\n const [tableState, setTableState] = useState<TableState>({\n page: 0,\n pageSize: 10,\n });\n\n const [servicesList, setServicesList] = useState<Service[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n const fetchServicesCall = async () => {\n try {\n setIsLoading(true);\n const opts: GetServicesOpts = {};\n if (paging) {\n opts.maxResults = tableState.pageSize;\n opts.startIndex = tableState.page * tableState.pageSize;\n }\n const data = await ilertApi.fetchServices(opts);\n setServicesList(data || []);\n setIsLoading(false);\n } catch (e) {\n if (!(e instanceof AuthenticationError)) {\n errorApi.post(e);\n }\n setIsLoading(false);\n throw e;\n }\n };\n\n const fetchServices = useAsyncRetry(fetchServicesCall, [tableState]);\n\n const refetchServices = () => {\n setTableState({ ...tableState, page: 0 });\n Promise.all([fetchServicesCall()]);\n };\n\n const error = fetchServices.error;\n const retry = () => {\n fetchServices.retry();\n };\n\n const onChangePage = (page: number) => {\n setTableState({ ...tableState, page });\n };\n const onChangeRowsPerPage = (p: number) => {\n setTableState({ ...tableState, pageSize: p });\n };\n\n return [\n {\n tableState,\n services: servicesList,\n isLoading,\n error,\n },\n {\n setTableState,\n setServicesList,\n setIsLoading,\n retry,\n refetchServices,\n onChangePage,\n onChangeRowsPerPage,\n },\n ] as const;\n};\n"],"names":[],"mappings":";;;;;;AAsBa,MAAA,WAAA,GAAc,CAAC,MAAoB,KAAA;AAC9C,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,QAAqB,CAAA;AAAA,IACvD,IAAM,EAAA,CAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACX,CAAA;AAED,EAAA,MAAM,CAAC,YAAc,EAAA,eAAe,CAAI,GAAA,QAAA,CAAoB,EAAE,CAAA;AAC9D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,EAAA,MAAM,oBAAoB,YAAY;AACpC,IAAI,I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,CAAA;AAAA,GAC9C;AAEA,EAAO,OAAA;AAAA,IACL;AAAA,MACE,UAAA;AAAA,MACA,QAAU,EAAA,YAAA;AAAA,MACV,SAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA;AAAA,MACE,aAAA;AAAA,MACA,eAAA;AAAA,MACA,YAAA;AAAA,MACA,KAAA;AAAA,MACA,eAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AACF,GACF;AACF;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import { ilertApiRef } from '../api/client.esm.js';
|
|
3
3
|
import { AuthenticationError } from '@backstage/errors';
|
|
4
4
|
import useAsyncRetry from 'react-use/esm/useAsyncRetry';
|
|
@@ -7,9 +7,9 @@ import { useApi, errorApiRef } from '@backstage/core-plugin-api';
|
|
|
7
7
|
const useShiftOverride = (s, isModalOpened) => {
|
|
8
8
|
const ilertApi = useApi(ilertApiRef);
|
|
9
9
|
const errorApi = useApi(errorApiRef);
|
|
10
|
-
const [shift, setShift] =
|
|
11
|
-
const [usersList, setUsersList] =
|
|
12
|
-
const [isLoading, setIsLoading] =
|
|
10
|
+
const [shift, setShift] = useState(s);
|
|
11
|
+
const [usersList, setUsersList] = useState([]);
|
|
12
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
13
13
|
const { error, retry } = useAsyncRetry(async () => {
|
|
14
14
|
try {
|
|
15
15
|
if (!isModalOpened) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShiftOverride.esm.js","sources":["../../src/hooks/useShiftOverride.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport
|
|
1
|
+
{"version":3,"file":"useShiftOverride.esm.js","sources":["../../src/hooks/useShiftOverride.ts"],"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 { ilertApiRef } from '../api';\nimport { AuthenticationError } from '@backstage/errors';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { User, Shift } from '../types';\nimport { useApi, errorApiRef } from '@backstage/core-plugin-api';\n\nexport const useShiftOverride = (s: Shift, isModalOpened: boolean) => {\n const ilertApi = useApi(ilertApiRef);\n const errorApi = useApi(errorApiRef);\n\n const [shift, setShift] = useState<Shift>(s);\n const [usersList, setUsersList] = useState<User[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n const { error, retry } = useAsyncRetry(async () => {\n try {\n if (!isModalOpened) {\n return;\n }\n setIsLoading(true);\n const data = await ilertApi.fetchUsers();\n setUsersList(data || []);\n setIsLoading(false);\n } catch (e) {\n setIsLoading(false);\n if (!(e instanceof AuthenticationError)) {\n errorApi.post(e);\n }\n throw e;\n }\n }, [isModalOpened]);\n\n const setUser = (user: User) => {\n setShift({ ...shift, user });\n };\n\n const setStart = (start: string) => {\n setShift({ ...shift, start });\n };\n\n const setEnd = (end: string) => {\n setShift({ ...shift, end });\n };\n\n return [\n {\n shift,\n users: usersList,\n user: shift.user,\n start: shift.start,\n end: shift.end,\n error,\n isLoading,\n },\n {\n retry,\n setIsLoading,\n setUser,\n setStart,\n setEnd,\n },\n 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,MAAA,MAAA,GAAS,CAAC,GAAgB,KAAA;AAC9B,IAAA,QAAA,CAAS,EAAE,GAAG,KAAO,EAAA,GAAA,EAAK,CAAA;AAAA,GAC5B;AAEA,EAAO,OAAA;AAAA,IACL;AAAA,MACE,KAAA;AAAA,MACA,KAAO,EAAA,SAAA;AAAA,MACP,MAAM,KAAM,CAAA,IAAA;AAAA,MACZ,OAAO,KAAM,CAAA,KAAA;AAAA,MACb,KAAK,KAAM,CAAA,GAAA;AAAA,MACX,KAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA;AAAA,MACE,KAAA;AAAA,MACA,YAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA;AAAA;AACF,GACF;AACF;;;;"}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { useApi, errorApiRef } from '@backstage/core-plugin-api';
|
|
2
2
|
import { AuthenticationError } from '@backstage/errors';
|
|
3
|
-
import
|
|
3
|
+
import { useState } from 'react';
|
|
4
4
|
import useAsyncRetry from 'react-use/esm/useAsyncRetry';
|
|
5
5
|
import { ilertApiRef } from '../api/client.esm.js';
|
|
6
6
|
|
|
7
7
|
const useStatusPages = (paging) => {
|
|
8
8
|
const ilertApi = useApi(ilertApiRef);
|
|
9
9
|
const errorApi = useApi(errorApiRef);
|
|
10
|
-
const [tableState, setTableState] =
|
|
10
|
+
const [tableState, setTableState] = useState({
|
|
11
11
|
page: 0,
|
|
12
12
|
pageSize: 10
|
|
13
13
|
});
|
|
14
|
-
const [statusPagesList, setStatusPagesList] =
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
14
|
+
const [statusPagesList, setStatusPagesList] = useState([]);
|
|
15
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
18
16
|
const fetchStatusPagesCall = async () => {
|
|
19
17
|
try {
|
|
20
18
|
setIsLoading(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStatusPages.esm.js","sources":["../../src/hooks/useStatusPages.ts"],"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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { AuthenticationError } from '@backstage/errors';\nimport
|
|
1
|
+
{"version":3,"file":"useStatusPages.esm.js","sources":["../../src/hooks/useStatusPages.ts"],"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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { AuthenticationError } from '@backstage/errors';\nimport { useState } from 'react';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport { GetStatusPagesOpts, ilertApiRef, TableState } from '../api';\nimport { StatusPage } from '../types';\n\nexport const useStatusPages = (paging: boolean) => {\n const ilertApi = useApi(ilertApiRef);\n const errorApi = useApi(errorApiRef);\n\n const [tableState, setTableState] = useState<TableState>({\n page: 0,\n pageSize: 10,\n });\n\n const [statusPagesList, setStatusPagesList] = useState<StatusPage[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n\n const fetchStatusPagesCall = async () => {\n try {\n setIsLoading(true);\n const opts: GetStatusPagesOpts = {};\n if (paging) {\n opts.maxResults = tableState.pageSize;\n opts.startIndex = tableState.page * tableState.pageSize;\n }\n const data = await ilertApi.fetchStatusPages(opts);\n setStatusPagesList(data || []);\n setIsLoading(false);\n } catch (e) {\n if (!(e instanceof AuthenticationError)) {\n errorApi.post(e);\n }\n setIsLoading(false);\n throw e;\n }\n };\n\n const fetchStatusPages = useAsyncRetry(fetchStatusPagesCall, [tableState]);\n\n const refetchStatusPages = () => {\n setTableState({ ...tableState, page: 0 });\n Promise.all([fetchStatusPagesCall()]);\n };\n\n const error = fetchStatusPages.error;\n const retry = () => {\n fetchStatusPages.retry();\n };\n\n const onChangePage = (page: number) => {\n setTableState({ ...tableState, page });\n };\n const onChangeRowsPerPage = (p: number) => {\n setTableState({ ...tableState, pageSize: p });\n };\n\n return [\n {\n tableState,\n statusPages: statusPagesList,\n isLoading,\n error,\n },\n {\n setTableState,\n setStatusPagesList,\n setIsLoading,\n retry,\n refetchStatusPages,\n onChangePage,\n onChangeRowsPerPage,\n },\n ] as const;\n};\n"],"names":[],"mappings":";;;;;;AAsBa,MAAA,cAAA,GAAiB,CAAC,MAAoB,KAAA;AACjD,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,QAAqB,CAAA;AAAA,IACvD,IAAM,EAAA,CAAA;AAAA,IACN,QAAU,EAAA;AAAA,GACX,CAAA;AAED,EAAA,MAAM,CAAC,eAAiB,EAAA,kBAAkB,CAAI,GAAA,QAAA,CAAuB,EAAE,CAAA;AACvE,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,EAAA,MAAM,uBAAuB,YAAY;AACvC,IAAI,IAAA;AACF,MAAA,YAAA,CAAa,IAAI,CAAA;AACjB,MAAA,MAAM,OAA2B,EAAC;AAClC,MAAA,IAAI,MAAQ,EAAA;AACV,QAAA,IAAA,CAAK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,MACA;AAAA,KACF;AAAA,IACA;AAAA,MACE,aAAA;AAAA,MACA,kBAAA;AAAA,MACA,YAAA;AAAA,MACA,KAAA;AAAA,MACA,kBAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AACF,GACF;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default from 'react';
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
5
3
|
import { ConfigApi, DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
|
|
6
4
|
import { Entity } from '@backstage/catalog-model';
|
|
@@ -11,22 +9,22 @@ declare const ilertPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
|
11
9
|
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
12
10
|
}, {}, {}>;
|
|
13
11
|
/** @public */
|
|
14
|
-
declare const ILertPage$1: () =>
|
|
12
|
+
declare const ILertPage$1: () => react_jsx_runtime.JSX.Element;
|
|
15
13
|
/** @public */
|
|
16
|
-
declare const EntityILertCard: () =>
|
|
14
|
+
declare const EntityILertCard: () => react_jsx_runtime.JSX.Element;
|
|
17
15
|
|
|
18
16
|
/** @public */
|
|
19
|
-
declare const ILertPage: () =>
|
|
17
|
+
declare const ILertPage: () => react_jsx_runtime.JSX.Element;
|
|
20
18
|
|
|
21
19
|
/** @public */
|
|
22
20
|
declare const isPluginApplicableToEntity: (entity: Entity) => boolean;
|
|
23
21
|
/** @public */
|
|
24
|
-
declare const ILertCard: () =>
|
|
22
|
+
declare const ILertCard: () => react_jsx_runtime.JSX.Element;
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
* @public
|
|
28
26
|
*/
|
|
29
|
-
declare const ILertIcon: (props: SvgIconProps) =>
|
|
27
|
+
declare const ILertIcon: (props: SvgIconProps) => react_jsx_runtime.JSX.Element;
|
|
30
28
|
|
|
31
29
|
/** @public */
|
|
32
30
|
interface Alert {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-ilert",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A Backstage plugin that integrates towards iLert",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@backstage/catalog-model": "^1.7.3",
|
|
42
|
-
"@backstage/core-components": "^0.17.
|
|
43
|
-
"@backstage/core-plugin-api": "^1.10.
|
|
42
|
+
"@backstage/core-components": "^0.17.1",
|
|
43
|
+
"@backstage/core-plugin-api": "^1.10.6",
|
|
44
44
|
"@backstage/errors": "^1.2.7",
|
|
45
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
45
|
+
"@backstage/plugin-catalog-react": "^1.17.0",
|
|
46
46
|
"@date-io/luxon": "1.x",
|
|
47
47
|
"@material-ui/core": "^4.12.2",
|
|
48
48
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -54,14 +54,13 @@
|
|
|
54
54
|
"react-use": "^17.2.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@backstage/cli": "^0.
|
|
58
|
-
"@backstage/dev-utils": "^1.1.
|
|
57
|
+
"@backstage/cli": "^0.32.0",
|
|
58
|
+
"@backstage/dev-utils": "^1.1.9",
|
|
59
59
|
"@testing-library/dom": "^10.0.0",
|
|
60
60
|
"@testing-library/jest-dom": "^6.0.0",
|
|
61
61
|
"@testing-library/react": "^15.0.0",
|
|
62
62
|
"@types/humanize-duration": "^3.18.1",
|
|
63
63
|
"@types/react-dom": "^18.2.19",
|
|
64
|
-
"canvas": "^2.11.2",
|
|
65
64
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
66
65
|
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
67
66
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
@@ -72,5 +71,12 @@
|
|
|
72
71
|
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
|
73
72
|
},
|
|
74
73
|
"configSchema": "config.d.ts",
|
|
74
|
+
"typesVersions": {
|
|
75
|
+
"*": {
|
|
76
|
+
"package.json": [
|
|
77
|
+
"package.json"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
75
81
|
"module": "./dist/index.esm.js"
|
|
76
82
|
}
|