From f68a7059b594c1946d3641fdbaf6b45f640af0b1 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 22 Nov 2022 10:11:52 +0100 Subject: [PATCH] fixed last of const-insigts components deprecations' Signed-off-by: Simon --- .../src/components/AlertInsights/AlertInsights.tsx | 3 ++- .../cost-insights/src/components/CostGrowth/CostGrowth.tsx | 2 +- .../components/CostInsightsLayout/CostInsightsLayout.tsx | 2 +- .../CostInsightsNavigation/CostInsightsNavigation.test.tsx | 3 ++- .../src/components/PeriodSelect/PeriodSelect.test.tsx | 3 ++- .../src/components/ProductInsights/ProductInsights.test.tsx | 2 +- .../src/components/ProductInsights/ProductInsights.tsx | 3 ++- .../ProductInsightsCard/ProductEntityDialog.test.tsx | 2 +- .../components/ProductInsightsCard/ProductEntityDialog.tsx | 2 +- .../components/ProductInsightsCard/ProductEntityTable.tsx | 6 +++++- .../ProductInsightsCard/ProductInsightsCard.test.tsx | 3 ++- .../components/ProductInsightsCard/ProductInsightsCard.tsx | 3 ++- .../ProductInsightsCard/ProductInsightsCardList.tsx | 3 ++- .../components/ProductInsightsCard/ProductInsightsChart.tsx | 3 ++- .../ProjectGrowthInstructionsPage.tsx | 3 +-- .../src/components/ProjectSelect/ProjectSelect.tsx | 2 +- 16 files changed, 28 insertions(+), 17 deletions(-) diff --git a/plugins/cost-insights/src/components/AlertInsights/AlertInsights.tsx b/plugins/cost-insights/src/components/AlertInsights/AlertInsights.tsx index 2daacda85e..e48ae2789d 100644 --- a/plugins/cost-insights/src/components/AlertInsights/AlertInsights.tsx +++ b/plugins/cost-insights/src/components/AlertInsights/AlertInsights.tsx @@ -30,7 +30,8 @@ import { MapLoadingToProps, } from '../../hooks'; import { DefaultLoadingAction } from '../../utils/loading'; -import { Alert, AlertOptions, AlertStatus, Maybe } from '../../types'; +import { Alert, AlertOptions, AlertStatus } from '../../types'; +import { Maybe } from '@backstage/plugin-cost-insights-common'; import { isStatusSnoozed, isStatusAccepted, diff --git a/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx b/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx index ffc548c7ad..d0a4e7901a 100644 --- a/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx +++ b/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx @@ -17,12 +17,12 @@ import React from 'react'; import classnames from 'classnames'; import { - ChangeStatistic, CurrencyType, Duration, EngineerThreshold, GrowthType, } from '../../types'; +import { ChangeStatistic } from '@backstage/plugin-cost-insights-common'; import { rateOf } from '../../utils/currency'; import { growthOf } from '../../utils/change'; import { useCostGrowthStyles as useStyles } from '../../utils/styles'; diff --git a/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx b/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx index 93614bd64f..0a583aae0d 100644 --- a/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx +++ b/plugins/cost-insights/src/components/CostInsightsLayout/CostInsightsLayout.tsx @@ -15,7 +15,7 @@ */ import React, { PropsWithChildren } from 'react'; import { makeStyles } from '@material-ui/core'; -import { Group } from '../../types'; +import { Group } from '@backstage/plugin-cost-insights-common'; import { CostInsightsTabs } from '../CostInsightsTabs'; import { Header, Page } from '@backstage/core-components'; diff --git a/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.test.tsx b/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.test.tsx index 8ccca96e0f..4cfabc119c 100644 --- a/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.test.tsx +++ b/plugins/cost-insights/src/components/CostInsightsNavigation/CostInsightsNavigation.test.tsx @@ -18,7 +18,8 @@ import React from 'react'; import { default as HappyFace } from '@material-ui/icons/SentimentSatisfiedAlt'; import { renderInTestApp } from '@backstage/test-utils'; import { CostInsightsNavigation } from './CostInsightsNavigation'; -import { Product, Icon } from '../../types'; +import { Icon } from '../../types'; +import { Product } from '@backstage/plugin-cost-insights-common'; import { MockConfigProvider, MockScrollProvider } from '../../testUtils'; import { getDefaultNavigationItems } from '../../utils/navigation'; diff --git a/plugins/cost-insights/src/components/PeriodSelect/PeriodSelect.test.tsx b/plugins/cost-insights/src/components/PeriodSelect/PeriodSelect.test.tsx index dfac13dd42..b7a1e034da 100644 --- a/plugins/cost-insights/src/components/PeriodSelect/PeriodSelect.test.tsx +++ b/plugins/cost-insights/src/components/PeriodSelect/PeriodSelect.test.tsx @@ -21,7 +21,8 @@ import userEvent from '@testing-library/user-event'; import { PeriodSelect, getDefaultOptions } from './PeriodSelect'; import { getDefaultPageFilters } from '../../utils/filters'; import { MockBillingDateProvider } from '../../testUtils'; -import { Group, Duration } from '../../types'; +import { Duration } from '../../types'; +import { Group } from '@backstage/plugin-cost-insights-common'; const DefaultPageFilters = getDefaultPageFilters([{ id: 'tools' }] as Group[]); const lastCompleteBillingDate = '2020-05-01'; diff --git a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx index 128c9d50b9..3c6b731ce8 100644 --- a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx +++ b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.test.tsx @@ -27,7 +27,7 @@ import { MockScrollProvider, MockLoadingProvider, } from '../../testUtils'; -import { Entity, Product } from '../../types'; +import { Entity, Product } from '@backstage/plugin-cost-insights-common'; // suppress recharts componentDidUpdate warnings jest.spyOn(console, 'warn').mockImplementation(() => {}); diff --git a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx index 3eba868843..9df763a5d4 100644 --- a/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx +++ b/plugins/cost-insights/src/components/ProductInsights/ProductInsights.tsx @@ -19,7 +19,8 @@ import { Box, Typography } from '@material-ui/core'; import { default as Alert } from '@material-ui/lab/Alert'; import { costInsightsApiRef } from '../../api'; import { ProductInsightsCardList } from '../ProductInsightsCard/ProductInsightsCardList'; -import { Duration, Entity, Maybe, Product } from '../../types'; +import { Duration } from '../../types'; +import { Entity, Maybe, Product } from '@backstage/plugin-cost-insights-common'; import { intervalsOf, DEFAULT_DURATION } from '../../utils/duration'; import { DefaultLoadingAction, diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.test.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.test.tsx index d3d12abe74..b0c35da493 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.test.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.test.tsx @@ -18,7 +18,7 @@ import React from 'react'; import { wrapInTestApp } from '@backstage/test-utils'; import { ProductEntityDialog } from './ProductEntityDialog'; import { render } from '@testing-library/react'; -import { Entity } from '../../types'; +import { Entity } from '@backstage/plugin-cost-insights-common'; const atomicEntity: Entity = { id: null, diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx index 50b2ff993c..55fa795728 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityDialog.tsx @@ -18,7 +18,7 @@ import React, { useState } from 'react'; import { Dialog, IconButton } from '@material-ui/core'; import { default as CloseButton } from '@material-ui/icons/Close'; import { useEntityDialogStyles as useStyles } from '../../utils/styles'; -import { Entity } from '../../types'; +import { Entity } from '@backstage/plugin-cost-insights-common'; import { ProductEntityTable, ProductEntityTableOptions, diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx index 95ba4f2f2d..24115e830a 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductEntityTable.tsx @@ -20,7 +20,11 @@ import { Typography } from '@material-ui/core'; import { costFormatter, formatChange } from '../../utils/formatters'; import { useEntityDialogStyles as useStyles } from '../../utils/styles'; import { CostGrowthIndicator } from '../CostGrowth'; -import { BarChartOptions, ChangeStatistic, Entity } from '../../types'; +import { BarChartOptions } from '../../types'; +import { + ChangeStatistic, + Entity, +} from '@backstage/plugin-cost-insights-common'; import { Table, TableColumn } from '@backstage/core-components'; export type ProductEntityTableOptions = Partial< diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx index 737019e77a..b24b3bd366 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.test.tsx @@ -28,7 +28,8 @@ import { MockScrollProvider, MockLoadingProvider, } from '../../testUtils'; -import { Duration, Entity, Product } from '../../types'; +import { Duration } from '../../types'; +import { Entity, Product } from '@backstage/plugin-cost-insights-common'; // suppress recharts componentDidUpdate warnings jest.spyOn(console, 'warn').mockImplementation(() => {}); diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx index 2b4ee4b0db..a587bfb26e 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCard.tsx @@ -28,7 +28,8 @@ import { PeriodSelect } from '../PeriodSelect'; import { ProductInsightsChart } from './ProductInsightsChart'; import { useProductInsightsCardStyles as useStyles } from '../../utils/styles'; import { DefaultLoadingAction } from '../../utils/loading'; -import { Duration, Entity, Maybe, Product } from '../../types'; +import { Duration } from '../../types'; +import { Entity, Maybe, Product } from '@backstage/plugin-cost-insights-common'; import { MapLoadingToProps, useLastCompleteBillingDate, diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCardList.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCardList.tsx index ecf60b4bef..3ae97daecb 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCardList.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsCardList.tsx @@ -17,7 +17,8 @@ import React from 'react'; import { Box, CircularProgress, Collapse } from '@material-ui/core'; import { ProductInsightsCard } from './ProductInsightsCard'; -import { Duration, Entity, Product } from '../../types'; +import { Duration } from '../../types'; +import { Entity, Product } from '@backstage/plugin-cost-insights-common'; import { ProductState } from '../../utils/loading'; type ProductInsightsCardListProps = { diff --git a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx index b77b415e1e..751a37f67e 100644 --- a/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx +++ b/plugins/cost-insights/src/components/ProductInsightsCard/ProductInsightsChart.tsx @@ -48,7 +48,8 @@ import { useProductInsightsChartStyles as useStyles, useBarChartLayoutStyles as useLayoutStyles, } from '../../utils/styles'; -import { Duration, Entity, Maybe } from '../../types'; +import { Duration } from '../../types'; +import { Entity, Maybe } from '@backstage/plugin-cost-insights-common'; import { choose } from '../../utils/change'; import { TooltipRenderer } from '../../types/Tooltip'; diff --git a/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx b/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx index 35b00ce6f6..0435210a98 100644 --- a/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx +++ b/plugins/cost-insights/src/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.tsx @@ -23,10 +23,9 @@ import { Alert, DEFAULT_DATE_FORMAT, Duration, - Entity, - Product, ProjectGrowthData, } from '../../types'; +import { Entity, Product } from '@backstage/plugin-cost-insights-common'; import { ProjectGrowthAlert } from '../../alerts'; import { InfoCard } from '@backstage/core-components'; diff --git a/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx b/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx index d46123b001..c83fa67d94 100644 --- a/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx +++ b/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; import { MenuItem, Select } from '@material-ui/core'; -import { Maybe, Project } from '../../types'; +import { Maybe, Project } from '@backstage/plugin-cost-insights-common'; import { useSelectStyles as useStyles } from '../../utils/styles'; type ProjectSelectProps = {