From f454f0eecca9dd35f60b4f47f9ccc1b30a5020f1 Mon Sep 17 00:00:00 2001 From: Ryan Vazquez Date: Thu, 29 Oct 2020 17:34:01 -0400 Subject: [PATCH] make thresholds and growth enums public --- .../src/components/CostGrowth/CostGrowth.tsx | 4 ++-- plugins/cost-insights/src/types/ChangeStatistic.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx b/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx index 3f5e0f55eb..da2f3e3c1b 100644 --- a/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx +++ b/plugins/cost-insights/src/components/CostGrowth/CostGrowth.tsx @@ -16,9 +16,9 @@ import React from 'react'; import classnames from 'classnames'; -import { ChangeStatistic, CurrencyType, Duration } from '../../types'; +import { ChangeStatistic, CurrencyType, Duration, EngineerThreshold, GrowthType } from '../../types'; import { rateOf } from '../../utils/currency'; -import { growthOf, GrowthType, EngineerThreshold } from '../../utils/change'; +import { growthOf } from '../../utils/change'; import { useCostGrowthStyles as useStyles } from '../../utils/styles'; import { formatPercent, formatCurrency } from '../../utils/formatters'; import { indefiniteArticleOf } from '../../utils/grammar'; diff --git a/plugins/cost-insights/src/types/ChangeStatistic.ts b/plugins/cost-insights/src/types/ChangeStatistic.ts index e60d47a0e6..a47640411a 100644 --- a/plugins/cost-insights/src/types/ChangeStatistic.ts +++ b/plugins/cost-insights/src/types/ChangeStatistic.ts @@ -20,3 +20,16 @@ export interface ChangeStatistic { // The actual USD change between time periods (can be negative if costs decreased) amount: number; } + +export const EngineerThreshold = 0.5; + +export enum ChangeThreshold { + upper = 0.05, + lower = -0.05, +} + +export enum GrowthType { + Negligible, + Savings, + Excess, +}