@@ -31,6 +31,9 @@ import { useDispatch, useSelector } from '@/store';
31
31
import { Deployment , PR , RepoWorkflowExtended } from '@/types/resources' ;
32
32
import { percent } from '@/utils/datatype' ;
33
33
import { depFn } from '@/utils/fn' ;
34
+ import Link from 'next/link' ;
35
+ import { ROUTES } from '@/constants/routes' ;
36
+ import { DeploymentSources } from '@/types/resources' ;
34
37
35
38
import { DeploymentItem } from './DeploymentItem' ;
36
39
@@ -195,6 +198,10 @@ export const DeploymentInsightsOverlay = () => {
195
198
196
199
const dateRangeLabel = useCurrentDateRangeReactNode ( ) ;
197
200
201
+ // Determine if the selected repository uses PR_MERGE as its deployment source
202
+ const currentBaseRepo = selectedRepo . value ? teamDeployments . repos_map [ selectedRepo . value ] : null ;
203
+ const isPRMergeSource = currentBaseRepo ?. deployment_type === DeploymentSources . PR_MERGE ;
204
+
198
205
if ( ! team ) return < Line > Please select a team first...</ Line > ;
199
206
200
207
return (
@@ -348,11 +355,26 @@ export const DeploymentInsightsOverlay = () => {
348
355
/>
349
356
</ FlexBox >
350
357
</ Box >
351
- < FlexBox >
352
- < DoraMetricsDuration deployments = { deployments } />
353
- </ FlexBox >
354
- < FlexBox > </ FlexBox >
355
- < DoraMetricsTrend />
358
+ { ! isPRMergeSource ? (
359
+ < >
360
+ < FlexBox >
361
+ < DoraMetricsDuration deployments = { deployments } />
362
+ </ FlexBox >
363
+ < FlexBox > </ FlexBox >
364
+ < DoraMetricsTrend />
365
+ </ >
366
+ ) : (
367
+ < Box sx = { { mb : '10px' } } >
368
+ < Line small white >
369
+ Deployment trends are only available for repos with workflows as source.{ ' ' }
370
+ < Link href = { ROUTES . TEAMS . ROUTE . PATH } passHref >
371
+ < Line component = "a" small color = "primary" bold underline pointer >
372
+ Go to settings →
373
+ </ Line >
374
+ </ Link >
375
+ </ Line >
376
+ </ Box >
377
+ ) }
356
378
</ FlexBox >
357
379
) : (
358
380
< >
0 commit comments