@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, jsxs } from 'react/jsx-runtime';
|
2
|
+
import { useState, useCallback, useMemo } from 'react';
|
2
3
|
import { parseEntityRef } from '@backstage/catalog-model';
|
3
4
|
import { ResponseErrorPanel } from '@backstage/core-components';
|
4
5
|
import Table from '@mui/material/Table';
|
@@ -17,105 +18,108 @@ import { useTemplates } from '../../hooks/useTemplates.esm.js';
|
|
17
18
|
import EmptyChartState from '../Common/EmptyChartState.esm.js';
|
18
19
|
|
19
20
|
const Templates = () => {
|
20
|
-
const [page, setPage] =
|
21
|
-
const [limit] =
|
22
|
-
const [rowsPerPage, setRowsPerPage] =
|
21
|
+
const [page, setPage] = useState(0);
|
22
|
+
const [limit] = useState(20);
|
23
|
+
const [rowsPerPage, setRowsPerPage] = useState(3);
|
23
24
|
const { templates, loading, error } = useTemplates({ limit });
|
24
|
-
const handleChangePage =
|
25
|
-
(
|
26
|
-
|
27
|
-
|
28
|
-
[]
|
29
|
-
);
|
30
|
-
const handleChangeRowsPerPage = React__default.useCallback(
|
25
|
+
const handleChangePage = useCallback((_event, newPage) => {
|
26
|
+
setPage(newPage);
|
27
|
+
}, []);
|
28
|
+
const handleChangeRowsPerPage = useCallback(
|
31
29
|
(event) => {
|
32
30
|
setRowsPerPage(+event.target.value);
|
33
31
|
setPage(0);
|
34
32
|
},
|
35
33
|
[]
|
36
34
|
);
|
37
|
-
const visibleTemplates =
|
35
|
+
const visibleTemplates = useMemo(() => {
|
38
36
|
return templates.data?.slice(
|
39
37
|
page * rowsPerPage,
|
40
38
|
page * rowsPerPage + rowsPerPage
|
41
39
|
);
|
42
40
|
}, [templates, page, rowsPerPage]);
|
43
41
|
if (error) {
|
44
|
-
return /* @__PURE__ */
|
42
|
+
return /* @__PURE__ */ jsx(CardWrapper, { title: "Top templates", children: /* @__PURE__ */ jsx(ResponseErrorPanel, { error }) });
|
45
43
|
}
|
46
44
|
if (!visibleTemplates || visibleTemplates?.length === 0) {
|
47
|
-
return /* @__PURE__ */
|
45
|
+
return /* @__PURE__ */ jsx(CardWrapper, { title: "Top templates", children: /* @__PURE__ */ jsx(
|
48
46
|
Box,
|
49
47
|
{
|
50
48
|
display: "flex",
|
51
49
|
justifyContent: "center",
|
52
50
|
alignItems: "center",
|
53
|
-
height: 200
|
54
|
-
|
55
|
-
/* @__PURE__ */ React__default.createElement(EmptyChartState, null)
|
56
|
-
));
|
57
|
-
}
|
58
|
-
return /* @__PURE__ */ React__default.createElement(CardWrapper, { title: `Top ${rowsPerPage} templates` }, /* @__PURE__ */ React__default.createElement(Table, { "aria-labelledby": "Catalog entities", sx: { width: "100%" } }, /* @__PURE__ */ React__default.createElement(TableHead, null, /* @__PURE__ */ React__default.createElement(TableRow, null, TEMPLATE_TABLE_HEADERS.map((header) => /* @__PURE__ */ React__default.createElement(
|
59
|
-
TableCell,
|
60
|
-
{
|
61
|
-
key: header.id,
|
62
|
-
align: "left",
|
63
|
-
sx: {
|
64
|
-
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`
|
51
|
+
height: 200,
|
52
|
+
children: /* @__PURE__ */ jsx(EmptyChartState, {})
|
65
53
|
}
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
const { name, namespace = "default" } = parseEntityRef(
|
72
|
-
template?.entityref
|
73
|
-
);
|
74
|
-
const entityHrefLink = `/create/templates/${namespace}/${name}`;
|
75
|
-
return /* @__PURE__ */ React__default.createElement(
|
76
|
-
TableRow,
|
54
|
+
) });
|
55
|
+
}
|
56
|
+
return /* @__PURE__ */ jsx(CardWrapper, { title: `Top ${rowsPerPage} templates`, children: /* @__PURE__ */ jsxs(Table, { "aria-labelledby": "Catalog entities", sx: { width: "100%" }, children: [
|
57
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: TEMPLATE_TABLE_HEADERS.map((header) => /* @__PURE__ */ jsx(
|
58
|
+
TableCell,
|
77
59
|
{
|
78
|
-
|
60
|
+
align: "left",
|
79
61
|
sx: {
|
80
|
-
"&:nth-of-type(odd)": { backgroundColor: "inherit" },
|
81
62
|
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`
|
82
|
-
}
|
63
|
+
},
|
64
|
+
children: header.title
|
83
65
|
},
|
84
|
-
|
85
|
-
|
66
|
+
header.id
|
67
|
+
)) }) }),
|
68
|
+
/* @__PURE__ */ jsx(TableBody, { children: loading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: TEMPLATE_TABLE_HEADERS.length, align: "center", children: /* @__PURE__ */ jsx(CircularProgress, {}) }) }) : visibleTemplates?.map((template) => {
|
69
|
+
if (!template.entityref || Object.keys(template.entityref).length === 0)
|
70
|
+
return null;
|
71
|
+
const { name, namespace = "default" } = parseEntityRef(
|
72
|
+
template?.entityref
|
73
|
+
);
|
74
|
+
const entityHrefLink = `/create/templates/${namespace}/${name}`;
|
75
|
+
return /* @__PURE__ */ jsxs(
|
76
|
+
TableRow,
|
86
77
|
{
|
87
|
-
component: "a",
|
88
|
-
href: entityHrefLink,
|
89
|
-
target: "_blank",
|
90
|
-
rel: "noopener noreferrer",
|
91
78
|
sx: {
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
79
|
+
"&:nth-of-type(odd)": { backgroundColor: "inherit" },
|
80
|
+
borderBottom: (theme) => `1px solid ${theme.palette.grey[300]}`
|
81
|
+
},
|
82
|
+
children: [
|
83
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "50%" }, children: /* @__PURE__ */ jsx(
|
84
|
+
Link,
|
85
|
+
{
|
86
|
+
component: "a",
|
87
|
+
href: entityHrefLink,
|
88
|
+
target: "_blank",
|
89
|
+
rel: "noopener noreferrer",
|
90
|
+
sx: {
|
91
|
+
textDecoration: "none",
|
92
|
+
"&:hover": {
|
93
|
+
textDecoration: "none"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
children: name ?? "--"
|
97
|
+
}
|
98
|
+
) }),
|
99
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { width: "50%" }, children: Number(template.count).toLocaleString() ?? "--" })
|
100
|
+
]
|
97
101
|
},
|
98
|
-
|
99
|
-
)
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
TableCell,
|
104
|
-
{
|
105
|
-
colSpan: TEMPLATE_TABLE_HEADERS.length,
|
106
|
-
sx: { padding: 0 }
|
107
|
-
},
|
108
|
-
/* @__PURE__ */ React__default.createElement(
|
109
|
-
TableFooterPagination,
|
102
|
+
template.entityref
|
103
|
+
);
|
104
|
+
}) }),
|
105
|
+
/* @__PURE__ */ jsx(TableFooter, { children: /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
106
|
+
TableCell,
|
110
107
|
{
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
108
|
+
colSpan: TEMPLATE_TABLE_HEADERS.length,
|
109
|
+
sx: { padding: 0 },
|
110
|
+
children: /* @__PURE__ */ jsx(
|
111
|
+
TableFooterPagination,
|
112
|
+
{
|
113
|
+
count: templates.data?.length,
|
114
|
+
rowsPerPage,
|
115
|
+
page,
|
116
|
+
handleChangePage,
|
117
|
+
handleChangeRowsPerPage
|
118
|
+
}
|
119
|
+
)
|
116
120
|
}
|
117
|
-
)
|
118
|
-
))
|
121
|
+
) }) })
|
122
|
+
] }) });
|
119
123
|
};
|
120
124
|
|
121
125
|
export { Templates as default };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Templates.esm.js","sources":["../../../src/components/Templates/Templates.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":"Templates.esm.js","sources":["../../../src/components/Templates/Templates.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 { useState, useCallback, useMemo } from 'react';\nimport type { ChangeEvent } from 'react';\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { ResponseErrorPanel } from '@backstage/core-components';\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 Box from '@mui/material/Box';\nimport Link from '@mui/material/Link';\n\nimport CardWrapper from '../CardWrapper';\nimport { TEMPLATE_TABLE_HEADERS } from '../../utils/constants';\nimport TableFooterPagination from '../CardFooter';\nimport { useTemplates } from '../../hooks/useTemplates';\nimport EmptyChartState from '../Common/EmptyChartState';\n\nconst Templates = () => {\n const [page, setPage] = useState(0);\n const [limit] = useState(20);\n const [rowsPerPage, setRowsPerPage] = useState(3);\n\n const { templates, loading, error } = useTemplates({ limit });\n\n const handleChangePage = useCallback((_event: unknown, newPage: number) => {\n setPage(newPage);\n }, []);\n\n const handleChangeRowsPerPage = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setRowsPerPage(+event.target.value);\n setPage(0);\n },\n [],\n );\n\n const visibleTemplates = useMemo(() => {\n return templates.data?.slice(\n page * rowsPerPage,\n page * rowsPerPage + rowsPerPage,\n );\n }, [templates, page, rowsPerPage]);\n\n if (error) {\n return (\n <CardWrapper title=\"Top templates\">\n <ResponseErrorPanel error={error} />\n </CardWrapper>\n );\n }\n\n if (!visibleTemplates || visibleTemplates?.length === 0) {\n return (\n <CardWrapper title=\"Top templates\">\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 title={`Top ${rowsPerPage} templates`}>\n <Table aria-labelledby=\"Catalog entities\" sx={{ width: '100%' }}>\n <TableHead>\n <TableRow>\n {TEMPLATE_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 }}\n >\n {header.title}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {loading ? (\n <TableRow>\n <TableCell colSpan={TEMPLATE_TABLE_HEADERS.length} align=\"center\">\n <CircularProgress />\n </TableCell>\n </TableRow>\n ) : (\n visibleTemplates?.map(template => {\n if (\n !template.entityref ||\n Object.keys(template.entityref).length === 0\n )\n return null;\n\n const { name, namespace = 'default' } = parseEntityRef(\n template?.entityref,\n );\n const entityHrefLink = `/create/templates/${namespace}/${name}`;\n\n return (\n <TableRow\n key={template.entityref}\n sx={{\n '&:nth-of-type(odd)': { backgroundColor: 'inherit' },\n borderBottom: theme =>\n `1px solid ${theme.palette.grey[300]}`,\n }}\n >\n <TableCell sx={{ width: '50%' }}>\n <Link\n component=\"a\"\n href={entityHrefLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n sx={{\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'none',\n },\n }}\n >\n {name ?? '--'}\n </Link>\n </TableCell>\n <TableCell sx={{ width: '50%' }}>\n {Number(template.count).toLocaleString() ?? '--'}\n </TableCell>\n </TableRow>\n );\n })\n )}\n </TableBody>\n <TableFooter>\n <TableRow>\n <TableCell\n colSpan={TEMPLATE_TABLE_HEADERS.length}\n sx={{ padding: 0 }}\n >\n <TableFooterPagination\n count={templates.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 Templates;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAoCA,MAAM,YAAY,MAAM;AACtB,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,CAAC,CAAA;AAClC,EAAA,MAAM,CAAC,KAAK,CAAI,GAAA,QAAA,CAAS,EAAE,CAAA;AAC3B,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,CAAC,CAAA;AAEhD,EAAM,MAAA,EAAE,WAAW,OAAS,EAAA,KAAA,KAAU,YAAa,CAAA,EAAE,OAAO,CAAA;AAE5D,EAAA,MAAM,gBAAmB,GAAA,WAAA,CAAY,CAAC,MAAA,EAAiB,OAAoB,KAAA;AACzE,IAAA,OAAA,CAAQ,OAAO,CAAA;AAAA,GACjB,EAAG,EAAE,CAAA;AAEL,EAAA,MAAM,uBAA0B,GAAA,WAAA;AAAA,IAC9B,CAAC,KAA+D,KAAA;AAC9D,MAAe,cAAA,CAAA,CAAC,KAAM,CAAA,MAAA,CAAO,KAAK,CAAA;AAClC,MAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,KACX;AAAA,IACA;AAAC,GACH;AAEA,EAAM,MAAA,gBAAA,GAAmB,QAAQ,MAAM;AACrC,IAAA,OAAO,UAAU,IAAM,EAAA,KAAA;AAAA,MACrB,IAAO,GAAA,WAAA;AAAA,MACP,OAAO,WAAc,GAAA;AAAA,KACvB;AAAA,GACC,EAAA,CAAC,SAAW,EAAA,IAAA,EAAM,WAAW,CAAC,CAAA;AAEjC,EAAA,IAAI,KAAO,EAAA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A,IAAA,IAAA;AAAA;AAAA,aAEb,EAAA,CAAA;AAAA,4BACC,GAAA,CAAA,SAAA,EAAA,EAAU,EAAI,EAAA,EAAE,KAAO,EAAA,KAAA,EACrB,EAAA,QAAA,EAAA,MAAA,CAAO,QAAS,CAAA,KAAK,CAAE,CAAA,cAAA,MAAoB,IAC9C,EAAA;AAAA;AAAA,SAAA;AAAA,QAzBK,QAAS,CAAA;AAAA,OA0BhB;AAAA,KAEH,CAEL,EAAA,CAAA;AAAA,oBACA,GAAA,CAAC,WACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,QACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,SAAS,sBAAuB,CAAA,MAAA;AAAA,QAChC,EAAA,EAAI,EAAE,OAAA,EAAS,CAAE,EAAA;AAAA,QAEjB,QAAA,kBAAA,GAAA;AAAA,UAAC,qBAAA;AAAA,UAAA;AAAA,YACC,KAAA,EAAO,UAAU,IAAM,EAAA,MAAA;AAAA,YACvB,WAAA;AAAA,YACA,IAAA;AAAA,YACA,gBAAA;AAAA,YACA;AAAA;AAAA;AACF;AAAA,OAEJ,CACF,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
2
2
|
import { useTheme } from '@mui/material/styles';
|
3
3
|
import Box from '@mui/material/Box';
|
4
4
|
import MuiTooltip from '@mui/material/Tooltip';
|
@@ -7,10 +7,10 @@ import IconButton from '@mui/material/IconButton';
|
|
7
7
|
|
8
8
|
const InfoComponent = () => {
|
9
9
|
const theme = useTheme();
|
10
|
-
return /* @__PURE__ */
|
10
|
+
return /* @__PURE__ */ jsx(Box, { sx: { display: "flex", alignItems: "center", height: "100%", mr: 2 }, children: /* @__PURE__ */ jsx(
|
11
11
|
MuiTooltip,
|
12
12
|
{
|
13
|
-
title: /* @__PURE__ */
|
13
|
+
title: /* @__PURE__ */ jsx(Box, { sx: { textAlign: "center", width: "238px" }, children: "Set the number of licensed users in the app-config.yaml" }),
|
14
14
|
placement: "left",
|
15
15
|
componentsProps: {
|
16
16
|
tooltip: {
|
@@ -24,15 +24,15 @@ const InfoComponent = () => {
|
|
24
24
|
p: 1.5
|
25
25
|
}
|
26
26
|
}
|
27
|
-
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
|
35
|
-
));
|
27
|
+
},
|
28
|
+
children: /* @__PURE__ */ jsx(IconButton, { children: /* @__PURE__ */ jsx(
|
29
|
+
InfoOutlinedIcon,
|
30
|
+
{
|
31
|
+
sx: { color: theme.palette.text.secondary, fontSize: "1.75rem" }
|
32
|
+
}
|
33
|
+
) })
|
34
|
+
}
|
35
|
+
) });
|
36
36
|
};
|
37
37
|
|
38
38
|
export { InfoComponent as default };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Info.esm.js","sources":["../../../src/components/Users/Info.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":"Info.esm.js","sources":["../../../src/components/Users/Info.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 { useTheme } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\nimport MuiTooltip from '@mui/material/Tooltip';\nimport InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';\nimport IconButton from '@mui/material/IconButton';\n\nconst InfoComponent = () => {\n const theme = useTheme();\n\n return (\n <Box sx={{ display: 'flex', alignItems: 'center', height: '100%', mr: 2 }}>\n <MuiTooltip\n title={\n <Box sx={{ textAlign: 'center', width: '238px' }}>\n Set the number of licensed users in the app-config.yaml\n </Box>\n }\n placement=\"left\"\n componentsProps={{\n tooltip: {\n sx: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n bgcolor: '#151515',\n color: 'white',\n fontSize: '0.875rem',\n p: 1.5,\n },\n },\n }}\n >\n <IconButton>\n <InfoOutlinedIcon\n sx={{ color: theme.palette.text.secondary, fontSize: '1.75rem' }}\n />\n </IconButton>\n </MuiTooltip>\n </Box>\n );\n};\n\nexport default InfoComponent;\n"],"names":[],"mappings":";;;;;;;AAqBA,MAAM,gBAAgB,MAAM;AAC1B,EAAA,MAAM,QAAQ,QAAS,EAAA;AAEvB,EAAA,uBACG,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,EAAE,OAAS,EAAA,MAAA,EAAQ,UAAY,EAAA,QAAA,EAAU,MAAQ,EAAA,MAAA,EAAQ,EAAI,EAAA,CAAA,EACpE,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA,kBACG,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,EAAE,WAAW,QAAU,EAAA,KAAA,EAAO,OAAQ,EAAA,EAAG,QAElD,EAAA,yDAAA,EAAA,CAAA;AAAA,MAEF,SAAU,EAAA,MAAA;AAAA,MACV,eAAiB,EAAA;AAAA,QACf,OAAS,EAAA;AAAA,UACP,EAAI,EAAA;AAAA,YACF,OAAS,EAAA,MAAA;AAAA,YACT,cAAgB,EAAA,QAAA;AAAA,YAChB,UAAY,EAAA,QAAA;AAAA,YACZ,OAAS,EAAA,SAAA;AAAA,YACT,KAAO,EAAA,OAAA;AAAA,YACP,QAAU,EAAA,UAAA;AAAA,YACV,CAAG,EAAA;AAAA;AACL;AACF,OACF;AAAA,MAEA,8BAAC,UACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,gBAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAI,EAAE,KAAO,EAAA,KAAA,CAAM,QAAQ,IAAK,CAAA,SAAA,EAAW,UAAU,SAAU;AAAA;AAAA,OAEnE,EAAA;AAAA;AAAA,GAEJ,EAAA,CAAA;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 Typography from '@mui/material/Typography';
|
4
4
|
|
@@ -8,7 +8,7 @@ const Tooltip = ({ active, payload, licensed_users, logged_in_users }) => {
|
|
8
8
|
(payload[0].name === "Licensed" ? (payload[0].value - logged_in_users) / licensed_users : payload[0].value / licensed_users) * 100
|
9
9
|
);
|
10
10
|
const { value, name } = payload[0];
|
11
|
-
return /* @__PURE__ */
|
11
|
+
return /* @__PURE__ */ jsxs(
|
12
12
|
Paper,
|
13
13
|
{
|
14
14
|
elevation: 1,
|
@@ -17,28 +17,32 @@ const Tooltip = ({ active, payload, licensed_users, logged_in_users }) => {
|
|
17
17
|
borderRadius: "4px",
|
18
18
|
boxShadow: "0px 0px 6px rgba(0, 0, 0, 0.1)",
|
19
19
|
border: (theme) => `1px solid ${theme.palette.grey[300]}`
|
20
|
-
}
|
21
|
-
},
|
22
|
-
/* @__PURE__ */ React__default.createElement(
|
23
|
-
Typography,
|
24
|
-
{
|
25
|
-
style: { fontSize: "0.875rem", margin: 0, fontWeight: "500" }
|
26
20
|
},
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
21
|
+
children: [
|
22
|
+
/* @__PURE__ */ jsx(
|
23
|
+
Typography,
|
24
|
+
{
|
25
|
+
style: { fontSize: "0.875rem", margin: 0, fontWeight: "500" },
|
26
|
+
children: name === "Licensed" ? (value - logged_in_users).toLocaleString() : value.toLocaleString()
|
27
|
+
}
|
28
|
+
),
|
29
|
+
/* @__PURE__ */ jsxs(
|
30
|
+
Typography,
|
31
|
+
{
|
32
|
+
style: {
|
33
|
+
fontSize: "2rem",
|
34
|
+
margin: 0,
|
35
|
+
color: "#009596",
|
36
|
+
fontWeight: "500"
|
37
|
+
},
|
38
|
+
children: [
|
39
|
+
percent,
|
40
|
+
"%"
|
41
|
+
]
|
42
|
+
}
|
43
|
+
)
|
44
|
+
]
|
45
|
+
}
|
42
46
|
);
|
43
47
|
}
|
44
48
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tooltip.esm.js","sources":["../../../src/components/Users/Tooltip.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":"Tooltip.esm.js","sources":["../../../src/components/Users/Tooltip.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 Paper from '@mui/material/Paper';\nimport Typography from '@mui/material/Typography';\n\nconst Tooltip = ({ active, payload, licensed_users, logged_in_users }: any) => {\n if (active && payload?.length) {\n const percent = Math.round(\n (payload[0].name === 'Licensed'\n ? (payload[0].value - logged_in_users) / licensed_users\n : payload[0].value / licensed_users) * 100,\n );\n\n const { value, name } = payload[0];\n\n return (\n <Paper\n elevation={1}\n sx={{\n padding: '8px',\n borderRadius: '4px',\n boxShadow: '0px 0px 6px rgba(0, 0, 0, 0.1)',\n border: theme => `1px solid ${theme.palette.grey[300]}`,\n }}\n >\n <Typography\n style={{ fontSize: '0.875rem', margin: 0, fontWeight: '500' }}\n >\n {name === 'Licensed'\n ? (value - logged_in_users).toLocaleString()\n : value.toLocaleString()}\n </Typography>\n <Typography\n style={{\n fontSize: '2rem',\n margin: 0,\n color: '#009596',\n fontWeight: '500',\n }}\n >\n {percent}%\n </Typography>\n </Paper>\n );\n }\n return null;\n};\n\nexport default Tooltip;\n"],"names":[],"mappings":";;;;AAkBA,MAAM,UAAU,CAAC,EAAE,QAAQ,OAAS,EAAA,cAAA,EAAgB,iBAA2B,KAAA;AAC7E,EAAI,IAAA,MAAA,IAAU,SAAS,MAAQ,EAAA;AAC7B,IAAA,MAAM,UAAU,IAAK,CAAA,KAAA;AAAA,MAAA,CAClB,OAAQ,CAAA,CAAC,CAAE,CAAA,IAAA,KAAS,cAChB,OAAQ,CAAA,CAAC,CAAE,CAAA,KAAA,GAAQ,mBAAmB,cACvC,GAAA,OAAA,CAAQ,CAAC,CAAA,CAAE,QAAQ,cAAkB,IAAA;AAAA,KAC3C;AAEA,IAAA,MAAM,EAAE,KAAA,EAAO,IAAK,EAAA,GAAI,QAAQ,CAAC,CAAA;AAEjC,IACE,uBAAA,IA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