Skip to content

Commit

Permalink
add richtext as field translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Oct 10, 2024
1 parent d878aee commit fc283e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions studio/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import socialMediaLinks from "./schemas/documents/siteSettings/socialMediaProfil
import customerCasesPage from "./schemas/documents/specialPages/customerCasesPage";
import callToActionField from "./schemas/fields/callToActionFields";
import categories from "./schemas/fields/categories";
import { richText } from "./schemas/fields/text";
import benefitsByLocation from "./schemas/objects/compensations/benefitsByLocation";
import { footerSection } from "./schemas/objects/footerSection";
import { link } from "./schemas/objects/link";
Expand Down Expand Up @@ -45,5 +46,6 @@ export const schema: { types: SchemaTypeDefinition[] } = {
brandAssets,
languageSettings,
locale,
richText,
],
};
12 changes: 10 additions & 2 deletions studio/schemas/objects/compensations/benefitsByLocation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineField } from "sanity";

import { companyLocationNameID } from "studio/schemas/documents/admin/companyLocation";
import { richText, title } from "studio/schemas/fields/text";
import { richTextID, title } from "studio/schemas/fields/text";
import { location, locationID } from "studio/schemas/objects/locations";

import {
Expand Down Expand Up @@ -60,7 +60,15 @@ export const benefitsByLocation = defineField({
name: "benefit",
type: "object",
title: "Benefit",
fields: [benefitType, title, richText],
fields: [
benefitType,
title,
{
name: richTextID,
title: "Body",
type: "internationalizedArrayRichText",
},
],
preview: {
select: {
title: title.name,
Expand Down
2 changes: 1 addition & 1 deletion studio/studioConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const config: WorkspaceOptions = {
languages: (client) => {
return client.fetch(SUPPORTED_LANGUAGES_QUERY);
},
fieldTypes: ["string"],
fieldTypes: ["string", "richText"],
}),
presentationTool({
previewUrl: {
Expand Down

0 comments on commit fc283e8

Please sign in to comment.