diff --git a/frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx b/frontend/src/component/insights/Insights.tsx
similarity index 76%
rename from frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx
rename to frontend/src/component/insights/Insights.tsx
index 8dfb63839d..efeb3a7406 100644
--- a/frontend/src/component/executiveDashboard/ExecutiveDashboard.tsx
+++ b/frontend/src/component/insights/Insights.tsx
@@ -6,10 +6,10 @@ import {
allOption,
ProjectSelect,
} from 'component/common/ProjectSelect/ProjectSelect';
-import { useExecutiveDashboard } from 'hooks/api/getters/useExecutiveSummary/useExecutiveSummary';
-import { DashboardHeader } from './components/DashboardHeader/DashboardHeader';
-import { useDashboardData } from './hooks/useDashboardData';
-import { Charts } from './Charts';
+import { useInsights } from 'hooks/api/getters/useInsights/useInsights';
+import { InsightsHeader } from './components/InsightsHeader/InsightsHeader';
+import { useInsightsData } from './hooks/useInsightsData';
+import { InsightsCharts } from './InsightsCharts';
const StickyWrapper = styled(Box, {
shouldForwardProp: (prop) => prop !== 'scrolled',
@@ -22,9 +22,9 @@ const StickyWrapper = styled(Box, {
transition: 'padding 0.3s ease',
}));
-export const ExecutiveDashboard: VFC = () => {
+export const Insights: VFC = () => {
const [scrolled, setScrolled] = useState(false);
- const { executiveDashboardData, loading, error } = useExecutiveDashboard();
+ const { insights, loading, error } = useInsights();
const stateConfig = {
projects: withDefault(ArrayParam, [allOption.id]),
};
@@ -36,7 +36,7 @@ export const ExecutiveDashboard: VFC = () => {
? (state.projects.filter(Boolean) as string[])
: [];
- const dashboardData = useDashboardData(executiveDashboardData, projects);
+ const insightsData = useInsightsData(insights, projects);
const handleScroll = () => {
if (!scrolled && window.scrollY > 0) {
@@ -53,7 +53,7 @@ export const ExecutiveDashboard: VFC = () => {
return (
<>
- {
}
/>
-
+
>
);
};
diff --git a/frontend/src/component/executiveDashboard/Charts.tsx b/frontend/src/component/insights/InsightsCharts.tsx
similarity index 93%
rename from frontend/src/component/executiveDashboard/Charts.tsx
rename to frontend/src/component/insights/InsightsCharts.tsx
index a5ddf79c59..9a3a71f6d5 100644
--- a/frontend/src/component/executiveDashboard/Charts.tsx
+++ b/frontend/src/component/insights/InsightsCharts.tsx
@@ -12,7 +12,7 @@ import { TimeToProduction } from './componentsStat/TimeToProduction/TimeToProduc
import { TimeToProductionChart } from './componentsChart/TimeToProductionChart/TimeToProductionChart';
import { MetricsSummaryChart } from './componentsChart/MetricsSummaryChart/MetricsSummaryChart';
import { UpdatesPerEnvironmentTypeChart } from './componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart';
-import type { ExecutiveSummarySchema } from '../../openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import type { GroupedDataByProject } from './hooks/useGroupedProjectTrends';
import { Box, styled } from '@mui/material';
import { allOption } from '../common/ProjectSelect/ProjectSelect';
@@ -20,18 +20,18 @@ import type { VFC } from 'react';
import { chartInfo } from './chart-info';
interface IChartsProps {
- flagTrends: ExecutiveSummarySchema['flagTrends'];
- projectsData: ExecutiveSummarySchema['projectFlagTrends'];
+ flagTrends: InstanceInsightsSchema['flagTrends'];
+ projectsData: InstanceInsightsSchema['projectFlagTrends'];
groupedProjectsData: GroupedDataByProject<
- ExecutiveSummarySchema['projectFlagTrends']
+ InstanceInsightsSchema['projectFlagTrends']
>;
- metricsData: ExecutiveSummarySchema['metricsSummaryTrends'];
+ metricsData: InstanceInsightsSchema['metricsSummaryTrends'];
groupedMetricsData: GroupedDataByProject<
- ExecutiveSummarySchema['metricsSummaryTrends']
+ InstanceInsightsSchema['metricsSummaryTrends']
>;
- users: ExecutiveSummarySchema['users'];
- userTrends: ExecutiveSummarySchema['userTrends'];
- environmentTypeTrends: ExecutiveSummarySchema['environmentTypeTrends'];
+ users: InstanceInsightsSchema['users'];
+ userTrends: InstanceInsightsSchema['userTrends'];
+ environmentTypeTrends: InstanceInsightsSchema['environmentTypeTrends'];
summary: {
total: number;
active: number;
@@ -64,7 +64,7 @@ const ChartWidget = styled(Widget)(({ theme }) => ({
},
}));
-export const Charts: VFC = ({
+export const InsightsCharts: VFC = ({
projects,
users,
summary,
diff --git a/frontend/src/component/executiveDashboard/chart-info.ts b/frontend/src/component/insights/chart-info.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/chart-info.ts
rename to frontend/src/component/insights/chart-info.ts
diff --git a/frontend/src/component/executiveDashboard/components/Gauge/Gauge.tsx b/frontend/src/component/insights/components/Gauge/Gauge.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/Gauge/Gauge.tsx
rename to frontend/src/component/insights/components/Gauge/Gauge.tsx
diff --git a/frontend/src/component/executiveDashboard/components/HorizontalDistributionChart/HorizontalDistributionChart.tsx b/frontend/src/component/insights/components/HorizontalDistributionChart/HorizontalDistributionChart.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/HorizontalDistributionChart/HorizontalDistributionChart.tsx
rename to frontend/src/component/insights/components/HorizontalDistributionChart/HorizontalDistributionChart.tsx
diff --git a/frontend/src/component/executiveDashboard/components/DashboardHeader/DashboardHeader.tsx b/frontend/src/component/insights/components/InsightsHeader/InsightsHeader.tsx
similarity index 98%
rename from frontend/src/component/executiveDashboard/components/DashboardHeader/DashboardHeader.tsx
rename to frontend/src/component/insights/components/InsightsHeader/InsightsHeader.tsx
index b342c61e4c..75fc56a9c3 100644
--- a/frontend/src/component/executiveDashboard/components/DashboardHeader/DashboardHeader.tsx
+++ b/frontend/src/component/insights/components/InsightsHeader/InsightsHeader.tsx
@@ -49,7 +49,7 @@ const StyledActionsSmallScreen = styled('div')(({ theme }) => ({
marginTop: theme.spacing(2),
}));
-export const DashboardHeader: VFC = ({ actions }) => {
+export const InsightsHeader: VFC = ({ actions }) => {
const showInactiveUsers = useUiFlag('showInactiveUsers');
const theme = useTheme();
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
diff --git a/frontend/src/component/executiveDashboard/components/DashboardHeader/ShareLink/ShareLink.tsx b/frontend/src/component/insights/components/InsightsHeader/ShareLink/ShareLink.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/DashboardHeader/ShareLink/ShareLink.tsx
rename to frontend/src/component/insights/components/InsightsHeader/ShareLink/ShareLink.tsx
diff --git a/frontend/src/component/executiveDashboard/components/LineChart/ChartTooltip/ChartTooltip.tsx b/frontend/src/component/insights/components/LineChart/ChartTooltip/ChartTooltip.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/LineChart/ChartTooltip/ChartTooltip.tsx
rename to frontend/src/component/insights/components/LineChart/ChartTooltip/ChartTooltip.tsx
diff --git a/frontend/src/component/executiveDashboard/components/LineChart/LineChart.tsx b/frontend/src/component/insights/components/LineChart/LineChart.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/LineChart/LineChart.tsx
rename to frontend/src/component/insights/components/LineChart/LineChart.tsx
diff --git a/frontend/src/component/executiveDashboard/components/LineChart/LineChartComponent.tsx b/frontend/src/component/insights/components/LineChart/LineChartComponent.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/LineChart/LineChartComponent.tsx
rename to frontend/src/component/insights/components/LineChart/LineChartComponent.tsx
diff --git a/frontend/src/component/executiveDashboard/components/LineChart/createChartOptions.ts b/frontend/src/component/insights/components/LineChart/createChartOptions.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/LineChart/createChartOptions.ts
rename to frontend/src/component/insights/components/LineChart/createChartOptions.ts
diff --git a/frontend/src/component/executiveDashboard/components/LineChart/createTooltip.ts b/frontend/src/component/insights/components/LineChart/createTooltip.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/LineChart/createTooltip.ts
rename to frontend/src/component/insights/components/LineChart/createTooltip.ts
diff --git a/frontend/src/component/executiveDashboard/components/LineChart/legendOptions.ts b/frontend/src/component/insights/components/LineChart/legendOptions.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/LineChart/legendOptions.ts
rename to frontend/src/component/insights/components/LineChart/legendOptions.ts
diff --git a/frontend/src/component/executiveDashboard/components/Widget/Widget.tsx b/frontend/src/component/insights/components/Widget/Widget.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/components/Widget/Widget.tsx
rename to frontend/src/component/insights/components/Widget/Widget.tsx
diff --git a/frontend/src/component/executiveDashboard/componentsChart/FlagsChart/FlagsChart.tsx b/frontend/src/component/insights/componentsChart/FlagsChart/FlagsChart.tsx
similarity index 82%
rename from frontend/src/component/executiveDashboard/componentsChart/FlagsChart/FlagsChart.tsx
rename to frontend/src/component/insights/componentsChart/FlagsChart/FlagsChart.tsx
index 0ef77bc652..270c281086 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/FlagsChart/FlagsChart.tsx
+++ b/frontend/src/component/insights/componentsChart/FlagsChart/FlagsChart.tsx
@@ -1,12 +1,15 @@
import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
import { useTheme } from '@mui/material';
-import type { ExecutiveSummarySchema } from 'openapi';
-import { LineChart, NotEnoughData } from '../../components/LineChart/LineChart';
-import { usePlaceholderData } from 'component/executiveDashboard/hooks/usePlaceholderData';
+import type { InstanceInsightsSchema } from 'openapi';
+import {
+ LineChart,
+ NotEnoughData,
+} from 'component/insights/components/LineChart/LineChart';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
interface IFlagsChartProps {
- flagTrends: ExecutiveSummarySchema['flagTrends'];
+ flagTrends: InstanceInsightsSchema['flagTrends'];
isLoading?: boolean;
}
diff --git a/frontend/src/component/executiveDashboard/componentsChart/FlagsProjectChart/FlagsProjectChart.tsx b/frontend/src/component/insights/componentsChart/FlagsProjectChart/FlagsProjectChart.tsx
similarity index 66%
rename from frontend/src/component/executiveDashboard/componentsChart/FlagsProjectChart/FlagsProjectChart.tsx
rename to frontend/src/component/insights/componentsChart/FlagsProjectChart/FlagsProjectChart.tsx
index 5b5bc26ca2..6b8564be2a 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/FlagsProjectChart/FlagsProjectChart.tsx
+++ b/frontend/src/component/insights/componentsChart/FlagsProjectChart/FlagsProjectChart.tsx
@@ -1,14 +1,17 @@
import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
-import type { ExecutiveSummarySchema } from 'openapi';
-import { LineChart, NotEnoughData } from '../../components/LineChart/LineChart';
-import { useProjectChartData } from 'component/executiveDashboard/hooks/useProjectChartData';
-import { usePlaceholderData } from 'component/executiveDashboard/hooks/usePlaceholderData';
-import type { GroupedDataByProject } from '../../hooks/useGroupedProjectTrends';
+import type { InstanceInsightsSchema } from 'openapi';
+import {
+ LineChart,
+ NotEnoughData,
+} from 'component/insights/components/LineChart/LineChart';
+import { useProjectChartData } from 'component/insights/hooks/useProjectChartData';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
+import type { GroupedDataByProject } from 'component/insights/hooks/useGroupedProjectTrends';
interface IFlagsProjectChartProps {
projectFlagTrends: GroupedDataByProject<
- ExecutiveSummarySchema['projectFlagTrends']
+ InstanceInsightsSchema['projectFlagTrends']
>;
}
diff --git a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx
rename to frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx
diff --git a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx
similarity index 95%
rename from frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx
rename to frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx
index 73c223dc81..6cd3c5b48e 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx
+++ b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip.tsx
@@ -1,7 +1,7 @@
import type { VFC } from 'react';
-import type { ExecutiveSummarySchemaMetricsSummaryTrendsItem } from 'openapi';
+import type { InstanceInsightsSchemaMetricsSummaryTrendsItem } from 'openapi';
import { Box, Divider, Paper, styled, Typography } from '@mui/material';
-import type { TooltipState } from '../../../components/LineChart/ChartTooltip/ChartTooltip';
+import type { TooltipState } from 'component/insights/components/LineChart/ChartTooltip/ChartTooltip';
const StyledTooltipItemContainer = styled(Paper)(({ theme }) => ({
padding: theme.spacing(2),
@@ -66,7 +66,7 @@ export const MetricsSummaryTooltip: VFC<{ tooltip: TooltipState | null }> = ({
label: point.label,
title: point.dataset.label,
color: point.dataset.borderColor,
- value: point.raw as ExecutiveSummarySchemaMetricsSummaryTrendsItem & {
+ value: point.raw as InstanceInsightsSchemaMetricsSummaryTrendsItem & {
total: number;
},
};
diff --git a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.test.ts b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.test.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.test.ts
rename to frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.test.ts
diff --git a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.ts b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.ts
similarity index 87%
rename from frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.ts
rename to frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.ts
index 84916011da..9008857bee 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.ts
+++ b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsChartTooltip/aggregate-metrics-by-day.ts
@@ -1,7 +1,7 @@
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
export function aggregateDataPerDate(
- items: ExecutiveSummarySchema['metricsSummaryTrends'],
+ items: InstanceInsightsSchema['metricsSummaryTrends'],
) {
return items.reduce(
(acc, item) => {
diff --git a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsSummaryChart.tsx b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsSummaryChart.tsx
similarity index 84%
rename from frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsSummaryChart.tsx
rename to frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsSummaryChart.tsx
index cc2871a494..c0a35b3832 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/MetricsSummaryChart/MetricsSummaryChart.tsx
+++ b/frontend/src/component/insights/componentsChart/MetricsSummaryChart/MetricsSummaryChart.tsx
@@ -1,22 +1,22 @@
import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import {
fillGradientPrimary,
LineChart,
NotEnoughData,
-} from '../../components/LineChart/LineChart';
+} from 'component/insights/components/LineChart/LineChart';
import { MetricsSummaryTooltip } from './MetricsChartTooltip/MetricsChartTooltip';
-import { useMetricsSummary } from '../../hooks/useMetricsSummary';
-import { usePlaceholderData } from 'component/executiveDashboard/hooks/usePlaceholderData';
-import type { GroupedDataByProject } from '../../hooks/useGroupedProjectTrends';
+import { useMetricsSummary } from 'component/insights/hooks/useMetricsSummary';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
+import type { GroupedDataByProject } from 'component/insights/hooks/useGroupedProjectTrends';
import { useTheme } from '@mui/material';
import { aggregateDataPerDate } from './MetricsChartTooltip/aggregate-metrics-by-day';
interface IMetricsSummaryChartProps {
metricsSummaryTrends: GroupedDataByProject<
- ExecutiveSummarySchema['metricsSummaryTrends']
+ InstanceInsightsSchema['metricsSummaryTrends']
>;
isAggregate?: boolean;
}
diff --git a/frontend/src/component/executiveDashboard/componentsChart/ProjectHealthChart/HealthChartTooltip/HealthChartTooltip.tsx b/frontend/src/component/insights/componentsChart/ProjectHealthChart/HealthChartTooltip/HealthChartTooltip.tsx
similarity index 93%
rename from frontend/src/component/executiveDashboard/componentsChart/ProjectHealthChart/HealthChartTooltip/HealthChartTooltip.tsx
rename to frontend/src/component/insights/componentsChart/ProjectHealthChart/HealthChartTooltip/HealthChartTooltip.tsx
index f9219e521e..2dd3a99c8f 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/ProjectHealthChart/HealthChartTooltip/HealthChartTooltip.tsx
+++ b/frontend/src/component/insights/componentsChart/ProjectHealthChart/HealthChartTooltip/HealthChartTooltip.tsx
@@ -1,9 +1,9 @@
import type { VFC } from 'react';
-import type { ExecutiveSummarySchemaProjectFlagTrendsItem } from 'openapi';
+import type { InstanceInsightsSchemaProjectFlagTrendsItem } from 'openapi';
import { Box, Divider, Paper, Typography, styled } from '@mui/material';
import { Badge } from 'component/common/Badge/Badge';
-import type { TooltipState } from '../../../components/LineChart/ChartTooltip/ChartTooltip';
-import { HorizontalDistributionChart } from '../../../components/HorizontalDistributionChart/HorizontalDistributionChart';
+import type { TooltipState } from 'component/insights/components/LineChart/ChartTooltip/ChartTooltip';
+import { HorizontalDistributionChart } from 'component/insights/components/HorizontalDistributionChart/HorizontalDistributionChart';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
const StyledTooltipItemContainer = styled(Paper)(({ theme }) => ({
@@ -89,7 +89,7 @@ export const HealthTooltip: VFC<{ tooltip: TooltipState | null }> = ({
label: point.label,
title: point.dataset.label,
color: point.dataset.borderColor,
- value: point.raw as ExecutiveSummarySchemaProjectFlagTrendsItem,
+ value: point.raw as InstanceInsightsSchemaProjectFlagTrendsItem,
};
});
diff --git a/frontend/src/component/executiveDashboard/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx b/frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx
similarity index 90%
rename from frontend/src/component/executiveDashboard/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx
rename to frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx
index b6cec83424..766b571dd0 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx
+++ b/frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx
@@ -1,19 +1,19 @@
import 'chartjs-adapter-date-fns';
import { useMemo, type VFC } from 'react';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import { HealthTooltip } from './HealthChartTooltip/HealthChartTooltip';
-import { useProjectChartData } from 'component/executiveDashboard/hooks/useProjectChartData';
+import { useProjectChartData } from 'component/insights/hooks/useProjectChartData';
import {
fillGradientPrimary,
LineChart,
NotEnoughData,
-} from 'component/executiveDashboard/components/LineChart/LineChart';
+} from 'component/insights/components/LineChart/LineChart';
import { useTheme } from '@mui/material';
-import type { GroupedDataByProject } from '../../hooks/useGroupedProjectTrends';
+import type { GroupedDataByProject } from 'component/insights/hooks/useGroupedProjectTrends';
interface IProjectHealthChartProps {
projectFlagTrends: GroupedDataByProject<
- ExecutiveSummarySchema['projectFlagTrends']
+ InstanceInsightsSchema['projectFlagTrends']
>;
isAggregate?: boolean;
}
diff --git a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/TimeToProductionChart.tsx b/frontend/src/component/insights/componentsChart/TimeToProductionChart/TimeToProductionChart.tsx
similarity index 85%
rename from frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/TimeToProductionChart.tsx
rename to frontend/src/component/insights/componentsChart/TimeToProductionChart/TimeToProductionChart.tsx
index 280f56b99e..71392391a2 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/TimeToProductionChart.tsx
+++ b/frontend/src/component/insights/componentsChart/TimeToProductionChart/TimeToProductionChart.tsx
@@ -1,21 +1,21 @@
import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import {
fillGradientPrimary,
LineChart,
NotEnoughData,
-} from '../../components/LineChart/LineChart';
-import { useProjectChartData } from '../../hooks/useProjectChartData';
-import type { GroupedDataByProject } from '../../hooks/useGroupedProjectTrends';
-import { usePlaceholderData } from '../../hooks/usePlaceholderData';
+} from 'component/insights/components/LineChart/LineChart';
+import { useProjectChartData } from 'component/insights/hooks/useProjectChartData';
+import type { GroupedDataByProject } from 'component/insights/hooks/useGroupedProjectTrends';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
import { TimeToProductionTooltip } from './TimeToProductionTooltip/TimeToProductionTooltip';
import { useTheme } from '@mui/material';
import { medianTimeToProduction } from './median-time-to-production';
interface ITimeToProductionChartProps {
projectFlagTrends: GroupedDataByProject<
- ExecutiveSummarySchema['projectFlagTrends']
+ InstanceInsightsSchema['projectFlagTrends']
>;
isAggregate?: boolean;
}
diff --git a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/TimeToProductionTooltip/TimeToProductionTooltip.tsx b/frontend/src/component/insights/componentsChart/TimeToProductionChart/TimeToProductionTooltip/TimeToProductionTooltip.tsx
similarity index 93%
rename from frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/TimeToProductionTooltip/TimeToProductionTooltip.tsx
rename to frontend/src/component/insights/componentsChart/TimeToProductionChart/TimeToProductionTooltip/TimeToProductionTooltip.tsx
index 15e9c7d180..ded06ffba2 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/TimeToProductionTooltip/TimeToProductionTooltip.tsx
+++ b/frontend/src/component/insights/componentsChart/TimeToProductionChart/TimeToProductionTooltip/TimeToProductionTooltip.tsx
@@ -1,8 +1,8 @@
import type { VFC } from 'react';
-import type { ExecutiveSummarySchemaProjectFlagTrendsItem } from 'openapi';
+import type { InstanceInsightsSchemaProjectFlagTrendsItem } from 'openapi';
import { Box, Paper, Typography, styled } from '@mui/material';
import { Badge } from 'component/common/Badge/Badge';
-import type { TooltipState } from '../../../components/LineChart/ChartTooltip/ChartTooltip';
+import type { TooltipState } from 'component/insights/components/LineChart/ChartTooltip/ChartTooltip';
const StyledTooltipItemContainer = styled(Paper)(({ theme }) => ({
padding: theme.spacing(2),
@@ -62,7 +62,7 @@ export const TimeToProductionTooltip: VFC<{ tooltip: TooltipState | null }> = ({
label: point.label,
title: point.dataset.label,
color: point.dataset.borderColor,
- value: point.raw as ExecutiveSummarySchemaProjectFlagTrendsItem,
+ value: point.raw as InstanceInsightsSchemaProjectFlagTrendsItem,
};
});
diff --git a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/median-time-to-production.test.ts b/frontend/src/component/insights/componentsChart/TimeToProductionChart/median-time-to-production.test.ts
similarity index 87%
rename from frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/median-time-to-production.test.ts
rename to frontend/src/component/insights/componentsChart/TimeToProductionChart/median-time-to-production.test.ts
index 10eb75a7b3..36bf79d8e3 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/median-time-to-production.test.ts
+++ b/frontend/src/component/insights/componentsChart/TimeToProductionChart/median-time-to-production.test.ts
@@ -1,5 +1,5 @@
import { medianTimeToProduction } from './median-time-to-production';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
describe('medianTimeToProduction', () => {
it('calculates the median with a single date and an odd number of projects', () => {
@@ -7,7 +7,7 @@ describe('medianTimeToProduction', () => {
{ date: '2023-03-21', timeToProduction: 10 },
{ date: '2023-03-21', timeToProduction: 20 },
{ date: '2023-03-21', timeToProduction: 30 },
- ] as unknown as ExecutiveSummarySchema['projectFlagTrends'];
+ ] as unknown as InstanceInsightsSchema['projectFlagTrends'];
const expected = { '2023-03-21': 20 };
expect(medianTimeToProduction(projectsData)).toEqual(expected);
});
@@ -18,7 +18,7 @@ describe('medianTimeToProduction', () => {
{ date: '2023-03-22', timeToProduction: 20 },
{ date: '2023-03-22', timeToProduction: 30 },
{ date: '2023-03-22', timeToProduction: 40 },
- ] as unknown as ExecutiveSummarySchema['projectFlagTrends'];
+ ] as unknown as InstanceInsightsSchema['projectFlagTrends'];
const expected = { '2023-03-22': 25 };
expect(medianTimeToProduction(projectsData)).toEqual(expected);
});
@@ -31,7 +31,7 @@ describe('medianTimeToProduction', () => {
{ date: '2023-03-24', timeToProduction: 20 },
{ date: '2023-03-24', timeToProduction: 30 },
{ date: '2023-03-25', timeToProduction: 25 },
- ] as unknown as ExecutiveSummarySchema['projectFlagTrends'];
+ ] as unknown as InstanceInsightsSchema['projectFlagTrends'];
const expected = {
'2023-03-23': 10,
'2023-03-24': 20,
diff --git a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/median-time-to-production.ts b/frontend/src/component/insights/componentsChart/TimeToProductionChart/median-time-to-production.ts
similarity index 89%
rename from frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/median-time-to-production.ts
rename to frontend/src/component/insights/componentsChart/TimeToProductionChart/median-time-to-production.ts
index 1fe3507b11..4aede05874 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/TimeToProductionChart/median-time-to-production.ts
+++ b/frontend/src/component/insights/componentsChart/TimeToProductionChart/median-time-to-production.ts
@@ -1,11 +1,11 @@
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
type GroupedDataByDate = Record;
type DateResult = Record;
export function medianTimeToProduction(
- projectsData: ExecutiveSummarySchema['projectFlagTrends'],
+ projectsData: InstanceInsightsSchema['projectFlagTrends'],
): DateResult {
const groupedData: GroupedDataByDate = {};
projectsData.forEach((item) => {
diff --git a/frontend/src/component/executiveDashboard/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart.tsx b/frontend/src/component/insights/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart.tsx
similarity index 84%
rename from frontend/src/component/executiveDashboard/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart.tsx
rename to frontend/src/component/insights/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart.tsx
index ccf457d5b7..04cf5bbf49 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart.tsx
+++ b/frontend/src/component/insights/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChart.tsx
@@ -2,21 +2,24 @@ import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
import { useTheme } from '@mui/material';
import type {
- ExecutiveSummarySchema,
- ExecutiveSummarySchemaEnvironmentTypeTrendsItem,
+ InstanceInsightsSchema,
+ InstanceInsightsSchemaEnvironmentTypeTrendsItem,
} from 'openapi';
-import { LineChart, NotEnoughData } from '../../components/LineChart/LineChart';
-import { usePlaceholderData } from 'component/executiveDashboard/hooks/usePlaceholderData';
+import {
+ LineChart,
+ NotEnoughData,
+} from 'component/insights/components/LineChart/LineChart';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
import { UpdatesPerEnvironmentTypeChartTooltip } from './UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip';
interface IUpdatesPerEnvironmnetTypeChart {
- environmentTypeTrends: ExecutiveSummarySchema['environmentTypeTrends'];
+ environmentTypeTrends: InstanceInsightsSchema['environmentTypeTrends'];
isLoading?: boolean;
}
const groupByDate = (
- items: ExecutiveSummarySchemaEnvironmentTypeTrendsItem[],
-): Record => {
+ items: InstanceInsightsSchemaEnvironmentTypeTrendsItem[],
+): Record => {
if (!items) {
return {};
}
@@ -33,7 +36,7 @@ const groupByDate = (
return acc;
},
- {} as Record,
+ {} as Record,
);
return grouped;
diff --git a/frontend/src/component/executiveDashboard/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip.tsx b/frontend/src/component/insights/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip.tsx
similarity index 93%
rename from frontend/src/component/executiveDashboard/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip.tsx
rename to frontend/src/component/insights/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip.tsx
index 8f5c9337f0..9e6489ef75 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip.tsx
+++ b/frontend/src/component/insights/componentsChart/UpdatesPerEnvironmentTypeChart/UpdatesPerEnvironmentTypeChartTooltip/UpdatesPerEnvironmentTypeChartTooltip.tsx
@@ -1,7 +1,7 @@
import type { VFC } from 'react';
-import type { ExecutiveSummarySchemaEnvironmentTypeTrendsItem } from 'openapi';
+import type { InstanceInsightsSchemaEnvironmentTypeTrendsItem } from 'openapi';
import { Box, Divider, Paper, styled, Typography } from '@mui/material';
-import type { TooltipState } from '../../../components/LineChart/ChartTooltip/ChartTooltip';
+import type { TooltipState } from 'component/insights/components/LineChart/ChartTooltip/ChartTooltip';
const StyledTooltipItemContainer = styled(Paper)(({ theme }) => ({
padding: theme.spacing(2),
@@ -64,7 +64,7 @@ export const UpdatesPerEnvironmentTypeChartTooltip: VFC<{
label: point.label,
title: point.dataset.label,
color: point.dataset.borderColor,
- value: point.raw as ExecutiveSummarySchemaEnvironmentTypeTrendsItem,
+ value: point.raw as InstanceInsightsSchemaEnvironmentTypeTrendsItem,
};
});
diff --git a/frontend/src/component/executiveDashboard/componentsChart/UsersChart/UsersChart.tsx b/frontend/src/component/insights/componentsChart/UsersChart/UsersChart.tsx
similarity index 89%
rename from frontend/src/component/executiveDashboard/componentsChart/UsersChart/UsersChart.tsx
rename to frontend/src/component/insights/componentsChart/UsersChart/UsersChart.tsx
index 6125704d41..af395ab15e 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/UsersChart/UsersChart.tsx
+++ b/frontend/src/component/insights/componentsChart/UsersChart/UsersChart.tsx
@@ -1,17 +1,17 @@
import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
import { useTheme } from '@mui/material';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import {
fillGradientPrimary,
LineChart,
NotEnoughData,
-} from '../../components/LineChart/LineChart';
+} from 'component/insights/components/LineChart/LineChart';
import { useUiFlag } from 'hooks/useUiFlag';
-import { usePlaceholderData } from 'component/executiveDashboard/hooks/usePlaceholderData';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
interface IUsersChartProps {
- userTrends: ExecutiveSummarySchema['userTrends'];
+ userTrends: InstanceInsightsSchema['userTrends'];
isLoading?: boolean;
}
diff --git a/frontend/src/component/executiveDashboard/componentsChart/UsersPerProjectChart/UsersPerProjectChart.tsx b/frontend/src/component/insights/componentsChart/UsersPerProjectChart/UsersPerProjectChart.tsx
similarity index 66%
rename from frontend/src/component/executiveDashboard/componentsChart/UsersPerProjectChart/UsersPerProjectChart.tsx
rename to frontend/src/component/insights/componentsChart/UsersPerProjectChart/UsersPerProjectChart.tsx
index bed0ac2925..bc003c0e7e 100644
--- a/frontend/src/component/executiveDashboard/componentsChart/UsersPerProjectChart/UsersPerProjectChart.tsx
+++ b/frontend/src/component/insights/componentsChart/UsersPerProjectChart/UsersPerProjectChart.tsx
@@ -1,14 +1,17 @@
import { useMemo, type VFC } from 'react';
import 'chartjs-adapter-date-fns';
-import type { ExecutiveSummarySchema } from 'openapi';
-import { LineChart, NotEnoughData } from '../../components/LineChart/LineChart';
-import { useProjectChartData } from 'component/executiveDashboard/hooks/useProjectChartData';
-import { usePlaceholderData } from 'component/executiveDashboard/hooks/usePlaceholderData';
-import type { GroupedDataByProject } from '../../hooks/useGroupedProjectTrends';
+import type { InstanceInsightsSchema } from 'openapi';
+import {
+ LineChart,
+ NotEnoughData,
+} from 'component/insights/components/LineChart/LineChart';
+import { useProjectChartData } from 'component/insights/hooks/useProjectChartData';
+import { usePlaceholderData } from 'component/insights/hooks/usePlaceholderData';
+import type { GroupedDataByProject } from 'component/insights/hooks/useGroupedProjectTrends';
interface IUsersPerProjectChartProps {
projectFlagTrends: GroupedDataByProject<
- ExecutiveSummarySchema['projectFlagTrends']
+ InstanceInsightsSchema['projectFlagTrends']
>;
}
diff --git a/frontend/src/component/executiveDashboard/componentsStat/FlagStats/FlagStats.tsx b/frontend/src/component/insights/componentsStat/FlagStats/FlagStats.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/componentsStat/FlagStats/FlagStats.tsx
rename to frontend/src/component/insights/componentsStat/FlagStats/FlagStats.tsx
diff --git a/frontend/src/component/executiveDashboard/componentsStat/HealthStats/HealthStats.tsx b/frontend/src/component/insights/componentsStat/HealthStats/HealthStats.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/componentsStat/HealthStats/HealthStats.tsx
rename to frontend/src/component/insights/componentsStat/HealthStats/HealthStats.tsx
diff --git a/frontend/src/component/executiveDashboard/componentsStat/TimeToProduction/TimeToProduction.tsx b/frontend/src/component/insights/componentsStat/TimeToProduction/TimeToProduction.tsx
similarity index 97%
rename from frontend/src/component/executiveDashboard/componentsStat/TimeToProduction/TimeToProduction.tsx
rename to frontend/src/component/insights/componentsStat/TimeToProduction/TimeToProduction.tsx
index 3a5725e0cd..2436532734 100644
--- a/frontend/src/component/executiveDashboard/componentsStat/TimeToProduction/TimeToProduction.tsx
+++ b/frontend/src/component/insights/componentsStat/TimeToProduction/TimeToProduction.tsx
@@ -1,6 +1,6 @@
import type { VFC } from 'react';
import { Typography, styled } from '@mui/material';
-import { Gauge } from '../../components/Gauge/Gauge';
+import { Gauge } from 'component/insights/components/Gauge/Gauge';
const StyledContainer = styled('div')(({ theme }) => ({
display: 'flex',
diff --git a/frontend/src/component/executiveDashboard/componentsStat/UserStats/UserDistributionInfo.tsx b/frontend/src/component/insights/componentsStat/UserStats/UserDistributionInfo.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/componentsStat/UserStats/UserDistributionInfo.tsx
rename to frontend/src/component/insights/componentsStat/UserStats/UserDistributionInfo.tsx
diff --git a/frontend/src/component/executiveDashboard/componentsStat/UserStats/UserStats.tsx b/frontend/src/component/insights/componentsStat/UserStats/UserStats.tsx
similarity index 100%
rename from frontend/src/component/executiveDashboard/componentsStat/UserStats/UserStats.tsx
rename to frontend/src/component/insights/componentsStat/UserStats/UserStats.tsx
diff --git a/frontend/src/component/executiveDashboard/hooks/useFilteredFlagsSummary.test.ts b/frontend/src/component/insights/hooks/useFilteredFlagsSummary.test.ts
similarity index 93%
rename from frontend/src/component/executiveDashboard/hooks/useFilteredFlagsSummary.test.ts
rename to frontend/src/component/insights/hooks/useFilteredFlagsSummary.test.ts
index b4a19b73ef..4ccaaf2af5 100644
--- a/frontend/src/component/executiveDashboard/hooks/useFilteredFlagsSummary.test.ts
+++ b/frontend/src/component/insights/hooks/useFilteredFlagsSummary.test.ts
@@ -1,6 +1,6 @@
import { renderHook } from '@testing-library/react-hooks';
import { useFilteredFlagsSummary } from './useFilteredFlagsSummary';
-import type { ExecutiveSummarySchemaUsers } from '../../../openapi';
+import type { InstanceInsightsSchemaUsers } from 'openapi';
describe('useFilteredFlagTrends', () => {
it('should summarize only last week of project flag trends', () => {
@@ -48,7 +48,7 @@ describe('useFilteredFlagTrends', () => {
date: '',
},
],
- { total: 1 } as unknown as ExecutiveSummarySchemaUsers,
+ { total: 1 } as unknown as InstanceInsightsSchemaUsers,
),
);
@@ -78,7 +78,7 @@ describe('useFilteredFlagTrends', () => {
date: '',
},
],
- { total: 1 } as unknown as ExecutiveSummarySchemaUsers,
+ { total: 1 } as unknown as InstanceInsightsSchemaUsers,
),
);
@@ -118,7 +118,7 @@ describe('useFilteredFlagTrends', () => {
date: '',
},
],
- { total: 1 } as unknown as ExecutiveSummarySchemaUsers,
+ { total: 1 } as unknown as InstanceInsightsSchemaUsers,
),
);
@@ -148,7 +148,7 @@ describe('useFilteredFlagTrends', () => {
date: '',
},
],
- { total: 1 } as unknown as ExecutiveSummarySchemaUsers,
+ { total: 1 } as unknown as InstanceInsightsSchemaUsers,
),
);
diff --git a/frontend/src/component/executiveDashboard/hooks/useFilteredFlagsSummary.ts b/frontend/src/component/insights/hooks/useFilteredFlagsSummary.ts
similarity index 90%
rename from frontend/src/component/executiveDashboard/hooks/useFilteredFlagsSummary.ts
rename to frontend/src/component/insights/hooks/useFilteredFlagsSummary.ts
index 5c3ac1608e..2635ea64bb 100644
--- a/frontend/src/component/executiveDashboard/hooks/useFilteredFlagsSummary.ts
+++ b/frontend/src/component/insights/hooks/useFilteredFlagsSummary.ts
@@ -1,13 +1,13 @@
import { useMemo } from 'react';
import type {
- ExecutiveSummarySchemaProjectFlagTrendsItem,
- ExecutiveSummarySchemaUsers,
+ InstanceInsightsSchemaProjectFlagTrendsItem,
+ InstanceInsightsSchemaUsers,
} from 'openapi';
// NOTE: should we move project filtering to the backend?
export const useFilteredFlagsSummary = (
- filteredProjectFlagTrends: ExecutiveSummarySchemaProjectFlagTrendsItem[],
- users: ExecutiveSummarySchemaUsers,
+ filteredProjectFlagTrends: InstanceInsightsSchemaProjectFlagTrendsItem[],
+ users: InstanceInsightsSchemaUsers,
) =>
useMemo(() => {
const lastWeekId = filteredProjectFlagTrends.reduce((prev, current) => {
diff --git a/frontend/src/component/executiveDashboard/hooks/useFilteredTrends.test.ts b/frontend/src/component/insights/hooks/useFilteredTrends.test.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/useFilteredTrends.test.ts
rename to frontend/src/component/insights/hooks/useFilteredTrends.test.ts
diff --git a/frontend/src/component/executiveDashboard/hooks/useFilteredTrends.ts b/frontend/src/component/insights/hooks/useFilteredTrends.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/useFilteredTrends.ts
rename to frontend/src/component/insights/hooks/useFilteredTrends.ts
diff --git a/frontend/src/component/executiveDashboard/hooks/useGroupedProjectTrends.test.ts b/frontend/src/component/insights/hooks/useGroupedProjectTrends.test.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/useGroupedProjectTrends.test.ts
rename to frontend/src/component/insights/hooks/useGroupedProjectTrends.test.ts
diff --git a/frontend/src/component/executiveDashboard/hooks/useGroupedProjectTrends.ts b/frontend/src/component/insights/hooks/useGroupedProjectTrends.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/useGroupedProjectTrends.ts
rename to frontend/src/component/insights/hooks/useGroupedProjectTrends.ts
diff --git a/frontend/src/component/executiveDashboard/hooks/useDashboardData.ts b/frontend/src/component/insights/hooks/useInsightsData.ts
similarity index 91%
rename from frontend/src/component/executiveDashboard/hooks/useDashboardData.ts
rename to frontend/src/component/insights/hooks/useInsightsData.ts
index ade24fdaf3..7499e56737 100644
--- a/frontend/src/component/executiveDashboard/hooks/useDashboardData.ts
+++ b/frontend/src/component/insights/hooks/useInsightsData.ts
@@ -1,12 +1,12 @@
import { useMemo } from 'react';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import { useFilteredTrends } from './useFilteredTrends';
import { useGroupedProjectTrends } from './useGroupedProjectTrends';
import { useFilteredFlagsSummary } from './useFilteredFlagsSummary';
import { useMedianTimeToProduction } from './useMedianTimeToProduction';
-export const useDashboardData = (
- executiveDashboardData: ExecutiveSummarySchema,
+export const useInsightsData = (
+ executiveDashboardData: InstanceInsightsSchema,
projects: string[],
) => {
const projectsData = useFilteredTrends(
diff --git a/frontend/src/component/executiveDashboard/hooks/useMedianTimeToProduction.test.ts b/frontend/src/component/insights/hooks/useMedianTimeToProduction.test.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/useMedianTimeToProduction.test.ts
rename to frontend/src/component/insights/hooks/useMedianTimeToProduction.test.ts
diff --git a/frontend/src/component/executiveDashboard/hooks/useMedianTimeToProduction.ts b/frontend/src/component/insights/hooks/useMedianTimeToProduction.ts
similarity index 85%
rename from frontend/src/component/executiveDashboard/hooks/useMedianTimeToProduction.ts
rename to frontend/src/component/insights/hooks/useMedianTimeToProduction.ts
index e4d689da1a..6ae3df7500 100644
--- a/frontend/src/component/executiveDashboard/hooks/useMedianTimeToProduction.ts
+++ b/frontend/src/component/insights/hooks/useMedianTimeToProduction.ts
@@ -1,16 +1,16 @@
import { useMemo } from 'react';
import type {
- ExecutiveSummarySchema,
- ExecutiveSummarySchemaProjectFlagTrendsItem,
+ InstanceInsightsSchema,
+ InstanceInsightsSchemaProjectFlagTrendsItem,
} from 'openapi';
import type { GroupedDataByProject } from './useGroupedProjectTrends';
-const validTrend = (trend: ExecutiveSummarySchemaProjectFlagTrendsItem) =>
+const validTrend = (trend: InstanceInsightsSchemaProjectFlagTrendsItem) =>
Boolean(trend) && Boolean(trend.timeToProduction);
export const useMedianTimeToProduction = (
projectsData: GroupedDataByProject<
- ExecutiveSummarySchema['projectFlagTrends']
+ InstanceInsightsSchema['projectFlagTrends']
>,
) =>
useMemo(() => {
diff --git a/frontend/src/component/executiveDashboard/hooks/useMetricsSummary.ts b/frontend/src/component/insights/hooks/useMetricsSummary.ts
similarity index 88%
rename from frontend/src/component/executiveDashboard/hooks/useMetricsSummary.ts
rename to frontend/src/component/insights/hooks/useMetricsSummary.ts
index 3cbe80493c..935c271116 100644
--- a/frontend/src/component/executiveDashboard/hooks/useMetricsSummary.ts
+++ b/frontend/src/component/insights/hooks/useMetricsSummary.ts
@@ -1,10 +1,10 @@
import { useMemo } from 'react';
import { useTheme } from '@mui/material';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import { useProjectColor } from './useProjectColor';
import type { GroupedDataByProject } from './useGroupedProjectTrends';
-type MetricsSummaryTrends = ExecutiveSummarySchema['metricsSummaryTrends'];
+type MetricsSummaryTrends = InstanceInsightsSchema['metricsSummaryTrends'];
export const useMetricsSummary = (
metricsSummaryTrends: GroupedDataByProject,
diff --git a/frontend/src/component/executiveDashboard/hooks/usePlaceholderData.ts b/frontend/src/component/insights/hooks/usePlaceholderData.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/usePlaceholderData.ts
rename to frontend/src/component/insights/hooks/usePlaceholderData.ts
diff --git a/frontend/src/component/executiveDashboard/hooks/useProjectChartData.ts b/frontend/src/component/insights/hooks/useProjectChartData.ts
similarity index 88%
rename from frontend/src/component/executiveDashboard/hooks/useProjectChartData.ts
rename to frontend/src/component/insights/hooks/useProjectChartData.ts
index 915bf584a8..52caa036df 100644
--- a/frontend/src/component/executiveDashboard/hooks/useProjectChartData.ts
+++ b/frontend/src/component/insights/hooks/useProjectChartData.ts
@@ -1,10 +1,10 @@
import { useMemo } from 'react';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
import { useProjectColor } from './useProjectColor';
import { useTheme } from '@mui/material';
import type { GroupedDataByProject } from './useGroupedProjectTrends';
-type ProjectFlagTrends = ExecutiveSummarySchema['projectFlagTrends'];
+type ProjectFlagTrends = InstanceInsightsSchema['projectFlagTrends'];
export const useProjectChartData = (
projectFlagTrends: GroupedDataByProject,
diff --git a/frontend/src/component/executiveDashboard/hooks/useProjectColor.ts b/frontend/src/component/insights/hooks/useProjectColor.ts
similarity index 100%
rename from frontend/src/component/executiveDashboard/hooks/useProjectColor.ts
rename to frontend/src/component/insights/hooks/useProjectColor.ts
diff --git a/frontend/src/component/menu/routes.ts b/frontend/src/component/menu/routes.ts
index 5e2e443f9a..af20930a54 100644
--- a/frontend/src/component/menu/routes.ts
+++ b/frontend/src/component/menu/routes.ts
@@ -44,7 +44,7 @@ import { FeatureTypesList } from 'component/featureTypes/FeatureTypesList';
import { ViewIntegration } from 'component/integrations/ViewIntegration/ViewIntegration';
import { PaginatedApplicationList } from '../application/ApplicationList/PaginatedApplicationList';
import { AddonRedirect } from 'component/integrations/AddonRedirect/AddonRedirect';
-import { ExecutiveDashboard } from 'component/executiveDashboard/ExecutiveDashboard';
+import { Insights } from '../insights/Insights';
import { FeedbackList } from '../feedbackNew/FeedbackList';
import { Application } from 'component/application/Application';
import { Signals } from 'component/signals/Signals';
@@ -64,7 +64,7 @@ export const routes: IRoute[] = [
{
path: '/insights',
title: 'Insights',
- component: ExecutiveDashboard,
+ component: Insights,
type: 'protected',
menu: { mobile: true },
flag: 'executiveDashboardUI',
diff --git a/frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts b/frontend/src/hooks/api/getters/useInsights/useInsights.ts
similarity index 66%
rename from frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts
rename to frontend/src/hooks/api/getters/useInsights/useInsights.ts
index 59e519065d..d447ec8912 100644
--- a/frontend/src/hooks/api/getters/useExecutiveSummary/useExecutiveSummary.ts
+++ b/frontend/src/hooks/api/getters/useInsights/useInsights.ts
@@ -2,32 +2,32 @@ import useSWR, { mutate, type SWRConfiguration } from 'swr';
import { useCallback } from 'react';
import { formatApiPath } from 'utils/formatPath';
import handleErrorResponses from '../httpErrorResponseHandler';
-import type { ExecutiveSummarySchema } from 'openapi';
+import type { InstanceInsightsSchema } from 'openapi';
-interface IUseExecutiveDashboardDataOutput {
- executiveDashboardData: ExecutiveSummarySchema;
- refetchExecutiveDashboard: () => void;
+interface IUseInsightsDataOutput {
+ insights: InstanceInsightsSchema;
+ refetchInsights: () => void;
loading: boolean;
error?: Error;
}
-export const useExecutiveDashboard = (
+export const useInsights = (
options?: SWRConfiguration,
-): IUseExecutiveDashboardDataOutput => {
+): IUseInsightsDataOutput => {
const path = formatApiPath('api/admin/dashboard/executive');
- const { data, error } = useSWR(
+ const { data, error } = useSWR(
path,
fetchExecutiveDashboard,
options,
);
- const refetchExecutiveDashboard = useCallback(() => {
+ const refetchInsights = useCallback(() => {
mutate(path).catch(console.warn);
}, [path]);
return {
- executiveDashboardData: data || {
+ insights: data || {
users: { total: 0, inactive: 0, active: 0 },
flags: { total: 0 },
userTrends: [],
@@ -36,7 +36,7 @@ export const useExecutiveDashboard = (
metricsSummaryTrends: [],
environmentTypeTrends: [],
},
- refetchExecutiveDashboard,
+ refetchInsights,
loading: !error && !data,
error,
};
@@ -44,7 +44,7 @@ export const useExecutiveDashboard = (
const fetchExecutiveDashboard = (
path: string,
-): Promise => {
+): Promise => {
return fetch(path)
.then(handleErrorResponses('Executive Dashboard Data'))
.then((res) => res.json());
diff --git a/frontend/src/openapi/models/executiveSummarySchema.ts b/frontend/src/openapi/models/executiveSummarySchema.ts
deleted file mode 100644
index 0f65daab6c..0000000000
--- a/frontend/src/openapi/models/executiveSummarySchema.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Generated by Orval
- * Do not edit manually.
- * See `gen:api` script in package.json
- */
-import type { ExecutiveSummarySchemaEnvironmentTypeTrendsItem } from './executiveSummarySchemaEnvironmentTypeTrendsItem';
-import type { ExecutiveSummarySchemaFlags } from './executiveSummarySchemaFlags';
-import type { ExecutiveSummarySchemaFlagTrendsItem } from './executiveSummarySchemaFlagTrendsItem';
-import type { ExecutiveSummarySchemaMetricsSummaryTrendsItem } from './executiveSummarySchemaMetricsSummaryTrendsItem';
-import type { ExecutiveSummarySchemaProjectFlagTrendsItem } from './executiveSummarySchemaProjectFlagTrendsItem';
-import type { ExecutiveSummarySchemaUsers } from './executiveSummarySchemaUsers';
-import type { ExecutiveSummarySchemaUserTrendsItem } from './executiveSummarySchemaUserTrendsItem';
-
-/**
- * Executive summary of Unleash usage
- */
-export interface ExecutiveSummarySchema {
- /** How updates per environment type changed over time */
- environmentTypeTrends: ExecutiveSummarySchemaEnvironmentTypeTrendsItem[];
- /** High level flag count statistics */
- flags: ExecutiveSummarySchemaFlags;
- /** How number of flags changed over time */
- flagTrends: ExecutiveSummarySchemaFlagTrendsItem[];
- /** How metrics data per project changed over time */
- metricsSummaryTrends: ExecutiveSummarySchemaMetricsSummaryTrendsItem[];
- /** How number of flags per project changed over time */
- projectFlagTrends: ExecutiveSummarySchemaProjectFlagTrendsItem[];
- /** High level user count statistics */
- users: ExecutiveSummarySchemaUsers;
- /** How number of users changed over time */
- userTrends: ExecutiveSummarySchemaUserTrendsItem[];
-}
diff --git a/frontend/src/openapi/models/index.ts b/frontend/src/openapi/models/index.ts
index a5d2b8422f..139bb95c06 100644
--- a/frontend/src/openapi/models/index.ts
+++ b/frontend/src/openapi/models/index.ts
@@ -521,14 +521,6 @@ export * from './eventSchemaPreData';
export * from './eventSchemaType';
export * from './eventsSchema';
export * from './eventsSchemaVersion';
-export * from './executiveSummarySchema';
-export * from './executiveSummarySchemaEnvironmentTypeTrendsItem';
-export * from './executiveSummarySchemaFlagTrendsItem';
-export * from './executiveSummarySchemaFlags';
-export * from './executiveSummarySchemaMetricsSummaryTrendsItem';
-export * from './executiveSummarySchemaProjectFlagTrendsItem';
-export * from './executiveSummarySchemaUserTrendsItem';
-export * from './executiveSummarySchemaUsers';
export * from './exportFeatures404';
export * from './exportQuerySchema';
export * from './exportQuerySchemaAnyOf';
@@ -770,6 +762,14 @@ export * from './instanceAdminStatsSchemaClientAppsItem';
export * from './instanceAdminStatsSchemaClientAppsItemRange';
export * from './instanceAdminStatsSchemaPreviousDayMetricsBucketsCount';
export * from './instanceAdminStatsSchemaProductionChanges';
+export * from './instanceInsightsSchema';
+export * from './instanceInsightsSchemaEnvironmentTypeTrendsItem';
+export * from './instanceInsightsSchemaFlagTrendsItem';
+export * from './instanceInsightsSchemaFlags';
+export * from './instanceInsightsSchemaMetricsSummaryTrendsItem';
+export * from './instanceInsightsSchemaProjectFlagTrendsItem';
+export * from './instanceInsightsSchemaUserTrendsItem';
+export * from './instanceInsightsSchemaUsers';
export * from './invoicesSchema';
export * from './invoicesSchemaItem';
export * from './legalValueSchema';
diff --git a/frontend/src/openapi/models/instanceInsightsSchema.ts b/frontend/src/openapi/models/instanceInsightsSchema.ts
new file mode 100644
index 0000000000..e64ee03b5a
--- /dev/null
+++ b/frontend/src/openapi/models/instanceInsightsSchema.ts
@@ -0,0 +1,32 @@
+/**
+ * Generated by Orval
+ * Do not edit manually.
+ * See `gen:api` script in package.json
+ */
+import type { InstanceInsightsSchemaEnvironmentTypeTrendsItem } from './instanceInsightsSchemaEnvironmentTypeTrendsItem';
+import type { InstanceInsightsSchemaFlags } from './instanceInsightsSchemaFlags';
+import type { InstanceInsightsSchemaFlagTrendsItem } from './instanceInsightsSchemaFlagTrendsItem';
+import type { InstanceInsightsSchemaMetricsSummaryTrendsItem } from './instanceInsightsSchemaMetricsSummaryTrendsItem';
+import type { InstanceInsightsSchemaProjectFlagTrendsItem } from './instanceInsightsSchemaProjectFlagTrendsItem';
+import type { InstanceInsightsSchemaUsers } from './instanceInsightsSchemaUsers';
+import type { InstanceInsightsSchemaUserTrendsItem } from './instanceInsightsSchemaUserTrendsItem';
+
+/**
+ * A summary of this Unleash instance's usage statistics, including user and flag counts, and trends over time.
+ */
+export interface InstanceInsightsSchema {
+ /** How updates per environment type changed over time */
+ environmentTypeTrends: InstanceInsightsSchemaEnvironmentTypeTrendsItem[];
+ /** High level flag count statistics */
+ flags: InstanceInsightsSchemaFlags;
+ /** How number of flags changed over time */
+ flagTrends: InstanceInsightsSchemaFlagTrendsItem[];
+ /** How metrics data per project changed over time */
+ metricsSummaryTrends: InstanceInsightsSchemaMetricsSummaryTrendsItem[];
+ /** How number of flags per project changed over time */
+ projectFlagTrends: InstanceInsightsSchemaProjectFlagTrendsItem[];
+ /** High level user count statistics */
+ users: InstanceInsightsSchemaUsers;
+ /** How number of users changed over time */
+ userTrends: InstanceInsightsSchemaUserTrendsItem[];
+}
diff --git a/frontend/src/openapi/models/executiveSummarySchemaEnvironmentTypeTrendsItem.ts b/frontend/src/openapi/models/instanceInsightsSchemaEnvironmentTypeTrendsItem.ts
similarity index 88%
rename from frontend/src/openapi/models/executiveSummarySchemaEnvironmentTypeTrendsItem.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaEnvironmentTypeTrendsItem.ts
index 10fe5a5334..c40291ff2e 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaEnvironmentTypeTrendsItem.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaEnvironmentTypeTrendsItem.ts
@@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
-export type ExecutiveSummarySchemaEnvironmentTypeTrendsItem = {
+export type InstanceInsightsSchemaEnvironmentTypeTrendsItem = {
/** A UTC date when the stats were captured. Time is the very end of a given day. */
date: string;
/** Environment type the data belongs too */
diff --git a/frontend/src/openapi/models/executiveSummarySchemaFlagTrendsItem.ts b/frontend/src/openapi/models/instanceInsightsSchemaFlagTrendsItem.ts
similarity index 91%
rename from frontend/src/openapi/models/executiveSummarySchemaFlagTrendsItem.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaFlagTrendsItem.ts
index a3e8360041..468c80a69b 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaFlagTrendsItem.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaFlagTrendsItem.ts
@@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
-export type ExecutiveSummarySchemaFlagTrendsItem = {
+export type InstanceInsightsSchemaFlagTrendsItem = {
/** The number of active flags on a particular day */
active: number;
/** A UTC date when the stats were captured. Time is the very end of a given day. */
diff --git a/frontend/src/openapi/models/executiveSummarySchemaFlags.ts b/frontend/src/openapi/models/instanceInsightsSchemaFlags.ts
similarity index 82%
rename from frontend/src/openapi/models/executiveSummarySchemaFlags.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaFlags.ts
index 2a069ff9c3..2b5216c655 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaFlags.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaFlags.ts
@@ -7,7 +7,7 @@
/**
* High level flag count statistics
*/
-export type ExecutiveSummarySchemaFlags = {
+export type InstanceInsightsSchemaFlags = {
/** The number of non-archived flags */
total: number;
};
diff --git a/frontend/src/openapi/models/executiveSummarySchemaMetricsSummaryTrendsItem.ts b/frontend/src/openapi/models/instanceInsightsSchemaMetricsSummaryTrendsItem.ts
similarity index 94%
rename from frontend/src/openapi/models/executiveSummarySchemaMetricsSummaryTrendsItem.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaMetricsSummaryTrendsItem.ts
index 7dd31b91af..9ebc6a761c 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaMetricsSummaryTrendsItem.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaMetricsSummaryTrendsItem.ts
@@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
-export type ExecutiveSummarySchemaMetricsSummaryTrendsItem = {
+export type InstanceInsightsSchemaMetricsSummaryTrendsItem = {
/** A UTC date when metrics summary was captured. Time is the very end of a given day. */
date: string;
/** Project id of the project the impressions summary belong to */
diff --git a/frontend/src/openapi/models/executiveSummarySchemaProjectFlagTrendsItem.ts b/frontend/src/openapi/models/instanceInsightsSchemaProjectFlagTrendsItem.ts
similarity index 95%
rename from frontend/src/openapi/models/executiveSummarySchemaProjectFlagTrendsItem.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaProjectFlagTrendsItem.ts
index 9ce5e493b4..664adf48f5 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaProjectFlagTrendsItem.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaProjectFlagTrendsItem.ts
@@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
-export type ExecutiveSummarySchemaProjectFlagTrendsItem = {
+export type InstanceInsightsSchemaProjectFlagTrendsItem = {
/** The number of active flags on a particular day */
active: number;
/** A UTC date when the stats were captured. Time is the very end of a given day. */
diff --git a/frontend/src/openapi/models/executiveSummarySchemaUserTrendsItem.ts b/frontend/src/openapi/models/instanceInsightsSchemaUserTrendsItem.ts
similarity index 89%
rename from frontend/src/openapi/models/executiveSummarySchemaUserTrendsItem.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaUserTrendsItem.ts
index bc562bda80..131da75e62 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaUserTrendsItem.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaUserTrendsItem.ts
@@ -4,7 +4,7 @@
* See `gen:api` script in package.json
*/
-export type ExecutiveSummarySchemaUserTrendsItem = {
+export type InstanceInsightsSchemaUserTrendsItem = {
/** The number of active Unleash users on a particular day */
active: number;
/** A UTC date when the stats were captured. Time is the very end of a given day. */
diff --git a/frontend/src/openapi/models/executiveSummarySchemaUsers.ts b/frontend/src/openapi/models/instanceInsightsSchemaUsers.ts
similarity index 90%
rename from frontend/src/openapi/models/executiveSummarySchemaUsers.ts
rename to frontend/src/openapi/models/instanceInsightsSchemaUsers.ts
index a524856f28..a127051991 100644
--- a/frontend/src/openapi/models/executiveSummarySchemaUsers.ts
+++ b/frontend/src/openapi/models/instanceInsightsSchemaUsers.ts
@@ -7,7 +7,7 @@
/**
* High level user count statistics
*/
-export type ExecutiveSummarySchemaUsers = {
+export type InstanceInsightsSchemaUsers = {
/** The number of active Unleash users who have user Unleash in the past 60 days */
active: number;
/** The number of inactive Unleash users who have not used Unleash in the past 60 days. */