@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,48 @@
|
|
1
|
+
<svg width="602" height="319" viewBox="0 0 602 319" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M589.145 252.719C589.145 260.789 585.887 268.528 580.086 274.232C574.286 279.936 566.42 283.138 558.22 283.132H346.364C335.116 283.437 324.587 277.706 318.871 268.167C313.156 258.628 313.156 246.787 318.871 237.248C324.587 227.709 335.116 221.978 346.364 222.284H353.435C348.277 204.212 352.016 184.807 363.536 169.847C375.057 154.888 393.03 146.1 412.103 146.103H430.135C452.885 146.084 473.744 158.559 484.207 178.44C489.356 175.841 495.061 174.489 500.848 174.497H505.562C515.283 174.497 524.606 178.297 531.48 185.062C538.354 191.827 542.215 201.002 542.215 210.569V212.355C542.217 215.714 541.741 219.055 540.801 222.284H558.338C575.366 222.36 589.133 235.961 589.145 252.719Z" fill="#ADDDDD"/>
|
3
|
+
<path d="M599.555 244.046C599.555 252.116 596.296 259.855 590.496 265.559C584.696 271.263 576.83 274.464 568.63 274.458H356.773C345.526 274.764 334.997 269.033 329.281 259.494C323.566 249.955 323.566 238.114 329.281 228.575C334.997 219.036 345.526 213.305 356.773 213.61H363.845C358.687 195.539 362.426 176.133 373.946 161.174C385.467 146.214 403.44 137.427 422.513 137.429H440.545C463.295 137.41 484.154 149.885 494.617 169.767C499.766 167.167 505.471 165.815 511.258 165.823H515.972C525.693 165.823 535.016 169.624 541.89 176.389C548.764 183.153 552.625 192.329 552.625 201.896V203.682C552.626 207.04 552.15 210.382 551.211 213.61H568.748C585.776 213.687 599.543 227.287 599.555 244.046Z" fill="#E4F4F5" stroke="#ADDDDD" stroke-width="4"/>
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M143.133 34.0142L237.608 78.0613L246.833 181.781L161.436 241.386L66.9606 197.338L58.7769 94.104L143.133 34.0142Z" stroke="#ADDDDD" stroke-width="3"/>
|
5
|
+
<path d="M377.743 51.9932L424.551 73.8166L429.121 125.205L386.811 154.736L340.003 132.913L335.948 81.765L377.743 51.9932Z" fill="#FFDBDB"/>
|
6
|
+
<path d="M274.995 252.719C274.995 260.789 271.736 268.528 265.935 274.232C260.135 279.936 252.269 283.138 244.069 283.132H32.2126C20.9648 283.437 10.4358 277.706 4.72034 268.167C-0.99516 258.628 -0.99516 246.787 4.72034 237.248C10.4358 227.709 20.9648 221.978 32.2126 222.284H39.284C34.1266 204.212 37.8649 184.807 49.3854 169.847C60.906 154.888 78.8795 146.1 97.9523 146.103H115.984C138.734 146.084 159.594 158.559 170.056 178.44C175.205 175.841 180.91 174.489 186.697 174.497H191.412C201.133 174.497 210.455 178.297 217.329 185.062C224.203 191.827 228.065 201.002 228.065 210.569V212.355C228.066 215.714 227.59 219.055 226.65 222.284H244.187C261.215 222.36 274.982 235.961 274.995 252.719Z" fill="#ADDDDD"/>
|
7
|
+
<path d="M285.404 244.046C285.404 252.116 282.146 259.855 276.345 265.559C270.545 271.263 262.679 274.464 254.479 274.458H42.6226C31.3747 274.764 20.8458 269.033 15.1303 259.494C9.41475 249.955 9.41475 238.114 15.1303 228.575C20.8458 219.036 31.3747 213.305 42.6226 213.61H49.6939C44.5365 195.539 48.2748 176.133 59.7954 161.174C71.3159 146.214 89.2894 137.427 108.362 137.429H126.394C149.144 137.41 170.003 149.885 180.466 169.767C185.615 167.167 191.32 165.815 197.107 165.823H201.821C211.542 165.823 220.865 169.624 227.739 176.389C234.613 183.153 238.474 192.329 238.474 201.896V203.682C238.476 207.04 238 210.382 237.06 213.61H254.597C271.625 213.687 285.392 227.287 285.404 244.046Z" fill="#E4F4F5" stroke="#ADDDDD" stroke-width="4"/>
|
8
|
+
<rect x="93.046" y="82.7213" width="126.489" height="105.626" rx="1" fill="#261A4C"/>
|
9
|
+
<rect x="96.8359" y="78.932" width="126.489" height="105.626" rx="1" fill="#ADDDDD"/>
|
10
|
+
<rect x="98.731" y="96.4575" width="123.646" height="85.7327" rx="1" fill="white"/>
|
11
|
+
<ellipse cx="202.48" cy="88.4052" rx="3.31618" ry="3.31563" fill="white"/>
|
12
|
+
<ellipse cx="212.428" cy="88.4052" rx="3.31618" ry="3.31563" fill="white"/>
|
13
|
+
<rect x="104.416" y="86.9842" width="50.2165" height="3.31563" rx="1" fill="white"/>
|
14
|
+
<rect x="104.416" y="113.509" width="21.792" height="1.89465" rx="0.947323" fill="#F56D6D"/>
|
15
|
+
<rect x="132.366" y="113.509" width="36.478" height="1.89465" rx="0.947323" fill="#F56D6D"/>
|
16
|
+
<rect x="117.207" y="125.351" width="55.9013" height="1.89465" rx="0.947323" fill="#F56D6D"/>
|
17
|
+
<rect x="168.844" y="162.296" width="42.6366" height="1.89465" rx="0.947323" fill="#F56D6D"/>
|
18
|
+
<rect x="136.156" y="150.455" width="42.6366" height="1.89464" rx="0.947319" fill="#F56D6D"/>
|
19
|
+
<rect x="156.527" y="137.192" width="42.6366" height="1.89464" rx="0.947321" fill="#F56D6D"/>
|
20
|
+
<rect x="126.208" y="137.192" width="26.0557" height="1.89464" rx="0.947321" fill="#F56D6D"/>
|
21
|
+
<rect x="202.954" y="132.929" width="9.4748" height="1.89465" rx="0.947323" fill="#F56D6D"/>
|
22
|
+
<rect x="188.742" y="125.351" width="22.7395" height="1.89465" rx="0.947323" fill="#F56D6D"/>
|
23
|
+
<rect x="199.638" y="118.72" width="11.8435" height="1.89464" rx="0.947321" fill="#F56D6D"/>
|
24
|
+
<path d="M484.205 276.841C484.205 288.02 479.678 298.741 471.621 306.642C463.564 314.544 452.638 318.979 441.249 318.97H146.972C131.349 319.394 116.724 311.455 108.784 298.241C100.845 285.027 100.845 268.623 108.784 255.409C116.724 242.195 131.349 234.256 146.972 234.68H156.795C149.631 209.646 154.823 182.764 170.826 162.041C186.828 141.318 211.794 129.145 238.287 129.148H263.334C294.934 129.122 323.909 146.404 338.442 173.945C345.594 170.343 353.519 168.471 361.557 168.482H368.105C381.608 168.482 394.558 173.746 404.105 183.117C413.653 192.489 419.017 205.199 419.017 218.452V220.926C419.019 225.578 418.358 230.208 417.053 234.68H441.412C465.065 234.786 484.187 253.626 484.205 276.841Z" fill="#ADDDDD"/>
|
25
|
+
<path d="M498.664 264.826C498.664 276.005 494.138 286.725 486.081 294.627C478.024 302.529 467.098 306.964 455.708 306.955H161.432C145.808 307.379 131.183 299.44 123.244 286.226C115.305 273.012 115.305 256.608 123.244 243.394C131.183 230.18 145.808 222.241 161.432 222.665H171.254C164.09 197.631 169.283 170.749 185.286 150.026C201.288 129.303 226.254 117.13 252.747 117.133H277.794C309.394 117.107 338.368 134.389 352.901 161.929C360.054 158.328 367.978 156.455 376.017 156.467H382.565C396.068 156.467 409.017 161.731 418.565 171.102C428.113 180.474 433.477 193.184 433.477 206.437V208.911C433.479 213.563 432.817 218.192 431.513 222.665H455.872C479.525 222.771 498.647 241.611 498.664 264.826Z" fill="white" stroke="#ADDDDD"/>
|
26
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M301.422 231.107C307.438 227.787 311.522 221.307 311.522 213.857C311.522 203.026 302.89 194.246 292.241 194.246C281.592 194.246 272.959 203.026 272.959 213.857C272.959 221.307 277.044 227.787 283.059 231.107V252.75C283.059 255.511 285.298 257.75 288.059 257.75H296.422C299.184 257.75 301.422 255.511 301.422 252.75V231.107Z" fill="#ADDDDD"/>
|
27
|
+
<rect x="358.006" y="85.257" width="116.675" height="97.4313" rx="1" fill="#261A4C"/>
|
28
|
+
<rect x="361.501" y="81.7617" width="116.675" height="97.4313" rx="1" fill="#ADDDDD"/>
|
29
|
+
<rect x="363.25" y="97.9274" width="114.053" height="79.081" rx="1" fill="white"/>
|
30
|
+
<ellipse cx="458.949" cy="90.4999" rx="3.05889" ry="3.05838" fill="white"/>
|
31
|
+
<ellipse cx="468.126" cy="90.4999" rx="3.05889" ry="3.05838" fill="white"/>
|
32
|
+
<rect x="368.493" y="89.1892" width="46.3204" height="3.05838" rx="1" fill="white"/>
|
33
|
+
<rect x="368.493" y="113.656" width="20.1013" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
34
|
+
<rect x="394.275" y="113.656" width="33.6478" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
35
|
+
<rect x="380.292" y="124.579" width="51.5642" height="1.74764" rx="0.873821" fill="#F56D6D"/>
|
36
|
+
<rect x="296.391" y="124.579" width="51.5642" height="1.74764" rx="0.873821" fill="#F56D6D"/>
|
37
|
+
<rect x="286.34" y="124.579" width="8.30271" height="1.74764" rx="0.873821" fill="#F56D6D"/>
|
38
|
+
<rect x="317.803" y="135.065" width="51.5642" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
39
|
+
<rect x="306.005" y="135.065" width="10.4876" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
40
|
+
<rect x="330.913" y="145.551" width="17.0424" height="1.74764" rx="0.873821" fill="#F56D6D"/>
|
41
|
+
<rect x="427.923" y="158.658" width="39.3286" height="1.74765" rx="0.873825" fill="#F56D6D"/>
|
42
|
+
<rect x="397.771" y="147.735" width="39.3286" height="1.74765" rx="0.873825" fill="#F56D6D"/>
|
43
|
+
<rect x="416.562" y="135.502" width="39.3286" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
44
|
+
<rect x="388.594" y="135.502" width="24.0342" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
45
|
+
<rect x="459.386" y="131.57" width="8.7397" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
46
|
+
<rect x="446.276" y="124.579" width="20.9753" height="1.74764" rx="0.873821" fill="#F56D6D"/>
|
47
|
+
<rect x="456.327" y="118.462" width="10.9246" height="1.74765" rx="0.873823" fill="#F56D6D"/>
|
48
|
+
</svg>
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import * as react from 'react';
|
3
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
4
|
+
import { IconComponent } from '@backstage/core-plugin-api';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Plugin for Adoption Insights frontend
|
8
|
+
* @public
|
9
|
+
*/
|
10
|
+
declare const adoptionInsightsPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
11
|
+
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
12
|
+
}, {}, {}>;
|
13
|
+
/**
|
14
|
+
* Frontend page for Adoption Insights
|
15
|
+
* @public
|
16
|
+
*/
|
17
|
+
declare const AdoptionInsightsPage: () => react.JSX.Element | null;
|
18
|
+
/**
|
19
|
+
* @public
|
20
|
+
*/
|
21
|
+
declare const AdoptionInsightsIcon: IconComponent;
|
22
|
+
|
23
|
+
export { AdoptionInsightsIcon, AdoptionInsightsPage, adoptionInsightsPlugin };
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { unstable_ClassNameGenerator } from '@mui/material/className';
|
2
|
+
export { AdoptionInsightsIcon, AdoptionInsightsPage, adoptionInsightsPlugin } from './plugin.esm.js';
|
3
|
+
|
4
|
+
unstable_ClassNameGenerator.configure((componentName) => {
|
5
|
+
return componentName.startsWith("v5-") ? componentName : `v5-${componentName}`;
|
6
|
+
});
|
7
|
+
//# sourceMappingURL=index.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"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 */\n\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/material/className';\n\nClassNameGenerator.configure(componentName => {\n return componentName.startsWith('v5-')\n ? componentName\n : `v5-${componentName}`;\n});\n\nexport * from './plugin';\n"],"names":["ClassNameGenerator"],"mappings":";;;AAkBAA,2BAAA,CAAmB,UAAU,CAAiB,aAAA,KAAA;AAC5C,EAAA,OAAO,cAAc,UAAW,CAAA,KAAK,CACjC,GAAA,aAAA,GACA,MAAM,aAAa,CAAA,CAAA;AACzB,CAAC,CAAA"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { createPlugin, createApiFactory, fetchApiRef, configApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
2
|
+
import MUIAdoptionInsightsIcon from '@mui/icons-material/QueryStatsOutlined';
|
3
|
+
import { rootRouteRef } from './routes.esm.js';
|
4
|
+
import { AdoptionInsightsApiClient, adoptionInsightsApiRef } from './api/index.esm.js';
|
5
|
+
|
6
|
+
const adoptionInsightsPlugin = createPlugin({
|
7
|
+
id: "adoption-insights",
|
8
|
+
routes: {
|
9
|
+
root: rootRouteRef
|
10
|
+
},
|
11
|
+
apis: [
|
12
|
+
createApiFactory({
|
13
|
+
api: adoptionInsightsApiRef,
|
14
|
+
deps: {
|
15
|
+
configApi: configApiRef,
|
16
|
+
fetchApi: fetchApiRef
|
17
|
+
},
|
18
|
+
factory: ({ configApi, fetchApi }) => new AdoptionInsightsApiClient({ configApi, fetchApi })
|
19
|
+
})
|
20
|
+
]
|
21
|
+
});
|
22
|
+
const AdoptionInsightsPage = adoptionInsightsPlugin.provide(
|
23
|
+
createRoutableExtension({
|
24
|
+
name: "AdoptionInsightsPage",
|
25
|
+
component: () => import('./components/AdoptionInsightsPage/index.esm.js').then(
|
26
|
+
(m) => m.AdoptionInsightsPage
|
27
|
+
),
|
28
|
+
mountPoint: rootRouteRef
|
29
|
+
})
|
30
|
+
);
|
31
|
+
const AdoptionInsightsIcon = MUIAdoptionInsightsIcon;
|
32
|
+
|
33
|
+
export { AdoptionInsightsIcon, AdoptionInsightsPage, adoptionInsightsPlugin };
|
34
|
+
//# sourceMappingURL=plugin.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"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 {\n configApiRef,\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n fetchApiRef,\n type IconComponent,\n} from '@backstage/core-plugin-api';\n\nimport MUIAdoptionInsightsIcon from '@mui/icons-material/QueryStatsOutlined';\nimport { rootRouteRef } from './routes';\nimport { AdoptionInsightsApiClient, adoptionInsightsApiRef } from './api';\n\n/**\n * Plugin for Adoption Insights frontend\n * @public\n */\nexport const adoptionInsightsPlugin = createPlugin({\n id: 'adoption-insights',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: adoptionInsightsApiRef,\n deps: {\n configApi: configApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ configApi, fetchApi }) =>\n new AdoptionInsightsApiClient({ configApi, fetchApi }),\n }),\n ],\n});\n\n/**\n * Frontend page for Adoption Insights\n * @public\n */\nexport const AdoptionInsightsPage = adoptionInsightsPlugin.provide(\n createRoutableExtension({\n name: 'AdoptionInsightsPage',\n component: () =>\n import('./components/AdoptionInsightsPage').then(\n m => m.AdoptionInsightsPage,\n ),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * @public\n */\nexport const AdoptionInsightsIcon: IconComponent = MUIAdoptionInsightsIcon;\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,yBAAyB,YAAa,CAAA;AAAA,EACjD,EAAI,EAAA,mBAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA,GACR;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,sBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,SAAW,EAAA,YAAA;AAAA,QACX,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,SAAW,EAAA,QAAA,EACrB,KAAA,IAAI,yBAA0B,CAAA,EAAE,SAAW,EAAA,QAAA,EAAU;AAAA,KACxD;AAAA;AAEL,CAAC;AAMM,MAAM,uBAAuB,sBAAuB,CAAA,OAAA;AAAA,EACzD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,sBAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,gDAAmC,CAAE,CAAA,IAAA;AAAA,MAC1C,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA;AAAA,GACb;AACH;AAKO,MAAM,oBAAsC,GAAA;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'adoption-insights',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA;AACN,CAAC;;;;"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
const DATE_RANGE_OPTIONS = [
|
2
|
+
{ value: "today", label: "Today" },
|
3
|
+
{ value: "last-week", label: "Last week" },
|
4
|
+
{ value: "last-month", label: "Last month" },
|
5
|
+
{ value: "last-28-days", label: "Last 28 days" },
|
6
|
+
{ value: "last-year", label: "Last year" }
|
7
|
+
];
|
8
|
+
const CATALOG_ENTITIES_TITLE = "Top catalog entities";
|
9
|
+
const CATALOG_ENTITIES_TABLE_HEADERS = [
|
10
|
+
{ id: "name", title: "Name" },
|
11
|
+
{ id: "kind", title: "Kind" },
|
12
|
+
{ id: "last-used", title: "Last used" },
|
13
|
+
{ id: "views", title: "Views" }
|
14
|
+
];
|
15
|
+
const PLUGINS_TABLE_HEADERS = [
|
16
|
+
{ id: "name", title: "Name" },
|
17
|
+
{ id: "trend", title: "Trend" },
|
18
|
+
{ id: "percent", title: "" },
|
19
|
+
{ id: "views", title: "Views" }
|
20
|
+
];
|
21
|
+
const TECHDOCS_TABLE_HEADERS = [
|
22
|
+
{ id: "name", title: "Name" },
|
23
|
+
{ id: "entity", title: "Entity" },
|
24
|
+
{ id: "last-used", title: "Last used" },
|
25
|
+
{ id: "views", title: "Views" }
|
26
|
+
];
|
27
|
+
const TEMPLATE_TABLE_HEADERS = [
|
28
|
+
{ id: "name", title: "Name" },
|
29
|
+
{ id: "executions", title: "Executions" }
|
30
|
+
];
|
31
|
+
|
32
|
+
export { CATALOG_ENTITIES_TABLE_HEADERS, CATALOG_ENTITIES_TITLE, DATE_RANGE_OPTIONS, PLUGINS_TABLE_HEADERS, TECHDOCS_TABLE_HEADERS, TEMPLATE_TABLE_HEADERS };
|
33
|
+
//# sourceMappingURL=constants.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.esm.js","sources":["../../src/utils/constants.ts"],"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 */\nexport const DATE_RANGE_OPTIONS = [\n { value: 'today', label: 'Today' },\n { value: 'last-week', label: 'Last week' },\n { value: 'last-month', label: 'Last month' },\n { value: 'last-28-days', label: 'Last 28 days' },\n { value: 'last-year', label: 'Last year' },\n];\n\nexport const CATALOG_ENTITIES_TITLE = 'Top catalog entities';\n\nexport const CATALOG_ENTITIES_TABLE_HEADERS = [\n { id: 'name', title: 'Name' },\n { id: 'kind', title: 'Kind' },\n { id: 'last-used', title: 'Last used' },\n { id: 'views', title: 'Views' },\n];\n\nexport const PLUGINS_TABLE_HEADERS = [\n { id: 'name', title: 'Name' },\n { id: 'trend', title: 'Trend' },\n { id: 'percent', title: '' },\n { id: 'views', title: 'Views' },\n];\n\nexport const TECHDOCS_TABLE_HEADERS = [\n { id: 'name', title: 'Name' },\n { id: 'entity', title: 'Entity' },\n { id: 'last-used', title: 'Last used' },\n { id: 'views', title: 'Views' },\n];\n\nexport const TEMPLATE_TABLE_HEADERS = [\n { id: 'name', title: 'Name' },\n { id: 'executions', title: 'Executions' },\n];\n"],"names":[],"mappings":"AAeO,MAAM,kBAAqB,GAAA;AAAA,EAChC,EAAE,KAAA,EAAO,OAAS,EAAA,KAAA,EAAO,OAAQ,EAAA;AAAA,EACjC,EAAE,KAAA,EAAO,WAAa,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACzC,EAAE,KAAA,EAAO,YAAc,EAAA,KAAA,EAAO,YAAa,EAAA;AAAA,EAC3C,EAAE,KAAA,EAAO,cAAgB,EAAA,KAAA,EAAO,cAAe,EAAA;AAAA,EAC/C,EAAE,KAAA,EAAO,WAAa,EAAA,KAAA,EAAO,WAAY;AAC3C;AAEO,MAAM,sBAAyB,GAAA;AAE/B,MAAM,8BAAiC,GAAA;AAAA,EAC5C,EAAE,EAAA,EAAI,MAAQ,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EAC5B,EAAE,EAAA,EAAI,MAAQ,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EAC5B,EAAE,EAAA,EAAI,WAAa,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACtC,EAAE,EAAA,EAAI,OAAS,EAAA,KAAA,EAAO,OAAQ;AAChC;AAEO,MAAM,qBAAwB,GAAA;AAAA,EACnC,EAAE,EAAA,EAAI,MAAQ,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EAC5B,EAAE,EAAA,EAAI,OAAS,EAAA,KAAA,EAAO,OAAQ,EAAA;AAAA,EAC9B,EAAE,EAAA,EAAI,SAAW,EAAA,KAAA,EAAO,EAAG,EAAA;AAAA,EAC3B,EAAE,EAAA,EAAI,OAAS,EAAA,KAAA,EAAO,OAAQ;AAChC;AAEO,MAAM,sBAAyB,GAAA;AAAA,EACpC,EAAE,EAAA,EAAI,MAAQ,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EAC5B,EAAE,EAAA,EAAI,QAAU,EAAA,KAAA,EAAO,QAAS,EAAA;AAAA,EAChC,EAAE,EAAA,EAAI,WAAa,EAAA,KAAA,EAAO,WAAY,EAAA;AAAA,EACtC,EAAE,EAAA,EAAI,OAAS,EAAA,KAAA,EAAO,OAAQ;AAChC;AAEO,MAAM,sBAAyB,GAAA;AAAA,EACpC,EAAE,EAAA,EAAI,MAAQ,EAAA,KAAA,EAAO,MAAO,EAAA;AAAA,EAC5B,EAAE,EAAA,EAAI,YAAc,EAAA,KAAA,EAAO,YAAa;AAC1C;;;;"}
|
@@ -0,0 +1,148 @@
|
|
1
|
+
import { startOfToday, format, startOfYear, subDays, startOfMonth, startOfWeek, isToday, isYesterday } from 'date-fns';
|
2
|
+
|
3
|
+
const getDateRange = (value) => {
|
4
|
+
const startDate = null;
|
5
|
+
const endDate = null;
|
6
|
+
const today = startOfToday();
|
7
|
+
switch (value) {
|
8
|
+
case "today":
|
9
|
+
return {
|
10
|
+
startDate: format(today, "yyyy-MM-dd"),
|
11
|
+
endDate: format(today, "yyyy-MM-dd")
|
12
|
+
};
|
13
|
+
case "last-week":
|
14
|
+
return {
|
15
|
+
startDate: format(startOfWeek(today), "yyyy-MM-dd"),
|
16
|
+
endDate: format(today, "yyyy-MM-dd")
|
17
|
+
};
|
18
|
+
case "last-month":
|
19
|
+
return {
|
20
|
+
startDate: format(startOfMonth(today), "yyyy-MM-dd"),
|
21
|
+
endDate: format(today, "yyyy-MM-dd")
|
22
|
+
};
|
23
|
+
case "last-28-days":
|
24
|
+
return {
|
25
|
+
startDate: format(subDays(today, 27), "yyyy-MM-dd"),
|
26
|
+
endDate: format(today, "yyyy-MM-dd")
|
27
|
+
};
|
28
|
+
case "last-year":
|
29
|
+
return {
|
30
|
+
startDate: format(startOfYear(today), "yyyy-MM-dd"),
|
31
|
+
endDate: format(today, "yyyy-MM-dd")
|
32
|
+
};
|
33
|
+
default:
|
34
|
+
return { startDate, endDate };
|
35
|
+
}
|
36
|
+
};
|
37
|
+
const getXAxisTickValues = (data, grouping) => {
|
38
|
+
if (!data || data.length === 0) return [];
|
39
|
+
if (data.length <= 2) return data.map((d) => d.date);
|
40
|
+
const first = data[0].date;
|
41
|
+
const last = data[data.length - 1].date;
|
42
|
+
const selectedDates = [];
|
43
|
+
const processGrouping = (unitExtractor) => {
|
44
|
+
const selectedUnits = /* @__PURE__ */ new Set([
|
45
|
+
unitExtractor(first),
|
46
|
+
unitExtractor(last)
|
47
|
+
]);
|
48
|
+
if (data.length <= 4) {
|
49
|
+
data.forEach((d) => {
|
50
|
+
const unit = unitExtractor(d.date);
|
51
|
+
if (!selectedUnits.has(unit)) {
|
52
|
+
selectedUnits.add(unit);
|
53
|
+
selectedDates.push(d.date);
|
54
|
+
}
|
55
|
+
});
|
56
|
+
} else if (data.length === 6) {
|
57
|
+
selectedDates.push(data[2].date);
|
58
|
+
selectedDates.push(data[3].date);
|
59
|
+
} else if (data.length === 9) {
|
60
|
+
selectedDates.push(data[3].date);
|
61
|
+
selectedDates.push(data[5].date);
|
62
|
+
} else {
|
63
|
+
const intervals = [];
|
64
|
+
if (data.length !== 5) {
|
65
|
+
intervals.push(Math.floor((data.length - 1) / 3));
|
66
|
+
}
|
67
|
+
intervals.push(Math.floor((data.length - 1) * 2 / 3));
|
68
|
+
intervals.forEach((i) => selectedDates.push(data[i].date));
|
69
|
+
}
|
70
|
+
};
|
71
|
+
if (grouping === "hourly") {
|
72
|
+
processGrouping((date) => new Date(date).getHours());
|
73
|
+
} else if (grouping === "daily" || grouping === "weekly") {
|
74
|
+
processGrouping((date) => new Date(date).getDate());
|
75
|
+
} else if (grouping === "monthly") {
|
76
|
+
processGrouping((date) => new Date(date).getMonth());
|
77
|
+
}
|
78
|
+
return [first, ...selectedDates, last];
|
79
|
+
};
|
80
|
+
const getXAxisformat = (date, grouping) => {
|
81
|
+
const dateObj = new Date(date);
|
82
|
+
if (grouping === "hourly") {
|
83
|
+
return format(dateObj, "hh:mm a");
|
84
|
+
}
|
85
|
+
if (grouping === "daily" || grouping === "weekly") {
|
86
|
+
return format(dateObj, "d MMMM yy");
|
87
|
+
}
|
88
|
+
if (grouping === "monthly") {
|
89
|
+
return format(dateObj, "MMM yyyy");
|
90
|
+
}
|
91
|
+
return date;
|
92
|
+
};
|
93
|
+
const getLastUsedDay = (timestamp) => {
|
94
|
+
const date = new Date(timestamp);
|
95
|
+
if (isToday(date)) {
|
96
|
+
return "Today";
|
97
|
+
} else if (isYesterday(date)) {
|
98
|
+
return "Yesterday";
|
99
|
+
}
|
100
|
+
return format(date, "dd MMM yyyy");
|
101
|
+
};
|
102
|
+
const getAverage = (data, key) => {
|
103
|
+
if (!data || data.length === 0) return 0;
|
104
|
+
const totalSum = data.reduce(
|
105
|
+
(sum, entry) => sum + Number(entry[key] || 0),
|
106
|
+
0
|
107
|
+
);
|
108
|
+
return totalSum / data.length;
|
109
|
+
};
|
110
|
+
const getTotal = (data, key) => {
|
111
|
+
const totalSum = data?.reduce(
|
112
|
+
(sum, entry) => sum + Number(entry[key] || 0),
|
113
|
+
0
|
114
|
+
);
|
115
|
+
return totalSum;
|
116
|
+
};
|
117
|
+
const getUniqueCatalogEntityKinds = (data) => {
|
118
|
+
const allKinds = data.map(
|
119
|
+
(item) => item.kind.charAt(0).toLocaleUpperCase("en-US") + item.kind.slice(1)
|
120
|
+
);
|
121
|
+
const uniqueKinds = Array.from(/* @__PURE__ */ new Set([...allKinds]));
|
122
|
+
return uniqueKinds;
|
123
|
+
};
|
124
|
+
const generateEventsUrl = (baseUrl, options) => {
|
125
|
+
const params = new URLSearchParams();
|
126
|
+
Object.entries(options).forEach(([key, value]) => {
|
127
|
+
if (value && value !== void 0) {
|
128
|
+
params.append(key, String(value));
|
129
|
+
}
|
130
|
+
});
|
131
|
+
return `${baseUrl}?${params.toString()}`;
|
132
|
+
};
|
133
|
+
const determineGrouping = (startDate, endDate) => {
|
134
|
+
if (startDate && endDate && (isNaN(startDate.getTime()) || isNaN(endDate.getTime()))) {
|
135
|
+
throw new Error("Invalid date format");
|
136
|
+
}
|
137
|
+
if (startDate && endDate) {
|
138
|
+
const diffInMs = endDate.getTime() - startDate.getTime();
|
139
|
+
const daysDiff = Math.ceil(diffInMs / (1e3 * 60 * 60 * 24));
|
140
|
+
if (daysDiff <= 1) return "hourly";
|
141
|
+
if (daysDiff <= 7) return "daily";
|
142
|
+
if (daysDiff <= 30) return "weekly";
|
143
|
+
}
|
144
|
+
return "monthly";
|
145
|
+
};
|
146
|
+
|
147
|
+
export { determineGrouping, generateEventsUrl, getAverage, getDateRange, getLastUsedDay, getTotal, getUniqueCatalogEntityKinds, getXAxisTickValues, getXAxisformat };
|
148
|
+
//# sourceMappingURL=utils.esm.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../../src/utils/utils.ts"],"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 {\n format,\n startOfToday,\n startOfYear,\n isToday,\n isYesterday,\n startOfMonth,\n startOfWeek,\n subDays,\n} from 'date-fns';\nimport { APIsViewOptions } from '../types';\n\nexport const getDateRange = (value: string) => {\n const startDate: Date | null = null;\n const endDate: Date | null = null;\n const today = startOfToday();\n\n switch (value) {\n case 'today':\n return {\n startDate: format(today, 'yyyy-MM-dd'),\n endDate: format(today, 'yyyy-MM-dd'),\n };\n\n case 'last-week':\n return {\n startDate: format(startOfWeek(today), 'yyyy-MM-dd'),\n endDate: format(today, 'yyyy-MM-dd'),\n };\n\n case 'last-month':\n return {\n startDate: format(startOfMonth(today), 'yyyy-MM-dd'),\n endDate: format(today, 'yyyy-MM-dd'),\n };\n\n case 'last-28-days':\n return {\n startDate: format(subDays(today, 27), 'yyyy-MM-dd'),\n endDate: format(today, 'yyyy-MM-dd'),\n };\n\n case 'last-year':\n return {\n startDate: format(startOfYear(today), 'yyyy-MM-dd'),\n endDate: format(today, 'yyyy-MM-dd'),\n };\n\n default:\n return { startDate, endDate };\n }\n};\n\nexport const getXAxisTickValues = (data: any, grouping: string): string[] => {\n if (!data || data.length === 0) return [];\n if (data.length <= 2) return data.map((d: { date: string }) => d.date);\n\n const first = data[0].date;\n const last = data[data.length - 1].date;\n const selectedDates: string[] = [];\n\n const processGrouping = (unitExtractor: (date: string) => number) => {\n const selectedUnits = new Set<number>([\n unitExtractor(first),\n unitExtractor(last),\n ]);\n\n if (data.length <= 4) {\n data.forEach((d: { date: string }) => {\n const unit = unitExtractor(d.date);\n if (!selectedUnits.has(unit)) {\n selectedUnits.add(unit);\n selectedDates.push(d.date);\n }\n });\n } else if (data.length === 6) {\n selectedDates.push(data[2].date);\n selectedDates.push(data[3].date);\n } else if (data.length === 9) {\n selectedDates.push(data[3].date);\n selectedDates.push(data[5].date);\n } else {\n const intervals = [];\n if (data.length !== 5) {\n intervals.push(Math.floor((data.length - 1) / 3));\n }\n intervals.push(Math.floor(((data.length - 1) * 2) / 3));\n intervals.forEach(i => selectedDates.push(data[i].date));\n }\n };\n\n if (grouping === 'hourly') {\n processGrouping(date => new Date(date).getHours());\n } else if (grouping === 'daily' || grouping === 'weekly') {\n processGrouping(date => new Date(date).getDate());\n } else if (grouping === 'monthly') {\n processGrouping(date => new Date(date).getMonth());\n }\n\n return [first, ...selectedDates, last];\n};\n\nexport const getXAxisformat = (date: string, grouping: string) => {\n const dateObj = new Date(date);\n\n if (grouping === 'hourly') {\n return format(dateObj, 'hh:mm a');\n }\n\n if (grouping === 'daily' || grouping === 'weekly') {\n return format(dateObj, 'd MMMM yy');\n }\n\n if (grouping === 'monthly') {\n return format(dateObj, 'MMM yyyy');\n }\n\n return date;\n};\n\nexport const getLastUsedDay = (timestamp: string) => {\n const date = new Date(timestamp);\n\n if (isToday(date)) {\n return 'Today';\n } else if (isYesterday(date)) {\n return 'Yesterday';\n }\n return format(date, 'dd MMM yyyy');\n};\n\nexport const getAverage = <T extends Record<string, any>>(\n data: T[],\n key: keyof T,\n) => {\n if (!data || data.length === 0) return 0;\n\n const totalSum = data.reduce(\n (sum, entry) => sum + Number(entry[key] || 0),\n 0,\n );\n return totalSum / data.length;\n};\n\nexport const getTotal = <T extends Record<string, any>>(\n data: T[],\n key: keyof T,\n) => {\n const totalSum = data?.reduce(\n (sum, entry) => sum + Number(entry[key] || 0),\n 0,\n );\n return totalSum;\n};\n\nexport const getUniqueCatalogEntityKinds = (data: { kind: string }[]) => {\n const allKinds = data.map(\n item => item.kind.charAt(0).toLocaleUpperCase('en-US') + item.kind.slice(1),\n );\n const uniqueKinds = Array.from(new Set([...allKinds]));\n return uniqueKinds;\n};\n\nexport const generateEventsUrl = (\n baseUrl: string,\n options: APIsViewOptions,\n): string => {\n const params = new URLSearchParams();\n\n Object.entries(options).forEach(([key, value]) => {\n if (value && value !== undefined) {\n params.append(key, String(value));\n }\n });\n\n return `${baseUrl}?${params.toString()}`;\n};\n\nexport const determineGrouping = (\n startDate: Date | null,\n endDate: Date | null,\n): string => {\n if (\n startDate &&\n endDate &&\n (isNaN(startDate.getTime()) || isNaN(endDate.getTime()))\n ) {\n throw new Error('Invalid date format');\n }\n\n if (startDate && endDate) {\n const diffInMs = endDate.getTime() - startDate.getTime();\n const daysDiff = Math.ceil(diffInMs / (1000 * 60 * 60 * 24));\n\n if (daysDiff <= 1) return 'hourly';\n if (daysDiff <= 7) return 'daily';\n if (daysDiff <= 30) return 'weekly';\n }\n\n return 'monthly';\n};\n"],"names":[],"mappings":";;AA2Ba,MAAA,YAAA,GAAe,CAAC,KAAkB,KAAA;AAC7C,EAAA,MAAM,SAAyB,GAAA,IAAA;AAC/B,EAAA,MAAM,OAAuB,GAAA,IAAA;AAC7B,EAAA,MAAM,QAAQ,YAAa,EAAA;AAE3B,EAAA,QAAQ,KAAO;AAAA,IACb,KAAK,OAAA;AACH,MAAO,OAAA;AAAA,QACL,SAAA,EAAW,MAAO,CAAA,KAAA,EAAO,YAAY,CAAA;AAAA,QACrC,OAAA,EAAS,MAAO,CAAA,KAAA,EAAO,YAAY;AAAA,OACrC;AAAA,IAEF,KAAK,WAAA;AACH,MAAO,OAAA;AAAA,QACL,SAAW,EAAA,MAAA,CAAO,WAAY,CAAA,KAAK,GAAG,YAAY,CAAA;AAAA,QAClD,OAAA,EAAS,MAAO,CAAA,KAAA,EAAO,YAAY;AAAA,OACrC;AAAA,IAEF,KAAK,YAAA;AACH,MAAO,OAAA;AAAA,QACL,SAAW,EAAA,MAAA,CAAO,YAAa,CAAA,KAAK,GAAG,YAAY,CAAA;AAAA,QACnD,OAAA,EAAS,MAAO,CAAA,KAAA,EAAO,YAAY;AAAA,OACrC;AAAA,IAEF,KAAK,cAAA;AACH,MAAO,OAAA;AAAA,QACL,WAAW,MAAO,CAAA,OAAA,CAAQ,KAAO,EAAA,EAAE,GAAG,YAAY,CAAA;AAAA,QAClD,OAAA,EAAS,MAAO,CAAA,KAAA,EAAO,YAAY;AAAA,OACrC;AAAA,IAEF,KAAK,WAAA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EAAA;AACA,IAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AAAA;AAGvC,EAAA,IAAI,aAAa,OAAS,EAAA;AACxB,IAAA,MAAM,QAAW,GAAA,OAAA,CAAQ,OAAQ,EAAA,GAAI,UAAU,OAAQ,EAAA;AACvD,IAAA,MAAM,WAAW,IAAK,CAAA,IAAA,CAAK,YAAY,GAAO,GAAA,EAAA,GAAK,KAAK,EAAG,CAAA,CAAA;AAE3D,IAAI,IAAA,QAAA,IAAY,GAAU,OAAA,QAAA;AAC1B,IAAI,IAAA,QAAA,IAAY,GAAU,OAAA,OAAA;AAC1B,IAAI,IAAA,QAAA,IAAY,IAAW,OAAA,QAAA;AAAA;AAG7B,EAAO,OAAA,SAAA;AACT;;;;"}
|
package/package.json
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
{
|
2
|
+
"name": "@red-hat-developer-hub/backstage-plugin-adoption-insights",
|
3
|
+
"version": "0.0.2",
|
4
|
+
"license": "Apache-2.0",
|
5
|
+
"main": "dist/index.esm.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"publishConfig": {
|
8
|
+
"access": "public",
|
9
|
+
"main": "dist/index.esm.js",
|
10
|
+
"types": "dist/index.d.ts"
|
11
|
+
},
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "https://github.com/redhat-developer/rhdh-plugins",
|
15
|
+
"directory": "workspaces/adoption-insights/plugins/adoption-insights"
|
16
|
+
},
|
17
|
+
"backstage": {
|
18
|
+
"role": "frontend-plugin",
|
19
|
+
"pluginId": "adoption-insights",
|
20
|
+
"pluginPackages": [
|
21
|
+
"@red-hat-developer-hub/backstage-plugin-adoption-insights",
|
22
|
+
"@red-hat-developer-hub/backstage-plugin-adoption-insights-backend",
|
23
|
+
"@red-hat-developer-hub/backstage-plugin-adoption-insights-common"
|
24
|
+
]
|
25
|
+
},
|
26
|
+
"sideEffects": false,
|
27
|
+
"scripts": {
|
28
|
+
"start": "backstage-cli package start",
|
29
|
+
"build": "backstage-cli package build",
|
30
|
+
"lint": "backstage-cli package lint",
|
31
|
+
"test": "backstage-cli package test",
|
32
|
+
"clean": "backstage-cli package clean",
|
33
|
+
"prepack": "backstage-cli package prepack",
|
34
|
+
"postpack": "backstage-cli package postpack"
|
35
|
+
},
|
36
|
+
"dependencies": {
|
37
|
+
"@backstage/catalog-model": "^1.7.3",
|
38
|
+
"@backstage/core-components": "^0.16.3",
|
39
|
+
"@backstage/core-plugin-api": "^1.10.3",
|
40
|
+
"@backstage/plugin-catalog-react": "^1.15.1",
|
41
|
+
"@backstage/plugin-permission-react": "^0.4.30",
|
42
|
+
"@backstage/theme": "^0.6.3",
|
43
|
+
"@material-ui/core": "^4.12.2",
|
44
|
+
"@material-ui/icons": "^4.9.1",
|
45
|
+
"@material-ui/lab": "4.0.0-alpha.61",
|
46
|
+
"@mui/icons-material": "5.16.4",
|
47
|
+
"@mui/lab": "5.0.0-alpha.175",
|
48
|
+
"@mui/material": "5.16.14",
|
49
|
+
"@mui/x-date-pickers": "5.0.20",
|
50
|
+
"@red-hat-developer-hub/backstage-plugin-adoption-insights-common": "^0.1.1",
|
51
|
+
"date-fns": "2.30.0",
|
52
|
+
"react-use": "^17.2.4",
|
53
|
+
"recharts": "^2.15.1"
|
54
|
+
},
|
55
|
+
"peerDependencies": {
|
56
|
+
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
57
|
+
},
|
58
|
+
"devDependencies": {
|
59
|
+
"@backstage/cli": "^0.29.5",
|
60
|
+
"@backstage/config": "^1.3.2",
|
61
|
+
"@backstage/core-app-api": "^1.15.4",
|
62
|
+
"@backstage/dev-utils": "^1.1.7",
|
63
|
+
"@backstage/test-utils": "^1.7.4",
|
64
|
+
"@redhat-developer/red-hat-developer-hub-theme": "^0.5.0",
|
65
|
+
"@testing-library/jest-dom": "^6.0.0",
|
66
|
+
"@testing-library/react": "^14.0.0",
|
67
|
+
"@testing-library/user-event": "^14.0.0",
|
68
|
+
"msw": "^1.0.0",
|
69
|
+
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
70
|
+
},
|
71
|
+
"files": [
|
72
|
+
"app-config.dynamic.yaml",
|
73
|
+
"dist"
|
74
|
+
],
|
75
|
+
"typesVersions": {
|
76
|
+
"*": {
|
77
|
+
"index": [
|
78
|
+
"dist/index.d.ts"
|
79
|
+
]
|
80
|
+
}
|
81
|
+
},
|
82
|
+
"module": "./dist/index.esm.js"
|
83
|
+
}
|