1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: show 2 insights components to pro (#7207)

Currently it was showing only users. Now showing 2.
This commit is contained in:
Jaanus Sellin 2024-05-29 12:42:53 +03:00 committed by GitHub
parent 3daa731ed6
commit e79e36daae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,46 +145,38 @@ export const InsightsCharts: VFC<IChartsProps> = ({
</ChartWidget>
}
/>
<Widget {...chartInfo.totalFlags}>
<FlagStats
count={showAllProjects ? flags.total : summary.total}
flagsPerUser={
showAllProjects ? getFlagsPerUser(flags, users) : ''
}
isLoading={loading}
/>
</Widget>
<ConditionallyRender
condition={showAllProjects}
show={
<ChartWidget {...chartInfo.flags}>
<FlagsChart
flagTrends={flagTrends}
isLoading={loading}
/>
</ChartWidget>
}
elseShow={
<ChartWidget {...chartInfo.flagsPerProject}>
<FlagsProjectChart
projectFlagTrends={groupedProjectsData}
isLoading={loading}
/>
</ChartWidget>
}
/>
<ConditionallyRender
condition={isEnterprise()}
show={
<>
<Widget {...chartInfo.totalFlags}>
<FlagStats
count={
showAllProjects
? flags.total
: summary.total
}
flagsPerUser={
showAllProjects
? getFlagsPerUser(flags, users)
: ''
}
isLoading={loading}
/>
</Widget>
<ConditionallyRender
condition={showAllProjects}
show={
<ChartWidget {...chartInfo.flags}>
<FlagsChart
flagTrends={flagTrends}
isLoading={loading}
/>
</ChartWidget>
}
elseShow={
<ChartWidget {...chartInfo.flagsPerProject}>
<FlagsProjectChart
projectFlagTrends={
groupedProjectsData
}
isLoading={loading}
/>
</ChartWidget>
}
/>
<Widget {...chartInfo.averageHealth}>
<HealthStats
value={summary.averageHealth}