fix: resolve feedback
Signed-off-by: Chris Langhout <clanghout@bol.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/plugin-cost-insights': patch
|
||||
---
|
||||
|
||||
added an optional config entry to allow users to control the threshold value for the 'negligible' change in costs
|
||||
added an optional config entry `costInsights.engineerThreshold` to allow users to control the threshold value for the 'negligible' change in costs.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Vendored
+5
@@ -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: [],
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user