diff --git a/src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx b/src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx
deleted file mode 100644
index c8433ded..00000000
--- a/src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { useQueryClient } from '@tanstack/react-query'
-import { useParams } from 'react-router-dom'
-
-import { getPublicationsGetQueryKey, usePublicationsPost } from '@/api/fetchers'
-import { PublicationCreate } from '@/api/fetchers.schemas'
-import Modal from '@/components/Modal/Modal'
-import PublicationForm from '@/components/Publications/PublicationForm'
-import useModalStore from '@/store/modalStore'
-
-import { ModalStateMap } from '../../types'
-
-const PublicationAddModal = () => {
- const queryClient = useQueryClient()
- const { moduleId } = useParams()
-
- const modalState = useModalStore(
- state => state.modalStates['publicationAdd']
- ) as ModalStateMap['publicationAdd']
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- const { mutate } = usePublicationsPost({
- mutation: {
- onSuccess: () => {
- queryClient.invalidateQueries({
- queryKey: getPublicationsGetQueryKey({
- document_type: modalState?.documentType,
- }),
- })
-
- setActiveModal(null)
- },
- },
- })
-
- const initialValues = {
- Module_ID: parseInt(moduleId!),
- Document_Type: modalState?.documentType,
- Procedure_Type: modalState?.procedureType,
- Environment_UUID: modalState?.environmentUUID,
- } as PublicationCreate
-
- const handleFormSubmit = (payload: PublicationCreate) => {
- mutate({ data: payload })
- }
-
- return (
-
-
-
- )
-}
-
-export default PublicationAddModal
diff --git a/src/components/Modals/PublicationModals/PublicationAddModal/index.ts b/src/components/Modals/PublicationModals/PublicationAddModal/index.ts
deleted file mode 100644
index cd83af75..00000000
--- a/src/components/Modals/PublicationModals/PublicationAddModal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationAddModal'
diff --git a/src/components/Modals/PublicationModals/PublicationPackagesModal/PublicationPackagesModal.tsx b/src/components/Modals/PublicationModals/PublicationPackagesModal/PublicationPackagesModal.tsx
deleted file mode 100644
index c4f43874..00000000
--- a/src/components/Modals/PublicationModals/PublicationPackagesModal/PublicationPackagesModal.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { useState } from 'react'
-
-import Modal from '@/components/Modal'
-import useModalStore from '@/store/modalStore'
-
-import { StepOne, StepTwo } from './steps'
-
-const steps = [StepOne, StepTwo]
-
-interface PublicationPackagesModalProps {
- initialStep?: number
-}
-
-const PublicationPackagesModal = ({
- initialStep = 1,
-}: PublicationPackagesModalProps) => {
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- const [step, setStep] = useState(initialStep)
-
- const CurrentStep = steps[step - 1]
-
- const handleClose = () => {
- setActiveModal(null)
-
- // Wait for modal animation to finish before resetting step
- setTimeout(() => {
- setStep(initialStep)
- }, 300)
- }
-
- return (
-
-
-
- )
-}
-
-export default PublicationPackagesModal
diff --git a/src/components/Modals/PublicationModals/PublicationPackagesModal/index.ts b/src/components/Modals/PublicationModals/PublicationPackagesModal/index.ts
deleted file mode 100644
index bc5b1689..00000000
--- a/src/components/Modals/PublicationModals/PublicationPackagesModal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationPackagesModal'
diff --git a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/StepOne.tsx b/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/StepOne.tsx
deleted file mode 100644
index efd44df3..00000000
--- a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/StepOne.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { Button, Divider, Heading, Text } from '@pzh-ui/components'
-import { useParams } from 'react-router-dom'
-
-import {
- useModulesModuleIdStatusGet,
- usePublicationEnvironmentsGet,
-} from '@/api/fetchers'
-import { ModalStateMap } from '@/components/Modals/types'
-import PublicationPackages from '@/components/Publications/_OLD/PublicationPackages'
-import useModalStore from '@/store/modalStore'
-
-import { StepProps } from './types'
-
-export const StepOne = ({ setStep }: StepProps) => {
- const { moduleId } = useParams()
-
- const modalState = useModalStore(
- state => state.modalStates['publicationPackages']
- ) as ModalStateMap['publicationPackages']
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- const { data: status } = useModulesModuleIdStatusGet(parseInt(moduleId!), {
- query: {
- enabled: !!moduleId,
- select: data =>
- data.find(
- item => item.ID === modalState?.version.Module_Status.ID
- ),
- },
- })
-
- const { data: environment } = usePublicationEnvironmentsGet(undefined, {
- query: {
- select: data =>
- data.results.find(
- environment =>
- environment.UUID ===
- modalState.publication.Environment_UUID
- ),
- },
- })
-
- return (
-
-
Levering
-
-
- {status?.Status} -{' '}
- {modalState?.version.Bill_Metadata.Official_Title} (
- {environment?.Can_Publicate ? 'Officiële' : 'Interne'}{' '}
- publicatie)
-
-
setStep(2)}
- {...modalState?.version}
- />
-
-
-
-
-
- )
-}
diff --git a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/StepTwo.tsx b/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/StepTwo.tsx
deleted file mode 100644
index 9a5018e5..00000000
--- a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/StepTwo.tsx
+++ /dev/null
@@ -1,201 +0,0 @@
-import {
- Button,
- Divider,
- FormikDate,
- FormikInput,
- FormikRte,
- Heading,
-} from '@pzh-ui/components'
-import { useQueryClient } from '@tanstack/react-query'
-import { Form, Formik } from 'formik'
-import { isNull, isUndefined, mergeWith } from 'lodash'
-
-import {
- usePublicationAnnouncementsAnnouncementUuidGet,
- usePublicationAnnouncementsAnnouncementUuidPost,
-} from '@/api/fetchers'
-import { PublicationAnnouncementEdit } from '@/api/fetchers.schemas'
-import { LoaderSpinner } from '@/components/Loader'
-import { ModalStateMap } from '@/components/Modals/types'
-import useModalStore from '@/store/modalStore'
-
-import { StepProps } from './types'
-
-export const StepTwo = ({ setStep }: StepProps) => {
- const queryClient = useQueryClient()
-
- const modalState = useModalStore(
- state => state.modalStates['publicationPackages']
- ) as ModalStateMap['publicationPackages']
-
- const { data, isFetching, queryKey } =
- usePublicationAnnouncementsAnnouncementUuidGet(
- modalState?.announcementUuid,
- {
- query: {
- enabled: !!modalState?.announcementUuid,
- },
- }
- )
-
- const { mutate, isError } = usePublicationAnnouncementsAnnouncementUuidPost(
- {
- mutation: {
- onSuccess: () => {
- queryClient
- .invalidateQueries({ queryKey })
- .finally(() => setStep(1))
- },
- },
- }
- )
-
- const handleSubmit = (payload: PublicationAnnouncementEdit) => {
- mutate({
- announcementUuid: modalState?.announcementUuid,
- data: payload,
- })
- }
-
- const initialValues = {
- Content: {
- Texts: [
- {
- Title: null,
- },
- {
- Title: 'Planning',
- },
- {
- Title: 'Reageren',
- },
- {
- Title: 'Inzien',
- },
- {
- Title: 'Sluiting',
- },
- ],
- },
- } as PublicationAnnouncementEdit
-
- const mergedValues = mergeWith(
- initialValues,
- data,
- (objValue, srcValue) => {
- if (isUndefined(objValue) || isNull(objValue)) {
- return srcValue
- }
- }
- )
-
- return (
- <>
-
- Kennisgeving
-
-
- {isFetching ? (
-
-
-
- ) : (
-
- {({ isSubmitting }) => (
-
- )}
-
- )}
- >
- )
-}
diff --git a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/index.ts b/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/index.ts
deleted file mode 100644
index 33a926f0..00000000
--- a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './StepOne'
-export * from './StepTwo'
diff --git a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/types.ts b/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/types.ts
deleted file mode 100644
index 5d0e798d..00000000
--- a/src/components/Modals/PublicationModals/PublicationPackagesModal/steps/types.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export interface StepProps {
- setStep: (step: number) => void
-}
diff --git a/src/components/Modals/PublicationModals/PublicationVersionAbortModal/PublicationVersionAbortModal.tsx b/src/components/Modals/PublicationModals/PublicationVersionAbortModal/PublicationVersionAbortModal.tsx
deleted file mode 100644
index fb6273e3..00000000
--- a/src/components/Modals/PublicationModals/PublicationVersionAbortModal/PublicationVersionAbortModal.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { Button, Divider, Text } from '@pzh-ui/components'
-import { useParams } from 'react-router-dom'
-
-import {
- useModulesModuleIdStatusGet,
- usePublicationEnvironmentsGet,
-} from '@/api/fetchers'
-import Modal from '@/components/Modal/Modal'
-import useModalStore from '@/store/modalStore'
-
-import { ModalStateMap } from '../../types'
-
-const PublicationVersionAbortModal = () => {
- const { moduleId } = useParams()
-
- const setActiveModal = useModalStore(state => state.setActiveModal)
- const modalState = useModalStore(
- state => state.modalStates['publicationVersionAbort']
- ) as ModalStateMap['publicationVersionAbort']
-
- const { data: status } = useModulesModuleIdStatusGet(parseInt(moduleId!), {
- query: {
- enabled: !!moduleId,
- select: data =>
- data.find(
- item => item.ID === modalState?.version.Module_Status.ID
- ),
- },
- })
-
- const { data: environment } = usePublicationEnvironmentsGet(undefined, {
- query: {
- select: data =>
- data.results.find(
- environment =>
- environment.UUID ===
- modalState.publication.Environment_UUID
- ),
- },
- })
-
- return (
-
-
-
- {status?.Status} -{' '}
- {modalState?.version.Bill_Metadata.Official_Title} (
- {environment?.Can_Publicate ? 'Officiële' : 'Interne'}{' '}
- publicatie)
-
- {/*
*/}
-
-
-
-
-
-
- )
-}
-
-export default PublicationVersionAbortModal
diff --git a/src/components/Modals/PublicationModals/PublicationVersionAbortModal/index.ts b/src/components/Modals/PublicationModals/PublicationVersionAbortModal/index.ts
deleted file mode 100644
index 328d4e50..00000000
--- a/src/components/Modals/PublicationModals/PublicationVersionAbortModal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationVersionAbortModal'
diff --git a/src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx b/src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx
deleted file mode 100644
index 948473be..00000000
--- a/src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useQueryClient } from '@tanstack/react-query'
-import { toFormikValidationSchema } from 'zod-formik-adapter'
-
-import {
- getPublicationsPublicationUuidVersionsGetQueryKey,
- usePublicationsPublicationUuidVersionPost,
-} from '@/api/fetchers'
-import { PublicationVersionCreate } from '@/api/fetchers.schemas'
-import Modal from '@/components/Modal/Modal'
-import PublicationVersionForm from '@/components/Publications/PublicationVersionForm'
-import useModalStore from '@/store/modalStore'
-import { PUBLICATION_VERSION_ADD_SCHEMA } from '@/validation/publication'
-
-import { ModalStateMap } from '../../types'
-
-const PublicationVersionAddModal = () => {
- const queryClient = useQueryClient()
-
- const setActiveModal = useModalStore(state => state.setActiveModal)
- const modalState = useModalStore(
- state => state.modalStates['publicationVersionAdd']
- ) as ModalStateMap['publicationVersionAdd']
-
- const { mutate } = usePublicationsPublicationUuidVersionPost({
- mutation: {
- onSuccess: () => {
- queryClient.invalidateQueries({
- queryKey: getPublicationsPublicationUuidVersionsGetQueryKey(
- modalState.publication.UUID
- ),
- })
-
- setActiveModal(null)
- },
- },
- })
-
- const handleFormSubmit = (payload: PublicationVersionCreate) => {
- mutate({ publicationUuid: modalState.publication.UUID, data: payload })
- }
-
- return (
-
-
-
- )
-}
-
-export default PublicationVersionAddModal
diff --git a/src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts b/src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts
deleted file mode 100644
index 7fe4fbd3..00000000
--- a/src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationVersionAddModal'
diff --git a/src/components/Modals/PublicationModals/index.ts b/src/components/Modals/PublicationModals/index.ts
index d8f72afc..7d2b4e69 100644
--- a/src/components/Modals/PublicationModals/index.ts
+++ b/src/components/Modals/PublicationModals/index.ts
@@ -1,17 +1,9 @@
-import PublicationAddModal from './PublicationAddModal'
import PublicationAnnouncementUpdateModal from './PublicationAnnouncementUpdateModal'
import PublicationEditModal from './PublicationEditModal'
-import PublicationPackagesModal from './PublicationPackagesModal'
-import PublicationVersionAbortModal from './PublicationVersionAbortModal'
-import PublicationVersionAddModal from './PublicationVersionAddModal'
import PublicationVersionEditModal from './PublicationVersionEditModal'
export {
- PublicationAddModal,
PublicationAnnouncementUpdateModal,
PublicationEditModal,
- PublicationPackagesModal,
- PublicationVersionAbortModal,
- PublicationVersionAddModal,
PublicationVersionEditModal,
}
diff --git a/src/components/Publications/_OLD/Publication/Publication.tsx b/src/components/Publications/_OLD/Publication/Publication.tsx
deleted file mode 100644
index 3e25beff..00000000
--- a/src/components/Publications/_OLD/Publication/Publication.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { Button, Heading } from '@pzh-ui/components'
-import { Plus } from '@pzh-ui/icons'
-
-import { usePublicationEnvironmentsGet } from '@/api/fetchers'
-import { Publication as PublicationType } from '@/api/fetchers.schemas'
-import usePermissions from '@/hooks/usePermissions'
-import useModalStore from '@/store/modalStore'
-
-import PublicationVersions from '../PublicationVersions'
-
-interface PublicationProps {
- data: PublicationType
-}
-
-const Publication = ({ data }: PublicationProps) => {
- const { canEditPublication, canCreatePublicationVersion } = usePermissions()
-
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- const { data: environment } = usePublicationEnvironmentsGet(undefined, {
- query: {
- select: e =>
- e.results.find(
- environment => environment.UUID === data.Environment_UUID
- ),
- },
- })
-
- return (
-
-
-
- {data.Title || data.Document_Type} - {environment?.Title}{' '}
- publicatie
-
- {canEditPublication && (
-
- )}
-
-
- {!!data && (
-
- )}
-
- {canCreatePublicationVersion && (
-
- )}
-
- )
-}
-
-export default Publication
diff --git a/src/components/Publications/_OLD/Publication/index.ts b/src/components/Publications/_OLD/Publication/index.ts
deleted file mode 100644
index 869b92da..00000000
--- a/src/components/Publications/_OLD/Publication/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './Publication'
diff --git a/src/components/Publications/_OLD/PublicationAnnouncement/PublicationAnnouncement.tsx b/src/components/Publications/_OLD/PublicationAnnouncement/PublicationAnnouncement.tsx
deleted file mode 100644
index b7b004a0..00000000
--- a/src/components/Publications/_OLD/PublicationAnnouncement/PublicationAnnouncement.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-import { Text } from '@pzh-ui/components'
-import { useMemo } from 'react'
-
-import { usePublicationAnnouncementPackagesGet } from '@/api/fetchers'
-import {
- PackageType,
- PublicationAnnouncementShort,
-} from '@/api/fetchers.schemas'
-import { LoaderSpinner } from '@/components/Loader'
-
-import { PackageStep } from './components'
-
-export interface PublicationAnnouncementPackageProps {
- type: 'update' | 'create' | 'download' | 'upload'
- eventType: PackageType
-}
-
-interface PublicationAnnouncementProps extends PublicationAnnouncementShort {
- handleUpdateAction: () => void
-}
-
-const PublicationAnnouncement = ({
- handleUpdateAction,
- ...announcement
-}: PublicationAnnouncementProps) => {
- const { data: packages, isPending } = usePublicationAnnouncementPackagesGet(
- {
- announcement_uuid: announcement.UUID,
- }
- )
-
- const { validationPackage, publicationPackage } = useMemo(() => {
- const validationPackage = packages?.results.find(
- pkg => pkg.Package_Type === PackageType['validation']
- )
- const publicationPackage = packages?.results.find(
- pkg => pkg.Package_Type === PackageType['publication']
- )
-
- return { validationPackage, publicationPackage }
- }, [packages?.results])
-
- if (isPending) {
- return (
-
-
-
- )
- }
-
- return (
- <>
-
-
- Kennisgeving
-
-
-
-
-
-
-
-
- {/* {isOfficial && publicationPackage?.Report_Status === 'valid' && (
-
-
-
- )}
-
- {isOfficial && publicationPackage?.Report_Status === 'failed' && (
-
- )} */}
- >
- )
-}
-
-export default PublicationAnnouncement
diff --git a/src/components/Publications/_OLD/PublicationAnnouncement/components/PackageStep.tsx b/src/components/Publications/_OLD/PublicationAnnouncement/components/PackageStep.tsx
deleted file mode 100644
index 64fc8ec1..00000000
--- a/src/components/Publications/_OLD/PublicationAnnouncement/components/PackageStep.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { Text } from '@pzh-ui/components'
-import { Check } from '@pzh-ui/icons'
-import classNames from 'clsx'
-
-import { usePublicationAnnouncementPackagesGet } from '@/api/fetchers'
-import { PublicationAnnouncementShort } from '@/api/fetchers.schemas'
-
-import { PublicationAnnouncementPackageProps } from '../PublicationAnnouncement'
-import PackageStepActions from './PackageStepActions'
-
-interface PackageStepProps extends PublicationAnnouncementPackageProps {
- handleAction?: () => void
- announcement: PublicationAnnouncementShort
- isActive?: boolean
- isSucceeded?: boolean
- isFirst?: boolean
- isLast?: boolean
- isLoading?: boolean
-}
-
-const STEP_LABEL = {
- update: 'Vul gegevens in',
- create: 'Maak kennisgeving',
- download: 'Download kennisgeving',
- upload: 'Upload rapport(en) (kennisgeving)',
-}
-
-const PackageStep = ({
- handleAction,
- announcement,
- type,
- eventType,
- isActive,
- isSucceeded,
- isFirst,
- isLast,
- isLoading,
-}: PackageStepProps) => {
- const { data: pkg } = usePublicationAnnouncementPackagesGet(
- { announcement_uuid: announcement.UUID },
- {
- query: {
- select: data =>
- data.results.find(pkg => pkg.Package_Type === eventType),
- },
- }
- )
-
- const indicatorClass = classNames(
- 'after:content-[` `] -mt-1 flex h-[19px] w-[19px] items-center justify-center rounded-full border',
- {
- 'after:block after:h-[13px] after:w-[13px] after:rounded-full after:bg-pzh-green-500':
- isActive && !isSucceeded,
- 'border-pzh-gray-600': !isSucceeded,
- 'border-pzh-green-500 bg-pzh-green-500': isSucceeded,
- }
- )
-
- const borderClass = classNames('absolute h-full', {
- 'before:content-[` `] before:left-[9px] before:absolute before:top-0 before:block before:h-[calc(50%-13px)] before:w-px before:bg-pzh-gray-300':
- !isFirst,
- 'after:content-[` `] after:left-[9px] after:absolute after:bottom-0 after:block after:h-[calc(50%-9px)] after:w-px after:bg-pzh-gray-300':
- !isLast,
- })
-
- return (
-
-
-
- {isSucceeded && }
-
-
-
-
- {STEP_LABEL[type]}
-
- {type === 'upload' && !isSucceeded && (
-
- Selecteer alle(!) rapporten die zijn teruggekomen
- van het DSO
-
- )}
-
-
-
-
- )
-}
-
-export default PackageStep
diff --git a/src/components/Publications/_OLD/PublicationAnnouncement/components/PackageStepActions.tsx b/src/components/Publications/_OLD/PublicationAnnouncement/components/PackageStepActions.tsx
deleted file mode 100644
index 8eff3f0f..00000000
--- a/src/components/Publications/_OLD/PublicationAnnouncement/components/PackageStepActions.tsx
+++ /dev/null
@@ -1,347 +0,0 @@
-import { Button, FileTrigger, Tag, Text, formatDate } from '@pzh-ui/components'
-import { Plus } from '@pzh-ui/icons'
-import { useQuery, useQueryClient } from '@tanstack/react-query'
-import clsx from 'clsx'
-import { useMemo, useState } from 'react'
-
-import {
- getPublicationAnnouncementPackagesAnnouncementPackageUuidDownloadGetQueryKey,
- getPublicationAnnouncementPackagesGetQueryKey,
- usePublicationAnnouncementPackagesAnnouncementPackageUuidReportPost,
- usePublicationAnnouncementReportsGet,
- usePublicationAnnouncementsAnnouncementUuidPackagesPost,
-} from '@/api/fetchers'
-import {
- PublicationAnnouncementShort,
- PublicationPackage,
-} from '@/api/fetchers.schemas'
-import { downloadFile } from '@/utils/file'
-
-import { PublicationAnnouncementPackageProps } from '../PublicationAnnouncement'
-
-interface PackageStepActionsProps extends PublicationAnnouncementPackageProps {
- handleAction?: () => void
- announcement: PublicationAnnouncementShort
- publicationPackage?: PublicationPackage
- isActive?: boolean
- isSucceeded?: boolean
- isLoading?: boolean
- buttonLabel?: string
- hideDescription?: boolean
-}
-
-const PackageStepActions = ({ type, ...props }: PackageStepActionsProps) => {
- switch (type) {
- case 'create':
- return
- case 'download':
- return
- case 'upload':
- return
- case 'update':
- return
- }
-}
-
-const CreateAction = ({
- announcement,
- publicationPackage,
- eventType,
- isActive,
- isSucceeded,
- buttonLabel = 'Maak levering',
- hideDescription = false,
-}: PackageStepActionsProps) => {
- const queryClient = useQueryClient()
-
- const { mutate: create, isPending } =
- usePublicationAnnouncementsAnnouncementUuidPackagesPost({
- mutation: {
- onSuccess: () => {
- queryClient.invalidateQueries({
- queryKey: getPublicationAnnouncementPackagesGetQueryKey(
- {
- announcement_uuid: announcement.UUID,
- }
- ),
- })
- },
- },
- })
-
- const handleAction = () =>
- create({
- announcementUuid: announcement.UUID,
- data: { Package_Type: eventType },
- })
-
- const date = useMemo(() => {
- if (!!publicationPackage && isSucceeded) {
- return formatDate(
- new Date(publicationPackage.Created_Date),
- 'dd-MM-yyyy'
- )
- }
- }, [isSucceeded, publicationPackage])
-
- /**
- * Only show text if step isSucceeded
- */
- if (!!publicationPackage && isSucceeded) {
- return Levering gemaakt op {date}
- }
-
- return (
-
- {isPending && !hideDescription && (
-
- Levering wordt gemaakt, dit kan even duren..
-
- )}
-
-
- )
-}
-
-const DownloadAction = ({
- announcement,
- publicationPackage,
- eventType,
- isActive,
-}: PackageStepActionsProps) => {
- const queryClient = useQueryClient()
-
- const { isFetching, refetch: download } = useQuery({
- queryKey: [
- 'downloadPackage',
- publicationPackage?.UUID,
- announcement.UUID,
- eventType,
- ],
- queryFn: async () =>
- downloadFile(
- getPublicationAnnouncementPackagesAnnouncementPackageUuidDownloadGetQueryKey(
- publicationPackage?.UUID || ''
- )[0]
- ),
- enabled: false,
- })
-
- const handleAction = () =>
- download().finally(() =>
- queryClient.invalidateQueries({
- queryKey: getPublicationAnnouncementPackagesGetQueryKey({
- announcement_uuid: announcement.UUID,
- }),
- })
- )
-
- const date = useMemo(() => {
- if (!!publicationPackage?.Zip.Latest_Download_Date) {
- return formatDate(
- new Date(publicationPackage.Zip.Latest_Download_Date),
- 'dd-MM-yyyy'
- )
- }
- }, [publicationPackage])
-
- return (
-
- {!!publicationPackage?.Zip.Latest_Download_Date && (
-
- Laatst gedownload op {date}
-
- )}
-
-
- )
-}
-
-const UploadAction = ({
- announcement,
- publicationPackage,
- isActive,
- isLoading,
-}: PackageStepActionsProps) => {
- const queryClient = useQueryClient()
-
- const [files, setFiles] = useState(null)
-
- const { data: reports, queryKey } = usePublicationAnnouncementReportsGet(
- {
- announcement_package_uuid: publicationPackage?.UUID,
- limit: 100,
- },
- {
- query: {
- enabled: !!publicationPackage?.UUID,
- },
- }
- )
-
- const { mutate, isPending } =
- usePublicationAnnouncementPackagesAnnouncementPackageUuidReportPost({
- mutation: {
- onSuccess: () => {
- setFiles(null)
-
- queryClient.invalidateQueries({
- queryKey: getPublicationAnnouncementPackagesGetQueryKey(
- {
- announcement_uuid: announcement.UUID,
- }
- ),
- })
- queryClient.invalidateQueries({
- queryKey,
- })
- },
- },
- })
-
- const handleAction = () => {
- if (!publicationPackage?.UUID || !!!files?.length) return
-
- mutate({
- announcementPackageUuid: publicationPackage.UUID,
- data: { uploaded_files: files },
- })
- }
-
- const date = useMemo(() => {
- if (
- publicationPackage?.Modified_Date &&
- !!publicationPackage.Report_Status &&
- publicationPackage.Report_Status !== 'pending'
- ) {
- return formatDate(
- new Date(publicationPackage.Modified_Date),
- 'dd-MM-yyyy'
- )
- }
- }, [publicationPackage])
-
- const allFiles = useMemo(
- () =>
- ((!!files?.length || !!reports?.results.length) && [
- ...(reports?.results || []),
- ...(files || []),
- ]) ||
- undefined,
- [files, reports?.results]
- )
-
- return (
-
-
- {!!allFiles?.length && (
-
- {allFiles.map(file => (
-
- setFiles(
- files.filter(
- e => e.name !== file.name
- )
- )
- : undefined
- }
- className={clsx({
- 'border-pzh-red-900 bg-pzh-red-10 text-pzh-red-900':
- 'Report_Status' in file &&
- file.Report_Status === 'failed',
- 'border-pzh-gray-200 bg-pzh-gray-200 text-pzh-gray-600':
- 'Filename' in file && !!files?.length,
- })}
- />
- ))}
-
- )}
-
{
- if (!e) return
-
- const newFiles = Array.from(e)
-
- setFiles(
- !!files?.length ? [...files, ...newFiles] : newFiles
- )
- }}>
-
-
- {!!files?.length && (
-
- )}
-
- {date && (
-
- Gevalideerd op {date}
-
- )}
-
- )
-}
-
-const UpdateAction = ({
- handleAction,
- isActive,
- isSucceeded,
- buttonLabel = 'Ga naar het formulier',
-}: PackageStepActionsProps) => (
-
-)
-
-export default PackageStepActions
diff --git a/src/components/Publications/_OLD/PublicationAnnouncement/components/index.ts b/src/components/Publications/_OLD/PublicationAnnouncement/components/index.ts
deleted file mode 100644
index 36d4b3c0..00000000
--- a/src/components/Publications/_OLD/PublicationAnnouncement/components/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import PackageStep from './PackageStep'
-import PackageStepActions from './PackageStepActions'
-
-export { PackageStep, PackageStepActions }
diff --git a/src/components/Publications/_OLD/PublicationAnnouncement/index.ts b/src/components/Publications/_OLD/PublicationAnnouncement/index.ts
deleted file mode 100644
index 35d3ac42..00000000
--- a/src/components/Publications/_OLD/PublicationAnnouncement/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationAnnouncement'
diff --git a/src/components/Publications/_OLD/PublicationEnvironmentAction/PublicationEnvironmentAction.tsx b/src/components/Publications/_OLD/PublicationEnvironmentAction/PublicationEnvironmentAction.tsx
deleted file mode 100644
index 239bd17d..00000000
--- a/src/components/Publications/_OLD/PublicationEnvironmentAction/PublicationEnvironmentAction.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { Button } from '@pzh-ui/components'
-import { Check, Hourglass, Plus } from '@pzh-ui/icons'
-import clsx from 'clsx'
-
-import {
- DocumentType,
- ProcedureType,
- PublicationEnvironment,
-} from '@/api/fetchers.schemas'
-import useModalStore from '@/store/modalStore'
-
-interface PublicationEnvironmentActionProps extends PublicationEnvironment {
- documentType: DocumentType
- procedureType: ProcedureType
- state?: 'pending' | 'success'
- onClick?: () => void
-}
-
-const PublicationEnvironmentAction = ({
- documentType,
- procedureType,
- Title,
- UUID,
- state,
- onClick,
-}: PublicationEnvironmentActionProps) => {
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- if (state === 'pending' || state === 'success') {
- return (
-
- )
- }
-
- return (
-
- )
-}
-
-export default PublicationEnvironmentAction
diff --git a/src/components/Publications/_OLD/PublicationEnvironmentAction/index.ts b/src/components/Publications/_OLD/PublicationEnvironmentAction/index.ts
deleted file mode 100644
index dc6ff32c..00000000
--- a/src/components/Publications/_OLD/PublicationEnvironmentAction/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationEnvironmentAction'
diff --git a/src/components/Publications/_OLD/PublicationPackages/PublicationPackages.tsx b/src/components/Publications/_OLD/PublicationPackages/PublicationPackages.tsx
deleted file mode 100644
index e9ea967a..00000000
--- a/src/components/Publications/_OLD/PublicationPackages/PublicationPackages.tsx
+++ /dev/null
@@ -1,330 +0,0 @@
-import {
- Accordion,
- AccordionContent,
- AccordionItem,
- AccordionTrigger,
- Button,
- Notification,
- Text,
- formatDate,
-} from '@pzh-ui/components'
-import { useMemo } from 'react'
-
-import {
- usePublicationActPackagesActPackageUuidCreateAnnouncementPost,
- usePublicationActPackagesGet,
- usePublicationAnnouncementsGet,
- usePublicationVersionsVersionUuidGet,
-} from '@/api/fetchers'
-import {
- PackageType,
- ProcedureType,
- PublicationEnvironment,
- PublicationVersionShort,
-} from '@/api/fetchers.schemas'
-import { LoaderSpinner } from '@/components/Loader'
-import { ModalStateMap } from '@/components/Modals/types'
-import useModalStore from '@/store/modalStore'
-
-import PublicationAnnouncement from '../PublicationAnnouncement'
-import { PackageStep, PackageStepActions } from './components'
-
-export interface PublicationPackageProps {
- type: 'create' | 'download' | 'upload'
- eventType: PackageType
-}
-
-interface PublicationPackagesProps extends PublicationVersionShort {
- environment?: PublicationEnvironment
- procedureType: string
- handleUpdateAction: () => void
-}
-
-const PublicationPackages = ({
- environment,
- procedureType,
- handleUpdateAction,
- ...version
-}: PublicationPackagesProps) => {
- const modalState = useModalStore(
- state => state.modalStates['publicationPackages']
- ) as ModalStateMap['publicationPackages']
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- const { data } = usePublicationVersionsVersionUuidGet(version.UUID)
-
- const { data: packages, isPending } = usePublicationActPackagesGet({
- version_uuid: version.UUID,
- })
-
- const { validationPackage, publicationPackage } = useMemo(() => {
- const validationPackage = packages?.results.find(
- pkg => pkg.Package_Type === PackageType['validation']
- )
- const publicationPackage = packages?.results.find(
- pkg => pkg.Package_Type === PackageType['publication']
- )
-
- return { validationPackage, publicationPackage }
- }, [packages?.results])
-
- const { mutate: createAnnouncement } =
- usePublicationActPackagesActPackageUuidCreateAnnouncementPost({
- mutation: {
- onSuccess: data =>
- setActiveModal('publicationAnnouncementPackages', {
- environment,
- version,
- announcementUuid: data.UUID,
- }),
- },
- })
-
- const { data: announcement } = usePublicationAnnouncementsGet(
- { act_package_uuid: publicationPackage?.UUID },
- {
- query: {
- enabled: publicationPackage?.Report_Status === 'valid',
- select: data => data.results[0],
- },
- }
- )
-
- const { announcementDate, effectiveDate } = useMemo(() => {
- const announcementDate =
- data?.Announcement_Date &&
- formatDate(new Date(data.Announcement_Date), 'd LLLL yyyy')
-
- const effectiveDate =
- data?.Effective_Date &&
- formatDate(new Date(data.Effective_Date), 'd LLLL yyyy')
-
- return { announcementDate, effectiveDate }
- }, [data])
-
- const isOfficial = useMemo(
- () => environment?.Can_Publicate,
- [environment?.Can_Publicate]
- )
-
- if (isPending) {
- return (
-
-
-
- )
- }
-
- return (
-
-
-
-
- {isOfficial ? 'Validatie' : 'Publicatie'}
-
-
-
-
-
- {isOfficial && (
-
- )}
-
- {isOfficial &&
- validationPackage?.Report_Status === 'valid' &&
- !!!publicationPackage && (
-
- )}
-
- {isOfficial &&
- validationPackage?.Report_Status === 'failed' &&
- !!!publicationPackage && (
-
- )}
-
-
-
- {isOfficial && (
- <>
- {/* {validationPackage?.Report_Status === 'valid' && (
- !data?.Is_Valid &&
-
- )} */}
-
-
-
-
- Publicatie
-
-
-
- {validationPackage?.Report_Status === 'valid' && (
-
- )}
-
-
-
-
-
-
- >
- )}
-
- {isOfficial &&
- publicationPackage?.Report_Status === 'valid' &&
- !!!announcement && (
-
-
- {(procedureType as ProcedureType) === 'draft' &&
- !!publicationPackage && (
-
- )}
-
- )}
-
- {isOfficial && publicationPackage?.Report_Status === 'failed' && (
-
- )}
-
- {!!announcement && (procedureType as ProcedureType) === 'draft' && (
-
-
{
- setActiveModal('publicationPackages', {
- ...modalState,
- announcementUuid: announcement.UUID,
- })
- handleUpdateAction()
- }}
- {...announcement}
- />
-
- )}
-
- )
-}
-
-export default PublicationPackages
diff --git a/src/components/Publications/_OLD/PublicationPackages/components/PackageStep.tsx b/src/components/Publications/_OLD/PublicationPackages/components/PackageStep.tsx
deleted file mode 100644
index e9f47281..00000000
--- a/src/components/Publications/_OLD/PublicationPackages/components/PackageStep.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import { Text } from '@pzh-ui/components'
-import { Check } from '@pzh-ui/icons'
-import classNames from 'clsx'
-
-import { usePublicationActPackagesGet } from '@/api/fetchers'
-import { PublicationVersionShort } from '@/api/fetchers.schemas'
-
-import { PublicationPackageProps } from '../PublicationPackages'
-import PackageStepActions from './PackageStepActions'
-
-interface PackageStepProps extends PublicationPackageProps {
- version: PublicationVersionShort
- isActive?: boolean
- isSucceeded?: boolean
- isFirst?: boolean
- isLast?: boolean
- isLoading?: boolean
-}
-
-const STEP_LABEL = {
- create: 'Maak levering',
- download: 'Download levering',
- upload: 'Upload rapport(en)',
-}
-
-const PackageStep = ({
- version,
- type,
- eventType,
- isActive,
- isSucceeded,
- isFirst,
- isLast,
- isLoading,
-}: PackageStepProps) => {
- const { data: pkg } = usePublicationActPackagesGet(
- { version_uuid: version.UUID },
- {
- query: {
- select: data =>
- data.results.find(pkg => pkg.Package_Type === eventType),
- },
- }
- )
-
- const indicatorClass = classNames(
- 'after:content-[` `] -mt-1 flex h-[19px] w-[19px] items-center justify-center rounded-full border',
- {
- 'after:block after:h-[13px] after:w-[13px] after:rounded-full after:bg-pzh-green-500':
- isActive && !isSucceeded,
- 'border-pzh-gray-600': !isSucceeded,
- 'border-pzh-green-500 bg-pzh-green-500': isSucceeded,
- }
- )
-
- const borderClass = classNames('absolute h-full', {
- 'before:content-[` `] before:left-[9px] before:absolute before:top-0 before:block before:h-[calc(50%-13px)] before:w-px before:bg-pzh-gray-300':
- !isFirst,
- 'after:content-[` `] after:left-[9px] after:absolute after:bottom-0 after:block after:h-[calc(50%-9px)] after:w-px after:bg-pzh-gray-300':
- !isLast,
- })
-
- return (
-
-
-
- {isSucceeded && }
-
-
-
-
- {STEP_LABEL[type]}
-
- {type === 'upload' && !isSucceeded && (
-
- Selecteer alle(!) rapporten die zijn teruggekomen
- van het DSO
-
- )}
-
-
-
-
- )
-}
-
-export default PackageStep
diff --git a/src/components/Publications/_OLD/PublicationPackages/components/PackageStepActions.tsx b/src/components/Publications/_OLD/PublicationPackages/components/PackageStepActions.tsx
deleted file mode 100644
index ad4cdf41..00000000
--- a/src/components/Publications/_OLD/PublicationPackages/components/PackageStepActions.tsx
+++ /dev/null
@@ -1,342 +0,0 @@
-import { Button, FileTrigger, Tag, Text, formatDate } from '@pzh-ui/components'
-import { Plus } from '@pzh-ui/icons'
-import { useQuery, useQueryClient } from '@tanstack/react-query'
-import clsx from 'clsx'
-import { useMemo, useState } from 'react'
-
-import {
- getPublicationActPackagesActPackageUuidDownloadGetQueryKey,
- getPublicationActPackagesGetQueryKey,
- getPublicationsPublicationUuidVersionsGetQueryKey,
- usePublicationActPackagesActPackageUuidReportPost,
- usePublicationActReportsGet,
- usePublicationVersionsVersionUuidPackagesPost,
-} from '@/api/fetchers'
-import {
- PublicationPackage,
- PublicationVersionShort,
-} from '@/api/fetchers.schemas'
-import { downloadFile } from '@/utils/file'
-
-import { PublicationPackageProps } from '../PublicationPackages'
-
-interface PackageStepActionsProps extends PublicationPackageProps {
- version: PublicationVersionShort
- publicationPackage?: PublicationPackage
- isActive?: boolean
- isSucceeded?: boolean
- isLoading?: boolean
- buttonLabel?: string
- hideDescription?: boolean
-}
-
-const PackageStepActions = ({ type, ...props }: PackageStepActionsProps) => {
- switch (type) {
- case 'create':
- return
- case 'download':
- return
- case 'upload':
- return
- }
-}
-
-const CreateAction = ({
- version,
- publicationPackage,
- eventType,
- isActive,
- isSucceeded,
- buttonLabel = 'Maak levering',
- hideDescription = false,
-}: PackageStepActionsProps) => {
- const queryClient = useQueryClient()
-
- const { mutate: create, isPending } =
- usePublicationVersionsVersionUuidPackagesPost({
- mutation: {
- onSuccess: () => {
- queryClient.invalidateQueries({
- queryKey: getPublicationActPackagesGetQueryKey({
- version_uuid: version.UUID,
- }),
- })
- queryClient.invalidateQueries({
- queryKey:
- getPublicationsPublicationUuidVersionsGetQueryKey(
- version.Publication_UUID
- ),
- })
- },
- },
- })
-
- const handleAction = () =>
- create({
- versionUuid: version.UUID,
- data: { Package_Type: eventType },
- })
-
- const date = useMemo(() => {
- if (!!publicationPackage && isSucceeded) {
- return formatDate(
- new Date(publicationPackage.Created_Date),
- 'dd-MM-yyyy'
- )
- }
- }, [isSucceeded, publicationPackage])
-
- /**
- * Only show text if step isSucceeded
- */
- if (!!publicationPackage && isSucceeded) {
- return Levering gemaakt op {date}
- }
-
- return (
-
- {isPending && !hideDescription && (
-
- Levering wordt gemaakt, dit kan even duren..
-
- )}
-
-
- )
-}
-
-const DownloadAction = ({
- version,
- publicationPackage,
- eventType,
- isActive,
-}: PackageStepActionsProps) => {
- const queryClient = useQueryClient()
-
- const { isFetching, refetch: download } = useQuery({
- queryKey: [
- 'downloadPackage',
- publicationPackage?.UUID,
- version.UUID,
- eventType,
- ],
- queryFn: async () =>
- downloadFile(
- getPublicationActPackagesActPackageUuidDownloadGetQueryKey(
- publicationPackage?.UUID || ''
- )[0]
- ),
- enabled: false,
- })
-
- const handleAction = () =>
- download().finally(() =>
- queryClient.invalidateQueries({
- queryKey: getPublicationActPackagesGetQueryKey({
- version_uuid: version.UUID,
- }),
- })
- )
-
- const date = useMemo(() => {
- if (!!publicationPackage?.Zip.Latest_Download_Date) {
- return formatDate(
- new Date(publicationPackage.Zip.Latest_Download_Date),
- 'dd-MM-yyyy'
- )
- }
- }, [publicationPackage])
-
- return (
-
- {!!publicationPackage?.Zip.Latest_Download_Date && (
-
- Laatst gedownload op {date}
-
- )}
-
-
- )
-}
-
-const UploadAction = ({
- version,
- publicationPackage,
- isActive,
- isLoading,
-}: PackageStepActionsProps) => {
- const queryClient = useQueryClient()
-
- const [files, setFiles] = useState(null)
-
- const { data: reports, queryKey } = usePublicationActReportsGet(
- {
- act_package_uuid: publicationPackage?.UUID,
- limit: 100,
- },
- {
- query: {
- enabled: !!publicationPackage?.UUID,
- },
- }
- )
-
- const { mutate, isPending } =
- usePublicationActPackagesActPackageUuidReportPost({
- mutation: {
- onSuccess: data => {
- setFiles(null)
-
- queryClient.invalidateQueries({
- queryKey: getPublicationActPackagesGetQueryKey({
- version_uuid: version.UUID,
- }),
- })
- queryClient.invalidateQueries({
- queryKey,
- })
-
- if (data.Status === 'valid') {
- queryClient.invalidateQueries({
- queryKey:
- getPublicationsPublicationUuidVersionsGetQueryKey(
- version.Publication_UUID
- ),
- })
- }
- },
- },
- })
-
- const handleAction = () => {
- if (!publicationPackage?.UUID || !!!files?.length) return
-
- mutate({
- actPackageUuid: publicationPackage.UUID,
- data: { uploaded_files: files },
- })
- }
-
- const date = useMemo(() => {
- if (
- publicationPackage?.Modified_Date &&
- !!publicationPackage.Report_Status &&
- publicationPackage.Report_Status !== 'pending'
- ) {
- return formatDate(
- new Date(publicationPackage.Modified_Date),
- 'dd-MM-yyyy'
- )
- }
- }, [publicationPackage])
-
- const allFiles = useMemo(
- () =>
- ((!!files?.length || !!reports?.results.length) && [
- ...(reports?.results || []),
- ...(files || []),
- ]) ||
- undefined,
- [files, reports?.results]
- )
-
- return (
-
-
- {!!allFiles?.length && (
-
- {allFiles.map(file => (
-
- setFiles(
- files.filter(
- e => e.name !== file.name
- )
- )
- : undefined
- }
- className={clsx({
- 'border-pzh-red-900 bg-pzh-red-10 text-pzh-red-900':
- 'Report_Status' in file &&
- file.Report_Status === 'failed',
- 'border-pzh-gray-200 bg-pzh-gray-200 text-pzh-gray-600':
- 'Filename' in file && !!files?.length,
- })}
- />
- ))}
-
- )}
-
{
- if (!e) return
-
- const newFiles = Array.from(e)
-
- setFiles(
- !!files?.length ? [...files, ...newFiles] : newFiles
- )
- }}>
-
-
- {!!files?.length && (
-
- )}
-
- {date && (
-
- Gevalideerd op {date}
-
- )}
-
- )
-}
-
-export default PackageStepActions
diff --git a/src/components/Publications/_OLD/PublicationPackages/components/index.ts b/src/components/Publications/_OLD/PublicationPackages/components/index.ts
deleted file mode 100644
index 36d4b3c0..00000000
--- a/src/components/Publications/_OLD/PublicationPackages/components/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import PackageStep from './PackageStep'
-import PackageStepActions from './PackageStepActions'
-
-export { PackageStep, PackageStepActions }
diff --git a/src/components/Publications/_OLD/PublicationPackages/index.ts b/src/components/Publications/_OLD/PublicationPackages/index.ts
deleted file mode 100644
index e10af1c9..00000000
--- a/src/components/Publications/_OLD/PublicationPackages/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationPackages'
diff --git a/src/components/Publications/_OLD/PublicationVersions/PublicationVersions.tsx b/src/components/Publications/_OLD/PublicationVersions/PublicationVersions.tsx
deleted file mode 100644
index da610325..00000000
--- a/src/components/Publications/_OLD/PublicationVersions/PublicationVersions.tsx
+++ /dev/null
@@ -1,189 +0,0 @@
-import {
- Button,
- Pagination,
- Text,
- Tooltip,
- formatDate,
-} from '@pzh-ui/components'
-import { FileWord } from '@pzh-ui/icons'
-import { keepPreviousData, useQuery } from '@tanstack/react-query'
-import { useMemo, useState } from 'react'
-import { useParams } from 'react-router-dom'
-
-import { usePublicationsPublicationUuidVersionsGet } from '@/api/fetchers'
-import { Publication, PublicationVersionShort } from '@/api/fetchers.schemas'
-import { LoaderCard } from '@/components/Loader'
-import usePermissions from '@/hooks/usePermissions'
-import useModalStore from '@/store/modalStore'
-import { downloadFile } from '@/utils/file'
-
-const PAGE_LIMIT = 10
-
-interface PublicationVersionsProps {
- publication: Publication
-}
-
-const PublicationVersions = ({ publication }: PublicationVersionsProps) => {
- const [currPage, setCurrPage] = useState(1)
-
- const { data, isFetching } = usePublicationsPublicationUuidVersionsGet(
- publication!.UUID,
- {
- limit: PAGE_LIMIT,
- offset: (currPage - 1) * PAGE_LIMIT,
- },
- {
- query: {
- enabled: !!publication,
- placeholderData: keepPreviousData,
- },
- }
- )
-
- return (
- <>
-
- {isFetching ? (
-
- ) : !!data?.results.length ? (
-
-
-
- Datum aangemaakt |
- Gebaseerd op Modulestatus |
- Actie |
-
-
-
- {data?.results.map(version => (
-
- ))}
-
-
- ) : (
-
- Er is nog geen versie aangemaakt
-
- )}
-
- {!!data?.total && !!data?.limit && data.total > data.limit && (
-
- )}
- >
- )
-}
-
-const VersionRow = ({
- publication,
- ...version
-}: PublicationVersionShort & {
- publication: Publication
-}) => {
- const { moduleId } = useParams()
-
- const { canEditPublicationVersion, canViewPublicationPackage } =
- usePermissions()
-
- const setActiveModal = useModalStore(state => state.setActiveModal)
-
- const downloadDiff = ({
- moduleId,
- Module_Status_ID,
- }: {
- moduleId?: string
- Module_Status_ID: number
- }) =>
- downloadFile(
- `modules/${moduleId}/diff?output_format=doc&status_id=${Module_Status_ID}`
- )
-
- const { isFetching, refetch: download } = useQuery({
- queryKey: [
- 'downloadDiff',
- moduleId,
- version.Module_Status.ID,
- version.UUID,
- ],
- queryFn: () =>
- downloadDiff({
- moduleId,
- Module_Status_ID: version.Module_Status.ID,
- }),
- enabled: false,
- })
-
- const date = useMemo(
- () => formatDate(new Date(version.Created_Date), 'dd-MM-yyyy'),
- [version.Created_Date]
- )
-
- return (
-
- {date} |
- {version.Module_Status.Status} |
-
-
- {!version.Is_Locked && canEditPublicationVersion && (
-
- )}
- {canViewPublicationPackage && (
-
- )}
-
-
-
-
-
- |
-
- )
-}
-
-export default PublicationVersions
diff --git a/src/components/Publications/_OLD/PublicationVersions/index.ts b/src/components/Publications/_OLD/PublicationVersions/index.ts
deleted file mode 100644
index fff16603..00000000
--- a/src/components/Publications/_OLD/PublicationVersions/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './PublicationVersions'
diff --git a/src/components/Publications/_OLD/Publications.tsx b/src/components/Publications/_OLD/Publications.tsx
deleted file mode 100644
index 00e37101..00000000
--- a/src/components/Publications/_OLD/Publications.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import { Button, Heading } from '@pzh-ui/components'
-import { Minus, Plus } from '@pzh-ui/icons'
-import classNames from 'clsx'
-import { useState } from 'react'
-import { useParams } from 'react-router-dom'
-
-import {
- usePublicationEnvironmentsGet,
- usePublicationsGet,
-} from '@/api/fetchers'
-import { DocumentType, ProcedureType } from '@/api/fetchers.schemas'
-
-import { LoaderCard } from '../../Loader'
-import Publication from './Publication'
-import PublicationEnvironmentAction from './PublicationEnvironmentAction'
-
-const PROCEDURE_TYPE = {
- draft: 'Ontwerp',
- final: 'Definitief',
-}
-
-interface PublicationsProps {
- type: DocumentType
-}
-
-const Publications = ({ type }: PublicationsProps) => (
-
-
- {type}
-
-
-
- {Object.entries(ProcedureType).map(([key, value]) => (
-
- ))}
-
-
-)
-
-interface PublicationCollection {
- procedureType: ProcedureType
- documentType: DocumentType
-}
-
-const PublicationCollection = ({
- procedureType,
- documentType,
-}: PublicationCollection) => {
- const { moduleId } = useParams()
-
- const [isOpen, setIsOpen] = useState(false)
-
- const { data: environments, isFetching: environmentsFetching } =
- usePublicationEnvironmentsGet({
- is_active: true,
- })
-
- const { data, isFetching: publicationsFetching } = usePublicationsGet(
- { document_type: documentType, module_id: parseInt(moduleId!) },
- {
- query: {
- enabled: !!moduleId,
- select: data =>
- data.results.filter(
- publication =>
- publication.Procedure_Type === procedureType
- ),
- },
- }
- )
-
- return (
-
-
-
- {PROCEDURE_TYPE[procedureType]}
-
-
-
- {environmentsFetching || publicationsFetching ? (
-
- ) : !isOpen ? (
-
- {environments?.results.map(environment => (
-
-
- publication.Environment_UUID ===
- environment.UUID
- )
- ? data?.find(
- publication =>
- publication.Environment_UUID ===
- environment.UUID
- )?.Is_Locked
- ? 'success'
- : 'pending'
- : undefined
- }
- onClick={() => setIsOpen(true)}
- {...environment}
- />
-
- ))}
-
- ) : (
- <>
- {!!data?.length &&
- data.map(publication => (
-
- ))}
- {environments?.results
- .filter(
- environment =>
- !data?.find(
- publication =>
- publication.Environment_UUID ===
- environment.UUID
- )
- )
- .map(environment => (
-
- ))}
- >
- )}
-
- )
-}
-
-export default Publications
diff --git a/src/components/Publications/_OLD/index.ts b/src/components/Publications/_OLD/index.ts
deleted file mode 100644
index 53ba7944..00000000
--- a/src/components/Publications/_OLD/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './Publications'