fix: resolve feedback

Signed-off-by: Chris Langhout <clanghout@bol.com>
This commit is contained in:
Chris Langhout
2022-11-25 15:29:18 +01:00
parent 626b06eb1f
commit 5534de6cfa
5 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ costInsights:
rate: 3.5
```
### costChangeNegligibleThreshold (Optional; default 0.5)
### engineerThreshold (Optional; default 0.5)
This threshold determines whether to show 'Negligible', or a percentage with a fraction of 'engineers' for cost savings or cost excess on top of the charts.
A threshold of 0.5 means that `Negligible` is shown when the difference in costs is lower than that fraction of engineers in that time frame,
+5
View File
@@ -21,6 +21,11 @@ export interface Config {
*/
engineerCost: number;
/**
* @visibility frontend
*/
engineerThreshold: number;
/**
* @visibility frontend
*/
@@ -22,7 +22,7 @@ import React, {
useState,
} from 'react';
import { Config as BackstageConfig } from '@backstage/config';
import { Currency, Icon, Metric, Product } from '../types';
import { Currency, EngineerThreshold, Icon, Metric, Product } from '../types';
import { getIcon } from '../utils/navigation';
import { validateCurrencies, validateMetrics } from '../utils/config';
import { createCurrencyFormat, defaultCurrencies } from '../utils/currency';
@@ -84,7 +84,7 @@ const defaultState: ConfigContextProps = {
products: [],
icons: [],
engineerCost: 0,
engineerThreshold: 0.5,
engineerThreshold: EngineerThreshold,
currencies: defaultCurrencies,
};
@@ -31,7 +31,7 @@ import {
ScrollContext,
ScrollContextProps,
} from '../hooks';
import { Duration } from '../types';
import { Duration, EngineerThreshold } from '../types';
import { createCurrencyFormat } from '../utils/currency';
export type MockFilterProviderProps = PropsWithChildren<
@@ -95,7 +95,7 @@ export const MockConfigProvider = (props: MockConfigProviderProps) => {
products: [],
icons: [],
engineerCost: 0,
engineerThreshold: 0.5,
engineerThreshold: EngineerThreshold,
currencies: [],
};