@backstage-community/plugin-cost-insights 0.12.25 → 0.12.27

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.
Files changed (230) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/alerts/ProjectGrowthAlert.esm.js +24 -0
  3. package/dist/alerts/ProjectGrowthAlert.esm.js.map +1 -0
  4. package/dist/alerts/UnlabeledDataflowAlert.esm.js +25 -0
  5. package/dist/alerts/UnlabeledDataflowAlert.esm.js.map +1 -0
  6. package/dist/api/CostInsightsApi.esm.js +8 -0
  7. package/dist/api/CostInsightsApi.esm.js.map +1 -0
  8. package/dist/components/ActionItems/ActionItemCard.esm.js +46 -0
  9. package/dist/components/ActionItems/ActionItemCard.esm.js.map +1 -0
  10. package/dist/components/ActionItems/ActionItems.esm.js +90 -0
  11. package/dist/components/ActionItems/ActionItems.esm.js.map +1 -0
  12. package/dist/components/AlertInsights/AlertDialog.esm.js +123 -0
  13. package/dist/components/AlertInsights/AlertDialog.esm.js.map +1 -0
  14. package/dist/components/AlertInsights/AlertInsights.esm.js +157 -0
  15. package/dist/components/AlertInsights/AlertInsights.esm.js.map +1 -0
  16. package/dist/components/AlertInsights/AlertInsightsHeader.esm.js +17 -0
  17. package/dist/components/AlertInsights/AlertInsightsHeader.esm.js.map +1 -0
  18. package/dist/components/AlertInsights/AlertInsightsSection.esm.js +57 -0
  19. package/dist/components/AlertInsights/AlertInsightsSection.esm.js.map +1 -0
  20. package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js +30 -0
  21. package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js.map +1 -0
  22. package/dist/components/AlertInsights/AlertStatusSummary.esm.js +93 -0
  23. package/dist/components/AlertInsights/AlertStatusSummary.esm.js.map +1 -0
  24. package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js +35 -0
  25. package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js.map +1 -0
  26. package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js +47 -0
  27. package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js.map +1 -0
  28. package/dist/components/BarChart/BarChart.esm.js +167 -0
  29. package/dist/components/BarChart/BarChart.esm.js.map +1 -0
  30. package/dist/components/BarChart/BarChartLabel.esm.js +31 -0
  31. package/dist/components/BarChart/BarChartLabel.esm.js.map +1 -0
  32. package/dist/components/BarChart/BarChartLegend.esm.js +47 -0
  33. package/dist/components/BarChart/BarChartLegend.esm.js.map +1 -0
  34. package/dist/components/BarChart/BarChartStepper.esm.js +91 -0
  35. package/dist/components/BarChart/BarChartStepper.esm.js.map +1 -0
  36. package/dist/components/BarChart/BarChartStepperButton.esm.js +27 -0
  37. package/dist/components/BarChart/BarChartStepperButton.esm.js.map +1 -0
  38. package/dist/components/BarChart/BarChartSteps.esm.js +25 -0
  39. package/dist/components/BarChart/BarChartSteps.esm.js.map +1 -0
  40. package/dist/components/BarChart/BarChartTick.esm.js +29 -0
  41. package/dist/components/BarChart/BarChartTick.esm.js.map +1 -0
  42. package/dist/components/BarChart/BarChartTooltip.esm.js +30 -0
  43. package/dist/components/BarChart/BarChartTooltip.esm.js.map +1 -0
  44. package/dist/components/BarChart/BarChartTooltipItem.esm.js +24 -0
  45. package/dist/components/BarChart/BarChartTooltipItem.esm.js.map +1 -0
  46. package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js +44 -0
  47. package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js.map +1 -0
  48. package/dist/components/CostGrowth/CostGrowth.esm.js +55 -0
  49. package/dist/components/CostGrowth/CostGrowth.esm.js.map +1 -0
  50. package/dist/components/CostGrowth/CostGrowthIndicator.esm.js +31 -0
  51. package/dist/components/CostGrowth/CostGrowthIndicator.esm.js.map +1 -0
  52. package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js +57 -0
  53. package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js.map +1 -0
  54. package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js +35 -0
  55. package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js.map +1 -0
  56. package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js +87 -0
  57. package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js.map +1 -0
  58. package/dist/components/CostInsightsPage/CostInsightsPage.esm.js +229 -0
  59. package/dist/components/CostInsightsPage/CostInsightsPage.esm.js.map +1 -0
  60. package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js +15 -0
  61. package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js.map +1 -0
  62. package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js +24 -0
  63. package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js.map +1 -0
  64. package/dist/components/CostInsightsPage/index.esm.js +2 -0
  65. package/dist/components/CostInsightsPage/index.esm.js.map +1 -0
  66. package/dist/components/CostInsightsPage/selector.esm.js +15 -0
  67. package/dist/components/CostInsightsPage/selector.esm.js.map +1 -0
  68. package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js +89 -0
  69. package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js.map +1 -0
  70. package/dist/components/CostInsightsTabs/selector.esm.js +17 -0
  71. package/dist/components/CostInsightsTabs/selector.esm.js.map +1 -0
  72. package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js +196 -0
  73. package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js.map +1 -0
  74. package/dist/components/CostOverviewCard/CostOverviewCard.esm.js +99 -0
  75. package/dist/components/CostOverviewCard/CostOverviewCard.esm.js.map +1 -0
  76. package/dist/components/CostOverviewCard/CostOverviewChart.esm.js +157 -0
  77. package/dist/components/CostOverviewCard/CostOverviewChart.esm.js.map +1 -0
  78. package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js +25 -0
  79. package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js.map +1 -0
  80. package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js +54 -0
  81. package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js.map +1 -0
  82. package/dist/components/CostOverviewCard/selector.esm.js +22 -0
  83. package/dist/components/CostOverviewCard/selector.esm.js.map +1 -0
  84. package/dist/components/CurrencySelect/CurrencySelect.esm.js +52 -0
  85. package/dist/components/CurrencySelect/CurrencySelect.esm.js.map +1 -0
  86. package/dist/{esm/index-BPzWHt3A.esm.js → components/EntityCosts/EntityCosts.esm.js} +14 -80
  87. package/dist/{esm/index-BPzWHt3A.esm.js.map → components/EntityCosts/EntityCosts.esm.js.map} +1 -1
  88. package/dist/components/EntityCosts/index.esm.js +2 -0
  89. package/dist/components/EntityCosts/index.esm.js.map +1 -0
  90. package/dist/{esm/index-BA6m_qFS.esm.js → components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js} +2 -79
  91. package/dist/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js.map +1 -0
  92. package/dist/components/LabelDataflowInstructionsPage/index.esm.js +2 -0
  93. package/dist/components/LabelDataflowInstructionsPage/index.esm.js.map +1 -0
  94. package/dist/components/LegendItem/LegendItem.esm.js +44 -0
  95. package/dist/components/LegendItem/LegendItem.esm.js.map +1 -0
  96. package/dist/components/MetricSelect/MetricSelect.esm.js +37 -0
  97. package/dist/components/MetricSelect/MetricSelect.esm.js.map +1 -0
  98. package/dist/components/PeriodSelect/PeriodSelect.esm.js +72 -0
  99. package/dist/components/PeriodSelect/PeriodSelect.esm.js.map +1 -0
  100. package/dist/components/ProductInsights/ProductInsights.esm.js +98 -0
  101. package/dist/components/ProductInsights/ProductInsights.esm.js.map +1 -0
  102. package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js +42 -0
  103. package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js.map +1 -0
  104. package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js +139 -0
  105. package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js.map +1 -0
  106. package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js +83 -0
  107. package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js.map +1 -0
  108. package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js +34 -0
  109. package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js.map +1 -0
  110. package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js +148 -0
  111. package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js.map +1 -0
  112. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js +20 -0
  113. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js.map +1 -0
  114. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js +46 -0
  115. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js.map +1 -0
  116. package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js +111 -0
  117. package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js.map +1 -0
  118. package/dist/components/ProjectGrowthInstructionsPage/index.esm.js +2 -0
  119. package/dist/components/ProjectGrowthInstructionsPage/index.esm.js.map +1 -0
  120. package/dist/components/ProjectSelect/ProjectSelect.esm.js +47 -0
  121. package/dist/components/ProjectSelect/ProjectSelect.esm.js.map +1 -0
  122. package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js +41 -0
  123. package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js.map +1 -0
  124. package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js +21 -0
  125. package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js.map +1 -0
  126. package/dist/example/alerts/KubernetesMigrationAlert.esm.js +86 -0
  127. package/dist/example/alerts/KubernetesMigrationAlert.esm.js.map +1 -0
  128. package/dist/example/client.esm.js +194 -0
  129. package/dist/example/client.esm.js.map +1 -0
  130. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js +33 -0
  131. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js.map +1 -0
  132. package/dist/{esm/index-BTIHr4n_.esm.js → example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js} +69 -48
  133. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js.map +1 -0
  134. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js +107 -0
  135. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js.map +1 -0
  136. package/dist/example/forms/KubernetesMigrationDismissForm.esm.js +57 -0
  137. package/dist/example/forms/KubernetesMigrationDismissForm.esm.js.map +1 -0
  138. package/dist/forms/AlertAcceptForm.esm.js +27 -0
  139. package/dist/forms/AlertAcceptForm.esm.js.map +1 -0
  140. package/dist/forms/AlertDismissForm.esm.js +100 -0
  141. package/dist/forms/AlertDismissForm.esm.js.map +1 -0
  142. package/dist/forms/AlertSnoozeForm.esm.js +52 -0
  143. package/dist/forms/AlertSnoozeForm.esm.js.map +1 -0
  144. package/dist/hooks/useConfig.esm.js +153 -0
  145. package/dist/hooks/useConfig.esm.js.map +1 -0
  146. package/dist/hooks/useCurrency.esm.js +26 -0
  147. package/dist/hooks/useCurrency.esm.js.map +1 -0
  148. package/dist/hooks/useFilters.esm.js +67 -0
  149. package/dist/hooks/useFilters.esm.js.map +1 -0
  150. package/dist/hooks/useGroups.esm.js +55 -0
  151. package/dist/hooks/useGroups.esm.js.map +1 -0
  152. package/dist/hooks/useLastCompleteBillingDate.esm.js +65 -0
  153. package/dist/hooks/useLastCompleteBillingDate.esm.js.map +1 -0
  154. package/dist/hooks/useLoading.esm.js +54 -0
  155. package/dist/hooks/useLoading.esm.js.map +1 -0
  156. package/dist/hooks/useScroll.esm.js +24 -0
  157. package/dist/hooks/useScroll.esm.js.map +1 -0
  158. package/dist/index.esm.js +37 -22
  159. package/dist/index.esm.js.map +1 -1
  160. package/dist/plugin.esm.js +55 -0
  161. package/dist/plugin.esm.js.map +1 -0
  162. package/dist/testUtils/filters.esm.js +8 -0
  163. package/dist/testUtils/filters.esm.js.map +1 -0
  164. package/dist/testUtils/loading.esm.js +14 -0
  165. package/dist/testUtils/loading.esm.js.map +1 -0
  166. package/dist/testUtils/mockData.esm.js +485 -0
  167. package/dist/testUtils/mockData.esm.js.map +1 -0
  168. package/dist/testUtils/products.esm.js +49 -0
  169. package/dist/testUtils/products.esm.js.map +1 -0
  170. package/dist/testUtils/providers.esm.js +41 -0
  171. package/dist/testUtils/providers.esm.js.map +1 -0
  172. package/dist/testUtils/testUtils.esm.js +142 -0
  173. package/dist/testUtils/testUtils.esm.js.map +1 -0
  174. package/dist/types/Alert.esm.js +66 -0
  175. package/dist/types/Alert.esm.js.map +1 -0
  176. package/dist/types/ChangeStatistic.esm.js +15 -0
  177. package/dist/types/ChangeStatistic.esm.js.map +1 -0
  178. package/dist/types/CurrencyType.esm.js +10 -0
  179. package/dist/types/CurrencyType.esm.js.map +1 -0
  180. package/dist/types/DateFormat.esm.js +4 -0
  181. package/dist/types/DateFormat.esm.js.map +1 -0
  182. package/dist/types/Duration.esm.js +10 -0
  183. package/dist/types/Duration.esm.js.map +1 -0
  184. package/dist/types/Icon.esm.js +12 -0
  185. package/dist/types/Icon.esm.js.map +1 -0
  186. package/dist/utils/alerts.esm.js +72 -0
  187. package/dist/utils/alerts.esm.js.map +1 -0
  188. package/dist/utils/assert.esm.js +29 -0
  189. package/dist/utils/assert.esm.js.map +1 -0
  190. package/dist/utils/change.esm.js +58 -0
  191. package/dist/utils/change.esm.js.map +1 -0
  192. package/dist/utils/charts.esm.js +9 -0
  193. package/dist/utils/charts.esm.js.map +1 -0
  194. package/dist/utils/config.esm.js +19 -0
  195. package/dist/utils/config.esm.js.map +1 -0
  196. package/dist/utils/currency.esm.js +56 -0
  197. package/dist/utils/currency.esm.js.map +1 -0
  198. package/dist/utils/duration.esm.js +55 -0
  199. package/dist/utils/duration.esm.js.map +1 -0
  200. package/dist/utils/filters.esm.js +14 -0
  201. package/dist/utils/filters.esm.js.map +1 -0
  202. package/dist/utils/formatters.esm.js +103 -0
  203. package/dist/utils/formatters.esm.js.map +1 -0
  204. package/dist/utils/grammar.esm.js +14 -0
  205. package/dist/utils/grammar.esm.js.map +1 -0
  206. package/dist/utils/graphs.esm.js +48 -0
  207. package/dist/utils/graphs.esm.js.map +1 -0
  208. package/dist/utils/history.esm.js +32 -0
  209. package/dist/utils/history.esm.js.map +1 -0
  210. package/dist/utils/loading.esm.js +51 -0
  211. package/dist/utils/loading.esm.js.map +1 -0
  212. package/dist/utils/navigation.esm.js +56 -0
  213. package/dist/utils/navigation.esm.js.map +1 -0
  214. package/dist/utils/scroll.esm.js +38 -0
  215. package/dist/utils/scroll.esm.js.map +1 -0
  216. package/dist/utils/sort.esm.js +10 -0
  217. package/dist/utils/sort.esm.js.map +1 -0
  218. package/dist/utils/styles.esm.js +562 -0
  219. package/dist/utils/styles.esm.js.map +1 -0
  220. package/dist/utils/sum.esm.js +4 -0
  221. package/dist/utils/sum.esm.js.map +1 -0
  222. package/package.json +17 -12
  223. package/dist/esm/index-BA6m_qFS.esm.js.map +0 -1
  224. package/dist/esm/index-BFM2mP6Z.esm.js +0 -4084
  225. package/dist/esm/index-BFM2mP6Z.esm.js.map +0 -1
  226. package/dist/esm/index-BTIHr4n_.esm.js.map +0 -1
  227. package/dist/esm/index-DaitkcPN.esm.js +0 -1136
  228. package/dist/esm/index-DaitkcPN.esm.js.map +0 -1
  229. package/dist/esm/selector-D7iXJwd9.esm.js +0 -594
  230. package/dist/esm/selector-D7iXJwd9.esm.js.map +0 -1
