|
6 | 6 | import TeamInfo from '$lib/components/TeamInfo.svelte';
|
7 | 7 | import TeamUtilizationAndOverage from '$lib/components/TeamUtilizationAndOverage.svelte';
|
8 | 8 | import VulnerabilitySummary from '$lib/components/VulnerabilitySummary.svelte';
|
9 |
| - import { Alert, Heading } from '@nais/ds-svelte-community'; |
| 9 | + import { Alert, BodyShort, Heading } from '@nais/ds-svelte-community'; |
10 | 10 |
|
11 | 11 | import WorkloadLink from '$lib/components/WorkloadLink.svelte';
|
12 | 12 | import type { PageProps } from './$houdini';
|
|
21 | 21 | )
|
22 | 22 | )
|
23 | 23 | );
|
| 24 | +
|
| 25 | + const syncFailed = $derived( |
| 26 | + $TeamOverview.data?.team.workloads.nodes.filter((workload) => |
| 27 | + workload.status.errors.some( |
| 28 | + (error) => error.__typename === 'WorkloadStatusSynchronizationFailing' |
| 29 | + ) |
| 30 | + ) |
| 31 | + ); |
24 | 32 | </script>
|
25 | 33 |
|
26 | 34 | {#if page.url.searchParams.has('deleted')}
|
|
30 | 38 | {msgParts[1]}.
|
31 | 39 | </Alert>
|
32 | 40 | {/if}
|
| 41 | +<div class="alerts-wrapper"> |
| 42 | + {#if syncFailed?.length} |
| 43 | + <Alert variant="error"> |
| 44 | + <div style="display: flex; flex-direction: column; gap: var(--a-spacing-3)"> |
| 45 | + <Heading level="2" size="small">Synchronization failing</Heading> |
| 46 | + <BodyShort> |
| 47 | + The rollout of the following workload{syncFailed.length === 1 ? '' : 's'} failed because of |
| 48 | + synchronization errors. |
| 49 | + </BodyShort> |
| 50 | + <div> |
| 51 | + {#each syncFailed as workload (workload.id)} |
| 52 | + <WorkloadLink {workload} hideTeam /> |
| 53 | + {/each} |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </Alert> |
| 57 | + {/if} |
33 | 58 |
|
34 |
| -{#if deprecatedImages?.length} |
35 |
| - <Alert variant="warning"> |
36 |
| - Starting April 1st, applications and jobs on Nais must use images from Google Artifact Registry |
37 |
| - (GAR). The easiest way to ensure that images are stored in GAR is to use Nais' GitHub Actions in |
38 |
| - the workflow. <a |
39 |
| - href="https://nais.io/log/#2025-02-24-image-policy" |
40 |
| - target="_blank" |
41 |
| - rel="noopener noreferrer">Read more in Nais announcement</a |
42 |
| - >. |
43 |
| - <p> |
44 |
| - {teamSlug} currently has <strong>{deprecatedImages.length}</strong> |
45 |
| - workload{deprecatedImages.length === 1 ? '' : 's'} using |
46 |
| - {deprecatedImages.length === 1 |
47 |
| - ? 'a deprecated image registry' |
48 |
| - : 'deprecated image registries'}. |
49 |
| - </p> |
| 59 | + {#if deprecatedImages?.length} |
| 60 | + <Alert variant="warning"> |
| 61 | + Starting April 1st, applications and jobs on Nais must use images from Google Artifact |
| 62 | + Registry (GAR). The easiest way to ensure that images are stored in GAR is to use Nais' GitHub |
| 63 | + Actions in the workflow. <a |
| 64 | + href="https://nais.io/log/#2025-02-24-image-policy" |
| 65 | + target="_blank" |
| 66 | + rel="noopener noreferrer">Read more in Nais announcement</a |
| 67 | + >. |
| 68 | + <p> |
| 69 | + {teamSlug} currently has <strong>{deprecatedImages.length}</strong> |
| 70 | + workload{deprecatedImages.length === 1 ? '' : 's'} using |
| 71 | + {deprecatedImages.length === 1 |
| 72 | + ? 'a deprecated image registry' |
| 73 | + : 'deprecated image registries'}. |
| 74 | + </p> |
50 | 75 |
|
51 |
| - {#if deprecatedImages.length < 5} |
52 |
| - {#each deprecatedImages as workload (workload.id)} |
53 |
| - <WorkloadLink {workload} /> |
54 |
| - {/each} |
55 |
| - {:else} |
56 |
| - <details> |
57 |
| - <summary>Workloads with deprecated image registries</summary> |
| 76 | + {#if deprecatedImages.length < 5} |
58 | 77 | {#each deprecatedImages as workload (workload.id)}
|
59 | 78 | <WorkloadLink {workload} />
|
60 | 79 | {/each}
|
61 |
| - </details> |
62 |
| - {/if} |
63 |
| - </Alert> |
64 |
| -{/if} |
| 80 | + {:else} |
| 81 | + <details> |
| 82 | + <summary>Workloads with deprecated image registries</summary> |
| 83 | + {#each deprecatedImages as workload (workload.id)} |
| 84 | + <WorkloadLink {workload} /> |
| 85 | + {/each} |
| 86 | + </details> |
| 87 | + {/if} |
| 88 | + </Alert> |
| 89 | + {/if} |
| 90 | +</div> |
65 | 91 | <div class="grid">
|
66 | 92 | <Card rows={1} columns={3}>
|
67 | 93 | <TeamInfo {teamSlug} {viewerIsMember} />
|
|
95 | 121 | .grid:not(:first-child) {
|
96 | 122 | margin-top: 1rem;
|
97 | 123 | }
|
| 124 | +
|
| 125 | + .alerts-wrapper { |
| 126 | + display: flex; |
| 127 | + flex-direction: column; |
| 128 | + gap: var(--a-spacing-4); |
| 129 | + } |
98 | 130 | .deployments {
|
99 | 131 | grid-column: span 12;
|
100 | 132 | grid-row: span 1;
|
|
0 commit comments