,
+ options: { groupId?: string } = {},
+): { lane?: ExperimentLane; treatment?: ExperimentTreatment } => {
+ const groupId = options.groupId ?? 'experiment-preview';
+ const matchedLane =
+ lanes.find(
+ (lane) =>
+ lane.constraints.length > 0 &&
+ laneMatchesContext(lane, context),
+ ) ??
+ lanes.find(
+ (lane) =>
+ lane.constraints.length === 0 &&
+ laneMatchesContext(lane, context),
+ );
+
+ return {
+ lane: matchedLane,
+ treatment: matchedLane
+ ? selectWeightedTreatment(treatments, matchedLane, context, groupId)
+ : undefined,
+ };
+};
diff --git a/frontend/src/component/feature/FeatureView/FeatureView.tsx b/frontend/src/component/feature/FeatureView/FeatureView.tsx
index e5ec9fad84..ffa5def37b 100644
--- a/frontend/src/component/feature/FeatureView/FeatureView.tsx
+++ b/frontend/src/component/feature/FeatureView/FeatureView.tsx
@@ -15,6 +15,7 @@ import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { FeatureImpactHeader } from './FeatureImpactOverview/FeatureImpactHeader';
import { ImpactMetricModal } from '../../impact-metrics/ImpactMetricModal/ImpactMetricModal';
import { useFeatureImpactChartActions } from './useFeatureImpactChartActions';
+import { FeatureExperimentOverview } from './FeatureExperiment/FeatureExperimentOverview.tsx';
export const StyledLink = styled(Link)(() => ({
maxWidth: '100%',
@@ -32,7 +33,7 @@ export const FeatureView = () => {
const { isEnterprise } = useUiConfig();
const showImpactMetrics = impactMetricsFlagPage && isEnterprise();
- const { feature, loading, error, status } = useFeature(
+ const { feature, loading, error, status, refetchFeature } = useFeature(
projectId,
featureId,
);
@@ -56,6 +57,26 @@ export const FeatureView = () => {
return ;
}
+ const overview =
+ feature.type === 'experiment' ? (
+
+ ) : (
+
+ ) : undefined
+ }
+ />
+ );
+
return (
@@ -67,22 +88,7 @@ export const FeatureView = () => {
element={}
/>
} />
-
- ) : undefined
- }
- />
- }
- />
+
{showImpactMetrics && (