Skip to content

Commit

Permalink
feat: add 4 new schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
MishraShardendu22 authored and Vishesh-Dwivedi-Git committed Jan 26, 2025
1 parent e98eac4 commit 3be6fc3
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
"typescript": "^5"
},
"packageManager": "pnpm@9.15.3+sha512.1f79bc245a66eb0b07c5d4d83131240774642caaa86ef7d0434ab47c0d16f66b04e21e0c086eb61e62c77efc4d7f7ec071afad3796af64892fae66509173893a"
}
}
47 changes: 47 additions & 0 deletions src/sanity/schemaTypes/Finance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { defineField, defineType } from 'sanity';

export const Finance = defineType({
title: 'finance',
name: 'Finance',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Group Title',
type: 'string',
description:
'Title of the profile group, e.g., "Members" or "Special Invitee".',
}),
defineField({
name: 'profiles',
title: 'Profiles',
type: 'array',
of: [
{
type: 'object',
fields: [
defineField({
name: 'content',
title: 'Content',
type: 'array',
of: [{ type: 'string' }],
description: 'Roles or descriptions for the profile.',
}),
defineField({
name: 'imageURL',
title: 'Image URL',
type: 'string',
description: 'URL of the profile image (can be empty).',
}),
defineField({
name: 'title',
title: 'Profile Name',
type: 'string',
description: 'Name of the person.',
}),
],
},
],
}),
],
});
46 changes: 46 additions & 0 deletions src/sanity/schemaTypes/building_and_works.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { defineField, defineType } from 'sanity';

export const building_and_works = defineType({
title: 'Building and Works',
name: 'buildingAndWorks',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'Group title (optional)',
}),
defineField({
name: 'profiles',
title: 'Profiles',
type: 'array',
of: [
{
type: 'object',
fields: [
defineField({
name: 'content',
title: 'Content',
type: 'array',
of: [{ type: 'string' }],
description: 'Roles or descriptions for the profile',
}),
defineField({
name: 'imageURL',
title: 'Image URL',
type: 'url',
description: 'Profile image URL (optional)',
}),
defineField({
name: 'title',
title: 'Profile Name',
type: 'string',
description: 'Name of the person',
}),
],
},
],
}),
],
});
46 changes: 46 additions & 0 deletions src/sanity/schemaTypes/cgc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { defineField, defineType } from 'sanity';

export const cgc = defineType({
title: 'cgc',
name: 'Cgc',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'Group title (can be empty)',
}),
defineField({
name: 'profiles',
title: 'Profiles',
type: 'array',
of: [
{
type: 'object',
fields: [
defineField({
name: 'content',
title: 'Content',
type: 'array',
of: [{ type: 'string' }],
description: 'Roles or descriptions for the profile',
}),
defineField({
name: 'imageURL',
title: 'Image URL',
type: 'string',
description: 'URL of the profile image',
}),
defineField({
name: 'title',
title: 'Profile Name',
type: 'string',
description: 'Name of the person',
}),
],
},
],
}),
],
});
11 changes: 8 additions & 3 deletions src/sanity/schemaTypes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ import {
ContactData,
ContactInf,
} from './generalInfo/ContactInfo';
import { building_and_works } from './building_and_works';
import { cgc } from './cgc';
import { Finance } from './Finance';
import { student_coordinators } from './student_coordinators';

export const schema: { types: SchemaTypeDefinition[] } = {
types: [
Expand Down Expand Up @@ -73,17 +77,18 @@ export const schema: { types: SchemaTypeDefinition[] } = {
Club,
NIRF,
Tender,

AnnualReport,

ContactInf,
ContactCategory,
ContactData,

EventInfo,
Gallery,
MainCarouselImage,
ProgramCards,
ProgramsType,
building_and_works,
cgc,
Finance,
student_coordinators,
],
};
2 changes: 1 addition & 1 deletion src/sanity/schemaTypes/researchDevelopment/KrcDataTel.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineType, defineField } from 'sanity';

export const krcDataTel = defineType({
name: 'krcDataTEL',
name: 'krcDataTel',
title: 'Krc Data TEL(First three)',
type: 'document',
fields: [
Expand Down
46 changes: 46 additions & 0 deletions src/sanity/schemaTypes/student_coordinators.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { defineField, defineType } from 'sanity';

export const student_coordinators = defineType({
title: 'student_coordinators',
name: 'student_Coordinators',
type: 'document',
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
description: 'Group title (can be empty)',
}),
defineField({
name: 'profiles',
title: 'Profiles',
type: 'array',
of: [
{
type: 'object',
fields: [
defineField({
name: 'content',
title: 'Content',
type: 'array',
of: [{ type: 'string' }],
description: 'Roles or descriptions for the profile',
}),
defineField({
name: 'imageURL',
title: 'Image URL',
type: 'string',
description: 'Profile image URL',
}),
defineField({
name: 'title',
title: 'Profile Name',
type: 'string',
description: 'Name of the person',
}),
],
},
],
}),
],
});
23 changes: 20 additions & 3 deletions src/sanity/structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const structure: StructureResolver = (S) =>
.title('About')
.child(S.documentTypeList('about').title('About')),
S.listItem()
.title('Chairperson')
.child(S.documentTypeList('chairPerson').title('Chairperson')),
.title('Chair Person')
.child(S.documentTypeList('chairPerson').title('Chair Person')),
S.listItem()
.title('Contact')
.child(S.documentTypeList('contact').title('Contact')),
Expand All @@ -35,6 +35,23 @@ export const structure: StructureResolver = (S) =>
S.list()
.title('Academics')
.items([
S.listItem()
.title('Seat Structure')
.child(
S.documentTypeList('seatStructure').title('Seat Structure')
),
S.listItem()
.title('Links Structure')
.child(
S.documentTypeList('linksStructure').title('Links Structure')
),
S.listItem()
.title('Description Structure')
.child(
S.documentTypeList('descriptionStructure').title(
'Description Structure'
)
),
S.listItem()
.title('CSE Academic')
.child(S.documentTypeList('cseDetail').title('CSE')),
Expand Down Expand Up @@ -83,7 +100,7 @@ export const structure: StructureResolver = (S) =>
.child(S.documentTypeList('krcData').title('KRC Data')),
S.listItem()
.title('KRC Data Tel')
.child(S.documentTypeList('krcDataTEL').title('KRC Data Tel')),
.child(S.documentTypeList('krcDataTel').title('KRC Data Tel')),
S.listItem()
.title('KRC Data Tel Full')
.child(
Expand Down

0 comments on commit 3be6fc3

Please sign in to comment.