@gen-epix/ui-client-casedb 4.2.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 (32) hide show
  1. package/dist/_chunks/CaseInfoDialog.js +40 -39
  2. package/dist/_chunks/CaseInfoDialog.js.map +1 -1
  3. package/dist/_chunks/Dashboard.js +285 -286
  4. package/dist/_chunks/Dashboard.js.map +1 -1
  5. package/dist/_chunks/LineListWidget.js +138 -136
  6. package/dist/_chunks/LineListWidget.js.map +1 -1
  7. package/dist/_chunks/{chunk-BV7QT456.js → chunk-OB3PAWPO.js} +3 -3
  8. package/dist/_chunks/chunk-OB3PAWPO.js.map +1 -0
  9. package/dist/_chunks/yup.js +2 -2
  10. package/dist/_chunks/yup.js.map +1 -1
  11. package/dist/components/ui/HistogramWidget/index.js +161 -162
  12. package/dist/components/ui/HistogramWidget/index.js.map +1 -1
  13. package/dist/locale/en.json +6 -0
  14. package/dist/locale/nl.json +7 -1
  15. package/dist/pages/CasesDetailPage/index.js +1 -1
  16. package/dist/pages/ColsAdminPage/index.js +1 -1
  17. package/dist/pages/ConceptsAdminPage/index.js +1 -1
  18. package/dist/pages/DimsAdminPage/index.js +1 -1
  19. package/dist/pages/EventsDetailPage/index.js +1 -1
  20. package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js +120 -86
  21. package/dist/pages/OrganizationAccessCasePoliciesAdminPage/index.js.map +1 -1
  22. package/dist/pages/RefColsAdminPage/index.js +1 -1
  23. package/dist/pages/RegionSetShapesAdminPage/index.js +1 -1
  24. package/dist/pages/RegionsAdminPage/index.js +1 -1
  25. package/dist/pages/UserEffectiveRightsAdminPage/index.js +1 -1
  26. package/dist/pages/UserEffectiveRightsTesterAdminPage/index.js +1 -1
  27. package/dist/routes/index.js +93 -91
  28. package/dist/routes/index.js.map +1 -1
  29. package/dist/setup/setup.js +2 -3
  30. package/dist/setup/setup.js.map +1 -1
  31. package/package.json +26 -26
  32. package/dist/_chunks/chunk-BV7QT456.js.map +0 -1
@@ -46,7 +46,9 @@
46
46
  "Add {{numCases}} selected case(s) to an existing event": "Add {{numCases}} selected case(s) to an existing event",
47
47
  "Add a widget": "Add a widget",
48
48
  "Add case": "Add case",
49
+ "Add case must be enabled for private policies": "Add case must be enabled for private policies",
49
50
  "Add case set": "Add case set",
51
+ "Add case set must be enabled for private policies": "Add case set must be enabled for private policies",
50
52
  "Add case set: {{addCaseSet}}": "Add case set: {{addCaseSet}}",
51
53
  "Add case: {{addCase}}": "Add case: {{addCase}}",
52
54
  "Add selected cases to an existing event": "Add selected cases to an existing event",
@@ -437,6 +439,7 @@
437
439
  "Read case set": "Read case set",
438
440
  "Read case set: {{readCaseSet}}": "Read case set: {{readCaseSet}}",
439
441
  "Read column set": "Read column set",
442
+ "Read column set is required for private policies": "Read column set is required for private policies",
440
443
  "Read column sets": "Read column sets",
441
444
  "Read max number of cases": "Read max number of cases",
442
445
  "Read max tree size": "Read max tree size",
@@ -467,7 +470,9 @@
467
470
  "Remove": "Remove",
468
471
  "Remove all similar cases from result": "Remove all similar cases from result",
469
472
  "Remove case": "Remove case",
473
+ "Remove case must be enabled for private policies": "Remove case must be enabled for private policies",
470
474
  "Remove case set": "Remove case set",
475
+ "Remove case set must be enabled for private policies": "Remove case set must be enabled for private policies",
471
476
  "Remove case set: {{removeCaseSet}}": "Remove case set: {{removeCaseSet}}",
472
477
  "Remove case: {{removeCase}}": "Remove case: {{removeCase}}",
473
478
  "Remove from selected rows": "Remove from selected rows",
@@ -651,6 +656,7 @@
651
656
  "Write case set": "Write case set",
652
657
  "Write case set: {{writeCaseSet}}": "Write case set: {{writeCaseSet}}",
653
658
  "Write column set": "Write column set",
659
+ "Write column set is required for private policies": "Write column set is required for private policies",
654
660
  "Write column sets": "Write column sets",
655
661
  "X-Axis: {{label}}": "X-Axis: {{label}}",
656
662
  "Yes": "Yes",
@@ -46,7 +46,9 @@
46
46
  "Add {{numCases}} selected case(s) to an existing event": "Voeg {{numCases}} geselecteerde casus(sen) toe aan een bestaande event",
47
47
  "Add a widget": "Widget toevoegen",
48
48
  "Add case": "Casus toevoegen",
