From 993f86678d279d1bcced182a7d62431b635f6154 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Fri, 20 Dec 2024 23:09:20 +0100 Subject: [PATCH] Explicitly define page title --- .../routes/(app)/(internal)/analytics/+page.server.ts | 4 +++- .../(app)/(internal)/my-assignments/+page.server.ts | 3 ++- .../risk-scenarios/[id=uuid]/+page.server.ts | 2 +- .../(third-party)/evidences/[id=uuid]/+page.server.ts | 10 +++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/(app)/(internal)/analytics/+page.server.ts b/frontend/src/routes/(app)/(internal)/analytics/+page.server.ts index 60214af8e..af9d2c88c 100644 --- a/frontend/src/routes/(app)/(internal)/analytics/+page.server.ts +++ b/frontend/src/routes/(app)/(internal)/analytics/+page.server.ts @@ -5,6 +5,7 @@ import { zod } from 'sveltekit-superforms/adapters'; import type { PageServerLoad } from './$types'; import type { Project } from '$lib/utils/types'; import { TODAY } from '$lib/utils/constants'; +import * as m from '$paraglide/messages'; const REQUIREMENT_ASSESSMENT_STATUS = [ 'compliant', @@ -235,6 +236,7 @@ export const load: PageServerLoad = async ({ locals, fetch }) => { applied_control_status: applied_control_status.results, projects, user: locals.user, - metrics: metrics.results + metrics: metrics.results, + title: m.analytics() }; }; diff --git a/frontend/src/routes/(app)/(internal)/my-assignments/+page.server.ts b/frontend/src/routes/(app)/(internal)/my-assignments/+page.server.ts index 9256d6ad3..fe10c3216 100644 --- a/frontend/src/routes/(app)/(internal)/my-assignments/+page.server.ts +++ b/frontend/src/routes/(app)/(internal)/my-assignments/+page.server.ts @@ -1,6 +1,7 @@ import { BASE_API_URL } from '$lib/utils/constants'; import type { PageServerLoad } from './$types'; +import * as m from '$paraglide/messages'; export const load = (async ({ fetch }) => { const endpoint = `${BASE_API_URL}/folders/my_assignments/`; @@ -8,5 +9,5 @@ export const load = (async ({ fetch }) => { const res = await fetch(endpoint); const data = await res.json(); - return { data }; + return { data, title: m.myAssignments() }; }) satisfies PageServerLoad; diff --git a/frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/+page.server.ts b/frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/+page.server.ts index 70c1fdf6e..3e23b5661 100644 --- a/frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/+page.server.ts +++ b/frontend/src/routes/(app)/(internal)/risk-scenarios/[id=uuid]/+page.server.ts @@ -65,5 +65,5 @@ export const load = (async ({ fetch, params }) => { .then((res) => res.json()) .then((res) => JSON.parse(res.json_definition)); - return { scenario, tables, riskMatrix }; + return { scenario, tables, riskMatrix, title: scenario.name }; }) satisfies PageServerLoad; diff --git a/frontend/src/routes/(app)/(third-party)/evidences/[id=uuid]/+page.server.ts b/frontend/src/routes/(app)/(third-party)/evidences/[id=uuid]/+page.server.ts index ae955ac81..1c5b6c898 100644 --- a/frontend/src/routes/(app)/(third-party)/evidences/[id=uuid]/+page.server.ts +++ b/frontend/src/routes/(app)/(third-party)/evidences/[id=uuid]/+page.server.ts @@ -52,7 +52,15 @@ export const load: PageServerLoad = async ({ fetch, params }) => { zod(attachmentDeleteSchema) ); - return { URLModel, evidence, object, tables, deleteForm, attachmentDeleteForm }; + return { + URLModel, + evidence, + object, + tables, + deleteForm, + attachmentDeleteForm, + title: evidence.name + }; }; export const actions: Actions = {