@pagerduty/backstage-plugin 0.13.0-next.8 → 0.13.0-next.9
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.
|
@@ -3,8 +3,9 @@ import { Typography, Box, DialogTitle, DialogContent, DialogActions, Tooltip, Ic
|
|
|
3
3
|
import EditIcon from '@mui/icons-material/Edit';
|
|
4
4
|
import { useApi } from '@backstage/core-plugin-api';
|
|
5
5
|
import { pagerDutyApiRef } from '../../api/client.esm.js';
|
|
6
|
-
import { QueryClient, QueryClientProvider,
|
|
6
|
+
import { useQuery, QueryClient, QueryClientProvider, useMutation } from '@tanstack/react-query';
|
|
7
7
|
import { useMaterialReactTable, MRT_EditActionButtons, MaterialReactTable } from 'material-react-table';
|
|
8
|
+
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
8
9
|
import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
|
|
9
10
|
|
|
10
11
|
function getColorFromStatus(status) {
|
|
@@ -33,10 +34,110 @@ function makeReadable(status) {
|
|
|
33
34
|
}
|
|
34
35
|
const ServiceMappingComponent = () => {
|
|
35
36
|
const pagerDutyApi = useApi(pagerDutyApiRef);
|
|
37
|
+
const catalogApi = useApi(catalogApiRef);
|
|
36
38
|
async function fetchMappings() {
|
|
37
39
|
const { mappings: foundMappings } = await pagerDutyApi.getEntityMappings();
|
|
38
40
|
return foundMappings;
|
|
39
41
|
}
|
|
42
|
+
async function fetchCatalogEntities() {
|
|
43
|
+
const result = await catalogApi.getEntities({
|
|
44
|
+
filter: { kind: "Component" }
|
|
45
|
+
});
|
|
46
|
+
const entities = [];
|
|
47
|
+
result.items.forEach((entity) => {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f;
|
|
49
|
+
entities.push({
|
|
50
|
+
name: (_a = entity.metadata) == null ? void 0 : _a.name,
|
|
51
|
+
id: (_c = (_b = entity.metadata) == null ? void 0 : _b.uid) != null ? _c : "",
|
|
52
|
+
system: JSON.stringify((_d = entity.spec) == null ? void 0 : _d.system) || "",
|
|
53
|
+
owner: JSON.stringify((_e = entity.spec) == null ? void 0 : _e.owner) || "",
|
|
54
|
+
lifecycle: JSON.stringify((_f = entity.spec) == null ? void 0 : _f.lifecycle) || ""
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
return entities;
|
|
58
|
+
}
|
|
59
|
+
const {
|
|
60
|
+
data: fetchedMappings = [],
|
|
61
|
+
isError: isLoadingMappingsError,
|
|
62
|
+
isFetching: isFetchingMappings,
|
|
63
|
+
isLoading: isLoadingMappings
|
|
64
|
+
} = useGetMappings();
|
|
65
|
+
const {
|
|
66
|
+
data: fetchedCatalogEntities = [],
|
|
67
|
+
isError: isLoadingCatalogEntitiesError,
|
|
68
|
+
isFetching: isFetchingCatalogEntities,
|
|
69
|
+
isLoading: isLoadingCatalogEntities
|
|
70
|
+
} = useGetCatalogEntities();
|
|
71
|
+
function getCatalogEntityOptions() {
|
|
72
|
+
const options = [];
|
|
73
|
+
options.push({ value: "", label: "None" });
|
|
74
|
+
fetchedCatalogEntities.forEach((entity) => {
|
|
75
|
+
const foundEntity = fetchedMappings.find(
|
|
76
|
+
(item) => item.entityRef === entity.id
|
|
77
|
+
);
|
|
78
|
+
if (!foundEntity) {
|
|
79
|
+
options.push({
|
|
80
|
+
value: entity.id,
|
|
81
|
+
label: entity.name
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return options;
|
|
86
|
+
}
|
|
87
|
+
function useGetMappings() {
|
|
88
|
+
return useQuery({
|
|
89
|
+
queryKey: ["mappings"],
|
|
90
|
+
queryFn: async () => fetchMappings(),
|
|
91
|
+
refetchOnWindowFocus: false
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function useGetCatalogEntities() {
|
|
95
|
+
return useQuery({
|
|
96
|
+
queryKey: ["entities"],
|
|
97
|
+
queryFn: async () => fetchCatalogEntities(),
|
|
98
|
+
refetchOnMount: false,
|
|
99
|
+
refetchOnWindowFocus: false,
|
|
100
|
+
refetchOnReconnect: false
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function useUpdateMapping() {
|
|
104
|
+
return useMutation({
|
|
105
|
+
mutationFn: async (mapping) => {
|
|
106
|
+
return await pagerDutyApi.storeServiceMapping(
|
|
107
|
+
mapping.serviceId,
|
|
108
|
+
mapping.entityRef
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
// client side optimistic update
|
|
112
|
+
// onMutate: (newMappingInfo: PagerDutyEntityMapping) => {
|
|
113
|
+
// queryClient.setQueryData(["updateMappings"], (prevMappings: any) =>
|
|
114
|
+
// prevMappings?.map((prevMapping: PagerDutyEntityMapping) => {
|
|
115
|
+
// if (prevMapping.serviceId === newMappingInfo.serviceId) {
|
|
116
|
+
// newMappingInfo.entityName =
|
|
117
|
+
// fetchedCatalogEntities.find(
|
|
118
|
+
// (entity) => entity.id === newMappingInfo.entityRef
|
|
119
|
+
// )?.name || "";
|
|
120
|
+
// return newMappingInfo;
|
|
121
|
+
// }
|
|
122
|
+
// return prevMapping;
|
|
123
|
+
// })
|
|
124
|
+
// );
|
|
125
|
+
// },
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const { mutateAsync: updateMapping, isPending: isUpdatingMapping } = useUpdateMapping();
|
|
129
|
+
const handleSaveMapping = async ({ values, table }) => {
|
|
130
|
+
var _a;
|
|
131
|
+
values.entityName = ((_a = fetchedCatalogEntities.find(
|
|
132
|
+
(entity) => entity.id === values.entityRef
|
|
133
|
+
)) == null ? void 0 : _a.name) || "";
|
|
134
|
+
values.status = "RefreshToUpdate";
|
|
135
|
+
await updateMapping(values);
|
|
136
|
+
table.setEditingRow(null);
|
|
137
|
+
};
|
|
138
|
+
const openInBrowser = (url) => {
|
|
139
|
+
window.open(url, "_blank", "noreferrer");
|
|
140
|
+
};
|
|
40
141
|
const DenseTable = () => {
|
|
41
142
|
const [validationErrors, setValidationErrors] = useState({});
|
|
42
143
|
const columns = useMemo(
|
|
@@ -69,8 +170,7 @@ const ServiceMappingComponent = () => {
|
|
|
69
170
|
header: "Mapping",
|
|
70
171
|
visibleInShowHideMenu: false,
|
|
71
172
|
editVariant: "select",
|
|
72
|
-
editSelectOptions:
|
|
73
|
-
// getCatalogEntityOptions(),
|
|
173
|
+
editSelectOptions: getCatalogEntityOptions(),
|
|
74
174
|
muiEditTextFieldProps: {
|
|
75
175
|
select: true,
|
|
76
176
|
error: !!(validationErrors == null ? void 0 : validationErrors.state),
|
|
@@ -110,54 +210,6 @@ const ServiceMappingComponent = () => {
|
|
|
110
210
|
],
|
|
111
211
|
[validationErrors]
|
|
112
212
|
);
|
|
113
|
-
function useGetMappings() {
|
|
114
|
-
return useQuery({
|
|
115
|
-
queryKey: ["mappings"],
|
|
116
|
-
queryFn: async () => fetchMappings(),
|
|
117
|
-
refetchOnWindowFocus: false
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
function useUpdateMapping() {
|
|
121
|
-
return useMutation({
|
|
122
|
-
mutationFn: async (mapping) => {
|
|
123
|
-
return await pagerDutyApi.storeServiceMapping(
|
|
124
|
-
mapping.serviceId,
|
|
125
|
-
mapping.entityRef
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
// client side optimistic update
|
|
129
|
-
// onMutate: (newMappingInfo: PagerDutyEntityMapping) => {
|
|
130
|
-
// queryClient.setQueryData(["updateMappings"], (prevMappings: any) =>
|
|
131
|
-
// prevMappings?.map((prevMapping: PagerDutyEntityMapping) => {
|
|
132
|
-
// if (prevMapping.serviceId === newMappingInfo.serviceId) {
|
|
133
|
-
// newMappingInfo.entityName =
|
|
134
|
-
// fetchedCatalogEntities.find(
|
|
135
|
-
// (entity) => entity.id === newMappingInfo.entityRef
|
|
136
|
-
// )?.name || "";
|
|
137
|
-
// return newMappingInfo;
|
|
138
|
-
// }
|
|
139
|
-
// return prevMapping;
|
|
140
|
-
// })
|
|
141
|
-
// );
|
|
142
|
-
// },
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
const {
|
|
146
|
-
data: fetchedMappings = [],
|
|
147
|
-
isError: isLoadingMappingsError,
|
|
148
|
-
isFetching: isFetchingMappings,
|
|
149
|
-
isLoading: isLoadingMappings
|
|
150
|
-
} = useGetMappings();
|
|
151
|
-
const { mutateAsync: updateMapping, isPending: isUpdatingMapping } = useUpdateMapping();
|
|
152
|
-
const handleSaveMapping = async ({ values, table }) => {
|
|
153
|
-
setValidationErrors({});
|
|
154
|
-
values.status = "RefreshToUpdate";
|
|
155
|
-
await updateMapping(values);
|
|
156
|
-
table.setEditingRow(null);
|
|
157
|
-
};
|
|
158
|
-
const openInBrowser = (url) => {
|
|
159
|
-
window.open(url, "_blank", "noreferrer");
|
|
160
|
-
};
|
|
161
213
|
const dataTable = useMaterialReactTable({
|
|
162
214
|
columns,
|
|
163
215
|
data: fetchedMappings,
|
|
@@ -189,13 +241,10 @@ const ServiceMappingComponent = () => {
|
|
|
189
241
|
/* @__PURE__ */ React.createElement(OpenInBrowserIcon, null)
|
|
190
242
|
))),
|
|
191
243
|
state: {
|
|
192
|
-
isLoading: isLoadingMappings,
|
|
193
|
-
// || isLoadingCatalogEntities,
|
|
244
|
+
isLoading: isLoadingMappings || isLoadingCatalogEntities,
|
|
194
245
|
isSaving: isUpdatingMapping,
|
|
195
|
-
showAlertBanner: isLoadingMappingsError,
|
|
196
|
-
|
|
197
|
-
showProgressBars: isFetchingMappings,
|
|
198
|
-
// || isFetchingCatalogEntities,
|
|
246
|
+
showAlertBanner: isLoadingMappingsError || isLoadingCatalogEntitiesError,
|
|
247
|
+
showProgressBars: isFetchingMappings || isFetchingCatalogEntities,
|
|
199
248
|
columnVisibility: {
|
|
200
249
|
serviceId: false,
|
|
201
250
|
entityRef: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceMappingComponent.esm.js","sources":["../../../src/components/PagerDutyPage/ServiceMappingComponent.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport {\n Box,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Tooltip,\n Typography,\n} from \"@material-ui/core\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport { PagerDutyEntityMapping } from \"@pagerduty/backstage-plugin-common\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport {\n QueryClient,\n QueryClientProvider,\n useMutation,\n // useQueries,\n useQuery,\n} from \"@tanstack/react-query\";\nimport {\n MRT_ColumnDef,\n MRT_EditActionButtons,\n MRT_TableOptions,\n MaterialReactTable,\n useMaterialReactTable,\n} from \"material-react-table\";\n// import { catalogApiRef } from \"@backstage/plugin-catalog-react\";\nimport OpenInBrowser from \"@material-ui/icons/OpenInBrowser\";\n\n// type Service = {\n// name: string; // \"Ads\"\n// id: string; // \"QWe1j283n12j132\"\n// system: string; // \"Production\"\n// owner: string; // \"Mapped\"\n// lifecycle: string; // \"Ads\"\n// };\n\nfunction getColorFromStatus(status?: string) {\n switch (status) {\n case \"InSync\":\n return \"green\";\n case \"OutOfSync\":\n return \"red\";\n case \"NotMapped\":\n return \"orange\";\n default:\n return \"gray\";\n }\n}\n\nfunction makeReadable(status?: string) {\n switch (status) {\n case \"InSync\":\n return \"In Sync\";\n case \"OutOfSync\":\n return \"Out of Sync\";\n case \"NotMapped\":\n return \"Not Mapped\";\n default:\n return \"Refresh to Update\";\n }\n}\n\nexport const ServiceMappingComponent = () => {\n // const [_, setEntityMappings] = useState<\n // PagerDutyEntityMapping[]\n // >([]);\n // const [catalogEntities, setCatalogEntities] = useState<Service[]>([]);\n // const [entityOptions, setEntityOptions] = useState<CatalogEntityOptions[]>([]);\n\n const pagerDutyApi = useApi(pagerDutyApiRef);\n // const catalogApi = useApi(catalogApiRef);\n\n // function fetchCatalogEntities() {\n // catalogApi\n // .getEntities({\n // filter: { kind: \"Component\" },\n // })\n // .then((result) => {\n // const entities: Service[] = [];\n // result.items.forEach((entity: any) => {\n // entities.push({\n // name: entity.metadata?.name,\n // id: entity.metadata?.uid ?? \"\",\n // system: JSON.stringify(entity.spec?.system) || \"\",\n // owner: JSON.stringify(entity.spec?.owner) || \"\",\n // lifecycle: JSON.stringify(entity.spec?.lifecycle) || \"\",\n // });\n // });\n\n // setCatalogEntities(entities);\n // });\n // }\n\n async function fetchMappings(): Promise<PagerDutyEntityMapping[]> {\n const { mappings: foundMappings } = await pagerDutyApi.getEntityMappings();\n\n // setEntityMappings(foundMappings);\n\n return foundMappings;\n }\n\n // async function fetchCatalogEntities(): Promise<Service[]> {\n // if (catalogEntities.length === 0) {\n // const result = await catalogApi.getEntities({\n // filter: { kind: \"Component\" },\n // });\n\n // const entities: Service[] = [];\n // result.items.forEach((entity: any) => {\n // entities.push({\n // name: entity.metadata?.name,\n // id: entity.metadata?.uid ?? \"\",\n // system: JSON.stringify(entity.spec?.system) || \"\",\n // owner: JSON.stringify(entity.spec?.owner) || \"\",\n // lifecycle: JSON.stringify(entity.spec?.lifecycle) || \"\",\n // });\n // });\n\n // setCatalogEntities(entities);\n\n // return entities;\n // }\n\n // return catalogEntities;\n // }\n\n // type CatalogEntityOptions = {\n // value: string;\n // label: string;\n // };\n\n // function getCatalogEntityOptions(): CatalogEntityOptions[] {\n // const options: CatalogEntityOptions[] = [];\n // // if (entityOptions.length === 0) {\n // // initialize with empty object\n // options.push({ value: \"\", label: \"None\" });\n // // }\n\n // catalogEntities.forEach((entity) => {\n // // find entity with entity.id in entityMappings array\n // const foundEntity = entityMappings.find(\n // (item) => item.entityRef === entity.id\n // );\n\n // if (!foundEntity) {\n // options.push({\n // value: entity.id,\n // label: entity.name,\n // });\n // }\n // });\n\n // // setEntityOptions(options);\n\n // return options;\n // }\n\n // READ hook (get mappings from api)\n\n const DenseTable = () => {\n const [validationErrors, setValidationErrors] = useState<\n Record<string, string | undefined>\n >({});\n\n const columns = useMemo<MRT_ColumnDef<PagerDutyEntityMapping>[]>(\n () => [\n {\n accessorKey: \"serviceId\",\n header: \"Service ID\",\n visibleInShowHideMenu: false,\n enableEditing: false,\n Edit: () => null,\n Cell: ({ cell }) => (\n <Typography variant=\"body1\" style={{ fontWeight: 600 }}>\n {cell.getValue<string>()}\n </Typography>\n ),\n },\n {\n accessorKey: \"serviceName\",\n header: \"PagerDuty Service\",\n enableEditing: false,\n },\n {\n accessorKey: \"team\",\n header: \"Team\",\n enableEditing: false,\n },\n {\n accessorKey: \"escalationPolicy\",\n header: \"Escalation Policy\",\n enableEditing: false,\n },\n {\n accessorKey: \"entityRef\",\n header: \"Mapping\",\n visibleInShowHideMenu: false,\n editVariant: \"select\",\n editSelectOptions: [], // getCatalogEntityOptions(),\n muiEditTextFieldProps: {\n select: true,\n error: !!validationErrors?.state,\n helperText: validationErrors?.state,\n },\n },\n {\n accessorKey: \"entityName\",\n header: \"Mapped Entity Name\",\n enableEditing: false,\n Edit: () => null,\n },\n {\n accessorKey: \"status\",\n header: \"Status\",\n enableEditing: false,\n Edit: () => null,\n Cell: ({ cell }) => (\n <Box\n component=\"span\"\n bgcolor={getColorFromStatus(cell.getValue<string>())}\n borderRadius=\"0.25rem\"\n color=\"white\"\n p=\"0.25rem\"\n >\n {makeReadable(cell.getValue<string>())}\n </Box>\n ),\n },\n {\n accessorKey: \"serviceUrl\",\n header: \"Service URL\",\n visibleInShowHideMenu: false,\n enableEditing: false,\n Edit: () => null,\n },\n ],\n [validationErrors]\n );\n\n function useGetMappings() {\n return useQuery<PagerDutyEntityMapping[]>({\n queryKey: [\"mappings\"],\n queryFn: async () => fetchMappings(),\n refetchOnWindowFocus: false,\n });\n }\n\n // READ hook (get catalog entities from api)\n // function useGetCatalogEntities() {\n // return useQuery<Service[]>({\n // queryKey: [\"entities\"],\n // queryFn: async () => fetchCatalogEntities(),\n // refetchOnMount: false,\n // refetchOnWindowFocus: false,\n // refetchOnReconnect: false,\n // });\n // }\n\n // UPDATE hook (put mapping in api)\n function useUpdateMapping() {\n // const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (mapping: PagerDutyEntityMapping) => {\n return await pagerDutyApi.storeServiceMapping(\n mapping.serviceId,\n mapping.entityRef\n );\n },\n // client side optimistic update\n // onMutate: (newMappingInfo: PagerDutyEntityMapping) => {\n // queryClient.setQueryData([\"updateMappings\"], (prevMappings: any) =>\n // prevMappings?.map((prevMapping: PagerDutyEntityMapping) => {\n // if (prevMapping.serviceId === newMappingInfo.serviceId) {\n // newMappingInfo.entityName =\n // fetchedCatalogEntities.find(\n // (entity) => entity.id === newMappingInfo.entityRef\n // )?.name || \"\";\n\n // return newMappingInfo;\n // }\n // return prevMapping;\n // })\n // );\n // },\n });\n }\n\n // call READ hook\n const {\n data: fetchedMappings = [],\n isError: isLoadingMappingsError,\n isFetching: isFetchingMappings,\n isLoading: isLoadingMappings,\n } = useGetMappings();\n\n // call READ hook\n // const {\n // data: fetchedCatalogEntities = [],\n // isError: isLoadingCatalogEntitiesError,\n // isFetching: isFetchingCatalogEntities,\n // isLoading: isLoadingCatalogEntities,\n // } = useGetCatalogEntities();\n\n // call UPDATE hook\n const { mutateAsync: updateMapping, isPending: isUpdatingMapping } =\n useUpdateMapping();\n\n // UPDATE action\n const handleSaveMapping: MRT_TableOptions<PagerDutyEntityMapping>[\"onEditingRowSave\"] =\n async ({ values, table }) => {\n setValidationErrors({});\n // values.entityName =\n // fetchedCatalogEntities.find(\n // (entity) => entity.id === values.entityRef\n // )?.name || \"\";\n values.status = \"RefreshToUpdate\";\n await updateMapping(values);\n table.setEditingRow(null); // exit editing mode\n };\n\n const openInBrowser = (url: string) => {\n window.open(url, \"_blank\", \"noreferrer\");\n };\n\n const dataTable = useMaterialReactTable({\n columns,\n data: fetchedMappings,\n editDisplayMode: \"modal\", // default ('row', 'cell', 'table', and 'custom' are also available)\n enableEditing: true,\n positionActionsColumn: \"last\",\n enableStickyHeader: true,\n enableFilters: true,\n getRowId: (row) => row.serviceId,\n muiToolbarAlertBannerProps: isLoadingMappingsError\n ? {\n color: \"error\",\n children: \"Error loading data\",\n }\n : undefined,\n muiTableContainerProps: {\n sx: {\n minHeight: \"500px\",\n },\n },\n onEditingRowCancel: () => setValidationErrors({}),\n onEditingRowSave: handleSaveMapping,\n // optionally customize modal content\n renderEditRowDialogContent: ({ table, row, internalEditComponents }) => (\n <>\n <DialogTitle>Edit Mapping</DialogTitle>\n <DialogContent>{internalEditComponents} </DialogContent>\n <DialogActions>\n <MRT_EditActionButtons variant=\"text\" table={table} row={row} />\n </DialogActions>\n </>\n ),\n renderRowActions: ({ row, table }) => (\n <Box sx={{ display: \"flex\" }}>\n <Tooltip title=\"Edit\">\n <IconButton onClick={() => table.setEditingRow(row)}>\n <EditIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Open in PagerDuty\">\n <IconButton\n onClick={() => openInBrowser(row.getValue(\"serviceUrl\"))}\n >\n <OpenInBrowser />\n </IconButton>\n </Tooltip>\n </Box>\n ),\n state: {\n isLoading: isLoadingMappings, // || isLoadingCatalogEntities,\n isSaving: isUpdatingMapping,\n showAlertBanner: isLoadingMappingsError, // || isLoadingCatalogEntitiesError,\n showProgressBars: isFetchingMappings, // || isFetchingCatalogEntities,\n columnVisibility: {\n serviceId: false,\n entityRef: false,\n serviceUrl: false,\n },\n },\n });\n\n return <MaterialReactTable table={dataTable} />;\n };\n\n const queryClient = new QueryClient();\n\n return (\n <QueryClientProvider client={queryClient}>\n <DenseTable />\n </QueryClientProvider>\n );\n};\n"],"names":["OpenInBrowser"],"mappings":";;;;;;;;;AAuCA,SAAS,mBAAmB,MAAiB,EAAA;AAC3C,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,QAAA;AACH,MAAO,OAAA,OAAA,CAAA;AAAA,IACT,KAAK,WAAA;AACH,MAAO,OAAA,KAAA,CAAA;AAAA,IACT,KAAK,WAAA;AACH,MAAO,OAAA,QAAA,CAAA;AAAA,IACT;AACE,MAAO,OAAA,MAAA,CAAA;AAAA,GACX;AACF,CAAA;AAEA,SAAS,aAAa,MAAiB,EAAA;AACrC,EAAA,QAAQ,MAAQ;AA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AA,EAAQ,WAC3B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAW,CACd,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"ServiceMappingComponent.esm.js","sources":["../../../src/components/PagerDutyPage/ServiceMappingComponent.tsx"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport {\n Box,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n Tooltip,\n Typography,\n} from \"@material-ui/core\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport { PagerDutyEntityMapping } from \"@pagerduty/backstage-plugin-common\";\nimport { useApi } from \"@backstage/core-plugin-api\";\nimport { pagerDutyApiRef } from \"../../api\";\nimport {\n QueryClient,\n QueryClientProvider,\n useMutation,\n // useQueries,\n useQuery,\n} from \"@tanstack/react-query\";\nimport {\n MRT_ColumnDef,\n MRT_EditActionButtons,\n MRT_TableOptions,\n MaterialReactTable,\n useMaterialReactTable,\n} from \"material-react-table\";\nimport { catalogApiRef } from \"@backstage/plugin-catalog-react\";\nimport OpenInBrowser from \"@material-ui/icons/OpenInBrowser\";\n\ntype Service = {\n name: string; // \"Ads\"\n id: string; // \"QWe1j283n12j132\"\n system: string; // \"Production\"\n owner: string; // \"Mapped\"\n lifecycle: string; // \"Ads\"\n};\n\nfunction getColorFromStatus(status?: string) {\n switch (status) {\n case \"InSync\":\n return \"green\";\n case \"OutOfSync\":\n return \"red\";\n case \"NotMapped\":\n return \"orange\";\n default:\n return \"gray\";\n }\n}\n\nfunction makeReadable(status?: string) {\n switch (status) {\n case \"InSync\":\n return \"In Sync\";\n case \"OutOfSync\":\n return \"Out of Sync\";\n case \"NotMapped\":\n return \"Not Mapped\";\n default:\n return \"Refresh to Update\";\n }\n}\n\nexport const ServiceMappingComponent = () => {\n // const [_, setEntityMappings] = useState<\n // PagerDutyEntityMapping[]\n // >([]);\n // const [catalogEntities, setCatalogEntities] = useState<Service[]>([]);\n // const [entityOptions, setEntityOptions] = useState<CatalogEntityOptions[]>([]);\n\n const pagerDutyApi = useApi(pagerDutyApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n // function fetchCatalogEntities() {\n // catalogApi\n // .getEntities({\n // filter: { kind: \"Component\" },\n // })\n // .then((result) => {\n // const entities: Service[] = [];\n // result.items.forEach((entity: any) => {\n // entities.push({\n // name: entity.metadata?.name,\n // id: entity.metadata?.uid ?? \"\",\n // system: JSON.stringify(entity.spec?.system) || \"\",\n // owner: JSON.stringify(entity.spec?.owner) || \"\",\n // lifecycle: JSON.stringify(entity.spec?.lifecycle) || \"\",\n // });\n // });\n\n // setCatalogEntities(entities);\n // });\n // }\n\n async function fetchMappings(): Promise<PagerDutyEntityMapping[]> {\n const { mappings: foundMappings } = await pagerDutyApi.getEntityMappings();\n\n // setEntityMappings(foundMappings);\n\n return foundMappings;\n }\n\n async function fetchCatalogEntities(): Promise<Service[]> {\n // if (catalogEntities.length === 0) {\n const result = await catalogApi.getEntities({\n filter: { kind: \"Component\" },\n });\n\n const entities: Service[] = [];\n result.items.forEach((entity: any) => {\n entities.push({\n name: entity.metadata?.name,\n id: entity.metadata?.uid ?? \"\",\n system: JSON.stringify(entity.spec?.system) || \"\",\n owner: JSON.stringify(entity.spec?.owner) || \"\",\n lifecycle: JSON.stringify(entity.spec?.lifecycle) || \"\",\n });\n });\n\n // setCatalogEntities(entities);\n\n return entities;\n // }\n\n // return catalogEntities;\n }\n\n type CatalogEntityOptions = {\n value: string;\n label: string;\n };\n\n // call READ hook\n const {\n data: fetchedMappings = [],\n isError: isLoadingMappingsError,\n isFetching: isFetchingMappings,\n isLoading: isLoadingMappings,\n } = useGetMappings();\n\n // call READ hook\n const {\n data: fetchedCatalogEntities = [],\n isError: isLoadingCatalogEntitiesError,\n isFetching: isFetchingCatalogEntities,\n isLoading: isLoadingCatalogEntities,\n } = useGetCatalogEntities();\n\n function getCatalogEntityOptions(): CatalogEntityOptions[] {\n const options: CatalogEntityOptions[] = [];\n // if (entityOptions.length === 0) {\n // initialize with empty object\n options.push({ value: \"\", label: \"None\" });\n // }\n\n fetchedCatalogEntities.forEach((entity) => {\n // find entity with entity.id in entityMappings array\n const foundEntity = fetchedMappings.find(\n (item) => item.entityRef === entity.id\n );\n\n if (!foundEntity) {\n options.push({\n value: entity.id,\n label: entity.name,\n });\n }\n });\n\n // setEntityOptions(options);\n\n return options;\n }\n\n function useGetMappings() {\n return useQuery<PagerDutyEntityMapping[]>({\n queryKey: [\"mappings\"],\n queryFn: async () => fetchMappings(),\n refetchOnWindowFocus: false,\n });\n }\n\n // READ hook (get catalog entities from api)\n function useGetCatalogEntities() {\n return useQuery<Service[]>({\n queryKey: [\"entities\"],\n queryFn: async () => fetchCatalogEntities(),\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n });\n }\n\n // UPDATE hook (put mapping in api)\n function useUpdateMapping() {\n // const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (mapping: PagerDutyEntityMapping) => {\n return await pagerDutyApi.storeServiceMapping(\n mapping.serviceId,\n mapping.entityRef\n );\n },\n // client side optimistic update\n // onMutate: (newMappingInfo: PagerDutyEntityMapping) => {\n // queryClient.setQueryData([\"updateMappings\"], (prevMappings: any) =>\n // prevMappings?.map((prevMapping: PagerDutyEntityMapping) => {\n // if (prevMapping.serviceId === newMappingInfo.serviceId) {\n // newMappingInfo.entityName =\n // fetchedCatalogEntities.find(\n // (entity) => entity.id === newMappingInfo.entityRef\n // )?.name || \"\";\n\n // return newMappingInfo;\n // }\n // return prevMapping;\n // })\n // );\n // },\n });\n }\n\n // call UPDATE hook\n const { mutateAsync: updateMapping, isPending: isUpdatingMapping } =\n useUpdateMapping();\n\n // UPDATE action\n const handleSaveMapping: MRT_TableOptions<PagerDutyEntityMapping>[\"onEditingRowSave\"] =\n async ({ values, table }) => {\n values.entityName =\n fetchedCatalogEntities.find(\n (entity) => entity.id === values.entityRef\n )?.name || \"\";\n values.status = \"RefreshToUpdate\";\n await updateMapping(values);\n table.setEditingRow(null); // exit editing mode\n };\n\n const openInBrowser = (url: string) => {\n window.open(url, \"_blank\", \"noreferrer\");\n };\n\n const DenseTable = () => {\n const [validationErrors, setValidationErrors] = useState<\n Record<string, string | undefined>\n >({});\n\n const columns = useMemo<MRT_ColumnDef<PagerDutyEntityMapping>[]>(\n () => [\n {\n accessorKey: \"serviceId\",\n header: \"Service ID\",\n visibleInShowHideMenu: false,\n enableEditing: false,\n Edit: () => null,\n Cell: ({ cell }) => (\n <Typography variant=\"body1\" style={{ fontWeight: 600 }}>\n {cell.getValue<string>()}\n </Typography>\n ),\n },\n {\n accessorKey: \"serviceName\",\n header: \"PagerDuty Service\",\n enableEditing: false,\n },\n {\n accessorKey: \"team\",\n header: \"Team\",\n enableEditing: false,\n },\n {\n accessorKey: \"escalationPolicy\",\n header: \"Escalation Policy\",\n enableEditing: false,\n },\n {\n accessorKey: \"entityRef\",\n header: \"Mapping\",\n visibleInShowHideMenu: false,\n editVariant: \"select\",\n editSelectOptions: getCatalogEntityOptions(),\n muiEditTextFieldProps: {\n select: true,\n error: !!validationErrors?.state,\n helperText: validationErrors?.state,\n },\n },\n {\n accessorKey: \"entityName\",\n header: \"Mapped Entity Name\",\n enableEditing: false,\n Edit: () => null,\n },\n {\n accessorKey: \"status\",\n header: \"Status\",\n enableEditing: false,\n Edit: () => null,\n Cell: ({ cell }) => (\n <Box\n component=\"span\"\n bgcolor={getColorFromStatus(cell.getValue<string>())}\n borderRadius=\"0.25rem\"\n color=\"white\"\n p=\"0.25rem\"\n >\n {makeReadable(cell.getValue<string>())}\n </Box>\n ),\n },\n {\n accessorKey: \"serviceUrl\",\n header: \"Service URL\",\n visibleInShowHideMenu: false,\n enableEditing: false,\n Edit: () => null,\n },\n ],\n [validationErrors]\n );\n\n const dataTable = useMaterialReactTable({\n columns,\n data: fetchedMappings,\n editDisplayMode: \"modal\", // default ('row', 'cell', 'table', and 'custom' are also available)\n enableEditing: true,\n positionActionsColumn: \"last\",\n enableStickyHeader: true,\n enableFilters: true,\n getRowId: (row) => row.serviceId,\n muiToolbarAlertBannerProps: isLoadingMappingsError\n ? {\n color: \"error\",\n children: \"Error loading data\",\n }\n : undefined,\n muiTableContainerProps: {\n sx: {\n minHeight: \"500px\",\n },\n },\n onEditingRowCancel: () => setValidationErrors({}),\n onEditingRowSave: handleSaveMapping,\n // optionally customize modal content\n renderEditRowDialogContent: ({ table, row, internalEditComponents }) => (\n <>\n <DialogTitle>Edit Mapping</DialogTitle>\n <DialogContent>{internalEditComponents} </DialogContent>\n <DialogActions>\n <MRT_EditActionButtons variant=\"text\" table={table} row={row} />\n </DialogActions>\n </>\n ),\n renderRowActions: ({ row, table }) => (\n <Box sx={{ display: \"flex\" }}>\n <Tooltip title=\"Edit\">\n <IconButton onClick={() => table.setEditingRow(row)}>\n <EditIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Open in PagerDuty\">\n <IconButton\n onClick={() => openInBrowser(row.getValue(\"serviceUrl\"))}\n >\n <OpenInBrowser />\n </IconButton>\n </Tooltip>\n </Box>\n ),\n state: {\n isLoading: isLoadingMappings || isLoadingCatalogEntities,\n isSaving: isUpdatingMapping,\n showAlertBanner:\n isLoadingMappingsError || isLoadingCatalogEntitiesError,\n showProgressBars: isFetchingMappings || isFetchingCatalogEntities,\n columnVisibility: {\n serviceId: false,\n entityRef: false,\n serviceUrl: false,\n },\n },\n });\n\n return <MaterialReactTable table={dataTable} />;\n };\n\n const queryClient = new QueryClient();\n\n return (\n <QueryClientProvider client={queryClient}>\n <DenseTable />\n </QueryClientProvider>\n );\n};\n"],"names":["OpenInBrowser"],"mappings":";;;;;;;;;;AAuCA,SAAS,mBAAmB,MAAiB,EAAA;AAC3C,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,QAAA;AACH,MAAO,OAAA,OAAA,CAAA;AAAA,IACT,KAAK,WAAA;AACH,MAAO,OAAA,KAAA,CAAA;AAAA,IACT,KAAK,WAAA;AACH,MAAO,OAAA,QAAA,CAAA;AAAA,IACT;AACE,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