@backstage-community/plugin-cost-insights 0.26.0 → 0.28.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.
Files changed (158) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/alerts/ProjectGrowthAlert.esm.js.map +1 -1
  3. package/dist/alerts/UnlabeledDataflowAlert.esm.js.map +1 -1
  4. package/dist/alpha/plugin.esm.js +2 -1
  5. package/dist/alpha/plugin.esm.js.map +1 -1
  6. package/dist/alpha/router.esm.js +1 -0
  7. package/dist/alpha/router.esm.js.map +1 -1
  8. package/dist/alpha.d.ts +31 -10
  9. package/dist/api/CostInsightsApi.esm.js.map +1 -1
  10. package/dist/components/ActionItems/ActionItemCard.esm.js.map +1 -1
  11. package/dist/components/ActionItems/ActionItems.esm.js.map +1 -1
  12. package/dist/components/AlertInsights/AlertDialog.esm.js.map +1 -1
  13. package/dist/components/AlertInsights/AlertInsights.esm.js.map +1 -1
  14. package/dist/components/AlertInsights/AlertInsightsHeader.esm.js.map +1 -1
  15. package/dist/components/AlertInsights/AlertInsightsSection.esm.js.map +1 -1
  16. package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js.map +1 -1
  17. package/dist/components/AlertInsights/AlertStatusSummary.esm.js.map +1 -1
  18. package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js.map +1 -1
  19. package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js.map +1 -1
  20. package/dist/components/BarChart/BarChart.esm.js.map +1 -1
  21. package/dist/components/BarChart/BarChartLabel.esm.js.map +1 -1
  22. package/dist/components/BarChart/BarChartLegend.esm.js.map +1 -1
  23. package/dist/components/BarChart/BarChartStepper.esm.js.map +1 -1
  24. package/dist/components/BarChart/BarChartStepperButton.esm.js.map +1 -1
  25. package/dist/components/BarChart/BarChartSteps.esm.js.map +1 -1
  26. package/dist/components/BarChart/BarChartTick.esm.js.map +1 -1
  27. package/dist/components/BarChart/BarChartTooltip.esm.js.map +1 -1
  28. package/dist/components/BarChart/BarChartTooltipItem.esm.js.map +1 -1
  29. package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js.map +1 -1
  30. package/dist/components/CostGrowth/CostGrowth.esm.js +11 -2
  31. package/dist/components/CostGrowth/CostGrowth.esm.js.map +1 -1
  32. package/dist/components/CostGrowth/CostGrowthIndicator.esm.js.map +1 -1
  33. package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js.map +1 -1
  34. package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js.map +1 -1
  35. package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js.map +1 -1
  36. package/dist/components/CostInsightsPage/CostInsightsPage.esm.js +5 -1
  37. package/dist/components/CostInsightsPage/CostInsightsPage.esm.js.map +1 -1
  38. package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js.map +1 -1
  39. package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js.map +1 -1
  40. package/dist/components/CostInsightsPage/index.esm.js +5 -1
  41. package/dist/components/CostInsightsPage/index.esm.js.map +1 -1
  42. package/dist/components/CostInsightsPage/selector.esm.js +1 -1
  43. package/dist/components/CostInsightsPage/selector.esm.js.map +1 -1
  44. package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js.map +1 -1
  45. package/dist/components/CostInsightsTabs/selector.esm.js.map +1 -1
  46. package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js +20 -6
  47. package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js.map +1 -1
  48. package/dist/components/CostOverviewCard/CostOverviewCard.esm.js +17 -4
  49. package/dist/components/CostOverviewCard/CostOverviewCard.esm.js.map +1 -1
  50. package/dist/components/CostOverviewCard/CostOverviewChart.esm.js +1 -1
  51. package/dist/components/CostOverviewCard/CostOverviewChart.esm.js.map +1 -1
  52. package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js.map +1 -1
  53. package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js +11 -3
  54. package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js.map +1 -1
  55. package/dist/components/CostOverviewCard/selector.esm.js +3 -2
  56. package/dist/components/CostOverviewCard/selector.esm.js.map +1 -1
  57. package/dist/components/CurrencySelect/CurrencySelect.esm.js.map +1 -1
  58. package/dist/components/EntityCosts/EntityCosts.esm.js +5 -1
  59. package/dist/components/EntityCosts/EntityCosts.esm.js.map +1 -1
  60. package/dist/components/EntityCosts/index.esm.js +5 -1
  61. package/dist/components/EntityCosts/index.esm.js.map +1 -1
  62. package/dist/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js.map +1 -1
  63. package/dist/components/LabelDataflowInstructionsPage/index.esm.js +5 -1
  64. package/dist/components/LabelDataflowInstructionsPage/index.esm.js.map +1 -1
  65. package/dist/components/LegendItem/LegendItem.esm.js.map +1 -1
  66. package/dist/components/MetricSelect/MetricSelect.esm.js.map +1 -1
  67. package/dist/components/PeriodSelect/DateRangePicker.esm.js +218 -0
  68. package/dist/components/PeriodSelect/DateRangePicker.esm.js.map +1 -0
  69. package/dist/components/ProductInsights/ProductInsights.esm.js +9 -2
  70. package/dist/components/ProductInsights/ProductInsights.esm.js.map +1 -1
  71. package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js.map +1 -1
  72. package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js.map +1 -1
  73. package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js +32 -8
  74. package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js.map +1 -1
  75. package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js.map +1 -1
  76. package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js +24 -4
  77. package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js.map +1 -1
  78. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js.map +1 -1
  79. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js.map +1 -1
  80. package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js +1 -1
  81. package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js.map +1 -1
  82. package/dist/components/ProjectGrowthInstructionsPage/index.esm.js +5 -1
  83. package/dist/components/ProjectGrowthInstructionsPage/index.esm.js.map +1 -1
  84. package/dist/components/ProjectSelect/ProjectSelect.esm.js.map +1 -1
  85. package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js.map +1 -1
  86. package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js.map +1 -1
  87. package/dist/example/alerts/KubernetesMigrationAlert.esm.js.map +1 -1
  88. package/dist/example/client.esm.js +1 -1
  89. package/dist/example/client.esm.js.map +1 -1
  90. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js.map +1 -1
  91. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js +1 -0
  92. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js.map +1 -1
  93. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js +1 -0
  94. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js.map +1 -1
  95. package/dist/example/forms/KubernetesMigrationDismissForm.esm.js.map +1 -1
  96. package/dist/forms/AlertAcceptForm.esm.js.map +1 -1
  97. package/dist/forms/AlertDismissForm.esm.js.map +1 -1
  98. package/dist/forms/AlertSnoozeForm.esm.js.map +1 -1
  99. package/dist/hooks/useConfig.esm.js +2 -2
  100. package/dist/hooks/useConfig.esm.js.map +1 -1
  101. package/dist/hooks/useCurrency.esm.js +1 -1
  102. package/dist/hooks/useCurrency.esm.js.map +1 -1
  103. package/dist/hooks/useFilters.esm.js +1 -1
  104. package/dist/hooks/useFilters.esm.js.map +1 -1
  105. package/dist/hooks/useGroups.esm.js +1 -1
  106. package/dist/hooks/useGroups.esm.js.map +1 -1
  107. package/dist/hooks/useLastCompleteBillingDate.esm.js +1 -1
  108. package/dist/hooks/useLastCompleteBillingDate.esm.js.map +1 -1
  109. package/dist/hooks/useLoading.esm.js +1 -1
  110. package/dist/hooks/useLoading.esm.js.map +1 -1
  111. package/dist/hooks/useScroll.esm.js +1 -1
  112. package/dist/hooks/useScroll.esm.js.map +1 -1
  113. package/dist/index.d.ts +16 -2
  114. package/dist/index.esm.js +1 -0
  115. package/dist/index.esm.js.map +1 -1
  116. package/dist/plugin.esm.js +1 -1
  117. package/dist/plugin.esm.js.map +1 -1
  118. package/dist/routes.esm.js.map +1 -1
  119. package/dist/testUtils/filters.esm.js.map +1 -1
  120. package/dist/testUtils/loading.esm.js.map +1 -1
  121. package/dist/testUtils/mockData.esm.js.map +1 -1
  122. package/dist/testUtils/products.esm.js.map +1 -1
  123. package/dist/testUtils/providers.esm.js.map +1 -1
  124. package/dist/testUtils/testUtils.esm.js +30 -11
  125. package/dist/testUtils/testUtils.esm.js.map +1 -1
  126. package/dist/types/Alert.esm.js.map +1 -1
  127. package/dist/types/ChangeStatistic.esm.js.map +1 -1
  128. package/dist/types/CurrencyType.esm.js.map +1 -1
  129. package/dist/types/DateFormat.esm.js.map +1 -1
  130. package/dist/types/Duration.esm.js +1 -0
  131. package/dist/types/Duration.esm.js.map +1 -1
  132. package/dist/types/Icon.esm.js.map +1 -1
  133. package/dist/utils/alerts.esm.js.map +1 -1
  134. package/dist/utils/assert.esm.js.map +1 -1
  135. package/dist/utils/change.esm.js +20 -6
  136. package/dist/utils/change.esm.js.map +1 -1
  137. package/dist/utils/charts.esm.js.map +1 -1
  138. package/dist/utils/config.esm.js.map +1 -1
  139. package/dist/utils/currency.esm.js +6 -1
  140. package/dist/utils/currency.esm.js.map +1 -1
  141. package/dist/utils/duration.esm.js +41 -5
  142. package/dist/utils/duration.esm.js.map +1 -1
  143. package/dist/utils/filters.esm.js.map +1 -1
  144. package/dist/utils/formatters.esm.js +25 -4
  145. package/dist/utils/formatters.esm.js.map +1 -1
  146. package/dist/utils/grammar.esm.js.map +1 -1
  147. package/dist/utils/graphs.esm.js +1 -1
  148. package/dist/utils/graphs.esm.js.map +1 -1
  149. package/dist/utils/history.esm.js.map +1 -1
  150. package/dist/utils/loading.esm.js.map +1 -1
  151. package/dist/utils/navigation.esm.js.map +1 -1
  152. package/dist/utils/scroll.esm.js.map +1 -1
  153. package/dist/utils/sort.esm.js.map +1 -1
  154. package/dist/utils/styles.esm.js.map +1 -1
  155. package/dist/utils/sum.esm.js.map +1 -1
  156. package/package.json +15 -13
  157. package/dist/components/PeriodSelect/PeriodSelect.esm.js +0 -72
  158. package/dist/components/PeriodSelect/PeriodSelect.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @backstage-community/plugin-cost-insights
2
2
 
3
+ ## 0.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ea7c464: Backstage version bump to v1.49.2
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [ea7c464]
12
+ - @backstage-community/plugin-cost-insights-common@0.13.0
13
+
14
+ ## 0.27.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 8a5c766: The product insights and the cost insights graph support date ranges to add custom time frames
19
+
3
20
  ## 0.26.0
4
21
 