49
+ "Add case must be enabled for private policies": "Casus toevoegen moet zijn ingeschakeld voor privébeleidsregels",
49
50
  "Add case set": "Casus set toevoegen",
51
+ "Add case set must be enabled for private policies": "Casus set toevoegen moet zijn ingeschakeld voor privébeleidsregels",
50
52
  "Add case set: {{addCaseSet}}": "Voeg casus set toe: {{addCaseSet}}",
51
53
  "Add case: {{addCase}}": "Voeg casus toe: {{addCase}}",
52
54
  "Add selected cases to an existing event": "Geselecteerde casussen toevoegen aan een bestaande event",
@@ -437,6 +439,7 @@
437
439
  "Read case set": "Lees casus set",
438
440
  "Read case set: {{readCaseSet}}": "Lees casus set: {{readCaseSet}}",
439
441
  "Read column set": "Lees kolom set",
442
+ "Read column set is required for private policies": "Lees kolom set is verplicht voor privébeleidsregels",
440
443
  "Read column sets": "Lees kolom sets",
441
444
  "Read max number of cases": "Lees max aantal casussen",
442
445
  "Read max tree size": "Lees max boom grootte",
@@ -467,7 +470,9 @@
467
470
  "Remove": "Verwijderen",
468
471
  "Remove all similar cases from result": "Alle vergelijkbare casussen uit resultaat verwijderen",
469
472
  "Remove case": "Casus verwijderen",
473
+ "Remove case must be enabled for private policies": "Casus verwijderen moet zijn ingeschakeld voor privébeleidsregels",
470
474
  "Remove case set": "Casus set verwijderen",
475
+ "Remove case set must be enabled for private policies": "Casus set verwijderen moet zijn ingeschakeld voor privébeleidsregels",
471
476
  "Remove case set: {{removeCaseSet}}": "Verwijder casus set: {{removeCaseSet}}",
472
477
  "Remove case: {{removeCase}}": "Verwijder casus: {{removeCase}}",
473
478
  "Remove from selected rows": "Verwijderen uit geselecteerde rijen",
@@ -651,6 +656,7 @@
651
656
  "Write case set": "Schrijf casus set",
652
657
  "Write case set: {{writeCaseSet}}": "Schrijf casus set: {{writeCaseSet}}",
653
658
  "Write column set": "Schrijf kolom set",
659
+ "Write column set is required for private policies": "Schrijf kolom set is verplicht voor privébeleidsregels",
654
660
  "Write column sets": "Schrijf kolom sets",
655
661
  "X-Axis: {{label}}": "X-as: {{label}}",
656
662
  "Yes": "Ja",
@@ -662,4 +668,4 @@
662
668
  "You do not have the required permissions to create an event. Contact your organization administrator for assistance.": "U heeft niet de vereiste rechten om een event aan te maken. Neem contact op met uw organisatiebeheerder voor hulp.",
663
669
  "You have exceeded the maximum number of {{maxCases}} cases for this case type. Please reduce the number of selected cases before proceeding.": "U heeft het maximale aantal van {{maxCases}} casussen voor dit casus type overschreden. Verminder het aantal geselecteerde casussen voordat u doorgaat."
664
670
  }
665
- }
671
+ }
@@ -1,6 +1,6 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
2
  import { n as t } from "../../_chunks/Dashboard.js";
3
- import { t as n } from "../../_chunks/chunk-BV7QT456.js";
3
+ import { t as n } from "../../_chunks/chunk-OB3PAWPO.js";
4
4
  import { CaseDbCaseApi as r } from "@gen-epix/api-casedb";
5
5
  import { useEffect as i, useMemo as a } from "react";
6
6
  import { useTranslation as o } from "react-i18next";
@@ -3,7 +3,7 @@ import { CaseDbDataUtil as t } from "../../utils/CaseDbDataUtil/index.js";
3
3
  import { useCaseTypeMapQuery as n, useCaseTypeOptionsQuery as r } from "../../dataHooks/useCaseTypesQuery/index.js";
4
4
  import { useDimMapQuery as i, useDimOptionsQuery as a } from "../../dataHooks/useDimsQuery/index.js";
5
5
  import { useColMapQuery as o, useColOptionsQuery as s } from "../../dataHooks/useColsQuery/index.js";
6
- import { t as ee } from "../../_chunks/chunk-BV7QT456.js";
6
+ import { t as ee } from "../../_chunks/chunk-OB3PAWPO.js";
7
7
  import { useRefColMapQuery as c, useRefColOptionsQuery as l } from "../../dataHooks/useRefColsQuery/index.js";
8
8
  import { useTreeAlgorithmCodeOptionsQuery as u } from "../../dataHooks/useTreeAlgorithmCodesQuery/index.js";
9
9
  import { useRefColsValidationRulesQuery as d } from "../../dataHooks/useRefColsValidationRulesQuery/index.js";
@@ -1,5 +1,5 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
- import { t } from "../../_chunks/chunk-BV7QT456.js";
2
+ import { t } from "../../_chunks/chunk-OB3PAWPO.js";
3
3
  import { object as n } from "yup";
