@backstage-community/plugin-cost-insights 0.15.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/alerts/ProjectGrowthAlert.esm.js +2 -2
- package/dist/alerts/ProjectGrowthAlert.esm.js.map +1 -1
- package/dist/alerts/UnlabeledDataflowAlert.esm.js +2 -2
- package/dist/alerts/UnlabeledDataflowAlert.esm.js.map +1 -1
- package/dist/alpha/plugin.esm.js +55 -0
- package/dist/alpha/plugin.esm.js.map +1 -0
- package/dist/alpha.d.ts +85 -0
- package/dist/alpha.esm.js +23 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/components/ActionItems/ActionItemCard.esm.js +3 -3
- package/dist/components/ActionItems/ActionItemCard.esm.js.map +1 -1
- package/dist/components/ActionItems/ActionItems.esm.js +52 -41
- package/dist/components/ActionItems/ActionItems.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertDialog.esm.js +79 -58
- package/dist/components/AlertInsights/AlertDialog.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertInsights.esm.js +57 -44
- package/dist/components/AlertInsights/AlertInsights.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertInsightsHeader.esm.js +10 -2
- package/dist/components/AlertInsights/AlertInsightsHeader.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertInsightsSection.esm.js +42 -34
- package/dist/components/AlertInsights/AlertInsightsSection.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js +23 -12
- package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertStatusSummary.esm.js +63 -55
- package/dist/components/AlertInsights/AlertStatusSummary.esm.js.map +1 -1
- package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js +7 -6
- package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js.map +1 -1
- package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js +23 -17
- package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js.map +1 -1
- package/dist/components/BarChart/BarChart.esm.js +83 -78
- package/dist/components/BarChart/BarChart.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartLabel.esm.js +8 -5
- package/dist/components/BarChart/BarChartLabel.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartLegend.esm.js +20 -16
- package/dist/components/BarChart/BarChartLegend.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartStepper.esm.js +51 -48
- package/dist/components/BarChart/BarChartStepper.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartStepperButton.esm.js +6 -5
- package/dist/components/BarChart/BarChartStepperButton.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartSteps.esm.js +3 -3
- package/dist/components/BarChart/BarChartSteps.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartTick.esm.js +5 -5
- package/dist/components/BarChart/BarChartTick.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartTooltip.esm.js +27 -14
- package/dist/components/BarChart/BarChartTooltip.esm.js.map +1 -1
- package/dist/components/BarChart/BarChartTooltipItem.esm.js +11 -6
- package/dist/components/BarChart/BarChartTooltipItem.esm.js.map +1 -1
- package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js +3 -2
- package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js.map +1 -1
- package/dist/components/CostGrowth/CostGrowth.esm.js +26 -7
- package/dist/components/CostGrowth/CostGrowth.esm.js.map +1 -1
- package/dist/components/CostGrowth/CostGrowthIndicator.esm.js +6 -2
- package/dist/components/CostGrowth/CostGrowthIndicator.esm.js.map +1 -1
- package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js +77 -8
- package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js.map +1 -1
- package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js +16 -10
- package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js.map +1 -1
- package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js +41 -35
- package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js.map +1 -1
- package/dist/components/CostInsightsPage/CostInsightsPage.esm.js +116 -79
- package/dist/components/CostInsightsPage/CostInsightsPage.esm.js.map +1 -1
- package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js +2 -2
- package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js.map +1 -1
- package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js +5 -5
- package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js.map +1 -1
- package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js +58 -51
- package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js.map +1 -1
- package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js +74 -59
- package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js.map +1 -1
- package/dist/components/CostOverviewCard/CostOverviewCard.esm.js +45 -35
- package/dist/components/CostOverviewCard/CostOverviewCard.esm.js.map +1 -1
- package/dist/components/CostOverviewCard/CostOverviewChart.esm.js +86 -73
- package/dist/components/CostOverviewCard/CostOverviewChart.esm.js.map +1 -1
- package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js +11 -6
- package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js.map +1 -1
- package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js +21 -15
- package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js.map +1 -1
- package/dist/components/CurrencySelect/CurrencySelect.esm.js +24 -21
- package/dist/components/CurrencySelect/CurrencySelect.esm.js.map +1 -1
- package/dist/components/EntityCosts/EntityCosts.esm.js +8 -7
- package/dist/components/EntityCosts/EntityCosts.esm.js.map +1 -1
- package/dist/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js +65 -20
- package/dist/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js.map +1 -1
- package/dist/components/LegendItem/LegendItem.esm.js +34 -29
- package/dist/components/LegendItem/LegendItem.esm.js.map +1 -1
- package/dist/components/MetricSelect/MetricSelect.esm.js +19 -14
- package/dist/components/MetricSelect/MetricSelect.esm.js.map +1 -1
- package/dist/components/PeriodSelect/PeriodSelect.esm.js +15 -15
- package/dist/components/PeriodSelect/PeriodSelect.esm.js.map +1 -1
- package/dist/components/ProductInsights/ProductInsights.esm.js +12 -8
- package/dist/components/ProductInsights/ProductInsights.esm.js.map +1 -1
- package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js +20 -15
- package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js.map +1 -1
- package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js +9 -9
- package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js.map +1 -1
- package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js +25 -15
- package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js.map +1 -1
- package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js +14 -14
- package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js.map +1 -1
- package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js +43 -35
- package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js.map +1 -1
- package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js +5 -5
- package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js.map +1 -1
- package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js +5 -2
- package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js.map +1 -1
- package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js +55 -9
- package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js.map +1 -1
- package/dist/components/ProjectSelect/ProjectSelect.esm.js +15 -15
- package/dist/components/ProjectSelect/ProjectSelect.esm.js.map +1 -1
- package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js +12 -9
- package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js.map +1 -1
- package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js +40 -10
- package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js.map +1 -1
- package/dist/example/alerts/KubernetesMigrationAlert.esm.js +10 -3
- package/dist/example/alerts/KubernetesMigrationAlert.esm.js.map +1 -1
- package/dist/example/client.esm.js +1 -1
- package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js +20 -17
- package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js.map +1 -1
- package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js +3 -2
- package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js.map +1 -1
- package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js +14 -9
- package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js.map +1 -1
- package/dist/example/forms/KubernetesMigrationDismissForm.esm.js +21 -17
- package/dist/example/forms/KubernetesMigrationDismissForm.esm.js.map +1 -1
- package/dist/forms/AlertAcceptForm.esm.js +5 -4
- package/dist/forms/AlertAcceptForm.esm.js.map +1 -1
- package/dist/forms/AlertDismissForm.esm.js +47 -38
- package/dist/forms/AlertDismissForm.esm.js.map +1 -1
- package/dist/forms/AlertSnoozeForm.esm.js +20 -16
- package/dist/forms/AlertSnoozeForm.esm.js.map +1 -1
- package/dist/hooks/useConfig.esm.js +3 -2
- package/dist/hooks/useConfig.esm.js.map +1 -1
- package/dist/hooks/useCurrency.esm.js +6 -3
- package/dist/hooks/useCurrency.esm.js.map +1 -1
- package/dist/hooks/useFilters.esm.js +10 -7
- package/dist/hooks/useFilters.esm.js.map +1 -1
- package/dist/hooks/useGroups.esm.js +7 -4
- package/dist/hooks/useGroups.esm.js.map +1 -1
- package/dist/hooks/useLastCompleteBillingDate.esm.js +8 -7
- package/dist/hooks/useLastCompleteBillingDate.esm.js.map +1 -1
- package/dist/hooks/useLoading.esm.js +6 -2
- package/dist/hooks/useLoading.esm.js.map +1 -1
- package/dist/hooks/useScroll.esm.js +6 -3
- package/dist/hooks/useScroll.esm.js.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +3 -11
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js +14 -0
- package/dist/routes.esm.js.map +1 -0
- package/dist/testUtils/providers.esm.js +3 -3
- package/dist/testUtils/providers.esm.js.map +1 -1
- package/dist/utils/navigation.esm.js +10 -10
- package/dist/utils/navigation.esm.js.map +1 -1
- package/dist/utils/scroll.esm.js +3 -2
- package/dist/utils/scroll.esm.js.map +1 -1
- package/package.json +44 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage-community/plugin-cost-insights
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 364eea8: Adds support for Backstage's new frontend system, available via the `/alpha` sub-path export.
|
|
8
|
+
|
|
9
|
+
## 0.16.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 74ab831: Backstage version bump to v1.40.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [74ab831]
|
|
18
|
+
- @backstage-community/plugin-cost-insights-common@0.5.0
|
|
19
|
+
|
|
3
20
|
## 0.15.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { ProjectGrowthAlertCard } from '../components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js';
|
|
3
3
|
|
|
4
4
|
class ProjectGrowthAlert {
|
|
@@ -16,7 +16,7 @@ class ProjectGrowthAlert {
|
|
|
16
16
|
return "Cost growth outpacing business growth is unsustainable long-term.";
|
|
17
17
|
}
|
|
18
18
|
get element() {
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(ProjectGrowthAlertCard, { alert: this.data });
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -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
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { UnlabeledDataflowAlertCard } from '../components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js';
|
|
3
3
|
|
|
4
4
|
class UnlabeledDataflowAlert {
|
|
@@ -17,7 +17,7 @@ class UnlabeledDataflowAlert {
|
|
|
17
17
|
return "Labels show in billing data, enabling cost insights for each workflow.";
|
|
18
18
|
}
|
|
19
19
|
get element() {
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsx(UnlabeledDataflowAlertCard, { alert: this.data });
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -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
|
|
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;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { PageBlueprint, NavItemBlueprint } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
|
|
4
|
+
import { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
5
|
+
import MoneyIcon from '@material-ui/icons/MonetizationOn';
|
|
6
|
+
import { rootRouteRef, projectGrowthAlertRef, unlabeledDataflowAlertRef } from '../routes.esm.js';
|
|
7
|
+
|
|
8
|
+
const CostInsightsPage = PageBlueprint.make({
|
|
9
|
+
params: {
|
|
10
|
+
defaultPath: "/cost-insights",
|
|
11
|
+
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
12
|
+
loader: () => import('../components/CostInsightsPage/index.esm.js').then(
|
|
13
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.CostInsightsPage, {}))
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const CostInsightsProjectGrowthInstructionsPage = PageBlueprint.make({
|
|
18
|
+
params: {
|
|
19
|
+
defaultPath: "/cost-insights/investigating-growth",
|
|
20
|
+
routeRef: convertLegacyRouteRef(projectGrowthAlertRef),
|
|
21
|
+
loader: () => import('../components/ProjectGrowthInstructionsPage/index.esm.js').then(
|
|
22
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ProjectGrowthInstructionsPage, {}))
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const CostInsightsLabelDataflowInstructionsPage = PageBlueprint.make({
|
|
27
|
+
params: {
|
|
28
|
+
defaultPath: "/cost-insights/labeling-jobs",
|
|
29
|
+
routeRef: convertLegacyRouteRef(unlabeledDataflowAlertRef),
|
|
30
|
+
loader: () => import('../components/LabelDataflowInstructionsPage/index.esm.js').then(
|
|
31
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.LabelDataflowInstructionsPage, {}))
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const EntityCostInsightsContent = EntityContentBlueprint.make({
|
|
36
|
+
name: "EntityCostInsightsContent",
|
|
37
|
+
params: {
|
|
38
|
+
defaultPath: "/cost-insights",
|
|
39
|
+
defaultTitle: "Cost Insights",
|
|
40
|
+
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
41
|
+
loader: () => import('../components/EntityCosts/index.esm.js').then(
|
|
42
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.EntityCosts, {}))
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const CostInsightsNavItem = NavItemBlueprint.make({
|
|
47
|
+
params: {
|
|
48
|
+
title: "Cost Insights",
|
|
49
|
+
routeRef: convertLegacyRouteRef(rootRouteRef),
|
|
50
|
+
icon: MoneyIcon
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export { CostInsightsLabelDataflowInstructionsPage, CostInsightsNavItem, CostInsightsPage, CostInsightsProjectGrowthInstructionsPage, EntityCostInsightsContent };
|
|
55
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +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} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport { EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport MoneyIcon from '@material-ui/icons/MonetizationOn';\nimport {\n projectGrowthAlertRef,\n rootRouteRef,\n unlabeledDataflowAlertRef,\n} from '../routes';\n\n/** @alpha */\nexport const CostInsightsPage = PageBlueprint.make({\n params: {\n defaultPath: '/cost-insights',\n routeRef: convertLegacyRouteRef(rootRouteRef),\n loader: () =>\n import('../components/CostInsightsPage').then(m =>\n compatWrapper(<m.CostInsightsPage />),\n ),\n },\n});\n\n/** @alpha */\nexport const CostInsightsProjectGrowthInstructionsPage = PageBlueprint.make({\n params: {\n defaultPath: '/cost-insights/investigating-growth',\n routeRef: convertLegacyRouteRef(projectGrowthAlertRef),\n loader: () =>\n import('../components/ProjectGrowthInstructionsPage').then(m =>\n compatWrapper(<m.ProjectGrowthInstructionsPage />),\n ),\n },\n});\n\n/** @alpha */\nexport const CostInsightsLabelDataflowInstructionsPage = PageBlueprint.make({\n params: {\n defaultPath: '/cost-insights/labeling-jobs',\n routeRef: convertLegacyRouteRef(unlabeledDataflowAlertRef),\n loader: () =>\n import('../components/LabelDataflowInstructionsPage').then(m =>\n compatWrapper(<m.LabelDataflowInstructionsPage />),\n ),\n },\n});\n\n/** @alpha */\nexport const EntityCostInsightsContent = EntityContentBlueprint.make({\n name: 'EntityCostInsightsContent',\n params: {\n defaultPath: '/cost-insights',\n defaultTitle: 'Cost Insights',\n routeRef: convertLegacyRouteRef(rootRouteRef),\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"],"names":[],"mappings":";;;;;;;AAiCa,MAAA,gBAAA,GAAmB,cAAc,IAAK,CAAA;AAAA,EACjD,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,gBAAA;AAAA,IACb,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,MAAQ,EAAA,MACN,OAAO,6CAAgC,CAAE,CAAA,IAAA;AAAA,MAAK,OAC5C,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,gBAAA,EAAF,EAAmB,CAAE;AAAA;AACtC;AAEN,CAAC;AAGY,MAAA,yCAAA,GAA4C,cAAc,IAAK,CAAA;AAAA,EAC1E,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,qCAAA;AAAA,IACb,QAAA,EAAU,sBAAsB,qBAAqB,CAAA;AAAA,IACrD,MAAQ,EAAA,MACN,OAAO,0DAA6C,CAAE,CAAA,IAAA;AAAA,MAAK,OACzD,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,6BAAA,EAAF,EAAgC,CAAE;AAAA;AACnD;AAEN,CAAC;AAGY,MAAA,yCAAA,GAA4C,cAAc,IAAK,CAAA;AAAA,EAC1E,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,8BAAA;AAAA,IACb,QAAA,EAAU,sBAAsB,yBAAyB,CAAA;AAAA,IACzD,MAAQ,EAAA,MACN,OAAO,0DAA6C,CAAE,CAAA,IAAA;AAAA,MAAK,OACzD,aAAc,iBAAA,GAAA,CAAC,CAAE,CAAA,6BAAA,EAAF,EAAgC,CAAE;AAAA;AACnD;AAEN,CAAC;AAGY,MAAA,yBAAA,GAA4B,uBAAuB,IAAK,CAAA;AAAA,EACnE,IAAM,EAAA,2BAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,WAAa,EAAA,gBAAA;AAAA,IACb,YAAc,EAAA,eAAA;AAAA,IACd,QAAA,EAAU,sBAAsB,YAAY,CAAA;AAAA,IAC5C,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;;;;"}
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
|
+
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
6
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
7
|
+
|
|
8
|
+
declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
9
|
+
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
10
|
+
growthAlerts: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
11
|
+
unlabeledDataflowAlerts: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
12
|
+
}, {}, {
|
|
13
|
+
"entity-content:cost-insights/EntityCostInsightsContent": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
14
|
+
kind: "entity-content";
|
|
15
|
+
name: "EntityCostInsightsContent";
|
|
16
|
+
config: {
|
|
17
|
+
path: string | undefined;
|
|
18
|
+
title: string | undefined;
|
|
19
|
+
filter: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
20
|
+
group: string | false | undefined;
|
|
21
|
+
};
|
|
22
|
+
configInput: {
|
|
23
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
path?: string | undefined;
|
|
26
|
+
group?: string | false | undefined;
|
|
27
|
+
};
|
|
28
|
+
output: _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", {
|
|
29
|
+
optional: true;
|
|
30
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
31
|
+
optional: true;
|
|
32
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
33
|
+
optional: true;
|
|
34
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-group", {
|
|
35
|
+
optional: true;
|
|
36
|
+
}>;
|
|
37
|
+
inputs: {};
|
|
38
|
+
params: {
|
|
39
|
+
loader: () => Promise<JSX.Element>;
|
|
40
|
+
defaultPath: string;
|
|
41
|
+
defaultTitle: string;
|
|
42
|
+
defaultGroup?: (string & {}) | "overview" | "documentation" | "development" | "deployment" | "operation" | "observability" | undefined;
|
|
43
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
44
|
+
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
"nav-item:cost-insights": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
48
|
+
kind: "nav-item";
|
|
49
|
+
name: undefined;
|
|
50
|
+
config: {};
|
|
51
|
+
configInput: {};
|
|
52
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
|
|
53
|
+
title: string;
|
|
54
|
+
icon: _backstage_core_plugin_api.IconComponent;
|
|
55
|
+
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
56
|
+
}, "core.nav-item.target", {}>;
|
|
57
|
+
inputs: {};
|
|
58
|
+
params: {
|
|
59
|
+
title: string;
|
|
60
|
+
icon: _backstage_core_plugin_api.IconComponent;
|
|
61
|
+
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
"page:cost-insights": _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
65
|
+
kind: "page";
|
|
66
|
+
name: undefined;
|
|
67
|
+
config: {
|
|
68
|
+
path: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
configInput: {
|
|
71
|
+
path?: string | undefined;
|
|
72
|
+
};
|
|
73
|
+
output: _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", {
|
|
74
|
+
optional: true;
|
|
75
|
+
}>;
|
|
76
|
+
inputs: {};
|
|
77
|
+
params: {
|
|
78
|
+
defaultPath: string;
|
|
79
|
+
loader: () => Promise<JSX.Element>;
|
|
80
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
81
|
+
};
|
|
82
|
+
}>;
|
|
83
|
+
}>;
|
|
84
|
+
|
|
85
|
+
export { _default as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
2
|
+
import { rootRouteRef, projectGrowthAlertRef, unlabeledDataflowAlertRef } from './routes.esm.js';
|
|
3
|
+
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import { CostInsightsPage, CostInsightsProjectGrowthInstructionsPage, CostInsightsLabelDataflowInstructionsPage, EntityCostInsightsContent, CostInsightsNavItem } from './alpha/plugin.esm.js';
|
|
5
|
+
|
|
6
|
+
var alpha = createFrontendPlugin({
|
|
7
|
+
pluginId: "cost-insights",
|
|
8
|
+
extensions: [
|
|
9
|
+
CostInsightsPage,
|
|
10
|
+
CostInsightsProjectGrowthInstructionsPage,
|
|
11
|
+
CostInsightsLabelDataflowInstructionsPage,
|
|
12
|
+
EntityCostInsightsContent,
|
|
13
|
+
CostInsightsNavItem
|
|
14
|
+
],
|
|
15
|
+
routes: convertLegacyRouteRefs({
|
|
16
|
+
root: rootRouteRef,
|
|
17
|
+
growthAlerts: projectGrowthAlertRef,
|
|
18
|
+
unlabeledDataflowAlerts: unlabeledDataflowAlertRef
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { alpha as default };
|
|
23
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.ts"],"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 { convertLegacyRouteRefs } from '@backstage/core-compat-api';\n\nimport {\n projectGrowthAlertRef,\n rootRouteRef,\n unlabeledDataflowAlertRef,\n} from './routes';\nimport { createFrontendPlugin } from '@backstage/frontend-plugin-api';\nimport {\n CostInsightsLabelDataflowInstructionsPage,\n CostInsightsNavItem,\n CostInsightsPage,\n CostInsightsProjectGrowthInstructionsPage,\n EntityCostInsightsContent,\n} from './alpha/plugin';\n\nexport default createFrontendPlugin({\n pluginId: 'cost-insights',\n extensions: [\n CostInsightsPage,\n CostInsightsProjectGrowthInstructionsPage,\n CostInsightsLabelDataflowInstructionsPage,\n EntityCostInsightsContent,\n CostInsightsNavItem,\n ],\n routes: convertLegacyRouteRefs({\n root: rootRouteRef,\n growthAlerts: projectGrowthAlertRef,\n unlabeledDataflowAlerts: unlabeledDataflowAlertRef,\n }),\n});\n"],"names":[],"mappings":";;;;;AAgCA,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,eAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,gBAAA;AAAA,IACA,yCAAA;AAAA,IACA,yCAAA;AAAA,IACA,yBAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA,YAAA;AAAA,IACN,YAAc,EAAA,qBAAA;AAAA,IACd,uBAAyB,EAAA;AAAA,GAC1B;AACH,CAAC,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import Card from '@material-ui/core/Card';
|
|
4
4
|
import CardHeader from '@material-ui/core/CardHeader';
|
|
@@ -27,7 +27,7 @@ const ActionItemCard = ({
|
|
|
27
27
|
setScroll(`alert-${number}`);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx(Card, { className: classes.card, raised: false, onClick: onActionItemClick, children: /* @__PURE__ */ jsx(
|
|
31
31
|
CardHeader,
|
|
32
32
|
{
|
|
33
33
|
classes: {
|
|
@@ -39,7 +39,7 @@ const ActionItemCard = ({
|
|
|
39
39
|
subheader: alert.subtitle,
|
|
40
40
|
avatar
|
|
41
41
|
}
|
|
42
|
-
));
|
|
42
|
+
) });
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export { ActionItemCard };
|
|
@@ -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
|
|
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,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment as Fragment$1 } from 'react';
|
|
2
3
|
import Avatar from '@material-ui/core/Avatar';
|
|
3
4
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
4
5
|
import IconButton from '@material-ui/core/IconButton';
|
|
@@ -26,16 +27,16 @@ const AlertStatusButton = ({
|
|
|
26
27
|
icon,
|
|
27
28
|
onClick,
|
|
28
29
|
...buttonProps
|
|
29
|
-
}) => /* @__PURE__ */
|
|
30
|
+
}) => /* @__PURE__ */ jsx(Tooltip, { title, children: /* @__PURE__ */ jsx(
|
|
30
31
|
IconButton,
|
|
31
32
|
{
|
|
32
33
|
onClick,
|
|
33
34
|
role: "button",
|
|
34
35
|
"aria-hidden": false,
|
|
35
|
-
...buttonProps
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
));
|
|
36
|
+
...buttonProps,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Badge, { badgeContent: amount, children: icon })
|
|
38
|
+
}
|
|
39
|
+
) });
|
|
39
40
|
const ActionItems = ({
|
|
40
41
|
active,
|
|
41
42
|
snoozed,
|
|
@@ -49,41 +50,51 @@ const ActionItems = ({
|
|
|
49
50
|
const isDismissedButtonDisplayed = !!dismissed.length;
|
|
50
51
|
const isStatusButtonGroupDisplayed = !!active.length;
|
|
51
52
|
const onStatusButtonClick = () => setScroll(ScrollType.AlertSummary);
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
53
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Paper, { children: active.map((alert, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
ActionItemCard,
|
|
57
|
+
{
|
|
58
|
+
alert,
|
|
59
|
+
number: index + 1,
|
|
60
|
+
avatar: /* @__PURE__ */ jsx(Avatar, { className: classes.avatar, children: index + 1 })
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
index < active.length - 1 && /* @__PURE__ */ jsx(Divider, {})
|
|
64
|
+
] }, `alert-${index}`)) }),
|
|
65
|
+
isStatusButtonGroupDisplayed && /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "flex-end", mt: 2, children: [
|
|
66
|
+
isAcceptedButtonDisplayed && /* @__PURE__ */ jsx(
|
|
67
|
+
AlertStatusButton,
|
|
68
|
+
{
|
|
69
|
+
title: "Accepted",
|
|
70
|
+
"aria-label": AlertStatus.Accepted,
|
|
71
|
+
icon: /* @__PURE__ */ jsx(AcceptIcon, {}),
|
|
72
|
+
amount: accepted.length,
|
|
73
|
+
onClick: onStatusButtonClick
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
isSnoozedButtonDisplayed && /* @__PURE__ */ jsx(
|
|
77
|
+
AlertStatusButton,
|
|
78
|
+
{
|
|
79
|
+
title: "Snoozed",
|
|
80
|
+
"aria-label": AlertStatus.Snoozed,
|
|
81
|
+
amount: snoozed.length,
|
|
82
|
+
icon: /* @__PURE__ */ jsx(SnoozeIcon, {}),
|
|
83
|
+
onClick: onStatusButtonClick
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
isDismissedButtonDisplayed && /* @__PURE__ */ jsx(
|
|
87
|
+
AlertStatusButton,
|
|
88
|
+
{
|
|
89
|
+
title: "Dismissed",
|
|
90
|
+
"aria-label": AlertStatus.Dismissed,
|
|
91
|
+
icon: /* @__PURE__ */ jsx(DismissIcon, {}),
|
|
92
|
+
amount: dismissed.length,
|
|
93
|
+
onClick: onStatusButtonClick
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] })
|
|
97
|
+
] });
|
|
87
98
|
};
|
|
88
99
|
|
|
89
100
|
export { ActionItems };
|
|
@@ -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
|
|
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":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
3
|
import { capitalize } from '@material-ui/core/utils';
|
|
3
4
|
import Box from '@material-ui/core/Box';
|
|
4
5
|
import Button from '@material-ui/core/Button';
|
|
@@ -53,69 +54,89 @@ const AlertDialog = ({
|
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
const Form = formOf(alert, status);
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
57
58
|
Dialog,
|
|
58
59
|
{
|
|
59
60
|
open,
|
|
60
61
|
onClose: onDialogClose,
|
|
61
62
|
scroll: "body",
|
|
62
63
|
maxWidth: "lg",
|
|
63
|
-
TransitionProps
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
64
|
+
TransitionProps,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", justifyContent: "flex-end", children: /* @__PURE__ */ jsx(
|
|
67
|
+
IconButton,
|
|
68
|
+
{
|
|
69
|
+
className: classes.icon,
|
|
70
|
+
disableRipple: true,
|
|
71
|
+
"aria-label": "Close",
|
|
72
|
+
onClick: onDialogClose,
|
|
73
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
74
|
+
}
|
|
75
|
+
) }),
|
|
76
|
+
/* @__PURE__ */ jsxs(DialogContent, { className: classes.content, children: [
|
|
77
|
+
/* @__PURE__ */ jsxs(Box, { mb: 1.5, children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: /* @__PURE__ */ jsxs("b", { children: [
|
|
79
|
+
capitalize(action),
|
|
80
|
+
" this action item?"
|
|
81
|
+
] }) }),
|
|
82
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", color: "textSecondary", children: /* @__PURE__ */ jsxs("b", { children: [
|
|
83
|
+
"This action item will be ",
|
|
84
|
+
actioned,
|
|
85
|
+
" for all of ",
|
|
86
|
+
group,
|
|
87
|
+
"."
|
|
88
|
+
] }) })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsxs(
|
|
91
|
+
Box,
|
|
92
|
+
{
|
|
93
|
+
display: "flex",
|
|
94
|
+
flexDirection: "column",
|
|
95
|
+
bgcolor: "alertBackground",
|
|
96
|
+
p: 2,
|
|
97
|
+
mb: 1.5,
|
|
98
|
+
borderRadius: 4,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx("b", { children: alert?.title }) }),
|
|
101
|
+
/* @__PURE__ */ jsx(Typography, { color: "textSecondary", children: alert?.subtitle })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
Form && /* @__PURE__ */ jsx(
|
|
106
|
+
Form,
|
|
107
|
+
{
|
|
108
|
+
ref: formRef,
|
|
109
|
+
alert,
|
|
110
|
+
onSubmit,
|
|
111
|
+
disableSubmit
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
116
|
+
/* @__PURE__ */ jsx(DialogActions, { className: classes.actions, disableSpacing: true, children: Form ? /* @__PURE__ */ jsx(
|
|
117
|
+
Button,
|
|
118
|
+
{
|
|
119
|
+
type: "submit",
|
|
120
|
+
color: "primary",
|
|
121
|
+
variant: "contained",
|
|
122
|
+
"aria-label": action,
|
|
123
|
+
form: DEFAULT_FORM_ID,
|
|
124
|
+
disabled: isSubmitDisabled,
|
|
125
|
+
children: capitalize(action)
|
|
126
|
+
}
|
|
127
|
+
) : /* @__PURE__ */ jsx(
|
|
128
|
+
Button,
|
|
129
|
+
{
|
|
130
|
+
type: "button",
|
|
131
|
+
color: "primary",
|
|
132
|
+
variant: "contained",
|
|
133
|
+
"aria-label": action,
|
|
134
|
+
onClick: () => onSubmit(null),
|
|
135
|
+
children: capitalize(action)
|
|
136
|
+
}
|
|
137
|
+
) })
|
|
138
|
+
]
|
|
139
|
+
}
|
|
119
140
|
);
|
|
120
141
|
};
|
|
121
142
|
|