5
22
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectGrowthAlert.esm.js","sources":["../../src/alerts/ProjectGrowthAlert.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 { ProjectGrowthAlertCard } from '../components/ProjectGrowthAlertCard';\nimport { Alert, ProjectGrowthData } from '../types';\n\n/**\n * The alert below is an example of an Alert implementation; the CostInsightsApi permits returning\n * any implementation of the Alert type, so adopters can create their own. The CostInsightsApi\n * fetches alert data from the backend, then creates Alert classes with the data.\n *\n * @public\n */\nexport class ProjectGrowthAlert implements Alert {\n data: ProjectGrowthData;\n\n constructor(data: ProjectGrowthData) {\n this.data = data;\n }\n\n get url() {\n return '/cost-insights/investigating-growth';\n }\n\n get title() {\n return `Investigate cost growth in project ${this.data.project}`;\n }\n\n get subtitle() {\n return 'Cost growth outpacing business growth is unsustainable long-term.';\n }\n\n get element() {\n return <ProjectGrowthAlertCard alert={this.data} />;\n }\n}\n"],"names":[],"mappings":";;;AA0BO,MAAM,kBAAoC,CAAA;AAAA,EAC/C,IAAA;AAAA,EAEA,YAAY,IAAyB,EAAA;AACnC,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AAAA;AACd,EAEA,IAAI,GAAM,GAAA;AACR,IAAO,OAAA,qCAAA;AAAA;AACT,EAEA,IAAI,KAAQ,GAAA;AACV,IAAO,OAAA,CAAA,mCAAA,EAAsC,IAAK,CAAA,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA;AAChE,EAEA,IAAI,QAAW,GAAA;AACb,IAAO,OAAA,mEAAA;AAAA;AACT,EAEA,IAAI,OAAU,GAAA;AACZ,IAAA,uBAAQ,GAAA,CAAA,sBAAA,EAAA,EAAuB,KAAO,EAAA,IAAA,CAAK,IAAM,EAAA,CAAA;AAAA;AAErD;;;;"}
1
+ {"version":3,"file":"ProjectGrowthAlert.esm.js","sources":["../../src/alerts/ProjectGrowthAlert.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 { ProjectGrowthAlertCard } from '../components/ProjectGrowthAlertCard';\nimport { Alert, ProjectGrowthData } from '../types';\n\n/**\n * The alert below is an example of an Alert implementation; the CostInsightsApi permits returning\n * any implementation of the Alert type, so adopters can create their own. The CostInsightsApi\n * fetches alert data from the backend, then creates Alert classes with the data.\n *\n * @public\n */\nexport class ProjectGrowthAlert implements Alert {\n data: ProjectGrowthData;\n\n constructor(data: ProjectGrowthData) {\n this.data = data;\n }\n\n get url() {\n return '/cost-insights/investigating-growth';\n }\n\n get title() {\n return `Investigate cost growth in project ${this.data.project}`;\n }\n\n get subtitle() {\n return 'Cost growth outpacing business growth is unsustainable long-term.';\n }\n\n get element() {\n return <ProjectGrowthAlertCard alert={this.data} />;\n }\n}\n"],"names":[],"mappings":";;;AA0BO,MAAM,kBAAA,CAAoC;AAAA,EAC/C,IAAA;AAAA,EAEA,YAAY,IAAA,EAAyB;AACnC,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AAAA,EAEA,IAAI,GAAA,GAAM;AACR,IAAA,OAAO,qCAAA;AAAA,EACT;AAAA,EAEA,IAAI,KAAA,GAAQ;AACV,IAAA,OAAO,CAAA,mCAAA,EAAsC,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,EAChE;AAAA,EAEA,IAAI,QAAA,GAAW;AACb,IAAA,OAAO,mEAAA;AAAA,EACT;AAAA,EAEA,IAAI,OAAA,GAAU;AACZ,IAAA,uBAAO,GAAA,CAAC,sBAAA,EAAA,EAAuB,KAAA,EAAO,IAAA,CAAK,IAAA,EAAM,CAAA;AAAA,EACnD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnlabeledDataflowAlert.esm.js","sources":["../../src/alerts/UnlabeledDataflowAlert.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 { UnlabeledDataflowAlertCard } from '../components/UnlabeledDataflowAlertCard';\nimport { Alert, AlertStatus, UnlabeledDataflowData } from '../types';\n\n/**\n * The alert below is an example of an Alert implementation; the CostInsightsApi permits returning\n * any implementation of the Alert type, so adopters can create their own. The CostInsightsApi\n * fetches alert data from the backend, then creates Alert classes with the data.\n *\n * @public\n */\nexport class UnlabeledDataflowAlert implements Alert {\n data: UnlabeledDataflowData;\n status?: AlertStatus;\n\n constructor(data: UnlabeledDataflowData) {\n this.data = data;\n }\n\n get url() {\n return '/cost-insights/labeling-jobs';\n }\n\n get title() {\n return 'Add labels to workflows';\n }\n\n get subtitle() {\n return 'Labels show in billing data, enabling cost insights for each workflow.';\n }\n\n get element() {\n return <UnlabeledDataflowAlertCard alert={this.data} />;\n }\n}\n"],"names":[],"mappings":";;;AA0BO,MAAM,sBAAwC,CAAA;AAAA,EACnD,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAY,IAA6B,EAAA;AACvC,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA;AAAA;AACd,EAEA,IAAI,GAAM,GAAA;AACR,IAAO,OAAA,8BAAA;AAAA;AACT,EAEA,IAAI,KAAQ,GAAA;AACV,IAAO,OAAA,yBAAA;AAAA;AACT,EAEA,IAAI,QAAW,GAAA;AACb,IAAO,OAAA,wEAAA;AAAA;AACT,EAEA,IAAI,OAAU,GAAA;AACZ,IAAA,uBAAQ,GAAA,CAAA,0BAAA,EAAA,EAA2B,KAAO,EAAA,IAAA,CAAK,IAAM,EAAA,CAAA;AAAA;AAEzD;;;;"}
1
+ {"version":3,"file":"UnlabeledDataflowAlert.esm.js","sources":["../../src/alerts/UnlabeledDataflowAlert.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 { UnlabeledDataflowAlertCard } from '../components/UnlabeledDataflowAlertCard';\nimport { Alert, AlertStatus, UnlabeledDataflowData } from '../types';\n\n/**\n * The alert below is an example of an Alert implementation; the CostInsightsApi permits returning\n * any implementation of the Alert type, so adopters can create their own. The CostInsightsApi\n * fetches alert data from the backend, then creates Alert classes with the data.\n *\n * @public\n */\nexport class UnlabeledDataflowAlert implements Alert {\n data: UnlabeledDataflowData;\n status?: AlertStatus;\n\n constructor(data: UnlabeledDataflowData) {\n this.data = data;\n }\n\n get url() {\n return '/cost-insights/labeling-jobs';\n }\n\n get title() {\n return 'Add labels to workflows';\n }\n\n get subtitle() {\n return 'Labels show in billing data, enabling cost insights for each workflow.';\n }\n\n get element() {\n return <UnlabeledDataflowAlertCard alert={this.data} />;\n }\n}\n"],"names":[],"mappings":";;;AA0BO,MAAM,sBAAA,CAAwC;AAAA,EACnD,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAY,IAAA,EAA6B;AACvC,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AAAA,EAEA,IAAI,GAAA,GAAM;AACR,IAAA,OAAO,8BAAA;AAAA,EACT;AAAA,EAEA,IAAI,KAAA,GAAQ;AACV,IAAA,OAAO,yBAAA;AAAA,EACT;AAAA,EAEA,IAAI,QAAA,GAAW;AACb,IAAA,OAAO,wEAAA;AAAA,EACT;AAAA,EAEA,IAAI,OAAA,GAAU;AACZ,IAAA,uBAAO,GAAA,CAAC,0BAAA,EAAA,EAA2B,KAAA,EAAO,IAAA,CAAK,IAAA,EAAM,CAAA;AAAA,EACvD;AACF;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { ApiBlueprint, PageBlueprint, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
- import { convertLegacyRouteRef, compatWrapper, convertLegacyRouteRefs } from '@backstage/core-compat-api';
3
+ import { compatWrapper, convertLegacyRouteRef, convertLegacyRouteRefs } from '@backstage/core-compat-api';
4
4
  import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
5
5
  import MoneyIcon from '@material-ui/icons/MonetizationOn';
6
6
  import { rootRouteRef } from '../routes.esm.js';
@@ -84,6 +84,7 @@ import '@material-ui/core/Tab';
84
84
  import '@material-ui/core/Tabs';
85
85
  import '@material-ui/core/styles/colorManipulator';
86
86
  import '@material-ui/icons/Fullscreen';
87
+ import '../components/PeriodSelect/DateRangePicker.esm.js';
87
88
  import '@material-ui/core/CircularProgress';
88
89
  import '@backstage/core-components';
89
90
  import '@material-ui/core/Menu';
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 PageBlueprint,\n NavItemBlueprint,\n createFrontendPlugin,\n ApiBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport MoneyIcon from '@material-ui/icons/MonetizationOn';\nimport { rootRouteRef } from '../routes';\nimport { costInsightsApiRef } from '../api';\nimport { ExampleCostInsightsClient } from '../example';\n\n/** @alpha */\nexport const CostInsightsApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: costInsightsApiRef,\n deps: {},\n factory: ({}) => new ExampleCostInsightsClient(),\n }),\n});\n\n/** @alpha */\nexport const CostInsightsPage = PageBlueprint.make({\n params: {\n path: '/cost-insights',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('./router').then(m => compatWrapper(<m.CostInsightsRouter />)),\n },\n});\n\n/** @alpha */\nexport const EntityCostInsightsContent = EntityContentBlueprint.make({\n name: 'EntityCostInsightsContent',\n params: {\n path: '/cost-insights',\n title: 'Cost Insights',\n loader: () =>\n import('../components/EntityCosts').then(m =>\n compatWrapper(<m.EntityCosts />),\n ),\n },\n});\n\n/**\n * @alpha\n */\nexport const CostInsightsNavItem = NavItemBlueprint.make({\n params: {\n title: 'Cost Insights',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n icon: MoneyIcon,\n },\n});\n\nexport default createFrontendPlugin({\n pluginId: 'cost-insights',\n extensions: [CostInsightsApi, CostInsightsPage, CostInsightsNavItem],\n routes: convertLegacyRouteRefs({\n root: rootRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCa,MAAA,eAAA,GAAkB,aAAa,IAAK,CAAA;AAAA,EAC/C,MAAA,EAAQ,kBACN,YAAa,CAAA;AAAA,IACX,GAAK,EAAA,kBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,OAAS,EAAA,CAAC,EAAC,KAAM,IAAI,yBAA0B;AAAA,GAChD;AACL,CAAC;AAGY,MAAA,gBAAA,GAAmB,cAAc,IAAK,CAAA;AAAA,EACjD,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,gBAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAQ,EAAA,MACN,OAAO,iBAAU,CAAE,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,aAAA,iBAAe,GAAA,CAAA,CAAA,CAAE,kBAAF,EAAA,EAAqB,CAAE,CAAC;AAAA;AAE1E,CAAC;AAGwC,uBAAuB,IAAK,CAAA;AAAA,EACnE,IAAM,EAAA,2BAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,gBAAA;AAAA,IACN,KAAO,EAAA,eAAA;AAAA,IACP,MAAQ,EAAA,MACN,OAAO,wCAA2B,CAAE,CAAA,IAAA;AAAA,MAAK,OACvC,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,WAAA,EAAF,EAAc,CAAE;AAAA;AACjC;AAEN,CAAC;AAKY,MAAA,mBAAA,GAAsB,iBAAiB,IAAK,CAAA;AAAA,EACvD,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,eAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,IAAM,EAAA;AAAA;AAEV,CAAC;AAED,aAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,eAAA;AAAA,EACV,UAAY,EAAA,CAAC,eAAiB,EAAA,gBAAA,EAAkB,mBAAmB,CAAA;AAAA,EACnE,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA;AAAA,GACP;AACH,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 PageBlueprint,\n NavItemBlueprint,\n createFrontendPlugin,\n ApiBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport MoneyIcon from '@material-ui/icons/MonetizationOn';\nimport { rootRouteRef } from '../routes';\nimport { costInsightsApiRef } from '../api';\nimport { ExampleCostInsightsClient } from '../example';\n\n/** @alpha */\nexport const CostInsightsApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: costInsightsApiRef,\n deps: {},\n factory: ({}) => new ExampleCostInsightsClient(),\n }),\n});\n\n/** @alpha */\nexport const CostInsightsPage = PageBlueprint.make({\n params: {\n path: '/cost-insights',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('./router').then(m => compatWrapper(<m.CostInsightsRouter />)),\n },\n});\n\n/** @alpha */\nexport const EntityCostInsightsContent = EntityContentBlueprint.make({\n name: 'EntityCostInsightsContent',\n params: {\n path: '/cost-insights',\n title: 'Cost Insights',\n loader: () =>\n import('../components/EntityCosts').then(m =>\n compatWrapper(<m.EntityCosts />),\n ),\n },\n});\n\n/**\n * @alpha\n */\nexport const CostInsightsNavItem = NavItemBlueprint.make({\n params: {\n title: 'Cost Insights',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n icon: MoneyIcon,\n },\n});\n\nexport default createFrontendPlugin({\n pluginId: 'cost-insights',\n extensions: [CostInsightsApi, CostInsightsPage, CostInsightsNavItem],\n routes: convertLegacyRouteRefs({\n root: rootRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,EACnE,QAAQ,sBAAA,CAAuB;AAAA,IAC7B,IAAA,EAAM;AAAA,GACP;AACH,CAAC,CAAA;;;;"}
@@ -82,6 +82,7 @@ import '@material-ui/icons/Fullscreen';
82
82
  import '@material-ui/core/InputLabel';
83
83
  import '@material-ui/core/FormControl';
84
84
  import '@material-ui/core/Select';
85
+ import '../components/PeriodSelect/DateRangePicker.esm.js';
85
86
  import { LabelDataflowInstructionsPage } from '../components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js';
86
87
  import '../api/CostInsightsApi.esm.js';
87
88
  import '@material-ui/core/CircularProgress';
@@ -1 +1 @@
1
- {"version":3,"file":"router.esm.js","sources":["../../src/alpha/router.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 { createSubRouteRef } from '@backstage/core-plugin-api';\nimport { Route, Routes } from 'react-router-dom';\nimport { rootRouteRef } from '../routes';\nimport {\n CostInsightsPage,\n LabelDataflowInstructionsPage,\n ProjectGrowthInstructionsPage,\n} from '../components';\n\nexport const projectGrowthAlertSubRouteRef = createSubRouteRef({\n id: 'cost-insights/investigating-growth',\n parent: rootRouteRef,\n path: '/investigating-growth',\n});\n\nexport const unlabeledDataflowAlertSubRouteRef = createSubRouteRef({\n id: 'cost-insights/labeling-jobs',\n parent: rootRouteRef,\n path: '/labeling-jobs',\n});\n\nexport const CostInsightsRouter = () => (\n <Routes>\n <Route path=\"/\" element={<CostInsightsPage />} />\n <Route\n path={projectGrowthAlertSubRouteRef.path}\n element={<ProjectGrowthInstructionsPage />}\n />\n <Route\n path={unlabeledDataflowAlertSubRouteRef.path}\n element={<LabelDataflowInstructionsPage />}\n />\n </Routes>\n);\n"],"names":["CostInsightsPage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,gCAAgC,iBAAkB,CAAA;AAAA,EAC7D,EAAI,EAAA,oCAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA;AACR,CAAC;AAEM,MAAM,oCAAoC,iBAAkB,CAAA;AAAA,EACjE,EAAI,EAAA,6BAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA;AACR,CAAC;AAEY,MAAA,kBAAA,GAAqB,sBAChC,IAAA,CAAC,MACC,EAAA,EAAA,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,SAAM,IAAK,EAAA,GAAA,EAAI,OAAS,kBAAA,GAAA,CAACA,wBAAiB,CAAI,EAAA,CAAA;AAAA,kBAC/C,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,MAAM,6BAA8B,CAAA,IAAA;AAAA,MACpC,OAAA,sBAAU,6BAA8B,EAAA,EAAA;AAAA;AAAA,GAC1C;AAAA,kBACA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,MAAM,iCAAkC,CAAA,IAAA;AAAA,MACxC,OAAA,sBAAU,6BAA8B,EAAA,EAAA;AAAA;AAAA;AAC1C,CACF,EAAA;;;;"}
1
+ {"version":3,"file":"router.esm.js","sources":["../../src/alpha/router.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 { createSubRouteRef } from '@backstage/core-plugin-api';\nimport { Route, Routes } from 'react-router-dom';\nimport { rootRouteRef } from '../routes';\nimport {\n CostInsightsPage,\n LabelDataflowInstructionsPage,\n ProjectGrowthInstructionsPage,\n} from '../components';\n\nexport const projectGrowthAlertSubRouteRef = createSubRouteRef({\n id: 'cost-insights/investigating-growth',\n parent: rootRouteRef,\n path: '/investigating-growth',\n});\n\nexport const unlabeledDataflowAlertSubRouteRef = createSubRouteRef({\n id: 'cost-insights/labeling-jobs',\n parent: rootRouteRef,\n path: '/labeling-jobs',\n});\n\nexport const CostInsightsRouter = () => (\n <Routes>\n <Route path=\"/\" element={<CostInsightsPage />} />\n <Route\n path={projectGrowthAlertSubRouteRef.path}\n element={<ProjectGrowthInstructionsPage />}\n />\n <Route\n path={unlabeledDataflowAlertSubRouteRef.path}\n element={<LabelDataflowInstructionsPage />}\n />\n </Routes>\n);\n"],"names":["CostInsightsPage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,gCAAgC,iBAAA,CAAkB;AAAA,EAC7D,EAAA,EAAI,oCAAA;AAAA,EACJ,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM;AACR,CAAC;AAEM,MAAM,oCAAoC,iBAAA,CAAkB;AAAA,EACjE,EAAA,EAAI,6BAAA;AAAA,EACJ,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM;AACR,CAAC;AAEM,MAAM,kBAAA,GAAqB,sBAChC,IAAA,CAAC,MAAA,EAAA,EACC,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,SAAM,IAAA,EAAK,GAAA,EAAI,OAAA,kBAAS,GAAA,CAACA,wBAAiB,CAAA,EAAI,CAAA;AAAA,kBAC/C,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,MAAM,6BAAA,CAA8B,IAAA;AAAA,MACpC,OAAA,sBAAU,6BAAA,EAAA,EAA8B;AAAA;AAAA,GAC1C;AAAA,kBACA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,MAAM,iCAAA,CAAkC,IAAA;AAAA,MACxC,OAAA,sBAAU,6BAAA,EAAA,EAA8B;AAAA;AAAA;AAC1C,CAAA,EACF;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import * as react from 'react';
3
2
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
4
3
 
@@ -12,15 +11,17 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
12
11
  configInput: {};
13
12
  output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
14
13
  inputs: {};
15
- params: <TApi, TImpl extends TApi, TDeps extends {
16
- [x: string]: unknown;
17
- }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
14
+ params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
18
15
  }>;
19
16
  "nav-item:cost-insights": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
20
17
  kind: "nav-item";
21
18
  name: undefined;
22
- config: {};
23
- configInput: {};
19
+ config: {
20
+ title: string | undefined;
21
+ };
22
+ configInput: {
23
+ title?: string | undefined;
24
+ };
24
25
  output: _backstage_frontend_plugin_api.ExtensionDataRef<{
25
26
  title: string;
26
27
  icon: _backstage_frontend_plugin_api.IconComponent;
@@ -38,19 +39,39 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
38
39
  name: undefined;
39
40
  config: {
40
41
  path: string | undefined;
42
+ title: string | undefined;
41
43
  };
42
44
  configInput: {
43
45
  path?: string | undefined;
46
+ title?: string | undefined;
44
47
  };
45
48
  output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
46
49
  optional: true;
50
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {
51
+ optional: true;
52
+ }> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
53
+ optional: true;
47
54
  }>;
48
- inputs: {};
55
+ inputs: {
56
+ pages: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
57
+ optional: true;
58
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.title", {
59
+ optional: true;
60
+ }> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
61
+ optional: true;
62
+ }>, {
63
+ singleton: false;
64
+ optional: false;
65
+ internal: false;
66
+ }>;
67
+ };
49
68
  params: {
50
- defaultPath?: [Error: "Use the 'path' param instead"] | undefined;
51
69
  path: string;
52
- loader: () => Promise<JSX.Element>;
53
- routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
70
+ title?: string;
71
+ icon?: _backstage_frontend_plugin_api.IconElement;
72
+ loader?: () => Promise<react.JSX.Element>;
73
+ routeRef?: _backstage_frontend_plugin_api.RouteRef;
74
+ noHeader?: boolean;
54
75
  };
55
76
  }>;
56
77
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"CostInsightsApi.esm.js","sources":["../../src/api/CostInsightsApi.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 Cost,\n Entity,\n Group,\n Project,\n Maybe,\n MetricData,\n} from '@backstage-community/plugin-cost-insights-common';\n\nimport { Alert } from '../types';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport type ProductInsightsOptions = {\n /**\n * The product from the cost-insights configuration in app-config.yaml\n */\n product: string;\n\n /**\n * The group id from getUserGroups or query parameters\n */\n group: string;\n\n /**\n * An ISO 8601 repeating interval string, such as R2/P3M/2020-09-01\n */\n intervals: string;\n\n /**\n * (optional) The project id from getGroupProjects or query parameters\n */\n project: Maybe<string>;\n};\n\n/** @public */\nexport type CostInsightsApi = {\n /**\n * Get the most current date for which billing data is complete, in YYYY-MM-DD format. This helps\n * define the intervals used in other API methods to avoid showing incomplete cost. The costs for\n * today, for example, will not be complete. This ideally comes from the cloud provider.\n */\n getLastCompleteBillingDate(): Promise<string>;\n\n /**\n * Get a list of groups the given user belongs to. These may be LDAP groups or similar\n * organizational groups. Cost Insights is designed to show costs based on group membership;\n * if a user has multiple groups, they are able to switch between groups to see costs for each.\n *\n * This method should be removed once the Backstage identity plugin provides the same concept.\n *\n * @param userId - The login id for the current user\n */\n getUserGroups(userId: string): Promise<Group[]>;\n\n /**\n * Get a list of cloud billing entities that belong to this group (projects in GCP, AWS has a\n * similar concept in billing accounts). These act as filters for the displayed costs, users can\n * choose whether they see all costs for a group, or those from a particular owned project.\n *\n * @param group - The group id from getUserGroups or query parameters\n */\n getGroupProjects(group: string): Promise<Project[]>;\n\n /**\n * Get daily cost aggregations for a given catalog entity and interval time frame.\n *\n * The return type includes an array of daily cost aggregations as well as statistics about the\n * change in cost over the intervals. Calculating these statistics requires us to bucket costs\n * into two or more time periods, hence a repeating interval format rather than just a start and\n * end date.\n *\n * The rate of change in this comparison allows teams to reason about their cost growth (or\n * reduction) and compare it to metrics important to the business.\n *\n * Note: implementing this is only required when using the `EntityCostInsightsContent` extension.\n *\n * @param catalogEntityRef - A reference to the catalog entity, as described in\n * https://backstage.io/docs/features/software-catalog/references\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getCatalogEntityDailyCost?(\n catalogEntityRef: string,\n intervals: string,\n ): Promise<Cost>;\n\n /**\n * Get daily cost aggregations for a given group and interval time frame.\n *\n * The return type includes an array of daily cost aggregations as well as statistics about the\n * change in cost over the intervals. Calculating these statistics requires us to bucket costs\n * into two or more time periods, hence a repeating interval format rather than just a start and\n * end date.\n *\n * The rate of change in this comparison allows teams to reason about their cost growth (or\n * reduction) and compare it to metrics important to the business.\n *\n * @param group - The group id from getUserGroups or query parameters\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getGroupDailyCost(group: string, intervals: string): Promise<Cost>;\n\n /**\n * Get daily cost aggregations for a given billing entity (project in GCP, AWS has a similar\n * concept in billing accounts) and interval time frame.\n *\n * The return type includes an array of daily cost aggregations as well as statistics about the\n * change in cost over the intervals. Calculating these statistics requires us to bucket costs\n * into two or more time periods, hence a repeating interval format rather than just a start and\n * end date.\n *\n * The rate of change in this comparison allows teams to reason about the project's cost growth\n * (or reduction) and compare it to metrics important to the business.\n *\n * @param project - The project id from getGroupProjects or query parameters\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getProjectDailyCost(project: string, intervals: string): Promise<Cost>;\n\n /**\n * Get aggregations for a particular metric and interval time frame. Teams\n * can see metrics important to their business in comparison to the growth\n * (or reduction) of a project or group's daily costs.\n *\n * @param metric - A metric from the cost-insights configuration in app-config.yaml.\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getDailyMetricData(metric: string, intervals: string): Promise<MetricData>;\n\n /**\n * Get cost aggregations for a particular cloud product and interval time frame. This includes\n * total cost for the product, as well as a breakdown of particular entities that incurred cost\n * in this product. The type of entity depends on the product - it may be deployed services,\n * storage buckets, managed database instances, etc.\n *\n * If project is supplied, this should only return product costs for the given billing entity\n * (project in GCP).\n *\n * The time period is supplied as a Duration rather than intervals, since this is always expected\n * to return data for two bucketed time period (e.g. month vs month, or quarter vs quarter).\n *\n * @param options - Options to use when fetching insights for a particular cloud product and\n * interval time frame.\n */\n getProductInsights(options: ProductInsightsOptions): Promise<Entity>;\n\n /**\n * Get current cost alerts for a given group. These show up as Action Items for the group on the\n * Cost Insights page. Alerts may include cost-saving recommendations, such as infrastructure\n * migrations, or cost-related warnings, such as an unexpected billing anomaly.\n */\n getAlerts(group: string): Promise<Alert[]>;\n};\n\n/** @public */\nexport const costInsightsApiRef = createApiRef<CostInsightsApi>({\n id: 'plugin.costinsights.service',\n});\n"],"names":[],"mappings":";;AA+KO,MAAM,qBAAqB,YAA8B,CAAA;AAAA,EAC9D,EAAI,EAAA;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"CostInsightsApi.esm.js","sources":["../../src/api/CostInsightsApi.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 Cost,\n Entity,\n Group,\n Project,\n Maybe,\n MetricData,\n} from '@backstage-community/plugin-cost-insights-common';\n\nimport { Alert } from '../types';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport type ProductInsightsOptions = {\n /**\n * The product from the cost-insights configuration in app-config.yaml\n */\n product: string;\n\n /**\n * The group id from getUserGroups or query parameters\n */\n group: string;\n\n /**\n * An ISO 8601 repeating interval string, such as R2/P3M/2020-09-01\n */\n intervals: string;\n\n /**\n * (optional) The project id from getGroupProjects or query parameters\n */\n project: Maybe<string>;\n};\n\n/** @public */\nexport type CostInsightsApi = {\n /**\n * Get the most current date for which billing data is complete, in YYYY-MM-DD format. This helps\n * define the intervals used in other API methods to avoid showing incomplete cost. The costs for\n * today, for example, will not be complete. This ideally comes from the cloud provider.\n */\n getLastCompleteBillingDate(): Promise<string>;\n\n /**\n * Get a list of groups the given user belongs to. These may be LDAP groups or similar\n * organizational groups. Cost Insights is designed to show costs based on group membership;\n * if a user has multiple groups, they are able to switch between groups to see costs for each.\n *\n * This method should be removed once the Backstage identity plugin provides the same concept.\n *\n * @param userId - The login id for the current user\n */\n getUserGroups(userId: string): Promise<Group[]>;\n\n /**\n * Get a list of cloud billing entities that belong to this group (projects in GCP, AWS has a\n * similar concept in billing accounts). These act as filters for the displayed costs, users can\n * choose whether they see all costs for a group, or those from a particular owned project.\n *\n * @param group - The group id from getUserGroups or query parameters\n */\n getGroupProjects(group: string): Promise<Project[]>;\n\n /**\n * Get daily cost aggregations for a given catalog entity and interval time frame.\n *\n * The return type includes an array of daily cost aggregations as well as statistics about the\n * change in cost over the intervals. Calculating these statistics requires us to bucket costs\n * into two or more time periods, hence a repeating interval format rather than just a start and\n * end date.\n *\n * The rate of change in this comparison allows teams to reason about their cost growth (or\n * reduction) and compare it to metrics important to the business.\n *\n * Note: implementing this is only required when using the `EntityCostInsightsContent` extension.\n *\n * @param catalogEntityRef - A reference to the catalog entity, as described in\n * https://backstage.io/docs/features/software-catalog/references\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getCatalogEntityDailyCost?(\n catalogEntityRef: string,\n intervals: string,\n ): Promise<Cost>;\n\n /**\n * Get daily cost aggregations for a given group and interval time frame.\n *\n * The return type includes an array of daily cost aggregations as well as statistics about the\n * change in cost over the intervals. Calculating these statistics requires us to bucket costs\n * into two or more time periods, hence a repeating interval format rather than just a start and\n * end date.\n *\n * The rate of change in this comparison allows teams to reason about their cost growth (or\n * reduction) and compare it to metrics important to the business.\n *\n * @param group - The group id from getUserGroups or query parameters\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getGroupDailyCost(group: string, intervals: string): Promise<Cost>;\n\n /**\n * Get daily cost aggregations for a given billing entity (project in GCP, AWS has a similar\n * concept in billing accounts) and interval time frame.\n *\n * The return type includes an array of daily cost aggregations as well as statistics about the\n * change in cost over the intervals. Calculating these statistics requires us to bucket costs\n * into two or more time periods, hence a repeating interval format rather than just a start and\n * end date.\n *\n * The rate of change in this comparison allows teams to reason about the project's cost growth\n * (or reduction) and compare it to metrics important to the business.\n *\n * @param project - The project id from getGroupProjects or query parameters\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getProjectDailyCost(project: string, intervals: string): Promise<Cost>;\n\n /**\n * Get aggregations for a particular metric and interval time frame. Teams\n * can see metrics important to their business in comparison to the growth\n * (or reduction) of a project or group's daily costs.\n *\n * @param metric - A metric from the cost-insights configuration in app-config.yaml.\n * @param intervals - An ISO 8601 repeating interval string, such as R2/P30D/2020-09-01\n * https://en.wikipedia.org/wiki/ISO_8601#Repeating_intervals\n */\n getDailyMetricData(metric: string, intervals: string): Promise<MetricData>;\n\n /**\n * Get cost aggregations for a particular cloud product and interval time frame. This includes\n * total cost for the product, as well as a breakdown of particular entities that incurred cost\n * in this product. The type of entity depends on the product - it may be deployed services,\n * storage buckets, managed database instances, etc.\n *\n * If project is supplied, this should only return product costs for the given billing entity\n * (project in GCP).\n *\n * The time period is supplied as a Duration rather than intervals, since this is always expected\n * to return data for two bucketed time period (e.g. month vs month, or quarter vs quarter).\n *\n * @param options - Options to use when fetching insights for a particular cloud product and\n * interval time frame.\n */\n getProductInsights(options: ProductInsightsOptions): Promise<Entity>;\n\n /**\n * Get current cost alerts for a given group. These show up as Action Items for the group on the\n * Cost Insights page. Alerts may include cost-saving recommendations, such as infrastructure\n * migrations, or cost-related warnings, such as an unexpected billing anomaly.\n */\n getAlerts(group: string): Promise<Alert[]>;\n};\n\n/** @public */\nexport const costInsightsApiRef = createApiRef<CostInsightsApi>({\n id: 'plugin.costinsights.service',\n});\n"],"names":[],"mappings":";;AA+KO,MAAM,qBAAqB,YAAA,CAA8B;AAAA,EAC9D,EAAA,EAAI;AACN,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionItemCard.esm.js","sources":["../../../src/components/ActionItems/ActionItemCard.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 { MouseEventHandler } from 'react';\nimport classnames from 'classnames';\nimport Card from '@material-ui/core/Card';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport { useScroll } from '../../hooks';\nimport { Alert } from '../../types';\nimport { useActionItemCardStyles as useStyles } from '../../utils/styles';\n\ntype ActionItemCardProps = {\n alert: Alert;\n number?: number;\n avatar?: JSX.Element;\n disableScroll?: boolean;\n};\n\nexport const ActionItemCard = ({\n alert,\n avatar,\n number,\n disableScroll = false,\n}: ActionItemCardProps) => {\n const classes = useStyles();\n const rootClasses = classnames(classes.root, {\n [classes.activeRoot]: !disableScroll,\n });\n const [, setScroll] = useScroll();\n\n const onActionItemClick: MouseEventHandler = () => {\n if (!disableScroll && number) {\n setScroll(`alert-${number}`);\n }\n };\n\n return (\n <Card className={classes.card} raised={false} onClick={onActionItemClick}>\n <CardHeader\n classes={{\n root: rootClasses,\n action: classes.action,\n title: classes.title,\n }}\n title={alert.title}\n subheader={alert.subtitle}\n avatar={avatar}\n />\n </Card>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;AA8BO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,KAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAgB,GAAA;AAClB,CAA2B,KAAA;AACzB,EAAA,MAAM,UAAUA,uBAAU,EAAA;AAC1B,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,OAAA,CAAQ,IAAM,EAAA;AAAA,IAC3C,CAAC,OAAA,CAAQ,UAAU,GAAG,CAAC;AAAA,GACxB,CAAA;AACD,EAAA,MAAM,GAAG,SAAS,CAAA,GAAI,SAAU,EAAA;AAEhC,EAAA,MAAM,oBAAuC,MAAM;AACjD,IAAI,IAAA,CAAC,iBAAiB,MAAQ,EAAA;AAC5B,MAAU,SAAA,CAAA,CAAA,MAAA,EAAS,MAAM,CAAE,CAAA,CAAA;AAAA;AAC7B,GACF;AAEA,EACE,uBAAA,GAAA,CAAC,QAAK,SAAW,EAAA,OAAA,CAAQ,MAAM,MAAQ,EAAA,KAAA,EAAO,SAAS,iBACrD,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA;AAAA,QACP,IAAM,EAAA,WAAA;AAAA,QACN,QAAQ,OAAQ,CAAA,MAAA;AAAA,QAChB,OAAO,OAAQ,CAAA;AAAA,OACjB;AAAA,MACA,OAAO,KAAM,CAAA,KAAA;AAAA,MACb,WAAW,KAAM,CAAA,QAAA;AAAA,MACjB;AAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ActionItemCard.esm.js","sources":["../../../src/components/ActionItems/ActionItemCard.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 { MouseEventHandler } from 'react';\nimport classnames from 'classnames';\nimport Card from '@material-ui/core/Card';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport { useScroll } from '../../hooks';\nimport { Alert } from '../../types';\nimport { useActionItemCardStyles as useStyles } from '../../utils/styles';\n\ntype ActionItemCardProps = {\n alert: Alert;\n number?: number;\n avatar?: JSX.Element;\n disableScroll?: boolean;\n};\n\nexport const ActionItemCard = ({\n alert,\n avatar,\n number,\n disableScroll = false,\n}: ActionItemCardProps) => {\n const classes = useStyles();\n const rootClasses = classnames(classes.root, {\n [classes.activeRoot]: !disableScroll,\n });\n const [, setScroll] = useScroll();\n\n const onActionItemClick: MouseEventHandler = () => {\n if (!disableScroll && number) {\n setScroll(`alert-${number}`);\n }\n };\n\n return (\n <Card className={classes.card} raised={false} onClick={onActionItemClick}>\n <CardHeader\n classes={{\n root: rootClasses,\n action: classes.action,\n title: classes.title,\n }}\n title={alert.title}\n subheader={alert.subtitle}\n avatar={avatar}\n />\n </Card>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;AA8BO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,KAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,aAAA,GAAgB;AAClB,CAAA,KAA2B;AACzB,EAAA,MAAM,UAAUA,uBAAA,EAAU;AAC1B,EAAA,MAAM,WAAA,GAAc,UAAA,CAAW,OAAA,CAAQ,IAAA,EAAM;AAAA,IAC3C,CAAC,OAAA,CAAQ,UAAU,GAAG,CAAC;AAAA,GACxB,CAAA;AACD,EAAA,MAAM,GAAG,SAAS,CAAA,GAAI,SAAA,EAAU;AAEhC,EAAA,MAAM,oBAAuC,MAAM;AACjD,IAAA,IAAI,CAAC,iBAAiB,MAAA,EAAQ;AAC5B,MAAA,SAAA,CAAU,CAAA,MAAA,EAAS,MAAM,CAAA,CAAE,CAAA;AAAA,IAC7B;AAAA,EACF,CAAA;AAEA,EAAA,uBACE,GAAA,CAAC,QAAK,SAAA,EAAW,OAAA,CAAQ,MAAM,MAAA,EAAQ,KAAA,EAAO,SAAS,iBAAA,EACrD,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,WAAA;AAAA,QACN,QAAQ,OAAA,CAAQ,MAAA;AAAA,QAChB,OAAO,OAAA,CAAQ;AAAA,OACjB;AAAA,MACA,OAAO,KAAA,CAAM,KAAA;AAAA,MACb,WAAW,KAAA,CAAM,QAAA;AAAA,MACjB;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionItems.esm.js","sources":["../../../src/components/ActionItems/ActionItems.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 { Fragment, MouseEventHandler } from 'react';\nimport Avatar from '@material-ui/core/Avatar';\nimport { IconButtonProps } from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Badge from '@material-ui/core/Badge';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Divider from '@material-ui/core/Divider';\nimport { default as SnoozeIcon } from '@material-ui/icons/AccessTime';\nimport { default as AcceptIcon } from '@material-ui/icons/Check';\nimport { default as DismissIcon } from '@material-ui/icons/Delete';\nimport { ActionItemCard } from './ActionItemCard';\nimport { Alert, AlertStatus } from '../../types';\nimport { useScroll, ScrollType } from '../../hooks';\nimport { useActionItemCardStyles as useStyles } from '../../utils/styles';\n\ntype AlertStatusButtonProps = {\n title: string;\n amount: number;\n icon: JSX.Element;\n onClick: MouseEventHandler;\n} & IconButtonProps;\n\nconst AlertStatusButton = ({\n title,\n amount,\n icon,\n onClick,\n ...buttonProps\n}: AlertStatusButtonProps) => (\n <Tooltip title={title}>\n <IconButton\n onClick={onClick}\n role=\"button\"\n aria-hidden={false}\n {...buttonProps}\n >\n <Badge badgeContent={amount}>{icon}</Badge>\n </IconButton>\n </Tooltip>\n);\n\ntype ActionItemsProps = {\n active: Alert[];\n snoozed: Alert[];\n accepted: Alert[];\n dismissed: Alert[];\n};\n\nexport const ActionItems = ({\n active,\n snoozed,\n accepted,\n dismissed,\n}: ActionItemsProps) => {\n const classes = useStyles();\n const [, setScroll] = useScroll();\n\n const isSnoozedButtonDisplayed = !!snoozed.length;\n const isAcceptedButtonDisplayed = !!accepted.length;\n const isDismissedButtonDisplayed = !!dismissed.length;\n const isStatusButtonGroupDisplayed = !!active.length;\n\n const onStatusButtonClick: MouseEventHandler = () =>\n setScroll(ScrollType.AlertSummary);\n\n return (\n <>\n <Paper>\n {active.map((alert, index) => (\n <Fragment key={`alert-${index}`}>\n <ActionItemCard\n alert={alert}\n number={index + 1}\n avatar={<Avatar className={classes.avatar}>{index + 1}</Avatar>}\n />\n {index < active.length - 1 && <Divider />}\n </Fragment>\n ))}\n </Paper>\n {isStatusButtonGroupDisplayed && (\n <Box display=\"flex\" justifyContent=\"flex-end\" mt={2}>\n {isAcceptedButtonDisplayed && (\n <AlertStatusButton\n title=\"Accepted\"\n aria-label={AlertStatus.Accepted}\n icon={<AcceptIcon />}\n amount={accepted.length}\n onClick={onStatusButtonClick}\n />\n )}\n {isSnoozedButtonDisplayed && (\n <AlertStatusButton\n title=\"Snoozed\"\n aria-label={AlertStatus.Snoozed}\n amount={snoozed.length}\n icon={<SnoozeIcon />}\n onClick={onStatusButtonClick}\n />\n )}\n {isDismissedButtonDisplayed && (\n <AlertStatusButton\n title=\"Dismissed\"\n aria-label={AlertStatus.Dismissed}\n icon={<DismissIcon />}\n amount={dismissed.length}\n onClick={onStatusButtonClick}\n />\n )}\n </Box>\n )}\n </>\n );\n};\n"],"names":["useStyles","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,oBAAoB,CAAC;AAAA,EACzB,KAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CACE,qBAAA,GAAA,CAAC,WAAQ,KACP,EAAA,QAAA,kBAAA,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAA;AAAA,IACA,IAAK,EAAA,QAAA;AAAA,IACL,aAAa,EAAA,KAAA;AAAA,I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,CACD,CACH,EAAA,CAAA;AAAA,IACC,4BAAA,yBACE,GAAI,EAAA,EAAA,OAAA,EAAQ,QAAO,cAAe,EAAA,UAAA,EAAW,IAAI,CAC/C,EAAA,QAAA,EAAA;AAAA,MACC,yBAAA,oBAAA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,UAAA;AAAA,UACN,cAAY,WAAY,CAAA,QAAA;AAAA,UACxB,IAAA,sBAAO,UAAW,EAAA,EAAA,CAAA;AAAA,UAClB,QAAQ,QAAS,CAAA,MAAA;AAAA,UACjB,OAAS,EAAA;AAAA;AAAA,OACX;AAAA,MAED,wBACC,oBAAA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,SAAA;AAAA,UACN,cAAY,WAAY,CAAA,OAAA;AAAA,UACxB,QAAQ,OAAQ,CAAA,MAAA;AAAA,UAChB,IAAA,sBAAO,UAAW,EAAA,EAAA,CAAA;AAAA,UAClB,OAAS,EAAA;AAAA;AAAA,OACX;AAAA,MAED,0BACC,oBAAA,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,WAAA;AAAA,UACN,cAAY,WAAY,CAAA,SAAA;AAAA,UACxB,IAAA,sBAAO,WAAY,EAAA,EAAA,CAAA;AAAA,UACnB,QAAQ,SAAU,CAAA,MAAA;AAAA,UAClB,OAAS,EAAA;AAAA;AAAA;AACX,KAEJ,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ActionItems.esm.js","sources":["../../../src/components/ActionItems/ActionItems.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 { Fragment, MouseEventHandler } from 'react';\nimport Avatar from '@material-ui/core/Avatar';\nimport { IconButtonProps } from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport Badge from '@material-ui/core/Badge';\nimport Box from '@material-ui/core/Box';\nimport Paper from '@material-ui/core/Paper';\nimport Divider from '@material-ui/core/Divider';\nimport { default as SnoozeIcon } from '@material-ui/icons/AccessTime';\nimport { default as AcceptIcon } from '@material-ui/icons/Check';\nimport { default as DismissIcon } from '@material-ui/icons/Delete';\nimport { ActionItemCard } from './ActionItemCard';\nimport { Alert, AlertStatus } from '../../types';\nimport { useScroll, ScrollType } from '../../hooks';\nimport { useActionItemCardStyles as useStyles } from '../../utils/styles';\n\ntype AlertStatusButtonProps = {\n title: string;\n amount: number;\n icon: JSX.Element;\n onClick: MouseEventHandler;\n} & IconButtonProps;\n\nconst AlertStatusButton = ({\n title,\n amount,\n icon,\n onClick,\n ...buttonProps\n}: AlertStatusButtonProps) => (\n <Tooltip title={title}>\n <IconButton\n onClick={onClick}\n role=\"button\"\n aria-hidden={false}\n {...buttonProps}\n >\n <Badge badgeContent={amount}>{icon}</Badge>\n </IconButton>\n </Tooltip>\n);\n\ntype ActionItemsProps = {\n active: Alert[];\n snoozed: Alert[];\n accepted: Alert[];\n dismissed: Alert[];\n};\n\nexport const ActionItems = ({\n active,\n snoozed,\n accepted,\n dismissed,\n}: ActionItemsProps) => {\n const classes = useStyles();\n const [, setScroll] = useScroll();\n\n const isSnoozedButtonDisplayed = !!snoozed.length;\n const isAcceptedButtonDisplayed = !!accepted.length;\n const isDismissedButtonDisplayed = !!dismissed.length;\n const isStatusButtonGroupDisplayed = !!active.length;\n\n const onStatusButtonClick: MouseEventHandler = () =>\n setScroll(ScrollType.AlertSummary);\n\n return (\n <>\n <Paper>\n {active.map((alert, index) => (\n <Fragment key={`alert-${index}`}>\n <ActionItemCard\n alert={alert}\n number={index + 1}\n avatar={<Avatar className={classes.avatar}>{index + 1}</Avatar>}\n />\n {index < active.length - 1 && <Divider />}\n </Fragment>\n ))}\n </Paper>\n {isStatusButtonGroupDisplayed && (\n <Box display=\"flex\" justifyContent=\"flex-end\" mt={2}>\n {isAcceptedButtonDisplayed && (\n <AlertStatusButton\n title=\"Accepted\"\n aria-label={AlertStatus.Accepted}\n icon={<AcceptIcon />}\n amount={accepted.length}\n onClick={onStatusButtonClick}\n />\n )}\n {isSnoozedButtonDisplayed && (\n <AlertStatusButton\n title=\"Snoozed\"\n aria-label={AlertStatus.Snoozed}\n amount={snoozed.length}\n icon={<SnoozeIcon />}\n onClick={onStatusButtonClick}\n />\n )}\n {isDismissedButtonDisplayed && (\n <AlertStatusButton\n title=\"Dismissed\"\n aria-label={AlertStatus.Dismissed}\n icon={<DismissIcon />}\n amount={dismissed.length}\n onClick={onStatusButtonClick}\n />\n )}\n </Box>\n )}\n </>\n );\n};\n"],"names":["useStyles","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,oBAAoB,CAAC;AAAA,EACzB,KAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA,CAAC,WAAQ,KAAA,EACP,QAAA,kBAAA,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAA;AAAA,IACA,IAAA,EAAK,QAAA;AAAA,IACL,aAAA,EAAa,KAAA;AAAA,IACZ,GAAG,WAAA;AAAA,IAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAM,YAAA,EAAc,MAAA,EAAS,QAAA,EAAA,IAAA,EAAK;AAAA;AACrC,CAAA,EACF,CAAA;AAUK,MAAM,cAAc,CAAC;AAAA,EAC1B,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EAC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UACN,cAAY,WAAA,CAAY,QAAA;AAAA,UACxB,IAAA,sBAAO,UAAA,EAAA,EAAW,CAAA;AAAA,UAClB,QAAQ,QAAA,CAAS,MAAA;AAAA,UACjB,OAAA,EAAS;AAAA;AAAA,OACX;AAAA,MAED,wBAAA,oBACC,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAM,SAAA;AAAA,UACN,cAAY,WAAA,CAAY,OAAA;AAAA,UACxB,QAAQ,OAAA,CAAQ,MAAA;AAAA,UAChB,IAAA,sBAAO,UAAA,EAAA,EAAW,CAAA;AAAA,UAClB,OAAA,EAAS;AAAA;AAAA,OACX;AAAA,MAED,0BAAA,oBACC,GAAA;AAAA,QAAC,iBAAA;AAAA,QAAA;AAAA,UACC,KAAA,EAAM,WAAA;AAAA,UACN,cAAY,WAAA,CAAY,SAAA;AAAA,UACxB,IAAA,sBAAO,WAAA,EAAA,EAAY,CAAA;AAAA,UACnB,QAAQ,SAAA,CAAU,MAAA;AAAA,UAClB,OAAA,EAAS;AAAA;AAAA;AACX,KAAA,EAEJ;AAAA,GAAA,EAEJ,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertDialog.esm.js","sources":["../../../src/components/AlertInsights/AlertDialog.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 { useEffect, useRef, useState } from 'react';\nimport { capitalize } from '@material-ui/core/utils';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Divider from '@material-ui/core/Divider';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport IconButton from '@material-ui/core/IconButton';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Typography from '@material-ui/core/Typography';\nimport { default as CloseIcon } from '@material-ui/icons/Close';\nimport { useAlertDialogStyles as useStyles } from '../../utils/styles';\nimport { Alert, AlertStatus } from '../../types';\nimport { Maybe } from '@backstage-community/plugin-cost-insights-common';\nimport { choose, formOf } from '../../utils/alerts';\n\nconst DEFAULT_FORM_ID = 'alert-form';\n\ntype AlertDialogProps = {\n open: boolean;\n group: string;\n alert: Maybe<Alert>;\n status: Maybe<AlertStatus>;\n onClose: () => void;\n onSubmit: (data: any) => void;\n};\n\nexport const AlertDialog = ({\n open,\n group,\n alert,\n status,\n onClose,\n onSubmit,\n}: AlertDialogProps) => {\n const classes = useStyles();\n const [isSubmitDisabled, setSubmitDisabled] = useState(true);\n const formRef = useRef<Maybe<HTMLFormElement>>(null);\n\n useEffect(() => {\n setSubmitDisabled(open);\n }, [open]);\n\n function disableSubmit(isDisabled: boolean) {\n setSubmitDisabled(isDisabled);\n }\n\n function onDialogClose() {\n onClose();\n setSubmitDisabled(true);\n }\n\n const [action, actioned] = choose(\n status,\n [\n ['snooze', 'snoozed'],\n ['accept', 'accepted'],\n ['dismiss', 'dismissed'],\n ],\n ['', ''],\n );\n\n const TransitionProps = {\n mountOnEnter: true,\n unmountOnExit: true,\n onEntered() {\n if (formRef.current) {\n formRef.current.id = DEFAULT_FORM_ID;\n }\n },\n };\n\n const Form = formOf(alert, status);\n\n return (\n <Dialog\n open={open}\n onClose={onDialogClose}\n scroll=\"body\"\n maxWidth=\"lg\"\n TransitionProps={TransitionProps}\n >\n <Box display=\"flex\" justifyContent=\"flex-end\">\n <IconButton\n className={classes.icon}\n disableRipple\n aria-label=\"Close\"\n onClick={onDialogClose}\n >\n <CloseIcon />\n </IconButton>\n </Box>\n <DialogContent className={classes.content}>\n <Box mb={1.5}>\n <Typography variant=\"h5\">\n <b>{capitalize(action)} this action item?</b>\n </Typography>\n <Typography variant=\"h6\" color=\"textSecondary\">\n <b>\n This action item will be {actioned} for all of {group}.\n </b>\n </Typography>\n </Box>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n bgcolor=\"alertBackground\"\n p={2}\n mb={1.5}\n borderRadius={4}\n >\n <Typography>\n <b>{alert?.title}</b>\n </Typography>\n <Typography color=\"textSecondary\">{alert?.subtitle}</Typography>\n </Box>\n {Form && (\n <Form\n ref={formRef}\n alert={alert}\n onSubmit={onSubmit}\n disableSubmit={disableSubmit}\n />\n )}\n </DialogContent>\n <Divider />\n <DialogActions className={classes.actions} disableSpacing>\n {Form ? (\n <Button\n type=\"submit\"\n color=\"primary\"\n variant=\"contained\"\n aria-label={action}\n form={DEFAULT_FORM_ID}\n disabled={isSubmitDisabled}\n >\n {capitalize(action)}\n </Button>\n ) : (\n <Button\n type=\"button\"\n color=\"primary\"\n variant=\"contained\"\n aria-label={action}\n onClick={() => onSubmit(null)}\n >\n {capitalize(action)}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;AAgCA,MAAM,eAAkB,GAAA,YAAA;AAWjB,MAAM,cAAc,CAAC;AAAA,EAC1B,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAwB,KAAA;AACtB,EAAA,MAAM,UAAUA,oBAAU,EAAA;AAC1B,EAAA,MAAM,CAAC,gBAAA,EAAkB,iBAAiB,CAAA,GAAI,SAAS,IAAI,CAAA;AAC3D,EAAM,MAAA,OAAA,GAAU,OAA+B,IAAI,CAAA;AAEnD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,iBAAA,CAAkB,IAAI,CAAA;AAAA,GACxB,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,SAAS,cAAc,UAAqB,EAAA;AAC1C,IAAA,iBAAA,CAAkB,UAAU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;AAAA,4BACC,OAAQ,EAAA,EAAA,CAAA;AAAA,4BACR,aAAc,EAAA,EAAA,SAAA,EAAW,QAAQ,OAAS,EAAA,cAAA,EAAc,MACtD,QACC,EAAA,IAAA,mBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAK,EAAA,QAAA;AAAA,YACL,KAAM,EAAA,SAAA;AAAA,YACN,OAAQ,EAAA,WAAA;AAAA,YACR,YAAY,EAAA,MAAA;AAAA,YACZ,IAAM,EAAA,eAAA;AAAA,YACN,QAAU,EAAA,gBAAA;AAAA,YAET,qBAAW,MAAM;AAAA;AAAA,SAGpB,mBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAK,EAAA,QAAA;AAAA,YACL,KAAM,EAAA,SAAA;AAAA,YACN,OAAQ,EAAA,WAAA;AAAA,YACR,YAAY,EAAA,MAAA;AAAA,YACZ,OAAA,EAAS,MAAM,QAAA,CAAS,IAAI,CAAA;AAAA,YAE3B,qBAAW,MAAM;AAAA;AAAA,SAGxB,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertDialog.esm.js","sources":["../../../src/components/AlertInsights/AlertDialog.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 { useEffect, useRef, useState } from 'react';\nimport { capitalize } from '@material-ui/core/utils';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Divider from '@material-ui/core/Divider';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport IconButton from '@material-ui/core/IconButton';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Typography from '@material-ui/core/Typography';\nimport { default as CloseIcon } from '@material-ui/icons/Close';\nimport { useAlertDialogStyles as useStyles } from '../../utils/styles';\nimport { Alert, AlertStatus } from '../../types';\nimport { Maybe } from '@backstage-community/plugin-cost-insights-common';\nimport { choose, formOf } from '../../utils/alerts';\n\nconst DEFAULT_FORM_ID = 'alert-form';\n\ntype AlertDialogProps = {\n open: boolean;\n group: string;\n alert: Maybe<Alert>;\n status: Maybe<AlertStatus>;\n onClose: () => void;\n onSubmit: (data: any) => void;\n};\n\nexport const AlertDialog = ({\n open,\n group,\n alert,\n status,\n onClose,\n onSubmit,\n}: AlertDialogProps) => {\n const classes = useStyles();\n const [isSubmitDisabled, setSubmitDisabled] = useState(true);\n const formRef = useRef<Maybe<HTMLFormElement>>(null);\n\n useEffect(() => {\n setSubmitDisabled(open);\n }, [open]);\n\n function disableSubmit(isDisabled: boolean) {\n setSubmitDisabled(isDisabled);\n }\n\n function onDialogClose() {\n onClose();\n setSubmitDisabled(true);\n }\n\n const [action, actioned] = choose(\n status,\n [\n ['snooze', 'snoozed'],\n ['accept', 'accepted'],\n ['dismiss', 'dismissed'],\n ],\n ['', ''],\n );\n\n const TransitionProps = {\n mountOnEnter: true,\n unmountOnExit: true,\n onEntered() {\n if (formRef.current) {\n formRef.current.id = DEFAULT_FORM_ID;\n }\n },\n };\n\n const Form = formOf(alert, status);\n\n return (\n <Dialog\n open={open}\n onClose={onDialogClose}\n scroll=\"body\"\n maxWidth=\"lg\"\n TransitionProps={TransitionProps}\n >\n <Box display=\"flex\" justifyContent=\"flex-end\">\n <IconButton\n className={classes.icon}\n disableRipple\n aria-label=\"Close\"\n onClick={onDialogClose}\n >\n <CloseIcon />\n </IconButton>\n </Box>\n <DialogContent className={classes.content}>\n <Box mb={1.5}>\n <Typography variant=\"h5\">\n <b>{capitalize(action)} this action item?</b>\n </Typography>\n <Typography variant=\"h6\" color=\"textSecondary\">\n <b>\n This action item will be {actioned} for all of {group}.\n </b>\n </Typography>\n </Box>\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n bgcolor=\"alertBackground\"\n p={2}\n mb={1.5}\n borderRadius={4}\n >\n <Typography>\n <b>{alert?.title}</b>\n </Typography>\n <Typography color=\"textSecondary\">{alert?.subtitle}</Typography>\n </Box>\n {Form && (\n <Form\n ref={formRef}\n alert={alert}\n onSubmit={onSubmit}\n disableSubmit={disableSubmit}\n />\n )}\n </DialogContent>\n <Divider />\n <DialogActions className={classes.actions} disableSpacing>\n {Form ? (\n <Button\n type=\"submit\"\n color=\"primary\"\n variant=\"contained\"\n aria-label={action}\n form={DEFAULT_FORM_ID}\n disabled={isSubmitDisabled}\n >\n {capitalize(action)}\n </Button>\n ) : (\n <Button\n type=\"button\"\n color=\"primary\"\n variant=\"contained\"\n aria-label={action}\n onClick={() => onSubmit(null)}\n >\n {capitalize(action)}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;AAgCA,MAAM,eAAA,GAAkB,YAAA;AAWjB,MAAM,cAAc,CAAC;AAAA,EAC1B,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,KAAwB;AACtB,EAAA,MAAM,UAAUA,oBAAA,EAAU;AAC1B,EAAA,MAAM,CAAC,gBAAA,EAAkB,iBAAiB,CAAA,GAAI,SAAS,IAAI,CAAA;AAC3D,EAAA,MAAM,OAAA,GAAU,OAA+B,IAAI,CAAA;AAEnD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,iBAAA,CAAkB,IAAI,CAAA;AAAA,EACxB,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,SAAS,cAAc,UAAA,EAAqB;AAC1C,IAAA,iBAAA,CAAkB,UAAU,CAAA;AAAA,EAC9B;A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AAAA,4BACC,OAAA,EAAA,EAAQ,CAAA;AAAA,4BACR,aAAA,EAAA,EAAc,SAAA,EAAW,QAAQ,OAAA,EAAS,cAAA,EAAc,MACtD,QAAA,EAAA,IAAA,mBACC,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YACL,KAAA,EAAM,SAAA;AAAA,YACN,OAAA,EAAQ,WAAA;AAAA,YACR,YAAA,EAAY,MAAA;AAAA,YACZ,IAAA,EAAM,eAAA;AAAA,YACN,QAAA,EAAU,gBAAA;AAAA,YAET,qBAAW,MAAM;AAAA;AAAA,SACpB,mBAEA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YACL,KAAA,EAAM,SAAA;AAAA,YACN,OAAA,EAAQ,WAAA;AAAA,YACR,YAAA,EAAY,MAAA;AAAA,YACZ,OAAA,EAAS,MAAM,QAAA,CAAS,IAAI,CAAA;AAAA,YAE3B,qBAAW,MAAM;AAAA;AAAA,SACpB,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertInsights.esm.js","sources":["../../../src/components/AlertInsights/AlertInsights.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 { useEffect, useState } from 'react';\nimport pluralize from 'pluralize';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport { default as MuiAlert } from '@material-ui/lab/Alert';\nimport { AlertDialog } from './AlertDialog';\nimport { AlertStatusSummary } from './AlertStatusSummary';\nimport { AlertStatusSummaryButton } from './AlertStatusSummaryButton';\nimport { AlertInsightsHeader } from './AlertInsightsHeader';\nimport { AlertInsightsSection } from './AlertInsightsSection';\nimport {\n useScroll,\n useLoading,\n ScrollType,\n MapLoadingToProps,\n} from '../../hooks';\nimport { DefaultLoadingAction } from '../../utils/loading';\nimport { Alert, AlertOptions, AlertStatus } from '../../types';\nimport { Maybe } from '@backstage-community/plugin-cost-insights-common';\nimport {\n isStatusSnoozed,\n isStatusAccepted,\n isStatusDismissed,\n sumOfAllAlerts,\n} from '../../utils/alerts';\nimport { ScrollAnchor } from '../../utils/scroll';\n\ntype MapLoadingtoAlerts = (isLoading: boolean) => void;\n\nconst mapLoadingToAlerts: MapLoadingToProps<MapLoadingtoAlerts> =\n ({ dispatch }) =>\n (isLoading: boolean) =>\n dispatch({ [DefaultLoadingAction.CostInsightsAlerts]: isLoading });\n\ntype AlertInsightsProps = {\n group: string;\n active: Alert[];\n snoozed: Alert[];\n accepted: Alert[];\n dismissed: Alert[];\n onChange: (alerts: Alert[]) => void;\n};\n\nexport const AlertInsights = ({\n group,\n active,\n snoozed,\n accepted,\n dismissed,\n onChange,\n}: AlertInsightsProps) => {\n const [scroll] = useScroll();\n const [alert, setAlert] = useState<Maybe<Alert>>(null);\n const dispatchLoadingAlerts = useLoading(mapLoadingToAlerts);\n const [status, setStatus] = useState<Maybe<AlertStatus>>(null);\n // Allow users to pass null values for data.\n const [data, setData] = useState<Maybe<any>>(undefined);\n const [error, setError] = useState<Maybe<Error>>(null);\n const [isDialogOpen, setDialogOpen] = useState(false);\n const [isSummaryOpen, setSummaryOpen] = useState(false);\n const [isSnackbarOpen, setSnackbarOpen] = useState(false);\n\n useEffect(() => {\n async function callAlertHook(\n options: AlertOptions,\n callback: (options: AlertOptions) => Promise<Alert[]>,\n ) {\n setAlert(null);\n setStatus(null);\n setData(undefined);\n setDialogOpen(false);\n dispatchLoadingAlerts(true);\n try {\n const alerts: Alert[] = await callback(options);\n onChange(alerts);\n } catch (e) {\n setError(e);\n } finally {\n dispatchLoadingAlerts(false);\n }\n }\n\n const options: AlertOptions = { data, group };\n const onSnoozed = alert?.onSnoozed?.bind(alert);\n const onAccepted = alert?.onAccepted?.bind(alert);\n const onDismissed = alert?.onDismissed?.bind(alert);\n\n if (data !== undefined) {\n if (isStatusSnoozed(status) && onSnoozed) {\n callAlertHook(options, onSnoozed);\n } else if (isStatusAccepted(status) && onAccepted) {\n callAlertHook(options, onAccepted);\n } else if (isStatusDismissed(status) && onDismissed) {\n callAlertHook(options, onDismissed);\n }\n }\n }, [group, data, alert, status, onChange, dispatchLoadingAlerts]);\n\n useEffect(() => {\n if (scroll === ScrollType.AlertSummary) {\n setSummaryOpen(true);\n }\n }, [scroll]);\n\n useEffect(() => {\n setDialogOpen(!!status);\n }, [status]);\n\n useEffect(() => {\n setSnackbarOpen(!!error);\n }, [error]);\n\n function onSnooze(alertToSnooze: Alert) {\n setAlert(alertToSnooze);\n setStatus(AlertStatus.Snoozed);\n }\n\n function onAccept(alertToAccept: Alert) {\n setAlert(alertToAccept);\n setStatus(AlertStatus.Accepted);\n }\n\n function onDismiss(alertToDismiss: Alert) {\n setAlert(alertToDismiss);\n setStatus(AlertStatus.Dismissed);\n }\n\n function onSnackbarClose() {\n setError(null);\n }\n\n function onDialogClose() {\n setAlert(null);\n setStatus(null);\n }\n\n function onDialogFormSubmit(formData: any) {\n setData(formData);\n }\n\n function onSummaryButtonClick() {\n setSummaryOpen(prevOpen => !prevOpen);\n }\n\n const total = [accepted, snoozed, dismissed].reduce(sumOfAllAlerts, 0);\n\n const isAlertStatusSummaryDisplayed = !!total;\n const isAlertInsightSectionDisplayed = !!active.length;\n\n return (\n <Grid container direction=\"column\" spacing={2}>\n <Grid item>\n <AlertInsightsHeader\n title=\"Your team's action items\"\n subtitle={\n isAlertInsightSectionDisplayed\n ? 'This section outlines suggested action items your team can address to improve cloud costs.'\n : \"All of your team's action items are hidden. Maybe it's time to give them another look?\"\n }\n />\n </Grid>\n {isAlertInsightSectionDisplayed && (\n <Grid item container direction=\"column\" spacing={4}>\n {active.map((activeAlert, index) => (\n <Grid item key={`alert-insights-section-${index}`}>\n <AlertInsightsSection\n alert={activeAlert}\n number={index + 1}\n onSnooze={onSnooze}\n onAccept={onAccept}\n onDismiss={onDismiss}\n />\n </Grid>\n ))}\n </Grid>\n )}\n {isAlertStatusSummaryDisplayed && (\n <Grid item>\n <Box position=\"relative\" display=\"flex\" justifyContent=\"flex-end\">\n <ScrollAnchor id={ScrollType.AlertSummary} />\n <AlertStatusSummaryButton onClick={onSummaryButtonClick}>\n {pluralize('Hidden Action Item', total)}\n </AlertStatusSummaryButton>\n </Box>\n <AlertStatusSummary\n open={isSummaryOpen}\n snoozed={snoozed}\n accepted={accepted}\n dismissed={dismissed}\n />\n </Grid>\n )}\n <AlertDialog\n group={group}\n open={isDialogOpen}\n alert={alert}\n status={status}\n onClose={onDialogClose}\n onSubmit={onDialogFormSubmit}\n />\n <Snackbar\n open={isSnackbarOpen}\n autoHideDuration={6_000}\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n onClose={onSnackbarClose}\n >\n <MuiAlert onClose={onSnackbarClose} severity=\"error\">\n {error?.message}\n </MuiAlert>\n </Snackbar>\n </Grid>\n );\n};\n"],"names":["options","MuiAlert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAM,kBACJ,GAAA,CAAC,EAAE,QAAA,OACH,CAAC,SAAA,KACC,QAAS,CAAA,EAAE,CAAC,oBAAA,CAAqB,kBAAkB,GAAG,WAAW,CAAA;AAW9D,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAA0B,KAAA;AACxB,EAAM,MAAA,CAAC,MAAM,CAAA,GAAI,SAAU,EAAA;AAC3B,EAA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AU,EAAA,KAAA,EAAO,YAAY,QAAS,EAAA;AAAA,QACtD,OAAS,EAAA,eAAA;AAAA,QAET,8BAACC,KAAS,EAAA,EAAA,OAAA,EAAS,iBAAiB,QAAS,EAAA,OAAA,EAC1C,iBAAO,OACV,EAAA;AAAA;AAAA;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertInsights.esm.js","sources":["../../../src/components/AlertInsights/AlertInsights.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 { useEffect, useState } from 'react';\nimport pluralize from 'pluralize';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport Snackbar from '@material-ui/core/Snackbar';\nimport { default as MuiAlert } from '@material-ui/lab/Alert';\nimport { AlertDialog } from './AlertDialog';\nimport { AlertStatusSummary } from './AlertStatusSummary';\nimport { AlertStatusSummaryButton } from './AlertStatusSummaryButton';\nimport { AlertInsightsHeader } from './AlertInsightsHeader';\nimport { AlertInsightsSection } from './AlertInsightsSection';\nimport {\n useScroll,\n useLoading,\n ScrollType,\n MapLoadingToProps,\n} from '../../hooks';\nimport { DefaultLoadingAction } from '../../utils/loading';\nimport { Alert, AlertOptions, AlertStatus } from '../../types';\nimport { Maybe } from '@backstage-community/plugin-cost-insights-common';\nimport {\n isStatusSnoozed,\n isStatusAccepted,\n isStatusDismissed,\n sumOfAllAlerts,\n} from '../../utils/alerts';\nimport { ScrollAnchor } from '../../utils/scroll';\n\ntype MapLoadingtoAlerts = (isLoading: boolean) => void;\n\nconst mapLoadingToAlerts: MapLoadingToProps<MapLoadingtoAlerts> =\n ({ dispatch }) =>\n (isLoading: boolean) =>\n dispatch({ [DefaultLoadingAction.CostInsightsAlerts]: isLoading });\n\ntype AlertInsightsProps = {\n group: string;\n active: Alert[];\n snoozed: Alert[];\n accepted: Alert[];\n dismissed: Alert[];\n onChange: (alerts: Alert[]) => void;\n};\n\nexport const AlertInsights = ({\n group,\n active,\n snoozed,\n accepted,\n dismissed,\n onChange,\n}: AlertInsightsProps) => {\n const [scroll] = useScroll();\n const [alert, setAlert] = useState<Maybe<Alert>>(null);\n const dispatchLoadingAlerts = useLoading(mapLoadingToAlerts);\n const [status, setStatus] = useState<Maybe<AlertStatus>>(null);\n // Allow users to pass null values for data.\n const [data, setData] = useState<Maybe<any>>(undefined);\n const [error, setError] = useState<Maybe<Error>>(null);\n const [isDialogOpen, setDialogOpen] = useState(false);\n const [isSummaryOpen, setSummaryOpen] = useState(false);\n const [isSnackbarOpen, setSnackbarOpen] = useState(false);\n\n useEffect(() => {\n async function callAlertHook(\n options: AlertOptions,\n callback: (options: AlertOptions) => Promise<Alert[]>,\n ) {\n setAlert(null);\n setStatus(null);\n setData(undefined);\n setDialogOpen(false);\n dispatchLoadingAlerts(true);\n try {\n const alerts: Alert[] = await callback(options);\n onChange(alerts);\n } catch (e) {\n setError(e);\n } finally {\n dispatchLoadingAlerts(false);\n }\n }\n\n const options: AlertOptions = { data, group };\n const onSnoozed = alert?.onSnoozed?.bind(alert);\n const onAccepted = alert?.onAccepted?.bind(alert);\n const onDismissed = alert?.onDismissed?.bind(alert);\n\n if (data !== undefined) {\n if (isStatusSnoozed(status) && onSnoozed) {\n callAlertHook(options, onSnoozed);\n } else if (isStatusAccepted(status) && onAccepted) {\n callAlertHook(options, onAccepted);\n } else if (isStatusDismissed(status) && onDismissed) {\n callAlertHook(options, onDismissed);\n }\n }\n }, [group, data, alert, status, onChange, dispatchLoadingAlerts]);\n\n useEffect(() => {\n if (scroll === ScrollType.AlertSummary) {\n setSummaryOpen(true);\n }\n }, [scroll]);\n\n useEffect(() => {\n setDialogOpen(!!status);\n }, [status]);\n\n useEffect(() => {\n setSnackbarOpen(!!error);\n }, [error]);\n\n function onSnooze(alertToSnooze: Alert) {\n setAlert(alertToSnooze);\n setStatus(AlertStatus.Snoozed);\n }\n\n function onAccept(alertToAccept: Alert) {\n setAlert(alertToAccept);\n setStatus(AlertStatus.Accepted);\n }\n\n function onDismiss(alertToDismiss: Alert) {\n setAlert(alertToDismiss);\n setStatus(AlertStatus.Dismissed);\n }\n\n function onSnackbarClose() {\n setError(null);\n }\n\n function onDialogClose() {\n setAlert(null);\n setStatus(null);\n }\n\n function onDialogFormSubmit(formData: any) {\n setData(formData);\n }\n\n function onSummaryButtonClick() {\n setSummaryOpen(prevOpen => !prevOpen);\n }\n\n const total = [accepted, snoozed, dismissed].reduce(sumOfAllAlerts, 0);\n\n const isAlertStatusSummaryDisplayed = !!total;\n const isAlertInsightSectionDisplayed = !!active.length;\n\n return (\n <Grid container direction=\"column\" spacing={2}>\n <Grid item>\n <AlertInsightsHeader\n title=\"Your team's action items\"\n subtitle={\n isAlertInsightSectionDisplayed\n ? 'This section outlines suggested action items your team can address to improve cloud costs.'\n : \"All of your team's action items are hidden. Maybe it's time to give them another look?\"\n }\n />\n </Grid>\n {isAlertInsightSectionDisplayed && (\n <Grid item container direction=\"column\" spacing={4}>\n {active.map((activeAlert, index) => (\n <Grid item key={`alert-insights-section-${index}`}>\n <AlertInsightsSection\n alert={activeAlert}\n number={index + 1}\n onSnooze={onSnooze}\n onAccept={onAccept}\n onDismiss={onDismiss}\n />\n </Grid>\n ))}\n </Grid>\n )}\n {isAlertStatusSummaryDisplayed && (\n <Grid item>\n <Box position=\"relative\" display=\"flex\" justifyContent=\"flex-end\">\n <ScrollAnchor id={ScrollType.AlertSummary} />\n <AlertStatusSummaryButton onClick={onSummaryButtonClick}>\n {pluralize('Hidden Action Item', total)}\n </AlertStatusSummaryButton>\n </Box>\n <AlertStatusSummary\n open={isSummaryOpen}\n snoozed={snoozed}\n accepted={accepted}\n dismissed={dismissed}\n />\n </Grid>\n )}\n <AlertDialog\n group={group}\n open={isDialogOpen}\n alert={alert}\n status={status}\n onClose={onDialogClose}\n onSubmit={onDialogFormSubmit}\n />\n <Snackbar\n open={isSnackbarOpen}\n autoHideDuration={6_000}\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\n onClose={onSnackbarClose}\n >\n <MuiAlert onClose={onSnackbarClose} severity=\"error\">\n {error?.message}\n </MuiAlert>\n </Snackbar>\n </Grid>\n );\n};\n"],"names":["options","MuiAlert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAM,kBAAA,GACJ,CAAC,EAAE,QAAA,OACH,CAAC,SAAA,KACC,QAAA,CAAS,EAAE,CAAC,oBAAA,CAAqB,kBAAkB,GAAG,WAAW,CAAA;AAW9D,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA,KAA0B;AACxB,EAAA,MAAM,CAAC,MAAM,CAAA,GAAI,SAAA,EAAU;AAC3B,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,qBAAA,GAAwB,WAAW,kBAAkB,CAAA;AAC3D,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAA6B,IAAI,CAAA;AAE7D,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAqB,MAAS,CAAA;AACtD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAuB,IAAI,CAAA;AACrD,EAAA,MAAM,CAAC,YAAA,EAAc,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA;AACpD,EAAA,MAAM,CAAC,aAAA,EAAe,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA;AACtD,E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AAA;AAAA,sBAAA,IAAA,CAAC,OAAI,QAAA,EAAS,UAAA,EAAW,OAAA,EAAQ,MAAA,EAAO,gBAAe,UAAA,EACrD,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,EAAA,EAAI,UAAA,CAAW,YAAA,EAAc,CAAA;AAAA,4BAC1C,wBAAA,EAAA,EAAyB,OAAA,EAAS,sBAChC,QAAA,EAAA,SAAA,CAAU,oBAAA,EAAsB,KAAK,CAAA,EACxC;AAAA,OAAA,EACF,CAAA;AAAA,sBACA,GAAA;AAAA,QAAC,kBAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAM,aAAA;AAAA,UACN,OAAA;AAAA,UACA,QAAA;AAAA,UACA;AAAA;AAAA;AACF,KAAA,EACF,CAAA;AAAA,oBAEF,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,KAAA;AAAA,QACA,IAAA,EAAM,YAAA;AAAA,QACN,KAAA;AAAA,QACA,MAAA;AAAA,QACA,OAAA,EAAS,aAAA;AAAA,QACT,QAAA,EAAU;AAAA;AAAA,KACZ;AAAA,oBACA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAM,cAAA;AAAA,QACN,gBAAA,EAAkB,GAAA;AAAA,QAClB,YAAA,EAAc,EAAE,QAAA,EAAU,KAAA,EAAO,YAAY,QAAA,EAAS;AAAA,QACtD,OAAA,EAAS,eAAA;AAAA,QAET,8BAACC,KAAA,EAAA,EAAS,OAAA,EAAS,iBAAiB,QAAA,EAAS,OAAA,EAC1C,iBAAO,OAAA,EACV;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertInsightsHeader.esm.js","sources":["../../../src/components/AlertInsights/AlertInsightsHeader.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 Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport { useCostInsightsStyles as useStyles } from '../../utils/styles';\nimport { ScrollAnchor } from '../../utils/scroll';\nimport { DefaultNavigation } from '../../utils/navigation';\n\ntype AlertInsightsHeaderProps = {\n title: string;\n subtitle: string;\n};\n\nexport const AlertInsightsHeader = ({\n title,\n subtitle,\n}: AlertInsightsHeaderProps) => {\n const classes = useStyles();\n\n return (\n <Box mb={6} position=\"relative\">\n <ScrollAnchor id={DefaultNavigation.AlertInsightsHeader} />\n <Typography variant=\"h4\" align=\"center\">\n {title}{' '}\n <Typography component=\"span\" role=\"img\" aria-label=\"direct-hit\">\n 🎯\n </Typography>\n </Typography>\n <Typography className={classes.h6Subtle} align=\"center\" gutterBottom>\n {subtitle}\n </Typography>\n </Box>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;AA2BO,MAAM,sBAAsB,CAAC;AAAA,EAClC,KAAA;AAAA,EACA;AACF,CAAgC,KAAA;AAC9B,EAAA,MAAM,UAAUA,qBAAU,EAAA;AAE1B,EAAA,uBACG,IAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,UAAS,UACnB,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,YAAA,EAAA,EAAa,EAAI,EAAA,iBAAA,CAAkB,mBAAqB,EAAA,CAAA;AAAA,oBACxD,IAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,IAAA,EAAK,OAAM,QAC5B,EAAA,QAAA,EAAA;AAAA,MAAA,KAAA;AAAA,MAAO,GAAA;AAAA,sBACR,GAAA,CAAC,cAAW,SAAU,EAAA,MAAA,EAAO,MAAK,KAAM,EAAA,YAAA,EAAW,cAAa,QAEhE,EAAA,WAAA,EAAA;AAAA,KACF,EAAA,CAAA;AAAA,oBACA,GAAA,CAAC,cAAW,SAAW,EAAA,OAAA,CAAQ,UAAU,KAAM,EAAA,QAAA,EAAS,YAAY,EAAA,IAAA,EACjE,QACH,EAAA,QAAA,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertInsightsHeader.esm.js","sources":["../../../src/components/AlertInsights/AlertInsightsHeader.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 Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport { useCostInsightsStyles as useStyles } from '../../utils/styles';\nimport { ScrollAnchor } from '../../utils/scroll';\nimport { DefaultNavigation } from '../../utils/navigation';\n\ntype AlertInsightsHeaderProps = {\n title: string;\n subtitle: string;\n};\n\nexport const AlertInsightsHeader = ({\n title,\n subtitle,\n}: AlertInsightsHeaderProps) => {\n const classes = useStyles();\n\n return (\n <Box mb={6} position=\"relative\">\n <ScrollAnchor id={DefaultNavigation.AlertInsightsHeader} />\n <Typography variant=\"h4\" align=\"center\">\n {title}{' '}\n <Typography component=\"span\" role=\"img\" aria-label=\"direct-hit\">\n 🎯\n </Typography>\n </Typography>\n <Typography className={classes.h6Subtle} align=\"center\" gutterBottom>\n {subtitle}\n </Typography>\n </Box>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;AA2BO,MAAM,sBAAsB,CAAC;AAAA,EAClC,KAAA;AAAA,EACA;AACF,CAAA,KAAgC;AAC9B,EAAA,MAAM,UAAUA,qBAAA,EAAU;AAE1B,EAAA,uBACE,IAAA,CAAC,GAAA,EAAA,EAAI,EAAA,EAAI,CAAA,EAAG,UAAS,UAAA,EACnB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,EAAA,EAAI,iBAAA,CAAkB,mBAAA,EAAqB,CAAA;AAAA,oBACzD,IAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAK,OAAM,QAAA,EAC5B,QAAA,EAAA;AAAA,MAAA,KAAA;AAAA,MAAO,GAAA;AAAA,sBACR,GAAA,CAAC,cAAW,SAAA,EAAU,MAAA,EAAO,MAAK,KAAA,EAAM,YAAA,EAAW,cAAa,QAAA,EAAA,WAAA,EAEhE;AAAA,KAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,cAAW,SAAA,EAAW,OAAA,CAAQ,UAAU,KAAA,EAAM,QAAA,EAAS,YAAA,EAAY,IAAA,EACjE,QAAA,EAAA,QAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertInsightsSection.esm.js","sources":["../../../src/components/AlertInsights/AlertInsightsSection.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 Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { default as SnoozeIcon } from '@material-ui/icons/AccessTime';\nimport { default as AcceptIcon } from '@material-ui/icons/Check';\nimport { default as DismissIcon } from '@material-ui/icons/Delete';\nimport { AlertInsightsSectionHeader } from './AlertInsightsSectionHeader';\nimport { Alert } from '../../types';\nimport {\n isSnoozeEnabled,\n isAcceptEnabled,\n isDismissEnabled,\n} from '../../utils/alerts';\n\ntype AlertInsightsSectionProps = {\n alert: Alert;\n number: number;\n onSnooze: (alert: Alert) => void;\n onAccept: (alert: Alert) => void;\n onDismiss: (alert: Alert) => void;\n};\n\nexport const AlertInsightsSection = ({\n alert,\n number,\n onSnooze,\n onAccept,\n onDismiss,\n}: AlertInsightsSectionProps) => {\n const isSnoozeButtonDisplayed = isSnoozeEnabled(alert);\n const isAcceptButtonDisplayed = isAcceptEnabled(alert);\n const isDismissButtonDisplayed = isDismissEnabled(alert);\n const isButtonGroupDisplayed =\n isSnoozeButtonDisplayed ||\n isAcceptButtonDisplayed ||\n isDismissButtonDisplayed;\n\n return (\n <Box display=\"flex\" flexDirection=\"column\" mb={6}>\n <AlertInsightsSectionHeader alert={alert} number={number} />\n {isButtonGroupDisplayed && (\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\n {isAcceptButtonDisplayed && (\n <Box mr={1}>\n <Button\n color=\"primary\"\n variant=\"contained\"\n aria-label=\"accept\"\n onClick={() => onAccept(alert)}\n startIcon={<AcceptIcon />}\n >\n Accept\n </Button>\n </Box>\n )}\n {isSnoozeButtonDisplayed && (\n <Box mr={1}>\n <Button\n color=\"default\"\n variant=\"outlined\"\n aria-label=\"snooze\"\n disableElevation\n onClick={() => onSnooze(alert)}\n startIcon={<SnoozeIcon />}\n >\n Snooze\n </Button>\n </Box>\n )}\n {isDismissButtonDisplayed && (\n <Button\n color=\"secondary\"\n variant=\"outlined\"\n aria-label=\"dismiss\"\n disableElevation\n onClick={() => onDismiss(alert)}\n startIcon={<DismissIcon />}\n >\n Dismiss\n </Button>\n )}\n </Box>\n )}\n {alert.element}\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAoCO,MAAM,uBAAuB,CAAC;AAAA,EACnC,KAAA;AAAA,EACA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,QAAA,CAAS,KAAK,CAAA;AAAA,UAC7B,SAAA,sBAAY,UAAW,EAAA,EAAA,CAAA;AAAA,UACxB,QAAA,EAAA;AAAA;AAAA,OAGH,EAAA,CAAA;AAAA,MAED,wBACC,oBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,WAAA;AAAA,UACN,OAAQ,EAAA,UAAA;AAAA,UACR,YAAW,EAAA,SAAA;AAAA,UACX,gBAAgB,EAAA,IAAA;AAAA,UAChB,OAAA,EAAS,MAAM,SAAA,CAAU,KAAK,CAAA;AAAA,UAC9B,SAAA,sBAAY,WAAY,EAAA,EAAA,CAAA;AAAA,UACzB,QAAA,EAAA;AAAA;AAAA;AAED,KAEJ,EAAA,CAAA;AAAA,IAED,KAAM,CAAA;AAAA,GACT,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertInsightsSection.esm.js","sources":["../../../src/components/AlertInsights/AlertInsightsSection.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 Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { default as SnoozeIcon } from '@material-ui/icons/AccessTime';\nimport { default as AcceptIcon } from '@material-ui/icons/Check';\nimport { default as DismissIcon } from '@material-ui/icons/Delete';\nimport { AlertInsightsSectionHeader } from './AlertInsightsSectionHeader';\nimport { Alert } from '../../types';\nimport {\n isSnoozeEnabled,\n isAcceptEnabled,\n isDismissEnabled,\n} from '../../utils/alerts';\n\ntype AlertInsightsSectionProps = {\n alert: Alert;\n number: number;\n onSnooze: (alert: Alert) => void;\n onAccept: (alert: Alert) => void;\n onDismiss: (alert: Alert) => void;\n};\n\nexport const AlertInsightsSection = ({\n alert,\n number,\n onSnooze,\n onAccept,\n onDismiss,\n}: AlertInsightsSectionProps) => {\n const isSnoozeButtonDisplayed = isSnoozeEnabled(alert);\n const isAcceptButtonDisplayed = isAcceptEnabled(alert);\n const isDismissButtonDisplayed = isDismissEnabled(alert);\n const isButtonGroupDisplayed =\n isSnoozeButtonDisplayed ||\n isAcceptButtonDisplayed ||\n isDismissButtonDisplayed;\n\n return (\n <Box display=\"flex\" flexDirection=\"column\" mb={6}>\n <AlertInsightsSectionHeader alert={alert} number={number} />\n {isButtonGroupDisplayed && (\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\n {isAcceptButtonDisplayed && (\n <Box mr={1}>\n <Button\n color=\"primary\"\n variant=\"contained\"\n aria-label=\"accept\"\n onClick={() => onAccept(alert)}\n startIcon={<AcceptIcon />}\n >\n Accept\n </Button>\n </Box>\n )}\n {isSnoozeButtonDisplayed && (\n <Box mr={1}>\n <Button\n color=\"default\"\n variant=\"outlined\"\n aria-label=\"snooze\"\n disableElevation\n onClick={() => onSnooze(alert)}\n startIcon={<SnoozeIcon />}\n >\n Snooze\n </Button>\n </Box>\n )}\n {isDismissButtonDisplayed && (\n <Button\n color=\"secondary\"\n variant=\"outlined\"\n aria-label=\"dismiss\"\n disableElevation\n onClick={() => onDismiss(alert)}\n startIcon={<DismissIcon />}\n >\n Dismiss\n </Button>\n )}\n </Box>\n )}\n {alert.element}\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAoCO,MAAM,uBAAuB,CAAC;AAAA,EACnC,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,KAAiC;AAC/B,EAAA,MAAM,uBAAA,GAA0B,gBAAgB,KAAK,CAAA;AACrD,EAAA,MAAM,uBAAA,GAA0B,gBAAgB,KAAK,CAAA;AACr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AAA;AAAA,UACC,KAAA,EAAM,WAAA;AAAA,UACN,OAAA,EAAQ,UAAA;AAAA,UACR,YAAA,EAAW,SAAA;AAAA,UACX,gBAAA,EAAgB,IAAA;AAAA,UAChB,OAAA,EAAS,MAAM,SAAA,CAAU,KAAK,CAAA;AAAA,UAC9B,SAAA,sBAAY,WAAA,EAAA,EAAY,CAAA;AAAA,UACzB,QAAA,EAAA;AAAA;AAAA;AAED,KAAA,EAEJ,CAAA;AAAA,IAED,KAAA,CAAM;AAAA,GAAA,EACT,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertInsightsSectionHeader.esm.js","sources":["../../../src/components/AlertInsights/AlertInsightsSectionHeader.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 Avatar from '@material-ui/core/Avatar';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { useAlertInsightsSectionStyles as useStyles } from '../../utils/styles';\nimport { ScrollAnchor } from '../../utils/scroll';\nimport { Alert } from '../../types';\n\ntype AlertInsightsSectionHeaderProps = {\n alert: Alert;\n number: number;\n};\n\nexport const AlertInsightsSectionHeader = ({\n alert,\n number,\n}: AlertInsightsSectionHeaderProps) => {\n const classes = useStyles();\n\n const isViewInstructionsButtonDisplayed = !!alert.url;\n\n return (\n <Box position=\"relative\" mb={3} textAlign=\"left\">\n <ScrollAnchor id={`alert-${number}`} />\n <Grid\n container\n spacing={2}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n <Grid item>\n <Box display=\"flex\" alignItems=\"center\">\n <Box mr={2}>\n <Avatar className={classes.button}>{number}</Avatar>\n </Box>\n <Box>\n <Typography variant=\"h5\">{alert.title}</Typography>\n <Typography gutterBottom>{alert.subtitle}</Typography>\n </Box>\n </Box>\n </Grid>\n {isViewInstructionsButtonDisplayed && (\n <Grid item>\n <Button variant=\"text\" color=\"primary\" href={alert.url}>\n {alert.buttonText || 'View Instructions'}\n </Button>\n </Grid>\n )}\n </Grid>\n </Box>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;AA8BO,MAAM,6BAA6B,CAAC;AAAA,EACzC,KAAA;AAAA,EACA;AACF,CAAuC,KAAA;AACrC,EAAA,MAAM,UAAUA,6BAAU,EAAA;AAE1B,EAAM,MAAA,iCAAA,GAAoC,CAAC,CAAC,KAAM,CAAA,GAAA;AAElD,EAAA,4BACG,GAAI,EAAA,EAAA,QAAA,EAAS,YAAW,EAAI,EAAA,CAAA,EAAG,WAAU,MACxC,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAa,EAAA,EAAA,EAAA,EAAI,CAAS,MAAA,EAAA,MAAM,CAAI,CAAA,EAAA,CAAA;AAAA,oBACrC,IAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,SAAS,EAAA,IAAA;AAAA,QACT,OAAS,EAAA,CAAA;AAAA,QACT,cAAe,EAAA,eAAA;AAAA,QACf,UAAW,EAAA,QAAA;AAAA,QAEX,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IACR,EAAA,QAAA,kBAAA,IAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,QAAA,EAAA;AAAA,4BAAC,GAAA,CAAA,GAAA,EAAA,EAAI,IAAI,CACP,EAAA,QAAA,kBAAA,GAAA,CAAC,UAAO,SAAW,EAAA,OAAA,CAAQ,MAAS,EAAA,QAAA,EAAA,MAAA,EAAO,CAC7C,EAAA,CAAA;AAAA,iCACC,GACC,EAAA,EAAA,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,IAAM,EAAA,QAAA,EAAA,KAAA,CAAM,KAAM,EAAA,CAAA;AAAA,8BACrC,GAAA,CAAA,UAAA,EAAA,EAAW,YAAY,EAAA,IAAA,EAAE,gBAAM,QAAS,EAAA;AAAA,aAC3C,EAAA;AAAA,WAAA,EACF,CACF,EAAA,CAAA;AAAA,UACC,qDACE,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EACR,8BAAC,MAAO,EAAA,EAAA,OAAA,EAAQ,MAAO,EAAA,KAAA,EAAM,WAAU,IAAM,EAAA,KAAA,CAAM,KAChD,QAAM,EAAA,KAAA,CAAA,UAAA,IAAc,qBACvB,CACF,EAAA;AAAA;AAAA;AAAA;AAEJ,GACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertInsightsSectionHeader.esm.js","sources":["../../../src/components/AlertInsights/AlertInsightsSectionHeader.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 Avatar from '@material-ui/core/Avatar';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport Typography from '@material-ui/core/Typography';\nimport { useAlertInsightsSectionStyles as useStyles } from '../../utils/styles';\nimport { ScrollAnchor } from '../../utils/scroll';\nimport { Alert } from '../../types';\n\ntype AlertInsightsSectionHeaderProps = {\n alert: Alert;\n number: number;\n};\n\nexport const AlertInsightsSectionHeader = ({\n alert,\n number,\n}: AlertInsightsSectionHeaderProps) => {\n const classes = useStyles();\n\n const isViewInstructionsButtonDisplayed = !!alert.url;\n\n return (\n <Box position=\"relative\" mb={3} textAlign=\"left\">\n <ScrollAnchor id={`alert-${number}`} />\n <Grid\n container\n spacing={2}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n <Grid item>\n <Box display=\"flex\" alignItems=\"center\">\n <Box mr={2}>\n <Avatar className={classes.button}>{number}</Avatar>\n </Box>\n <Box>\n <Typography variant=\"h5\">{alert.title}</Typography>\n <Typography gutterBottom>{alert.subtitle}</Typography>\n </Box>\n </Box>\n </Grid>\n {isViewInstructionsButtonDisplayed && (\n <Grid item>\n <Button variant=\"text\" color=\"primary\" href={alert.url}>\n {alert.buttonText || 'View Instructions'}\n </Button>\n </Grid>\n )}\n </Grid>\n </Box>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;AA8BO,MAAM,6BAA6B,CAAC;AAAA,EACzC,KAAA;AAAA,EACA;AACF,CAAA,KAAuC;AACrC,EAAA,MAAM,UAAUA,6BAAA,EAAU;AAE1B,EAAA,MAAM,iCAAA,GAAoC,CAAC,CAAC,KAAA,CAAM,GAAA;AAElD,EAAA,4BACG,GAAA,EAAA,EAAI,QAAA,EAAS,YAAW,EAAA,EAAI,CAAA,EAAG,WAAU,MAAA,EACxC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,YAAA,EAAA,EAAa,EAAA,EAAI,CAAA,MAAA,EAAS,MAAM,CAAA,CAAA,EAAI,CAAA;AAAA,oBACrC,IAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAS,IAAA;AAAA,QACT,OAAA,EAAS,CAAA;AAAA,QACT,cAAA,EAAe,eAAA;AAAA,QACf,UAAA,EAAW,QAAA;AAAA,QAEX,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,MAAI,IAAA,EACR,QAAA,kBAAA,IAAA,CAAC,OAAI,OAAA,EAAQ,MAAA,EAAO,YAAW,QAAA,EAC7B,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,GAAA,EAAA,EAAI,IAAI,CAAA,EACP,QAAA,kBAAA,GAAA,CAAC,UAAO,SAAA,EAAW,OAAA,CAAQ,MAAA,EAAS,QAAA,EAAA,MAAA,EAAO,CAAA,EAC7C,CAAA;AAAA,iCACC,GAAA,EAAA,EACC,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,IAAA,EAAM,QAAA,EAAA,KAAA,CAAM,KAAA,EAAM,CAAA;AAAA,8BACtC,GAAA,CAAC,UAAA,EAAA,EAAW,YAAA,EAAY,IAAA,EAAE,gBAAM,QAAA,EAAS;AAAA,aAAA,EAC3C;AAAA,WAAA,EACF,CAAA,EACF,CAAA;AAAA,UACC,qDACC,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EACR,8BAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,MAAA,EAAO,KAAA,EAAM,WAAU,IAAA,EAAM,KAAA,CAAM,KAChD,QAAA,EAAA,KAAA,CAAM,UAAA,IAAc,qBACvB,CAAA,EACF;AAAA;AAAA;AAAA;AAEJ,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertStatusSummary.esm.js","sources":["../../../src/components/AlertInsights/AlertStatusSummary.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 { Fragment } from 'react';\nimport Avatar from '@material-ui/core/Avatar';\nimport Box from '@material-ui/core/Box';\nimport Collapse from '@material-ui/core/Collapse';\nimport Divider from '@material-ui/core/Divider';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { default as AcceptIcon } from '@material-ui/icons/Check';\nimport { default as DismissIcon } from '@material-ui/icons/Delete';\nimport { default as SnoozeIcon } from '@material-ui/icons/AccessTime';\nimport { ActionItemCard } from '../ActionItems';\nimport { Alert, AlertStatus } from '../../types';\nimport { useActionItemCardStyles as useStyles } from '../../utils/styles';\n\ntype AlertGroupProps = {\n alerts: Alert[];\n status: AlertStatus;\n title: string;\n icon: JSX.Element;\n};\n\nconst AlertGroup = ({ alerts, status, title, icon }: AlertGroupProps) => {\n const classes = useStyles();\n return (\n <Box p={1}>\n {alerts.map((alert, index) => (\n <Fragment key={`alert-${status}-${index}`}>\n <ActionItemCard\n disableScroll\n alert={alert}\n avatar={\n <Tooltip title={title}>\n <Avatar className={classes.avatar}>{icon}</Avatar>\n </Tooltip>\n }\n />\n {index < alerts.length - 1 && <Divider />}\n </Fragment>\n ))}\n </Box>\n );\n};\n\ntype AlertStatusSummaryProps = {\n open: boolean;\n snoozed: Alert[];\n accepted: Alert[];\n dismissed: Alert[];\n};\n\nexport const AlertStatusSummary = ({\n open,\n snoozed,\n accepted,\n dismissed,\n}: AlertStatusSummaryProps) => {\n const isSnoozedListDisplayed = !!snoozed.length;\n const isAcceptedListDisplayed = !!accepted.length;\n const isDismissedListDisplayed = !!dismissed.length;\n\n return (\n <Collapse in={open}>\n {isAcceptedListDisplayed && (\n <AlertGroup\n title=\"Accepted\"\n alerts={accepted}\n status={AlertStatus.Accepted}\n icon={\n <AcceptIcon\n role=\"img\"\n aria-hidden={false}\n aria-label={AlertStatus.Accepted}\n />\n }\n />\n )}\n {isSnoozedListDisplayed && (\n <AlertGroup\n title=\"Snoozed\"\n alerts={snoozed}\n status={AlertStatus.Snoozed}\n icon={\n <SnoozeIcon\n role=\"img\"\n aria-hidden={false}\n aria-label={AlertStatus.Snoozed}\n />\n }\n />\n )}\n {isDismissedListDisplayed && (\n <AlertGroup\n title=\"Dismissed\"\n alerts={dismissed}\n status={AlertStatus.Dismissed}\n icon={\n <DismissIcon\n role=\"img\"\n aria-hidden={false}\n aria-label={AlertStatus.Dismissed}\n />\n }\n />\n )}\n </Collapse>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,aAAa,CAAC,EAAE,QAAQ,MAAQ,EAAA,KAAA,EAAO,MAA4B,KAAA;AACvE,EAAA,MAAM,UAAUA,uBAAU,EAAA;AAC1B,EACE,uBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,CAAA,EAAG,CACL,EAAA,QAAA,EAAA,MAAA,CAAO,IAAI,CAAC,KAAA,EAAO,KAClB,qBAAA,IAAA,CAAC,QACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,aAAa,EAAA,IAAA;AAAA,QACb,KAAA;AAAA,QACA,MAAA,kBACG,GAAA,CAAA,OAAA,EAAA,EAAQ,KACP,EAAA,QAAA,kBAAA,GAAA,CAAC,UAAO,SAAW,EAAA,OAAA,CAAQ,MAAS,EAAA,QAAA,EAAA,IAAA,EAAK,CAC3C,EAAA;AAAA;AAAA,KAEJ;AAAA,IACC,KAAQ,GAAA,MAAA,CAAO,MAAS,GAAA,CAAA,wBAAM,OAAQ,EAAA,EAAA;AAAA,GAAA,EAAA,EAV1B,SAAS,MAAM,CAAA,CAAA,EAAI,KAAK,CAAA,CAWvC,CACD,CACH,EAAA,CAAA;AAEJ,CAAA;AASO,MAAM,qBAAqB,CAAC;AAAA,EACjC,IAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAA+B,KAAA;AAC7B,EAAM,MAAA,sBAAA,GAAyB,CAAC,CAAC,OAAQ,CAAA,MAAA;AACzC,EAAM,M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"}
1
+ {"version":3,"file":"AlertStatusSummary.esm.js","sources":["../../../src/components/AlertInsights/AlertStatusSummary.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 { Fragment } from 'react';\nimport Avatar from '@material-ui/core/Avatar';\nimport Box from '@material-ui/core/Box';\nimport Collapse from '@material-ui/core/Collapse';\nimport Divider from '@material-ui/core/Divider';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { default as AcceptIcon } from '@material-ui/icons/Check';\nimport { default as DismissIcon } from '@material-ui/icons/Delete';\nimport { default as SnoozeIcon } from '@material-ui/icons/AccessTime';\nimport { ActionItemCard } from '../ActionItems';\nimport { Alert, AlertStatus } from '../../types';\nimport { useActionItemCardStyles as useStyles } from '../../utils/styles';\n\ntype AlertGroupProps = {\n alerts: Alert[];\n status: AlertStatus;\n title: string;\n icon: JSX.Element;\n};\n\nconst AlertGroup = ({ alerts, status, title, icon }: AlertGroupProps) => {\n const classes = useStyles();\n return (\n <Box p={1}>\n {alerts.map((alert, index) => (\n <Fragment key={`alert-${status}-${index}`}>\n <ActionItemCard\n disableScroll\n alert={alert}\n avatar={\n <Tooltip title={title}>\n <Avatar className={classes.avatar}>{icon}</Avatar>\n </Tooltip>\n }\n />\n {index < alerts.length - 1 && <Divider />}\n </Fragment>\n ))}\n </Box>\n );\n};\n\ntype AlertStatusSummaryProps = {\n open: boolean;\n snoozed: Alert[];\n accepted: Alert[];\n dismissed: Alert[];\n};\n\nexport const AlertStatusSummary = ({\n open,\n snoozed,\n accepted,\n dismissed,\n}: AlertStatusSummaryProps) => {\n const isSnoozedListDisplayed = !!snoozed.length;\n const isAcceptedListDisplayed = !!accepted.length;\n const isDismissedListDisplayed = !!dismissed.length;\n\n return (\n <Collapse in={open}>\n {isAcceptedListDisplayed && (\n <AlertGroup\n title=\"Accepted\"\n alerts={accepted}\n status={AlertStatus.Accepted}\n icon={\n <AcceptIcon\n role=\"img\"\n aria-hidden={false}\n aria-label={AlertStatus.Accepted}\n />\n }\n />\n )}\n {isSnoozedListDisplayed && (\n <AlertGroup\n title=\"Snoozed\"\n alerts={snoozed}\n status={AlertStatus.Snoozed}\n icon={\n <SnoozeIcon\n role=\"img\"\n aria-hidden={false}\n aria-label={AlertStatus.Snoozed}\n />\n }\n />\n )}\n {isDismissedListDisplayed && (\n <AlertGroup\n title=\"Dismissed\"\n alerts={dismissed}\n status={AlertStatus.Dismissed}\n icon={\n <DismissIcon\n role=\"img\"\n aria-hidden={false}\n aria-label={AlertStatus.Dismissed}\n />\n }\n />\n )}\n </Collapse>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,aAAa,CAAC,EAAE,QAAQ,MAAA,EAAQ,KAAA,EAAO,MAAK,KAAuB;AACvE,EAAA,MAAM,UAAUA,uBAAA,EAAU;AAC1B,EAAA,uBACE,GAAA,CAAC,GAAA,EAAA,EAAI,CAAA,EAAG,CAAA,EACL,QAAA,EAAA,MAAA,CAAO,IAAI,CAAC,KAAA,EAAO,KAAA,qBAClB,IAAA,CAAC,QAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAa,IAAA;AAAA,QACb,KAAA;AAAA,QACA,MAAA,kBACE,GAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EACP,QAAA,kBAAA,GAAA,CAAC,UAAO,SAAA,EAAW,OAAA,CAAQ,MAAA,EAAS,QAAA,EAAA,IAAA,EAAK,CAAA,EAC3C;AAAA;AAAA,KA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;AAAA,KAEJ;AAAA,IAED,wBAAA,oBACC,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAM,WAAA;AAAA,QACN,MAAA,EAAQ,SAAA;AAAA,QACR,QAAQ,WAAA,CAAY,SAAA;AAAA,QACpB,IAAA,kBACE,GAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,KAAA;AAAA,YACL,aAAA,EAAa,KAAA;AAAA,YACb,cAAY,WAAA,CAAY;AAAA;AAAA;AAC1B;AAAA;AAEJ,GAAA,EAEJ,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertStatusSummaryButton.esm.js","sources":["../../../src/components/AlertInsights/AlertStatusSummaryButton.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 { useState, MouseEventHandler, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport { default as ExpandMoreIcon } from '@material-ui/icons/ExpandMore';\nimport { useAlertStatusSummaryButtonStyles as useStyles } from '../../utils/styles';\n\ntype AlertStatusSummaryButtonProps = {\n onClick: MouseEventHandler;\n};\n\nexport const AlertStatusSummaryButton = ({\n children,\n onClick,\n}: PropsWithChildren<AlertStatusSummaryButtonProps>) => {\n const classes = useStyles();\n const [clicked, setClicked] = useState(false);\n const iconClassName = classnames(classes.icon, {\n [classes.clicked]: clicked,\n });\n\n const handleOnClick: MouseEventHandler = e => {\n setClicked(prevClicked => !prevClicked);\n onClick(e);\n };\n\n return (\n <Button\n variant=\"text\"\n color=\"primary\"\n disableElevation\n aria-label=\"expand\"\n endIcon={<ExpandMoreIcon className={iconClassName} />}\n onClick={handleOnClick}\n >\n {children}\n </Button>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;AA0BO,MAAM,2BAA2B,CAAC;AAAA,EACvC,QAAA;AAAA,EACA;AACF,CAAwD,KAAA;AACtD,EAAA,MAAM,UAAUA,iCAAU,EAAA;AAC1B,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAM,MAAA,aAAA,GAAgB,UAAW,CAAA,OAAA,CAAQ,IAAM,EAAA;AAAA,IAC7C,CAAC,OAAQ,CAAA,OAAO,GAAG;AAAA,GACpB,CAAA;AAED,EAAA,MAAM,gBAAmC,CAAK,CAAA,KAAA;AAC5C,IAAW,UAAA,CAAA,CAAA,WAAA,KAAe,CAAC,WAAW,CAAA;AACtC,IAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GACX;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,MAAA;AAAA,MACR,KAAM,EAAA,SAAA;AAAA,MACN,gBAAgB,EAAA,IAAA;AAAA,MAChB,YAAW,EAAA,QAAA;AAAA,MACX,OAAS,kBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,SAAA,EAAW,aAAe,EAAA,CAAA;AAAA,MACnD,OAAS,EAAA,aAAA;AAAA,MAER;AAAA;AAAA,GACH;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertStatusSummaryButton.esm.js","sources":["../../../src/components/AlertInsights/AlertStatusSummaryButton.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 { useState, MouseEventHandler, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport { default as ExpandMoreIcon } from '@material-ui/icons/ExpandMore';\nimport { useAlertStatusSummaryButtonStyles as useStyles } from '../../utils/styles';\n\ntype AlertStatusSummaryButtonProps = {\n onClick: MouseEventHandler;\n};\n\nexport const AlertStatusSummaryButton = ({\n children,\n onClick,\n}: PropsWithChildren<AlertStatusSummaryButtonProps>) => {\n const classes = useStyles();\n const [clicked, setClicked] = useState(false);\n const iconClassName = classnames(classes.icon, {\n [classes.clicked]: clicked,\n });\n\n const handleOnClick: MouseEventHandler = e => {\n setClicked(prevClicked => !prevClicked);\n onClick(e);\n };\n\n return (\n <Button\n variant=\"text\"\n color=\"primary\"\n disableElevation\n aria-label=\"expand\"\n endIcon={<ExpandMoreIcon className={iconClassName} />}\n onClick={handleOnClick}\n >\n {children}\n </Button>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;AA0BO,MAAM,2BAA2B,CAAC;AAAA,EACvC,QAAA;AAAA,EACA;AACF,CAAA,KAAwD;AACtD,EAAA,MAAM,UAAUA,iCAAA,EAAU;AAC1B,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,aAAA,GAAgB,UAAA,CAAW,OAAA,CAAQ,IAAA,EAAM;AAAA,IAC7C,CAAC,OAAA,CAAQ,OAAO,GAAG;AAAA,GACpB,CAAA;AAED,EAAA,MAAM,gBAAmC,CAAA,CAAA,KAAK;AAC5C,IAAA,UAAA,CAAW,CAAA,WAAA,KAAe,CAAC,WAAW,CAAA;AACtC,IAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,EACX,CAAA;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,MAAA;AAAA,MACR,KAAA,EAAM,SAAA;AAAA,MACN,gBAAA,EAAgB,IAAA;AAAA,MAChB,YAAA,EAAW,QAAA;AAAA,MACX,OAAA,kBAAS,GAAA,CAAC,cAAA,EAAA,EAAe,SAAA,EAAW,aAAA,EAAe,CAAA;AAAA,MACnD,OAAA,EAAS,aAAA;AAAA,MAER;AAAA;AAAA,GACH;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AlertInstructionsLayout.esm.js","sources":["../../../src/components/AlertInstructionsLayout/AlertInstructionsLayout.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 { PropsWithChildren } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Container from '@material-ui/core/Container';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport { CostInsightsThemeProvider } from '../CostInsightsPage/CostInsightsThemeProvider';\nimport { ConfigProvider, CurrencyProvider } from '../../hooks';\nimport { Header, Page } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n gridArea: 'pageContent',\n padding: theme.spacing(4),\n },\n}));\n\ntype AlertInstructionsLayoutProps = {\n title: string;\n};\n\nexport const AlertInstructionsLayout = ({\n title,\n children,\n}: PropsWithChildren<AlertInstructionsLayoutProps>) => {\n const classes = useStyles();\n return (\n <CostInsightsThemeProvider>\n <ConfigProvider>\n <CurrencyProvider>\n <Page themeId=\"tool\">\n <Header\n title=\"Cost Insights\"\n pageTitleOverride={title}\n type=\"Tool\"\n />\n <Container maxWidth=\"md\" disableGutters className={classes.root}>\n <Box mb={3}>\n <Button\n variant=\"outlined\"\n startIcon={<ChevronLeftIcon />}\n href=\"/cost-insights\"\n >\n Back to Cost Insights\n </Button>\n </Box>\n {children}\n </Container>\n </Page>\n </CurrencyProvider>\n </ConfigProvider>\n </CostInsightsThemeProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,QAAU,EAAA,aAAA;AAAA,IACV,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAE,CAAA,CAAA;AAMK,MAAM,0BAA0B,CAAC;AAAA,EACtC,KAAA;AAAA,EACA;AACF,CAAuD,KAAA;AACrD,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EACE,uBAAA,GAAA,CAAC,6BACC,QAAC,kBAAA,GAAA,CAAA,cAAA,EAAA,EACC,8BAAC,gBACC,EAAA,EAAA,QAAA,kBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,eAAA;AAAA,QACN,iBAAmB,EAAA,KAAA;AAAA,QACnB,IAAK,EAAA;AAAA;AAAA,KACP;AAAA,oBACA,IAAA,CAAC,aAAU,QAAS,EAAA,IAAA,EAAK,gBAAc,IAAC,EAAA,SAAA,EAAW,QAAQ,IACzD,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,GAAA,EAAA,EAAI,IAAI,CACP,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,UAAA;AAAA,UACR,SAAA,sBAAY,eAAgB,EAAA,EAAA,CAAA;AAAA,UAC5B,IAAK,EAAA,gBAAA;AAAA,UACN,QAAA,EAAA;AAAA;AAAA,OAGH,EAAA,CAAA;AAAA,MACC;AAAA,KACH,EAAA;AAAA,GACF,EAAA,CAAA,EACF,GACF,CACF,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AlertInstructionsLayout.esm.js","sources":["../../../src/components/AlertInstructionsLayout/AlertInstructionsLayout.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 { PropsWithChildren } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Container from '@material-ui/core/Container';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport { CostInsightsThemeProvider } from '../CostInsightsPage/CostInsightsThemeProvider';\nimport { ConfigProvider, CurrencyProvider } from '../../hooks';\nimport { Header, Page } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n gridArea: 'pageContent',\n padding: theme.spacing(4),\n },\n}));\n\ntype AlertInstructionsLayoutProps = {\n title: string;\n};\n\nexport const AlertInstructionsLayout = ({\n title,\n children,\n}: PropsWithChildren<AlertInstructionsLayoutProps>) => {\n const classes = useStyles();\n return (\n <CostInsightsThemeProvider>\n <ConfigProvider>\n <CurrencyProvider>\n <Page themeId=\"tool\">\n <Header\n title=\"Cost Insights\"\n pageTitleOverride={title}\n type=\"Tool\"\n />\n <Container maxWidth=\"md\" disableGutters className={classes.root}>\n <Box mb={3}>\n <Button\n variant=\"outlined\"\n startIcon={<ChevronLeftIcon />}\n href=\"/cost-insights\"\n >\n Back to Cost Insights\n </Button>\n </Box>\n {children}\n </Container>\n </Page>\n </CurrencyProvider>\n </ConfigProvider>\n </CostInsightsThemeProvider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,IAAA,EAAM;AAAA,IACJ,QAAA,EAAU,aAAA;AAAA,IACV,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAA,CAAE,CAAA;AAMK,MAAM,0BAA0B,CAAC;AAAA,EACtC,KAAA;AAAA,EACA;AACF,CAAA,KAAuD;AACrD,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,uBACE,GAAA,CAAC,6BACC,QAAA,kBAAA,GAAA,CAAC,cAAA,EAAA,EACC,8BAAC,gBAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,MAAA,EACZ,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAM,eAAA;AAAA,QACN,iBAAA,EAAmB,KAAA;AAAA,QACnB,IAAA,EAAK;AAAA;AAAA,KACP;AAAA,oBACA,IAAA,CAAC,aAAU,QAAA,EAAS,IAAA,EAAK,gBAAc,IAAA,EAAC,SAAA,EAAW,QAAQ,IAAA,EACzD,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,GAAA,EAAA,EAAI,IAAI,CAAA,EACP,QAAA,kBAAA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAA,EAAQ,UAAA;AAAA,UACR,SAAA,sBAAY,eAAA,EAAA,EAAgB,CAAA;AAAA,UAC5B,IAAA,EAAK,gBAAA;AAAA,UACN,QAAA,EAAA;AAAA;AAAA,OAED,EACF,CAAA;AAAA,MACC;AAAA,KAAA,EACH;AAAA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