Skip to content
Open
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
49 changes: 49 additions & 0 deletions src/collections/HonoraryMembers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { isExec } from '@/access/isExec';
import type { CollectionConfig } from 'payload';

export const HonoraryMembers: CollectionConfig = {
slug: 'honorary-members',
admin: {
useAsTitle: 'name',
},
fields: [
{
name: 'name',
type: 'text',
required: true,
},
{
name: 'yearAwarded',
type: 'number',
required: true,
},
{
name: 'positions',
type: 'array',
required: false,
fields: [
{
name: 'position',
type: 'text',
required: true,
},
{
name: 'year',
type: 'number',
required: true,
},
],
minRows: 0,
maxRows: 20,
},
],
access: {
create: isExec,
update: isExec,
delete: isExec,
read: () => true,
},
versions: {
drafts: true,
},
};
88 changes: 66 additions & 22 deletions src/payload-types.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set LOGIN_TYPE=keycloak and run pnpm dev and access website to generate the types for keycloak. Otherwise the production build will fail.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface Config {
projects: Project;
gallery: Gallery;
'committee-members': CommitteeMember;
'honorary-members': HonoraryMember;
'known-spam-messages': KnownSpamMessage;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
Expand All @@ -89,6 +90,7 @@ export interface Config {
projects: ProjectsSelect<false> | ProjectsSelect<true>;
gallery: GallerySelect<false> | GallerySelect<true>;
'committee-members': CommitteeMembersSelect<false> | CommitteeMembersSelect<true>;
'honorary-members': HonoraryMembersSelect<false> | HonoraryMembersSelect<true>;
'known-spam-messages': KnownSpamMessagesSelect<false> | KnownSpamMessagesSelect<true>;
'payload-locked-documents':
| PayloadLockedDocumentsSelect<false>
Expand Down Expand Up @@ -135,10 +137,6 @@ export interface UserAuthOperations {
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "users". */
export interface User {
id: string;
email: string;
emailVerified?: string | null;
name?: string | null;
image?: string | null;
/** Users can have one or many roles */
roles?:
| (
Expand All @@ -152,16 +150,23 @@ export interface User {
| 'exec'
)[]
| null;
accounts?:
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string | null;
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
sessions?:
| {
id?: string | null;
provider: string;
providerAccountId: string;
type: string;
id: string;
createdAt?: string | null;
expiresAt: string;
}[]
| null;
updatedAt: string;
createdAt: string;
password?: string | null;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "media". */
export interface Media {
Expand Down Expand Up @@ -292,6 +297,22 @@ export interface CommitteeMember {
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "honorary-members". */
export interface HonoraryMember {
id: string;
name: string;
yearAwarded: number;
positions?:
| {
position: string;
year: number;
id?: string | null;
}[]
| null;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* Please upload messages that are known to be spam so they can be automatically filtered out on
* Discord using DuckBot.
Expand Down Expand Up @@ -345,6 +366,10 @@ export interface PayloadLockedDocument {
relationTo: 'committee-members';
value: string | CommitteeMember;
} | null)
| ({
relationTo: 'honorary-members';
value: string | HonoraryMember;
} | null)
| ({
relationTo: 'known-spam-messages';
value: string | KnownSpamMessage;
Expand Down Expand Up @@ -393,22 +418,23 @@ export interface PayloadMigration {
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "users_select". */
export interface UsersSelect<T extends boolean = true> {
id?: T;
email?: T;
emailVerified?: T;
name?: T;
image?: T;
roles?: T;
accounts?:
updatedAt?: T;
createdAt?: T;
email?: T;
resetPasswordToken?: T;
resetPasswordExpiration?: T;
salt?: T;
hash?: T;
loginAttempts?: T;
lockUntil?: T;
sessions?:
| T
| {
id?: T;
provider?: T;
providerAccountId?: T;
type?: T;
createdAt?: T;
expiresAt?: T;
};
updatedAt?: T;
createdAt?: T;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "media_select". */
export interface MediaSelect<T extends boolean = true> {
Expand Down Expand Up @@ -502,6 +528,24 @@ export interface CommitteeMembersSelect<T extends boolean = true> {
createdAt?: T;
_status?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema via the `definition`
* "honorary-members_select".
*/
export interface HonoraryMembersSelect<T extends boolean = true> {
name?: T;
yearAwarded?: T;
positions?:
| T
| {
position?: T;
year?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
_status?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema via the `definition`
* "known-spam-messages_select".
Expand Down
2 changes: 2 additions & 0 deletions src/payload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { authConfig } from './auth.config';
import { CommitteeMembers } from './collections/CommitteeMembers';
import { Events } from './collections/Events';
import { Gallery } from './collections/Gallery';
import { HonoraryMembers } from './collections/HonoraryMembers';
import { KnownSpamMessages } from './collections/KnownSpamMessages';
import { Media } from './collections/Media';
import { Projects } from './collections/Projects';
Expand Down Expand Up @@ -96,6 +97,7 @@ export default buildConfig({
Projects,
Gallery,
CommitteeMembers,
HonoraryMembers,
KnownSpamMessages,
], // Include any new collections here
editor: lexicalEditor(),
Expand Down