@@ -0,0 +1,54 @@
1
+ import React, { createContext, useMemo, useReducer, useState, useEffect, useContext } from 'react';
2
+ import Backdrop from '@material-ui/core/Backdrop';
3
+ import CircularProgress from '@material-ui/core/CircularProgress';
4
+ import { INITIAL_LOADING_ACTIONS, DefaultLoadingAction, getDefaultState } from '../utils/loading.esm.js';
5
+ import { useBackdropStyles } from '../utils/styles.esm.js';
6
+ import { useConfig } from './useConfig.esm.js';
7
+
8
+ const LoadingContext = createContext(
9
+ void 0
10
+ );
11
+ function reducer(prevState, action) {
12
+ return {
13
+ ...prevState,
14
+ ...action
15
+ };
16
+ }
17
+ const LoadingProvider = ({ children }) => {
18
+ const classes = useBackdropStyles();
19
+ const { products } = useConfig();
20
+ const actions = useMemo(
21
+ () => INITIAL_LOADING_ACTIONS.filter(
22
+ (action) => products.length || action !== DefaultLoadingAction.CostInsightsProducts
23
+ ),
24
+ [products]
25
+ );
26
+ const [state, dispatch] = useReducer(reducer, getDefaultState(actions));
27
+ const [isBackdropVisible, setBackdropVisible] = useState(false);
28
+ useEffect(() => {
29
+ function displayLoadingBackdrop() {
30
+ setBackdropVisible(
31
+ !state[DefaultLoadingAction.CostInsightsInitial] && Object.values(state).some((l) => l)
32
+ );
33
+ }
34
+ displayLoadingBackdrop();
35
+ }, [state, setBackdropVisible]);
36
+ return /* @__PURE__ */ React.createElement(LoadingContext.Provider, { value: { state, actions, dispatch } }, children, /* @__PURE__ */ React.createElement(Backdrop, { open: isBackdropVisible, classes }, /* @__PURE__ */ React.createElement(CircularProgress, null)));
37
+ };
38
+ function useLoading(mapLoadingToProps) {
39
+ const context = useContext(LoadingContext);
40
+ if (!context) {
41
+ assertNever();
42
+ }
43
+ return mapLoadingToProps({
44
+ state: context.state,
45
+ actions: context.actions,
46
+ dispatch: context.dispatch
47
+ });
48
+ }
49
+ function assertNever() {
50
+ throw Error("useLoading cannot be used outside of LoadingProvider");
51
+ }
52
+
53
+ export { LoadingContext, LoadingProvider, useLoading };
54
+ //# sourceMappingURL=useLoading.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoading.esm.js","sources":["../../src/hooks/useLoading.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\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 React, {\n createContext,\n Dispatch,\n PropsWithChildren,\n SetStateAction,\n useContext,\n useEffect,\n useMemo,\n useReducer,\n useState,\n} from 'react';\nimport Backdrop from '@material-ui/core/Backdrop';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { Loading } from '../types';\nimport {\n DefaultLoadingAction,\n getDefaultState,\n INITIAL_LOADING_ACTIONS,\n} from '../utils/loading';\nimport { useBackdropStyles as useStyles } from '../utils/styles';\nimport { useConfig } from './useConfig';\n\nexport type LoadingContextProps = {\n state: Loading;\n dispatch: Dispatch<Partial<SetStateAction<Loading>>>;\n actions: Array<string>;\n};\n\nexport type MapLoadingToProps<T> = (props: LoadingContextProps) => T;\n\nexport const LoadingContext = createContext<LoadingContextProps | undefined>(\n undefined,\n);\n\nfunction reducer(prevState: Loading, action: Partial<Loading>): Loading {\n return {\n ...prevState,\n ...action,\n } as Record<string, boolean>;\n}\n\nexport const LoadingProvider = ({ children }: PropsWithChildren<{}>) => {\n const classes = useStyles();\n const { products } = useConfig();\n const actions = useMemo(\n () =>\n INITIAL_LOADING_ACTIONS.filter(\n action =>\n products.length ||\n action !== DefaultLoadingAction.CostInsightsProducts,\n ),\n [products],\n );\n const [state, dispatch] = useReducer(reducer, getDefaultState(actions));\n const [isBackdropVisible, setBackdropVisible] = useState(false);\n\n useEffect(() => {\n function displayLoadingBackdrop() {\n // Initial page loading is handled by progress bar\n setBackdropVisible(\n !state[DefaultLoadingAction.CostInsightsInitial] &&\n Object.values(state).some(l => l),\n );\n }\n displayLoadingBackdrop();\n }, [state, setBackdropVisible]);\n\n return (\n <LoadingContext.Provider value={{ state, actions, dispatch }}>\n {children}\n <Backdrop open={isBackdropVisible} classes={classes}>\n <CircularProgress />\n </Backdrop>\n </LoadingContext.Provider>\n );\n};\n\nexport function useLoading<T>(mapLoadingToProps: MapLoadingToProps<T>): T {\n const context = useContext(LoadingContext);\n\n if (!context) {\n assertNever();\n }\n\n return mapLoadingToProps({\n state: context.state,\n actions: context.actions,\n dispatch: context.dispatch,\n });\n}\n\nfunction assertNever(): never {\n throw Error('useLoading cannot be used outside of LoadingProvider');\n}\n"],"names":["useStyles"],"mappings":";;;;;;;AA8CO,MAAM,cAAiB,GAAA,aAAA;AAAA,EAC5B,KAAA,CAAA;AACF,EAAA;AAEA,SAAS,OAAA,CAAQ,WAAoB,MAAmC,EAAA;AACtE,EAAO,OAAA;AAAA,IACL,GAAG,SAAA;AAAA,IACH,GAAG,MAAA;AAAA,GACL,CAAA;AACF,CAAA;AAEO,MAAM,eAAkB,GAAA,CAAC,EAAE,QAAA,EAAsC,KAAA;AACtE,EAAA,MAAM,UAAUA,iBAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,SAAU,EAAA,CAAA;AAC/B,EAAA,MAAM,OAAU,GAAA,OAAA;AAAA,IACd,MACE,uBAAwB,CAAA,MAAA;AAAA,MACtB,CACE,MAAA,KAAA,QAAA,CAAS,MACT,IAAA,MAAA,KAAW,oBAAqB,CAAA,oBAAA;AAAA,KACpC;AAAA,IACF,CAAC,QAAQ,CAAA;AAAA,GACX,CAAA;AACA,EAAM,MAAA,CAAC,OAAO,QAAQ,CAAA,GAAI,WAAW,OAAS,EAAA,eAAA,CAAgB,OAAO,CAAC,CAAA,CAAA;AACtE,EAAA,MAAM,CAAC,iBAAA,EAAmB,kBAAkB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAE9D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,SAAS,sBAAyB,GAAA;AAEhC,MAAA,kBAAA;AAAA,QACE,CAAC,KAAM,CAAA,oBAAA,CAAqB,mBAAmB,CAAA,IAC7C,MAAO,CAAA,MAAA,CAAO,KAAK,CAAA,CAAE,IAAK,CAAA,CAAA,CAAA,KAAK,CAAC,CAAA;AAAA,OACpC,CAAA;AAAA,KACF;AACA,IAAuB,sBAAA,EAAA,CAAA;AAAA,GACtB,EAAA,CAAC,KAAO,EAAA,kBAAkB,CAAC,CAAA,CAAA;AAE9B,EAAA,2CACG,cAAe,CAAA,QAAA,EAAf,EAAwB,KAAO,EAAA,EAAE,OAAO,OAAS,EAAA,QAAA,MAC/C,QACD,kBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,IAAM,EAAA,iBAAA,EAAmB,2BAChC,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,IAAiB,CACpB,CACF,CAAA,CAAA;AAEJ,EAAA;AAEO,SAAS,WAAc,iBAA4C,EAAA;AACxE,EAAM,MAAA,OAAA,GAAU,WAAW,cAAc,CAAA,CAAA;AAEzC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAY,WAAA,EAAA,CAAA;AAAA,GACd;AAEA,EAAA,OAAO,iBAAkB,CAAA;AAAA,IACvB,OAAO,OAAQ,CAAA,KAAA;AAAA,IACf,SAAS,OAAQ,CAAA,OAAA;AAAA,IACjB,UAAU,OAAQ,CAAA,QAAA;AAAA,GACnB,CAAA,CAAA;AACH,CAAA;AAEA,SAAS,WAAqB,GAAA;AAC5B,EAAA,MAAM,MAAM,sDAAsD,CAAA,CAAA;AACpE;;;;"}
@@ -0,0 +1,24 @@
1
+ import React, { useState, useContext } from 'react';
2
+
3
+ const ScrollContext = React.createContext(void 0);
4
+ const ScrollProvider = ({ children }) => {
5
+ const [scroll, setScroll] = useState(null);
6
+ return /* @__PURE__ */ React.createElement(ScrollContext.Provider, { value: { scroll, setScroll } }, children);
7
+ };
8
+ var ScrollType = /* @__PURE__ */ ((ScrollType2) => {
9
+ ScrollType2["AlertSummary"] = "alert-status-summary";
10
+ return ScrollType2;
11
+ })(ScrollType || {});
12
+ function useScroll() {
13
+ const context = useContext(ScrollContext);
14
+ if (!context) {
15
+ assertNever();
16
+ }
17
+ return [context.scroll, context.setScroll];
18
+ }
19
+ function assertNever() {
20
+ throw new Error(`Cannot use useScroll outside ScrollProvider`);
21
+ }
22
+
23
+ export { ScrollContext, ScrollProvider, ScrollType, useScroll };
24
+ //# sourceMappingURL=useScroll.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScroll.esm.js","sources":["../../src/hooks/useScroll.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, {\n Dispatch,\n SetStateAction,\n useState,\n useContext,\n PropsWithChildren,\n} from 'react';\nimport { Maybe } from '@backstage-community/plugin-cost-insights-common';\n\nexport type ScrollTo = Maybe<string>;\n\nexport type ScrollContextProps = {\n scroll: ScrollTo;\n setScroll: Dispatch<SetStateAction<ScrollTo>>;\n};\n\nexport const ScrollContext = React.createContext<\n ScrollContextProps | undefined\n>(undefined);\n\nexport const ScrollProvider = ({ children }: PropsWithChildren<{}>) => {\n const [scroll, setScroll] = useState<ScrollTo>(null);\n return (\n <ScrollContext.Provider value={{ scroll, setScroll }}>\n {children}\n </ScrollContext.Provider>\n );\n};\n\nexport enum ScrollType {\n AlertSummary = 'alert-status-summary',\n}\n\nexport function useScroll() {\n const context = useContext(ScrollContext);\n\n if (!context) {\n assertNever();\n }\n\n return [context.scroll, context.setScroll] as const;\n}\n\nfunction assertNever(): never {\n throw new Error(`Cannot use useScroll outside ScrollProvider`);\n}\n"],"names":["ScrollType"],"mappings":";;AA+Ba,MAAA,aAAA,GAAgB,KAAM,CAAA,aAAA,CAEjC,KAAS,CAAA,EAAA;AAEJ,MAAM,cAAiB,GAAA,CAAC,EAAE,QAAA,EAAsC,KAAA;AACrE,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAmB,IAAI,CAAA,CAAA;AACnD,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAc,QAAd,EAAA,EAAuB,OAAO,EAAE,MAAA,EAAQ,SAAU,EAAA,EAAA,EAChD,QACH,CAAA,CAAA;AAEJ,EAAA;AAEY,IAAA,UAAA,qBAAAA,WAAL,KAAA;AACL,EAAAA,YAAA,cAAe,CAAA,GAAA,sBAAA,CAAA;AADL,EAAAA,OAAAA,WAAAA,CAAAA;AAAA,CAAA,EAAA,UAAA,IAAA,EAAA,EAAA;AAIL,SAAS,SAAY,GAAA;AAC1B,EAAM,MAAA,OAAA,GAAU,WAAW,aAAa,CAAA,CAAA;AAExC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAY,WAAA,EAAA,CAAA;AAAA,GACd;AAEA,EAAA,OAAO,CAAC,OAAA,CAAQ,MAAQ,EAAA,OAAA,CAAQ,SAAS,CAAA,CAAA;AAC3C,CAAA;AAEA,SAAS,WAAqB,GAAA;AAC5B,EAAM,MAAA,IAAI,MAAM,CAA6C,2CAAA,CAAA,CAAA,CAAA;AAC/D;;;;"}
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- export { ax as AlertDismissOptions, aw as AlertDismissReason, ay as AlertSnoozeOptions, Q as AlertStatus, aq as BarChart, x as BarChartLegend, r as BarChartTooltip, s as BarChartTooltipItem, aB as ChangeThreshold, l as CostGrowth, ar as CostGrowthIndicator, ao as CostInsightsLabelDataflowInstructionsPage, al as CostInsightsPage, an as CostInsightsProjectGrowthInstructionsPage, aD as CurrencyType, D as DEFAULT_DATE_FORMAT, az as DataKey, z as Duration, aA as EngineerThreshold, am as EntityCostInsightsContent, ap as ExampleCostInsightsClient, aC as GrowthType, aE as IconType, h as LegendItem, as as MockConfigProvider, at as MockCurrencyProvider, au as ProjectGrowthAlert, av as UnlabeledDataflowAlert, c as costInsightsApiRef, ak as costInsightsPlugin, ak as plugin } from './esm/index-BFM2mP6Z.esm.js';
1
+ export { CostInsightsLabelDataflowInstructionsPage, CostInsightsPage, CostInsightsProjectGrowthInstructionsPage, EntityCostInsightsContent, costInsightsPlugin, costInsightsPlugin as plugin } from './plugin.esm.js';
2
2
  import 'react';
