diff --git a/src/entities/listing/listing.mock.ts b/src/entities/listing/listing.mock.ts index a90adb17..1e9917db 100644 --- a/src/entities/listing/listing.mock.ts +++ b/src/entities/listing/listing.mock.ts @@ -26,6 +26,7 @@ export const mockListingsData = (): TListing[] => [ tooi: 'string', rsin: 'string', pki: 'string', + image: 'string', }, }, { @@ -52,6 +53,7 @@ export const mockListingsData = (): TListing[] => [ tooi: 'string', rsin: 'string', pki: 'string', + image: 'string', }, }, { diff --git a/src/entities/organization/organization.mock.ts b/src/entities/organization/organization.mock.ts index d2a0fd20..ae84f2f6 100644 --- a/src/entities/organization/organization.mock.ts +++ b/src/entities/organization/organization.mock.ts @@ -11,6 +11,7 @@ export const mockOrganizationData = (): TOrganization[] => [ tooi: '7843432', rsin: '827342654', pki: '543573424', + image: '', }, { id: '2', @@ -21,6 +22,7 @@ export const mockOrganizationData = (): TOrganization[] => [ tooi: '', rsin: '', pki: '', + image: '', }, { // invalid data id: '3', @@ -31,6 +33,7 @@ export const mockOrganizationData = (): TOrganization[] => [ tooi: '5435', rsin: '54', pki: '6565', + image: '', }, ] diff --git a/src/entities/organization/organization.ts b/src/entities/organization/organization.ts index f8fd86cc..90d1f3b9 100644 --- a/src/entities/organization/organization.ts +++ b/src/entities/organization/organization.ts @@ -11,6 +11,7 @@ export class Organization implements TOrganization { public tooi: string public rsin: string public pki: string + public image: string constructor(data: TOrganization) { this.hydrate(data) @@ -26,6 +27,7 @@ export class Organization implements TOrganization { this.tooi = data?.tooi || '' this.rsin = data?.rsin || '' this.pki = data?.pki || '' + this.image = data?.image || '' } /* istanbul ignore next */ @@ -42,6 +44,7 @@ export class Organization implements TOrganization { tooi: z.string().regex(/^\d{1,}$/, 'is niet een geldige TOOI nummer').or(z.literal('')), rsin: z.string().regex(/^\d{9}$/, 'is niet een geldige RSIN nummer').or(z.literal('')), pki: z.string().regex(/^\d{1,}$/, 'is niet een geldige PKI nummer').or(z.literal('')), + image: z.string(), }) const result = schema.safeParse({ diff --git a/src/entities/organization/organization.types.ts b/src/entities/organization/organization.types.ts index 4d9b5b09..2f4480a4 100644 --- a/src/entities/organization/organization.types.ts +++ b/src/entities/organization/organization.types.ts @@ -7,4 +7,5 @@ export type TOrganization = { tooi: string rsin: string pki: string + image: string } diff --git a/src/entities/publication/publication.mock.ts b/src/entities/publication/publication.mock.ts index 5e717bc0..890cbdda 100644 --- a/src/entities/publication/publication.mock.ts +++ b/src/entities/publication/publication.mock.ts @@ -15,6 +15,7 @@ export const mockPublicationsData = (): TPublication[] => [ publicationType: '4', published: '2024-09-04T12:36:39Z', modified: '2024-09-04T12:36:39Z', + organization: '1', featured: true, data: { key: 'anyvalue', @@ -60,6 +61,7 @@ export const mockPublicationsData = (): TPublication[] => [ published: '2024-09-04T12:36:39Z', modified: '2024-09-04T12:36:39Z', featured: true, + organization: '1', data: { type: '', }, diff --git a/src/entities/publication/publication.ts b/src/entities/publication/publication.ts index dee7e62f..2e5bd360 100644 --- a/src/entities/publication/publication.ts +++ b/src/entities/publication/publication.ts @@ -21,6 +21,7 @@ export class Publication implements TPublication { public attachments: number[] public attachmentCount: number public themes: string[] + public organization: string public data: Record public anonymization: { @@ -60,6 +61,7 @@ export class Publication implements TPublication { this.description = data.description || '' this.reference = data.reference || '' this.image = data.image || '' + this.organization = data.organization || '' this.category = data.category || '' this.portal = data.portal || '' this.featured = (typeof data.featured === 'boolean' && data.featured) @@ -113,6 +115,7 @@ export class Publication implements TPublication { portal: z.string().url('is niet een url').or(z.literal('')), featured: z.boolean(), schema: z.string(), + organization: z.string(), status: z.enum(['Concept', 'Published', 'Withdrawn', 'Archived', 'Revised', 'Rejected']), attachments: z.union([z.string(), z.number()]).array(), attachmentCount: z.number(), diff --git a/src/entities/publication/publication.types.ts b/src/entities/publication/publication.types.ts index 52a80a94..a99f6194 100644 --- a/src/entities/publication/publication.types.ts +++ b/src/entities/publication/publication.types.ts @@ -17,6 +17,7 @@ export type TPublication = { status: 'Concept' | 'Published' | 'Withdrawn' | 'Archived' | 'Revised' | 'Rejected' attachments: number[] attachmentCount: number + organization: string themes: string[] data: Record anonymization: { diff --git a/src/modals/organization/AddOrganizationModal.vue b/src/modals/organization/AddOrganizationModal.vue index b42652da..8776de83 100644 --- a/src/modals/organization/AddOrganizationModal.vue +++ b/src/modals/organization/AddOrganizationModal.vue @@ -64,6 +64,12 @@ import { navigationStore, organizationStore } from '../../store/store.js' :value.sync="organization.pki" :error="!!inputValidation.fieldErrors?.['pki']" :helper-text="inputValidation.fieldErrors?.['pki']?.[0]" /> + + -import { publicationTypeStore, navigationStore, publicationStore, catalogiStore } from '../../store/store.js' +import { publicationTypeStore, navigationStore, publicationStore, catalogiStore, organizationStore } from '../../store/store.js'