1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00
This commit is contained in:
sjaanus 2025-07-29 16:27:27 +03:00
parent 2a3de76284
commit f9c0a542f4
No known key found for this signature in database
GPG Key ID: 20E007C0248BA7FF
2 changed files with 4 additions and 10 deletions

View File

@ -44,7 +44,6 @@ interface ICreationArchiveChartProps {
creationArchiveTrends: GroupedDataByProject< creationArchiveTrends: GroupedDataByProject<
InstanceInsightsSchema['creationArchiveTrends'] InstanceInsightsSchema['creationArchiveTrends']
>; >;
isAggregate?: boolean;
isLoading?: boolean; isLoading?: boolean;
} }
@ -66,7 +65,6 @@ type RawWeekData = {
export const CreationArchiveChart: FC<ICreationArchiveChartProps> = ({ export const CreationArchiveChart: FC<ICreationArchiveChartProps> = ({
creationArchiveTrends, creationArchiveTrends,
isAggregate,
isLoading, isLoading,
}) => { }) => {
const creationArchiveData = useProjectChartData(creationArchiveTrends); const creationArchiveData = useProjectChartData(creationArchiveTrends);
@ -188,9 +186,7 @@ export const CreationArchiveChart: FC<ICreationArchiveChartProps> = ({
}; };
}, [creationArchiveData, theme]); }, [creationArchiveData, theme]);
const aggregateOrProjectData = isAggregate const aggregateOrProjectData = aggregateHealthData;
? aggregateHealthData
: creationArchiveData;
const notEnoughData = useMemo( const notEnoughData = useMemo(
() => () =>
!isLoading && !isLoading &&
@ -200,14 +196,11 @@ export const CreationArchiveChart: FC<ICreationArchiveChartProps> = ({
const data = const data =
notEnoughData || isLoading ? placeholderData : aggregateOrProjectData; notEnoughData || isLoading ? placeholderData : aggregateOrProjectData;
const flagTypeNames = isAggregate const flagTypeNames = (aggregateHealthData as any).flagTypeNames || [];
? (aggregateHealthData as any).flagTypeNames || []
: [];
return ( return (
<> <>
<Chart <Chart
key={isAggregate ? 'aggregate' : 'project'}
type='bar' type='bar'
data={data as any} data={data as any}
options={{ options={{

View File

@ -68,6 +68,8 @@ export const PerformanceInsights: FC = () => {
groupedCreationArchiveData, groupedCreationArchiveData,
} = useInsightsData(insights, projects); } = useInsightsData(insights, projects);
console.log(groupedCreationArchiveData);
const { isEnterprise } = useUiConfig(); const { isEnterprise } = useUiConfig();
const lastUserTrend = userTrends[userTrends.length - 1]; const lastUserTrend = userTrends[userTrends.length - 1];
const usersTotal = lastUserTrend?.total ?? 0; const usersTotal = lastUserTrend?.total ?? 0;
@ -158,7 +160,6 @@ export const PerformanceInsights: FC = () => {
<StyledChartContainer> <StyledChartContainer>
<CreationArchiveChart <CreationArchiveChart
creationArchiveTrends={groupedCreationArchiveData} creationArchiveTrends={groupedCreationArchiveData}
isAggregate={showAllProjects}
isLoading={loading} isLoading={loading}
/> />
</StyledChartContainer> </StyledChartContainer>