Skip to content

Commit

Permalink
Added fields for top section in customer cases
Browse files Browse the repository at this point in the history
  • Loading branch information
anemne authored and mathiazom committed Oct 16, 2024
1 parent 6467d13 commit 706cf3a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
9 changes: 7 additions & 2 deletions studioShared/schemas/documents/customerCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { isInternationalizedString } from "studio/lib/interfaces/global";
import { richTextID, titleID } from "studio/schemas/fields/text";
import { titleSlug } from "studio/schemas/schemaTypes/slug";
import { firstTranslation } from "studio/utils/i18n";
import { customerCaseProjectInfo } from "studioShared/schemas/fields/customerCaseProjectInfo";

export const customerCaseID = "customerCase";

Expand All @@ -12,15 +13,19 @@ const customerCase = defineType({
type: "document",
title: "Customer Case",
fields: [
{
...titleSlug,
type: "internationalizedArrayString",
},
{
name: titleID.basic,
type: "internationalizedArrayString",
title: "Customer Case Title",
},
{
...titleSlug,
type: "internationalizedArrayString",
...customerCaseProjectInfo,
},
//TODO: Block section
defineField({
name: richTextID,
title: "Body",
Expand Down
41 changes: 41 additions & 0 deletions studioShared/schemas/fields/customerCaseProjectInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineField } from "sanity";

export const customerCaseProjectInfo = defineField({
name: "customerCaseProjectInfo",
title: "Project Info",
description: "General information about the project",
type: "object",
fields: [
{
name: "customer",
description: "The customer for the project",
type: "internationalizedArrayString",
},
{
name: "projectName",
description: "The name of the project",
type: "internationalizedArrayString",
},
{
name: "projectDuration",
description: "The duration of the project",
type: "internationalizedArrayString",
},
{
name: "sector",
description: "The sector of the project",
type: "internationalizedArrayString",
},
{
name: "delivery",
description: "The delivery of the project",
type: "internationalizedArrayString",
},
{
//TODO: We should be able to select the consultants from a list
name: "consultants",
description: "The consultants for the project",
type: "internationalizedArrayString",
},
],
});

0 comments on commit 706cf3a

Please sign in to comment.