@red-hat-developer-hub/backstage-plugin-adoption-insights 0.0.4 → 0.2.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 +25 -0
- package/dist/components/ActiveUsers/ActiveUsers.esm.js +106 -89
- package/dist/components/ActiveUsers/ActiveUsers.esm.js.map +1 -1
- package/dist/components/ActiveUsers/CustomLegend.esm.js +40 -35
- package/dist/components/ActiveUsers/CustomLegend.esm.js.map +1 -1
- package/dist/components/ActiveUsers/CustomTooltip.esm.js +68 -57
- package/dist/components/ActiveUsers/CustomTooltip.esm.js.map +1 -1
- package/dist/components/ActiveUsers/ExportCSVButton.esm.js +26 -25
- package/dist/components/ActiveUsers/ExportCSVButton.esm.js.map +1 -1
- package/dist/components/AdoptionInsightsPage/AdoptionInsightsPage.esm.js +13 -2
- package/dist/components/AdoptionInsightsPage/AdoptionInsightsPage.esm.js.map +1 -1
- package/dist/components/CardFooter/TableFooterPagination.esm.js +42 -42
- package/dist/components/CardFooter/TableFooterPagination.esm.js.map +1 -1
- package/dist/components/CardWrapper/CardWrapper.esm.js +29 -24
- package/dist/components/CardWrapper/CardWrapper.esm.js.map +1 -1
- package/dist/components/CatalogEntities/CatalogEntities.esm.js +96 -92
- package/dist/components/CatalogEntities/CatalogEntities.esm.js.map +1 -1
- package/dist/components/CatalogEntities/FilterDropdown.esm.js +22 -17
- package/dist/components/CatalogEntities/FilterDropdown.esm.js.map +1 -1
- package/dist/components/Common/CustomCursor.esm.js +2 -2
- package/dist/components/Common/CustomCursor.esm.js.map +1 -1
- package/dist/components/Common/EmptyChartState.esm.js +2 -2
- package/dist/components/Common/EmptyChartState.esm.js.map +1 -1
- package/dist/components/Common/PermissionRequiredIcon.esm.js +2 -2
- package/dist/components/Common/PermissionRequiredIcon.esm.js.map +1 -1
- package/dist/components/Common/PermissionRequiredState.esm.js +29 -23
- package/dist/components/Common/PermissionRequiredState.esm.js.map +1 -1
- package/dist/components/Header/DateRangeContext.esm.js +7 -6
- package/dist/components/Header/DateRangeContext.esm.js.map +1 -1
- package/dist/components/Header/DateRangePicker.esm.js +67 -59
- package/dist/components/Header/DateRangePicker.esm.js.map +1 -1
- package/dist/components/Header/Header.esm.js +116 -106
- package/dist/components/Header/Header.esm.js.map +1 -1
- package/dist/components/Plugins/Plugins.esm.js +74 -64
- package/dist/components/Plugins/Plugins.esm.js.map +1 -1
- package/dist/components/Searches/CustomTooltip.esm.js +41 -36
- package/dist/components/Searches/CustomTooltip.esm.js.map +1 -1
- package/dist/components/Searches/Searches.esm.js +85 -74
- package/dist/components/Searches/Searches.esm.js.map +1 -1
- package/dist/components/Techdocs/Techdocs.esm.js +85 -81
- package/dist/components/Techdocs/Techdocs.esm.js.map +1 -1
- package/dist/components/Templates/Templates.esm.js +74 -70
- package/dist/components/Templates/Templates.esm.js.map +1 -1
- package/dist/components/Users/Info.esm.js +12 -12
- package/dist/components/Users/Info.esm.js.map +1 -1
- package/dist/components/Users/Tooltip.esm.js +27 -23
- package/dist/components/Users/Tooltip.esm.js.map +1 -1
- package/dist/components/Users/Users.esm.js +119 -95
- package/dist/components/Users/Users.esm.js.map +1 -1
- package/dist/hooks/useActiveUsers.esm.js +5 -5
- package/dist/hooks/useActiveUsers.esm.js.map +1 -1
- package/dist/hooks/useCatalogEntities.esm.js +5 -5
- package/dist/hooks/useCatalogEntities.esm.js.map +1 -1
- package/dist/hooks/usePlugins.esm.js +5 -5
- package/dist/hooks/usePlugins.esm.js.map +1 -1
- package/dist/hooks/useSearches.esm.js +5 -5
- package/dist/hooks/useSearches.esm.js.map +1 -1
- package/dist/hooks/useTechdocs.esm.js +5 -5
- package/dist/hooks/useTechdocs.esm.js.map +1 -1
- package/dist/hooks/useTemplates.esm.js +5 -5
- package/dist/hooks/useTemplates.esm.js.map +1 -1
- package/dist/hooks/useUsers.esm.js +5 -5
- package/dist/hooks/useUsers.esm.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/package.json +18 -17
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
2
|
+
import { useState, useRef } from 'react';
|
2
3
|
import { useApi } from '@backstage/core-plugin-api';
|
3
4
|
import Button from '@mui/material/Button';
|
4
5
|
import FileDownloadOutlinedIcon from '@mui/icons-material/FileDownloadOutlined';
|
@@ -9,11 +10,11 @@ import { adoptionInsightsApiRef } from '../../api/index.esm.js';
|
|
9
10
|
import { useDateRange } from '../Header/DateRangeContext.esm.js';
|
10
11
|
|
11
12
|
const ExportCSVButton = () => {
|
12
|
-
const [loading, setLoading] =
|
13
|
+
const [loading, setLoading] = useState(false);
|
13
14
|
const api = useApi(adoptionInsightsApiRef);
|
14
15
|
const { startDateRange, endDateRange } = useDateRange();
|
15
16
|
const theme = useTheme();
|
16
|
-
const debounceRef =
|
17
|
+
const debounceRef = useRef(null);
|
17
18
|
const handleCSVDownload = async () => {
|
18
19
|
try {
|
19
20
|
await api.downloadBlob({
|
@@ -37,7 +38,7 @@ const ExportCSVButton = () => {
|
|
37
38
|
handleCSVDownload();
|
38
39
|
}, 500);
|
39
40
|
};
|
40
|
-
return /* @__PURE__ */
|
41
|
+
return /* @__PURE__ */ jsx(
|
41
42
|
Box,
|
42
43
|
{
|
43
44
|
sx: {
|
@@ -46,28 +47,28 @@ const ExportCSVButton = () => {
|
|
46
47
|
display: "flex",
|
47
48
|
alignItems: "center",
|
48
49
|
justifyContent: "center"
|
49
|
-
}
|
50
|
-
},
|
51
|
-
/* @__PURE__ */ React__default.createElement(
|
52
|
-
Button,
|
53
|
-
{
|
54
|
-
variant: "text",
|
55
|
-
startIcon: /* @__PURE__ */ React__default.createElement(FileDownloadOutlinedIcon, null),
|
56
|
-
onClick: debouncedHandleCSVDownload,
|
57
|
-
sx: {
|
58
|
-
color: theme.palette.primary.main,
|
59
|
-
textTransform: "none",
|
60
|
-
fontSize: "1rem",
|
61
|
-
fontWeight: 400,
|
62
|
-
textDecoration: "none",
|
63
|
-
"&:hover": {
|
64
|
-
backgroundColor: "transparent",
|
65
|
-
textDecoration: "none"
|
66
|
-
}
|
67
|
-
}
|
68
50
|
},
|
69
|
-
|
70
|
-
|
51
|
+
children: /* @__PURE__ */ jsx(
|
52
|
+
Button,
|
53
|
+
{
|
54
|
+
variant: "text",
|
55
|
+
startIcon: /* @__PURE__ */ jsx(FileDownloadOutlinedIcon, {}),
|
56
|
+
onClick: debouncedHandleCSVDownload,
|
57
|
+
sx: {
|
58
|
+
color: theme.palette.primary.main,
|
59
|
+
textTransform: "none",
|
60
|
+
fontSize: "1rem",
|
61
|
+
fontWeight: 400,
|
62
|
+
textDecoration: "none",
|
63
|
+
"&:hover": {
|
64
|
+
backgroundColor: "transparent",
|
65
|
+
textDecoration: "none"
|
66
|
+
}
|
67
|
+
},
|
68
|
+
children: loading ? "Downloading..." : "Export CSV"
|
69
|
+
}
|
70
|
+
)
|
71
|
+
}
|
71
72
|
);
|
72
73
|
};
|
73
74
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExportCSVButton.esm.js","sources":["../../../src/components/ActiveUsers/ExportCSVButton.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
|
1
|
+
{"version":3,"file":"ExportCSVButton.esm.js","sources":["../../../src/components/ActiveUsers/ExportCSVButton.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 { useRef, useState } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport Button from '@mui/material/Button';\nimport FileDownloadOutlinedIcon from '@mui/icons-material/FileDownloadOutlined';\nimport Box from '@mui/material/Box';\nimport { useTheme } from '@mui/material/styles';\nimport { format } from 'date-fns';\n\nimport { adoptionInsightsApiRef } from '../../api';\nimport { useDateRange } from '../Header/DateRangeContext';\n\nconst ExportCSVButton = () => {\n const [loading, setLoading] = useState(false);\n const api = useApi(adoptionInsightsApiRef);\n const { startDateRange, endDateRange } = useDateRange();\n const theme = useTheme();\n const debounceRef = useRef<NodeJS.Timeout | null>(null);\n\n const handleCSVDownload = async () => {\n try {\n await api.downloadBlob({\n type: 'active_users',\n start_date: startDateRange\n ? format(startDateRange, 'yyyy-MM-dd')\n : undefined,\n end_date: endDateRange ? format(endDateRange, 'yyyy-MM-dd') : undefined,\n format: 'csv',\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('CSV Download failed:', error);\n } finally {\n setLoading(false);\n }\n };\n\n const debouncedHandleCSVDownload = () => {\n setLoading(true);\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n debounceRef.current = setTimeout(() => {\n handleCSVDownload();\n }, 500);\n };\n\n return (\n <Box\n sx={{\n height: '100%',\n minWidth: 160,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <Button\n variant=\"text\"\n startIcon={<FileDownloadOutlinedIcon />}\n onClick={debouncedHandleCSVDownload}\n sx={{\n color: theme.palette.primary.main,\n textTransform: 'none',\n fontSize: '1rem',\n fontWeight: 400,\n textDecoration: 'none',\n '&:hover': {\n backgroundColor: 'transparent',\n textDecoration: 'none',\n },\n }}\n >\n {loading ? 'Downloading...' : 'Export CSV'}\n </Button>\n </Box>\n );\n};\n\nexport default ExportCSVButton;\n"],"names":[],"mappings":";;;;;;;;;;;AA2BA,MAAM,kBAAkB,MAAM;AAC5B,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAM,MAAA,GAAA,GAAM,OAAO,sBAAsB,CAAA;AACzC,EAAA,MAAM,EAAE,cAAA,EAAgB,YAAa,EAAA,GAAI,YAAa,EAAA;AACtD,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EAAM,MAAA,WAAA,GAAc,OAA8B,IAAI,CAAA;AAEtD,EAAA,MAAM,oBAAoB,YAAY;AACpC,IAAI,IAAA;AACF,MAAA,MAAM,IAAI,YAAa,CAAA;AAAA,QACrB,IAAM,EAAA,cAAA;AAAA,QACN,UAAY,EAAA,cAAA,GACR,MAAO,CAAA,cAAA,EAAgB,YAAY,CACnC,GAAA,KAAA,CAAA;AAAA,QACJ,QAAU,EAAA,YAAA,GAAe,MAAO,CAAA,YAAA,EAAc,YAAY,CAAI,GAAA,KAAA,CAAA;AAAA,QAC9D,MAAQ,EAAA;AAAA,OACT,CAAA;AAAA,aACM,KAAO,EAAA;AAEd,MAAQ,OAAA,CAAA,KAAA,CAAM,wBAAwB,KAAK,CAAA;AAAA,KAC3C,SAAA;AACA,MAAA,UAAA,CAAW,KAAK,CAAA;AAAA;AAClB,GACF;AAEA,EAAA,MAAM,6BAA6B,MAAM;AACvC,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,IAAI,YAAY,OAAS,EAAA;AACvB,MAAA,YAAA,CAAa,YAAY,OAAO,CAAA;AAAA;AAElC,IAAY,WAAA,CAAA,OAAA,GAAU,WAAW,MAAM;AACrC,MAAkB,iBAAA,EAAA;AAAA,OACjB,GAAG,CAAA;AAAA,GACR;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,MAAQ,EAAA,MAAA;AAAA,QACR,QAAU,EAAA,GAAA;AAAA,QACV,OAAS,EAAA,MAAA;AAAA,QACT,UAAY,EAAA,QAAA;AAAA,QACZ,cAAgB,EAAA;AAAA,OAClB;AAAA,MAEA,QAAA,kBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,MAAA;AAAA,UACR,SAAA,sBAAY,wBAAyB,EAAA,EAAA,CAAA;AAAA,UACrC,OAAS,EAAA,0BAAA;AAAA,UACT,EAAI,EAAA;AAAA,YACF,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA,IAAA;AAAA,YAC7B,aAAe,EAAA,MAAA;AAAA,YACf,QAAU,EAAA,MAAA;AAAA,YACV,UAAY,EAAA,GAAA;AAAA,YACZ,cAAgB,EAAA,MAAA;AAAA,YAChB,SAAW,EAAA;AAAA,cACT,eAAiB,EAAA,aAAA;AAAA,cACjB,cAAgB,EAAA;AAAA;AAClB,WACF;AAAA,UAEC,oBAAU,gBAAmB,GAAA;AAAA;AAAA;AAChC;AAAA,GACF;AAEJ;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
2
2
|
import { Page, Content } from '@backstage/core-components';
|
3
3
|
import Masonry from '@mui/lab/Masonry';
|
4
4
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
@@ -22,7 +22,18 @@ const AdoptionInsightsPage = () => {
|
|
22
22
|
if (loading) {
|
23
23
|
return null;
|
24
24
|
}
|
25
|
-
return /* @__PURE__ */
|
25
|
+
return /* @__PURE__ */ jsx(Page, { themeId: "home", children: !hasEventsReadPermission ? /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(PermissionRequiredState, {}) }) : /* @__PURE__ */ jsxs(DateRangeProvider, { children: [
|
26
|
+
/* @__PURE__ */ jsx(InsightsHeader, { title: "Adoption Insights" }),
|
27
|
+
/* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsxs(Masonry, { columns: isSmallScreen ? 1 : 2, spacing: 2, children: [
|
28
|
+
/* @__PURE__ */ jsx(ActiveUsers, {}),
|
29
|
+
/* @__PURE__ */ jsx(Users, {}),
|
30
|
+
/* @__PURE__ */ jsx(Templates, {}),
|
31
|
+
/* @__PURE__ */ jsx(CatalogEntities, {}),
|
32
|
+
/* @__PURE__ */ jsx(Plugins, {}),
|
33
|
+
/* @__PURE__ */ jsx(Techdocs, {}),
|
34
|
+
/* @__PURE__ */ jsx(Searches, {})
|
35
|
+
] }) })
|
36
|
+
] }) });
|
26
37
|
};
|
27
38
|
|
28
39
|
export { AdoptionInsightsPage };
|
@@ -1 +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
|
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 { 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":[],"mappings":";;;;;;;;;;;;;;;;;AAgCO,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,EAAA,uBACG,GAAA,CAAA,IAAA,EAAA,EAAK,OAAQ,EAAA,MAAA,EACX,QAAC,EAAA,CAAA,uBAAA,mBACC,GAAA,CAAA,OAAA,EAAA,EACC,QAAC,kBAAA,GAAA,CAAA,uBAAA,EAAA,EAAwB,CAC3B,EAAA,CAAA,wBAEC,iBACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,cAAA,EAAA,EAAe,OAAM,mBAAoB,EAAA,CAAA;AAAA,oBAC1C,GAAA,CAAC,WACC,QAAC,kBAAA,IAAA,CAAA,OAAA,EAAA,EAAQ,SAAS,aAAgB,GAAA,CAAA,GAAI,CAAG,EAAA,OAAA,EAAS,CAChD,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,WAAY,EAAA,EAAA,CAAA;AAAA,0BACZ,KAAM,EAAA,EAAA,CAAA;AAAA,0BACN,SAAU,EAAA,EAAA,CAAA;AAAA,0BACV,eAAgB,EAAA,EAAA,CAAA;AAAA,0BAChB,OAAQ,EAAA,EAAA,CAAA;AAAA,0BACR,QAAS,EAAA,EAAA,CAAA;AAAA,0BACT,QAAS,EAAA,EAAA;AAAA,KAAA,EACZ,CACF,EAAA;AAAA,GAAA,EACF,CAEJ,EAAA,CAAA;AAEJ;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
2
2
|
import Box from '@mui/material/Box';
|
3
3
|
import Paper from '@mui/material/Paper';
|
4
4
|
import TablePagination from '@mui/material/TablePagination';
|
@@ -10,7 +10,7 @@ const TableFooterPagination = ({
|
|
10
10
|
handleChangePage,
|
11
11
|
handleChangeRowsPerPage
|
12
12
|
}) => {
|
13
|
-
return /* @__PURE__ */
|
13
|
+
return /* @__PURE__ */ jsx(
|
14
14
|
Box,
|
15
15
|
{
|
16
16
|
component: Paper,
|
@@ -18,51 +18,51 @@ const TableFooterPagination = ({
|
|
18
18
|
display: "flex",
|
19
19
|
justifyContent: "flex-end",
|
20
20
|
padding: 1
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
21
|
+
},
|
22
|
+
children: /* @__PURE__ */ jsx(
|
23
|
+
TablePagination,
|
24
|
+
{
|
25
|
+
sx: {
|
26
|
+
"& .v5-MuiTablePagination-select:focus": {
|
27
|
+
backgroundColor: "transparent"
|
28
|
+
}
|
29
|
+
},
|
30
|
+
rowsPerPageOptions: [
|
31
|
+
{ label: "Top 3", value: 3 },
|
32
|
+
{ label: "Top 5", value: 5 },
|
33
|
+
{ label: "Top 10", value: 10 },
|
34
|
+
{ label: "Top 20", value: 20 }
|
35
|
+
],
|
36
|
+
component: "div",
|
37
|
+
count,
|
38
|
+
rowsPerPage,
|
39
|
+
page,
|
40
|
+
onPageChange: handleChangePage,
|
41
|
+
onRowsPerPageChange: handleChangeRowsPerPage,
|
42
|
+
labelRowsPerPage: null,
|
43
|
+
labelDisplayedRows: () => null,
|
44
|
+
ActionsComponent: () => null,
|
45
|
+
slotProps: {
|
46
|
+
select: {
|
47
|
+
MenuProps: {
|
48
|
+
MenuListProps: {
|
49
|
+
autoFocusItem: false
|
50
|
+
},
|
51
|
+
PaperProps: {
|
52
|
+
sx: {
|
53
|
+
width: 190,
|
54
|
+
boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.2)",
|
55
|
+
borderRadius: 2,
|
56
|
+
border: (theme) => `1px solid ${theme.palette.grey[300]}`,
|
57
|
+
overflow: "hidden"
|
58
|
+
}
|
59
59
|
}
|
60
60
|
}
|
61
61
|
}
|
62
62
|
}
|
63
63
|
}
|
64
|
-
|
65
|
-
|
64
|
+
)
|
65
|
+
}
|
66
66
|
);
|
67
67
|
};
|
68
68
|
|
@@ -1 +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
|
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 type { MouseEvent, ChangeEvent, FC } 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: MouseEvent<HTMLButtonElement> | null,\n newPage: number,\n ) => void;\n handleChangeRowsPerPage: (\n event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => void;\n}\n\nconst TableFooterPagination: 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":[],"mappings":";;;;;AAiCA,MAAM,wBAAwD,CAAC;AAAA,EAC7D,KAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAM,KAAA;AACJ,EACE,uBAAA,GAAA;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,OACX;AAAA,MAEA,QAAA,kBAAA,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,uCAAyC,EAAA;AAAA,cACvC,eAAiB,EAAA;AAAA;AACnB,WACF;AAAA,UACA,kBAAoB,EAAA;AAAA,YAClB,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAO,CAAE,EAAA;AAAA,YAC3B,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAO,CAAE,EAAA;AAAA,YAC3B,EAAE,KAAA,EAAO,QAAU,EAAA,KAAA,EAAO,EAAG,EAAA;AAAA,YAC7B,EAAE,KAAA,EAAO,QAAU,EAAA,KAAA,EAAO,EAAG;AAAA,WAC/B;AAAA,UACA,SAAU,EAAA,KAAA;AAAA,UACV,KAAA;AAAA,UACA,WAAA;AAAA,UACA,IAAA;AAAA,UACA,YAAc,EAAA,gBAAA;AAAA,UACd,mBAAqB,EAAA,uBAAA;AAAA,UACrB,gBAAkB,EAAA,IAAA;AAAA,UAClB,oBAAoB,MAAM,IAAA;AAAA,UAC1B,kBAAkB,MAAM,IAAA;AAAA,UACxB,SAAW,EAAA;AAAA,YACT,MAAQ,EAAA;AAAA,cACN,SAAW,EAAA;AAAA,gBACT,aAAe,EAAA;AAAA,kBACb,aAAe,EAAA;AAAA,iBACjB;AAAA,gBACA,UAAY,EAAA;AAAA,kBACV,EAAI,EAAA;AAAA,oBACF,KAAO,EAAA,GAAA;AAAA,oBACP,SAAW,EAAA,iCAAA;AAAA,oBACX,YAAc,EAAA,CAAA;AAAA,oBACd,QAAQ,CAAS,KAAA,KAAA,CAAA,UAAA,EAAa,MAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAAA,oBACrD,QAAU,EAAA;AAAA;AACZ;AACF;AACF;AACF;AACF;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
2
2
|
import Paper from '@mui/material/Paper';
|
3
3
|
import Box from '@mui/material/Box';
|
4
4
|
import Divider from '@mui/material/Divider';
|
@@ -9,32 +9,37 @@ const CardWrapper = ({
|
|
9
9
|
title,
|
10
10
|
filter
|
11
11
|
}) => {
|
12
|
-
return /* @__PURE__ */
|
12
|
+
return /* @__PURE__ */ jsxs(
|
13
13
|
Box,
|
14
14
|
{
|
15
15
|
component: Paper,
|
16
|
-
sx: { border: (theme) => `1px solid ${theme.palette.grey[300]}` }
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
16
|
+
sx: { border: (theme) => `1px solid ${theme.palette.grey[300]}` },
|
17
|
+
children: [
|
18
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", justifyContent: "space-between" }, children: [
|
19
|
+
/* @__PURE__ */ jsx(
|
20
|
+
Typography,
|
21
|
+
{
|
22
|
+
variant: "h5",
|
23
|
+
sx: {
|
24
|
+
p: 3,
|
25
|
+
display: "flex",
|
26
|
+
alignItems: "center",
|
27
|
+
fontWeight: "bold"
|
28
|
+
},
|
29
|
+
children: title
|
30
|
+
}
|
31
|
+
),
|
32
|
+
filter && /* @__PURE__ */ jsx(Box, { children: filter })
|
33
|
+
] }),
|
34
|
+
/* @__PURE__ */ jsx(
|
35
|
+
Divider,
|
36
|
+
{
|
37
|
+
sx: { border: (theme) => `1px solid ${theme.palette.grey[300]}` }
|
38
|
+
}
|
39
|
+
),
|
40
|
+
/* @__PURE__ */ jsx(Box, { children })
|
41
|
+
]
|
42
|
+
}
|
38
43
|
);
|
39
44
|
};
|
40
45
|
|
@@ -1 +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
|
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 type { ReactNode, HTMLProps, FC } 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 HTMLProps<HTMLDivElement> {\n children: ReactNode;\n title: string;\n filter?: ReactNode;\n}\n\nconst CardWrapper: 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":[],"mappings":";;;;;;AA4BA,MAAM,cAAoC,CAAC;AAAA,EACzC,QAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAwB,KAAA;AACtB,EACE,uBAAA,IAAA;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,EAAA;AAAA,MAE9D,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,OAAI,EAAI,EAAA,EAAE,SAAS,MAAQ,EAAA,cAAA,EAAgB,iBAC1C,EAAA,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,OAAQ,EAAA,IAAA;AAAA,cACR,EAAI,EAAA;AAAA,gBACF,CAAG,EAAA,CAAA;AAAA,gBACH,OAAS,EAAA,MAAA;AAAA,gBACT,UAAY,EAAA,QAAA;AAAA,gBACZ,UAAY,EAAA;AAAA,eACd;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA,WACH;AAAA,UAEC,MAAA,oBAAW,GAAA,CAAA,GAAA,EAAA,EAAK,QAAO,EAAA,MAAA,EAAA;AAAA,SAC1B,EAAA,CAAA;AAAA,wBACA,GAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,EAAA,EAAI,EAAE,MAAA,EAAQ,CAAS,KAAA,KAAA,CAAA,UAAA,EAAa,MAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAC,CAAG,CAAA;AAAA;AAAA,SAChE;AAAA,wBACA,GAAA,CAAC,OAAK,QAAS,EAAA;AAAA;AAAA;AAAA,GACjB;AAEJ;;;;"}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
2
|
+
import { useState, useEffect, useCallback, useMemo } from 'react';
|
2
3
|
import { ResponseErrorPanel } from '@backstage/core-components';
|
3
4
|
import Box from '@mui/material/Box';
|
4
5
|
import Table from '@mui/material/Table';
|
@@ -20,39 +21,36 @@ import FilterDropdown from './FilterDropdown.esm.js';
|
|
20
21
|
import EmptyChartState from '../Common/EmptyChartState.esm.js';
|
21
22
|
|
22
23
|
const CatalogEntities = () => {
|
23
|
-
const [page, setPage] =
|
24
|
-
const [limit] =
|
25
|
-
const [rowsPerPage, setRowsPerPage] =
|
26
|
-
const [selectedOption, setSelectedOption] =
|
27
|
-
const [uniqueCatalogEntityKinds, setUniqueCatalogEntityKinds] =
|
24
|
+
const [page, setPage] = useState(0);
|
25
|
+
const [limit] = useState(20);
|
26
|
+
const [rowsPerPage, setRowsPerPage] = useState(3);
|
27
|
+
const [selectedOption, setSelectedOption] = useState("");
|
28
|
+
const [uniqueCatalogEntityKinds, setUniqueCatalogEntityKinds] = useState([]);
|
28
29
|
const entityLink = useRouteRef(entityRouteRef);
|
29
30
|
const { catalogEntities, loading, error } = useCatalogEntities({
|
30
31
|
limit,
|
31
32
|
kind: selectedOption === "All" ? "" : selectedOption.toLocaleLowerCase()
|
32
33
|
});
|
33
|
-
|
34
|
+
useEffect(() => {
|
34
35
|
if (catalogEntities?.data?.length > 0 && uniqueCatalogEntityKinds?.length === 0) {
|
35
36
|
const uniqueKinds = getUniqueCatalogEntityKinds(catalogEntities.data);
|
36
37
|
setUniqueCatalogEntityKinds(uniqueKinds);
|
37
38
|
}
|
38
39
|
}, [catalogEntities, uniqueCatalogEntityKinds]);
|
39
|
-
const handleChangePage =
|
40
|
-
(
|
41
|
-
|
42
|
-
|
43
|
-
[]
|
44
|
-
);
|
45
|
-
const handleChangeRowsPerPage = React__default.useCallback(
|
40
|
+
const handleChangePage = useCallback((_event, newPage) => {
|
41
|
+
setPage(newPage);
|
42
|
+
}, []);
|
43
|
+
const handleChangeRowsPerPage = useCallback(
|
46
44
|
(event) => {
|
47
45
|
setRowsPerPage(+event.target.value);
|
48
46
|
setPage(0);
|
49
47
|
},
|
50
48
|
[]
|
51
49
|
);
|
52
|
-
const handleChange =
|
50
|
+
const handleChange = useCallback((event) => {
|
53
51
|
setSelectedOption(event.target.value);
|
54
52
|
}, []);
|
55
|
-
const visibleCatalogEntities =
|
53
|
+
const visibleCatalogEntities = useMemo(() => {
|
56
54
|
return catalogEntities.data?.filter((entity) => {
|
57
55
|
if (selectedOption && selectedOption !== "All") {
|
58
56
|
return entity.kind.toLocaleLowerCase() === selectedOption.toLocaleLowerCase();
|
@@ -61,100 +59,106 @@ const CatalogEntities = () => {
|
|
61
59
|
}).slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage);
|
62
60
|
}, [catalogEntities, page, rowsPerPage, selectedOption]);
|
63
61
|
if (error) {
|
64
|
-
return /* @__PURE__ */
|
62
|
+
return /* @__PURE__ */ jsx(CardWrapper, { title: CATALOG_ENTITIES_TITLE, children: /* @__PURE__ */ jsx(ResponseErrorPanel, { error }) });
|
65
63
|
}
|
66
64
|
if ((!visibleCatalogEntities || visibleCatalogEntities?.length === 0) && !loading) {
|
67
|
-
return /* @__PURE__ */
|
65
|
+
return /* @__PURE__ */ jsx(CardWrapper, { title: CATALOG_ENTITIES_TITLE, children: /* @__PURE__ */ jsx(
|
68
66
|
Box,
|
69
67
|
{
|
70
68
|
display: "flex",
|
71
69
|
justifyContent: "center",
|
72
70
|
alignItems: "center",
|
73
|
-
height: 200
|
74
|
-
|
75
|
-
|
76
|
-
));
|
71
|
+
height: 200,
|
72
|
+
children: /* @__PURE__ */ jsx(EmptyChartState, {})
|
73
|
+
}
|
74
|
+
) });
|
77
75
|
}
|
78
|
-
return /* @__PURE__ */
|
76
|
+
return /* @__PURE__ */ jsx(
|
79
77
|
CardWrapper,
|
80
78
|
{
|
81
79
|
title: CATALOG_ENTITIES_TITLE,
|
82
|
-
filter: /* @__PURE__ */
|
80
|
+
filter: /* @__PURE__ */ jsx(
|
83
81
|
FilterDropdown,
|
84
82
|
{
|
85
83
|
selectedOption,
|
86
84
|
handleChange,
|
87
85
|
uniqueCatalogEntityKinds
|
88
86
|
}
|
89
|
-
)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
)) : visibleCatalogEntities?.map((entity) => /* @__PURE__ */ React__default.createElement(
|
110
|
-
TableRow,
|
111
|
-
{
|
112
|
-
key: `${entity.kind}-${entity.name}`,
|
113
|
-
sx: {
|
114
|
-
"&:nth-of-type(odd)": { backgroundColor: "inherit" },
|
115
|
-
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`
|
116
|
-
}
|
117
|
-
},
|
118
|
-
/* @__PURE__ */ React__default.createElement(TableCell, { sx: { width: "25%" } }, /* @__PURE__ */ React__default.createElement(
|
119
|
-
Link,
|
120
|
-
{
|
121
|
-
component: "a",
|
122
|
-
href: entityLink({
|
123
|
-
kind: entity.kind,
|
124
|
-
namespace: entity.namespace,
|
125
|
-
name: entity.name
|
126
|
-
}),
|
127
|
-
target: "_blank",
|
128
|
-
rel: "noopener noreferrer",
|
129
|
-
sx: {
|
130
|
-
textDecoration: "none",
|
131
|
-
"&:hover": {
|
132
|
-
textDecoration: "none"
|
133
|
-
}
|
87
|
+
),
|
88
|
+
children: /* @__PURE__ */ jsxs(Table, { "aria-labelledby": "Catalog entities", sx: { width: "100%" }, children: [
|
89
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: CATALOG_ENTITIES_TABLE_HEADERS.map((header) => /* @__PURE__ */ jsx(
|
90
|
+
TableCell,
|
91
|
+
{
|
92
|
+
align: "left",
|
93
|
+
sx: {
|
94
|
+
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`,
|
95
|
+
width: "25%"
|
96
|
+
},
|
97
|
+
children: header.title
|
98
|
+
},
|
99
|
+
header.id
|
100
|
+
)) }) }),
|
101
|
+
/* @__PURE__ */ jsx(TableBody, { children: loading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
102
|
+
TableCell,
|
103
|
+
{
|
104
|
+
colSpan: CATALOG_ENTITIES_TABLE_HEADERS.length,
|
105
|
+
align: "center",
|
106
|
+
children: /* @__PURE__ */ jsx(CircularProgress, {})
|
134
107
|
}
|
135
|
-
}
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
108
|
+
) }) : visibleCatalogEntities?.map((entity) => /* @__PURE__ */ jsxs(
|
109
|
+
TableRow,
|
110
|
+
{
|
111
|
+
sx: {
|
112
|
+
"&:nth-of-type(odd)": { backgroundColor: "inherit" },
|
113
|
+
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`
|
114
|
+
},
|
115
|
+
children: [
|
116
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "25%" }, children: /* @__PURE__ */ jsx(
|
117
|
+
Link,
|
118
|
+
{
|
119
|
+
component: "a",
|
120
|
+
href: entityLink({
|
121
|
+
kind: entity.kind,
|
122
|
+
namespace: entity.namespace,
|
123
|
+
name: entity.name
|
124
|
+
}),
|
125
|
+
target: "_blank",
|
126
|
+
rel: "noopener noreferrer",
|
127
|
+
sx: {
|
128
|
+
textDecoration: "none",
|
129
|
+
"&:hover": {
|
130
|
+
textDecoration: "none"
|
131
|
+
}
|
132
|
+
},
|
133
|
+
children: entity.name ?? "--"
|
134
|
+
}
|
135
|
+
) }),
|
136
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "25%" }, children: entity.kind?.charAt(0).toLocaleUpperCase("en-US") + entity.kind?.slice(1) || "--" }),
|
137
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "25%" }, children: getLastUsedDay(entity.last_used) ?? "--" }),
|
138
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "25%" }, children: Number(entity.count).toLocaleString() ?? "--" })
|
139
|
+
]
|
140
|
+
},
|
141
|
+
`${entity.kind}-${entity.name}`
|
142
|
+
)) }),
|
143
|
+
/* @__PURE__ */ jsx(TableFooter, { children: /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
144
|
+
TableCell,
|
145
|
+
{
|
146
|
+
colSpan: CATALOG_ENTITIES_TABLE_HEADERS.length,
|
147
|
+
sx: { padding: 0 },
|
148
|
+
children: /* @__PURE__ */ jsx(
|
149
|
+
TableFooterPagination,
|
150
|
+
{
|
151
|
+
count: catalogEntities.data?.length,
|
152
|
+
rowsPerPage,
|
153
|
+
page,
|
154
|
+
handleChangePage,
|
155
|
+
handleChangeRowsPerPage
|
156
|
+
}
|
157
|
+
)
|
158
|
+
}
|
159
|
+
) }) })
|
160
|
+
] })
|
161
|
+
}
|
158
162
|
);
|
159
163
|
};
|
160
164
|
|