@red-hat-developer-hub/backstage-plugin-adoption-insights 0.0.2
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 +9 -0
- package/README.md +88 -0
- package/app-config.dynamic.yaml +16 -0
- package/dist/api/index.esm.js +106 -0
- package/dist/api/index.esm.js.map +1 -0
- package/dist/components/ActiveUsers/ActiveUsers.esm.js +125 -0
- package/dist/components/ActiveUsers/ActiveUsers.esm.js.map +1 -0
- package/dist/components/ActiveUsers/CustomLegend.esm.js +58 -0
- package/dist/components/ActiveUsers/CustomLegend.esm.js.map +1 -0
- package/dist/components/ActiveUsers/CustomTooltip.esm.js +87 -0
- package/dist/components/ActiveUsers/CustomTooltip.esm.js.map +1 -0
- package/dist/components/ActiveUsers/ExportCSVButton.esm.js +75 -0
- package/dist/components/ActiveUsers/ExportCSVButton.esm.js.map +1 -0
- package/dist/components/ActiveUsers/index.esm.js +6 -0
- package/dist/components/ActiveUsers/index.esm.js.map +1 -0
- package/dist/components/AdoptionInsightsPage/AdoptionInsightsPage.esm.js +29 -0
- package/dist/components/AdoptionInsightsPage/AdoptionInsightsPage.esm.js.map +1 -0
- package/dist/components/AdoptionInsightsPage/index.esm.js +2 -0
- package/dist/components/AdoptionInsightsPage/index.esm.js.map +1 -0
- package/dist/components/CardFooter/TableFooterPagination.esm.js +70 -0
- package/dist/components/CardFooter/TableFooterPagination.esm.js.map +1 -0
- package/dist/components/CardFooter/index.esm.js +6 -0
- package/dist/components/CardFooter/index.esm.js.map +1 -0
- package/dist/components/CardWrapper/CardWrapper.esm.js +42 -0
- package/dist/components/CardWrapper/CardWrapper.esm.js.map +1 -0
- package/dist/components/CardWrapper/index.esm.js +6 -0
- package/dist/components/CardWrapper/index.esm.js.map +1 -0
- package/dist/components/CatalogEntities/CatalogEntities.esm.js +158 -0
- package/dist/components/CatalogEntities/CatalogEntities.esm.js.map +1 -0
- package/dist/components/CatalogEntities/FilterDropdown.esm.js +33 -0
- package/dist/components/CatalogEntities/FilterDropdown.esm.js.map +1 -0
- package/dist/components/CatalogEntities/index.esm.js +6 -0
- package/dist/components/CatalogEntities/index.esm.js.map +1 -0
- package/dist/components/Common/CustomCursor.esm.js +22 -0
- package/dist/components/Common/CustomCursor.esm.js.map +1 -0
- package/dist/components/Common/EmptyChartState.esm.js +9 -0
- package/dist/components/Common/EmptyChartState.esm.js.map +1 -0
- package/dist/components/Common/PermissionRequiredIcon.esm.js +9 -0
- package/dist/components/Common/PermissionRequiredIcon.esm.js.map +1 -0
- package/dist/components/Common/PermissionRequiredState.esm.js +43 -0
- package/dist/components/Common/PermissionRequiredState.esm.js.map +1 -0
- package/dist/components/Header/DateRangeContext.esm.js +34 -0
- package/dist/components/Header/DateRangeContext.esm.js.map +1 -0
- package/dist/components/Header/DateRangePicker.esm.js +160 -0
- package/dist/components/Header/DateRangePicker.esm.js.map +1 -0
- package/dist/components/Header/Header.esm.js +195 -0
- package/dist/components/Header/Header.esm.js.map +1 -0
- package/dist/components/Header/index.esm.js +6 -0
- package/dist/components/Header/index.esm.js.map +1 -0
- package/dist/components/Plugins/Plugins.esm.js +113 -0
- package/dist/components/Plugins/Plugins.esm.js.map +1 -0
- package/dist/components/Plugins/index.esm.js +6 -0
- package/dist/components/Plugins/index.esm.js.map +1 -0
- package/dist/components/Searches/CustomTooltip.esm.js +66 -0
- package/dist/components/Searches/CustomTooltip.esm.js.map +1 -0
- package/dist/components/Searches/Searches.esm.js +106 -0
- package/dist/components/Searches/Searches.esm.js.map +1 -0
- package/dist/components/Searches/index.esm.js +6 -0
- package/dist/components/Searches/index.esm.js.map +1 -0
- package/dist/components/Techdocs/Techdocs.esm.js +129 -0
- package/dist/components/Techdocs/Techdocs.esm.js.map +1 -0
- package/dist/components/Techdocs/index.esm.js +6 -0
- package/dist/components/Techdocs/index.esm.js.map +1 -0
- package/dist/components/Templates/Templates.esm.js +118 -0
- package/dist/components/Templates/Templates.esm.js.map +1 -0
- package/dist/components/Templates/index.esm.js +6 -0
- package/dist/components/Templates/index.esm.js.map +1 -0
- package/dist/components/Users/Info.esm.js +39 -0
- package/dist/components/Users/Info.esm.js.map +1 -0
- package/dist/components/Users/Tooltip.esm.js +48 -0
- package/dist/components/Users/Tooltip.esm.js.map +1 -0
- package/dist/components/Users/Users.esm.js +143 -0
- package/dist/components/Users/Users.esm.js.map +1 -0
- package/dist/components/Users/index.esm.js +6 -0
- package/dist/components/Users/index.esm.js.map +1 -0
- package/dist/hooks/useActiveUsers.esm.js +44 -0
- package/dist/hooks/useActiveUsers.esm.js.map +1 -0
- package/dist/hooks/useAdoptionInsightsEventsReadPermission.esm.js +15 -0
- package/dist/hooks/useAdoptionInsightsEventsReadPermission.esm.js.map +1 -0
- package/dist/hooks/useCatalogEntities.esm.js +45 -0
- package/dist/hooks/useCatalogEntities.esm.js.map +1 -0
- package/dist/hooks/usePlugins.esm.js +44 -0
- package/dist/hooks/usePlugins.esm.js.map +1 -0
- package/dist/hooks/useSearches.esm.js +43 -0
- package/dist/hooks/useSearches.esm.js.map +1 -0
- package/dist/hooks/useTechdocs.esm.js +41 -0
- package/dist/hooks/useTechdocs.esm.js.map +1 -0
- package/dist/hooks/useTemplates.esm.js +43 -0
- package/dist/hooks/useTemplates.esm.js.map +1 -0
- package/dist/hooks/useUsers.esm.js +36 -0
- package/dist/hooks/useUsers.esm.js.map +1 -0
- package/dist/images/permission-required.svg +48 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.esm.js +7 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/plugin.esm.js +34 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +8 -0
- package/dist/routes.esm.js.map +1 -0
- package/dist/utils/constants.esm.js +33 -0
- package/dist/utils/constants.esm.js.map +1 -0
- package/dist/utils/utils.esm.js +148 -0
- package/dist/utils/utils.esm.js.map +1 -0
- package/package.json +83 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { Page, Content } from '@backstage/core-components';
|
3
|
+
import Masonry from '@mui/lab/Masonry';
|
4
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
5
|
+
import { useTheme } from '@mui/material/styles';
|
6
|
+
import InsightsHeader from '../Header/Header.esm.js';
|
7
|
+
import CatalogEntities from '../CatalogEntities/CatalogEntities.esm.js';
|
8
|
+
import Templates from '../Templates/Templates.esm.js';
|
9
|
+
import Techdocs from '../Techdocs/Techdocs.esm.js';
|
10
|
+
import ActiveUsers from '../ActiveUsers/ActiveUsers.esm.js';
|
11
|
+
import Plugins from '../Plugins/Plugins.esm.js';
|
12
|
+
import Searches from '../Searches/Searches.esm.js';
|
13
|
+
import Users from '../Users/Users.esm.js';
|
14
|
+
import { DateRangeProvider } from '../Header/DateRangeContext.esm.js';
|
15
|
+
import { useAdoptionInsightsEventsReadPermission } from '../../hooks/useAdoptionInsightsEventsReadPermission.esm.js';
|
16
|
+
import PermissionRequiredState from '../Common/PermissionRequiredState.esm.js';
|
17
|
+
|
18
|
+
const AdoptionInsightsPage = () => {
|
19
|
+
const theme = useTheme();
|
20
|
+
const isSmallScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
21
|
+
const { allowed: hasEventsReadPermission, loading } = useAdoptionInsightsEventsReadPermission();
|
22
|
+
if (loading) {
|
23
|
+
return null;
|
24
|
+
}
|
25
|
+
return /* @__PURE__ */ React__default.createElement(Page, { themeId: "home" }, !hasEventsReadPermission ? /* @__PURE__ */ React__default.createElement(Content, null, /* @__PURE__ */ React__default.createElement(PermissionRequiredState, null)) : /* @__PURE__ */ React__default.createElement(DateRangeProvider, null, /* @__PURE__ */ React__default.createElement(InsightsHeader, { title: "Adoption Insights" }), /* @__PURE__ */ React__default.createElement(Content, null, /* @__PURE__ */ React__default.createElement(Masonry, { columns: isSmallScreen ? 1 : 2, spacing: 2 }, /* @__PURE__ */ React__default.createElement(ActiveUsers, null), /* @__PURE__ */ React__default.createElement(Users, null), /* @__PURE__ */ React__default.createElement(Templates, null), /* @__PURE__ */ React__default.createElement(CatalogEntities, null), /* @__PURE__ */ React__default.createElement(Plugins, null), /* @__PURE__ */ React__default.createElement(Techdocs, null), /* @__PURE__ */ React__default.createElement(Searches, null)))));
|
26
|
+
};
|
27
|
+
|
28
|
+
export { AdoptionInsightsPage };
|
29
|
+
//# sourceMappingURL=AdoptionInsightsPage.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AdoptionInsightsPage.esm.js","sources":["../../../src/components/AdoptionInsightsPage/AdoptionInsightsPage.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nimport { Content, Page } from '@backstage/core-components';\nimport Masonry from '@mui/lab/Masonry';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport { useTheme } from '@mui/material/styles';\n\nimport InsightsHeader from '../Header';\nimport CatalogEntities from '../CatalogEntities';\nimport Templates from '../Templates';\nimport Techdocs from '../Techdocs';\nimport ActiveUsers from '../ActiveUsers';\nimport Plugins from '../Plugins';\nimport Searches from '../Searches';\nimport Users from '../Users';\nimport { DateRangeProvider } from '../Header/DateRangeContext';\nimport { useAdoptionInsightsEventsReadPermission } from '../../hooks/useAdoptionInsightsEventsReadPermission';\nimport PermissionRequiredState from '../Common/PermissionRequiredState';\n\nexport const AdoptionInsightsPage = () => {\n const theme = useTheme();\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'));\n const { allowed: hasEventsReadPermission, loading } =\n useAdoptionInsightsEventsReadPermission();\n\n if (loading) {\n return null;\n }\n\n return (\n <Page themeId=\"home\">\n {!hasEventsReadPermission ? (\n <Content>\n <PermissionRequiredState />\n </Content>\n ) : (\n <DateRangeProvider>\n <InsightsHeader title=\"Adoption Insights\" />\n <Content>\n <Masonry columns={isSmallScreen ? 1 : 2} spacing={2}>\n <ActiveUsers />\n <Users />\n <Templates />\n <CatalogEntities />\n <Plugins />\n <Techdocs />\n <Searches />\n </Masonry>\n </Content>\n </DateRangeProvider>\n )}\n </Page>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;AAkCO,MAAM,uBAAuB,MAAM;AACxC,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EAAA,MAAM,gBAAgB,aAAc,CAAA,KAAA,CAAM,WAAY,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA;AAChE,EAAA,MAAM,EAAE,OAAA,EAAS,uBAAyB,EAAA,OAAA,KACxC,uCAAwC,EAAA;AAE1C,EAAA,IAAI,OAAS,EAAA;AACX,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAAA,cAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACX,EAAA,EAAA,CAAC,0CACCA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,IAAA,kBACEA,cAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,IAAwB,CAC3B,CAAA,gDAEC,iBACC,EAAA,IAAA,kBAAAA,cAAA,CAAA,aAAA,CAAC,cAAe,EAAA,EAAA,KAAA,EAAM,mBAAoB,EAAA,CAAA,+CACzC,OACC,EAAA,IAAA,kBAAAA,cAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,OAAA,EAAS,aAAgB,GAAA,CAAA,GAAI,GAAG,OAAS,EAAA,CAAA,EAAA,kBAC/CA,cAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,CACb,kBAAAA,cAAA,CAAA,aAAA,CAAC,WAAM,CACP,kBAAAA,cAAA,CAAA,aAAA,CAAC,SAAU,EAAA,IAAA,CAAA,kBACVA,cAAA,CAAA,aAAA,CAAA,eAAA,EAAA,IAAgB,mBAChBA,cAAA,CAAA,aAAA,CAAA,OAAA,EAAA,IAAQ,CACT,kBAAAA,cAAA,CAAA,aAAA,CAAC,QAAS,EAAA,IAAA,CAAA,+CACT,QAAS,EAAA,IAAA,CACZ,CACF,CACF,CAEJ,CAAA;AAEJ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import Box from '@mui/material/Box';
|
3
|
+
import Paper from '@mui/material/Paper';
|
4
|
+
import TablePagination from '@mui/material/TablePagination';
|
5
|
+
|
6
|
+
const TableFooterPagination = ({
|
7
|
+
count,
|
8
|
+
rowsPerPage,
|
9
|
+
page,
|
10
|
+
handleChangePage,
|
11
|
+
handleChangeRowsPerPage
|
12
|
+
}) => {
|
13
|
+
return /* @__PURE__ */ React__default.createElement(
|
14
|
+
Box,
|
15
|
+
{
|
16
|
+
component: Paper,
|
17
|
+
sx: {
|
18
|
+
display: "flex",
|
19
|
+
justifyContent: "flex-end",
|
20
|
+
padding: 1
|
21
|
+
}
|
22
|
+
},
|
23
|
+
/* @__PURE__ */ React__default.createElement(
|
24
|
+
TablePagination,
|
25
|
+
{
|
26
|
+
sx: {
|
27
|
+
"& .v5-MuiTablePagination-select:focus": {
|
28
|
+
backgroundColor: "transparent"
|
29
|
+
}
|
30
|
+
},
|
31
|
+
rowsPerPageOptions: [
|
32
|
+
{ label: "Top 3", value: 3 },
|
33
|
+
{ label: "Top 5", value: 5 },
|
34
|
+
{ label: "Top 10", value: 10 },
|
35
|
+
{ label: "Top 20", value: 20 }
|
36
|
+
],
|
37
|
+
component: "div",
|
38
|
+
count,
|
39
|
+
rowsPerPage,
|
40
|
+
page,
|
41
|
+
onPageChange: handleChangePage,
|
42
|
+
onRowsPerPageChange: handleChangeRowsPerPage,
|
43
|
+
labelRowsPerPage: null,
|
44
|
+
labelDisplayedRows: () => null,
|
45
|
+
ActionsComponent: () => null,
|
46
|
+
slotProps: {
|
47
|
+
select: {
|
48
|
+
MenuProps: {
|
49
|
+
MenuListProps: {
|
50
|
+
autoFocusItem: false
|
51
|
+
},
|
52
|
+
PaperProps: {
|
53
|
+
sx: {
|
54
|
+
width: 190,
|
55
|
+
boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.2)",
|
56
|
+
borderRadius: 2,
|
57
|
+
border: (theme) => `1px solid ${theme.palette.grey[300]}`,
|
58
|
+
overflow: "hidden"
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
)
|
66
|
+
);
|
67
|
+
};
|
68
|
+
|
69
|
+
export { TableFooterPagination as default };
|
70
|
+
//# sourceMappingURL=TableFooterPagination.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TableFooterPagination.esm.js","sources":["../../../src/components/CardFooter/TableFooterPagination.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\nimport Box from '@mui/material/Box';\nimport Paper from '@mui/material/Paper';\nimport TablePagination from '@mui/material/TablePagination';\n\ninterface TableFooterPaginationProps {\n count: number;\n rowsPerPage: number;\n page: number;\n handleChangePage: (\n event: React.MouseEvent<HTMLButtonElement> | null,\n newPage: number,\n ) => void;\n handleChangeRowsPerPage: (\n event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => void;\n}\n\nconst TableFooterPagination: React.FC<TableFooterPaginationProps> = ({\n count,\n rowsPerPage,\n page,\n handleChangePage,\n handleChangeRowsPerPage,\n}) => {\n return (\n <Box\n component={Paper}\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n padding: 1,\n }}\n >\n <TablePagination\n sx={{\n '& .v5-MuiTablePagination-select:focus': {\n backgroundColor: 'transparent',\n },\n }}\n rowsPerPageOptions={[\n { label: 'Top 3', value: 3 },\n { label: 'Top 5', value: 5 },\n { label: 'Top 10', value: 10 },\n { label: 'Top 20', value: 20 },\n ]}\n component=\"div\"\n count={count}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n labelRowsPerPage={null}\n labelDisplayedRows={() => null}\n ActionsComponent={() => null}\n slotProps={{\n select: {\n MenuProps: {\n MenuListProps: {\n autoFocusItem: false,\n },\n PaperProps: {\n sx: {\n width: 190,\n boxShadow: '0px 4px 10px rgba(0, 0, 0, 0.2)',\n borderRadius: 2,\n border: theme => `1px solid ${theme.palette.grey[300]}`,\n overflow: 'hidden',\n },\n },\n },\n },\n }}\n />\n </Box>\n );\n};\n\nexport default TableFooterPagination;\n"],"names":["React"],"mappings":";;;;;AAiCA,MAAM,wBAA8D,CAAC;AAAA,EACnE,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,KAAA;AAAA,MACX,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,cAAgB,EAAA,UAAA;AAAA,QAChB,OAAS,EAAA;AAAA;AACX,KAAA;AAAA,oBAEAA,cAAA,CAAA,aAAA;AAAA,MAAC,eAAA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+
import React__default from 'react';
|
2
|
+
import Paper from '@mui/material/Paper';
|
3
|
+
import Box from '@mui/material/Box';
|
4
|
+
import Divider from '@mui/material/Divider';
|
5
|
+
import Typography from '@mui/material/Typography';
|
6
|
+
|
7
|
+
const CardWrapper = ({
|
8
|
+
children,
|
9
|
+
title,
|
10
|
+
filter
|
11
|
+
}) => {
|
12
|
+
return /* @__PURE__ */ React__default.createElement(
|
13
|
+
Box,
|
14
|
+
{
|
15
|
+
component: Paper,
|
16
|
+
sx: { border: (theme) => `1px solid ${theme.palette.grey[300]}` }
|
17
|
+
},
|
18
|
+
/* @__PURE__ */ React__default.createElement(Box, { sx: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ React__default.createElement(
|
19
|
+
Typography,
|
20
|
+
{
|
21
|
+
variant: "h5",
|
22
|
+
sx: {
|
23
|
+
p: 3,
|
24
|
+
display: "flex",
|
25
|
+
alignItems: "center",
|
26
|
+
fontWeight: "bold"
|
27
|
+
}
|
28
|
+
},
|
29
|
+
title
|
30
|
+
), filter && /* @__PURE__ */ React__default.createElement(Box, null, filter)),
|
31
|
+
/* @__PURE__ */ React__default.createElement(
|
32
|
+
Divider,
|
33
|
+
{
|
34
|
+
sx: { border: (theme) => `1px solid ${theme.palette.grey[300]}` }
|
35
|
+
}
|
36
|
+
),
|
37
|
+
/* @__PURE__ */ React__default.createElement(Box, null, children)
|
38
|
+
);
|
39
|
+
};
|
40
|
+
|
41
|
+
export { CardWrapper as default };
|
42
|
+
//# sourceMappingURL=CardWrapper.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardWrapper.esm.js","sources":["../../../src/components/CardWrapper/CardWrapper.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nimport Paper from '@mui/material/Paper';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\nimport Typography from '@mui/material/Typography';\n\ninterface CardWrapperProps extends React.HTMLProps<HTMLDivElement> {\n children: React.ReactNode;\n title: string;\n filter?: React.ReactNode;\n}\n\nconst CardWrapper: React.FC<CardWrapperProps> = ({\n children,\n title,\n filter,\n}: CardWrapperProps) => {\n return (\n <Box\n component={Paper}\n sx={{ border: theme => `1px solid ${theme.palette.grey[300]}` }}\n >\n <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>\n <Typography\n variant=\"h5\"\n sx={{\n p: 3,\n display: 'flex',\n alignItems: 'center',\n fontWeight: 'bold',\n }}\n >\n {title}\n </Typography>\n\n {filter && <Box>{filter}</Box>}\n </Box>\n <Divider\n sx={{ border: theme => `1px solid ${theme.palette.grey[300]}` }}\n />\n <Box>{children}</Box>\n </Box>\n );\n};\n\nexport default CardWrapper;\n"],"names":["React"],"mappings":";;;;;;AA4BA,MAAM,cAA0C,CAAC;AAAA,EAC/C,QAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAwB,KAAA;AACtB,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,KAAA;AAAA,MACX,EAAA,EAAI,EAAE,MAAA,EAAQ,CAAS,KAAA,KAAA,CAAA,UAAA,EAAa,MAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAG,CAAA;AAAA,KAAA;AAAA,oBAE9DA,cAAA,CAAA,aAAA,CAAC,OAAI,EAAI,EAAA,EAAE,SAAS,MAAQ,EAAA,cAAA,EAAgB,iBAC1C,EAAA,kBAAAA,cAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,IAAA;AAAA,QACR,EAAI,EAAA;AAAA,UACF,CAAG,EAAA,CAAA;AAAA,UACH,OAAS,EAAA,MAAA;AAAA,UACT,UAAY,EAAA,QAAA;AAAA,UACZ,UAAY,EAAA;AAAA;AACd,OAAA;AAAA,MAEC;AAAA,KAGF,EAAA,MAAA,oBAAWA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,IAAA,EAAK,MAAO,CAC1B,CAAA;AAAA,oBACAA,cAAA,CAAA,aAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,EAAE,MAAA,EAAQ,CAAS,KAAA,KAAA,CAAA,UAAA,EAAa,MAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAG,CAAA;AAAA;AAAA,KAChE;AAAA,oBACAA,cAAA,CAAA,aAAA,CAAC,WAAK,QAAS;AAAA,GACjB;AAEJ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
@@ -0,0 +1,158 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import Box from '@mui/material/Box';
|
3
|
+
import Table from '@mui/material/Table';
|
4
|
+
import TableBody from '@mui/material/TableBody';
|
5
|
+
import TableCell from '@mui/material/TableCell';
|
6
|
+
import TableFooter from '@mui/material/TableFooter';
|
7
|
+
import TableHead from '@mui/material/TableHead';
|
8
|
+
import TableRow from '@mui/material/TableRow';
|
9
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
10
|
+
import Link from '@mui/material/Link';
|
11
|
+
import { entityRouteRef } from '@backstage/plugin-catalog-react';
|
12
|
+
import { useRouteRef } from '@backstage/core-plugin-api';
|
13
|
+
import CardWrapper from '../CardWrapper/CardWrapper.esm.js';
|
14
|
+
import { CATALOG_ENTITIES_TITLE, CATALOG_ENTITIES_TABLE_HEADERS } from '../../utils/constants.esm.js';
|
15
|
+
import { useCatalogEntities } from '../../hooks/useCatalogEntities.esm.js';
|
16
|
+
import TableFooterPagination from '../CardFooter/TableFooterPagination.esm.js';
|
17
|
+
import { getUniqueCatalogEntityKinds, getLastUsedDay } from '../../utils/utils.esm.js';
|
18
|
+
import FilterDropdown from './FilterDropdown.esm.js';
|
19
|
+
import EmptyChartState from '../Common/EmptyChartState.esm.js';
|
20
|
+
|
21
|
+
const CatalogEntities = () => {
|
22
|
+
const [page, setPage] = React__default.useState(0);
|
23
|
+
const [limit] = React__default.useState(20);
|
24
|
+
const [rowsPerPage, setRowsPerPage] = React__default.useState(3);
|
25
|
+
const [selectedOption, setSelectedOption] = React__default.useState("");
|
26
|
+
const [uniqueCatalogEntityKinds, setUniqueCatalogEntityKinds] = React__default.useState([]);
|
27
|
+
const entityLink = useRouteRef(entityRouteRef);
|
28
|
+
const { catalogEntities, loading } = useCatalogEntities({
|
29
|
+
limit,
|
30
|
+
kind: selectedOption === "All" ? "" : selectedOption.toLocaleLowerCase()
|
31
|
+
});
|
32
|
+
React__default.useEffect(() => {
|
33
|
+
if (catalogEntities?.data?.length > 0 && uniqueCatalogEntityKinds?.length === 0) {
|
34
|
+
const uniqueKinds = getUniqueCatalogEntityKinds(catalogEntities.data);
|
35
|
+
setUniqueCatalogEntityKinds(uniqueKinds);
|
36
|
+
}
|
37
|
+
}, [catalogEntities, uniqueCatalogEntityKinds]);
|
38
|
+
const handleChangePage = React__default.useCallback(
|
39
|
+
(_event, newPage) => {
|
40
|
+
setPage(newPage);
|
41
|
+
},
|
42
|
+
[]
|
43
|
+
);
|
44
|
+
const handleChangeRowsPerPage = React__default.useCallback(
|
45
|
+
(event) => {
|
46
|
+
setRowsPerPage(+event.target.value);
|
47
|
+
setPage(0);
|
48
|
+
},
|
49
|
+
[]
|
50
|
+
);
|
51
|
+
const handleChange = React__default.useCallback((event) => {
|
52
|
+
setSelectedOption(event.target.value);
|
53
|
+
}, []);
|
54
|
+
const visibleCatalogEntities = React__default.useMemo(() => {
|
55
|
+
return catalogEntities.data?.filter((entity) => {
|
56
|
+
if (selectedOption && selectedOption !== "All") {
|
57
|
+
return entity.kind.toLocaleLowerCase() === selectedOption.toLocaleLowerCase();
|
58
|
+
}
|
59
|
+
return true;
|
60
|
+
}).slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage);
|
61
|
+
}, [catalogEntities, page, rowsPerPage, selectedOption]);
|
62
|
+
if ((!visibleCatalogEntities || visibleCatalogEntities?.length === 0) && !loading) {
|
63
|
+
return /* @__PURE__ */ React__default.createElement(CardWrapper, { title: CATALOG_ENTITIES_TITLE }, /* @__PURE__ */ React__default.createElement(
|
64
|
+
Box,
|
65
|
+
{
|
66
|
+
display: "flex",
|
67
|
+
justifyContent: "center",
|
68
|
+
alignItems: "center",
|
69
|
+
height: 200
|
70
|
+
},
|
71
|
+
/* @__PURE__ */ React__default.createElement(EmptyChartState, null)
|
72
|
+
));
|
73
|
+
}
|
74
|
+
return /* @__PURE__ */ React__default.createElement(
|
75
|
+
CardWrapper,
|
76
|
+
{
|
77
|
+
title: CATALOG_ENTITIES_TITLE,
|
78
|
+
filter: /* @__PURE__ */ React__default.createElement(
|
79
|
+
FilterDropdown,
|
80
|
+
{
|
81
|
+
selectedOption,
|
82
|
+
handleChange,
|
83
|
+
uniqueCatalogEntityKinds
|
84
|
+
}
|
85
|
+
)
|
86
|
+
},
|
87
|
+
/* @__PURE__ */ React__default.createElement(Table, { "aria-labelledby": "Catalog entities", sx: { width: "100%" } }, /* @__PURE__ */ React__default.createElement(TableHead, null, /* @__PURE__ */ React__default.createElement(TableRow, null, CATALOG_ENTITIES_TABLE_HEADERS.map((header) => /* @__PURE__ */ React__default.createElement(
|
88
|
+
TableCell,
|
89
|
+
{
|
90
|
+
key: header.id,
|
91
|
+
align: "left",
|
92
|
+
sx: {
|
93
|
+
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`,
|
94
|
+
width: "25%"
|
95
|
+
}
|
96
|
+
},
|
97
|
+
header.title
|
98
|
+
)))), /* @__PURE__ */ React__default.createElement(TableBody, null, loading ? /* @__PURE__ */ React__default.createElement(TableRow, null, /* @__PURE__ */ React__default.createElement(
|
99
|
+
TableCell,
|
100
|
+
{
|
101
|
+
colSpan: CATALOG_ENTITIES_TABLE_HEADERS.length,
|
102
|
+
align: "center"
|
103
|
+
},
|
104
|
+
/* @__PURE__ */ React__default.createElement(CircularProgress, null)
|
105
|
+
)) : visibleCatalogEntities?.map((entity) => /* @__PURE__ */ React__default.createElement(
|
106
|
+
TableRow,
|
107
|
+
{
|
108
|
+
key: `${entity.kind}-${entity.name}`,
|
109
|
+
sx: {
|
110
|
+
"&:nth-of-type(odd)": { backgroundColor: "inherit" },
|
111
|
+
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`
|
112
|
+
}
|
113
|
+
},
|
114
|
+
/* @__PURE__ */ React__default.createElement(TableCell, { sx: { width: "25%" } }, /* @__PURE__ */ React__default.createElement(
|
115
|
+
Link,
|
116
|
+
{
|
117
|
+
component: "a",
|
118
|
+
href: entityLink({
|
119
|
+
kind: entity.kind,
|
120
|
+
namespace: entity.namespace,
|
121
|
+
name: entity.name
|
122
|
+
}),
|
123
|
+
target: "_blank",
|
124
|
+
rel: "noopener noreferrer",
|
125
|
+
sx: {
|
126
|
+
textDecoration: "none",
|
127
|
+
"&:hover": {
|
128
|
+
textDecoration: "none"
|
129
|
+
}
|
130
|
+
}
|
131
|
+
},
|
132
|
+
entity.name ?? "--"
|
133
|
+
)),
|
134
|
+
/* @__PURE__ */ React__default.createElement(TableCell, { sx: { width: "25%" } }, entity.kind?.charAt(0).toLocaleUpperCase("en-US") + entity.kind?.slice(1) || "--"),
|
135
|
+
/* @__PURE__ */ React__default.createElement(TableCell, { sx: { width: "25%" } }, getLastUsedDay(entity.last_used) ?? "--"),
|
136
|
+
/* @__PURE__ */ React__default.createElement(TableCell, { sx: { width: "25%" } }, Number(entity.count).toLocaleString() ?? "--")
|
137
|
+
))), /* @__PURE__ */ React__default.createElement(TableFooter, null, /* @__PURE__ */ React__default.createElement(TableRow, null, /* @__PURE__ */ React__default.createElement(
|
138
|
+
TableCell,
|
139
|
+
{
|
140
|
+
colSpan: CATALOG_ENTITIES_TABLE_HEADERS.length,
|
141
|
+
sx: { padding: 0 }
|
142
|
+
},
|
143
|
+
/* @__PURE__ */ React__default.createElement(
|
144
|
+
TableFooterPagination,
|
145
|
+
{
|
146
|
+
count: catalogEntities.data?.length,
|
147
|
+
rowsPerPage,
|
148
|
+
page,
|
149
|
+
handleChangePage,
|
150
|
+
handleChangeRowsPerPage
|
151
|
+
}
|
152
|
+
)
|
153
|
+
))))
|
154
|
+
);
|
155
|
+
};
|
156
|
+
|
157
|
+
export { CatalogEntities as default };
|
158
|
+
//# sourceMappingURL=CatalogEntities.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CatalogEntities.esm.js","sources":["../../../src/components/CatalogEntities/CatalogEntities.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nimport Box from '@mui/material/Box';\nimport { SelectChangeEvent } from '@mui/material/Select';\nimport Table from '@mui/material/Table';\nimport TableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableFooter from '@mui/material/TableFooter';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport Link from '@mui/material/Link';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\n\nimport CardWrapper from '../CardWrapper';\nimport {\n CATALOG_ENTITIES_TABLE_HEADERS,\n CATALOG_ENTITIES_TITLE,\n} from '../../utils/constants';\nimport { useCatalogEntities } from '../../hooks/useCatalogEntities';\nimport TableFooterPagination from '../CardFooter';\nimport { getLastUsedDay, getUniqueCatalogEntityKinds } from '../../utils/utils';\nimport FilterDropdown from './FilterDropdown';\nimport EmptyChartState from '../Common/EmptyChartState';\n\nconst CatalogEntities = () => {\n const [page, setPage] = React.useState(0);\n const [limit] = React.useState(20);\n const [rowsPerPage, setRowsPerPage] = React.useState(3);\n const [selectedOption, setSelectedOption] = React.useState('');\n const [uniqueCatalogEntityKinds, setUniqueCatalogEntityKinds] =\n React.useState<string[]>([]);\n\n const entityLink = useRouteRef(entityRouteRef);\n\n const { catalogEntities, loading } = useCatalogEntities({\n limit,\n kind: selectedOption === 'All' ? '' : selectedOption.toLocaleLowerCase(),\n });\n\n React.useEffect(() => {\n if (\n catalogEntities?.data?.length > 0 &&\n uniqueCatalogEntityKinds?.length === 0\n ) {\n const uniqueKinds = getUniqueCatalogEntityKinds(catalogEntities.data);\n setUniqueCatalogEntityKinds(uniqueKinds);\n }\n }, [catalogEntities, uniqueCatalogEntityKinds]);\n\n const handleChangePage = React.useCallback(\n (_event: unknown, newPage: number) => {\n setPage(newPage);\n },\n [],\n );\n\n const handleChangeRowsPerPage = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setRowsPerPage(+event.target.value);\n setPage(0);\n },\n [],\n );\n\n const handleChange = React.useCallback((event: SelectChangeEvent<string>) => {\n setSelectedOption(event.target.value);\n }, []);\n\n const visibleCatalogEntities = React.useMemo(() => {\n return catalogEntities.data\n ?.filter(entity => {\n if (selectedOption && selectedOption !== 'All') {\n return (\n entity.kind.toLocaleLowerCase() ===\n selectedOption.toLocaleLowerCase()\n );\n }\n return true;\n })\n .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage);\n }, [catalogEntities, page, rowsPerPage, selectedOption]);\n\n if (\n (!visibleCatalogEntities || visibleCatalogEntities?.length === 0) &&\n !loading\n ) {\n return (\n <CardWrapper title={CATALOG_ENTITIES_TITLE}>\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n height={200}\n >\n <EmptyChartState />\n </Box>\n </CardWrapper>\n );\n }\n\n return (\n <CardWrapper\n title={CATALOG_ENTITIES_TITLE}\n filter={\n <FilterDropdown\n selectedOption={selectedOption}\n handleChange={handleChange}\n uniqueCatalogEntityKinds={uniqueCatalogEntityKinds}\n />\n }\n >\n <Table aria-labelledby=\"Catalog entities\" sx={{ width: '100%' }}>\n <TableHead>\n <TableRow>\n {CATALOG_ENTITIES_TABLE_HEADERS.map(header => (\n <TableCell\n key={header.id}\n align=\"left\"\n sx={{\n borderBottom: theme => `1px solid ${theme.palette.grey[300]}`,\n width: '25%',\n }}\n >\n {header.title}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {loading ? (\n <TableRow>\n <TableCell\n colSpan={CATALOG_ENTITIES_TABLE_HEADERS.length}\n align=\"center\"\n >\n <CircularProgress />\n </TableCell>\n </TableRow>\n ) : (\n visibleCatalogEntities?.map(entity => (\n <TableRow\n key={`${entity.kind}-${entity.name}`}\n sx={{\n '&:nth-of-type(odd)': { backgroundColor: 'inherit' },\n borderBottom: theme => `1px solid ${theme.palette.grey[300]}`,\n }}\n >\n <TableCell sx={{ width: '25%' }}>\n <Link\n component=\"a\"\n href={entityLink({\n kind: entity.kind,\n namespace: entity.namespace,\n name: entity.name,\n })}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n sx={{\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'none',\n },\n }}\n >\n {entity.name ?? '--'}\n </Link>\n </TableCell>\n <TableCell sx={{ width: '25%' }}>\n {entity.kind?.charAt(0).toLocaleUpperCase('en-US') +\n entity.kind?.slice(1) || '--'}\n </TableCell>\n <TableCell sx={{ width: '25%' }}>\n {getLastUsedDay(entity.last_used) ?? '--'}\n </TableCell>\n <TableCell sx={{ width: '25%' }}>\n {Number(entity.count).toLocaleString() ?? '--'}\n </TableCell>\n </TableRow>\n ))\n )}\n </TableBody>\n <TableFooter>\n <TableRow>\n <TableCell\n colSpan={CATALOG_ENTITIES_TABLE_HEADERS.length}\n sx={{ padding: 0 }}\n >\n <TableFooterPagination\n count={catalogEntities.data?.length}\n rowsPerPage={rowsPerPage}\n page={page}\n handleChangePage={handleChangePage}\n handleChangeRowsPerPage={handleChangeRowsPerPage}\n />\n </TableCell>\n </TableRow>\n </TableFooter>\n </Table>\n </CardWrapper>\n );\n};\n\nexport default CatalogEntities;\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,kBAAkB,MAAM;AAC5B,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAAA,cAAA,CAAM,SAAS,CAAC,CAAA;AACxC,EAAA,MAAM,CAAC,KAAK,CAAI,GAAAA,cAAA,CAAM,SAAS,EAAE,CAAA;AACjC,EAAA,MAAM,CAAC,WAAa,EAAA,cAAc,CAAI,GAAAA,cAAA,CAAM,SAAS,CAAC,CAAA;AACtD,EAAA,MAAM,CAAC,cAAgB,EAAA,iBAAiB,CAAI,GAAAA,cAAA,CAAM,SAAS,EAAE,CAAA;AAC7D,EAAA,MAAM,CAAC,wBAA0B,EAAA,2BAA2B,IAC1DA,cAAM,CAAA,QAAA,CAAmB,EAAE,CAAA;AAE7B,EAAM,MAAA,UAAA,GAAa,YAAY,cAAc,CAAA;AAE7C,EAAA,MAAM,EAAE,eAAA,EAAiB,OAAQ,EAAA,GAAI,kBAAmB,CAAA;AAAA,IACtD,KAAA;AAAA,IACA,IAAM,EAAA,cAAA,KAAmB,KAAQ,GAAA,EAAA,GAAK,eAAe,iBAAkB;AAAA,GACxE,CAAA;AAED,EAAAA,cAAA,CAAM,UAAU,MAAM;AACpB,IAAA,IACE,iBAAiB,IAAM,EAAA,MAAA,GAAS,CAChC,IAAA,wBAAA,EAA0B,WAAW,CACrC,EAAA;A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,MAAA,CAAO,CAAC,CAAE,CAAA,iBAAA,CAAkB,OAAO,CAC/C,GAAA,MAAA,CAAO,MAAM,KAAM,CAAA,CAAC,KAAK,IAC7B,CAAA;AAAA,sBACAA,cAAA,CAAA,aAAA,CAAC,SAAU,EAAA,EAAA,EAAA,EAAI,EAAE,KAAA,EAAO,KAAM,EAAA,EAAA,EAC3B,cAAe,CAAA,MAAA,CAAO,SAAS,CAAA,IAAK,IACvC,CAAA;AAAA,sBACCA,cAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,EAAI,EAAA,EAAE,KAAO,EAAA,KAAA,EACrB,EAAA,EAAA,MAAA,CAAO,MAAO,CAAA,KAAK,CAAE,CAAA,cAAA,MAAoB,IAC5C;AAAA,KAEH,CAEL,CAAA,kBACCA,cAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAA,+CACE,QACC,EAAA,IAAA,kBAAAA,cAAA,CAAA,aAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,SAAS,8BAA+B,CAAA,MAAA;AAAA,QACxC,EAAA,EAAI,EAAE,OAAA,EAAS,CAAE;AAAA,OAAA;AAAA,sBAEjBA,cAAA,CAAA,aAAA;AAAA,QAAC,qBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAO,gBAAgB,IAAM,EAAA,MAAA;AAAA,UAC7B,WAAA;AAAA,UACA,IAAA;AAAA,UACA,gBAAA;AAAA,UACA;AAAA;AAAA;AACF,KAEJ,CACF,CACF;AAAA,GACF;AAEJ;;;;"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import Box from '@mui/material/Box';
|
3
|
+
import FormControl from '@mui/material/FormControl';
|
4
|
+
import InputLabel from '@mui/material/InputLabel';
|
5
|
+
import MenuItem from '@mui/material/MenuItem';
|
6
|
+
import Select from '@mui/material/Select';
|
7
|
+
|
8
|
+
const FilterDropdown = ({
|
9
|
+
selectedOption,
|
10
|
+
handleChange,
|
11
|
+
uniqueCatalogEntityKinds
|
12
|
+
}) => {
|
13
|
+
return /* @__PURE__ */ React__default.createElement(Box, { sx: { m: 2, minWidth: 160 } }, /* @__PURE__ */ React__default.createElement(FormControl, { fullWidth: true }, /* @__PURE__ */ React__default.createElement(InputLabel, { id: "kind-select" }, "Select kind"), /* @__PURE__ */ React__default.createElement(
|
14
|
+
Select,
|
15
|
+
{
|
16
|
+
labelId: "kind-select",
|
17
|
+
renderValue: (selected) => selected.length === 0 ? "Select kind" : selected,
|
18
|
+
value: selectedOption,
|
19
|
+
onChange: handleChange,
|
20
|
+
label: "Select kind",
|
21
|
+
MenuProps: {
|
22
|
+
MenuListProps: {
|
23
|
+
autoFocusItem: false
|
24
|
+
}
|
25
|
+
}
|
26
|
+
},
|
27
|
+
/* @__PURE__ */ React__default.createElement(MenuItem, { key: "All", value: "All" }, "All"),
|
28
|
+
uniqueCatalogEntityKinds?.map((kind) => /* @__PURE__ */ React__default.createElement(MenuItem, { key: kind, value: kind }, kind))
|
29
|
+
)));
|
30
|
+
};
|
31
|
+
|
32
|
+
export { FilterDropdown as default };
|
33
|
+
//# sourceMappingURL=FilterDropdown.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FilterDropdown.esm.js","sources":["../../../src/components/CatalogEntities/FilterDropdown.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nimport Box from '@mui/material/Box';\nimport FormControl from '@mui/material/FormControl';\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select, { SelectChangeEvent } from '@mui/material/Select';\n\nconst FilterDropdown = ({\n selectedOption,\n handleChange,\n uniqueCatalogEntityKinds,\n}: {\n selectedOption: string;\n handleChange: (event: SelectChangeEvent<string>) => void;\n uniqueCatalogEntityKinds: string[];\n}) => {\n return (\n <Box sx={{ m: 2, minWidth: 160 }}>\n <FormControl fullWidth>\n <InputLabel id=\"kind-select\">Select kind</InputLabel>\n <Select\n labelId=\"kind-select\"\n renderValue={(selected: string) =>\n selected.length === 0 ? 'Select kind' : selected\n }\n value={selectedOption}\n onChange={handleChange}\n label=\"Select kind\"\n MenuProps={{\n MenuListProps: {\n autoFocusItem: false,\n },\n }}\n >\n <MenuItem key=\"All\" value=\"All\">\n All\n </MenuItem>\n {uniqueCatalogEntityKinds?.map(kind => (\n <MenuItem key={kind} value={kind}>\n {kind}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </Box>\n );\n};\n\nexport default FilterDropdown;\n"],"names":["React"],"mappings":";;;;;;;AAuBA,MAAM,iBAAiB,CAAC;AAAA,EACtB,cAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAIM,KAAA;AACJ,EAAA,oDACG,GAAI,EAAA,EAAA,EAAA,EAAI,EAAE,CAAG,EAAA,CAAA,EAAG,UAAU,GAAI,EAAA,EAAA,kBAC5BA,cAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,WAAS,IACpB,EAAA,kBAAAA,cAAA,CAAA,aAAA,CAAC,cAAW,EAAG,EAAA,aAAA,EAAA,EAAc,aAAW,CACxC,kBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,aAAA;AAAA,MACR,aAAa,CAAC,QAAA,KACZ,QAAS,CAAA,MAAA,KAAW,IAAI,aAAgB,GAAA,QAAA;AAAA,MAE1C,KAAO,EAAA,cAAA;AAAA,MACP,QAAU,EAAA,YAAA;AAAA,MACV,KAAM,EAAA,aAAA;AAAA,MACN,SAAW,EAAA;AAAA,QACT,aAAe,EAAA;AAAA,UACb,aAAe,EAAA;AAAA;AACjB;AACF,KAAA;AAAA,iDAEC,QAAS,EAAA,EAAA,GAAA,EAAI,KAAM,EAAA,KAAA,EAAM,SAAM,KAEhC,CAAA;AAAA,IACC,wBAAA,EAA0B,GAAI,CAAA,CAAA,IAAA,qBAC5BA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,KAAK,IAAM,EAAA,KAAA,EAAO,IACzB,EAAA,EAAA,IACH,CACD;AAAA,GAEL,CACF,CAAA;AAEJ;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
|
3
|
+
const CustomCursor = (props) => {
|
4
|
+
const { points, cursorHeight = 250 } = props;
|
5
|
+
if (!points || points.length === 0) return null;
|
6
|
+
return /* @__PURE__ */ React__default.createElement(
|
7
|
+
"line",
|
8
|
+
{
|
9
|
+
"data-testid": "custom-cursor-line",
|
10
|
+
x1: points[0].x,
|
11
|
+
y1: 10,
|
12
|
+
x2: points[0].x,
|
13
|
+
y2: cursorHeight,
|
14
|
+
stroke: "gray",
|
15
|
+
strokeWidth: 1,
|
16
|
+
strokeDasharray: "3 3"
|
17
|
+
}
|
18
|
+
);
|
19
|
+
};
|
20
|
+
|
21
|
+
export { CustomCursor as default };
|
22
|
+
//# sourceMappingURL=CustomCursor.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CustomCursor.esm.js","sources":["../../../src/components/Common/CustomCursor.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nconst CustomCursor = (props: any) => {\n const { points, cursorHeight = 250 } = props;\n if (!points || points.length === 0) return null;\n\n return (\n <line\n data-testid=\"custom-cursor-line\"\n x1={points[0].x}\n y1={10}\n x2={points[0].x}\n y2={cursorHeight}\n stroke=\"gray\"\n strokeWidth={1}\n strokeDasharray=\"3 3\"\n />\n );\n};\n\nexport default CustomCursor;\n"],"names":["React"],"mappings":";;AAiBM,MAAA,YAAA,GAAe,CAAC,KAAe,KAAA;AACnC,EAAA,MAAM,EAAE,MAAA,EAAQ,YAAe,GAAA,GAAA,EAAQ,GAAA,KAAA;AACvC,EAAA,IAAI,CAAC,MAAA,IAAU,MAAO,CAAA,MAAA,KAAW,GAAU,OAAA,IAAA;AAE3C,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,aAAY,EAAA,oBAAA;AAAA,MACZ,EAAA,EAAI,MAAO,CAAA,CAAC,CAAE,CAAA,CAAA;AAAA,MACd,EAAI,EAAA,EAAA;AAAA,MACJ,EAAA,EAAI,MAAO,CAAA,CAAC,CAAE,CAAA,CAAA;AAAA,MACd,EAAI,EAAA,YAAA;AAAA,MACJ,MAAO,EAAA,MAAA;AAAA,MACP,WAAa,EAAA,CAAA;AAAA,MACb,eAAgB,EAAA;AAAA;AAAA,GAClB;AAEJ;;;;"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import Typography from '@mui/material/Typography';
|
3
|
+
|
4
|
+
const EmptyChartState = () => {
|
5
|
+
return /* @__PURE__ */ React__default.createElement(Typography, null, "No results for this date range.");
|
6
|
+
};
|
7
|
+
|
8
|
+
export { EmptyChartState as default };
|
9
|
+
//# sourceMappingURL=EmptyChartState.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EmptyChartState.esm.js","sources":["../../../src/components/Common/EmptyChartState.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\nimport Typography from '@mui/material/Typography';\n\nconst EmptyChartState = () => {\n return <Typography>No results for this date range.</Typography>;\n};\n\nexport default EmptyChartState;\n"],"names":["React"],"mappings":";;;AAkBA,MAAM,kBAAkB,MAAM;AAC5B,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,kBAAW,iCAA+B,CAAA;AACpD;;;;"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import permissionRequired from '../../images/permission-required.svg';
|
3
|
+
|
4
|
+
const PermissionRequiredIcon = () => {
|
5
|
+
return /* @__PURE__ */ React.createElement("img", { src: permissionRequired, alt: "permission required icon" });
|
6
|
+
};
|
7
|
+
|
8
|
+
export { PermissionRequiredIcon };
|
9
|
+
//# sourceMappingURL=PermissionRequiredIcon.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PermissionRequiredIcon.esm.js","sources":["../../../src/components/Common/PermissionRequiredIcon.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 * as React from 'react';\n\nimport permissionRequired from '../../images/permission-required.svg';\n\nexport const PermissionRequiredIcon = () => {\n return <img src={permissionRequired as any} alt=\"permission required icon\" />;\n};\n"],"names":[],"mappings":";;;AAmBO,MAAM,yBAAyB,MAAM;AAC1C,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,GAAK,EAAA,kBAAA,EAA2B,KAAI,0BAA2B,EAAA,CAAA;AAC7E;;;;"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React__default from 'react';
|
2
|
+
import { EmptyState } from '@backstage/core-components';
|
3
|
+
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
4
|
+
import Box from '@mui/material/Box';
|
5
|
+
import Typography from '@mui/material/Typography';
|
6
|
+
import Button from '@mui/material/Button';
|
7
|
+
import { PermissionRequiredIcon } from './PermissionRequiredIcon.esm.js';
|
8
|
+
|
9
|
+
const PermissionRequiredState = () => {
|
10
|
+
return /* @__PURE__ */ React__default.createElement(
|
11
|
+
Box,
|
12
|
+
{
|
13
|
+
sx: {
|
14
|
+
display: "flex",
|
15
|
+
height: "100%",
|
16
|
+
alignItems: "center",
|
17
|
+
padding: "100px"
|
18
|
+
}
|
19
|
+
},
|
20
|
+
/* @__PURE__ */ React__default.createElement(
|
21
|
+
EmptyState,
|
22
|
+
{
|
23
|
+
title: "Missing permissions",
|
24
|
+
description: /* @__PURE__ */ React__default.createElement(Typography, { variant: "subtitle1", component: "span" }, "To view Adoption Insights plugin, contact your administrator to give the ", /* @__PURE__ */ React__default.createElement("b", null, "adoption-insights.events.read"), " permissions."),
|
25
|
+
missing: { customImage: /* @__PURE__ */ React__default.createElement(PermissionRequiredIcon, null) },
|
26
|
+
action: /* @__PURE__ */ React__default.createElement(
|
27
|
+
Button,
|
28
|
+
{
|
29
|
+
variant: "outlined",
|
30
|
+
color: "primary",
|
31
|
+
target: "_blank",
|
32
|
+
href: "https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/adoption-insights/plugins/adoption-insights/README.md#permission-framework-support"
|
33
|
+
},
|
34
|
+
"Read more \xA0 ",
|
35
|
+
/* @__PURE__ */ React__default.createElement(OpenInNewIcon, null)
|
36
|
+
)
|
37
|
+
}
|
38
|
+
)
|
39
|
+
);
|
40
|
+
};
|
41
|
+
|
42
|
+
export { PermissionRequiredState as default };
|
43
|
+
//# sourceMappingURL=PermissionRequiredState.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PermissionRequiredState.esm.js","sources":["../../../src/components/Common/PermissionRequiredState.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React from 'react';\n\nimport { EmptyState } from '@backstage/core-components';\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport Button from '@mui/material/Button';\n\nimport { PermissionRequiredIcon } from './PermissionRequiredIcon';\n\nconst PermissionRequiredState = () => {\n return (\n <Box\n sx={{\n display: 'flex',\n height: '100%',\n alignItems: 'center',\n padding: '100px',\n }}\n >\n <EmptyState\n title=\"Missing permissions\"\n description={\n <Typography variant=\"subtitle1\" component=\"span\">\n To view Adoption Insights plugin, contact your administrator to give\n the <b>adoption-insights.events.read</b> permissions.\n </Typography>\n }\n missing={{ customImage: <PermissionRequiredIcon /> }}\n action={\n <Button\n variant=\"outlined\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/adoption-insights/plugins/adoption-insights/README.md#permission-framework-support\"\n >\n Read more <OpenInNewIcon />\n </Button>\n }\n />\n </Box>\n );\n};\n\nexport default PermissionRequiredState;\n"],"names":["React"],"mappings":";;;;;;;;AAyBA,MAAM,0BAA0B,MAAM;AACpC,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,MAAQ,EAAA,MAAA;AAAA,QACR,UAAY,EAAA,QAAA;AAAA,QACZ,OAAS,EAAA;AAAA;AACX,KAAA;AAAA,oBAEAA,cAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,qBAAA;AAAA,QACN,WACE,kBAAAA,cAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,WAAY,EAAA,SAAA,EAAU,MAAO,EAAA,EAAA,2EAAA,kBAE1CA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,IAAA,EAAE,+BAA6B,CAAA,EAAI,eAC1C,CAAA;AAAA,QAEF,OAAS,EAAA,EAAE,WAAa,kBAAAA,cAAA,CAAA,aAAA,CAAC,4BAAuB,CAAG,EAAA;AAAA,QACnD,MACE,kBAAAA,cAAA,CAAA,aAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,UAAA;AAAA,YACR,KAAM,EAAA,SAAA;AAAA,YACN,MAAO,EAAA,QAAA;AAAA,YACP,IAAK,EAAA;AAAA,WAAA;AAAA,UACN,iBAAA;AAAA,uDACmB,aAAc,EAAA,IAAA;AAAA;AAClC;AAAA;AAEJ,GACF;AAEJ;;;;"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React__default, { createContext, useContext } from 'react';
|
2
|
+
|
3
|
+
const DateRangeContext = createContext(
|
4
|
+
void 0
|
5
|
+
);
|
6
|
+
const DateRangeProvider = ({
|
7
|
+
children
|
8
|
+
}) => {
|
9
|
+
const [startDateRange, setStartDateRange] = React__default.useState(null);
|
10
|
+
const [endDateRange, setEndDateRange] = React__default.useState(null);
|
11
|
+
const [isDefaultDateRange, setIsDefaultDateRange] = React__default.useState(true);
|
12
|
+
const value = React__default.useMemo(
|
13
|
+
() => ({
|
14
|
+
startDateRange,
|
15
|
+
endDateRange,
|
16
|
+
isDefaultDateRange,
|
17
|
+
setStartDateRange,
|
18
|
+
setEndDateRange,
|
19
|
+
setIsDefaultDateRange
|
20
|
+
}),
|
21
|
+
[startDateRange, endDateRange, isDefaultDateRange]
|
22
|
+
);
|
23
|
+
return /* @__PURE__ */ React__default.createElement(DateRangeContext.Provider, { value }, children);
|
24
|
+
};
|
25
|
+
const useDateRange = () => {
|
26
|
+
const context = useContext(DateRangeContext);
|
27
|
+
if (!context) {
|
28
|
+
throw new Error("useDateRange must be used within a DateRangeProvider");
|
29
|
+
}
|
30
|
+
return context;
|
31
|
+
};
|
32
|
+
|
33
|
+
export { DateRangeContext, DateRangeProvider, useDateRange };
|
34
|
+
//# sourceMappingURL=DateRangeContext.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DateRangeContext.esm.js","sources":["../../../src/components/Header/DateRangeContext.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 React, { createContext, useContext } from 'react';\n\ninterface DateRange {\n startDateRange: Date | null;\n endDateRange: Date | null;\n setStartDateRange: (date: Date | null) => void;\n setEndDateRange: (date: Date | null) => void;\n isDefaultDateRange: boolean;\n setIsDefaultDateRange: (val: boolean) => void;\n}\n\nexport const DateRangeContext = createContext<DateRange | undefined>(\n undefined as any,\n);\n\nexport const DateRangeProvider: React.FC<{ children: React.ReactNode }> = ({\n children,\n}) => {\n const [startDateRange, setStartDateRange] = React.useState<Date | null>(null);\n const [endDateRange, setEndDateRange] = React.useState<Date | null>(null);\n const [isDefaultDateRange, setIsDefaultDateRange] =\n React.useState<boolean>(true);\n\n const value = React.useMemo(\n () => ({\n startDateRange,\n endDateRange,\n isDefaultDateRange,\n setStartDateRange,\n setEndDateRange,\n setIsDefaultDateRange,\n }),\n [startDateRange, endDateRange, isDefaultDateRange],\n );\n\n return (\n <DateRangeContext.Provider value={value}>\n {children}\n </DateRangeContext.Provider>\n );\n};\n\nexport const useDateRange = () => {\n const context = useContext(DateRangeContext);\n if (!context) {\n throw new Error('useDateRange must be used within a DateRangeProvider');\n }\n\n return context;\n};\n"],"names":["React"],"mappings":";;AA0BO,MAAM,gBAAmB,GAAA,aAAA;AAAA,EAC9B;AACF;AAEO,MAAM,oBAA6D,CAAC;AAAA,EACzE;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,CAAC,cAAgB,EAAA,iBAAiB,CAAI,GAAAA,cAAA,CAAM,SAAsB,IAAI,CAAA;AAC5E,EAAA,MAAM,CAAC,YAAc,EAAA,eAAe,CAAI,GAAAA,cAAA,CAAM,SAAsB,IAAI,CAAA;AACxE,EAAA,MAAM,CAAC,kBAAoB,EAAA,qBAAqB,CAC9C,GAAAA,cAAA,CAAM,SAAkB,IAAI,CAAA;AAE9B,EAAA,MAAM,QAAQA,cAAM,CAAA,OAAA;AAAA,IAClB,OAAO;AAAA,MACL,cAAA;AAAA,MACA,YAAA;AAAA,MACA,kBAAA;AAAA,MACA,iBAAA;AAAA,MACA,eAAA;AAAA,MACA;AAAA,KACF,CAAA;AAAA,IACA,CAAC,cAAgB,EAAA,YAAA,EAAc,kBAAkB;AAAA,GACnD;AAEA,EAAA,uBACGA,cAAA,CAAA,aAAA,CAAA,gBAAA,CAAiB,QAAjB,EAAA,EAA0B,SACxB,QACH,CAAA;AAEJ;AAEO,MAAM,eAAe,MAAM;AAChC,EAAM,MAAA,OAAA,GAAU,WAAW,gBAAgB,CAAA;AAC3C,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,sDAAsD,CAAA;AAAA;AAGxE,EAAO,OAAA,OAAA;AACT;;;;"}
|