3
3
  import 'pluralize';
4
4
  import '@material-ui/core/Typography';
@@ -16,6 +16,20 @@ import '@material-ui/icons/Delete';
16
16
  import 'classnames';
17
17
  import '@material-ui/core/Card';
18
18
  import '@material-ui/core/CardHeader';
19
+ import './hooks/useConfig.esm.js';
20
+ import './hooks/useCurrency.esm.js';
21
+ import './hooks/useFilters.esm.js';
22
+ import './hooks/useGroups.esm.js';
23
+ import './hooks/useLoading.esm.js';
24
+ import './hooks/useScroll.esm.js';
25
+ import './hooks/useLastCompleteBillingDate.esm.js';
26
+ import './utils/styles.esm.js';
27
+ export { AlertDismissOptions, AlertDismissReason, AlertSnoozeOptions, AlertStatus, DataKey } from './types/Alert.esm.js';
28
+ export { ChangeThreshold, EngineerThreshold, GrowthType } from './types/ChangeStatistic.esm.js';
29
+ export { CurrencyType } from './types/CurrencyType.esm.js';
30
+ export { DEFAULT_DATE_FORMAT } from './types/DateFormat.esm.js';
31
+ export { Duration } from './types/Duration.esm.js';
32
+ export { IconType } from './types/Icon.esm.js';
19
33
  import '@material-ui/core/Grid';
