File tree 6 files changed +339
-264
lines changed
6 files changed +339
-264
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import { graphql , PendingValue } from ' $houdini' ;
2
+ import { graphql } from ' $houdini' ;
3
+ import { Heading } from ' @nais/ds-svelte-community' ;
3
4
import type { VulnerabilitySummaryVariables } from ' ./$houdini' ;
4
- import RiskStack from ' ./RiskStack .svelte' ;
5
+ import VulnerabilityBadges from ' ./VulnerabilityBadges .svelte' ;
5
6
6
7
interface Props {
7
8
teamSlug: string ;
34
35
</script >
35
36
36
37
{#if team }
37
- <div class =" wrapper" >
38
- {#if team .vulnerabilitySummary && team .vulnerabilitySummary !== PendingValue }
39
- <RiskStack summary ={team .vulnerabilitySummary } />
38
+ <div class =" summary" >
39
+ <Heading level =" 4" size =" small" spacing >Vulnerabilities</Heading >
40
+ {#if team .vulnerabilitySummary }
41
+ <VulnerabilityBadges summary ={team .vulnerabilitySummary } />
40
42
{/if }
41
43
<a href ="/team/ {teamSlug }/vulnerabilities" >View team vulnerabilites</a >
42
44
</div >
43
45
{/if }
44
46
45
47
<style >
46
- .wrapper {
48
+ .summary {
47
49
display : flex ;
48
50
flex-direction : column ;
49
51
gap : var (--a-spacing-1 );
50
- align-items : start ;
51
52
}
52
53
</style >
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import { graphql , PendingValue } from ' $houdini' ;
3
+ import type { VulnerabilitySummaryNewVariables } from ' ./$houdini' ;
4
+ import RiskStack from ' ./RiskStack.svelte' ;
5
+
6
+ interface Props {
7
+ teamSlug: string ;
8
+ }
9
+
10
+ let { teamSlug }: Props = $props ();
11
+
12
+ export const _VulnerabilitySummaryNewVariables: VulnerabilitySummaryNewVariables = () => {
13
+ return { team: teamSlug };
14
+ };
15
+
16
+ const vulnerabilities = graphql (`
17
+ query VulnerabilitySummaryNew($team: Slug!) @cache(policy: NetworkOnly) @load {
18
+ team(slug: $team) @loading {
19
+ vulnerabilitySummary @loading {
20
+ critical
21
+ high
22
+ low
23
+ medium
24
+ riskScore
25
+ unassigned
26
+ bomCount
27
+ coverage
28
+ }
29
+ }
30
+ }
31
+ ` );
32
+
33
+ let team = $derived ($vulnerabilities .data ?.team );
34
+ </script >
35
+
36
+ {#if team }
37
+ <div class =" wrapper" >
38
+ {#if team .vulnerabilitySummary && team .vulnerabilitySummary !== PendingValue }
39
+ <RiskStack summary ={team .vulnerabilitySummary } />
40
+ {/if }
41
+ <a href ="/team/ {teamSlug }/vulnerabilities" >View team vulnerabilites</a >
42
+ </div >
43
+ {/if }
44
+
45
+ <style >
46
+ .wrapper {
47
+ display : flex ;
48
+ flex-direction : column ;
49
+ gap : var (--a-spacing-1 );
50
+ align-items : start ;
51
+ }
52
+ </style >
Original file line number Diff line number Diff line change 1
1
query TeamOverview ($team : Slug ! ) @cache (policy : NetworkOnly ) {
2
2
team (slug : $team ) {
3
- workloads (first : 9999 , orderBy : { field : STATUS , direction : DESC }) {
4
- pageInfo {
5
- endCursor
6
- hasNextPage
7
- hasPreviousPage
8
- pageEnd
9
- pageStart
10
- startCursor
11
- totalCount
12
- }
13
-
14
- edges {
15
- node {
16
- id
17
- __typename
18
- name
19
- status {
20
- state
21
- }
22
- team {
23
- slug
24
- }
25
- environment {
26
- name
27
- }
28
- deployments {
29
- nodes {
30
- createdAt
31
- }
32
- }
33
- status {
34
- state
35
-
36
- errors {
37
- __typename
38
- ... on WorkloadStatusVulnerable {
39
- summary {
40
- riskScore
41
- }
42
- }
43
- ... AppErrorFragment
44
- }
45
- }
46
-
47
- ... on Application {
48
- instances {
49
- pageInfo {
50
- totalCount
51
- }
52
- edges {
53
- node {
54
- status {
55
- state
56
- message
57
- }
58
- }
59
- }
60
- }
61
- }
62
- ... on Job {
63
- runs {
64
- pageInfo {
65
- totalCount
66
- }
67
- edges {
68
- node {
69
- startTime
70
- status {
71
- state
72
- message
73
- }
74
- }
75
- }
76
- }
77
- }
78
- }
79
- }
80
- }
81
- #...TeamDeployments
3
+ ... TeamDeployments
82
4
}
83
5
}
You can’t perform that action at this time.
0 commit comments