Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 make sanity better #1086

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/article.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BlockContentIcon } from "@sanity/icons";
import { StringInputProps, defineField } from "sanity";

import { StringInputWithCharacterCount } from "studio/components/stringInputWithCharacterCount/StringInputWithCharacterCount";
Expand All @@ -11,6 +12,7 @@ export const article = defineField({
name: articleID,
title: "Article",
type: "object",
icon: BlockContentIcon,
fields: [
{
name: "tag",
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/compensation-calculator.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ControlsIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { link } from "studio/schemas/objects/link";
Expand All @@ -18,6 +19,7 @@ export const compensationCalculator = defineField({
name: compensationCalculatorId,
title: "Compensation Calculator",
type: "object",
icon: ControlsIcon,
fields: [
{
name: "moduleTitle",
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/contact-box.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BellIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { StringInputWithCharacterCount } from "studio/components/stringInputWithCharacterCount/StringInputWithCharacterCount";
Expand All @@ -22,6 +23,7 @@ export const contactBox = defineField({
name: contactBoxID,
title: "Contact Box",
type: "object",
icon: BellIcon,
fields: [
{
name: titleID.basic,
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/employeeHighlight.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HighlightIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { isInternationalizedString } from "studio/lib/interfaces/global";
Expand All @@ -10,6 +11,7 @@ export const employeeHighlightSection = defineField({
name: employeeHighlightID,
title: "Employee Highlight",
type: "object",
icon: HighlightIcon,
fields: [
{
name: titleID.basic,
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/employees.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { UsersIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { titleID } from "studio/schemas/fields/text";
Expand All @@ -8,6 +9,7 @@ export const employees = defineField({
name: employeesID,
title: "Employees",
type: "object",
icon: UsersIcon,
fields: [
{
name: titleID.basic,
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/generosity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { HeartIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { titleID } from "studio/schemas/fields/text";
Expand All @@ -9,6 +10,7 @@ export const generositySection = defineField({
name: generosityID,
title: "Generosity",
type: "object",
icon: HeartIcon,
fields: [
{
name: titleID.basic,
Expand Down
6 changes: 4 additions & 2 deletions studio/schemas/objects/sections/hero.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BoltIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { allTranslations } from "studio/utils/i18n";
Expand All @@ -8,10 +9,11 @@ export const hero = defineField({
name: heroID,
title: "Hero Section",
type: "object",
icon: BoltIcon,
fields: [
{
name: "title",
title: "title",
title: "Title",
type: "internationalizedArrayString",
validation: (rule) =>
rule.custom<{ value: string; _type: string; _key: string }[]>(
Expand All @@ -25,7 +27,7 @@ export const hero = defineField({

if (invalidItems.length > 0) {
return invalidItems.map((item) => ({
message: "title cannot be more than 200 characters long.",
message: "Title cannot be more than 200 characters long.",
path: [{ _key: item._key }, "value"],
}));
}
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/image.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ImageIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { isInternationalizedString } from "studio/lib/interfaces/global";
Expand All @@ -10,6 +11,7 @@ export const imageSection = defineField({
name: imageID,
title: "Image",
type: "object",
icon: ImageIcon,
fields: [
defineField({
...internationalizedImage,
Expand Down
4 changes: 3 additions & 1 deletion studio/schemas/objects/sections/imagesplit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { InlineIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { imageExtended } from "studio/schemas/fields/media";
Expand All @@ -11,6 +12,7 @@ export const imageSplitSection = defineField({
name: imageID,
title: "Image Split",
type: "object",
icon: InlineIcon,
fields: [
{
name: "content",
Expand All @@ -24,7 +26,7 @@ export const imageSplitSection = defineField({
type: "internationalizedArrayString",
title: "Title",
description:
"Enter the primary title that will be displayed at the top of the employees section.",
"Enter the primary title that will be displayed at the top of the section.",
},
{
name: "description",
Expand Down
2 changes: 2 additions & 0 deletions studio/schemas/objects/sections/jobs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { UlistIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { titleID } from "studio/schemas/fields/text";
Expand All @@ -8,6 +9,7 @@ export const jobs = defineField({
name: jobsID,
title: "Jobs",
type: "object",
icon: UlistIcon,
fields: [
{
name: titleID.basic,
Expand Down
4 changes: 3 additions & 1 deletion studio/schemas/objects/sections/learning.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BulbOutlineIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { titleID } from "studio/schemas/fields/text";
Expand All @@ -8,6 +9,7 @@ export const learningSection = defineField({
name: learningID,
title: "Learning",
type: "object",
icon: BulbOutlineIcon,
fields: [
{
name: titleID.basic,
Expand All @@ -21,7 +23,7 @@ export const learningSection = defineField({
name: "image",
type: "image",
title: "Image",
description: "An image of the learning",
description: "An image representing learning in Variant",
options: {
hotspot: true,
},
Expand Down
5 changes: 4 additions & 1 deletion studio/schemas/objects/sections/logoSalad.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ProjectsIcon } from "@sanity/icons";
import { defineField } from "sanity";

import image from "studio/schemas/fields/media";
Expand All @@ -8,6 +9,7 @@ export const logoSalad = defineField({
name: logoSaladID,
title: "Logo Salad",
type: "object",
icon: ProjectsIcon,
fields: [
{
name: "title",
Expand All @@ -18,7 +20,8 @@ export const logoSalad = defineField({
{
name: "logos",
title: "Logos",
description: "Add the logos you want to display.",
description:
"Add the logos you want to display, remember to use the correct size as defined in Figma.",
type: "array",
of: [image],
validation: (rule) =>
Expand Down
4 changes: 3 additions & 1 deletion studio/schemas/objects/sections/openness.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SparkleIcon } from "@sanity/icons";
import { defineField } from "sanity";

import { titleID } from "studio/schemas/fields/text";
Expand All @@ -7,6 +8,7 @@ export const opennessSection = defineField({
name: opennessID,
title: "Openness",
type: "object",
icon: SparkleIcon,
fields: [
{
name: titleID.basic,
Expand All @@ -20,7 +22,7 @@ export const opennessSection = defineField({
name: "image",
type: "image",
title: "Image",
description: "An image of the openness",
description: "Add an image to the section",
options: {
hotspot: true,
},
Expand Down
Loading