4
4
  import { CaseDbCommandName as r, CaseDbOntologyApi as i } from "@gen-epix/api-casedb";
5
5
  import { FORM_FIELD_DEFINITION_TYPE as a } from "@gen-epix/ui-core-form/models/form";
@@ -1,6 +1,6 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
2
  import { useCaseTypeMapQuery as t, useCaseTypeOptionsQuery as n } from "../../dataHooks/useCaseTypesQuery/index.js";
3
- import { t as r } from "../../_chunks/chunk-BV7QT456.js";
3
+ import { t as r } from "../../_chunks/chunk-OB3PAWPO.js";
4
4
  import { useRefDimOptionsQuery as i } from "../../dataHooks/useRefDimsQuery/index.js";
5
5
  import { boolean as a, object as o, string as s } from "yup";
6
6
  import { CaseDbCaseApi as c, CaseDbCommandName as l, CaseDbPermissionType as u } from "@gen-epix/api-casedb";
@@ -1,7 +1,7 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
2
  import { useCaseTypeMapQuery as t } from "../../dataHooks/useCaseTypesQuery/index.js";
3
3
  import { n } from "../../_chunks/Dashboard.js";
4
- import { t as r } from "../../_chunks/chunk-BV7QT456.js";
4
+ import { t as r } from "../../_chunks/chunk-OB3PAWPO.js";
5
5
  import { CaseDbCaseApi as i } from "@gen-epix/api-casedb";
6
6
  import { useEffect as a, useMemo as o } from "react";
7
7
  import { useTranslation as s } from "react-i18next";
