@backstage-community/plugin-cost-insights 0.15.2 → 0.16.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 +11 -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/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/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 +18 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import Box from '@material-ui/core/Box';
|
|
4
4
|
import Divider from '@material-ui/core/Divider';
|
|
@@ -11,19 +11,32 @@ const BarChartTooltip = (props) => {
|
|
|
11
11
|
const titleClassName = classnames(classes.truncate, {
|
|
12
12
|
[classes.maxWidth]: topRight === void 0
|
|
13
13
|
});
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
return /* @__PURE__ */ jsxs(Box, { className: classes.tooltip, display: "flex", flexDirection: "column", children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(
|
|
16
|
+
Box,
|
|
17
|
+
{
|
|
18
|
+
display: "flex",
|
|
19
|
+
flexDirection: "row",
|
|
20
|
+
justifyContent: "space-between",
|
|
21
|
+
alignItems: "baseline",
|
|
22
|
+
px: 2,
|
|
23
|
+
pt: 2,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsxs(Box, { display: "flex", flexDirection: "column", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Typography, { className: titleClassName, variant: "h6", children: title }),
|
|
27
|
+
subtitle && /* @__PURE__ */ jsx(Typography, { className: classes.subtitle, variant: "subtitle1", children: subtitle })
|
|
28
|
+
] }),
|
|
29
|
+
topRight && /* @__PURE__ */ jsx(Box, { ml: 2, children: topRight })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
content && /* @__PURE__ */ jsx(Box, { px: 2, pt: 2, className: classes.maxWidth, children: /* @__PURE__ */ jsx(Typography, { variant: "body1", paragraph: true, children: content }) }),
|
|
34
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", flexDirection: "column", p: 2, children }),
|
|
35
|
+
actions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Divider, { className: classes.divider, variant: "fullWidth" }),
|
|
37
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", flexDirection: "column", p: 2, children: actions })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
27
40
|
};
|
|
28
41
|
|
|
29
42
|
export { BarChartTooltip };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChartTooltip.esm.js","sources":["../../../src/components/BarChart/BarChartTooltip.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":"BarChartTooltip.esm.js","sources":["../../../src/components/BarChart/BarChartTooltip.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 { ReactNode, PropsWithChildren } from 'react';\nimport classnames from 'classnames';\nimport Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport Typography from '@material-ui/core/Typography';\nimport { useTooltipStyles as useStyles } from '../../utils/styles';\n\n/** @public */\nexport type BarChartTooltipProps = {\n title: string;\n content?: ReactNode | string;\n subtitle?: ReactNode;\n topRight?: ReactNode;\n actions?: ReactNode;\n};\n\n/** @public */\nexport const BarChartTooltip = (\n props: PropsWithChildren<BarChartTooltipProps>,\n) => {\n const { title, content, subtitle, topRight, actions, children } = props;\n\n const classes = useStyles();\n const titleClassName = classnames(classes.truncate, {\n [classes.maxWidth]: topRight === undefined,\n });\n\n return (\n <Box className={classes.tooltip} display=\"flex\" flexDirection=\"column\">\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"baseline\"\n px={2}\n pt={2}\n >\n <Box display=\"flex\" flexDirection=\"column\">\n <Typography className={titleClassName} variant=\"h6\">\n {title}\n </Typography>\n {subtitle && (\n <Typography className={classes.subtitle} variant=\"subtitle1\">\n {subtitle}\n </Typography>\n )}\n </Box>\n {topRight && <Box ml={2}>{topRight}</Box>}\n </Box>\n {content && (\n <Box px={2} pt={2} className={classes.maxWidth}>\n <Typography variant=\"body1\" paragraph>\n {content}\n </Typography>\n </Box>\n )}\n <Box display=\"flex\" flexDirection=\"column\" p={2}>\n {children}\n </Box>\n {actions && (\n <>\n <Divider className={classes.divider} variant=\"fullWidth\" />\n <Box display=\"flex\" flexDirection=\"column\" p={2}>\n {actions}\n </Box>\n </>\n )}\n </Box>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;AAiCa,MAAA,eAAA,GAAkB,CAC7B,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G,EAAA,SAAA,EAAW,OAAQ,CAAA,QAAA,EACpC,8BAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,SAAQ,SAAS,EAAA,IAAA,EAClC,mBACH,CACF,EAAA,CAAA;AAAA,oBAEF,GAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,eAAc,QAAS,EAAA,CAAA,EAAG,GAC3C,QACH,EAAA,CAAA;AAAA,IACC,2BAEG,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,OAAQ,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,OAAA,EAAS,SAAQ,WAAY,EAAA,CAAA;AAAA,sBACzD,GAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,eAAc,QAAS,EAAA,CAAA,EAAG,GAC3C,QACH,EAAA,OAAA,EAAA;AAAA,KACF,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Box from '@material-ui/core/Box';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
4
|
import LensIcon from '@material-ui/icons/Lens';
|
|
@@ -7,16 +7,21 @@ import { useTooltipStyles } from '../../utils/styles.esm.js';
|
|
|
7
7
|
const BarChartTooltipItem = (props) => {
|
|
8
8
|
const { item } = props;
|
|
9
9
|
const classes = useTooltipStyles();
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
11
11
|
Box,
|
|
12
12
|
{
|
|
13
13
|
display: "flex",
|
|
14
14
|
alignItems: "center",
|
|
15
15
|
justifyContent: "space-between",
|
|
16
|
-
minHeight: 25
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
minHeight: 25,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsxs(Box, { display: "flex", alignContent: "center", marginRight: ".5em", children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", marginRight: ".5em", children: /* @__PURE__ */ jsx(LensIcon, { className: classes.lensIcon, style: { fill: item.fill } }) }),
|
|
20
|
+
/* @__PURE__ */ jsx(Typography, { children: item.label })
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ jsx(Typography, { display: "block", children: item.value })
|
|
23
|
+
]
|
|
24
|
+
}
|
|
20
25
|
);
|
|
21
26
|
};
|
|
22
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChartTooltipItem.esm.js","sources":["../../../src/components/BarChart/BarChartTooltipItem.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":"BarChartTooltipItem.esm.js","sources":["../../../src/components/BarChart/BarChartTooltipItem.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 LensIcon from '@material-ui/icons/Lens';\nimport { useTooltipStyles as useStyles } from '../../utils/styles';\n\n/** @public */\nexport type TooltipItem = {\n fill: string;\n label?: string;\n value?: string;\n};\n\n/** @public */\nexport type BarChartTooltipItemProps = {\n item: TooltipItem;\n};\n\n/** @public */\nexport const BarChartTooltipItem = (props: BarChartTooltipItemProps) => {\n const { item } = props;\n\n const classes = useStyles();\n\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n minHeight={25}\n >\n <Box display=\"flex\" alignContent=\"center\" marginRight=\".5em\">\n <Box display=\"flex\" alignItems=\"center\" marginRight=\".5em\">\n <LensIcon className={classes.lensIcon} style={{ fill: item.fill }} />\n </Box>\n <Typography>{item.label}</Typography>\n </Box>\n <Typography display=\"block\">{item.value}</Typography>\n </Box>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;AAkCa,MAAA,mBAAA,GAAsB,CAAC,KAAoC,KAAA;AACtE,EAAM,MAAA,EAAE,MAAS,GAAA,KAAA;AAEjB,EAAA,MAAM,UAAUA,gBAAU,EAAA;AAE1B,EACE,uBAAA,IAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,OAAQ,EAAA,MAAA;AAAA,MACR,UAAW,EAAA,QAAA;AAAA,MACX,cAAe,EAAA,eAAA;AAAA,MACf,SAAW,EAAA,EAAA;AAAA,MAEX,QAAA,EAAA;AAAA,wBAAA,IAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,YAAa,EAAA,QAAA,EAAS,aAAY,MACpD,EAAA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAAS,EAAA,WAAA,EAAY,QAClD,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EAAS,SAAW,EAAA,OAAA,CAAQ,UAAU,KAAO,EAAA,EAAE,MAAM,IAAK,CAAA,IAAA,IAAQ,CACrE,EAAA,CAAA;AAAA,0BACA,GAAA,CAAC,UAAY,EAAA,EAAA,QAAA,EAAA,IAAA,CAAK,KAAM,EAAA;AAAA,SAC1B,EAAA,CAAA;AAAA,wBACC,GAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAS,eAAK,KAAM,EAAA;AAAA;AAAA;AAAA,GAC1C;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { useLocation } from 'react-router-dom';
|
|
3
4
|
import useCopyToClipboard from 'react-use/esm/useCopyToClipboard';
|
|
4
5
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
@@ -37,7 +38,7 @@ const CopyUrlToClipboard = () => {
|
|
|
37
38
|
text = ClipboardMessage.success;
|
|
38
39
|
Icon = AssignmentTurnedInOutlinedIcon;
|
|
39
40
|
}
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: text, arrow: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: () => copyToClipboard(url), children: /* @__PURE__ */ jsx(Icon, {}) }) });
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
export { CopyUrlToClipboard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyUrlToClipboard.esm.js","sources":["../../../src/components/CopyUrlToClipboard/CopyUrlToClipboard.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":"CopyUrlToClipboard.esm.js","sources":["../../../src/components/CopyUrlToClipboard/CopyUrlToClipboard.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 { useLocation } from 'react-router-dom';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport IconButton from '@material-ui/core/IconButton';\nimport AssignmentOutlinedIcon from '@material-ui/icons/AssignmentOutlined';\nimport AssignmentTurnedInOutlinedIcon from '@material-ui/icons/AssignmentTurnedInOutlined';\nimport SentimentVeryDissatisfiedIcon from '@material-ui/icons/SentimentVeryDissatisfied';\n\nconst ClipboardMessage = {\n default: 'Copy URL to clipboard',\n success: 'Copied!',\n error: \"Couldn't copy to clipboard\",\n};\n\nexport const CopyUrlToClipboard = () => {\n const location = useLocation();\n const [state, copyToClipboard] = useCopyToClipboard();\n const [copied, setCopied] = useState(false);\n\n const origin = window.location.origin;\n const pathname = location.pathname;\n const search = location.search;\n const url = `${origin}${pathname}${search}`;\n\n useEffect(() => {\n if (state.error) {\n setCopied(false);\n } else if (state.value) {\n setCopied(true);\n setTimeout(setCopied, 1500, false);\n }\n }, [state]);\n\n let text = ClipboardMessage.default;\n let Icon = AssignmentOutlinedIcon;\n\n if (state.error) {\n text = ClipboardMessage.error;\n Icon = SentimentVeryDissatisfiedIcon;\n } else if (copied) {\n text = ClipboardMessage.success;\n Icon = AssignmentTurnedInOutlinedIcon;\n }\n\n return (\n <Tooltip title={text} arrow>\n <IconButton onClick={() => copyToClipboard(url)}>\n <Icon />\n </IconButton>\n </Tooltip>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAyBA,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AAA,EAAA,EAAW,OAAS,EAAA,MAAM,gBAAgB,GAAG,CAAA,EAC5C,QAAC,kBAAA,GAAA,CAAA,IAAA,EAAA,EAAK,GACR,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
4
|
import '../../types/Alert.esm.js';
|
|
@@ -34,21 +34,40 @@ const CostGrowth = (props) => {
|
|
|
34
34
|
[styles.savings]: growth === GrowthType.Savings
|
|
35
35
|
});
|
|
36
36
|
if (engineers < engineerThreshold) {
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ jsx(Typography, { component: "span", className: classes, children: "Negligible" });
|
|
38
38
|
}
|
|
39
39
|
if (currency.kind === CurrencyType.USD) {
|
|
40
40
|
if (isNaN(ratio)) {
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsxs(Typography, { component: "span", className: classes, children: [
|
|
42
|
+
"~",
|
|
43
|
+
currency.prefix,
|
|
44
|
+
formatCurrency(converted)
|
|
45
|
+
] });
|
|
42
46
|
}
|
|
43
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ jsxs(Typography, { component: "span", className: classes, children: [
|
|
48
|
+
formatPercent(ratio),
|
|
49
|
+
" or ~",
|
|
50
|
+
currency.prefix,
|
|
51
|
+
formatCurrency(converted)
|
|
52
|
+
] });
|
|
44
53
|
}
|
|
45
54
|
if (amount < 1) {
|
|
46
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ jsxs(Typography, { component: "span", className: classes, children: [
|
|
56
|
+
"less than ",
|
|
57
|
+
indefiniteArticleOf(["a", "an"], currency.unit)
|
|
58
|
+
] });
|
|
47
59
|
}
|
|
48
60
|
if (isNaN(ratio)) {
|
|
49
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ jsxs(Typography, { component: "span", className: classes, children: [
|
|
62
|
+
"~",
|
|
63
|
+
formatCurrency(converted, currency.unit)
|
|
64
|
+
] });
|
|
50
65
|
}
|
|
51
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ jsxs(Typography, { component: "span", className: classes, children: [
|
|
67
|
+
formatPercent(ratio),
|
|
68
|
+
" or ~",
|
|
69
|
+
formatCurrency(converted, currency.unit)
|
|
70
|
+
] });
|
|
52
71
|
};
|
|
53
72
|
|
|
54
73
|
export { CostGrowth };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostGrowth.esm.js","sources":["../../../src/components/CostGrowth/CostGrowth.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":"CostGrowth.esm.js","sources":["../../../src/components/CostGrowth/CostGrowth.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 classnames from 'classnames';\nimport Typography from '@material-ui/core/Typography';\nimport { CurrencyType, Duration, GrowthType } from '../../types';\nimport { ChangeStatistic } from '@backstage-community/plugin-cost-insights-common';\nimport { rateOf } from '../../utils/currency';\nimport { growthOf } from '../../utils/change';\nimport { useCostGrowthStyles as useStyles } from '../../utils/styles';\nimport { formatPercent, formatCurrency } from '../../utils/formatters';\nimport { indefiniteArticleOf } from '../../utils/grammar';\nimport { useConfig, useCurrency } from '../../hooks';\nimport { notEmpty } from '../../utils/assert';\n\n/** @public */\nexport type CostGrowthProps = {\n change: ChangeStatistic;\n duration: Duration;\n};\n\n/** @public */\nexport const CostGrowth = (props: CostGrowthProps) => {\n const { change, duration } = props;\n\n const styles = useStyles();\n const { engineerCost, engineerThreshold } = useConfig();\n const [currency] = useCurrency();\n\n // Only display costs in absolute values\n const amount = Math.abs(change.amount);\n const ratio = Math.abs(change.ratio ?? NaN);\n\n const rate = rateOf(engineerCost, duration);\n const engineers = amount / rate;\n const converted = amount / (currency.rate ?? rate);\n\n // If a ratio cannot be calculated, don't format.\n const growth = notEmpty(change.ratio)\n ? growthOf({ ratio: change.ratio, amount: engineers }, engineerThreshold)\n : null;\n // Determine if growth is significant enough to highlight\n const classes = classnames({\n [styles.excess]: growth === GrowthType.Excess,\n [styles.savings]: growth === GrowthType.Savings,\n });\n\n if (engineers < engineerThreshold) {\n return (\n <Typography component=\"span\" className={classes}>\n Negligible\n </Typography>\n );\n }\n\n if (currency.kind === CurrencyType.USD) {\n // Do not display percentage if ratio cannot be calculated\n if (isNaN(ratio)) {\n return (\n <Typography component=\"span\" className={classes}>\n ~{currency.prefix}\n {formatCurrency(converted)}\n </Typography>\n );\n }\n\n return (\n <Typography component=\"span\" className={classes}>\n {formatPercent(ratio)} or ~{currency.prefix}\n {formatCurrency(converted)}\n </Typography>\n );\n }\n\n if (amount < 1) {\n return (\n <Typography component=\"span\" className={classes}>\n less than {indefiniteArticleOf(['a', 'an'], currency.unit)}\n </Typography>\n );\n }\n\n // Do not display percentage if ratio cannot be calculated\n if (isNaN(ratio)) {\n return (\n <Typography component=\"span\" className={classes}>\n ~{formatCurrency(converted, currency.unit)}\n </Typography>\n );\n }\n\n return (\n <Typography component=\"span\" className={classes}>\n {formatPercent(ratio)} or ~{formatCurrency(converted, currency.unit)}\n </Typography>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCa,MAAA,UAAA,GAAa,CAAC,KAA2B,KAAA;AACpD,EAAM,MAAA,EAAE,MAAQ,EAAA,QAAA,EAAa,GAAA,KAAA;AAE7B,EAAA,MAAM,SAASA,mBAAU,EAAA;AACzB,EAAA,MAAM,EAAE,YAAA,EAAc,iBAAkB,EAAA,GAAI,SAAU,EAAA;AACtD,EAAM,MAAA,CAAC,QAAQ,CAAA,GAAI,WAAY,EAAA;AAG/B,EAAA,MAAM,MAAS,GAAA,IAAA,CAAK,GAAI,CAAA,MAAA,CAAO,MAAM,CAAA;AACrC,EAAA,MAAM,KAAQ,GAAA,IAAA,CAAK,GAAI,CAAA,MAAA,CAAO,SAAS,GAAG,CAAA;AAE1C,EAAM,MAAA,IAAA,GAAO,MAAO,CAAA,YAAA,EAAc,QAAQ,CAAA;AAC1C,EAAA,MAAM,YAAY,MAAS,GAAA,IAAA;AAC3B,EAAM,MAAA,SAAA,GAAY,MAAU,IAAA,QAAA,CAAS,IAAQ,IAAA,IAAA,CAAA;AAG7C,EAAA,MAAM,MAAS,GAAA,QAAA,CAAS,MAAO,CAAA,KAAK,IAChC,QAAS,CAAA,EAAE,KAAO,EAAA,MAAA,CAAO,KAAO,EAAA,MAAA,EAAQ,SAAU,EAAA,EAAG,iBAAiB,CACtE,GAAA,IAAA;AAEJ,EAAA,MAAM,UAAU,UAAW,CAAA;AAAA,IACzB,CAAC,MAAA,CAAO,MAAM,GAAG,WAAW,UAAW,CAAA,MAAA;AAAA,IACvC,CAAC,MAAA,CAAO,OAAO,GAAG,WAAW,UAAW,CAAA;AAAA,GACzC,CAAA;AAED,EAAA,IAAI,YAAY,iBAAmB,EAAA;AACjC,IAAA,2BACG,UAAW,EAAA,EAAA,SAAA,EAA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,EAAA,QAAA,EAAA;AAAA,IAAA,aAAA,CAAc,KAAK,CAAA;AAAA,IAAE,OAAA;AAAA,IAAM,cAAA,CAAe,SAAW,EAAA,QAAA,CAAS,IAAI;AAAA,GACrE,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
4
|
import ArrowDropUp from '@material-ui/icons/ArrowDropUp';
|
|
@@ -24,7 +24,11 @@ const CostGrowthIndicator = (props) => {
|
|
|
24
24
|
[classes.excess]: growth === GrowthType.Excess,
|
|
25
25
|
[classes.savings]: growth === GrowthType.Savings
|
|
26
26
|
});
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsxs(Typography, { className: classNames, component: "span", ...extraProps, children: [
|
|
28
|
+
formatter ? formatter(change, { absolute: true }) : change.ratio,
|
|
29
|
+
growth === GrowthType.Excess && /* @__PURE__ */ jsx(ArrowDropUp, { "aria-label": "excess" }),
|
|
30
|
+
growth === GrowthType.Savings && /* @__PURE__ */ jsx(ArrowDropDown, { "aria-label": "savings" })
|
|
31
|
+
] });
|
|
28
32
|
};
|
|
29
33
|
|
|
30
34
|
export { CostGrowthIndicator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostGrowthIndicator.esm.js","sources":["../../../src/components/CostGrowth/CostGrowthIndicator.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":"CostGrowthIndicator.esm.js","sources":["../../../src/components/CostGrowth/CostGrowthIndicator.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 classnames from 'classnames';\nimport Typography, { TypographyProps } from '@material-ui/core/Typography';\nimport { default as ArrowDropUp } from '@material-ui/icons/ArrowDropUp';\nimport { default as ArrowDropDown } from '@material-ui/icons/ArrowDropDown';\nimport { growthOf } from '../../utils/change';\nimport { GrowthType } from '../../types';\nimport { useCostGrowthStyles as useStyles } from '../../utils/styles';\nimport {\n ChangeStatistic,\n Maybe,\n} from '@backstage-community/plugin-cost-insights-common';\nimport { useConfig } from '../../hooks';\n\n/** @public */\nexport type CostGrowthIndicatorProps = TypographyProps & {\n change: ChangeStatistic;\n formatter?: (\n change: ChangeStatistic,\n options?: { absolute: boolean },\n ) => Maybe<string>;\n};\n\n/** @public */\nexport const CostGrowthIndicator = (props: CostGrowthIndicatorProps) => {\n const { engineerThreshold } = useConfig();\n const { change, formatter, className, ...extraProps } = props;\n\n const classes = useStyles();\n\n const growth = growthOf(change, engineerThreshold);\n\n const classNames = classnames(classes.indicator, className, {\n [classes.excess]: growth === GrowthType.Excess,\n [classes.savings]: growth === GrowthType.Savings,\n });\n\n return (\n <Typography className={classNames} component=\"span\" {...extraProps}>\n {formatter ? formatter(change, { absolute: true }) : change.ratio}\n {growth === GrowthType.Excess && <ArrowDropUp aria-label=\"excess\" />}\n {growth === GrowthType.Savings && <ArrowDropDown aria-label=\"savings\" />}\n </Typography>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;AAuCa,MAAA,mBAAA,GAAsB,CAAC,KAAoC,KAAA;AACtE,EAAM,MAAA,EAAE,iBAAkB,EAAA,GAAI,SAAU,EAAA;AACxC,EAAA,MAAM,EAAE,MAAQ,EAAA,SAAA,EAAW,SAAW,EAAA,GAAG,YAAe,GAAA,KAAA;AAExD,EAAA,MAAM,UAAUA,mBAAU,EAAA;AAE1B,EAAM,MAAA,MAAA,GAAS,QAAS,CAAA,MAAA,EAAQ,iBAAiB,CAAA;AAEjD,EAAA,MAAM,UAAa,GAAA,UAAA,CAAW,OAAQ,CAAA,SAAA,EAAW,SAAW,EAAA;AAAA,IAC1D,CAAC,OAAA,CAAQ,MAAM,GAAG,WAAW,UAAW,CAAA,MAAA;AAAA,IACxC,CAAC,OAAA,CAAQ,OAAO,GAAG,WAAW,UAAW,CAAA;AAAA,GAC1C,CAAA;AAED,EAAA,4BACG,UAAW,EAAA,EAAA,SAAA,EAAW,YAAY,SAAU,EAAA,MAAA,EAAQ,GAAG,UACrD,EAAA,QAAA,EAAA;AAAA,IAAA,SAAA,GAAY,UAAU,MAAQ,EAAA,EAAE,UAAU,IAAK,EAAC,IAAI,MAAO,CAAA,KAAA;AAAA,IAC3D,WAAW,UAAW,CAAA,MAAA,oBAAW,GAAA,CAAA,WAAA,EAAA,EAAY,cAAW,QAAS,EAAA,CAAA;AAAA,IACjE,WAAW,UAAW,CAAA,OAAA,oBAAY,GAAA,CAAA,aAAA,EAAA,EAAc,cAAW,SAAU,EAAA;AAAA,GACxE,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
import useAsync from 'react-use/esm/useAsync';
|
|
4
4
|
import { useCostInsightsStyles } from '../../utils/styles.esm.js';
|
|
@@ -17,7 +17,24 @@ const CostInsightsHeaderNoData = ({
|
|
|
17
17
|
const classes = useCostInsightsStyles();
|
|
18
18
|
const hasMultipleGroups = groups.length > 1;
|
|
19
19
|
const ownerName = groups.find(({ id }) => id === groupId)?.name ?? groupId;
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h4", align: "center", gutterBottom: true, children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", role: "img", "aria-label": "flushed-face", children: "\u{1F633}" }),
|
|
23
|
+
" ",
|
|
24
|
+
"Well this is awkward"
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsxs(Typography, { className: classes.h6Subtle, align: "center", gutterBottom: true, children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
|
28
|
+
"Hey, ",
|
|
29
|
+
displayName,
|
|
30
|
+
"!"
|
|
31
|
+
] }),
|
|
32
|
+
" ",
|
|
33
|
+
/* @__PURE__ */ jsx("b", { children: ownerName }),
|
|
34
|
+
" doesn't seem to have any cloud costs."
|
|
35
|
+
] }),
|
|
36
|
+
hasMultipleGroups && /* @__PURE__ */ jsx(Typography, { align: "center", gutterBottom: true, children: "Maybe we picked the wrong team, choose another from the menu above?" })
|
|
37
|
+
] });
|
|
21
38
|
};
|
|
22
39
|
const CostInsightsHeaderAlerts = ({
|
|
23
40
|
groupId,
|
|
@@ -27,7 +44,29 @@ const CostInsightsHeaderAlerts = ({
|
|
|
27
44
|
const displayName = useDisplayName();
|
|
28
45
|
const classes = useCostInsightsStyles();
|
|
29
46
|
const ownerName = groups.find(({ id }) => id === groupId)?.name ?? groupId;
|
|
30
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h4", align: "center", gutterBottom: true, children: [
|
|
49
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", role: "img", "aria-label": "magnifying-glass", children: "\u{1F50E}" }),
|
|
50
|
+
" ",
|
|
51
|
+
"You have ",
|
|
52
|
+
alerts,
|
|
53
|
+
" thing",
|
|
54
|
+
alerts > 1 && "s",
|
|
55
|
+
" to look into"
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsxs(Typography, { className: classes.h6Subtle, align: "center", gutterBottom: true, children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
|
59
|
+
"Hey, ",
|
|
60
|
+
displayName,
|
|
61
|
+
"!"
|
|
62
|
+
] }),
|
|
63
|
+
" We've identified",
|
|
64
|
+
" ",
|
|
65
|
+
alerts > 1 ? "a few things " : "one thing ",
|
|
66
|
+
/* @__PURE__ */ jsx("b", { children: ownerName }),
|
|
67
|
+
" should look into next."
|
|
68
|
+
] })
|
|
69
|
+
] });
|
|
31
70
|
};
|
|
32
71
|
const CostInsightsHeaderNoAlerts = ({
|
|
33
72
|
groupId,
|
|
@@ -36,21 +75,51 @@ const CostInsightsHeaderNoAlerts = ({
|
|
|
36
75
|
const displayName = useDisplayName();
|
|
37
76
|
const classes = useCostInsightsStyles();
|
|
38
77
|
const ownerName = groups.find(({ id }) => id === groupId)?.name ?? groupId;
|
|
39
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h4", gutterBottom: true, align: "center", children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", role: "img", "aria-label": "thumbs-up", children: "\u{1F44D}" }),
|
|
81
|
+
" ",
|
|
82
|
+
"Your team is doing great"
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsxs(Typography, { className: classes.h6Subtle, align: "center", gutterBottom: true, children: [
|
|
85
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
|
86
|
+
"Hey, ",
|
|
87
|
+
displayName,
|
|
88
|
+
"!"
|
|
89
|
+
] }),
|
|
90
|
+
" ",
|
|
91
|
+
/* @__PURE__ */ jsx("b", { children: ownerName }),
|
|
92
|
+
" is doing well. No major changes this month."
|
|
93
|
+
] })
|
|
94
|
+
] });
|
|
40
95
|
};
|
|
41
96
|
const CostInsightsHeaderNoGroups = () => {
|
|
42
97
|
const displayName = useDisplayName();
|
|
43
98
|
const classes = useCostInsightsStyles();
|
|
44
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h4", align: "center", gutterBottom: true, children: [
|
|
101
|
+
/* @__PURE__ */ jsx(Typography, { component: "span", role: "img", "aria-label": "flushed-face", children: "\u{1F633}" }),
|
|
102
|
+
" ",
|
|
103
|
+
"Well this is awkward"
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsxs(Typography, { className: classes.h6Subtle, align: "center", gutterBottom: true, children: [
|
|
106
|
+
/* @__PURE__ */ jsxs("b", { children: [
|
|
107
|
+
"Hey, ",
|
|
108
|
+
displayName,
|
|
109
|
+
"!"
|
|
110
|
+
] }),
|
|
111
|
+
" It doesn't look like you belong to any teams."
|
|
112
|
+
] })
|
|
113
|
+
] });
|
|
45
114
|
};
|
|
46
115
|
const CostInsightsHeader = (props) => {
|
|
47
116
|
if (!props.hasCostData) {
|
|
48
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ jsx(CostInsightsHeaderNoData, { ...props });
|
|
49
118
|
}
|
|
50
119
|
if (props.alerts) {
|
|
51
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ jsx(CostInsightsHeaderAlerts, { ...props });
|
|
52
121
|
}
|
|
53
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ jsx(CostInsightsHeaderNoAlerts, { ...props });
|
|
54
123
|
};
|
|
55
124
|
|
|
56
125
|
export { CostInsightsHeader, CostInsightsHeaderNoGroups };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostInsightsHeader.esm.js","sources":["../../../src/components/CostInsightsHeader/CostInsightsHeader.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":"CostInsightsHeader.esm.js","sources":["../../../src/components/CostInsightsHeader/CostInsightsHeader.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 Typography from '@material-ui/core/Typography';\nimport useAsync from 'react-use/esm/useAsync';\nimport { useCostInsightsStyles } from '../../utils/styles';\nimport { Group } from '@backstage-community/plugin-cost-insights-common';\nimport { identityApiRef, useApi } from '@backstage/core-plugin-api';\n\nfunction useDisplayName(): string {\n const identityApi = useApi(identityApiRef);\n const state = useAsync(() => identityApi.getProfileInfo(), [identityApi]);\n return state.loading ? '' : state.value?.displayName || 'Mysterious Stranger';\n}\n\ntype CostInsightsHeaderProps = {\n groupId: string;\n groups: Group[];\n hasCostData: boolean;\n alerts: number;\n};\n\nconst CostInsightsHeaderNoData = ({\n groupId,\n groups,\n}: CostInsightsHeaderProps) => {\n const displayName = useDisplayName();\n const classes = useCostInsightsStyles();\n const hasMultipleGroups = groups.length > 1;\n const ownerName = groups.find(({ id }) => id === groupId)?.name ?? groupId;\n\n return (\n <>\n <Typography variant=\"h4\" align=\"center\" gutterBottom>\n <Typography component=\"span\" role=\"img\" aria-label=\"flushed-face\">\n 😳\n </Typography>{' '}\n Well this is awkward\n </Typography>\n <Typography className={classes.h6Subtle} align=\"center\" gutterBottom>\n <b>Hey, {displayName}!</b> <b>{ownerName}</b> doesn't seem to have any\n cloud costs.\n </Typography>\n {hasMultipleGroups && (\n <Typography align=\"center\" gutterBottom>\n Maybe we picked the wrong team, choose another from the menu above?\n </Typography>\n )}\n </>\n );\n};\n\nconst CostInsightsHeaderAlerts = ({\n groupId,\n groups,\n alerts,\n}: CostInsightsHeaderProps) => {\n const displayName = useDisplayName();\n const classes = useCostInsightsStyles();\n const ownerName = groups.find(({ id }) => id === groupId)?.name ?? groupId;\n\n return (\n <>\n <Typography variant=\"h4\" align=\"center\" gutterBottom>\n <Typography component=\"span\" role=\"img\" aria-label=\"magnifying-glass\">\n 🔎\n </Typography>{' '}\n You have {alerts} thing{alerts > 1 && 's'} to look into\n </Typography>\n <Typography className={classes.h6Subtle} align=\"center\" gutterBottom>\n <b>Hey, {displayName}!</b> We've identified{' '}\n {alerts > 1 ? 'a few things ' : 'one thing '}\n <b>{ownerName}</b> should look into next.\n </Typography>\n </>\n );\n};\n\nconst CostInsightsHeaderNoAlerts = ({\n groupId,\n groups,\n}: CostInsightsHeaderProps) => {\n const displayName = useDisplayName();\n const classes = useCostInsightsStyles();\n const ownerName = groups.find(({ id }) => id === groupId)?.name ?? groupId;\n\n return (\n <>\n <Typography variant=\"h4\" gutterBottom align=\"center\">\n <Typography component=\"span\" role=\"img\" aria-label=\"thumbs-up\">\n 👍\n </Typography>{' '}\n Your team is doing great\n </Typography>\n <Typography className={classes.h6Subtle} align=\"center\" gutterBottom>\n <b>Hey, {displayName}!</b> <b>{ownerName}</b> is doing well. No major\n changes this month.\n </Typography>\n </>\n );\n};\n\nexport const CostInsightsHeaderNoGroups = () => {\n const displayName = useDisplayName();\n const classes = useCostInsightsStyles();\n return (\n <>\n <Typography variant=\"h4\" align=\"center\" gutterBottom>\n <Typography component=\"span\" role=\"img\" aria-label=\"flushed-face\">\n 😳\n </Typography>{' '}\n Well this is awkward\n </Typography>\n <Typography className={classes.h6Subtle} align=\"center\" gutterBottom>\n <b>Hey, {displayName}!</b> It doesn't look like you belong to any teams.\n </Typography>\n </>\n );\n};\n\nexport const CostInsightsHeader = (props: CostInsightsHeaderProps) => {\n if (!props.hasCostData) {\n return <CostInsightsHeaderNoData {...props} />;\n }\n if (props.alerts) {\n return <CostInsightsHeaderAlerts {...props} />;\n }\n return <CostInsightsHeaderNoAlerts {...props} />;\n};\n"],"names":[],"mappings":";;;;;;AAsBA,SAAS,cAAyB,GAAA;AAChC,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAM,MAAA,KAAA,GAAQ,SAAS,MAAM,WAAA,CAAY,gBAAkB,EAAA,CAAC,WAAW,CAAC,CAAA;AACxE,EAAA,OAAO,KAAM,CAAA,OAAA,GAAU,EAAK,GAAA,KAAA,CAAM,OAAO,WAAe,IAAA,qBAAA;AAC1D;AASA,MAAM,2BAA2B,CAAC;AAAA,EAChC,OAAA;AAAA,EACA;AACF,CAA+B,KAAA;AAC7B,EAAA,MAAM,cAAc,cAAe,EAAA;AACnC,EAAA,MAAM,UAAU,qBAAsB,EAAA;AACtC,EAAM,MAAA,iBAAA,GAAoB,OAAO,MAAS,GAAA,CAAA;AAC1C,EAAM,MAAA,SAAA,GAAY,MAAO,CAAA,IAAA,CAAK,CAAC,EAAE,IAAS,KAAA,EAAA,KAAO,OAAO,CAAA,EAAG,IAAQ,IAAA,OAAA;AAEnE,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,cAAW,OAAQ,EAAA,IAAA,EAAK,KAAM,EAAA,QAAA,EAA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AAA,kBAAA,GAAqB,CAAC,KAAmC,KAAA;AACpE,EAAI,IAAA,CAAC,MAAM,WAAa,EAAA;AACtB,IAAO,uBAAA,GAAA,CAAC,wBAA0B,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAAA;AAE9C,EAAA,IAAI,MAAM,MAAQ,EAAA;AAChB,IAAO,uBAAA,GAAA,CAAC,wBAA0B,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAAA;AAE9C,EAAO,uBAAA,GAAA,CAAC,0BAA4B,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAChD;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { makeStyles } from '@material-ui/core/styles';
|
|
3
3
|
import { CostInsightsTabs } from '../CostInsightsTabs/CostInsightsTabs.esm.js';
|
|
4
4
|
import { Page, Header } from '@backstage/core-components';
|
|
@@ -20,15 +20,21 @@ const CostInsightsLayout = ({
|
|
|
20
20
|
children
|
|
21
21
|
}) => {
|
|
22
22
|
const classes = useStyles();
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
return /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
Header,
|
|
26
|
+
{
|
|
27
|
+
style: { boxShadow: "none" },
|
|
28
|
+
title: "Cost Insights",
|
|
29
|
+
pageTitleOverride: title,
|
|
30
|
+
type: "Tool"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsxs("div", { className: classes.root, children: [
|
|
34
|
+
/* @__PURE__ */ jsx(CostInsightsTabs, { groups }),
|
|
35
|
+
/* @__PURE__ */ jsx("div", { className: classes.content, children })
|
|
36
|
+
] })
|
|
37
|
+
] });
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
export { CostInsightsLayout };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostInsightsLayout.esm.js","sources":["../../../src/components/CostInsightsLayout/CostInsightsLayout.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":"CostInsightsLayout.esm.js","sources":["../../../src/components/CostInsightsLayout/CostInsightsLayout.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 { PropsWithChildren } from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Group } from '@backstage-community/plugin-cost-insights-common';\nimport { CostInsightsTabs } from '../CostInsightsTabs';\nimport { Header, Page } from '@backstage/core-components';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n gridArea: 'pageContent',\n },\n header: {\n boxShadow: 'none',\n },\n content: {\n padding: theme.spacing(4),\n },\n}));\n\ntype CostInsightsLayoutProps = {\n title?: string;\n groups: Group[];\n};\n\nexport const CostInsightsLayout = ({\n title = 'Cost Insights',\n groups,\n children,\n}: PropsWithChildren<CostInsightsLayoutProps>) => {\n const classes = useStyles();\n return (\n <Page themeId=\"tool\">\n <Header\n style={{ boxShadow: 'none' }}\n title=\"Cost Insights\"\n pageTitleOverride={title}\n type=\"Tool\"\n />\n <div className={classes.root}>\n <CostInsightsTabs groups={groups} />\n <div className={classes.content}>{children}</div>\n </div>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA;AAAA,GACb;AAAA,EACA,OAAS,EAAA;AAAA,IACP,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAE5B,CAAE,CAAA,CAAA;AAOK,MAAM,qBAAqB,CAAC;AAAA,EACjC,KAAQ,GAAA,eAAA;AAAA,EACR,MAAA;AAAA,EACA;AACF,CAAkD,KAAA;AAChD,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,SAAA,EAAW,MAAO,EAAA;AAAA,QAC3B,KAAM,EAAA,eAAA;AAAA,QACN,iBAAmB,EAAA,KAAA;AAAA,QACnB,IAAK,EAAA;AAAA;AAAA,KACP;AAAA,oBACC,IAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,IACtB,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,oBAAiB,MAAgB,EAAA,CAAA;AAAA,sBACjC,GAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,SAAU,QAAS,EAAA;AAAA,KAC7C,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|