@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 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplates.esm.js","sources":["../../src/hooks/useTemplates.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":"useTemplates.esm.js","sources":["../../src/hooks/useTemplates.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, useEffect } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useAsyncRetry } from 'react-use';\nimport { format } from 'date-fns';\n\nimport { adoptionInsightsApiRef } from '../api';\nimport { APIsViewOptions, TemplatesResponse } from '../types';\nimport { useDateRange } from '../components/Header/DateRangeContext';\n\nexport const useTemplates = ({\n limit = 20,\n}: APIsViewOptions): {\n templates: TemplatesResponse;\n error: Error | undefined;\n loading: boolean;\n} => {\n const [loadingData, setLoadingData] = useState<boolean>(true);\n const [templates, setTemplates] = useState<TemplatesResponse>({\n data: [],\n });\n\n const { startDateRange, endDateRange } = useDateRange();\n\n const api = useApi(adoptionInsightsApiRef);\n\n const getTemplates = useCallback(async () => {\n return await api\n .getTemplates({\n type: 'top_templates',\n start_date: startDateRange\n ? format(startDateRange, 'yyyy-MM-dd')\n : undefined,\n end_date: endDateRange ? format(endDateRange, 'yyyy-MM-dd') : undefined,\n limit,\n })\n .then((response: TemplatesResponse) =>\n setTemplates(response ?? { data: [] }),\n );\n }, [api, limit, startDateRange, endDateRange]);\n\n const { error, loading } = useAsyncRetry(async () => {\n return await getTemplates();\n }, [getTemplates]);\n\n useEffect(() => {\n let mounted = true;\n if (!loading && mounted) {\n setLoadingData(false);\n }\n return () => {\n mounted = false;\n };\n }, [loading]);\n\n return { templates, error, loading: loadingData };\n};\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,eAAe,CAAC;AAAA,EAC3B,KAAQ,GAAA;AACV,CAIK,KAAA;AACH,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAkB,IAAI,CAAA;AAC5D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,QAA4B,CAAA;AAAA,IAC5D,MAAM;AAAC,GACR,CAAA;AAED,EAAA,MAAM,EAAE,cAAA,EAAgB,YAAa,EAAA,GAAI,YAAa,EAAA;AAEtD,EAAM,MAAA,GAAA,GAAM,OAAO,sBAAsB,CAAA;AAEzC,EAAM,MAAA,YAAA,GAAe,YAAY,YAAY;AAC3C,IAAO,OAAA,MAAM,IACV,YAAa,CAAA;AAAA,MACZ,IAAM,EAAA,eAAA;AAAA,MACN,UAAY,EAAA,cAAA,GACR,MAAO,CAAA,cAAA,EAAgB,YAAY,CACnC,GAAA,MAAA;AAAA,MACJ,QAAU,EAAA,YAAA,GAAe,MAAO,CAAA,YAAA,EAAc,YAAY,CAAI,GAAA,MAAA;AAAA,MAC9D;AAAA,KACD,CACA,CAAA,IAAA;AAAA,MAAK,CAAC,aACL,YAAa,CAAA,QAAA,IAAY,EAAE,IAAM,EAAA,IAAI;AAAA,KACvC;AAAA,KACD,CAAC,GAAA,EAAK,KAAO,EAAA,cAAA,EAAgB,YAAY,CAAC,CAAA;AAE7C,EAAA,MAAM,EAAE,KAAA,EAAO,OAAQ,EAAA,GAAI,cAAc,YAAY;AACnD,IAAA,OAAO,MAAM,YAAa,EAAA;AAAA,GAC5B,EAAG,CAAC,YAAY,CAAC,CAAA;AAEjB,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAU,GAAA,IAAA;AACd,IAAI,IAAA,CAAC,WAAW,OAAS,EAAA;AACvB,MAAA,cAAA,CAAe,KAAK,CAAA;AAAA;AAEtB,IAAA,OAAO,MAAM;AACX,MAAU,OAAA,GAAA,KAAA;AAAA,KACZ;AAAA,GACF,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,OAAO,EAAE,SAAA,EAAW,KAAO,EAAA,OAAA,EAAS,WAAY,EAAA;AAClD;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { useState, useCallback, useEffect } from 'react';
|
2
2
|
import { useApi } from '@backstage/core-plugin-api';
|
3
3
|
import { useAsyncRetry } from 'react-use';
|
4
4
|
import { format } from 'date-fns';
|
@@ -6,11 +6,11 @@ import { adoptionInsightsApiRef } from '../api/index.esm.js';
|
|
6
6
|
import { useDateRange } from '../components/Header/DateRangeContext.esm.js';
|
7
7
|
|
8
8
|
const useUsers = () => {
|
9
|
-
const [loadingData, setLoadingData] =
|
10
|
-
const [users, setUsers] =
|
9
|
+
const [loadingData, setLoadingData] = useState(true);
|
10
|
+
const [users, setUsers] = useState({ data: [] });
|
11
11
|
const { startDateRange, endDateRange } = useDateRange();
|
12
12
|
const api = useApi(adoptionInsightsApiRef);
|
13
|
-
const getUsers =
|
13
|
+
const getUsers = useCallback(async () => {
|
14
14
|
return await api.getUsers({
|
15
15
|
type: "total_users",
|
16
16
|
start_date: startDateRange ? format(startDateRange, "yyyy-MM-dd") : void 0,
|
@@ -20,7 +20,7 @@ const useUsers = () => {
|
|
20
20
|
const { error, loading } = useAsyncRetry(async () => {
|
21
21
|
return await getUsers();
|
22
22
|
}, [getUsers]);
|
23
|
-
|
23
|
+
useEffect(() => {
|
24
24
|
let mounted = true;
|
25
25
|
if (!loading && mounted) {
|
26
26
|
setLoadingData(false);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useUsers.esm.js","sources":["../../src/hooks/useUsers.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":"useUsers.esm.js","sources":["../../src/hooks/useUsers.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 { useEffect, useCallback, useState } from 'react';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useAsyncRetry } from 'react-use';\nimport { format } from 'date-fns';\n\nimport { UsersResponse } from '../types';\nimport { adoptionInsightsApiRef } from '../api';\nimport { useDateRange } from '../components/Header/DateRangeContext';\n\nexport const useUsers = (): {\n users: UsersResponse;\n error: Error | undefined;\n loading: boolean;\n} => {\n const [loadingData, setLoadingData] = useState<boolean>(true);\n const [users, setUsers] = useState<UsersResponse>({ data: [] });\n\n const { startDateRange, endDateRange } = useDateRange();\n\n const api = useApi(adoptionInsightsApiRef);\n\n const getUsers = useCallback(async () => {\n return await api\n .getUsers({\n type: 'total_users',\n start_date: startDateRange\n ? format(startDateRange, 'yyyy-MM-dd')\n : undefined,\n end_date: endDateRange ? format(endDateRange, 'yyyy-MM-dd') : undefined,\n })\n .then(response => setUsers(response ?? { data: [] }));\n }, [api, startDateRange, endDateRange]);\n\n const { error, loading } = useAsyncRetry(async () => {\n return await getUsers();\n }, [getUsers]);\n\n useEffect(() => {\n let mounted = true;\n if (!loading && mounted) {\n setLoadingData(false);\n }\n return () => {\n mounted = false;\n };\n }, [loading]);\n\n return { users, error, loading: loadingData };\n};\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,WAAW,MAInB;AACH,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAkB,IAAI,CAAA;AAC5D,EAAM,MAAA,CAAC,OAAO,QAAQ,CAAA,GAAI,SAAwB,EAAE,IAAA,EAAM,EAAC,EAAG,CAAA;AAE9D,EAAA,MAAM,EAAE,cAAA,EAAgB,YAAa,EAAA,GAAI,YAAa,EAAA;AAEtD,EAAM,MAAA,GAAA,GAAM,OAAO,sBAAsB,CAAA;AAEzC,EAAM,MAAA,QAAA,GAAW,YAAY,YAAY;AACvC,IAAO,OAAA,MAAM,IACV,QAAS,CAAA;AAAA,MACR,IAAM,EAAA,aAAA;AAAA,MACN,UAAY,EAAA,cAAA,GACR,MAAO,CAAA,cAAA,EAAgB,YAAY,CACnC,GAAA,MAAA;AAAA,MACJ,QAAU,EAAA,YAAA,GAAe,MAAO,CAAA,YAAA,EAAc,YAAY,CAAI,GAAA;AAAA,KAC/D,CACA,CAAA,IAAA,CAAK,CAAY,QAAA,KAAA,QAAA,CAAS,QAAY,IAAA,EAAE,IAAM,EAAA,EAAG,EAAC,CAAC,CAAA;AAAA,GACrD,EAAA,CAAC,GAAK,EAAA,cAAA,EAAgB,YAAY,CAAC,CAAA;AAEtC,EAAA,MAAM,EAAE,KAAA,EAAO,OAAQ,EAAA,GAAI,cAAc,YAAY;AACnD,IAAA,OAAO,MAAM,QAAS,EAAA;AAAA,GACxB,EAAG,CAAC,QAAQ,CAAC,CAAA;AAEb,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAU,GAAA,IAAA;AACd,IAAI,IAAA,CAAC,WAAW,OAAS,EAAA;AACvB,MAAA,cAAA,CAAe,KAAK,CAAA;AAAA;AAEtB,IAAA,OAAO,MAAM;AACX,MAAU,OAAA,GAAA,KAAA;AAAA,KACZ;AAAA,GACF,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,OAAO,EAAE,KAAA,EAAO,KAAO,EAAA,OAAA,EAAS,WAAY,EAAA;AAC9C;;;;"}
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
import * as react from 'react';
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
3
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
4
3
|
import { IconComponent } from '@backstage/core-plugin-api';
|
5
4
|
|
@@ -14,7 +13,7 @@ declare const adoptionInsightsPlugin: _backstage_core_plugin_api.BackstagePlugin
|
|
14
13
|
* Frontend page for Adoption Insights
|
15
14
|
* @public
|
16
15
|
*/
|
17
|
-
declare const AdoptionInsightsPage: () =>
|
16
|
+
declare const AdoptionInsightsPage: () => react_jsx_runtime.JSX.Element | null;
|
18
17
|
/**
|
19
18
|
* @public
|
20
19
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@red-hat-developer-hub/backstage-plugin-adoption-insights",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "0.2.0",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"main": "dist/index.esm.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -34,20 +34,20 @@
|
|
34
34
|
"postpack": "backstage-cli package postpack"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@backstage/catalog-model": "^1.7.
|
38
|
-
"@backstage/core-components": "^0.
|
39
|
-
"@backstage/core-plugin-api": "^1.10.
|
40
|
-
"@backstage/plugin-catalog-react": "^1.
|
41
|
-
"@backstage/plugin-permission-react": "^0.4.
|
42
|
-
"@backstage/theme": "^0.6.
|
37
|
+
"@backstage/catalog-model": "^1.7.4",
|
38
|
+
"@backstage/core-components": "^0.17.2",
|
39
|
+
"@backstage/core-plugin-api": "^1.10.7",
|
40
|
+
"@backstage/plugin-catalog-react": "^1.18.0",
|
41
|
+
"@backstage/plugin-permission-react": "^0.4.34",
|
42
|
+
"@backstage/theme": "^0.6.6",
|
43
43
|
"@material-ui/core": "^4.12.2",
|
44
44
|
"@material-ui/icons": "^4.9.1",
|
45
45
|
"@material-ui/lab": "4.0.0-alpha.61",
|
46
|
-
"@mui/icons-material": "5.
|
46
|
+
"@mui/icons-material": "5.17.1",
|
47
47
|
"@mui/lab": "5.0.0-alpha.176",
|
48
|
-
"@mui/material": "5.
|
48
|
+
"@mui/material": "5.17.1",
|
49
49
|
"@mui/x-date-pickers": "5.0.20",
|
50
|
-
"@red-hat-developer-hub/backstage-plugin-adoption-insights-common": "^0.
|
50
|
+
"@red-hat-developer-hub/backstage-plugin-adoption-insights-common": "^0.3.0",
|
51
51
|
"date-fns": "2.30.0",
|
52
52
|
"react-use": "^17.2.4",
|
53
53
|
"recharts": "^2.15.1"
|
@@ -56,12 +56,13 @@
|
|
56
56
|
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
57
57
|
},
|
58
58
|
"devDependencies": {
|
59
|
-
"@backstage/cli": "^0.
|
59
|
+
"@backstage/cli": "^0.32.1",
|
60
60
|
"@backstage/config": "^1.3.2",
|
61
|
-
"@backstage/core-app-api": "^1.
|
62
|
-
"@backstage/dev-utils": "^1.1.
|
63
|
-
"@backstage/
|
64
|
-
"@
|
61
|
+
"@backstage/core-app-api": "^1.17.0",
|
62
|
+
"@backstage/dev-utils": "^1.1.10",
|
63
|
+
"@backstage/plugin-catalog": "^1.30.0",
|
64
|
+
"@backstage/test-utils": "^1.7.8",
|
65
|
+
"@red-hat-developer-hub/backstage-plugin-theme": "^0.8.0",
|
65
66
|
"@testing-library/jest-dom": "^6.0.0",
|
66
67
|
"@testing-library/react": "^14.0.0",
|
67
68
|
"@testing-library/user-event": "^14.0.0",
|
@@ -74,8 +75,8 @@
|
|
74
75
|
],
|
75
76
|
"typesVersions": {
|
76
77
|
"*": {
|
77
|
-
"
|
78
|
-
"
|
78
|
+
"package.json": [
|
79
|
+
"package.json"
|
79
80
|
]
|
80
81
|
}
|
81
82
|
},
|