@@ -26,96 +26,129 @@ var b = () => {
26
26
  id: t.id,
27
27
  ...e
28
28
  })).data, []), A = d(async (e) => (await c.getInstance().organizationAccessCasePoliciesPostOne(e)).data, []), j = d((e) => T.getName(e), [T]), M = f(() => o().shape({
29
- add_case: a().required(),
30
- add_case_set: a().required(),
29
+ add_case: a().when("is_private", {
30
+ is: !0,
31
+ otherwise: () => a().required(),
32
+ then: () => a().required().oneOf([!0], b`Add case must be enabled for private policies`)
33
+ }),
34
+ add_case_set: a().when("is_private", {
35
+ is: !0,
36
+ otherwise: () => a().required(),
37
+ then: () => a().required().oneOf([!0], b`Add case set must be enabled for private policies`)
38
+ }),
31
39
  case_type_set_id: s().uuid4().required().max(100),
32
40
  data_collection_id: s().uuid4().required().max(100),
33
41
  is_active: a().required(),
34
42
  is_private: a().required(),
35
43
  organization_id: s().uuid4().required().max(100),
36
44
  read_case_set: a().required(),
37
- read_col_set_id: s().uuid4().required().max(100),
38
- remove_case: a().required(),
39
- remove_case_set: a().required(),
45
+ read_col_set_id: s().when("is_private", {
46
+ is: !0,
47
+ otherwise: () => s().nullable().notRequired().max(100),
48
+ then: () => s().uuid4().required(b`Read column set is required for private policies`).max(100)
49
+ }),
50
+ remove_case: a().when("is_private", {
51
+ is: !0,
52
+ otherwise: () => a().required(),
53
+ then: () => a().required().oneOf([!0], b`Remove case must be enabled for private policies`)
54
+ }),
55
+ remove_case_set: a().when("is_private", {
56
+ is: !0,
57
+ otherwise: () => a().required(),
58
+ then: () => a().required().oneOf([!0], b`Remove case set must be enabled for private policies`)
59
+ }),
40
60
  write_case_set: a().required(),
41
- write_col_set_id: s().uuid4().nullable().notRequired().max(100)
42
- }), []), N = f(() => [
43
- {
44
- definition: u.AUTOCOMPLETE,
45
- label: b`Organization`,
46
- loading: x.isLoading,
47
- name: "organization_id",
48
- options: x.options
49
- },
50
- {
51
- definition: u.AUTOCOMPLETE,
52
- label: b`Data collection`,
53
- loading: S.isLoading,
54
- name: "data_collection_id",
55
- options: S.options
56
- },
57
- {
58
- definition: u.AUTOCOMPLETE,
59
- label: b`Case type set`,
60
- loading: w.isLoading,
61
- name: "case_type_set_id",
62
- options: w.options
63
- },
64
- {
65
- definition: u.AUTOCOMPLETE,
66
- label: b`Read column set`,
67
- loading: C.isLoading,
68
- name: "read_col_set_id",
69
- options: C.options
70
- },
71
- {
72
- definition: u.AUTOCOMPLETE,
73
- label: b`Write column set`,
74
- loading: C.isLoading,
75
- name: "write_col_set_id",
76
- options: C.options
77
- },
78
- {
79
- definition: u.BOOLEAN,
80
- label: b`Add case`,
81
- name: "add_case"
82
- },
83
- {
84
- definition: u.BOOLEAN,
85
- label: b`Remove case`,
86
- name: "remove_case"
87
- },
88
- {
89
- definition: u.BOOLEAN,
90
- label: b`Add case set`,
91
- name: "add_case_set"
92
- },
93
- {
94
- definition: u.BOOLEAN,
95
- label: b`Remove case set`,
96
- name: "remove_case_set"
97
- },
98
- {
99
- definition: u.BOOLEAN,
100
- label: b`Read case set`,
101
- name: "read_case_set"
102
- },
103
- {
104
- definition: u.BOOLEAN,
105
- label: b`Write case set`,
106
- name: "write_case_set"
107
- },
108
- {
109
- definition: u.BOOLEAN,
110
- label: b`Is private`,
111
- name: "is_private"
112
- },
113
- {
114
- definition: u.BOOLEAN,
115
- label: b`Is active`,
116
- name: "is_active"
117
- }
118
- ], [
61
+ write_col_set_id: s().when("is_private", {
62
+ is: !0,
63
+ otherwise: () => s().nullable().notRequired().max(100),
64
+ then: () => s().uuid4().required(b`Write column set is required for private policies`).max(100)
65
+ })
66
+ }), [b]), N = d((e, t, n) => {
67
+ t?.is_private === !0 && t?.add_case !== !0 && n.setValue("add_case", !0), t?.is_private === !0 && t?.add_case_set !== !0 && n.setValue("add_case_set", !0), t?.is_private === !0 && t?.remove_case !== !0 && n.setValue("remove_case", !0), t?.is_private === !0 && t?.remove_case_set !== !0 && n.setValue("remove_case_set", !0);
68
+ }, []), P = d((e, t) => {
69
+ let n = t?.is_private ?? e?.is_private ?? !1;
70
+ return [
71
+ {
72
+ definition: u.AUTOCOMPLETE,
73
+ label: b`Organization`,
74
+ loading: x.isLoading,
75
+ name: "organization_id",
76
+ options: x.options
77
+ },
78
+ {
79
+ definition: u.AUTOCOMPLETE,
80
+ label: b`Data collection`,
81
+ loading: S.isLoading,
82
+ name: "data_collection_id",
83
+ options: S.options
84
+ },
85
+ {
86
+ definition: u.AUTOCOMPLETE,
87
+ label: b`Case type set`,
88
+ loading: w.isLoading,
89
+ name: "case_type_set_id",
90
+ options: w.options
91
+ },
92
+ {
93
+ definition: u.AUTOCOMPLETE,
94
+ label: b`Read column set`,
95
+ loading: C.isLoading,
96
+ name: "read_col_set_id",
97
+ options: C.options
98
+ },
99
+ {
100
+ definition: u.AUTOCOMPLETE,
101
+ label: b`Write column set`,
102
+ loading: C.isLoading,
103
+ name: "write_col_set_id",
104
+ options: C.options
105
+ },
106
+ {
107
+ definition: u.BOOLEAN,
108
+ disabled: n,
109
+ label: b`Add case`,
110
+ name: "add_case"
111
+ },
112
+ {
113
+ definition: u.BOOLEAN,
114
+ disabled: n,
115
+ label: b`Remove case`,
116
+ name: "remove_case"
117
+ },
118
+ {
119
+ definition: u.BOOLEAN,
120
+ disabled: n,
121
+ label: b`Add case set`,
122
+ name: "add_case_set"
123
+ },
124
+ {
125
+ definition: u.BOOLEAN,
126
+ disabled: n,
127
+ label: b`Remove case set`,
128
+ name: "remove_case_set"
129
+ },
130
+ {
131
+ definition: u.BOOLEAN,
132
+ label: b`Read case set`,
133
+ name: "read_case_set"
134
+ },
135
+ {
136
+ definition: u.BOOLEAN,
137
+ label: b`Write case set`,
138
+ name: "write_case_set"
139
+ },
140
+ {
141
+ definition: u.BOOLEAN,
142
+ label: b`Is private`,
143
+ name: "is_private"
144
+ },
145
+ {
146
+ definition: u.BOOLEAN,
147
+ label: b`Is active`,
148
+ name: "is_active"
149
+ }
150
+ ];
151
+ }, [
119
152
  C.isLoading,
120
153
  C.options,
121
154
  w.isLoading,
@@ -125,7 +158,7 @@ var b = () => {
125
158
  x.isLoading,
126
159
  x.options,
127
160
  b
128
- ]), P = f(() => [
161
+ ]), F = f(() => [
129
162
  g.createOptionsColumn({
130
163
  id: "organization_id",
131
164
  name: b`Organization`,
@@ -198,13 +231,14 @@ var b = () => {
198
231
  defaultSortDirection: "asc",
199
232
  deleteOne: O,
200
233
  fetchAll: D,
201
- formFieldDefinitions: N,
234
+ formFieldDefinitions: P,
202
235
  getName: j,
203
236
  itemName: b`Organization access case policy`,
204
237
  loadables: E,
238
+ onFormChange: N,
205
239
  resourceQueryKeyBase: e.ORGANIZATION_ACCESS_CASE_POLICIES,
206
240
  schema: M,
207
- tableColumns: P,
241
+ tableColumns: F,
208
242
  testIdAttributes: _.createAttributes("OrganizationAccessCasePoliciesAdminPage"),
209
243
  title: b`Organization access case policies`,
210
244
  updateOne: k
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/OrganizationAccessCasePoliciesAdminPage/OrganizationAccessCasePoliciesAdminPage.tsx"],"sourcesContent":["import {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n boolean,\n object,\n string,\n} from 'yup';\nimport type {\n CaseDbApiPermission,\n CaseDbOrganizationAccessCasePolicy,\n} from '@gen-epix/api-casedb';\nimport {\n CaseDbAbacApi,\n CaseDbCommandName,\n} from '@gen-epix/api-casedb';\nimport type { OmitWithMetaData } from '@gen-epix/ui-client-common/models/data';\nimport type { TableColumn } from '@gen-epix/ui-client-common/models/table';\nimport { CrudPage } from '@gen-epix/ui-client-common/pages/CrudPage';\nimport { TableUtil } from '@gen-epix/ui-client-common/utils/TableUtil';\nimport { useOrganizationOptionsQuery } 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 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 { useColSetOptionsQuery } from '../../dataHooks/useColSetsQuery';\nimport { useCaseTypeSetOptionsQuery } from '../../dataHooks/useCaseTypeSetsQuery';\nimport { useDataCollectionOptionsQuery } from '../../dataHooks/useDataCollectionsQuery';\nimport { CASEDB_QUERY_KEY } from '../../constants/query';\nimport { useOrganizationCasePolicyNameFactory } from '../../hooks/useOrganizationCasePolicyNameFactory';\n\ntype FormFields = OmitWithMetaData<CaseDbOrganizationAccessCasePolicy, 'case_type_set' | 'data_collection' | 'organization' | 'read_col_set' | 'write_col_set'>;\n\nexport const OrganizationAccessCasePoliciesAdminPage = () => {\n const { t } = useTranslation();\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const dataCollectionOptionsQuery = useDataCollectionOptionsQuery();\n const colSetOptionsQuery = useColSetOptionsQuery();\n const caseTypeSetOptionsQuery = useCaseTypeSetOptionsQuery();\n\n const nameFactory = useOrganizationCasePolicyNameFactory();\n\n const loadables = useArray([nameFactory, organizationOptionsQuery, dataCollectionOptionsQuery, colSetOptionsQuery, caseTypeSetOptionsQuery]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CaseDbOrganizationAccessCasePolicy) => {\n return await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesDeleteOne(item.id);\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CaseDbOrganizationAccessCasePolicy) => {\n return (await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesPostOne(variables)).data;\n }, []);\n\n const getName = useCallback((item: CaseDbOrganizationAccessCasePolicy) => {\n return nameFactory.getName(item);\n }, [nameFactory]);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n add_case: boolean().required(),\n add_case_set: boolean().required(),\n case_type_set_id: string().uuid4().required().max(100),\n data_collection_id: string().uuid4().required().max(100),\n is_active: boolean().required(),\n is_private: boolean().required(),\n organization_id: string().uuid4().required().max(100),\n read_case_set: boolean().required(),\n read_col_set_id: string().uuid4().required().max(100),\n remove_case: boolean().required(),\n remove_case_set: boolean().required(),\n write_case_set: boolean().required(),\n write_col_set_id: string().uuid4().nullable().notRequired().max(100),\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Organization`,\n loading: organizationOptionsQuery.isLoading,\n name: 'organization_id',\n options: organizationOptionsQuery.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: 'data_collection_id',\n options: dataCollectionOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Case type set`,\n loading: caseTypeSetOptionsQuery.isLoading,\n name: 'case_type_set_id',\n options: caseTypeSetOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Read column set`,\n loading: colSetOptionsQuery.isLoading,\n name: 'read_col_set_id',\n options: colSetOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Write column set`,\n loading: colSetOptionsQuery.isLoading,\n name: 'write_col_set_id',\n options: colSetOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Add case`,\n name: 'add_case',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Remove case`,\n name: 'remove_case',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Add case set`,\n name: 'add_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Remove case set`,\n name: 'remove_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Read case set`,\n name: 'read_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Write case set`,\n name: 'write_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is private`,\n name: 'is_private',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [colSetOptionsQuery.isLoading, colSetOptionsQuery.options, caseTypeSetOptionsQuery.isLoading, caseTypeSetOptionsQuery.options, dataCollectionOptionsQuery.isLoading, dataCollectionOptionsQuery.options, organizationOptionsQuery.isLoading, organizationOptionsQuery.options, t]);\n\n const tableColumns = useMemo((): TableColumn<CaseDbOrganizationAccessCasePolicy>[] => {\n return [\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'organization_id', name: t`Organization`, options: organizationOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'data_collection_id', name: t`Data collection`, options: dataCollectionOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'case_type_set_id', name: t`Case type set`, options: caseTypeSetOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'read_col_set_id', name: t`Read column set`, options: colSetOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'write_col_set_id', name: t`Write column set`, options: colSetOptionsQuery.options }),\n\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'add_case', name: t`Add case` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'remove_case', name: t`Remove case` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'add_case_set', name: t`Add case set` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'remove_case_set', name: t`Remove case set` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'read_case_set', name: t`Read case set` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'write_case_set', name: t`Write case set` }),\n\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'is_private', name: t`Private` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'is_active', name: t`Active` }),\n ];\n }, [colSetOptionsQuery.options, caseTypeSetOptionsQuery.options, dataCollectionOptionsQuery.options, organizationOptionsQuery.options, t]);\n\n return (\n <CrudPage<FormFields, CaseDbOrganizationAccessCasePolicy, CaseDbOrganizationAccessCasePolicy, CASEDB_QUERY_KEY, CaseDbApiPermission>\n createItemDialogTitle={t`Create new organization access case policy`}\n createOne={createOne}\n crudCommandType={CaseDbCommandName.OrganizationAccessCasePolicyCrudCommand}\n defaultSortByField={'organization_id'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Organization access case policy`}\n loadables={loadables}\n resourceQueryKeyBase={CASEDB_QUERY_KEY.ORGANIZATION_ACCESS_CASE_POLICIES}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OrganizationAccessCasePoliciesAdminPage')}\n title={t`Organization access case policies`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,IAAa,UAAgD;CAC3D,IAAM,EAAE,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GAAD;EACE,uBAAuB,CAAC;EACb;EACX,iBAAiB,EAAkB;EACnC,oBAAoB;EACpB,sBAAsB;EACX;EACD;EACY;EACb;EACT,UAAU,CAAC;EACA;EACX,sBAAsB,EAAiB;EAC/B;EACM;EACd,kBAAkB,EAAW,iBAAiB,yCAAyC;EACvF,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/OrganizationAccessCasePoliciesAdminPage/OrganizationAccessCasePoliciesAdminPage.tsx"],"sourcesContent":["import {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n boolean,\n object,\n string,\n} from 'yup';\nimport type {\n CaseDbApiPermission,\n CaseDbOrganizationAccessCasePolicy,\n} from '@gen-epix/api-casedb';\nimport {\n CaseDbAbacApi,\n CaseDbCommandName,\n} from '@gen-epix/api-casedb';\nimport type { OmitWithMetaData } from '@gen-epix/ui-client-common/models/data';\nimport type { TableColumn } from '@gen-epix/ui-client-common/models/table';\nimport { CrudPage } from '@gen-epix/ui-client-common/pages/CrudPage';\nimport { TableUtil } from '@gen-epix/ui-client-common/utils/TableUtil';\nimport { useOrganizationOptionsQuery } 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 type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form';\nimport type { UseFormReturn } from 'react-hook-form';\n\nimport { useColSetOptionsQuery } from '../../dataHooks/useColSetsQuery';\nimport { useCaseTypeSetOptionsQuery } from '../../dataHooks/useCaseTypeSetsQuery';\nimport { useDataCollectionOptionsQuery } from '../../dataHooks/useDataCollectionsQuery';\nimport { CASEDB_QUERY_KEY } from '../../constants/query';\nimport { useOrganizationCasePolicyNameFactory } from '../../hooks/useOrganizationCasePolicyNameFactory';\n\ntype FormFields = OmitWithMetaData<CaseDbOrganizationAccessCasePolicy, 'case_type_set' | 'data_collection' | 'organization' | 'read_col_set' | 'write_col_set'>;\n\nexport const OrganizationAccessCasePoliciesAdminPage = () => {\n const { t } = useTranslation();\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const dataCollectionOptionsQuery = useDataCollectionOptionsQuery();\n const colSetOptionsQuery = useColSetOptionsQuery();\n const caseTypeSetOptionsQuery = useCaseTypeSetOptionsQuery();\n\n const nameFactory = useOrganizationCasePolicyNameFactory();\n\n const loadables = useArray([nameFactory, organizationOptionsQuery, dataCollectionOptionsQuery, colSetOptionsQuery, caseTypeSetOptionsQuery]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CaseDbOrganizationAccessCasePolicy) => {\n return await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesDeleteOne(item.id);\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CaseDbOrganizationAccessCasePolicy) => {\n return (await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await CaseDbAbacApi.getInstance().organizationAccessCasePoliciesPostOne(variables)).data;\n }, []);\n\n const getName = useCallback((item: CaseDbOrganizationAccessCasePolicy) => {\n return nameFactory.getName(item);\n }, [nameFactory]);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n add_case: boolean().when('is_private', {\n is: true,\n otherwise: () => boolean().required(),\n then: () => boolean().required().oneOf([true], t`Add case must be enabled for private policies`),\n }),\n add_case_set: boolean().when('is_private', {\n is: true,\n otherwise: () => boolean().required(),\n then: () => boolean().required().oneOf([true], t`Add case set must be enabled for private policies`),\n }),\n case_type_set_id: string().uuid4().required().max(100),\n data_collection_id: string().uuid4().required().max(100),\n is_active: boolean().required(),\n is_private: boolean().required(),\n organization_id: string().uuid4().required().max(100),\n read_case_set: boolean().required(),\n read_col_set_id: string().when('is_private', {\n is: true,\n otherwise: () => string().nullable().notRequired().max(100),\n then: () => string().uuid4().required(t`Read column set is required for private policies`).max(100),\n }),\n remove_case: boolean().when('is_private', {\n is: true,\n otherwise: () => boolean().required(),\n then: () => boolean().required().oneOf([true], t`Remove case must be enabled for private policies`),\n }),\n remove_case_set: boolean().when('is_private', {\n is: true,\n otherwise: () => boolean().required(),\n then: () => boolean().required().oneOf([true], t`Remove case set must be enabled for private policies`),\n }),\n write_case_set: boolean().required(),\n write_col_set_id: string().when('is_private', {\n is: true,\n otherwise: () => string().nullable().notRequired().max(100),\n then: () => string().uuid4().required(t`Write column set is required for private policies`).max(100),\n }),\n });\n }, [t]);\n\n const onFormChange = useCallback((_item: CaseDbOrganizationAccessCasePolicy, values: FormFields, formMethods: UseFormReturn<FormFields>) => {\n if (values?.is_private === true && values?.add_case !== true) {\n formMethods.setValue('add_case', true);\n }\n if (values?.is_private === true && values?.add_case_set !== true) {\n formMethods.setValue('add_case_set', true);\n }\n if (values?.is_private === true && values?.remove_case !== true) {\n formMethods.setValue('remove_case', true);\n }\n if (values?.is_private === true && values?.remove_case_set !== true) {\n formMethods.setValue('remove_case_set', true);\n }\n }, []);\n\n const formFieldDefinitions = useCallback((item: CaseDbOrganizationAccessCasePolicy, values: FormFields): FormFieldDefinition<FormFields>[] => {\n const isPrivate = values?.is_private ?? item?.is_private ?? false;\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Organization`,\n loading: organizationOptionsQuery.isLoading,\n name: 'organization_id',\n options: organizationOptionsQuery.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: 'data_collection_id',\n options: dataCollectionOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Case type set`,\n loading: caseTypeSetOptionsQuery.isLoading,\n name: 'case_type_set_id',\n options: caseTypeSetOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Read column set`,\n loading: colSetOptionsQuery.isLoading,\n name: 'read_col_set_id',\n options: colSetOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Write column set`,\n loading: colSetOptionsQuery.isLoading,\n name: 'write_col_set_id',\n options: colSetOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n disabled: isPrivate,\n label: t`Add case`,\n name: 'add_case',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n disabled: isPrivate,\n label: t`Remove case`,\n name: 'remove_case',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n disabled: isPrivate,\n label: t`Add case set`,\n name: 'add_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n disabled: isPrivate,\n label: t`Remove case set`,\n name: 'remove_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Read case set`,\n name: 'read_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Write case set`,\n name: 'write_case_set',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is private`,\n name: 'is_private',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [colSetOptionsQuery.isLoading, colSetOptionsQuery.options, caseTypeSetOptionsQuery.isLoading, caseTypeSetOptionsQuery.options, dataCollectionOptionsQuery.isLoading, dataCollectionOptionsQuery.options, organizationOptionsQuery.isLoading, organizationOptionsQuery.options, t]);\n\n const tableColumns = useMemo((): TableColumn<CaseDbOrganizationAccessCasePolicy>[] => {\n return [\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'organization_id', name: t`Organization`, options: organizationOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'data_collection_id', name: t`Data collection`, options: dataCollectionOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'case_type_set_id', name: t`Case type set`, options: caseTypeSetOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'read_col_set_id', name: t`Read column set`, options: colSetOptionsQuery.options }),\n TableUtil.createOptionsColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'write_col_set_id', name: t`Write column set`, options: colSetOptionsQuery.options }),\n\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'add_case', name: t`Add case` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'remove_case', name: t`Remove case` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'add_case_set', name: t`Add case set` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'remove_case_set', name: t`Remove case set` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'read_case_set', name: t`Read case set` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'write_case_set', name: t`Write case set` }),\n\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'is_private', name: t`Private` }),\n TableUtil.createBooleanColumn<CaseDbOrganizationAccessCasePolicy>({ id: 'is_active', name: t`Active` }),\n ];\n }, [colSetOptionsQuery.options, caseTypeSetOptionsQuery.options, dataCollectionOptionsQuery.options, organizationOptionsQuery.options, t]);\n\n return (\n <CrudPage<FormFields, CaseDbOrganizationAccessCasePolicy, CaseDbOrganizationAccessCasePolicy, CASEDB_QUERY_KEY, CaseDbApiPermission>\n createItemDialogTitle={t`Create new organization access case policy`}\n createOne={createOne}\n crudCommandType={CaseDbCommandName.OrganizationAccessCasePolicyCrudCommand}\n defaultSortByField={'organization_id'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Organization access case policy`}\n loadables={loadables}\n onFormChange={onFormChange}\n resourceQueryKeyBase={CASEDB_QUERY_KEY.ORGANIZATION_ACCESS_CASE_POLICIES}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OrganizationAccessCasePoliciesAdminPage')}\n title={t`Organization access case policies`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,IAAa,UAAgD;CAC3D,IAAM,EAAE,SAAM,EAAe,GACvB,IAA2B,EAA4B,GACvD,IAA6B,EAA8B,GAC3D,IAAqB,EAAsB,GAC3C,IAA0B,EAA2B,GAErD,IAAc,EAAqC,GAEnD,IAAY,EAAS;EAAC;EAAa;EAA0B;EAA4B;EAAoB;CAAuB,CAAC,GAErI,IAAW,EAAY,OAAO,OAC1B,MAAM,EAAc,YAAY,CAAC,CAAC,qCAAqC,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,EAAI,MACxG,CAAC,CAAC,GAEC,IAAY,EAAY,OAAO,MAC5B,M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C/B;EACM;EACd,kBAAkB,EAAW,iBAAiB,yCAAyC;EACvF,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
@@ -1,6 +1,6 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
2
  import { CaseDbDataUtil as t } from "../../utils/CaseDbDataUtil/index.js";
3
- import { t as n } from "../../_chunks/chunk-BV7QT456.js";
3
+ import { t as n } from "../../_chunks/chunk-OB3PAWPO.js";
4
4
  import { useRefColsValidationRulesQuery as r } from "../../dataHooks/useRefColsValidationRulesQuery/index.js";
5
5
  import { useRefDimMapQuery as i, useRefDimOptionsQuery as a } from "../../dataHooks/useRefDimsQuery/index.js";
6
6
  import { useConceptSetMapQuery as o, useConceptSetOptionsQuery as s } from "../../dataHooks/useConceptSetsQuery/index.js";
@@ -1,5 +1,5 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
- import { t } from "../../_chunks/chunk-BV7QT456.js";
2
+ import { t } from "../../_chunks/chunk-OB3PAWPO.js";
3
3
  import { useRegionSetsMapQuery as n } from "../../dataHooks/useRegionSetsQuery/index.js";
4
4
  import { number as r, object as i, string as a } from "yup";
5
5
  import { CaseDbCommandName as o, CaseDbGeoApi as s } from "@gen-epix/api-casedb";
@@ -1,5 +1,5 @@
1
1
  import { CASEDB_QUERY_KEY as e } from "../../constants/query.js";
2
- import { t } from "../../_chunks/chunk-BV7QT456.js";
2
+ import { t } from "../../_chunks/chunk-OB3PAWPO.js";
3
3
  import { object as n } from "yup";
4
4
  import { CaseDbCommandName as r, CaseDbGeoApi as i } from "@gen-epix/api-casedb";
5
5
  import { FORM_FIELD_DEFINITION_TYPE as a } from "@gen-epix/ui-core-form/models/form";
@@ -1,7 +1,7 @@
1
1
  import { EffectiveRightsUtil as e } from "../../utils/EffectiveRightsUtil/index.js";
2
2
  import { useDataCollectionOptionsQuery as t, useDataCollectionsMapQuery as n } from "../../dataHooks/useDataCollectionsQuery/index.js";
3
3
  import { useCaseTypeSetMembersQuery as r } from "../../dataHooks/useCaseTypeSetMembersQuery/index.js";
4
- import { t as i } from "../../_chunks/chunk-BV7QT456.js";
4
+ import { t as i } from "../../_chunks/chunk-OB3PAWPO.js";
5
5
  import { useColSetMembersQuery as a } from "../../dataHooks/useColSetMembersQuery/index.js";
6
6
  import { useOrganizationAccessCasePoliciesQuery as o } from "../../dataHooks/useOrganizationAccessCasePoliciesQuery/index.js";
7
7
  import { useOrganizationShareCasePoliciesQuery as s } from "../../dataHooks/useOrganizationShareCasePoliciesQuery/index.js";
@@ -5,7 +5,7 @@ import { t as r } from "../../_chunks/yup.js";
5
5
  import { useCaseTypeOptionsQuery as i } from "../../dataHooks/useCaseTypesQuery/index.js";
6
6
  import { useDataCollectionOptionsQuery as a } from "../../dataHooks/useDataCollectionsQuery/index.js";
7
7
  import { useCaseTypeSetMembersQuery as o } from "../../dataHooks/useCaseTypeSetMembersQuery/index.js";
8
- import { t as s } from "../../_chunks/chunk-BV7QT456.js";
8
+ import { t as s } from "../../_chunks/chunk-OB3PAWPO.js";
9
9
  import { useColSetMembersQuery as c } from "../../dataHooks/useColSetMembersQuery/index.js";
10
10
  import { useOrganizationAccessCasePoliciesQuery as l } from "../../dataHooks/useOrganizationAccessCasePoliciesQuery/index.js";
11
11
  import { useOrganizationShareCasePoliciesQuery as u } from "../../dataHooks/useOrganizationShareCasePoliciesQuery/index.js";