Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaroise committed Sep 11, 2024
1 parent dd286a3 commit a8117f3
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions studioShared/studioConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { dataset, projectId } from "./env";
import { schema } from "./schema";
import { structureTool } from "sanity/structure";
import { WorkspaceOptions } from "sanity";
import StudioIcon from "../studio/components/studioIcon/StudioIcon";
import { defineField } from "sanity";
import { documentInternationalization } from "@sanity/document-internationalization";
import { visionTool } from "@sanity/vision";
import { structureTool } from "sanity/structure";
import { apiVersion, dataset, projectId } from "./env";
import { schema } from "./schema";
import { i18n } from "languages";
import { customerCaseID } from "./schemas/documents/customerCase";
import { deskStructure } from "./deskStructure";

const config: WorkspaceOptions = {
name: "sharedStudio",
Expand All @@ -12,8 +18,32 @@ const config: WorkspaceOptions = {
basePath: "/shared",
projectId,
dataset,
schema,
plugins: [structureTool()],
schema: {
...schema,
templates: (prev) =>
prev.filter((template) => template.value.language === i18n.base),
},
plugins: [
structureTool({
structure: deskStructure,
}),
visionTool({ defaultApiVersion: apiVersion }),
documentInternationalization({
// TODO: a function that takes the client and returns a promise of an array of supported languages
// MUST return an "id" and "title" as strings
// supportedLanguages: (client) => client.fetch(`*[_type == "language"]{id, title}`),
supportedLanguages: i18n.languages,
schemaTypes: [customerCaseID],
languageField: `language`,
metadataFields: [defineField({ name: "slug", type: "slug" })],
apiVersion,
// TODO:
// Optional
// Adds UI for publishing all translations at once. Requires access to the Scheduling API
// https://www.sanity.io/docs/scheduling-api
// bulkPublish: true,
}),
],
};

export default config;

0 comments on commit a8117f3

Please sign in to comment.