@gen-epix/ui-client-casedb 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/_chunks/AddCasesToEventDialog.js +98 -98
  2. package/dist/_chunks/AddCasesToEventDialog.js.map +1 -1
  3. package/dist/_chunks/CaseContentForm.js +10 -10
  4. package/dist/_chunks/CaseInfoDialog.js +242 -241
  5. package/dist/_chunks/CaseInfoDialog.js.map +1 -1
  6. package/dist/_chunks/CaseSetInfoDialog.js +224 -224
  7. package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
  8. package/dist/_chunks/Dashboard.js +549 -550
  9. package/dist/_chunks/Dashboard.js.map +1 -1
  10. package/dist/_chunks/FindSimilarCasesDialog.js +76 -76
  11. package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
  12. package/dist/_chunks/LegendaItem.js.map +1 -1
  13. package/dist/_chunks/LineListWidget.js +138 -136
  14. package/dist/_chunks/LineListWidget.js.map +1 -1
  15. package/dist/_chunks/PanelSeparator.js +3 -3
  16. package/dist/_chunks/PanelSeparator.js.map +1 -1
  17. package/dist/_chunks/Upload.js +318 -318
  18. package/dist/_chunks/Upload.js.map +1 -1
  19. package/dist/_chunks/{chunk-BV7QT456.js → chunk-OB3PAWPO.js} +3 -3
  20. package/dist/_chunks/chunk-OB3PAWPO.js.map +1 -0
  21. package/dist/_chunks/cloneDeep.js +1 -1
  22. package/dist/_chunks/cloneDeep.js.map +1 -1
  23. package/dist/_chunks/esm.js +3 -3
  24. package/dist/_chunks/esm.js.map +1 -1
  25. package/dist/_chunks/index.module.js +1 -1
  26. package/dist/_chunks/index.module.js.map +1 -1
  27. package/dist/_chunks/react.js +1 -1
  28. package/dist/_chunks/react.js.map +1 -1
  29. package/dist/_chunks/shallow.js +2 -2
  30. package/dist/_chunks/shallow.js.map +1 -1
  31. package/dist/_chunks/vanilla.js +1 -1
  32. package/dist/_chunks/vanilla.js.map +1 -1
  33. package/dist/_chunks/yup.js +24 -24
  34. package/dist/_chunks/yup.js.map +1 -1
  35. package/dist/components/form/fields/ArrangementEditor/index.js +30 -30
  36. package/dist/components/ui/CreateEventDialog/index.js +40 -40
  37. package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
  38. package/dist/components/ui/HistogramWidget/index.js +161 -162
  39. package/dist/components/ui/HistogramWidget/index.js.map +1 -1
  40. package/dist/components/ui/SequenceDownloadDialog/index.js +22 -22
  41. package/dist/locale/en.json +6 -0
  42. package/dist/locale/nl.json +7 -1
  43. package/dist/pages/CasesDetailPage/index.js +1 -1
  44. package/dist/pages/ColsAdminPage/index.js +1 -1
  45. package/dist/pages/ConceptsAdminPage/index.js +1 -1
  46. package/dist/pages/DimsAdminPage/index.js +1 -1
  47. package/dist/pages/EventsDetailPage/index.js +1 -1
  48. package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js +120 -86
  49. package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js.map +1 -1
  50. package/dist/pages/RefColsAdminPage/index.js +1 -1
  51. package/dist/pages/RegionSetShapesAdminPage/index.js +1 -1
  52. package/dist/pages/RegionsAdminPage/index.js +1 -1
  53. package/dist/pages/UserEffectiveRightsAdminPage/index.js +1 -1
  54. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +59 -59
  55. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
  56. package/dist/routes/index.js +93 -91
  57. package/dist/routes/index.js.map +1 -1
  58. package/dist/setup/setup.js +2 -3
  59. package/dist/setup/setup.js.map +1 -1
  60. package/package.json +73 -72
  61. package/dist/_chunks/chunk-BV7QT456.js.map +0 -1
  62. package/dist/_chunks/index.esm.js +0 -1465
  63. package/dist/_chunks/index.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSetInfoDialog.js","names":[],"sources":["../../src/components/ui/CaseSetInfoDialog/CaseSetDescription.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetSharingForm.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetSharingInfo.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetForm.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetContent.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetInfoDialog.tsx"],"sourcesContent":["import {\n Box,\n Typography,\n} from '@mui/material';\nimport type { BoxProps } from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { RichTextEditorContent } from '@gen-epix/ui-core-form/components/fields/RichTextEditor';\n\n\nexport type CaseSetDescriptionProps = {\n readonly caseSet: CaseDbCaseSet;\n} & BoxProps;\nexport const CaseSetDescription = ({ caseSet, ...boxProps }: CaseSetDescriptionProps) => {\n const { t } = useTranslation();\n return (\n <Box {...boxProps}>\n <Typography variant={'h6'}>\n {t`Description`}\n </Typography>\n <Box>\n {caseSet?.description && (\n <RichTextEditorContent source={caseSet?.description || ''} />\n )}\n {!caseSet?.description && (\n <Box sx={{ fontStyle: 'italic' }}>\n {t`None`}\n </Box>\n )}\n </Box>\n </Box>\n );\n\n};\n","import {\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n boolean,\n object,\n string,\n} from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport difference from 'lodash/difference';\nimport type { BoxProps } from '@mui/material';\nimport { Box } from '@mui/material';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { CaseDbCaseApi } from '@gen-epix/api-casedb';\nimport { NotificationService } from '@gen-epix/ui-client-common/classes/services/NotificationService';\nimport { QueryClientService } from '@gen-epix/ui-client-common/classes/services/QueryClientService';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\n\nimport { useCaseAbacContext } from '../../../context/caseAbac';\nimport { CaseUtil } from '../../../utils/CaseUtil';\nimport { CASEDB_QUERY_KEY } from '../../../constants/query';\n\n\nexport type CaseSetSharingFormProps = {\n readonly caseSet: CaseDbCaseSet;\n readonly caseTypeId: string;\n readonly formId: string;\n readonly onFinish: () => void;\n readonly onIsSavingChange: (isSaving: boolean) => void;\n} & BoxProps;\n\ntype FormFields = {\n dataCollectionIds?: string[];\n shouldApplySharingToCases?: boolean;\n};\n\nexport const CaseSetSharingForm = ({ caseSet, caseTypeId, formId, onFinish, onIsSavingChange, ...boxProps }: CaseSetSharingFormProps) => {\n const { t } = useTranslation();\n const [isSaving, setIsSaving] = useState(false);\n\n const schema = useMemo(() => object<FormFields>().shape({\n dataCollectionIds: array().of(string().uuid4()).required(),\n shouldApplySharingToCases: boolean().required(),\n }), []);\n\n const caseAbacContext = useCaseAbacContext();\n\n const onFormSubmit = useCallback(({ dataCollectionIds, shouldApplySharingToCases }: FormFields) => {\n const perform = async () => {\n setIsSaving(true);\n onIsSavingChange(true);\n const queryKeys = QueryClientService.getInstance().getQueryKeyDependencies([CASEDB_QUERY_KEY.CASE_SET_DATA_COLLECTION_LINKS], true);\n const notificationKey = NotificationService.getInstance().showNotification({\n isLoading: true,\n message: t('Saving case set data collections'),\n severity: 'info',\n });\n try {\n await QueryClientService.getInstance().cancelQueries(queryKeys);\n const rights = caseAbacContext?.rights?.[0];\n const dataCollectionIdsToAdd = difference(dataCollectionIds, rights.shared_in_data_collection_ids);\n const dataCollectionIdsToRemove = difference(rights.shared_in_data_collection_ids, dataCollectionIds);\n\n if (dataCollectionIdsToAdd.length > 0) {\n await CaseDbCaseApi.getInstance().caseSetDataCollectionLinksPostSome(dataCollectionIdsToAdd.map(data_collection_id => ({\n case_set_id: caseSet.id,\n data_collection_id,\n })));\n }\n if (dataCollectionIdsToRemove.length > 0) {\n await CaseDbCaseApi.getInstance().caseSetDataCollectionLinksDeleteSome(caseAbacContext.itemDataCollectionLinks[0]?.filter(x => dataCollectionIdsToRemove.includes(x.data_collection_id)).map(x => x.id).join(','));\n }\n NotificationService.getInstance().fulfillNotification(notificationKey, t('Successfully saved case set data collections.'), 'success');\n } catch (_error) {\n NotificationService.getInstance().fulfillNotification(notificationKey, t('Could not save case set data collections.'), 'error');\n } finally {\n await QueryClientService.getInstance().invalidateQueryKeys(queryKeys);\n if (shouldApplySharingToCases) {\n await CaseUtil.applyDataCollectionLinks({\n caseSetDataCollectionIds: dataCollectionIds,\n caseSetId: caseSet.id,\n caseTypeId,\n });\n }\n\n setIsSaving(false);\n onIsSavingChange(false);\n onFinish();\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n perform();\n }, [onIsSavingChange, t, caseAbacContext?.rights, caseAbacContext.itemDataCollectionLinks, caseSet.id, onFinish, caseTypeId]);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Data collections`,\n multiple: true,\n name: 'dataCollectionIds',\n options: caseAbacContext?.itemDataCollectionOptions?.[0] ?? [],\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Should the same sharing be applied to the cases in the event?`,\n name: 'shouldApplySharingToCases',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const, [caseAbacContext, t]);\n\n const item = useMemo<FormFields>(() => {\n return {\n dataCollectionIds: caseAbacContext?.rights?.[0]?.shared_in_data_collection_ids ?? [],\n shouldApplySharingToCases: true,\n };\n }, [caseAbacContext]);\n\n const values = useMemo<FormFields>(() => FormUtil.createFormValues(formFieldDefinitions, item), [formFieldDefinitions, item]);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema) as Resolver<FormFields>,\n values,\n });\n const { handleSubmit } = formMethods;\n\n\n if (isSaving) {\n return (\n <Spinner\n inline\n label={t`Saving case set data collections`}\n />\n );\n }\n\n return (\n <Box {...boxProps}>\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(onFormSubmit)}\n schema={schema}\n />\n </Box>\n );\n};\n","import { useTranslation } from 'react-i18next';\nimport {\n Box,\n Typography,\n} from '@mui/material';\nimport type { BoxProps } from '@mui/material';\n\nimport { DataCollectionAccessInfo } from '../DataCollectionAccessInfo';\n\nexport type CaseSetSharingInfoProps = BoxProps;\n\nexport const CaseSetSharingInfo = ({ ...boxProps }: CaseSetSharingInfoProps) => {\n const { t } = useTranslation();\n\n return (\n <Box {...boxProps}>\n <Typography variant={'h6'}>\n {t`Shared in`}\n </Typography>\n <DataCollectionAccessInfo />\n </Box>\n );\n};\n","import {\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport { t } from 'i18next';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport {\n object,\n string,\n} from 'yup';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { CaseDbCaseApi } from '@gen-epix/api-casedb';\nimport type { OmitWithMetaData } from '@gen-epix/ui-client-common/models/data';\nimport { QueryClientService } from '@gen-epix/ui-client-common/classes/services/QueryClientService';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { useEditMutation } from '@gen-epix/ui-client-common/hooks/useEditMutation';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { CreateEventDialogSuccessNotificationMessage } from '../CreateEventDialog/CreateEventDialogSuccessNotificationMessage';\nimport { useCaseSetCategoryOptionsQuery } from '../../../dataHooks/useCaseSetCategoriesQuery';\nimport { useCaseSetStatusOptionsQuery } from '../../../dataHooks/useCaseSetStatusesQuery';\nimport { useCaseTypeOptionsQuery } from '../../../dataHooks/useCaseTypesQuery';\nimport { CASEDB_QUERY_KEY } from '../../../constants/query';\n\nexport type CaseSetFormProps = {\n readonly caseSet: CaseDbCaseSet;\n readonly formId: string;\n readonly onFinish: () => void;\n readonly onIsSavingChange: (isSaving: boolean) => void;\n};\n\ntype FormFields = OmitWithMetaData<CaseDbCaseSet, 'case_set_category' | 'case_set_date' | 'case_set_status' | 'case_type' | 'created_in_data_collection_id' | 'created_in_data_collection'>;\n\nexport const CaseSetForm = ({ caseSet, formId, onFinish, onIsSavingChange }: CaseSetFormProps) => {\n const caseTypeOptionsQuery = useCaseTypeOptionsQuery();\n const caseSetCategoryOptionsQuery = useCaseSetCategoryOptionsQuery();\n const caseSetStatusOptionsQuery = useCaseSetStatusOptionsQuery();\n\n const schema = useMemo(() => object<FormFields>().shape({\n case_set_category_id: string().uuid4().required(),\n case_set_status_id: string().uuid4().required(),\n case_type_id: string().uuid4().required(),\n code: SchemaUtil.code,\n description: SchemaUtil.description,\n name: SchemaUtil.name,\n }), []);\n\n\n const onSuccess = useCallback(() => {\n onFinish();\n }, [onFinish]);\n\n const onError = useCallback(() => {\n onFinish();\n }, [onFinish]);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n disabled: !!caseSet,\n label: t`Case type`,\n loading: caseTypeOptionsQuery.isLoading,\n name: 'case_type_id',\n options: caseTypeOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Event name`,\n name: 'name',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Code`,\n name: 'code',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.RICH_TEXT,\n label: t`Description`,\n name: 'description',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Category`,\n loading: caseSetCategoryOptionsQuery.isLoading,\n name: 'case_set_category_id',\n options: caseSetCategoryOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Status`,\n loading: caseSetStatusOptionsQuery.isLoading,\n name: 'case_set_status_id',\n options: caseSetStatusOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [caseSet, caseSetCategoryOptionsQuery.isLoading, caseSetCategoryOptionsQuery.options, caseSetStatusOptionsQuery.isLoading, caseSetStatusOptionsQuery.options, caseTypeOptionsQuery.isLoading, caseTypeOptionsQuery.options]);\n\n const { isMutating: isEditing, mutate: mutateEdit, setPreviousItem } = useEditMutation<CaseDbCaseSet, FormFields>({\n getErrorNotificationMessage: (data) => t('Failed to edit event: {{name}}', { name: data.name }),\n getIntermediateItem: (variables: FormFields, previousItem: CaseDbCaseSet) => ({ ...previousItem, ...variables }),\n getProgressNotificationMessage: (data) => t('Saving event: {{name}}', { name: data.name }),\n getSuccessNotificationMessage: (item) => <CreateEventDialogSuccessNotificationMessage caseSet={item} />,\n onError,\n onSuccess,\n queryFn: async (formData: FormFields, item: CaseDbCaseSet): Promise<CaseDbCaseSet> => {\n const result = await CaseDbCaseApi.getInstance().caseSetsPutOne(item.id, { ...item, ...formData });\n return result.data;\n },\n resourceQueryKey: QueryClientService.getInstance().getGenericKey(CASEDB_QUERY_KEY.CASE_SETS),\n });\n\n useEffect(() => {\n onIsSavingChange(isEditing);\n }, [isEditing, onIsSavingChange]);\n\n const onFormSubmit = useCallback((formData: FormFields) => {\n setPreviousItem(caseSet);\n mutateEdit(formData);\n }, [caseSet, mutateEdit, setPreviousItem]);\n\n const values = useMemo(() => FormUtil.createFormValues<FormFields, CaseDbCaseSet>(formFieldDefinitions, caseSet), [formFieldDefinitions, caseSet]);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema) as unknown as Resolver<FormFields>,\n values,\n });\n const { handleSubmit } = formMethods;\n\n if (isEditing) {\n return (\n <Spinner\n inline\n label={t`Saving event data`}\n />\n );\n }\n\n return (\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(onFormSubmit)}\n schema={schema}\n />\n );\n};\n","import type { BoxProps } from '@mui/material';\nimport {\n Box,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport { format } from 'date-fns';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date';\n\nimport { useCaseSetCategoryMapQuery } from '../../../dataHooks/useCaseSetCategoriesQuery';\nimport { useCaseSetStatusMapQuery } from '../../../dataHooks/useCaseSetStatusesQuery';\nimport { useCaseTypeMapQuery } from '../../../dataHooks/useCaseTypesQuery';\n\nexport type CaseSetContentProps = {\n readonly caseSet: CaseDbCaseSet;\n} & BoxProps;\n\nexport const CaseSetContent = ({ caseSet, ...boxProps }: CaseSetContentProps) => {\n const caseSetCategoryMapQuery = useCaseSetCategoryMapQuery();\n const caseSetStatusMapQuery = useCaseSetStatusMapQuery();\n const caseTypeMapQuery = useCaseTypeMapQuery();\n const { t } = useTranslation();\n\n const loadables = useArray([caseSetCategoryMapQuery, caseSetStatusMapQuery, caseTypeMapQuery]);\n return (\n <Box {...boxProps}>\n <Typography variant={'h6'}>\n {t`Content`}\n </Typography>\n <ResponseHandler\n inlineSpinner\n loadables={loadables}\n shouldHideActionButtons\n >\n <Table size={'small'}>\n <TableHead>\n <TableRow>\n <TableCell\n sx={{\n width: 'calc(100% * 1/3)',\n }}\n >\n {t`Column`}\n </TableCell>\n <TableCell\n sx={{\n width: 'calc(100% * 2/3)',\n }}\n >\n {t`Value`}\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>\n {t`Name`}\n </TableCell>\n <TableCell>\n {caseSet.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Status`}\n </TableCell>\n <TableCell>\n {caseSetStatusMapQuery.map.get(caseSet.case_set_status_id)?.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Category`}\n </TableCell>\n <TableCell>\n {caseSetCategoryMapQuery.map.get(caseSet.case_set_category_id)?.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Type`}\n </TableCell>\n <TableCell>\n {caseTypeMapQuery.map.get(caseSet.case_type_id)?.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Created at`}\n </TableCell>\n <TableCell>\n {caseSet.case_set_date ? format(caseSet.case_set_date, DATE_FORMAT.DATE_TIME) : t`Unknown`}\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </ResponseHandler>\n </Box>\n );\n};\n","import type { ReactElement } from 'react';\nimport SaveIcon from '@mui/icons-material/Save';\nimport EditIcon from '@mui/icons-material/Edit';\nimport ShareIcon from '@mui/icons-material/Share';\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport ArrowLeftIcon from '@mui/icons-material/ArrowLeft';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type {\n CaseDbCaseSet,\n CaseDbUuidSetFilter,\n} from '@gen-epix/api-casedb';\nimport { CaseDbCaseApi } from '@gen-epix/api-casedb';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { QueryClientService } from '@gen-epix/ui-client-common/classes/services/QueryClientService';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { RouterService } from '@gen-epix/ui-client-common/classes/services/RouterService';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { useDeleteMutation } from '@gen-epix/ui-client-common/hooks/useDeleteMutation';\nimport { useItemQuery } from '@gen-epix/ui-client-common/hooks/useItemQuery';\nimport { useQueryMemo } from '@gen-epix/ui-client-common/hooks/useQueryMemo';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\n\nimport type { CaseAbacContext } from '../../../context/caseAbac';\nimport { CaseAbacContextProvider } from '../../../context/caseAbac';\nimport { useCaseSetRightsQuery } from '../../../dataHooks/useCaseSetRightsQuery';\nimport {\n useDataCollectionOptionsQuery,\n useDataCollectionsMapQuery,\n useDataCollectionsQuery,\n} from '../../../dataHooks/useDataCollectionsQuery';\nimport { CaseSetUtil } from '../../../utils/CaseSetUtil';\nimport { CASEDB_QUERY_KEY } from '../../../constants/query';\n\nimport { CaseSetDescription } from './CaseSetDescription';\nimport { CaseSetSharingForm } from './CaseSetSharingForm';\nimport { CaseSetSharingInfo } from './CaseSetSharingInfo';\nimport { CaseSetForm } from './CaseSetForm';\nimport { CaseSetContent } from './CaseSetContent';\n\n\nexport interface CaseSetInfoDialogOpenProps {\n readonly caseSetId: string;\n readonly caseTypeId: string;\n}\n\nexport interface CaseSetInfoDialogProps extends WithDialogRenderProps<CaseSetInfoDialogOpenProps> {\n readonly showNavigationButton?: boolean;\n}\n\nexport type CaseSetInfoDialogRefMethods = WithDialogRefMethods<CaseSetInfoDialogProps, CaseSetInfoDialogOpenProps>;\n\nexport const CaseSetInfoDialog = withDialog<CaseSetInfoDialogProps, CaseSetInfoDialogOpenProps>((\n {\n onActionsChange,\n onClose,\n onPermalinkChange,\n onTitleChange,\n openProps,\n showNavigationButton,\n }: CaseSetInfoDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const caseSetIds = useMemo(() => [openProps.caseSetId], [openProps.caseSetId]);\n const caseSetRightsQuery = useCaseSetRightsQuery(caseSetIds);\n const dataCollectionsQuery = useDataCollectionsQuery();\n const dataCollectionsMapQuery = useDataCollectionsMapQuery();\n const dataCollectionOptionsQuery = useDataCollectionOptionsQuery();\n const [isEditingCaseSetContent, setIsEditingCaseSetContent] = useState(false);\n const [isEditingDataCollections, setIsEditingDataCollections] = useState(false);\n const [isEpiCaseSetFormSaving, setIsEpiCaseSetFormSaving] = useState(false);\n const [isEpiCaseSetDataCollectionFormSaving, setIsEpiCaseSetDataCollectionFormSaving] = useState(false);\n const [isRefreshingData, setIsRefreshingData] = useState(false);\n const deleteConfirmationRef = useRef<ConfirmationRefMethods>(null);\n const valuesFormId = useId();\n const dataCollectionsFormId = useId();\n const loadables = useArray([caseSetRightsQuery, dataCollectionsQuery, dataCollectionsMapQuery, dataCollectionOptionsQuery]);\n\n\n const onDeleteSuccess = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const onDeleteError = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const { isMutating: isDeleteMutating, mutate: deleteMutate } = useDeleteMutation<CaseDbCaseSet>({\n associationQueryKeys: QueryClientService.getInstance().getQueryKeyDependencies([CASEDB_QUERY_KEY.CASE_SETS], true),\n getErrorNotificationMessage: (data) => t('Unable to remove event: {{name}}.', { name: data.name }),\n getProgressNotificationMessage: (data) => t('Deleting event: {{name}}...', { name: data.name }),\n getSuccessNotificationMessage: (data) => t('Event: {{name}}, has been removed.', { name: data.name }),\n onError: onDeleteError,\n onSuccess: onDeleteSuccess,\n queryFn: async (item: CaseDbCaseSet) => {\n return await CaseDbCaseApi.getInstance().caseSetsDeleteOne(item.id);\n },\n resourceQueryKey: QueryClientService.getInstance().getGenericKey(CASEDB_QUERY_KEY.CASE_SETS),\n });\n\n const { data: caseSet, error: caseSetError, isLoading: isCaseSetLoading } = useItemQuery<CaseDbCaseSet>({\n baseQueryKey: CASEDB_QUERY_KEY.CASE_SETS,\n itemId: openProps.caseSetId,\n useQueryOptions: {\n enabled: !isDeleteMutating,\n queryFn: async ({ signal }) => {\n const response = await CaseDbCaseApi.getInstance().caseSetsGetOne(openProps.caseSetId, { signal });\n return response.data;\n },\n },\n });\n\n const caseSetDataCollectionLinksFilter = useMemo<CaseDbUuidSetFilter>(() => ({\n invert: false,\n key: 'case_set_id',\n members: [caseSet?.id],\n type: 'UUID_SET',\n }), [caseSet?.id]);\n const { data: caseSetDataCollectionLinks, error: caseSetDataCollectionLinksError, isLoading: isSetCaseDataCollectionLinksLoading } = useQueryMemo({\n enabled: !!caseSet && !isDeleteMutating,\n queryFn: async ({ signal }) => {\n const response = await CaseDbCaseApi.getInstance().caseSetDataCollectionLinksPostQuery(caseSetDataCollectionLinksFilter, null, null, { signal });\n return response.data;\n },\n queryKey: QueryClientService.getInstance().getGenericKey(CASEDB_QUERY_KEY.CASE_SET_DATA_COLLECTION_LINKS, caseSetDataCollectionLinksFilter),\n });\n\n const canEdit = useMemo(() => {\n return !!caseSetRightsQuery.data && caseSetRightsQuery.data.some((right) => right.is_full_access || right.write_case_set);\n }, [caseSetRightsQuery.data]);\n\n const canShare = useMemo(() => {\n return !!caseSetRightsQuery.data && caseSetRightsQuery.data.some((right) => right.is_full_access || right.remove_data_collection_ids.length || right.add_data_collection_ids.length);\n }, [caseSetRightsQuery.data]);\n\n const canDelete = useCallback(() => {\n return !!caseSetRightsQuery.data && caseSetRightsQuery.data.some((right) => right.is_full_access || right.can_delete);\n }, [caseSetRightsQuery]);\n\n const onEditCaseContentButtonClick = useCallback(() => {\n setIsEditingCaseSetContent(true);\n }, []);\n\n const onEditDataCollectionsButtonClick = useCallback(() => {\n setIsEditingDataCollections(true);\n }, []);\n\n const onGoBackButtonClick = useCallback(() => {\n setIsEditingCaseSetContent(false);\n setIsEditingDataCollections(false);\n }, []);\n\n const onFinish = useCallback(() => {\n setIsEpiCaseSetFormSaving(false);\n setIsEpiCaseSetDataCollectionFormSaving(false);\n setIsRefreshingData(true);\n setIsEditingCaseSetContent(false);\n setIsEditingDataCollections(false);\n setIsRefreshingData(false);\n }, []);\n\n const onEpiCaseSetFormIsSavingChange = useCallback((isSaving: boolean) => {\n setIsEpiCaseSetFormSaving(isSaving);\n }, []);\n\n const onEpiCaseSetDataCollectionFormIsSavingChange = useCallback((isSaving: boolean) => {\n setIsEpiCaseSetDataCollectionFormSaving(isSaving);\n }, []);\n\n const onDeleteEventButtonClick = useCallback(() => {\n deleteConfirmationRef.current.open();\n }, []);\n\n const onDeleteConfirmationConfirm = useCallback(() => {\n deleteMutate(caseSet);\n }, [caseSet, deleteMutate]);\n\n const isSaving = isEpiCaseSetFormSaving || isEpiCaseSetDataCollectionFormSaving;\n\n const onGotoEventButtonClick = useCallback(async () => {\n await RouterService.getInstance().router.navigate(CaseSetUtil.createCaseSetLink(caseSet));\n }, [caseSet]);\n\n useEffect(() => {\n if (caseSet) {\n onPermalinkChange(CaseSetUtil.createCaseSetLink(caseSet, true));\n }\n }, [caseSet, onPermalinkChange]);\n\n useEffect(() => {\n if (!caseSet) {\n onTitleChange(t`Loading`);\n } else if (isEditingCaseSetContent) {\n onTitleChange(t('{{name}} - Edit', { name: caseSet.name }));\n } else if (isEditingDataCollections) {\n onTitleChange(t('{{name}} - Share', { name: caseSet.name }));\n } else {\n onTitleChange(caseSet?.name);\n }\n }, [isEditingDataCollections, isEditingCaseSetContent, onTitleChange, t, caseSet]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n\n if (isEditingCaseSetContent || isEditingDataCollections) {\n actions.push({\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-goBackButton'),\n color: 'primary',\n disabled: isSaving,\n label: t`Go back`,\n onClick: onGoBackButtonClick,\n startIcon: <ArrowLeftIcon />,\n variant: 'outlined',\n });\n }\n\n if (isEditingCaseSetContent) {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-saveButton'),\n color: 'secondary',\n disabled: isSaving,\n form: valuesFormId,\n label: t`Save`,\n startIcon: <SaveIcon />,\n type: 'submit',\n variant: 'contained',\n },\n );\n } else if (isEditingDataCollections) {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-saveButton'),\n color: 'secondary',\n disabled: isSaving,\n form: dataCollectionsFormId,\n label: t`Save`,\n startIcon: <SaveIcon />,\n type: 'submit',\n variant: 'contained',\n },\n );\n } else {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-deleteButton'),\n color: 'primary',\n disabled: !canDelete(),\n label: t`Delete`,\n onClick: onDeleteEventButtonClick,\n startIcon: <DeleteIcon />,\n variant: 'outlined',\n },\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-editDataCollectionsButton'),\n color: 'primary',\n disabled: !canShare,\n label: t`Share`,\n onClick: onEditDataCollectionsButtonClick,\n startIcon: <ShareIcon />,\n variant: 'outlined',\n },\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-editCaseContentButton'),\n color: 'primary',\n disabled: !canEdit,\n label: t`Edit`,\n onClick: onEditCaseContentButtonClick,\n startIcon: <EditIcon />,\n variant: 'outlined',\n },\n );\n\n if (showNavigationButton) {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-goToEvent'),\n autoFocus: true,\n color: 'secondary',\n label: t`Go to event`,\n onClick: onGotoEventButtonClick,\n variant: 'contained',\n },\n );\n }\n }\n\n\n onActionsChange(actions);\n }, [onActionsChange, showNavigationButton, onClose, onGotoEventButtonClick, t, caseSet, isEditingCaseSetContent, isEditingDataCollections, onGoBackButtonClick, isSaving, valuesFormId, dataCollectionsFormId, onEditDataCollectionsButtonClick, onEditCaseContentButtonClick, onDeleteEventButtonClick, canEdit, canShare, canDelete]);\n\n const caseAbacContextValue = useMemo<CaseAbacContext>(() => {\n return {\n createdInDataCollection: caseSet ? dataCollectionsMapQuery.map.get(caseSet?.created_in_data_collection_id) : undefined,\n itemDataCollectionLinks: [caseSetDataCollectionLinks],\n rights: caseSetRightsQuery.data,\n userDataCollectionOptions: dataCollectionOptionsQuery.options,\n userDataCollections: dataCollectionsQuery.data,\n userDataCollectionsMap: dataCollectionsMapQuery.map,\n };\n }, [caseSet, caseSetDataCollectionLinks, caseSetRightsQuery.data, dataCollectionOptionsQuery.options, dataCollectionsMapQuery.map, dataCollectionsQuery.data]);\n\n if (isRefreshingData || isDeleteMutating) {\n return (\n <Spinner\n inline\n label={t`Refreshing data`}\n />\n );\n }\n\n return (\n <>\n <ResponseHandler\n error={caseSetError || caseSetDataCollectionLinksError}\n inlineSpinner\n isLoading={isCaseSetLoading || isSetCaseDataCollectionLinksLoading}\n loadables={loadables}\n shouldHideActionButtons\n >\n <CaseAbacContextProvider caseAbac={caseAbacContextValue}>\n {!isEditingCaseSetContent && !isEditingDataCollections && (\n <>\n <CaseSetContent\n caseSet={caseSet}\n sx={{\n marginBottom: 2,\n }}\n />\n <CaseSetSharingInfo\n sx={{\n marginBottom: 2,\n }}\n />\n <CaseSetDescription\n caseSet={caseSet}\n sx={{\n marginBottom: 2,\n }}\n />\n </>\n )}\n {isEditingCaseSetContent && (\n <CaseSetForm\n caseSet={caseSet}\n formId={valuesFormId}\n onFinish={onFinish}\n onIsSavingChange={onEpiCaseSetFormIsSavingChange}\n />\n )}\n {isEditingDataCollections && (\n <CaseSetSharingForm\n caseSet={caseSet}\n caseTypeId={openProps.caseTypeId}\n formId={dataCollectionsFormId}\n onFinish={onFinish}\n onIsSavingChange={onEpiCaseSetDataCollectionFormIsSavingChange}\n />\n )}\n </CaseAbacContextProvider>\n </ResponseHandler>\n <Confirmation\n body={t`Are you sure you want to delete the event?`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Delete`}\n onConfirm={onDeleteConfirmationConfirm}\n ref={deleteConfirmationRef}\n title={t`Delete event?`}\n />\n\n </>\n );\n}, {\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'CaseSetInfoDialog',\n titleVariant: 'h2',\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAa,MAAsB,EAAE,YAAS,GAAG,QAAwC;CACvF,IAAM,EAAE,SAAM,EAAe;CAC7B,OACE,kBAAC,GAAD;EAAK,GAAI;EAAT,UAAA,CACE,kBAAC,GAAD;GAAY,SAAS;GAClB,UAAA,CAAC;EACQ,CAAA,GACZ,kBAAC,GAAD,EAAA,UAAA,CACG,GAAS,eACR,kBAAC,GAAD,EAAuB,QAAQ,GAAS,eAAe,GAAK,CAAA,GAE7D,CAAC,GAAS,eACT,kBAAC,GAAD;GAAK,IAAI,EAAE,WAAW,SAAS;GAC5B,UAAA,CAAC;EACC,CAAA,CAEJ,EAAA,CAAA,CACF;;AAGT,kCCaa,MAAsB,EAAE,YAAS,eAAY,WAAQ,aAAU,qBAAkB,GAAG,QAAwC;CACvI,IAAM,EAAE,SAAM,EAAe,GACvB,CAAC,GAAU,KAAe,EAAS,EAAK,GAExC,IAAS,QAAc,EAAmB,CAAC,CAAC,MAAM;EACtD,mBAAmB,EAAM,CAAC,CAAC,GAAG,EAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;EACzD,2BAA2B,EAAQ,CAAC,CAAC,SAAS;CAChD,CAAC,GAAG,CAAC,CAAC,GAEA,IAAkB,EAAmB,GAErC,IAAe,GAAa,EAAE,sBAAmB,mCAA4C;EA4CjG,aA3C4B;GAE1B,AADA,EAAY,EAA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MAAgB;EACvB,eAAA;EACA,WAAW,KAAoB;EACpB;EACX,yBAAA;EAEA,UAAA,kBAAC,GAAD;GAAyB,UAAU;GAAnC,UAAA;IACG,CAAC,KAA2B,CAAC,KAC5B,kBAAA,IAAA,EAAA,UAAA;KACE,kBAAC,IAAD;MACW;MACT,IAAI,EACF,cAAc,EAChB;KACD,CAAA;KACD,kBAAC,IAAD,EACE,IAAI,EACF,cAAc,EAChB,EACD,CAAA;KACD,kBAAC,IAAD;MACW;MACT,IAAI,EACF,cAAc,EAChB;KACD,CAAA;IACD,EAAA,CAAA;IAEH,KACC,kBAAC,IAAD;KACW;KACT,QAAQ;KACE;KACV,kBAAkB;IACnB,CAAA;IAEF,KACC,kBAAC,IAAD;KACW;KACT,YAAY,EAAU;KACtB,QAAQ;KACE;KACV,kBAAkB;IACnB,CAAA;GAEoB;;CACV,CAAA,GACjB,kBAAC,IAAD;EACE,MAAM,CAAC;EACP,aAAa,CAAC;EACd,cAAc,CAAC;EACf,WAAW;EACX,KAAK;EACL,OAAO,CAAC;CACT,CAAA,CAED,EAAA,CAAA;AAEN,GAAG;CACD,WAAW;CACX,UAAU;CACV,QAAQ;CACR,cAAc;AAChB,CAAC"}
1
+ {"version":3,"file":"CaseSetInfoDialog.js","names":[],"sources":["../../src/components/ui/CaseSetInfoDialog/CaseSetDescription.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetSharingForm.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetSharingInfo.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetForm.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetContent.tsx","../../src/components/ui/CaseSetInfoDialog/CaseSetInfoDialog.tsx"],"sourcesContent":["import {\n Box,\n Typography,\n} from '@mui/material';\nimport type { BoxProps } from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { RichTextEditorContent } from '@gen-epix/ui-core-form/components/fields/RichTextEditor';\n\n\nexport type CaseSetDescriptionProps = {\n readonly caseSet: CaseDbCaseSet;\n} & BoxProps;\nexport const CaseSetDescription = ({ caseSet, ...boxProps }: CaseSetDescriptionProps) => {\n const { t } = useTranslation();\n return (\n <Box {...boxProps}>\n <Typography variant={'h6'}>\n {t`Description`}\n </Typography>\n <Box>\n {caseSet?.description && (\n <RichTextEditorContent source={caseSet?.description || ''} />\n )}\n {!caseSet?.description && (\n <Box sx={{ fontStyle: 'italic' }}>\n {t`None`}\n </Box>\n )}\n </Box>\n </Box>\n );\n\n};\n","import {\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n boolean,\n object,\n string,\n} from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport difference from 'lodash/difference';\nimport type { BoxProps } from '@mui/material';\nimport { Box } from '@mui/material';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { CaseDbCaseApi } from '@gen-epix/api-casedb';\nimport { NotificationService } from '@gen-epix/ui-client-common/classes/services/NotificationService';\nimport { QueryClientService } from '@gen-epix/ui-client-common/classes/services/QueryClientService';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\n\nimport { useCaseAbacContext } from '../../../context/caseAbac';\nimport { CaseUtil } from '../../../utils/CaseUtil';\nimport { CASEDB_QUERY_KEY } from '../../../constants/query';\n\n\nexport type CaseSetSharingFormProps = {\n readonly caseSet: CaseDbCaseSet;\n readonly caseTypeId: string;\n readonly formId: string;\n readonly onFinish: () => void;\n readonly onIsSavingChange: (isSaving: boolean) => void;\n} & BoxProps;\n\ntype FormFields = {\n dataCollectionIds?: string[];\n shouldApplySharingToCases?: boolean;\n};\n\nexport const CaseSetSharingForm = ({ caseSet, caseTypeId, formId, onFinish, onIsSavingChange, ...boxProps }: CaseSetSharingFormProps) => {\n const { t } = useTranslation();\n const [isSaving, setIsSaving] = useState(false);\n\n const schema = useMemo(() => object<FormFields>().shape({\n dataCollectionIds: array().of(string().uuid4()).required(),\n shouldApplySharingToCases: boolean().required(),\n }), []);\n\n const caseAbacContext = useCaseAbacContext();\n\n const onFormSubmit = useCallback(({ dataCollectionIds, shouldApplySharingToCases }: FormFields) => {\n const perform = async () => {\n setIsSaving(true);\n onIsSavingChange(true);\n const queryKeys = QueryClientService.getInstance().getQueryKeyDependencies([CASEDB_QUERY_KEY.CASE_SET_DATA_COLLECTION_LINKS], true);\n const notificationKey = NotificationService.getInstance().showNotification({\n isLoading: true,\n message: t('Saving case set data collections'),\n severity: 'info',\n });\n try {\n await QueryClientService.getInstance().cancelQueries(queryKeys);\n const rights = caseAbacContext?.rights?.[0];\n const dataCollectionIdsToAdd = difference(dataCollectionIds, rights.shared_in_data_collection_ids);\n const dataCollectionIdsToRemove = difference(rights.shared_in_data_collection_ids, dataCollectionIds);\n\n if (dataCollectionIdsToAdd.length > 0) {\n await CaseDbCaseApi.getInstance().caseSetDataCollectionLinksPostSome(dataCollectionIdsToAdd.map(data_collection_id => ({\n case_set_id: caseSet.id,\n data_collection_id,\n })));\n }\n if (dataCollectionIdsToRemove.length > 0) {\n await CaseDbCaseApi.getInstance().caseSetDataCollectionLinksDeleteSome(caseAbacContext.itemDataCollectionLinks[0]?.filter(x => dataCollectionIdsToRemove.includes(x.data_collection_id)).map(x => x.id).join(','));\n }\n NotificationService.getInstance().fulfillNotification(notificationKey, t('Successfully saved case set data collections.'), 'success');\n } catch (_error) {\n NotificationService.getInstance().fulfillNotification(notificationKey, t('Could not save case set data collections.'), 'error');\n } finally {\n await QueryClientService.getInstance().invalidateQueryKeys(queryKeys);\n if (shouldApplySharingToCases) {\n await CaseUtil.applyDataCollectionLinks({\n caseSetDataCollectionIds: dataCollectionIds,\n caseSetId: caseSet.id,\n caseTypeId,\n });\n }\n\n setIsSaving(false);\n onIsSavingChange(false);\n onFinish();\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n perform();\n }, [onIsSavingChange, t, caseAbacContext?.rights, caseAbacContext.itemDataCollectionLinks, caseSet.id, onFinish, caseTypeId]);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Data collections`,\n multiple: true,\n name: 'dataCollectionIds',\n options: caseAbacContext?.itemDataCollectionOptions?.[0] ?? [],\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Should the same sharing be applied to the cases in the event?`,\n name: 'shouldApplySharingToCases',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const, [caseAbacContext, t]);\n\n const item = useMemo<FormFields>(() => {\n return {\n dataCollectionIds: caseAbacContext?.rights?.[0]?.shared_in_data_collection_ids ?? [],\n shouldApplySharingToCases: true,\n };\n }, [caseAbacContext]);\n\n const values = useMemo<FormFields>(() => FormUtil.createFormValues(formFieldDefinitions, item), [formFieldDefinitions, item]);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema) as Resolver<FormFields>,\n values,\n });\n const { handleSubmit } = formMethods;\n\n\n if (isSaving) {\n return (\n <Spinner\n inline\n label={t`Saving case set data collections`}\n />\n );\n }\n\n return (\n <Box {...boxProps}>\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(onFormSubmit)}\n schema={schema}\n />\n </Box>\n );\n};\n","import { useTranslation } from 'react-i18next';\nimport {\n Box,\n Typography,\n} from '@mui/material';\nimport type { BoxProps } from '@mui/material';\n\nimport { DataCollectionAccessInfo } from '../DataCollectionAccessInfo';\n\nexport type CaseSetSharingInfoProps = BoxProps;\n\nexport const CaseSetSharingInfo = ({ ...boxProps }: CaseSetSharingInfoProps) => {\n const { t } = useTranslation();\n\n return (\n <Box {...boxProps}>\n <Typography variant={'h6'}>\n {t`Shared in`}\n </Typography>\n <DataCollectionAccessInfo />\n </Box>\n );\n};\n","import {\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport { t } from 'i18next';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport {\n object,\n string,\n} from 'yup';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { CaseDbCaseApi } from '@gen-epix/api-casedb';\nimport type { OmitWithMetaData } from '@gen-epix/ui-client-common/models/data';\nimport { QueryClientService } from '@gen-epix/ui-client-common/classes/services/QueryClientService';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { useEditMutation } from '@gen-epix/ui-client-common/hooks/useEditMutation';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form';\nimport { FormUtil } from '@gen-epix/ui-core-form/utils/FormUtil';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { CreateEventDialogSuccessNotificationMessage } from '../CreateEventDialog/CreateEventDialogSuccessNotificationMessage';\nimport { useCaseSetCategoryOptionsQuery } from '../../../dataHooks/useCaseSetCategoriesQuery';\nimport { useCaseSetStatusOptionsQuery } from '../../../dataHooks/useCaseSetStatusesQuery';\nimport { useCaseTypeOptionsQuery } from '../../../dataHooks/useCaseTypesQuery';\nimport { CASEDB_QUERY_KEY } from '../../../constants/query';\n\nexport type CaseSetFormProps = {\n readonly caseSet: CaseDbCaseSet;\n readonly formId: string;\n readonly onFinish: () => void;\n readonly onIsSavingChange: (isSaving: boolean) => void;\n};\n\ntype FormFields = OmitWithMetaData<CaseDbCaseSet, 'case_set_category' | 'case_set_date' | 'case_set_status' | 'case_type' | 'created_in_data_collection_id' | 'created_in_data_collection'>;\n\nexport const CaseSetForm = ({ caseSet, formId, onFinish, onIsSavingChange }: CaseSetFormProps) => {\n const caseTypeOptionsQuery = useCaseTypeOptionsQuery();\n const caseSetCategoryOptionsQuery = useCaseSetCategoryOptionsQuery();\n const caseSetStatusOptionsQuery = useCaseSetStatusOptionsQuery();\n\n const schema = useMemo(() => object<FormFields>().shape({\n case_set_category_id: string().uuid4().required(),\n case_set_status_id: string().uuid4().required(),\n case_type_id: string().uuid4().required(),\n code: SchemaUtil.code,\n description: SchemaUtil.description,\n name: SchemaUtil.name,\n }), []);\n\n\n const onSuccess = useCallback(() => {\n onFinish();\n }, [onFinish]);\n\n const onError = useCallback(() => {\n onFinish();\n }, [onFinish]);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n disabled: !!caseSet,\n label: t`Case type`,\n loading: caseTypeOptionsQuery.isLoading,\n name: 'case_type_id',\n options: caseTypeOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Event name`,\n name: 'name',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Code`,\n name: 'code',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.RICH_TEXT,\n label: t`Description`,\n name: 'description',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Category`,\n loading: caseSetCategoryOptionsQuery.isLoading,\n name: 'case_set_category_id',\n options: caseSetCategoryOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Status`,\n loading: caseSetStatusOptionsQuery.isLoading,\n name: 'case_set_status_id',\n options: caseSetStatusOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [caseSet, caseSetCategoryOptionsQuery.isLoading, caseSetCategoryOptionsQuery.options, caseSetStatusOptionsQuery.isLoading, caseSetStatusOptionsQuery.options, caseTypeOptionsQuery.isLoading, caseTypeOptionsQuery.options]);\n\n const { isMutating: isEditing, mutate: mutateEdit, setPreviousItem } = useEditMutation<CaseDbCaseSet, FormFields>({\n getErrorNotificationMessage: (data) => t('Failed to edit event: {{name}}', { name: data.name }),\n getIntermediateItem: (variables: FormFields, previousItem: CaseDbCaseSet) => ({ ...previousItem, ...variables }),\n getProgressNotificationMessage: (data) => t('Saving event: {{name}}', { name: data.name }),\n getSuccessNotificationMessage: (item) => <CreateEventDialogSuccessNotificationMessage caseSet={item} />,\n onError,\n onSuccess,\n queryFn: async (formData: FormFields, item: CaseDbCaseSet): Promise<CaseDbCaseSet> => {\n const result = await CaseDbCaseApi.getInstance().caseSetsPutOne(item.id, { ...item, ...formData });\n return result.data;\n },\n resourceQueryKey: QueryClientService.getInstance().getGenericKey(CASEDB_QUERY_KEY.CASE_SETS),\n });\n\n useEffect(() => {\n onIsSavingChange(isEditing);\n }, [isEditing, onIsSavingChange]);\n\n const onFormSubmit = useCallback((formData: FormFields) => {\n setPreviousItem(caseSet);\n mutateEdit(formData);\n }, [caseSet, mutateEdit, setPreviousItem]);\n\n const values = useMemo(() => FormUtil.createFormValues<FormFields, CaseDbCaseSet>(formFieldDefinitions, caseSet), [formFieldDefinitions, caseSet]);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema) as unknown as Resolver<FormFields>,\n values,\n });\n const { handleSubmit } = formMethods;\n\n if (isEditing) {\n return (\n <Spinner\n inline\n label={t`Saving event data`}\n />\n );\n }\n\n return (\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(onFormSubmit)}\n schema={schema}\n />\n );\n};\n","import type { BoxProps } from '@mui/material';\nimport {\n Box,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n Typography,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport { format } from 'date-fns';\nimport type { CaseDbCaseSet } from '@gen-epix/api-casedb';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date';\n\nimport { useCaseSetCategoryMapQuery } from '../../../dataHooks/useCaseSetCategoriesQuery';\nimport { useCaseSetStatusMapQuery } from '../../../dataHooks/useCaseSetStatusesQuery';\nimport { useCaseTypeMapQuery } from '../../../dataHooks/useCaseTypesQuery';\n\nexport type CaseSetContentProps = {\n readonly caseSet: CaseDbCaseSet;\n} & BoxProps;\n\nexport const CaseSetContent = ({ caseSet, ...boxProps }: CaseSetContentProps) => {\n const caseSetCategoryMapQuery = useCaseSetCategoryMapQuery();\n const caseSetStatusMapQuery = useCaseSetStatusMapQuery();\n const caseTypeMapQuery = useCaseTypeMapQuery();\n const { t } = useTranslation();\n\n const loadables = useArray([caseSetCategoryMapQuery, caseSetStatusMapQuery, caseTypeMapQuery]);\n return (\n <Box {...boxProps}>\n <Typography variant={'h6'}>\n {t`Content`}\n </Typography>\n <ResponseHandler\n inlineSpinner\n loadables={loadables}\n shouldHideActionButtons\n >\n <Table size={'small'}>\n <TableHead>\n <TableRow>\n <TableCell\n sx={{\n width: 'calc(100% * 1/3)',\n }}\n >\n {t`Column`}\n </TableCell>\n <TableCell\n sx={{\n width: 'calc(100% * 2/3)',\n }}\n >\n {t`Value`}\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n <TableRow>\n <TableCell>\n {t`Name`}\n </TableCell>\n <TableCell>\n {caseSet.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Status`}\n </TableCell>\n <TableCell>\n {caseSetStatusMapQuery.map.get(caseSet.case_set_status_id)?.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Category`}\n </TableCell>\n <TableCell>\n {caseSetCategoryMapQuery.map.get(caseSet.case_set_category_id)?.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Type`}\n </TableCell>\n <TableCell>\n {caseTypeMapQuery.map.get(caseSet.case_type_id)?.name}\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n {t`Created at`}\n </TableCell>\n <TableCell>\n {caseSet.case_set_date ? format(caseSet.case_set_date, DATE_FORMAT.DATE_TIME) : t`Unknown`}\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </ResponseHandler>\n </Box>\n );\n};\n","import type { ReactElement } from 'react';\nimport SaveIcon from '@mui/icons-material/Save';\nimport EditIcon from '@mui/icons-material/Edit';\nimport ShareIcon from '@mui/icons-material/Share';\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport ArrowLeftIcon from '@mui/icons-material/ArrowLeft';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type {\n CaseDbCaseSet,\n CaseDbUuidSetFilter,\n} from '@gen-epix/api-casedb';\nimport { CaseDbCaseApi } from '@gen-epix/api-casedb';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport type { DialogAction } from '@gen-epix/ui-core-components/components/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { QueryClientService } from '@gen-epix/ui-client-common/classes/services/QueryClientService';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { RouterService } from '@gen-epix/ui-client-common/classes/services/RouterService';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { useDeleteMutation } from '@gen-epix/ui-client-common/hooks/useDeleteMutation';\nimport { useItemQuery } from '@gen-epix/ui-client-common/hooks/useItemQuery';\nimport { useQueryMemo } from '@gen-epix/ui-client-common/hooks/useQueryMemo';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\n\nimport type { CaseAbacContext } from '../../../context/caseAbac';\nimport { CaseAbacContextProvider } from '../../../context/caseAbac';\nimport { useCaseSetRightsQuery } from '../../../dataHooks/useCaseSetRightsQuery';\nimport {\n useDataCollectionOptionsQuery,\n useDataCollectionsMapQuery,\n useDataCollectionsQuery,\n} from '../../../dataHooks/useDataCollectionsQuery';\nimport { CaseSetUtil } from '../../../utils/CaseSetUtil';\nimport { CASEDB_QUERY_KEY } from '../../../constants/query';\n\nimport { CaseSetDescription } from './CaseSetDescription';\nimport { CaseSetSharingForm } from './CaseSetSharingForm';\nimport { CaseSetSharingInfo } from './CaseSetSharingInfo';\nimport { CaseSetForm } from './CaseSetForm';\nimport { CaseSetContent } from './CaseSetContent';\n\n\nexport interface CaseSetInfoDialogOpenProps {\n readonly caseSetId: string;\n readonly caseTypeId: string;\n}\n\nexport interface CaseSetInfoDialogProps extends WithDialogRenderProps<CaseSetInfoDialogOpenProps> {\n readonly showNavigationButton?: boolean;\n}\n\nexport type CaseSetInfoDialogRefMethods = WithDialogRefMethods<CaseSetInfoDialogProps, CaseSetInfoDialogOpenProps>;\n\nexport const CaseSetInfoDialog = withDialog<CaseSetInfoDialogProps, CaseSetInfoDialogOpenProps>((\n {\n onActionsChange,\n onClose,\n onPermalinkChange,\n onTitleChange,\n openProps,\n showNavigationButton,\n }: CaseSetInfoDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const caseSetIds = useMemo(() => [openProps.caseSetId], [openProps.caseSetId]);\n const caseSetRightsQuery = useCaseSetRightsQuery(caseSetIds);\n const dataCollectionsQuery = useDataCollectionsQuery();\n const dataCollectionsMapQuery = useDataCollectionsMapQuery();\n const dataCollectionOptionsQuery = useDataCollectionOptionsQuery();\n const [isEditingCaseSetContent, setIsEditingCaseSetContent] = useState(false);\n const [isEditingDataCollections, setIsEditingDataCollections] = useState(false);\n const [isEpiCaseSetFormSaving, setIsEpiCaseSetFormSaving] = useState(false);\n const [isEpiCaseSetDataCollectionFormSaving, setIsEpiCaseSetDataCollectionFormSaving] = useState(false);\n const [isRefreshingData, setIsRefreshingData] = useState(false);\n const deleteConfirmationRef = useRef<ConfirmationRefMethods>(null);\n const valuesFormId = useId();\n const dataCollectionsFormId = useId();\n const loadables = useArray([caseSetRightsQuery, dataCollectionsQuery, dataCollectionsMapQuery, dataCollectionOptionsQuery]);\n\n\n const onDeleteSuccess = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const onDeleteError = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const { isMutating: isDeleteMutating, mutate: deleteMutate } = useDeleteMutation<CaseDbCaseSet>({\n associationQueryKeys: QueryClientService.getInstance().getQueryKeyDependencies([CASEDB_QUERY_KEY.CASE_SETS], true),\n getErrorNotificationMessage: (data) => t('Unable to remove event: {{name}}.', { name: data.name }),\n getProgressNotificationMessage: (data) => t('Deleting event: {{name}}...', { name: data.name }),\n getSuccessNotificationMessage: (data) => t('Event: {{name}}, has been removed.', { name: data.name }),\n onError: onDeleteError,\n onSuccess: onDeleteSuccess,\n queryFn: async (item: CaseDbCaseSet) => {\n return await CaseDbCaseApi.getInstance().caseSetsDeleteOne(item.id);\n },\n resourceQueryKey: QueryClientService.getInstance().getGenericKey(CASEDB_QUERY_KEY.CASE_SETS),\n });\n\n const { data: caseSet, error: caseSetError, isLoading: isCaseSetLoading } = useItemQuery<CaseDbCaseSet>({\n baseQueryKey: CASEDB_QUERY_KEY.CASE_SETS,\n itemId: openProps.caseSetId,\n useQueryOptions: {\n enabled: !isDeleteMutating,\n queryFn: async ({ signal }) => {\n const response = await CaseDbCaseApi.getInstance().caseSetsGetOne(openProps.caseSetId, { signal });\n return response.data;\n },\n },\n });\n\n const caseSetDataCollectionLinksFilter = useMemo<CaseDbUuidSetFilter>(() => ({\n invert: false,\n key: 'case_set_id',\n members: [caseSet?.id],\n type: 'UUID_SET',\n }), [caseSet?.id]);\n const { data: caseSetDataCollectionLinks, error: caseSetDataCollectionLinksError, isLoading: isSetCaseDataCollectionLinksLoading } = useQueryMemo({\n enabled: !!caseSet && !isDeleteMutating,\n queryFn: async ({ signal }) => {\n const response = await CaseDbCaseApi.getInstance().caseSetDataCollectionLinksPostQuery(caseSetDataCollectionLinksFilter, null, null, { signal });\n return response.data;\n },\n queryKey: QueryClientService.getInstance().getGenericKey(CASEDB_QUERY_KEY.CASE_SET_DATA_COLLECTION_LINKS, caseSetDataCollectionLinksFilter),\n });\n\n const canEdit = useMemo(() => {\n return !!caseSetRightsQuery.data && caseSetRightsQuery.data.some((right) => right.is_full_access || right.write_case_set);\n }, [caseSetRightsQuery.data]);\n\n const canShare = useMemo(() => {\n return !!caseSetRightsQuery.data && caseSetRightsQuery.data.some((right) => right.is_full_access || right.remove_data_collection_ids.length || right.add_data_collection_ids.length);\n }, [caseSetRightsQuery.data]);\n\n const canDelete = useCallback(() => {\n return !!caseSetRightsQuery.data && caseSetRightsQuery.data.some((right) => right.is_full_access || right.can_delete);\n }, [caseSetRightsQuery]);\n\n const onEditCaseContentButtonClick = useCallback(() => {\n setIsEditingCaseSetContent(true);\n }, []);\n\n const onEditDataCollectionsButtonClick = useCallback(() => {\n setIsEditingDataCollections(true);\n }, []);\n\n const onGoBackButtonClick = useCallback(() => {\n setIsEditingCaseSetContent(false);\n setIsEditingDataCollections(false);\n }, []);\n\n const onFinish = useCallback(() => {\n setIsEpiCaseSetFormSaving(false);\n setIsEpiCaseSetDataCollectionFormSaving(false);\n setIsRefreshingData(true);\n setIsEditingCaseSetContent(false);\n setIsEditingDataCollections(false);\n setIsRefreshingData(false);\n }, []);\n\n const onEpiCaseSetFormIsSavingChange = useCallback((isSaving: boolean) => {\n setIsEpiCaseSetFormSaving(isSaving);\n }, []);\n\n const onEpiCaseSetDataCollectionFormIsSavingChange = useCallback((isSaving: boolean) => {\n setIsEpiCaseSetDataCollectionFormSaving(isSaving);\n }, []);\n\n const onDeleteEventButtonClick = useCallback(() => {\n deleteConfirmationRef.current.open();\n }, []);\n\n const onDeleteConfirmationConfirm = useCallback(() => {\n deleteMutate(caseSet);\n }, [caseSet, deleteMutate]);\n\n const isSaving = isEpiCaseSetFormSaving || isEpiCaseSetDataCollectionFormSaving;\n\n const onGotoEventButtonClick = useCallback(async () => {\n await RouterService.getInstance().router.navigate(CaseSetUtil.createCaseSetLink(caseSet));\n }, [caseSet]);\n\n useEffect(() => {\n if (caseSet) {\n onPermalinkChange(CaseSetUtil.createCaseSetLink(caseSet, true));\n }\n }, [caseSet, onPermalinkChange]);\n\n useEffect(() => {\n if (!caseSet) {\n onTitleChange(t`Loading`);\n } else if (isEditingCaseSetContent) {\n onTitleChange(t('{{name}} - Edit', { name: caseSet.name }));\n } else if (isEditingDataCollections) {\n onTitleChange(t('{{name}} - Share', { name: caseSet.name }));\n } else {\n onTitleChange(caseSet?.name);\n }\n }, [isEditingDataCollections, isEditingCaseSetContent, onTitleChange, t, caseSet]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n\n if (isEditingCaseSetContent || isEditingDataCollections) {\n actions.push({\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-goBackButton'),\n color: 'primary',\n disabled: isSaving,\n label: t`Go back`,\n onClick: onGoBackButtonClick,\n startIcon: <ArrowLeftIcon />,\n variant: 'outlined',\n });\n }\n\n if (isEditingCaseSetContent) {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-saveButton'),\n color: 'secondary',\n disabled: isSaving,\n form: valuesFormId,\n label: t`Save`,\n startIcon: <SaveIcon />,\n type: 'submit',\n variant: 'contained',\n },\n );\n } else if (isEditingDataCollections) {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-saveButton'),\n color: 'secondary',\n disabled: isSaving,\n form: dataCollectionsFormId,\n label: t`Save`,\n startIcon: <SaveIcon />,\n type: 'submit',\n variant: 'contained',\n },\n );\n } else {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-deleteButton'),\n color: 'primary',\n disabled: !canDelete(),\n label: t`Delete`,\n onClick: onDeleteEventButtonClick,\n startIcon: <DeleteIcon />,\n variant: 'outlined',\n },\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-editDataCollectionsButton'),\n color: 'primary',\n disabled: !canShare,\n label: t`Share`,\n onClick: onEditDataCollectionsButtonClick,\n startIcon: <ShareIcon />,\n variant: 'outlined',\n },\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-editCaseContentButton'),\n color: 'primary',\n disabled: !canEdit,\n label: t`Edit`,\n onClick: onEditCaseContentButtonClick,\n startIcon: <EditIcon />,\n variant: 'outlined',\n },\n );\n\n if (showNavigationButton) {\n actions.push(\n {\n ...TestIdUtil.createAttributes('CaseSetInfoDialog-goToEvent'),\n autoFocus: true,\n color: 'secondary',\n label: t`Go to event`,\n onClick: onGotoEventButtonClick,\n variant: 'contained',\n },\n );\n }\n }\n\n\n onActionsChange(actions);\n }, [onActionsChange, showNavigationButton, onClose, onGotoEventButtonClick, t, caseSet, isEditingCaseSetContent, isEditingDataCollections, onGoBackButtonClick, isSaving, valuesFormId, dataCollectionsFormId, onEditDataCollectionsButtonClick, onEditCaseContentButtonClick, onDeleteEventButtonClick, canEdit, canShare, canDelete]);\n\n const caseAbacContextValue = useMemo<CaseAbacContext>(() => {\n return {\n createdInDataCollection: caseSet ? dataCollectionsMapQuery.map.get(caseSet?.created_in_data_collection_id) : undefined,\n itemDataCollectionLinks: [caseSetDataCollectionLinks],\n rights: caseSetRightsQuery.data,\n userDataCollectionOptions: dataCollectionOptionsQuery.options,\n userDataCollections: dataCollectionsQuery.data,\n userDataCollectionsMap: dataCollectionsMapQuery.map,\n };\n }, [caseSet, caseSetDataCollectionLinks, caseSetRightsQuery.data, dataCollectionOptionsQuery.options, dataCollectionsMapQuery.map, dataCollectionsQuery.data]);\n\n if (isRefreshingData || isDeleteMutating) {\n return (\n <Spinner\n inline\n label={t`Refreshing data`}\n />\n );\n }\n\n return (\n <>\n <ResponseHandler\n error={caseSetError || caseSetDataCollectionLinksError}\n inlineSpinner\n isLoading={isCaseSetLoading || isSetCaseDataCollectionLinksLoading}\n loadables={loadables}\n shouldHideActionButtons\n >\n <CaseAbacContextProvider caseAbac={caseAbacContextValue}>\n {!isEditingCaseSetContent && !isEditingDataCollections && (\n <>\n <CaseSetContent\n caseSet={caseSet}\n sx={{\n marginBottom: 2,\n }}\n />\n <CaseSetSharingInfo\n sx={{\n marginBottom: 2,\n }}\n />\n <CaseSetDescription\n caseSet={caseSet}\n sx={{\n marginBottom: 2,\n }}\n />\n </>\n )}\n {isEditingCaseSetContent && (\n <CaseSetForm\n caseSet={caseSet}\n formId={valuesFormId}\n onFinish={onFinish}\n onIsSavingChange={onEpiCaseSetFormIsSavingChange}\n />\n )}\n {isEditingDataCollections && (\n <CaseSetSharingForm\n caseSet={caseSet}\n caseTypeId={openProps.caseTypeId}\n formId={dataCollectionsFormId}\n onFinish={onFinish}\n onIsSavingChange={onEpiCaseSetDataCollectionFormIsSavingChange}\n />\n )}\n </CaseAbacContextProvider>\n </ResponseHandler>\n <Confirmation\n body={t`Are you sure you want to delete the event?`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Delete`}\n onConfirm={onDeleteConfirmationConfirm}\n ref={deleteConfirmationRef}\n title={t`Delete event?`}\n />\n\n </>\n );\n}, {\n fullWidth: true,\n maxWidth: 'lg',\n testId: 'CaseSetInfoDialog',\n titleVariant: 'h2',\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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