20
34
  import '@material-ui/core/Snackbar';
21
35
  import '@material-ui/lab/Alert';
@@ -25,6 +39,7 @@ import '@material-ui/core/Dialog';
25
39
  import '@material-ui/core/DialogActions';
26
40
  import '@material-ui/core/DialogContent';
27
41
  import '@material-ui/icons/Close';
42
+ import './utils/alerts.esm.js';
28
43
  import '@material-ui/core/Collapse';
29
44
  import '@material-ui/icons/ExpandMore';
30
45
  import '@material-ui/icons/MonetizationOn';
@@ -36,14 +51,25 @@ import '@material-ui/icons/Search';
36
51
  import '@material-ui/icons/CloudQueue';
37
52
  import '@material-ui/icons/School';
38
53
  import '@material-ui/icons/ViewHeadline';
54
+ import './utils/duration.esm.js';
55
+ import './components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js';
56
+ export { BarChart } from './components/BarChart/BarChart.esm.js';
57
+ export { BarChartLegend } from './components/BarChart/BarChartLegend.esm.js';
58
+ export { BarChartTooltip } from './components/BarChart/BarChartTooltip.esm.js';
59
+ export { BarChartTooltipItem } from './components/BarChart/BarChartTooltipItem.esm.js';
39
60
  import 'react-router-dom';
