From 151eb7c03af4ef6ebd626ee6ee0a9417b97f1a33 Mon Sep 17 00:00:00 2001 From: afsuyadi Date: Mon, 22 Jun 2026 13:26:40 +0700 Subject: [PATCH] feat(code-references): show integration setup prompt when no github/gitlab is integrated --- .../FeatureCodeReferencesContainer.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/web/components/feature-page/FeatureNavTab/CodeReferences/FeatureCodeReferencesContainer.tsx b/frontend/web/components/feature-page/FeatureNavTab/CodeReferences/FeatureCodeReferencesContainer.tsx index ae7c1ba565a4..8141159ebb97 100644 --- a/frontend/web/components/feature-page/FeatureNavTab/CodeReferences/FeatureCodeReferencesContainer.tsx +++ b/frontend/web/components/feature-page/FeatureNavTab/CodeReferences/FeatureCodeReferencesContainer.tsx @@ -3,6 +3,8 @@ import flagsmith from '@flagsmith/flagsmith' import { useGetFeatureCodeReferencesQuery } from 'common/services/useCodeReferences' import RepoCodeReferencesSection from './components/RepoCodeReferencesSection' import { FeatureCodeReferences } from 'common/types/responses' +import { useHasGithubIntegration } from 'common/hooks/useHasGithubIntegration' +import { useHasGitLabIntegration } from 'common/hooks/useHasGitLabIntegration' interface FeatureCodeReferencesContainerProps { featureId: number @@ -18,6 +20,9 @@ const FeatureCodeReferencesContainer: React.FC< featureId: featureId, projectId: projectId, }) + const { hasIntegration: hasGithubIntegration, organisationId } = + useHasGithubIntegration() + const { hasIntegration: hasGitlabIntegration } = useHasGitLabIntegration() const codeReferencesByRepo = useMemo( () => @@ -63,6 +68,16 @@ const FeatureCodeReferencesContainer: React.FC< } if (!data || data.length === 0) { + if (!hasGithubIntegration && !hasGitlabIntegration) { + return ( +
+ Set up{' '} + GitHub or{' '} + GitLab integration + to enable code references. +
+ ) + } return (
No code references found for this feature.