1
1
import { ArrowDownwardRounded } from '@mui/icons-material' ;
2
2
import { Card , Divider , useTheme , Collapse , Box } from '@mui/material' ;
3
+ import Link from 'next/link' ;
3
4
import pluralize from 'pluralize' ;
4
5
import { ascend , descend , groupBy , path , prop , sort } from 'ramda' ;
5
6
import { FC , useCallback , useEffect , useMemo , useState } from 'react' ;
6
- import { DoraMetricsTrend } from '../DoraMetrics/DoraMetricsTrend' ;
7
- import { DoraMetricsDuration } from '../DoraMetrics/DoraMetricsDuration' ;
7
+
8
8
import { FlexBox } from '@/components/FlexBox' ;
9
9
import { MiniButton } from '@/components/MiniButton' ;
10
10
import { MiniCircularLoader } from '@/components/MiniLoader' ;
@@ -13,6 +13,7 @@ import { PullRequestsTableMini } from '@/components/PRTableMini/PullRequestsTabl
13
13
import Scrollbar from '@/components/Scrollbar' ;
14
14
import { Tabs , TabItem } from '@/components/Tabs' ;
15
15
import { Line } from '@/components/Text' ;
16
+ import { ROUTES } from '@/constants/routes' ;
16
17
import { FetchState } from '@/constants/ui-states' ;
17
18
import { useAuth } from '@/hooks/useAuth' ;
18
19
import { useBoolState , useEasyState } from '@/hooks/useEasyState' ;
@@ -29,14 +30,15 @@ import {
29
30
} from '@/slices/dora_metrics' ;
30
31
import { useDispatch , useSelector } from '@/store' ;
31
32
import { Deployment , PR , RepoWorkflowExtended } from '@/types/resources' ;
33
+ import { DeploymentSources } from '@/types/resources' ;
32
34
import { percent } from '@/utils/datatype' ;
33
35
import { depFn } from '@/utils/fn' ;
34
- import Link from 'next/link' ;
35
- import { ROUTES } from '@/constants/routes' ;
36
- import { DeploymentSources } from '@/types/resources' ;
37
36
38
37
import { DeploymentItem } from './DeploymentItem' ;
39
38
39
+ import { DoraMetricsDuration } from '../DoraMetrics/DoraMetricsDuration' ;
40
+ import { DoraMetricsTrend } from '../DoraMetrics/DoraMetricsTrend' ;
41
+
40
42
enum DepStatusFilter {
41
43
All ,
42
44
Pass ,
@@ -199,8 +201,11 @@ export const DeploymentInsightsOverlay = () => {
199
201
const dateRangeLabel = useCurrentDateRangeReactNode ( ) ;
200
202
201
203
// 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
+ const currentBaseRepo = selectedRepo . value
205
+ ? teamDeployments . repos_map [ selectedRepo . value ]
206
+ : null ;
207
+ const isPRMergeSource =
208
+ currentBaseRepo ?. deployment_type === DeploymentSources . PR_MERGE ;
204
209
205
210
if ( ! team ) return < Line > Please select a team first...</ Line > ;
206
211
@@ -226,10 +231,11 @@ export const DeploymentInsightsOverlay = () => {
226
231
px = { 1 }
227
232
py = { 1 / 2 }
228
233
corner = { theme . spacing ( 1 ) }
229
- border = { `1px solid ${ repo . id === selectedRepo . value
234
+ border = { `1px solid ${
235
+ repo . id === selectedRepo . value
230
236
? theme . colors . info . main
231
237
: theme . colors . secondary . light
232
- } `}
238
+ } `}
233
239
pointer
234
240
bgcolor = {
235
241
repo . id === selectedRepo . value
@@ -241,9 +247,7 @@ export const DeploymentInsightsOverlay = () => {
241
247
? theme . colors . info . main
242
248
: undefined
243
249
}
244
- fontWeight = {
245
- repo . id === selectedRepo . value ? 'bold' : undefined
246
- }
250
+ fontWeight = { repo . id === selectedRepo . value ? 'bold' : undefined }
247
251
onClick = { ( ) => {
248
252
selectedRepo . set ( repo . id as ID ) ;
249
253
} }
@@ -297,7 +301,7 @@ export const DeploymentInsightsOverlay = () => {
297
301
{ activeTab === TabKeys . ANALYTICS ? (
298
302
< FlexBox col gap = { 1 } p = { 1 } >
299
303
< Divider sx = { { mb : '10px' } } />
300
- < Box sx = { { mb :'10px' } } key = { selectedRepo . value } >
304
+ < Box sx = { { mb : '10px' } } key = { selectedRepo . value } >
301
305
< FlexBox col gap = { 1 / 2 } >
302
306
< Line white medium >
303
307
< Line bold white >
@@ -338,10 +342,7 @@ export const DeploymentInsightsOverlay = () => {
338
342
</ Line >
339
343
< ProgressBar
340
344
mt = { 1 }
341
- perc = { percent (
342
- successfulDeps . length ,
343
- deployments . length
344
- ) }
345
+ perc = { percent ( successfulDeps . length , deployments . length ) }
345
346
height = "12px"
346
347
maxWidth = "300px"
347
348
progressTitle = "Successful deployments"
@@ -366,9 +367,17 @@ export const DeploymentInsightsOverlay = () => {
366
367
) : (
367
368
< Box sx = { { mb : '10px' } } >
368
369
< Line small white >
369
- Deployment trends are only available for repos with workflows as source.{ ' ' }
370
+ Deployment trends are only available for repos with
371
+ workflows as source.{ ' ' }
370
372
< Link href = { ROUTES . TEAMS . ROUTE . PATH } passHref >
371
- < Line component = "a" small color = "primary" bold underline pointer >
373
+ < Line
374
+ component = "a"
375
+ small
376
+ color = "primary"
377
+ bold
378
+ underline
379
+ pointer
380
+ >
372
381
Go to settings →
373
382
</ Line >
374
383
</ Link >
@@ -379,7 +388,7 @@ export const DeploymentInsightsOverlay = () => {
379
388
) : (
380
389
< >
381
390
< FlexBox col flex1 >
382
- < Divider sx = { { mt : '10px' } } />
391
+ < Divider sx = { { mt : '10px' } } />
383
392
< FlexBox gap1 flex1 fullWidth >
384
393
< FlexBox col >
385
394
< FlexBox p = { 1 } pb = { 0 } gap = { 1 / 2 } >
0 commit comments