diff --git a/plugins/cost-insights/src/api/CostInsightsApi.ts b/plugins/cost-insights/src/api/CostInsightsApi.ts index a7065a04aa..959b40e584 100644 --- a/plugins/cost-insights/src/api/CostInsightsApi.ts +++ b/plugins/cost-insights/src/api/CostInsightsApi.ts @@ -15,14 +15,15 @@ */ import { - Alert, Cost, Entity, Group, Project, Maybe, MetricData, -} from '../types'; +} from '@backstage/plugin-cost-insights-common'; + +import { Alert } from '../types'; import { createApiRef } from '@backstage/core-plugin-api'; /** @public */ diff --git a/plugins/cost-insights/src/components/AlertInsights/AlertDialog.tsx b/plugins/cost-insights/src/components/AlertInsights/AlertDialog.tsx index af976c6d3f..385116e188 100644 --- a/plugins/cost-insights/src/components/AlertInsights/AlertDialog.tsx +++ b/plugins/cost-insights/src/components/AlertInsights/AlertDialog.tsx @@ -28,7 +28,8 @@ import { } from '@material-ui/core'; import { default as CloseIcon } from '@material-ui/icons/Close'; import { useAlertDialogStyles as useStyles } from '../../utils/styles'; -import { Alert, AlertStatus, Maybe } from '../../types'; +import { Alert, AlertStatus } from '../../types'; +import { Maybe } from '@backstage/plugin-cost-insights-common'; import { choose, formOf } from '../../utils/alerts'; const DEFAULT_FORM_ID = 'alert-form'; diff --git a/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx b/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx index 8993504c84..2591fd5a47 100644 --- a/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx +++ b/plugins/cost-insights/src/components/CostGrowth/CostGrowthIndicator.tsx @@ -20,8 +20,9 @@ import { Typography, TypographyProps } from '@material-ui/core'; import { default as ArrowDropUp } from '@material-ui/icons/ArrowDropUp'; import { default as ArrowDropDown } from '@material-ui/icons/ArrowDropDown'; import { growthOf } from '../../utils/change'; -import { ChangeStatistic, GrowthType, Maybe } from '../../types'; +import { GrowthType } from '../../types'; import { useCostGrowthStyles as useStyles } from '../../utils/styles'; +import { ChangeStatistic, Maybe } from '@backstage/plugin-cost-insights-common'; /** @public */ export type CostGrowthIndicatorProps = TypographyProps & { diff --git a/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx b/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx index 540165d1d9..8e12b7f5dd 100644 --- a/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx +++ b/plugins/cost-insights/src/components/CostInsightsHeader/CostInsightsHeader.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { Typography } from '@material-ui/core'; import useAsync from 'react-use/lib/useAsync'; import { useCostInsightsStyles } from '../../utils/styles'; -import { Group } from '../../types'; +import { Group } from '@backstage/plugin-cost-insights-common'; import { identityApiRef, useApi } from '@backstage/core-plugin-api'; function useDisplayName(): string { diff --git a/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.tsx b/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.tsx index ad7dea55fd..507016f391 100644 --- a/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.tsx +++ b/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.tsx @@ -32,7 +32,7 @@ import { NavigationItem, getDefaultNavigationItems, } from '../../utils/navigation'; -import { Maybe, Product } from '../../types'; +import { Maybe, Product } from '@backstage/plugin-cost-insights-common'; type CostInsightsNavigationProps = { alerts: number; diff --git a/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx b/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx index 00d92f945d..d113f1b8f3 100644 --- a/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx +++ b/plugins/cost-insights/src/components/CostInsightsPage/CostInsightsPage.tsx @@ -48,7 +48,14 @@ import { useLastCompleteBillingDate, useLoading, } from '../../hooks'; -import { Alert, Cost, Maybe, MetricData, Product, Project } from '../../types'; +import { Alert } from '../../types'; +import { + Cost, + Maybe, + MetricData, + Product, + Project, +} from '@backstage/plugin-cost-insights-common'; import { mapLoadingToProps } from './selector'; import { ProjectSelect } from '../ProjectSelect'; import { intervalsOf } from '../../utils/duration'; diff --git a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx index 2e2131daff..b04f314e73 100644 --- a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx +++ b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { CostInsightsTabs } from './CostInsightsTabs'; import userEvent from '@testing-library/user-event'; -import { Group } from '../../types'; +import { Group } from '@backstage/plugin-cost-insights-common'; import { MockFilterProvider, MockLoadingProvider } from '../../testUtils'; import { renderInTestApp } from '@backstage/test-utils'; diff --git a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx index 935184ee55..152ce56902 100644 --- a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx +++ b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx @@ -18,7 +18,7 @@ import React, { useState } from 'react'; import { Menu, MenuItem, Tab, Tabs, Typography } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { mapLoadingToProps, mapFiltersToProps } from './selector'; -import { Group } from '../../types'; +import { Group } from '@backstage/plugin-cost-insights-common'; import { useFilters, useLoading } from '../../hooks'; import { useCostInsightsTabsStyles as useStyles } from '../../utils/styles'; diff --git a/plugins/cost-insights/src/components/CostInsightsTabs/selector.ts b/plugins/cost-insights/src/components/CostInsightsTabs/selector.ts index 6309016c85..7e19deb301 100644 --- a/plugins/cost-insights/src/components/CostInsightsTabs/selector.ts +++ b/plugins/cost-insights/src/components/CostInsightsTabs/selector.ts @@ -16,7 +16,8 @@ import { MapFiltersToProps } from '../../hooks/useFilters'; import { MapLoadingToProps } from '../../hooks/useLoading'; -import { Group, PageFilters } from '../../types'; +import { PageFilters } from '../../types'; +import { Group } from '@backstage/plugin-cost-insights-common'; import { getResetStateWithoutInitial } from '../../utils/loading'; type CostInsightsTabsFilterProps = PageFilters & { diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx index 962dc6b332..6433ab472c 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewBreakdownChart.tsx @@ -32,7 +32,8 @@ import { ResponsiveContainer, CartesianGrid, } from 'recharts'; -import { Cost, DEFAULT_DATE_FORMAT, CostInsightsTheme } from '../../types'; +import { DEFAULT_DATE_FORMAT, CostInsightsTheme } from '../../types'; +import { Cost } from '@backstage/plugin-cost-insights-common'; import { BarChartTooltip as Tooltip, BarChartTooltipItem as TooltipItem, diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx index e3de9593d9..91c599e407 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { fireEvent } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; import { CostOverviewCard } from './CostOverviewCard'; -import { Cost } from '../../types'; +import { Cost } from '@backstage/plugin-cost-insights-common'; import { changeOf, getGroupedProducts, diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.tsx index 9eb5f1e190..c816da97ed 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.tsx @@ -34,7 +34,12 @@ import { useConfig, useFilters } from '../../hooks'; import { mapFiltersToProps } from './selector'; import { DefaultNavigation } from '../../utils/navigation'; import { findAlways } from '../../utils/assert'; -import { Cost, CostInsightsTheme, Maybe, MetricData } from '../../types'; +import { CostInsightsTheme } from '../../types'; +import { + Cost, + Maybe, + MetricData, +} from '@backstage/plugin-cost-insights-common'; import { useOverviewTabsStyles } from '../../utils/styles'; import { ScrollAnchor } from '../../utils/scroll'; diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx index 1c58bf58e6..e5b0c59684 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewChart.tsx @@ -26,15 +26,13 @@ import { Line, ResponsiveContainer, } from 'recharts'; +import { ChartData, DEFAULT_DATE_FORMAT, CostInsightsTheme } from '../../types'; import { - ChartData, Cost, - DEFAULT_DATE_FORMAT, Maybe, Metric, MetricData, - CostInsightsTheme, -} from '../../types'; +} from '@backstage/plugin-cost-insights-common'; import { BarChartTooltip as Tooltip, BarChartTooltipItem as TooltipItem, diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewLegend.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewLegend.tsx index 2df80f4780..d823c54691 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewLegend.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewLegend.tsx @@ -17,13 +17,13 @@ import React, { PropsWithChildren } from 'react'; import { Box, useTheme } from '@material-ui/core'; import { LegendItem } from '../LegendItem'; +import { CostInsightsTheme } from '../../types'; import { - CostInsightsTheme, MetricData, Maybe, Cost, Metric, -} from '../../types'; +} from '@backstage/plugin-cost-insights-common'; import { useLastCompleteBillingDate, useFilters } from '../../hooks'; import { getComparedChange, choose } from '../../utils/change'; import { mapFiltersToProps } from './selector'; diff --git a/plugins/cost-insights/src/components/CostOverviewCard/selector.tsx b/plugins/cost-insights/src/components/CostOverviewCard/selector.tsx index d0f7cb76d9..55ad6df69e 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/selector.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/selector.tsx @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Duration, Maybe, PageFilters } from '../../types'; +import { Duration, PageFilters } from '../../types'; +import { Maybe } from '@backstage/plugin-cost-insights-common'; import { MapFiltersToProps } from '../../hooks/useFilters'; type CostOverviewFilterProps = PageFilters & { diff --git a/plugins/cost-insights/src/components/MetricSelect/MetricSelect.tsx b/plugins/cost-insights/src/components/MetricSelect/MetricSelect.tsx index 090444f025..fd534eb8f0 100644 --- a/plugins/cost-insights/src/components/MetricSelect/MetricSelect.tsx +++ b/plugins/cost-insights/src/components/MetricSelect/MetricSelect.tsx @@ -16,7 +16,7 @@ import React from 'react'; import { InputLabel, FormControl, Select, MenuItem } from '@material-ui/core'; -import { Maybe, Metric } from '../../types'; +import { Maybe, Metric } from '@backstage/plugin-cost-insights-common'; import { useSelectStyles as useStyles } from '../../utils/styles'; export type MetricSelectProps = {