40
61
  import 'react-use/esm/useCopyToClipboard';
41
62
  import '@material-ui/icons/AssignmentOutlined';
42
63
  import '@material-ui/icons/AssignmentTurnedInOutlined';
43
64
  import '@material-ui/icons/SentimentVeryDissatisfied';
65
+ export { CostGrowth } from './components/CostGrowth/CostGrowth.esm.js';
66
+ export { CostGrowthIndicator } from './components/CostGrowth/CostGrowthIndicator.esm.js';
44
67
  import 'react-use/esm/useAsync';
45
68
  import '@backstage/core-plugin-api';
69
+ import './components/CostInsightsLayout/CostInsightsLayout.esm.js';
70
+ import './components/CostInsightsNavigation/CostInsightsNavigation.esm.js';
46
71
  import '@material-ui/core/Container';
72
+ export { costInsightsApiRef } from './api/CostInsightsApi.esm.js';
47
73
  import '@material-ui/core/InputLabel';
48
74
  import '@material-ui/core/Select';
49
75
  import '@material-ui/core/FormControl';
@@ -53,31 +79,20 @@ import '@material-ui/core/Tab';
53
79
  import '@material-ui/core/Tabs';
54
80
  import 'luxon';
55
81
  import 'recharts';
82
+ export { LegendItem } from './components/LegendItem/LegendItem.esm.js';
56
83
  import '@material-ui/core/styles/colorManipulator';
