diff --git a/studio/schema.ts b/studio/schema.ts index 1481719a2..763de2a34 100644 --- a/studio/schema.ts +++ b/studio/schema.ts @@ -20,6 +20,7 @@ import benefitsByLocation from "./schemas/objects/compensations/benefitsByLocati import { footerSection } from "./schemas/objects/footerSection"; import { link } from "./schemas/objects/link"; import { socialMedia } from "./schemas/objects/socialMedia"; +import { richText } from "./schemas/fields/text"; export const schema: { types: SchemaTypeDefinition[] } = { types: [ @@ -43,5 +44,6 @@ export const schema: { types: SchemaTypeDefinition[] } = { defaultSeo, brandAssets, languageSettings, + richText, ], }; diff --git a/studio/schemas/objects/compensations/benefitsByLocation.ts b/studio/schemas/objects/compensations/benefitsByLocation.ts index 23d2bb52c..5cf3da137 100644 --- a/studio/schemas/objects/compensations/benefitsByLocation.ts +++ b/studio/schemas/objects/compensations/benefitsByLocation.ts @@ -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 { @@ -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, @@ -98,7 +106,7 @@ export const benefitsByLocation = defineField({ validation: (rule) => rule.custom((benefitsByLocation) => { const isNotDuplicate: boolean = checkForDuplicateLocations( - benefitsByLocation as DocumentWithLocation[] | undefined, + benefitsByLocation as DocumentWithLocation[] | undefined ); return ( isNotDuplicate || diff --git a/studio/studioConfig.tsx b/studio/studioConfig.tsx index 20f90e924..7ed92b063 100644 --- a/studio/studioConfig.tsx +++ b/studio/studioConfig.tsx @@ -45,7 +45,7 @@ const config: WorkspaceOptions = { languages: (client) => { return client.fetch(SUPPORTED_LANGUAGES_QUERY); }, - fieldTypes: ["string"], + fieldTypes: ["string", "richText"], }), presentationTool({ previewUrl: {