File tree 6 files changed +47
-13
lines changed
6 files changed +47
-13
lines changed Original file line number Diff line number Diff line change 292
292
293
293
<Story name =" Teams" >
294
294
<List >
295
- {#each teams as team (team .slug )}
296
- <TeamListItem {team } />
295
+ {#each teams as team , i (team .slug )}
296
+ <TeamListItem {team } errors ={ i } />
297
297
{/each }
298
298
</List >
299
299
</Story >
Original file line number Diff line number Diff line change 11
11
<style >
12
12
.list-item {
13
13
background-color : #f7f8f9 ;
14
- display : flex ;
15
- justify-content : space-between ;
14
+ display : grid ;
15
+ grid-template-columns : 1 fr auto ;
16
16
align-items : center ;
17
+ column-gap : var (--a-spacing-4 );
17
18
padding : var (--a-spacing-4 ) var (--a-spacing-6 );
18
19
19
20
&:hover {
Original file line number Diff line number Diff line change 3
3
import IconLabel from ' ../IconLabel.svelte' ;
4
4
import ListItem from ' ./ListItem.svelte' ;
5
5
6
- const { team }: { team: { slug: string ; purpose: string } } = $props ();
6
+ const { team, errors }: { team: { slug: string ; purpose: string }; errors : number } = $props ();
7
7
</script >
8
8
9
9
<ListItem >
15
15
level =" 3"
16
16
href ="/team/ {team .slug }"
17
17
/>
18
+ {#if errors }
19
+ <div class ={[' errors' , { ' errors--long' : ` ${errors } ` .length > 2 }]}>
20
+ {errors }
21
+ </div >
22
+ {/if }
18
23
</ListItem >
24
+
25
+ <style >
26
+ .errors {
27
+ height : 2rem ;
28
+ width : 2rem ;
29
+ border-radius : 100% ;
30
+ display : flex ;
31
+ align-items : center ;
32
+ justify-content : center ;
33
+ font-weight : var (--a-font-weight-bold );
34
+ background-color : var (--a-surface-danger );
35
+ color : var (--a-text-on-danger );
36
+
37
+ &.errors--long {
38
+ font-size : var (--a-font-size-medium );
39
+ }
40
+ }
41
+ </style >
Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ query UserTeams @cache(policy: CacheAndNetwork) {
17
17
id
18
18
slug
19
19
purpose
20
+ workloads (first : 1000 ) {
21
+ nodes {
22
+ status {
23
+ errors {
24
+ __typename
25
+ }
26
+ }
27
+ }
28
+ }
20
29
}
21
30
}
22
31
}
Original file line number Diff line number Diff line change 4
4
import Pagination from ' $lib/Pagination.svelte' ;
5
5
import { BodyLong , Button } from ' @nais/ds-svelte-community' ;
6
6
import Logo from ' ../Logo.svelte' ;
7
- import type { PageData } from ' ./$houdini' ;
7
+ import type { PageProps } from ' ./$houdini' ;
8
8
import Onboarding from ' ./Onboarding.svelte' ;
9
9
10
- interface Props {
11
- data: PageData ;
12
- }
13
-
14
- let { data }: Props = $props ();
10
+ let { data }: PageProps = $props ();
15
11
16
12
let UserTeams = $derived (data .UserTeams );
17
13
let tenantName = $derived (data .tenantName );
47
43
{#if $UserTeams .data .me .__typename == ' User' }
48
44
<List >
49
45
{#each $UserTeams .data .me .teams .nodes as node (node .team .id )}
50
- <TeamListItem team ={node .team } />
46
+ <TeamListItem
47
+ team ={node .team }
48
+ errors ={node .team .workloads .nodes .filter ((w ) =>
49
+ w .status .errors .some ((e ) => e .__typename === ' WorkloadStatusDeprecatedRegistry' )
50
+ ).length }
51
+ />
51
52
{:else }
52
53
<BodyLong >
53
54
You don't seem to belong to any teams at the moment. You can create a new team or
Original file line number Diff line number Diff line change 41
41
rel =" noopener noreferrer" >Read more in Nais announcement</a
42
42
>.
43
43
<p >
44
- {teamSlug } currently has {deprecatedImages .length }
44
+ {teamSlug } currently has < strong > {deprecatedImages .length }</ strong >
45
45
workload{deprecatedImages .length === 1 ? ' ' : ' s' } using
46
46
{deprecatedImages .length === 1
47
47
? ' a deprecated image registry'
You can’t perform that action at this time.
0 commit comments