mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-19 01:17:18 +02:00
Fix/account for missing environments (#673)
* fix: add guards * fix: remove console log * fix: remove file * fix: remove console log
This commit is contained in:
parent
7344f47635
commit
7336bc3ef6
@ -81,6 +81,8 @@ const FeatureOverviewEnvironment = ({
|
|||||||
{} as { [key: string]: IStrategyIconObject }
|
{} as { [key: string]: IStrategyIconObject }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!strategyObjects) return [];
|
||||||
|
|
||||||
return Object.keys(strategyObjects).map(strategyName => {
|
return Object.keys(strategyObjects).map(strategyName => {
|
||||||
return { ...strategyObjects[strategyName], name: strategyName };
|
return { ...strategyObjects[strategyName], name: strategyName };
|
||||||
});
|
});
|
||||||
|
@ -13,8 +13,10 @@ const FeatureOverviewEnvironmentMetrics = ({
|
|||||||
}: IFeatureOverviewEnvironmentMetrics) => {
|
}: IFeatureOverviewEnvironmentMetrics) => {
|
||||||
const styles = useStyles();
|
const styles = useStyles();
|
||||||
|
|
||||||
|
if (!environmentMetric) return null;
|
||||||
|
|
||||||
const total = environmentMetric.yes + environmentMetric.no;
|
const total = environmentMetric.yes + environmentMetric.no;
|
||||||
const percentage = calculatePercentage(total, environmentMetric.yes);
|
const percentage = calculatePercentage(total, environmentMetric?.yes);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!environmentMetric ||
|
!environmentMetric ||
|
||||||
|
Loading…
Reference in New Issue
Block a user