Skip to content

Commit

Permalink
feat(studio): use undefined title in preview if missing translation
Browse files Browse the repository at this point in the history
instead of "Missing title", which is a valid page title and not obviously an error
  • Loading branch information
mathiazom committed Oct 9, 2024
1 parent 87fad53 commit 63e475b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion studio/schemas/documents/compensations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const compensations = defineType({
? firstTranslation(title)
: null;
return {
title: translatedTitle ?? "Missing title",
title: translatedTitle ?? undefined,
};
},
},
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/fields/callToActionFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const callToActionField = defineField({
? firstTranslation(title)
: null;
return {
title: translatedTitle ?? "Missing title",
title: translatedTitle ?? undefined,
subtitle: "Call to Action",
};
},
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/objects/compensations/benefitsByLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
},
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/objects/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) : "",
};
},
Expand Down

0 comments on commit 63e475b

Please sign in to comment.