@gen-epix/ui-client-casedb 4.0.2 → 4.2.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 (69) 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/CaseDbDownloadUtil.js +1 -1
  5. package/dist/_chunks/CaseDbDownloadUtil.js.map +1 -1
  6. package/dist/_chunks/CaseInfoDialog.js +222 -222
  7. package/dist/_chunks/CaseInfoDialog.js.map +1 -1
  8. package/dist/_chunks/CaseSetInfoDialog.js +222 -222
  9. package/dist/_chunks/CaseSetInfoDialog.js.map +1 -1
  10. package/dist/_chunks/CasesAlreadyInCaseSetWarning.js.map +1 -1
  11. package/dist/_chunks/Dashboard.js +296 -295
  12. package/dist/_chunks/Dashboard.js.map +1 -1
  13. package/dist/_chunks/FindSimilarCasesDialog.js +81 -81
  14. package/dist/_chunks/FindSimilarCasesDialog.js.map +1 -1
  15. package/dist/_chunks/HomePageTrends.js.map +1 -1
  16. package/dist/_chunks/LegendaItem.js.map +1 -1
  17. package/dist/_chunks/LineListWidget.js +46 -45
  18. package/dist/_chunks/LineListWidget.js.map +1 -1
  19. package/dist/_chunks/PanelSeparator.js +3 -3
  20. package/dist/_chunks/PanelSeparator.js.map +1 -1
  21. package/dist/_chunks/Upload.js +422 -418
  22. package/dist/_chunks/Upload.js.map +1 -1
  23. package/dist/_chunks/UploadUtil.js +44 -40
  24. package/dist/_chunks/UploadUtil.js.map +1 -1
  25. package/dist/_chunks/chunk-BV7QT456.js +1 -1
  26. package/dist/_chunks/chunk-BV7QT456.js.map +1 -1
  27. package/dist/_chunks/cloneDeep.js +1 -1
  28. package/dist/_chunks/cloneDeep.js.map +1 -1
  29. package/dist/_chunks/dashboardStore.js.map +1 -1
  30. package/dist/_chunks/esm.js +3 -3
  31. package/dist/_chunks/esm.js.map +1 -1
  32. package/dist/_chunks/index.module.js +1 -1
  33. package/dist/_chunks/index.module.js.map +1 -1
  34. package/dist/_chunks/react.js +1 -1
  35. package/dist/_chunks/react.js.map +1 -1
  36. package/dist/_chunks/shallow.js +2 -2
  37. package/dist/_chunks/shallow.js.map +1 -1
  38. package/dist/_chunks/vanilla.js +1 -1
  39. package/dist/_chunks/vanilla.js.map +1 -1
  40. package/dist/_chunks/yup.js +24 -24
  41. package/dist/_chunks/yup.js.map +1 -1
  42. package/dist/classes/services/EventBusService/EventBusService.d.ts +9 -2
  43. package/dist/classes/services/EventBusService/index.js.map +1 -1
  44. package/dist/components/form/fields/ArrangementEditor/index.js +30 -30
  45. package/dist/components/ui/CreateEventDialog/index.js +40 -40
  46. package/dist/components/ui/CreateEventDialog/index.js.map +1 -1
  47. package/dist/components/ui/MapWidget/index.js.map +1 -1
  48. package/dist/components/ui/RemoveCasesFromEventDialog/index.js.map +1 -1
  49. package/dist/components/ui/SequenceDownloadDialog/index.js +57 -44
  50. package/dist/components/ui/SequenceDownloadDialog/index.js.map +1 -1
  51. package/dist/components/ui/TreeWidget/index.js +8 -2
  52. package/dist/components/ui/TreeWidget/index.js.map +1 -1
  53. package/dist/locale/en.json +0 -11
  54. package/dist/locale/nl.json +0 -11
  55. package/dist/models/config.d.ts +2 -0
  56. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +59 -59
  57. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js.map +1 -1
  58. package/dist/utils/UploadUtil/UploadUtil.d.ts +1 -0
  59. package/package.json +68 -75
  60. package/dist/_chunks/index.esm.js +0 -1465
  61. package/dist/_chunks/index.esm.js.map +0 -1
  62. package/dist/components/ui/FileSelector/FileSelector.d.ts +0 -7
  63. package/dist/components/ui/FileSelector/index.d.ts +0 -1
  64. package/dist/components/ui/FileSelector/index.js +0 -206
  65. package/dist/components/ui/FileSelector/index.js.map +0 -1
  66. package/dist/utils/FileUtil/FileUtil.d.ts +0 -5
  67. package/dist/utils/FileUtil/index.d.ts +0 -1
  68. package/dist/utils/FileUtil/index.js +0 -15
  69. package/dist/utils/FileUtil/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/UserEffectiveRightsTesterAdminPage/UserEffectiveRightsTesterAdminPage.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next';\nimport {\n Box,\n Container,\n Typography,\n} from '@mui/material';\nimport {\n useId,\n useMemo,\n} from 'react';\nimport { useParams } from 'react-router-dom';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport {\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n object,\n string,\n} from 'yup';\nimport noop from 'lodash/noop';\nimport type { CaseDbUser } from '@gen-epix/api-casedb';\nimport { CaseDbOrganizationApi } from '@gen-epix/api-casedb';\nimport { COMMON_QUERY_KEY } from '@gen-epix/ui-client-common/constants/query';\nimport { PageContainer } from '@gen-epix/ui-client-common/components/ui/PageContainer';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { useItemQuery } from '@gen-epix/ui-client-common/hooks/useItemQuery';\nimport { useOrganizationMapQuery } from '@gen-epix/ui-client-common/dataHooks/useOrganizationsQuery';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\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';\n\nimport { useColSetMembersQuery } from '../../dataHooks/useColSetMembersQuery';\nimport { useCaseTypeSetMembersQuery } from '../../dataHooks/useCaseTypeSetMembersQuery';\nimport { useDataCollectionOptionsQuery } from '../../dataHooks/useDataCollectionsQuery';\nimport { useOrganizationAccessCasePoliciesQuery } from '../../dataHooks/useOrganizationAccessCasePoliciesQuery';\nimport { useOrganizationShareCasePoliciesQuery } from '../../dataHooks/useOrganizationShareCasePoliciesQuery';\nimport { useUserAccessCasePoliciesQuery } from '../../dataHooks/useUserAccessCasePoliciesQuery';\nimport { useUserShareCasePoliciesQuery } from '../../dataHooks/useUserShareCasePoliciesQuery';\nimport { useCaseTypeOptionsQuery } from '../../dataHooks/useCaseTypesQuery';\nimport type { UserEffectiveRight } from '../../models/caseAccess';\nimport { EffectiveRightsUtil } from '../../utils/EffectiveRightsUtil';\n\n\ntype FormFields = {\n caseTypeId: string;\n dataCollectionId: string;\n fromDataCollectionId: string;\n};\n\ntype Result = {\n add_case: boolean;\n add_case_set: boolean;\n has_share_case_rights?: boolean;\n read_case_set: boolean;\n read_col_ids: string[];\n remove_case: boolean;\n remove_case_set: boolean;\n write_case_set: boolean;\n write_col_ids: string[];\n};\n\nexport const UserEffectiveRightsTesterAdminPage = () => {\n const { t } = useTranslation();\n const formId = useId();\n\n const { userId } = useParams();\n\n const userQuery = useItemQuery<CaseDbUser>({\n baseQueryKey: COMMON_QUERY_KEY.USERS,\n itemId: userId,\n useQueryOptions: {\n queryFn: async ({ signal }) => {\n const response = await CaseDbOrganizationApi.getInstance().usersGetOne(userId, { signal });\n return response.data;\n },\n },\n });\n\n const colSetMembersQuery = useColSetMembersQuery();\n const caseTypeOptionsQuery = useCaseTypeOptionsQuery();\n const organizationMapQuery = useOrganizationMapQuery();\n const caseTypeSetMembersQuery = useCaseTypeSetMembersQuery();\n const dataCollectionOptionsQuery = useDataCollectionOptionsQuery();\n const organizationAccessCasePoliciesQuery = useOrganizationAccessCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.organization_id === userQuery.data?.organization_id));\n const organizationShareCasePoliciesQuery = useOrganizationShareCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.organization_id === userQuery.data?.organization_id));\n const userAccessCasePoliciesQuery = useUserAccessCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.user_id === userQuery.data?.id));\n const userShareCasePoliciesQuery = useUserShareCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.user_id === userQuery.data?.id));\n\n const loadables = useArray([\n userQuery,\n colSetMembersQuery,\n caseTypeOptionsQuery,\n caseTypeSetMembersQuery,\n dataCollectionOptionsQuery,\n organizationAccessCasePoliciesQuery,\n organizationShareCasePoliciesQuery,\n userAccessCasePoliciesQuery,\n userShareCasePoliciesQuery,\n organizationMapQuery,\n ]);\n\n\n const effectiveRights = useMemo<UserEffectiveRight[]>(() => {\n const { data: organizationAccessCasePolicies } = organizationAccessCasePoliciesQuery;\n const { data: organizationShareCasePolicies } = organizationShareCasePoliciesQuery;\n const { data: userAccessCasePolicies } = userAccessCasePoliciesQuery;\n const { data: userShareCasePolicies } = userShareCasePoliciesQuery;\n const { data: caseTypeSetMembers } = caseTypeSetMembersQuery;\n const { data: colSetMembers } = colSetMembersQuery;\n\n return EffectiveRightsUtil.assembleUserEffectiveRights({\n caseTypeSetMembers,\n colSetMembers,\n organizationAccessCasePolicies,\n organizationShareCasePolicies,\n user: userQuery.data,\n userAccessCasePolicies,\n userShareCasePolicies,\n });\n\n }, [colSetMembersQuery, caseTypeSetMembersQuery, organizationAccessCasePoliciesQuery, organizationShareCasePoliciesQuery, userAccessCasePoliciesQuery, userQuery.data, userShareCasePoliciesQuery]);\n\n const schema = useMemo(() => object<FormFields>().shape({\n caseTypeId: string().uuid4().required(),\n dataCollectionId: string().uuid4().required(),\n fromDataCollectionId: string().uuid4().nullable().notRequired(),\n }), []);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema) as unknown as Resolver<FormFields>,\n values: {\n caseTypeId: null,\n dataCollectionId: null,\n fromDataCollectionId: null,\n },\n });\n const { control, handleSubmit } = formMethods;\n const formValues = useWatch({ control });\n\n const result = useMemo<Result>(() => {\n if (!formValues.caseTypeId || !formValues.dataCollectionId) {\n return null;\n }\n const effectiveRight = effectiveRights.find(right => {\n return right.data_collection_id === formValues.dataCollectionId && right.categorized_case_type_ids.some(x => x === formValues.caseTypeId);\n });\n\n const shareCaseRight = formValues.fromDataCollectionId && effectiveRight?.effective_share_case_rights?.find(shareRight => {\n return shareRight.categorized_case_type_ids.some(x => x === formValues.caseTypeId) && shareRight.from_data_collection_id === formValues.fromDataCollectionId;\n });\n\n return {\n add_case: effectiveRight?.add_case || shareCaseRight?.add_case,\n add_case_set: effectiveRight?.add_case_set || shareCaseRight?.add_case_set,\n has_share_case_rights: effectiveRight?.effective_share_case_rights.length > 0,\n read_case_set: effectiveRight?.read_case_set,\n read_col_ids: effectiveRight?.categorized_read_col_ids,\n remove_case: effectiveRight?.remove_case || shareCaseRight?.remove_case,\n remove_case_set: effectiveRight?.remove_case_set || shareCaseRight?.remove_case_set,\n write_case_set: effectiveRight?.write_case_set,\n write_col_ids: effectiveRight?.categorized_write_col_ids,\n } satisfies Result;\n }, [effectiveRights, formValues.caseTypeId, formValues.dataCollectionId, formValues.fromDataCollectionId]);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Case type`,\n loading: caseTypeOptionsQuery.isLoading,\n name: 'caseTypeId',\n options: caseTypeOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Data collection`,\n loading: dataCollectionOptionsQuery.isLoading,\n name: 'dataCollectionId',\n options: dataCollectionOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n disabled: !result?.has_share_case_rights,\n label: t`From data collection`,\n loading: dataCollectionOptionsQuery.isLoading,\n name: 'fromDataCollectionId',\n options: dataCollectionOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [caseTypeOptionsQuery.isLoading, caseTypeOptionsQuery.options, dataCollectionOptionsQuery.isLoading, dataCollectionOptionsQuery.options, result?.has_share_case_rights, t]);\n\n\n return (\n <PageContainer\n fullWidth\n showBreadcrumbs\n testIdAttributes={TestIdUtil.createAttributes('UserEffectiveRightsTesterAdminPage')}\n title={t`Users effective rights`}\n >\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n }}\n >\n <ResponseHandler\n inlineSpinner\n loadables={loadables}\n >\n <Container maxWidth={'md'}>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography\n component={'h2'}\n variant={'h4'}\n >\n {t('Testing effective rights for user: {{userEmail}}', { userEmail: userQuery.data?.email })}\n </Typography>\n <Typography>\n {t('Organization: {{organizationName}}', { organizationName: organizationMapQuery.map.get(userQuery.data?.organization_id)?.name })}\n </Typography>\n <Typography>\n {t('Roles: {{roles}}', { roles: userQuery.data?.roles.join(', ') })}\n </Typography>\n </Box>\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(noop)}\n schema={schema}\n />\n {result !== null && typeof result === 'object' && (\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography variant={'h6'}>\n {t('Effective rights result:')}\n </Typography>\n {!formValues.fromDataCollectionId && result.has_share_case_rights && (\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography\n sx={{\n fontStyle: 'italic',\n }}\n >\n {t`Note: The user has share case rights that may affect the result when a 'From data collection' is selected.`}\n </Typography>\n </Box>\n )}\n <Typography>\n {t('Add case: {{addCase}}', { addCase: result?.add_case ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Remove case: {{removeCase}}', { removeCase: result?.remove_case ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Add case set: {{addCaseSet}}', { addCaseSet: result?.add_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Remove case set: {{removeCaseSet}}', { removeCaseSet: result?.remove_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Read case set: {{readCaseSet}}', { readCaseSet: result?.read_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Write case set: {{writeCaseSet}}', { writeCaseSet: result?.write_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Read case properties: {{readSomeProperties}}', { readSomeProperties: result?.read_col_ids?.length > 0 ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Write case properties: {{writeSomeProperties}}', { writeSomeProperties: result?.write_col_ids?.length > 0 ? t`Yes` : t`No` })}\n </Typography>\n\n </Box>\n )}\n </Container>\n </ResponseHandler>\n </Box>\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAiEa,UAA2C;CACtD,IAAM,EAAE,SAAM,EAAe,GACvB,IAAS,EAAM,GAEf,EAAE,cAAW,EAAU,GAEvB,IAAY,EAAyB;EACzC,cAAc,EAAiB;EAC/B,QAAQ;EACR,iBAAiB,EACf,SAAS,OAAO,EAAE,iBAET,MADgB,EAAsB,YAAY,CAAC,CAAC,YAAY,GAAQ,EAAE,UAAO,CAAC,EAAA,CACzE,KAEpB;CACF,CAAC,GAEK,IAAqB,EAAsB,GAC3C,IAAuB,EAAwB,GAC/C,IAAuB,EAAwB,GAC/C,IAA0B,EAA2B,GACrD,IAA6B,EAA8B,GAC3D,IAAsC,GAAuC,MAAY,EAAS,QAAO,MAAU,EAAO,aAAa,EAAO,oBAAoB,EAAU,MAAM,eAAe,CAAC,GAClM,IAAqC,GAAsC,MAAY,EAAS,QAAO,MAAU,EAAO,aAAa,EAAO,oBAAoB,EAAU,MAAM,eAAe,CAAC,GAChM,IAA8B,GAA+B,MAAY,EAAS,QAAO,MAAU,EAAO,aAAa,EAAO,YAAY,EAAU,MAAM,EAAE,CAAC,GAC7J,IAA6B,GAA8B,MAAY,EAAS,QAAO,MAAU,EAAO,aAAa,EAAO,YAAY,EAAU,MAAM,EAAE,CAAC,GAE3J,IAAY,EAAS;EACzB;EACA;EACA;EAC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ACZ,kBAAC,GAAD,EAAA,UACG,EAAE,gDAAgD,EAAE,oBAAoB,GAAQ,cAAc,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAClH,CAAA;QACZ,kBAAC,GAAD,EAAA,UACG,EAAE,kDAAkD,EAAE,qBAAqB,GAAQ,eAAe,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACtH,CAAA;OAET;;KAEE;;GACI,CAAA;EACd,CAAA;CACQ,CAAA;AAEnB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/UserEffectiveRightsTesterAdminPage/UserEffectiveRightsTesterAdminPage.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next';\nimport {\n Box,\n Container,\n Typography,\n} from '@mui/material';\nimport {\n useId,\n useMemo,\n} from 'react';\nimport { useParams } from 'react-router-dom';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport {\n useForm,\n useWatch,\n} from 'react-hook-form';\nimport {\n object,\n string,\n} from 'yup';\nimport noop from 'lodash/noop';\nimport type { CaseDbUser } from '@gen-epix/api-casedb';\nimport { CaseDbOrganizationApi } from '@gen-epix/api-casedb';\nimport { COMMON_QUERY_KEY } from '@gen-epix/ui-client-common/constants/query';\nimport { PageContainer } from '@gen-epix/ui-client-common/components/ui/PageContainer';\nimport { ResponseHandler } from '@gen-epix/ui-client-common/components/ui/ResponseHandler';\nimport { useItemQuery } from '@gen-epix/ui-client-common/hooks/useItemQuery';\nimport { useOrganizationMapQuery } from '@gen-epix/ui-client-common/dataHooks/useOrganizationsQuery';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\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';\n\nimport { useColSetMembersQuery } from '../../dataHooks/useColSetMembersQuery';\nimport { useCaseTypeSetMembersQuery } from '../../dataHooks/useCaseTypeSetMembersQuery';\nimport { useDataCollectionOptionsQuery } from '../../dataHooks/useDataCollectionsQuery';\nimport { useOrganizationAccessCasePoliciesQuery } from '../../dataHooks/useOrganizationAccessCasePoliciesQuery';\nimport { useOrganizationShareCasePoliciesQuery } from '../../dataHooks/useOrganizationShareCasePoliciesQuery';\nimport { useUserAccessCasePoliciesQuery } from '../../dataHooks/useUserAccessCasePoliciesQuery';\nimport { useUserShareCasePoliciesQuery } from '../../dataHooks/useUserShareCasePoliciesQuery';\nimport { useCaseTypeOptionsQuery } from '../../dataHooks/useCaseTypesQuery';\nimport type { UserEffectiveRight } from '../../models/caseAccess';\nimport { EffectiveRightsUtil } from '../../utils/EffectiveRightsUtil';\n\n\ntype FormFields = {\n caseTypeId: string;\n dataCollectionId: string;\n fromDataCollectionId: string;\n};\n\ntype Result = {\n add_case: boolean;\n add_case_set: boolean;\n has_share_case_rights?: boolean;\n read_case_set: boolean;\n read_col_ids: string[];\n remove_case: boolean;\n remove_case_set: boolean;\n write_case_set: boolean;\n write_col_ids: string[];\n};\n\nexport const UserEffectiveRightsTesterAdminPage = () => {\n const { t } = useTranslation();\n const formId = useId();\n\n const { userId } = useParams();\n\n const userQuery = useItemQuery<CaseDbUser>({\n baseQueryKey: COMMON_QUERY_KEY.USERS,\n itemId: userId,\n useQueryOptions: {\n queryFn: async ({ signal }) => {\n const response = await CaseDbOrganizationApi.getInstance().usersGetOne(userId, { signal });\n return response.data;\n },\n },\n });\n\n const colSetMembersQuery = useColSetMembersQuery();\n const caseTypeOptionsQuery = useCaseTypeOptionsQuery();\n const organizationMapQuery = useOrganizationMapQuery();\n const caseTypeSetMembersQuery = useCaseTypeSetMembersQuery();\n const dataCollectionOptionsQuery = useDataCollectionOptionsQuery();\n const organizationAccessCasePoliciesQuery = useOrganizationAccessCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.organization_id === userQuery.data?.organization_id));\n const organizationShareCasePoliciesQuery = useOrganizationShareCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.organization_id === userQuery.data?.organization_id));\n const userAccessCasePoliciesQuery = useUserAccessCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.user_id === userQuery.data?.id));\n const userShareCasePoliciesQuery = useUserShareCasePoliciesQuery(policies => policies.filter(policy => policy.is_active && policy.user_id === userQuery.data?.id));\n\n const loadables = useArray([\n userQuery,\n colSetMembersQuery,\n caseTypeOptionsQuery,\n caseTypeSetMembersQuery,\n dataCollectionOptionsQuery,\n organizationAccessCasePoliciesQuery,\n organizationShareCasePoliciesQuery,\n userAccessCasePoliciesQuery,\n userShareCasePoliciesQuery,\n organizationMapQuery,\n ]);\n\n\n const effectiveRights = useMemo<UserEffectiveRight[]>(() => {\n const { data: organizationAccessCasePolicies } = organizationAccessCasePoliciesQuery;\n const { data: organizationShareCasePolicies } = organizationShareCasePoliciesQuery;\n const { data: userAccessCasePolicies } = userAccessCasePoliciesQuery;\n const { data: userShareCasePolicies } = userShareCasePoliciesQuery;\n const { data: caseTypeSetMembers } = caseTypeSetMembersQuery;\n const { data: colSetMembers } = colSetMembersQuery;\n\n return EffectiveRightsUtil.assembleUserEffectiveRights({\n caseTypeSetMembers,\n colSetMembers,\n organizationAccessCasePolicies,\n organizationShareCasePolicies,\n user: userQuery.data,\n userAccessCasePolicies,\n userShareCasePolicies,\n });\n\n }, [colSetMembersQuery, caseTypeSetMembersQuery, organizationAccessCasePoliciesQuery, organizationShareCasePoliciesQuery, userAccessCasePoliciesQuery, userQuery.data, userShareCasePoliciesQuery]);\n\n const schema = useMemo(() => object<FormFields>().shape({\n caseTypeId: string().uuid4().required(),\n dataCollectionId: string().uuid4().required(),\n fromDataCollectionId: string().uuid4().nullable().notRequired(),\n }), []);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema) as unknown as Resolver<FormFields>,\n values: {\n caseTypeId: null,\n dataCollectionId: null,\n fromDataCollectionId: null,\n },\n });\n const { control, handleSubmit } = formMethods;\n const formValues = useWatch({ control });\n\n const result = useMemo<Result>(() => {\n if (!formValues.caseTypeId || !formValues.dataCollectionId) {\n return null;\n }\n const effectiveRight = effectiveRights.find(right => {\n return right.data_collection_id === formValues.dataCollectionId && right.categorized_case_type_ids.some(x => x === formValues.caseTypeId);\n });\n\n const shareCaseRight = formValues.fromDataCollectionId && effectiveRight?.effective_share_case_rights?.find(shareRight => {\n return shareRight.categorized_case_type_ids.some(x => x === formValues.caseTypeId) && shareRight.from_data_collection_id === formValues.fromDataCollectionId;\n });\n\n return {\n add_case: effectiveRight?.add_case || shareCaseRight?.add_case,\n add_case_set: effectiveRight?.add_case_set || shareCaseRight?.add_case_set,\n has_share_case_rights: effectiveRight?.effective_share_case_rights.length > 0,\n read_case_set: effectiveRight?.read_case_set,\n read_col_ids: effectiveRight?.categorized_read_col_ids,\n remove_case: effectiveRight?.remove_case || shareCaseRight?.remove_case,\n remove_case_set: effectiveRight?.remove_case_set || shareCaseRight?.remove_case_set,\n write_case_set: effectiveRight?.write_case_set,\n write_col_ids: effectiveRight?.categorized_write_col_ids,\n } satisfies Result;\n }, [effectiveRights, formValues.caseTypeId, formValues.dataCollectionId, formValues.fromDataCollectionId]);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Case type`,\n loading: caseTypeOptionsQuery.isLoading,\n name: 'caseTypeId',\n options: caseTypeOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Data collection`,\n loading: dataCollectionOptionsQuery.isLoading,\n name: 'dataCollectionId',\n options: dataCollectionOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n disabled: !result?.has_share_case_rights,\n label: t`From data collection`,\n loading: dataCollectionOptionsQuery.isLoading,\n name: 'fromDataCollectionId',\n options: dataCollectionOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [caseTypeOptionsQuery.isLoading, caseTypeOptionsQuery.options, dataCollectionOptionsQuery.isLoading, dataCollectionOptionsQuery.options, result?.has_share_case_rights, t]);\n\n\n return (\n <PageContainer\n fullWidth\n showBreadcrumbs\n testIdAttributes={TestIdUtil.createAttributes('UserEffectiveRightsTesterAdminPage')}\n title={t`Users effective rights`}\n >\n <Box\n sx={{\n height: '100%',\n position: 'relative',\n }}\n >\n <ResponseHandler\n inlineSpinner\n loadables={loadables}\n >\n <Container maxWidth={'md'}>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography\n component={'h2'}\n variant={'h4'}\n >\n {t('Testing effective rights for user: {{userEmail}}', { userEmail: userQuery.data?.email })}\n </Typography>\n <Typography>\n {t('Organization: {{organizationName}}', { organizationName: organizationMapQuery.map.get(userQuery.data?.organization_id)?.name })}\n </Typography>\n <Typography>\n {t('Roles: {{roles}}', { roles: userQuery.data?.roles.join(', ') })}\n </Typography>\n </Box>\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(noop)}\n schema={schema}\n />\n {result !== null && typeof result === 'object' && (\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography variant={'h6'}>\n {t('Effective rights result:')}\n </Typography>\n {!formValues.fromDataCollectionId && result.has_share_case_rights && (\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography\n sx={{\n fontStyle: 'italic',\n }}\n >\n {t`Note: The user has share case rights that may affect the result when a 'From data collection' is selected.`}\n </Typography>\n </Box>\n )}\n <Typography>\n {t('Add case: {{addCase}}', { addCase: result?.add_case ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Remove case: {{removeCase}}', { removeCase: result?.remove_case ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Add case set: {{addCaseSet}}', { addCaseSet: result?.add_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Remove case set: {{removeCaseSet}}', { removeCaseSet: result?.remove_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Read case set: {{readCaseSet}}', { readCaseSet: result?.read_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Write case set: {{writeCaseSet}}', { writeCaseSet: result?.write_case_set ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Read case properties: {{readSomeProperties}}', { readSomeProperties: result?.read_col_ids?.length > 0 ? t`Yes` : t`No` })}\n </Typography>\n <Typography>\n {t('Write case properties: {{writeSomeProperties}}', { writeSomeProperties: result?.write_col_ids?.length > 0 ? t`Yes` : t`No` })}\n </Typography>\n\n </Box>\n )}\n </Container>\n </ResponseHandler>\n </Box>\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAiEa,UAA2C;CACtD,IAAM,EAAE,SAAM,EAAe,GACvB,IAAS,GAAM,GAEf,EAAE,cAAW,EAAU,GAEvB,IAAY,EAAyB;EACzC,cAAc,EAAiB;EAC/B,QAAQ;EACR,iBAAiB,EACf,SAAS,OAAO,EAAE,iBAET,MADgB,EAAsB,YAAY,CAAC,CAAC,YAAY,GAAQ,EAAE,UAAO,CAAC,EAAA,CACzE,KAEpB;CACF,CAAC,GAEK,IAAqB,EAAsB,GAC3C,IAAuB,EAAwB,GAC/C,IAAuB,EAAwB,GAC/C,IAA0B,EAA2B,GACrD,IAA6B,EAA8B,GAC3D,IAAsC,GAAuC,MAAY,EAAS,QAAO,MAAU,EAAO,aAAa,EAAO,oBAAoB,EAAU,MAAM,eAAe,CAAC,GAClM,IAAqC,GAAsC,MAAY,EAAS,QAAO,MAAU,EAAO,aAAa,EAAO,oBAAoB,EAAU,MAAM,eAAe,CAAC,GAChM,IAA8B,GAA+B,MAAY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E,kCAAkC,EAAE,aAAa,GAAQ,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAClF,CAAA;QACZ,kBAAC,GAAD,EAAA,UACG,EAAE,oCAAoC,EAAE,cAAc,GAAQ,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,EACtF,CAAA;QACZ,kBAAC,GAAD,EAAA,UACG,EAAE,gDAAgD,EAAE,oBAAoB,GAAQ,cAAc,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAClH,CAAA;QACZ,kBAAC,GAAD,EAAA,UACG,EAAE,kDAAkD,EAAE,qBAAqB,GAAQ,eAAe,SAAS,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EACtH,CAAA;OAET;;KAEE;;GACI,CAAA;EACd,CAAA;CACQ,CAAA;AAEnB"}
@@ -100,6 +100,7 @@ export declare class UploadUtil {
100
100
  signal: AbortSignal;
101
101
  startPercentage: number;
102
102
  }): Promise<void>;
103
+ private static getFileCompressionFromFileName;
103
104
  private static idToRegex;
104
105
  private static mapExcelCellToString;
105
106
  private static mapExcelSheetData;
package/package.json CHANGED
@@ -1,20 +1,14 @@
1
1
  {
2
2
  "name": "@gen-epix/ui-client-casedb",
3
- "version": "4.0.2",
4
- "license": "EUPL-1.2",
3
+ "version": "4.2.0",
4
+ "homepage": "https://github.com/RIVM-bioinformatics/gen-epix",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/RIVM-bioinformatics/gen-epix-ui.git"
8
8
  },
9
+ "license": "EUPL-1.2",
9
10
  "author": "RIVM-bioinformatics <ids-bioinformatics@rivm.nl>",
10
- "homepage": "https://github.com/RIVM-bioinformatics/gen-epix",
11
11
  "type": "module",
12
- "files": [
13
- "dist"
14
- ],
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
12
  "exports": {
19
13
  "./types": {
20
14
  "types": "./dist/@types/ui-client-casedb.d.ts",
@@ -120,10 +114,6 @@
120
114
  "types": "./dist/components/ui/EpiCurveWidget/index.d.ts",
121
115
  "import": "./dist/components/ui/EpiCurveWidget/index.js"
122
116
  },
123
- "./components/ui/FileSelector": {
124
- "types": "./dist/components/ui/FileSelector/index.d.ts",
125
- "import": "./dist/components/ui/FileSelector/index.js"
126
- },
127
117
  "./components/ui/FindSimilarCasesDialog": {
128
118
  "types": "./dist/components/ui/FindSimilarCasesDialog/index.d.ts",
129
119
  "import": "./dist/components/ui/FindSimilarCasesDialog/index.js"
@@ -648,10 +638,6 @@
648
638
  "types": "./dist/utils/EpiCurveUtil/index.d.ts",
649
639
  "import": "./dist/utils/EpiCurveUtil/index.js"
650
640
  },
651
- "./utils/FileUtil": {
652
- "types": "./dist/utils/FileUtil/index.d.ts",
653
- "import": "./dist/utils/FileUtil/index.js"
654
- },
655
641
  "./utils/FilterUtil": {
656
642
  "types": "./dist/utils/FilterUtil/index.d.ts",
657
643
  "import": "./dist/utils/FilterUtil/index.js"
@@ -681,30 +667,12 @@
681
667
  "import": "./dist/utils/UploadUtil/index.js"
682
668
  }
683
669
  },
684
- "peerDependencies": {
685
- "@emotion/cache": "*",
686
- "@emotion/react": "*",
687
- "@emotion/styled": "*",
688
- "@gen-epix/api-casedb": "^4.0.0",
689
- "@gen-epix/api-commondb": "^4.0.0",
690
- "@gen-epix/ui-core": "^3.0.2",
691
- "@gen-epix/ui-core-components": "^4.0.2",
692
- "@gen-epix/ui-client-common": "^4.0.2",
693
- "@gen-epix/ui-phylogenetic-tree": "^3.0.2",
694
- "@gen-epix/ui-core-form": "^4.0.2",
695
- "@mui/icons-material": "*",
696
- "@mui/material": "*",
697
- "@mui/styled-engine": "*",
698
- "@mui/system": "*",
699
- "@mui/utils": "*",
700
- "@mui/x-date-pickers": "*",
701
- "axios": "*",
702
- "i18next": "*",
703
- "react": "*",
704
- "react-dom": "*",
705
- "react-i18next": "*",
706
- "yup": "*"
707
- },
670
+ "files": [
671
+ "dist"
672
+ ],
673
+ "browserslist": [
674
+ "last 2 Chrome versions"
675
+ ],
708
676
  "dependencies": {
709
677
  "@hookform/resolvers": "5.9.1",
710
678
  "@tanstack/react-query": "5.102.8",
@@ -717,12 +685,11 @@
717
685
  "fuse.js": "7.5.0",
718
686
  "immer": "11.1.18",
719
687
  "lodash": "4.18.1",
720
- "react-error-boundary": "6.1.4",
721
- "react-hook-form": "7.87.0",
722
- "react-resizable-panels": "4.12.3",
723
- "react-router-dom": "7.18.3",
688
+ "react-error-boundary": "6.1.5",
689
+ "react-resizable-panels": "4.12.4",
724
690
  "react-router": "8.3.1",
725
- "react-virtuoso": "4.18.12",
691
+ "react-router-dom": "7.18.3",
692
+ "react-virtuoso": "4.18.13",
726
693
  "read-excel-file": "9.3.10",
727
694
  "use-debounce": "10.1.1",
728
695
  "write-excel-file": "4.1.1",
@@ -732,61 +699,87 @@
732
699
  "@emotion/cache": "11.14.0",
733
700
  "@emotion/react": "11.14.0",
734
701
  "@emotion/styled": "11.14.1",
735
- "@gen-epix/api-casedb": "^4.0.0",
736
- "@gen-epix/api-commondb": "^4.0.0",
737
- "@gen-epix/ui-core": "^3.0.2",
738
- "@gen-epix/ui-core-components": "^4.0.2",
739
- "@gen-epix/ui-phylogenetic-tree": "^3.0.2",
740
- "@gen-epix/ui-core-form": "^4.0.2",
702
+ "@gen-epix/api-casedb": "^4.2.0",
703
+ "@gen-epix/api-commondb": "^4.2.0",
741
704
  "@gen-epix/eslint-config": "0.5.0",
742
705
  "@gen-epix/translation-util": "0.2.0",
743
- "@gen-epix/ui-client-common": "^4.0.2",
706
+ "@gen-epix/ui-client-common": "^4.2.0",
707
+ "@gen-epix/ui-core": "^3.2.0",
708
+ "@gen-epix/ui-core-components": "^4.2.0",
709
+ "@gen-epix/ui-core-form": "^4.2.0",
710
+ "@gen-epix/ui-phylogenetic-tree": "^3.2.0",
744
711
  "@hookform/resolvers": "5.9.1",
712
+ "@microsoft/api-extractor": "7.59.1",
745
713
  "@mui/icons-material": "9.4.0",
746
714
  "@mui/material": "9.4.0",
747
715
  "@mui/styled-engine": "9.4.0",
748
716
  "@mui/system": "9.4.0",
749
717
  "@mui/utils": "9.4.0",
750
- "@mui/x-date-pickers": "9.12.0",
718
+ "@mui/x-date-pickers": "9.13.0",
751
719
  "@types/lodash": "4.17.25",
752
720
  "@types/node": "26.4.1",
753
- "@types/react": "19.2.18",
721
+ "@types/react": "19.3.0",
754
722
  "@vitejs/plugin-react": "6.1.1",
755
- "@vitest/browser-playwright": "4.1.11",
756
- "@vitest/coverage-v8": "4.1.11",
723
+ "@vitest/browser-playwright": "5.0.0",
724
+ "@vitest/coverage-v8": "5.0.0",
757
725
  "axios": "1.20.0",
758
- "eslint": "10.9.1",
759
- "i18next": "26.4.1",
726
+ "eslint": "10.10.0",
727
+ "i18next": "26.4.2",
760
728
  "jsdom": "30.0.1",
761
- "playwright": "1.62.1",
762
- "react": "19.2.8",
763
- "react-dom": "19.2.8",
729
+ "playwright": "1.63.0",
730
+ "react": "19.3.0",
731
+ "react-dom": "19.3.0",
732
+ "react-hook-form": "7.87.0",
764
733
  "react-i18next": "17.0.13",
765
- "@microsoft/api-extractor": "7.59.0",
766
734
  "typescript": "6.0.3",
767
735
  "vite": "8.2.2",
768
736
  "vite-plugin-dts": "5.1.0",
769
737
  "vite-plugin-lib-inject-css": "2.2.2",
770
738
  "vite-plugin-static-copy": "4.1.1",
771
739
  "vite-plugin-svgr": "5.2.0",
772
- "vitest": "4.1.11",
773
- "vitest-browser-react": "2.2.0",
740
+ "vitest": "5.0.0",
741
+ "vitest-browser-react": "2.3.0",
774
742
  "yup": "1.7.1"
775
743
  },
776
- "browserslist": [
777
- "last 2 Chrome versions"
778
- ],
744
+ "peerDependencies": {
745
+ "@emotion/cache": "*",
746
+ "@emotion/react": "*",
747
+ "@emotion/styled": "*",
748
+ "@gen-epix/api-casedb": "^4.2.0",
749
+ "@gen-epix/api-commondb": "^4.2.0",
750
+ "@gen-epix/ui-client-common": "^4.2.0",
751
+ "@gen-epix/ui-core": "^3.2.0",
752
+ "@gen-epix/ui-core-components": "^4.2.0",
753
+ "@gen-epix/ui-core-form": "^4.2.0",
754
+ "@gen-epix/ui-phylogenetic-tree": "^3.2.0",
755
+ "@mui/icons-material": "*",
756
+ "@mui/material": "*",
757
+ "@mui/styled-engine": "*",
758
+ "@mui/system": "*",
759
+ "@mui/utils": "*",
760
+ "@mui/x-date-pickers": "*",
761
+ "axios": "*",
762
+ "i18next": "*",
763
+ "react": "*",
764
+ "react-dom": "*",
765
+ "react-hook-form": "*",
766
+ "react-i18next": "*",
767
+ "yup": "*"
768
+ },
769
+ "publishConfig": {
770
+ "access": "public"
771
+ },
779
772
  "scripts": {
780
- "update-exports": "node scripts/update-exports.js",
773
+ "add-missing-translations": "translation-util ./",
781
774
  "build": "vite build",
782
775
  "build-publish": "pnpm build && pnpm publish --access=public",
783
- "test-missing-translations": "translation-util ./ --dry-run --fail-on-missing --fail-on-stale",
784
- "add-missing-translations": "translation-util ./",
785
- "validate": "pnpm run lint && pnpm run check-types && pnpm run test-run && pnpm run test-missing-translations",
786
- "test": "vitest --coverage",
787
- "test-run": "vitest run --passWithNoTests --coverage",
776
+ "check-types": "tsc --noemit",
788
777
  "lint": "eslint ./src --report-unused-disable-directives --max-warnings 0",
789
778
  "lint-fix": "eslint ./src --report-unused-disable-directives --max-warnings 0 --fix",
790
- "check-types": "tsc --noemit"
779
+ "test": "vitest --coverage",
780
+ "test-missing-translations": "translation-util ./ --dry-run --fail-on-missing --fail-on-stale",
781
+ "test-run": "vitest run --passWithNoTests --coverage",
782
+ "update-exports": "node scripts/update-exports.js",
783
+ "validate": "pnpm run lint && pnpm run check-types && pnpm run test-run && pnpm run test-missing-translations"
791
784
  }
792
785
  }