From 63e475b691859e47cc095d787fcc633aabce20b4 Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Wed, 9 Oct 2024 09:48:05 +0200 Subject: [PATCH] feat(studio): use undefined title in preview if missing translation instead of "Missing title", which is a valid page title and not obviously an error --- studio/schemas/documents/compensations.ts | 2 +- studio/schemas/fields/callToActionFields.ts | 2 +- studio/schemas/objects/compensations/benefitsByLocation.ts | 2 +- studio/schemas/objects/link.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/studio/schemas/documents/compensations.ts b/studio/schemas/documents/compensations.ts index 9f3d75ee3..82e9bc20e 100644 --- a/studio/schemas/documents/compensations.ts +++ b/studio/schemas/documents/compensations.ts @@ -53,7 +53,7 @@ const compensations = defineType({ ? firstTranslation(title) : null; return { - title: translatedTitle ?? "Missing title", + title: translatedTitle ?? undefined, }; }, }, diff --git a/studio/schemas/fields/callToActionFields.ts b/studio/schemas/fields/callToActionFields.ts index 045d15858..1eaacc6bd 100644 --- a/studio/schemas/fields/callToActionFields.ts +++ b/studio/schemas/fields/callToActionFields.ts @@ -22,7 +22,7 @@ const callToActionField = defineField({ ? firstTranslation(title) : null; return { - title: translatedTitle ?? "Missing title", + title: translatedTitle ?? undefined, subtitle: "Call to Action", }; }, diff --git a/studio/schemas/objects/compensations/benefitsByLocation.ts b/studio/schemas/objects/compensations/benefitsByLocation.ts index c8dcd3b64..33238637f 100644 --- a/studio/schemas/objects/compensations/benefitsByLocation.ts +++ b/studio/schemas/objects/compensations/benefitsByLocation.ts @@ -87,7 +87,7 @@ export const benefitsByLocation = defineField({ BENEFIT_TYPES.find((o) => o.value === type)?.title ?? "Unknown benefit type"; return { - title: translatedTitle ?? "Missing title", + title: translatedTitle ?? undefined, subtitle, }; }, diff --git a/studio/schemas/objects/link.ts b/studio/schemas/objects/link.ts index 199324d0e..0d6107d70 100644 --- a/studio/schemas/objects/link.ts +++ b/studio/schemas/objects/link.ts @@ -197,7 +197,7 @@ export const link = defineField({ ? firstTranslation(title) : null; return { - title: translatedTitle ?? "Missing title", + title: translatedTitle ?? undefined, subtitle: type ? type.charAt(0).toUpperCase() + type.slice(1) : "", }; },