Skip to content

Commit 1520277

Browse files
Upgrades (#140)
* wip: upgrades * Page cannot be used in root layout with houdini * fix: cronParser after update - call new function parse and handle invalid cron expressions in getNextRunTime function * fix: lint errors after upgrades --------- Co-authored-by: Thomas Krampl <[email protected]>
1 parent 012c4a9 commit 1520277

File tree

34 files changed

+965
-1407
lines changed

34 files changed

+965
-1407
lines changed

houdini.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const config = {
1111
}
1212
},
1313
plugins: {
14-
'houdini-svelte': {}
14+
'houdini-svelte': {
15+
forceRunesMode: true
16+
}
1517
},
1618
scalars: {
1719
Slug: { type: 'string' },

package-lock.json

+847-1,305
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,50 @@
1818
"build-storybook": "storybook build"
1919
},
2020
"devDependencies": {
21-
"@chromatic-com/storybook": "^3.2.4",
22-
"@eslint/compat": "^1.2.6",
21+
"@chromatic-com/storybook": "^3.2.5",
22+
"@eslint/compat": "^1.2.7",
2323
"@nais/ds-svelte-community": "^1.0.0-next.22",
24-
"@navikt/ds-css": "^7.12.0",
25-
"@storybook/addon-essentials": "^8.5.5",
26-
"@storybook/addon-interactions": "^8.5.5",
27-
"@storybook/addon-svelte-csf": "^5.0.0-next.23",
28-
"@storybook/blocks": "^8.5.5",
29-
"@storybook/svelte": "^8.5.5",
30-
"@storybook/sveltekit": "^8.5.5",
31-
"@storybook/test": "^8.5.5",
24+
"@navikt/ds-css": "^7.17.0",
25+
"@storybook/addon-essentials": "^8.6.4",
26+
"@storybook/addon-interactions": "^8.6.4",
27+
"@storybook/addon-svelte-csf": "^5.0.0-next.27",
28+
"@storybook/blocks": "^8.6.4",
29+
"@storybook/svelte": "^8.6.4",
30+
"@storybook/sveltekit": "^8.6.4",
31+
"@storybook/test": "^8.6.4",
3232
"@sveltejs/adapter-node": "^5.2.12",
33-
"@sveltejs/kit": "^2.17.1",
34-
"@sveltejs/vite-plugin-svelte": "^4.0.4",
33+
"@sveltejs/kit": "^2.18.0",
34+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
3535
"@types/amplitude-js": "^8.16.5",
3636
"@types/luxon": "^3.4.2",
37-
"@typescript-eslint/eslint-plugin": "^8.24.0",
38-
"@typescript-eslint/parser": "^8.24.0",
37+
"@typescript-eslint/eslint-plugin": "^8.26.0",
38+
"@typescript-eslint/parser": "^8.26.0",
3939
"date-fns": "^4.1.0",
40-
"eslint": "^9.20.1",
41-
"eslint-config-prettier": "^10.0.1",
42-
"eslint-plugin-storybook": "^0.11.2",
43-
"eslint-plugin-svelte": "^2.46.1",
44-
"houdini": "^1.5.0",
45-
"houdini-svelte": "^2.1.4",
46-
"prettier": "^3.5.0",
40+
"eslint": "^9.21.0",
41+
"eslint-config-prettier": "^10.0.2",
42+
"eslint-plugin-storybook": "^0.11.4",
43+
"eslint-plugin-svelte": "^3.0.3",
44+
"houdini": "^1.5.3",
45+
"houdini-svelte": "^2.1.7",
46+
"prettier": "^3.5.3",
4747
"prettier-plugin-svelte": "^3.3.3",
48-
"storybook": "^8.5.5",
49-
"svelte": "^5.19.8",
48+
"storybook": "^8.6.4",
49+
"svelte": "^5.22.5",
5050
"svelte-check": "^4.1.4",
5151
"tslib": "^2.8.1",
5252
"typescript": "^5.7.3",
53-
"typescript-eslint": "^8.24.0",
54-
"vite": "5.4.14",
55-
"vitest": "^3.0.5"
53+
"typescript-eslint": "^8.26.0",
54+
"vite": "6.2.0",
55+
"vitest": "^3.0.7"
5656
},
5757
"type": "module",
5858
"dependencies": {
5959
"@slack/types": "^2.14.0",
6060
"@slack/web-api": "^7.8.0",
6161
"amplitude-js": "^8.21.9",
6262
"bytes-iec": "^3.1.1",
63-
"cron-parser": "^4.9.0",
64-
"cronstrue": "^2.54.0",
63+
"cron-parser": "^5.0.4",
64+
"cronstrue": "^2.56.0",
6565
"echarts": "^5.6.0",
6666
"eslint-plugin-unicorn": "^57.0.0",
6767
"graphql": "^16.10.0",

src/lib/components/Deployments.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<Td><Time time={deploy.createdAt} distance={true} /></Td>
128128
<Td
129129
>{#if deploy.statuses.nodes.length === 0}<DeploymentStatus
130-
status={'UNKNOWN'}
130+
status="UNKNOWN"
131131
/>{:else}<DeploymentStatus status={deploy.statuses.nodes[0].state} />{/if}</Td
132132
>
133133
</Tr>

src/lib/components/OrderByMenu.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<script lang="ts" generics="T extends OrderField">
2626
import { page } from '$app/state';
2727
import { OrderDirection, type OrderDirection$options } from '$houdini';
28-
import { changeParams } from '$lib/utils/searchparams.svelte';
28+
import { changeParams } from '$lib/utils/searchparams';
2929
import { Button } from '@nais/ds-svelte-community';
3030
import {
3131
ActionMenu,

src/lib/components/TeamDeployments.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<Td><Time time={deploy.createdAt} distance={true} /></Td>
116116
<Td
117117
>{#if deploy.statuses.nodes.length === 0}<DeploymentStatus
118-
status={'UNKNOWN'}
118+
status="UNKNOWN"
119119
/>{:else}<DeploymentStatus status={deploy.statuses.nodes[0].state} />{/if}</Td
120120
>
121121
</Tr>

src/lib/components/WorkloadsWithSBOM.svelte

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
type WorkloadOrderField$options
99
} from '$houdini';
1010
import Pagination from '$lib/Pagination.svelte';
11-
import { changeParams } from '$lib/utils/searchparams.svelte';
11+
import { changeParams } from '$lib/utils/searchparams';
1212
import {
1313
BodyShort,
1414
Skeleton,
@@ -242,7 +242,7 @@
242242
<Td>
243243
<div class="vulnerability">
244244
<div class="vulnerability-summary">
245-
<Tooltip content={'critical'}>
245+
<Tooltip content="critical">
246246
{#if workload.image.vulnerabilitySummary}
247247
{#if workload.image.vulnerabilitySummary.critical > 0}
248248
<a href={imageUrl(workload)} class="vulnerability-count CRITICAL">
@@ -263,7 +263,7 @@
263263
<Td>
264264
<div class="vulnerability">
265265
<div class="vulnerability-summary">
266-
<Tooltip content={'high'}>
266+
<Tooltip content="high">
267267
{#if workload.image.vulnerabilitySummary}
268268
{#if workload.image.vulnerabilitySummary.high > 0}
269269
<a href={imageUrl(workload)} class="vulnerability-count HIGH">
@@ -284,7 +284,7 @@
284284
<Td>
285285
<div class="vulnerability">
286286
<div class="vulnerability-summary">
287-
<Tooltip content={'medium'}>
287+
<Tooltip content="medium">
288288
{#if workload.image.vulnerabilitySummary}
289289
{#if workload.image.vulnerabilitySummary.medium > 0}
290290
<a href={imageUrl(workload)} class="vulnerability-count MEDIUM">
@@ -305,7 +305,7 @@
305305
<Td>
306306
<div class="vulnerability">
307307
<div class="vulnerability-summary">
308-
<Tooltip content={'low'}>
308+
<Tooltip content="low">
309309
{#if workload.image.vulnerabilitySummary}
310310
{#if workload.image.vulnerabilitySummary.low > 0}
311311
<a href={imageUrl(workload)} class="vulnerability-count LOW">
@@ -326,7 +326,7 @@
326326
<Td>
327327
<div class="vulnerability">
328328
<div class="vulnerability-summary">
329-
<Tooltip content={'unassigned'}>
329+
<Tooltip content="unassigned">
330330
{#if workload.image.vulnerabilitySummary}
331331
{#if workload.image.vulnerabilitySummary.unassigned > 0}
332332
<a href={imageUrl(workload)} class="vulnerability-count UNASSIGNED">
@@ -345,7 +345,7 @@
345345
<Td>
346346
<div class="vulnerability">
347347
<div class="vulnerability-summary">
348-
<Tooltip content={'risk score'}>
348+
<Tooltip content="risk score">
349349
<BodyShort class="vulnerability-count">
350350
<a href={imageUrl(workload)} class="vulnerability-count RISK_SCORE">
351351
{workload.image.vulnerabilitySummary

src/lib/components/image/ImageVulnerabilities.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { graphql, ImageVulnerabilityOrderField, PendingValue } from '$houdini';
33
import Pagination from '$lib/Pagination.svelte';
4-
import { changeParams } from '$lib/utils/searchparams.svelte';
4+
import { changeParams } from '$lib/utils/searchparams';
55
import { severityToColor } from '$lib/utils/vulnerabilities';
66
import { Button, Heading, Table, Tbody, Td, Th, Thead, Tr } from '@nais/ds-svelte-community';
77
import { CheckmarkIcon } from '@nais/ds-svelte-community/icons';
@@ -198,7 +198,7 @@
198198
>
199199
<Td style="text-align: center">
200200
{#if v.analysisTrail.suppressed}
201-
<CheckmarkIcon width={'18px'} height={'18px'} />
201+
<CheckmarkIcon width="18px" height="18px" />
202202
{/if}
203203
</Td>
204204
<Td>

src/lib/components/persistence/PersistencePage.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import WorkloadLink from '$lib/components/WorkloadLink.svelte';
1010
import { envTagVariant } from '$lib/envTagVariant';
1111
import Pagination from '$lib/Pagination.svelte';
12-
import { changeParams } from '$lib/utils/searchparams.svelte';
12+
import { changeParams } from '$lib/utils/searchparams';
1313
import { Tag } from '@nais/ds-svelte-community';
1414
import { endOfYesterday, startOfMonth, subMonths } from 'date-fns';
1515
import type { Snippet } from 'svelte';
File renamed without changes.

src/routes/+layout.server.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const load: LayoutServerLoad = async (event) => {
66
const userInfo = await ui.fetch({ event });
77

88
return {
9-
connected: event.url.searchParams.get('naisdevice') === 'connected',
109
UserInfo: userInfo,
1110
tenantName: event.locals.tenantName,
1211
githubOrganization: event.locals.githubOrganization

src/routes/+layout.svelte

+6-26
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@
77
import { isAuthenticated, isUnauthenticated } from '$lib/authentication';
88
import '$lib/font.css';
99
import ProgressBar from '$lib/ProgressBar.svelte';
10-
import { Alert } from '@nais/ds-svelte-community';
1110
import { onMount } from 'svelte';
12-
import { fade } from 'svelte/transition';
1311
import '../styles/app.css';
1412
import '../styles/colors.css';
15-
import type { LayoutData } from './$houdini';
13+
import type { LayoutProps } from './$houdini';
1614
import Login from './Login.svelte';
15+
import Naisdevice from './Naisdevice.svelte';
1716
18-
interface Props {
19-
data: LayoutData;
20-
children?: import('svelte').Snippet;
21-
}
22-
23-
let { data, children }: Props = $props();
24-
let { UserInfo, connected } = $derived(data);
17+
let { data, children }: LayoutProps = $props();
18+
let { UserInfo } = $derived(data);
2519
2620
let user = $derived(
2721
UserInfo.data?.me as
@@ -82,8 +76,6 @@
8276
afterNavigate(() => {
8377
loading = false;
8478
});
85-
86-
let open = $state(true);
8779
</script>
8880

8981
<div class={['full-wrapper', activeColor()]}>
@@ -101,23 +93,11 @@
10193

10294
{@render children?.()}
10395
{/if}
104-
{#if connected && open}
105-
<div class="naisdevice" out:fade>
106-
<Alert variant="success" closeButton onclose={() => (open = false)}>
107-
Naisdevice successfully connected.
108-
</Alert>
109-
</div>
110-
{/if}
96+
97+
<Naisdevice />
11198
</div>
11299

113100
<style>
114-
.naisdevice {
115-
position: fixed;
116-
bottom: 0;
117-
right: 0;
118-
padding: var(--a-spacing-2);
119-
}
120-
121101
:global(.page) {
122102
margin: 0 auto 0 auto;
123103
min-width: 1000px;

src/routes/Deploys.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
</Td>
119119
<Td>
120120
{#if deploy.statuses.nodes.length === 0}
121-
<DeploymentStatus status={'UNKNOWN'} />
121+
<DeploymentStatus status="UNKNOWN" />
122122
{:else}
123123
<DeploymentStatus status={deploy.statuses.nodes[0].state} />
124124
{/if}

src/routes/Naisdevice.svelte

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<svelte:options runes />
2+
3+
<script lang="ts">
4+
import { goto } from '$app/navigation';
5+
import { page } from '$app/state';
6+
import { Alert } from '@nais/ds-svelte-community';
7+
8+
import { fade } from 'svelte/transition';
9+
</script>
10+
11+
{#if page.url.searchParams.get('naisdevice') == 'connected'}
12+
<div class="naisdevice" out:fade>
13+
<Alert
14+
variant="success"
15+
closeButton
16+
onclose={() => {
17+
const url = page.url;
18+
url.searchParams.delete('naisdevice');
19+
20+
goto(page.url.toString(), { replaceState: true });
21+
}}
22+
>
23+
Naisdevice successfully connected.
24+
</Alert>
25+
</div>
26+
{/if}
27+
28+
<style>
29+
.naisdevice {
30+
position: fixed;
31+
bottom: 0;
32+
right: 0;
33+
padding: var(--a-spacing-2);
34+
}
35+
</style>

src/routes/team/[team]/[env]/app/[app]/utilization/+page.svelte

+4-8
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@
1212
import { WalletIcon } from '@nais/ds-svelte-community/icons';
1313
import type { EChartsOption } from 'echarts';
1414
import prettyBytes from 'pretty-bytes';
15-
import type { PageData } from './$houdini';
1615
17-
interface Props {
18-
data: PageData;
19-
}
16+
import type { PageProps } from './$houdini';
2017
21-
let { data }: Props = $props();
18+
let { data }: PageProps = $props();
2219
let { ResourceUtilizationForApp } = $derived(data);
23-
export const start = new Date();
2420
2521
type resourceUsage = {
2622
readonly timestamp: Date;
@@ -165,7 +161,7 @@
165161
</Card>
166162
<Card columns={12} borderColor="var(--a-gray-200)">
167163
<span class="graphHeader">
168-
<h3 style={'margin-bottom: 0'}>Memory usage</h3>
164+
<h3 style="margin-bottom: 0">Memory usage</h3>
169165
<span class="intervalPicker">
170166
{#each ['1h', '6h', '1d', '7d', '30d'] as interval (interval)}
171167
<a
@@ -187,7 +183,7 @@
187183
/>
188184

189185
<span class="graphHeader">
190-
<h3 style={'margin-bottom: 0'}>CPU usage</h3>
186+
<h3 style="margin-bottom: 0">CPU usage</h3>
191187
</span>
192188
<EChart
193189
options={options(utilization.cpu_series, utilization.requested_cpu, 'rgb(131, 191, 246)')}

src/routes/team/[team]/[env]/bigquery/[bigquery]/+page.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<dd>
5252
{#if bq.cascadingDelete}
5353
<IconLabel
54-
label={'Deleting the application will also remove the dataset and all its tables.'}
54+
label="Deleting the application will also remove the dataset and all its tables."
5555
>
5656
{#snippet icon()}
5757
<TooltipAlignHack content="Cascading delete">
@@ -60,7 +60,7 @@
6060
{/snippet}
6161
</IconLabel>
6262
{:else}
63-
<IconLabel label={'Deleting the application will NOT remove the dataset.'}>
63+
<IconLabel label="Deleting the application will NOT remove the dataset.">
6464
{#snippet icon()}
6565
<TooltipAlignHack content="Cascading delete">
6666
<XMarkIcon style="color: var(--a-icon-danger);" />

src/routes/team/[team]/[env]/bucket/[bucket]/+page.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dd>
3939
{#if bucket.cascadingDelete}
4040
<IconLabel
41-
label={'Deleting the application will also remove the bucket and all its contents.'}
41+
label="Deleting the application will also remove the bucket and all its contents."
4242
>
4343
{#snippet icon()}
4444
<TooltipAlignHack content="Cascading delete">
@@ -50,7 +50,7 @@
5050
{/snippet}
5151
</IconLabel>
5252
{:else}
53-
<IconLabel label={'Deleting the application will NOT remove the bucket.'}>
53+
<IconLabel label="Deleting the application will NOT remove the bucket.">
5454
{#snippet icon()}
5555
<TooltipAlignHack content="Cascading delete: false">
5656
<XMarkIcon style="color: var(--a-icon-danger);" />

0 commit comments

Comments
 (0)