57
84
  import '@material-ui/icons/Fullscreen';
58
85
  import '@material-ui/core/CircularProgress';
59
86
  import '@backstage/core-components';
60
87
  import '@material-ui/core/Menu';
88
+ import './components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js';
89
+ import './example/forms/KubernetesMigrationDismissForm.esm.js';
90
+ export { ExampleCostInsightsClient } from './example/client.esm.js';
91
+ import './testUtils/products.esm.js';
92
+ import './testUtils/filters.esm.js';
93
+ import './testUtils/loading.esm.js';
94
+ export { MockConfigProvider, MockCurrencyProvider } from './testUtils/providers.esm.js';
61
95
  import 'regression';
62
- import 'qs';
63
- import 'yup';
64
- import '@material-ui/core/Backdrop';
65
- import '@backstage/catalog-model';
66
- import '@material-ui/core/Checkbox';
67
- import '@material-ui/core/FormControlLabel';
68
- import '@material-ui/core/RadioGroup';
69
- import '@material-ui/core/Radio';
70
- import '@material-ui/core/TextField';
71
- import '@material-ui/icons/ChevronLeft';
72
- import '@material-ui/core/Slide';
73
- import '@material-ui/icons/ChevronRight';
74
- import '@material-ui/core/ButtonBase';
75
- import '@material-ui/icons/Lens';
76
- import '@material-ui/icons/HelpOutlineOutlined';
77
- import '@material-ui/icons/ArrowDropUp';
78
- import '@material-ui/icons/ArrowDropDown';
79
- import '@material-ui/core/MenuList';
80
- import '@material-ui/core/ListItemIcon';
81
- import '@material-ui/core/ListItemText';
82
- import '@material-ui/core/FormGroup';
96
+ export { ProjectGrowthAlert } from './alerts/ProjectGrowthAlert.esm.js';
97
+ export { UnlabeledDataflowAlert } from './alerts/UnlabeledDataflowAlert.esm.js';
83
98
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,55 @@
1
+ import { createRouteRef, createPlugin, createRoutableExtension } from '@backstage/core-plugin-api';
2
+
3
+ const rootRouteRef = createRouteRef({
4
+ id: "cost-insights"
5
+ });
6
+ const projectGrowthAlertRef = createRouteRef({
7
+ id: "cost-insights:investigating-growth"
8
+ });
9
+ const unlabeledDataflowAlertRef = createRouteRef({
10
+ id: "cost-insights:labeling-jobs"
11
+ });
12
+ const costInsightsPlugin = createPlugin({
13
+ id: "cost-insights",
14
+ featureFlags: [{ name: "cost-insights-currencies" }],
15
+ routes: {
16
+ root: rootRouteRef,
17
+ growthAlerts: projectGrowthAlertRef,
18
+ unlabeledDataflowAlerts: unlabeledDataflowAlertRef
19
+ }
20
+ });
21
+ const CostInsightsPage = costInsightsPlugin.provide(
22
+ createRoutableExtension({
23
+ name: "CostInsightsPage",
24
+ component: () => import('./components/CostInsightsPage/index.esm.js').then((m) => m.CostInsightsPage),
25
+ mountPoint: rootRouteRef
26
+ })
27
+ );
28
+ const EntityCostInsightsContent = costInsightsPlugin.provide(
29
+ createRoutableExtension({
30
+ name: "EntityCostInsightsContent",
31
+ component: () => import('./components/EntityCosts/index.esm.js').then((m) => m.EntityCosts),
32
+ mountPoint: rootRouteRef
33
+ })
34
+ );
35
+ const CostInsightsProjectGrowthInstructionsPage = costInsightsPlugin.provide(
36
+ createRoutableExtension({
37
+ name: "CostInsightsProjectGrowthInstructionsPage",
38
+ component: () => import('./components/ProjectGrowthInstructionsPage/index.esm.js').then(
39
+ (m) => m.ProjectGrowthInstructionsPage
40
+ ),
41
+ mountPoint: projectGrowthAlertRef
42
+ })
43
+ );
44
+ const CostInsightsLabelDataflowInstructionsPage = costInsightsPlugin.provide(
45
+ createRoutableExtension({
46
+ name: "CostInsightsLabelDataflowInstructionsPage",
47
+ component: () => import('./components/LabelDataflowInstructionsPage/index.esm.js').then(
48
+ (m) => m.LabelDataflowInstructionsPage
49
+ ),
50
+ mountPoint: unlabeledDataflowAlertRef
51
+ })
52
+ );
53
+
54
+ export { CostInsightsLabelDataflowInstructionsPage, CostInsightsPage, CostInsightsProjectGrowthInstructionsPage, EntityCostInsightsContent, costInsightsPlugin, projectGrowthAlertRef, rootRouteRef, unlabeledDataflowAlertRef };
55
+ //# sourceMappingURL=plugin.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\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 {\n createPlugin,\n createRouteRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'cost-insights',\n});\n\nexport const projectGrowthAlertRef = createRouteRef({\n id: 'cost-insights:investigating-growth',\n});\n\nexport const unlabeledDataflowAlertRef = createRouteRef({\n id: 'cost-insights:labeling-jobs',\n});\n\n/** @public */\nexport const costInsightsPlugin = createPlugin({\n id: 'cost-insights',\n featureFlags: [{ name: 'cost-insights-currencies' }],\n routes: {\n root: rootRouteRef,\n growthAlerts: projectGrowthAlertRef,\n unlabeledDataflowAlerts: unlabeledDataflowAlertRef,\n },\n});\n\n/** @public */\nexport const CostInsightsPage = costInsightsPlugin.provide(\n createRoutableExtension({\n name: 'CostInsightsPage',\n component: () =>\n import('./components/CostInsightsPage').then(m => m.CostInsightsPage),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * An extension for displaying costs on an entity page.\n *\n * @public\n */\nexport const EntityCostInsightsContent = costInsightsPlugin.provide(\n createRoutableExtension({\n name: 'EntityCostInsightsContent',\n component: () =>\n import('./components/EntityCosts').then(m => m.EntityCosts),\n mountPoint: rootRouteRef,\n }),\n);\n\n/** @public */\nexport const CostInsightsProjectGrowthInstructionsPage =\n costInsightsPlugin.provide(\n createRoutableExtension({\n name: 'CostInsightsProjectGrowthInstructionsPage',\n component: () =>\n import('./components/ProjectGrowthInstructionsPage').then(\n m => m.ProjectGrowthInstructionsPage,\n ),\n mountPoint: projectGrowthAlertRef,\n }),\n );\n\n/** @public */\nexport const CostInsightsLabelDataflowInstructionsPage =\n costInsightsPlugin.provide(\n createRoutableExtension({\n name: 'CostInsightsLabelDataflowInstructionsPage',\n component: () =>\n import('./components/LabelDataflowInstructionsPage').then(\n m => m.LabelDataflowInstructionsPage,\n ),\n mountPoint: unlabeledDataflowAlertRef,\n }),\n );\n"],"names":[],"mappings":";;AAsBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,eAAA;AACN,CAAC,EAAA;AAEM,MAAM,wBAAwB,cAAe,CAAA;AAAA,EAClD,EAAI,EAAA,oCAAA;AACN,CAAC,EAAA;AAEM,MAAM,4BAA4B,cAAe,CAAA;AAAA,EACtD,EAAI,EAAA,6BAAA;AACN,CAAC,EAAA;AAGM,MAAM,qBAAqB,YAAa,CAAA;AAAA,EAC7C,EAAI,EAAA,eAAA;AAAA,EACJ,YAAc,EAAA,CAAC,EAAE,IAAA,EAAM,4BAA4B,CAAA;AAAA,EACnD,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,YAAc,EAAA,qBAAA;AAAA,IACd,uBAAyB,EAAA,yBAAA;AAAA,GAC3B;AACF,CAAC,EAAA;AAGM,MAAM,mBAAmB,kBAAmB,CAAA,OAAA;AAAA,EACjD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,kBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,4CAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAOO,MAAM,4BAA4B,kBAAmB,CAAA,OAAA;AAAA,EAC1D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,uCAA0B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,WAAW,CAAA;AAAA,IAC5D,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,4CACX,kBAAmB,CAAA,OAAA;AAAA,EACjB,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2CAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,yDAA4C,CAAE,CAAA,IAAA;AAAA,MACnD,OAAK,CAAE,CAAA,6BAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,qBAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGK,MAAM,4CACX,kBAAmB,CAAA,OAAA;AAAA,EACjB,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2CAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,yDAA4C,CAAE,CAAA,IAAA;AAAA,MACnD,OAAK,CAAE,CAAA,6BAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,yBAAA;AAAA,GACb,CAAA;AACH;;;;"}
@@ -0,0 +1,8 @@
1
+ import '../types/Alert.esm.js';
2
+ import { Duration } from '../types/Duration.esm.js';
3
+ import { MockProductTypes } from './products.esm.js';
4
+
5
+ Object.keys(
6
+ MockProductTypes
7
+ ).map((productType) => ({ duration: Duration.P30D, productType }));
8
+ //# sourceMappingURL=filters.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.esm.js","sources":["../../src/testUtils/filters.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\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 { Duration, ProductFilters } from '../types';\nimport { MockProductTypes } from './products';\n\nexport const MockProductFilters: ProductFilters = Object.keys(\n MockProductTypes,\n).map(productType => ({ duration: Duration.P30D, productType }));\n"],"names":[],"mappings":";;;;AAmBkD,MAAO,CAAA,IAAA;AAAA,EACvD,gBAAA;AACF,CAAA,CAAE,IAAI,CAAgB,WAAA,MAAA,EAAE,UAAU,QAAS,CAAA,IAAA,EAAM,aAAc,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { MockProducts } from './products.esm.js';
2
+ import { DefaultLoadingAction, getDefaultState } from '../utils/loading.esm.js';
3
+
4
+ const MockDefaultLoadingActions = [
5
+ DefaultLoadingAction.UserGroups,
6
+ DefaultLoadingAction.CostInsightsInitial,
7
+ DefaultLoadingAction.CostInsightsPage
8
+ ].concat(MockProducts.map((product) => product.kind));
9
+ getDefaultState(
10
+ MockDefaultLoadingActions
11
+ );
12
+
13
+ export { MockDefaultLoadingActions };
14
+ //# sourceMappingURL=loading.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading.esm.js","sources":["../../src/testUtils/loading.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\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 { MockProducts } from './products';\nimport {\n DefaultLoadingAction,\n getDefaultState as getDefaultLoadingState,\n} from '../utils/loading';\n\nexport const MockDefaultLoadingActions = (\n [\n DefaultLoadingAction.UserGroups,\n DefaultLoadingAction.CostInsightsInitial,\n DefaultLoadingAction.CostInsightsPage,\n ] as string[]\n).concat(MockProducts.map(product => product.kind));\n\nexport const mockDefaultLoadingState = getDefaultLoadingState(\n MockDefaultLoadingActions,\n);\n"],"names":["getDefaultLoadingState"],"mappings":";;;AAqBO,MAAM,yBACX,GAAA;AAAA,EACE,oBAAqB,CAAA,UAAA;AAAA,EACrB,oBAAqB,CAAA,mBAAA;AAAA,EACrB,oBAAqB,CAAA,gBAAA;AACvB,CAAA,CACA,OAAO,YAAa,CAAA,GAAA,CAAI,CAAW,OAAA,KAAA,OAAA,CAAQ,IAAI,CAAC,EAAA;AAEXA,eAAA;AAAA,EACrC,yBAAA;AACF;;;;"}