datastake-daf 0.6.766 → 0.6.768

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 (51) hide show
  1. package/dist/components/index.js +269 -140
  2. package/dist/pages/index.js +4736 -5657
  3. package/dist/utils/index.js +16 -1
  4. package/package.json +4 -1
  5. package/src/@daf/core/components/Dashboard/Map/ChainIcon/Markers/StakeholderMarker.js +5 -2
  6. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +67 -28
  7. package/src/@daf/core/components/Dashboard/Map/StakeholderIcon/index.js +3 -0
  8. package/src/@daf/core/components/Dashboard/Map/hook.js +57 -33
  9. package/src/@daf/core/components/Graphs/TradeRelationship/index.jsx +49 -11
  10. package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +8 -4
  11. package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -1
  12. package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +1 -1
  13. package/src/@daf/core/components/UI/MissingTagButton/index.jsx +36 -0
  14. package/src/@daf/hooks/useMapHelper.js +5 -0
  15. package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +3 -2
  16. package/src/@daf/pages/Documents/config.js +0 -10
  17. package/src/@daf/pages/Documents/index.jsx +51 -108
  18. package/src/@daf/pages/Events/Activities/config.js +1 -11
  19. package/src/@daf/pages/Events/Activities/index.jsx +47 -105
  20. package/src/@daf/pages/Events/Incidents/config.js +1 -11
  21. package/src/@daf/pages/Events/Incidents/index.jsx +47 -105
  22. package/src/@daf/pages/Events/config.js +18 -34
  23. package/src/@daf/pages/Events/helper.js +0 -1
  24. package/src/@daf/pages/Events/index.jsx +49 -111
  25. package/src/@daf/pages/Locations/MineSite/columns.js +1 -1
  26. package/src/@daf/pages/Locations/MineSite/config.js +0 -10
  27. package/src/@daf/pages/Locations/MineSite/index.jsx +47 -105
  28. package/src/@daf/pages/Locations/config.js +4 -16
  29. package/src/@daf/pages/Locations/index.jsx +53 -110
  30. package/src/@daf/pages/Stakeholders/Operators/config.js +0 -10
  31. package/src/@daf/pages/Stakeholders/Operators/index.jsx +47 -105
  32. package/src/@daf/pages/Stakeholders/Workers/config.js +0 -10
  33. package/src/@daf/pages/Stakeholders/Workers/index.jsx +47 -105
  34. package/src/@daf/pages/Stakeholders/config.js +3 -15
  35. package/src/@daf/pages/Stakeholders/index.jsx +53 -109
  36. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +5 -1
  37. package/src/@daf/pages/TablePage/config.js +78 -0
  38. package/src/@daf/pages/{Events → TablePage}/create.jsx +11 -8
  39. package/src/@daf/pages/TablePage/hook.js +123 -0
  40. package/src/@daf/pages/TablePage/index.jsx +142 -0
  41. package/src/constants/locales/en/translation.js +5 -0
  42. package/src/constants/locales/fr/translation.js +5 -0
  43. package/src/index.js +1 -0
  44. package/src/@daf/pages/Documents/create.jsx +0 -105
  45. package/src/@daf/pages/Events/Activities/create.jsx +0 -104
  46. package/src/@daf/pages/Events/Incidents/create.jsx +0 -104
  47. package/src/@daf/pages/Locations/MineSite/create.jsx +0 -104
  48. package/src/@daf/pages/Locations/create.jsx +0 -104
  49. package/src/@daf/pages/Stakeholders/Operators/create.jsx +0 -104
  50. package/src/@daf/pages/Stakeholders/Workers/create.jsx +0 -104
  51. package/src/@daf/pages/Stakeholders/create.jsx +0 -105
@@ -1,11 +1,6 @@
1
- import React, { useMemo, useState, useEffect, useCallback } from 'react'
2
- import TablePageWithTabs from '../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
1
+ import React from 'react'
3
2
  import { getColumns } from './columns.js';
4
- import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
5
- import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
6
- import StakeholdersCreate from './create.jsx';
7
- import { displayMessage } from '../../../helpers/messages.js';
8
- import { useFetchData } from '../hook.js';
3
+ import TablePage from '../TablePage/index.jsx';
9
4
 
10
5
  const DocumentsTable = ({
11
6
  t = () => {},
@@ -37,109 +32,57 @@ const DocumentsTable = ({
37
32
  subjectClear = () => {},
38
33
  breadcrumbs = [],
39
34
  extendingFilters = {},
35
+ createDefaultValues = {},
40
36
  }) => {
41
- const [selectOptions, setSelectOptions] = useState();
42
- const [activeTab, setActiveTab] = useState("own");
43
- const columns = useMemo(() => getColumns({
44
- t,
45
- goTo,
46
- user,
47
- options,
48
- activeTab,
49
- getRedirectLink,
50
- theme,
51
- subject: 'documents',
52
- applications,
53
- }), [t, goTo, user, options, activeTab, getRedirectLink, theme, applications]);
54
-
55
- useFetchData({
56
- location,
57
- getData,
58
- activeTab,
59
- extendingFilters,
60
- subject: 'documents',
61
- })
62
-
63
- const selectFiltersConfig = useMemo(() => {
64
- return getFiltersConfig({t});
65
- }, [t]);
66
-
67
- useEffect(() => {
68
- setSelectOptions((prev) => ({
69
- ...prev,
70
- ...getFilterOptions(options, t),
71
- }))
72
- }, [options, t])
73
-
74
- const handleActiveTabChange = useCallback((value) => {
75
- setActiveTab(value);
76
- }, []);
77
-
78
- useEffect(
79
- () => () => {
80
- subjectClear();
81
- },
82
- [],
83
- );
84
-
85
37
  return (
86
- <TablePageWithTabs
87
- t={t}
88
- title={t("Documents")}
89
- breadCrumbs={breadcrumbs}
90
- location={location}
91
- loading={loading}
92
- goTo={goTo}
93
- defaultActiveTab={"own"}
94
- columns={columns}
95
- data={data}
96
- checkboxConfig={checkboxConfig}
97
- APP={APP}
98
- getApiBaseUrl={getApiBaseUrl}
99
- selectOptions={selectOptions}
100
- selectFiltersConfig={selectFiltersConfig}
101
- getRedirectLink={getRedirectLink}
102
- filtersConfig={filtersConfig}
103
- isMobile={isMobile}
104
- view="documents"
105
- getActiveTab={handleActiveTabChange}
106
- onDownload={() => {
107
- console.log("download");
108
- }}
109
- drawerTitle={t("Create Document")}
110
- >
111
- {({onDrawerClose}) => (
112
- <StakeholdersCreate
113
- t={t}
114
- goTo={goTo}
115
- user={user}
116
- APP={APP}
117
- getApiBaseUrl={getApiBaseUrl}
118
- getAppHeader={getAppHeader}
119
- getData={getFormData}
120
- saveData={saveFormData}
121
- loading={formLoading}
122
- onSubmitted={(type, m, data) => {
123
- if (data.datastakeId) {
124
- displayMessage(
125
- type,
126
- t("affirmations::subject-created-successfully") || m,
127
- );
128
- goTo(`/app/edit/documents/${data.datastakeId}`);
129
- }
130
- }}
131
- onCancel={onDrawerClose}
132
- query={query}
133
- ajaxForms={ajaxForms}
134
- changeAjaxForms={changeAjaxForms}
135
- ajaxOptions={ajaxOptions}
136
- changeAjaxOptions={changeAjaxOptions}
137
- formData={formData}
138
- formValue={formValue}
139
- form={form}
140
- />
141
- )}
142
- </TablePageWithTabs>
38
+ <TablePage
39
+ t={t}
40
+ goTo={goTo}
41
+ user={user}
42
+ options={options}
43
+ getRedirectLink={getRedirectLink}
44
+ theme={theme}
45
+ loading={loading}
46
+ data={data}
47
+ isMobile={isMobile}
48
+ APP={APP}
49
+ location={location}
50
+ applications={applications}
51
+
52
+ subject="documents"
53
+ getData={getData}
54
+ getApiBaseUrl={getApiBaseUrl}
55
+ getAppHeader={getAppHeader}
56
+ subjectClear={subjectClear}
57
+ getColumns={getColumns}
58
+
59
+ viewConfig={{
60
+ title: "Documents",
61
+ breadcrumbs: breadcrumbs,
62
+ createTitle: "Create Document",
63
+ }}
64
+
65
+ formConfig={{
66
+ getFormData,
67
+ saveFormData,
68
+ formLoading,
69
+ query,
70
+ ajaxForms,
71
+ changeAjaxForms,
72
+ ajaxOptions,
73
+ changeAjaxOptions,
74
+ formData,
75
+ formValue,
76
+ form,
77
+ namespace: 'document',
78
+ view: 'scoping',
79
+ scope: 'create',
80
+ formType: 'document',
81
+ defaultValues: createDefaultValues,
82
+ }}
83
+
84
+ onDownload={() => console.log("download")}
85
+ />
143
86
  )
144
87
  }
145
88
 
@@ -1,8 +1,3 @@
1
- export const checkboxConfig = {
2
- name: 'Name',
3
- datastakeId: 'ID'
4
- }
5
-
6
1
  export const getFiltersConfig = ({t}) => {
7
2
  return {
8
3
 
@@ -129,11 +124,6 @@ timeframe: {
129
124
  }
130
125
  }
131
126
 
132
- export const filtersConfig = {
133
- name: '',
134
- datastakeId: '',
135
- };
136
-
137
127
  export const getFilterOptions = (options, t) => {
138
128
  const {
139
129
  timeframe = [],
@@ -166,7 +156,7 @@ export const getFilterOptions = (options, t) => {
166
156
  category: stakeholderCategoryOptions || categoryOptions,
167
157
  country: countries,
168
158
  subCategory: subCategoriesOptions,
169
- category: category,
159
+ // category: category,
170
160
  administrativeLevel1,
171
161
  administrativeLevel2,
172
162
  positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
@@ -1,11 +1,6 @@
1
- import React, { useMemo, useState, useEffect, useCallback } from 'react'
2
- import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
1
+ import React from 'react'
3
2
  import { getColumns } from './columns.js';
4
- import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
5
- import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
6
- import StakeholdersCreate from './create.jsx';
7
- import { displayMessage } from '../../../../helpers/messages.js';
8
- import { useFetchData } from '../../hook.js';
3
+ import TablePage from '../../TablePage/index.jsx';
9
4
 
10
5
  const ActivitiesTable = ({
11
6
  t = () => {},
@@ -38,105 +33,52 @@ const ActivitiesTable = ({
38
33
  applications = [],
39
34
  breadcrumbs = [],
40
35
  }) => {
41
- const [selectOptions, setSelectOptions] = useState();
42
- const [activeTab, setActiveTab] = useState("own");
43
-
44
- const columns = useMemo(() => getColumns({
45
- t,
46
- goTo,
47
- user,
48
- options,
49
- activeTab,
50
- getRedirectLink,
51
- theme,
52
- subject: 'activities',
53
- data,
54
- applications,
55
- }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
56
-
57
- useFetchData({
58
- location,
59
- getData,
60
- activeTab,
61
- extendingFilters,
62
- subject: 'activities',
63
- })
64
-
65
- const selectFiltersConfig = useMemo(() => {
66
- return getFiltersConfig({t});
67
- }, [t]);
68
-
69
- useEffect(() => {
70
- setSelectOptions((prev) => ({
71
- ...prev,
72
- ...getFilterOptions(options, t),
73
- }))
74
- }, [options, t])
75
-
76
- const handleActiveTabChange = useCallback((value) => {
77
- setActiveTab(value);
78
- }, []);
79
-
80
36
  return (
81
- <TablePageWithTabs
82
- t={t}
83
- title={t("Activities")}
84
- breadCrumbs={breadcrumbs}
85
- location={location}
86
- loading={loading}
87
- goTo={goTo}
88
- defaultActiveTab={"own"}
89
- columns={columns}
90
- data={data}
91
- checkboxConfig={checkboxConfig}
92
- APP={APP}
93
- getApiBaseUrl={getApiBaseUrl}
94
- selectOptions={selectOptions}
95
- selectFiltersConfig={selectFiltersConfig}
96
- getRedirectLink={getRedirectLink}
97
- filtersConfig={filtersConfig}
98
- isMobile={isMobile}
99
- view="activities"
100
- getActiveTab={handleActiveTabChange}
101
- onDownload={() => {
102
- console.log("download");
103
- }}
104
- drawerTitle={t("Create Activity")}
105
- >
106
- {({onDrawerClose}) => (
107
- <StakeholdersCreate
108
- defaultData={createDefaultValues}
109
- t={t}
110
- goTo={goTo}
111
- user={user}
112
- APP={APP}
113
- getApiBaseUrl={getApiBaseUrl}
114
- getAppHeader={getAppHeader}
115
- getData={getFormData}
116
- saveData={saveFormData}
117
- loading={formLoading}
118
- onSubmitted={(type, m, data) => {
119
- if (data.datastakeId) {
120
- displayMessage(
121
- type,
122
- t("affirmations::subject-created-successfully") || m,
123
- );
124
- // goTo(`/app/edit/stakeholders/${data.datastakeId}`);
125
- goTo(`/app/edit/activities/${data.datastakeId}`)
126
- }
127
- }}
128
- onCancel={onDrawerClose}
129
- query={query}
130
- ajaxForms={ajaxForms}
131
- changeAjaxForms={changeAjaxForms}
132
- ajaxOptions={ajaxOptions}
133
- changeAjaxOptions={changeAjaxOptions}
134
- formData={formData}
135
- formValue={formValue}
136
- form={form}
137
- />
138
- )}
139
- </TablePageWithTabs>
37
+ <TablePage
38
+ t={t}
39
+ goTo={goTo}
40
+ user={user}
41
+ options={options}
42
+ getRedirectLink={getRedirectLink}
43
+ theme={theme}
44
+ loading={loading}
45
+ data={data}
46
+ isMobile={isMobile}
47
+ APP={APP}
48
+ location={location}
49
+ applications={applications}
50
+
51
+ subject="activities"
52
+ getData={getData}
53
+ getApiBaseUrl={getApiBaseUrl}
54
+ getAppHeader={getAppHeader}
55
+ getColumns={getColumns}
56
+ viewConfig={{
57
+ title: "Activities",
58
+ breadcrumbs: breadcrumbs,
59
+ createTitle: "Create Activity",
60
+ }}
61
+ extendingFilters={extendingFilters}
62
+ formConfig={{
63
+ getFormData,
64
+ saveFormData,
65
+ formLoading,
66
+ query,
67
+ ajaxForms,
68
+ changeAjaxForms,
69
+ ajaxOptions,
70
+ changeAjaxOptions,
71
+ formData,
72
+ formValue,
73
+ form,
74
+ namespace: "corrective-actions",
75
+ view: 'corrective-actions',
76
+ scope: 'createActivity',
77
+ formType: 'activity',
78
+ defaultValues: createDefaultValues,
79
+ }}
80
+ onDownload={() => console.log("download")}
81
+ />
140
82
  )
141
83
  }
142
84
 
@@ -1,8 +1,3 @@
1
- export const checkboxConfig = {
2
- name: 'Name',
3
- datastakeId: 'ID'
4
- }
5
-
6
1
  export const getFiltersConfig = ({t}) => {
7
2
  return {
8
3
 
@@ -129,11 +124,6 @@ timeframe: {
129
124
  }
130
125
  }
131
126
 
132
- export const filtersConfig = {
133
- name: '',
134
- datastakeId: '',
135
- };
136
-
137
127
  export const getFilterOptions = (options, t) => {
138
128
  const {
139
129
  timeframe = [],
@@ -166,7 +156,7 @@ export const getFilterOptions = (options, t) => {
166
156
  category: stakeholderCategoryOptions || categoryOptions,
167
157
  country: countries,
168
158
  subCategory: subCategoriesOptions,
169
- category: category,
159
+ // category: category,
170
160
  administrativeLevel1,
171
161
  administrativeLevel2,
172
162
  positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
@@ -1,11 +1,6 @@
1
- import React, { useMemo, useState, useEffect, useCallback } from 'react'
2
- import TablePageWithTabs from '../../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx'
1
+ import React from 'react'
3
2
  import { getColumns } from './columns.js';
4
- import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
5
- import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
6
- import StakeholdersCreate from './create.jsx';
7
- import { displayMessage } from '../../../../helpers/messages.js';
8
- import { useFetchData } from '../../hook.js';
3
+ import TablePage from '../../TablePage/index.jsx';
9
4
 
10
5
  const IncidentsTable = ({
11
6
  t = () => {},
@@ -38,105 +33,52 @@ const IncidentsTable = ({
38
33
  applications = [],
39
34
  breadcrumbs = [],
40
35
  }) => {
41
- const [selectOptions, setSelectOptions] = useState();
42
- const [activeTab, setActiveTab] = useState("own");
43
-
44
- const columns = useMemo(() => getColumns({
45
- t,
46
- goTo,
47
- user,
48
- options,
49
- activeTab,
50
- getRedirectLink,
51
- theme,
52
- subject: 'incidents',
53
- data,
54
- applications,
55
- }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
56
-
57
- useFetchData({
58
- location,
59
- getData,
60
- activeTab,
61
- extendingFilters,
62
- subject: 'incidents',
63
- })
64
-
65
- const selectFiltersConfig = useMemo(() => {
66
- return getFiltersConfig({t});
67
- }, [t]);
68
-
69
- useEffect(() => {
70
- setSelectOptions((prev) => ({
71
- ...prev,
72
- ...getFilterOptions(options, t),
73
- }))
74
- }, [options, t])
75
-
76
- const handleActiveTabChange = useCallback((value) => {
77
- setActiveTab(value);
78
- }, []);
79
-
80
36
  return (
81
- <TablePageWithTabs
82
- t={t}
83
- title={t("Incidents")}
84
- breadCrumbs={breadcrumbs}
85
- location={location}
86
- loading={loading}
87
- goTo={goTo}
88
- defaultActiveTab={"own"}
89
- columns={columns}
90
- data={data}
91
- checkboxConfig={checkboxConfig}
92
- APP={APP}
93
- getApiBaseUrl={getApiBaseUrl}
94
- selectOptions={selectOptions}
95
- selectFiltersConfig={selectFiltersConfig}
96
- getRedirectLink={getRedirectLink}
97
- filtersConfig={filtersConfig}
98
- isMobile={isMobile}
99
- view="incidents"
100
- getActiveTab={handleActiveTabChange}
101
- onDownload={() => {
102
- console.log("download");
103
- }}
104
- drawerTitle={t("Create Incidents")}
105
- >
106
- {({onDrawerClose}) => (
107
- <StakeholdersCreate
108
- defaultData={createDefaultValues}
109
- t={t}
110
- goTo={goTo}
111
- user={user}
112
- APP={APP}
113
- getApiBaseUrl={getApiBaseUrl}
114
- getAppHeader={getAppHeader}
115
- getData={getFormData}
116
- saveData={saveFormData}
117
- loading={formLoading}
118
- onSubmitted={(type, m, data) => {
119
- if (data.datastakeId) {
120
- displayMessage(
121
- type,
122
- t("affirmations::subject-created-successfully") || m,
123
- );
124
- // goTo(`/app/edit/stakeholders/${data.datastakeId}`);
125
- goTo(`/app/edit/incidents/${data.datastakeId}`)
126
- }
127
- }}
128
- onCancel={onDrawerClose}
129
- query={query}
130
- ajaxForms={ajaxForms}
131
- changeAjaxForms={changeAjaxForms}
132
- ajaxOptions={ajaxOptions}
133
- changeAjaxOptions={changeAjaxOptions}
134
- formData={formData}
135
- formValue={formValue}
136
- form={form}
137
- />
138
- )}
139
- </TablePageWithTabs>
37
+ <TablePage
38
+ t={t}
39
+ goTo={goTo}
40
+ user={user}
41
+ options={options}
42
+ getRedirectLink={getRedirectLink}
43
+ theme={theme}
44
+ loading={loading}
45
+ data={data}
46
+ isMobile={isMobile}
47
+ APP={APP}
48
+ location={location}
49
+ applications={applications}
50
+
51
+ subject="incidents"
52
+ getData={getData}
53
+ getApiBaseUrl={getApiBaseUrl}
54
+ getAppHeader={getAppHeader}
55
+ getColumns={getColumns}
56
+ viewConfig={{
57
+ title: "Incidents",
58
+ breadcrumbs: breadcrumbs,
59
+ createTitle: "Create Incident",
60
+ }}
61
+ extendingFilters={extendingFilters}
62
+ formConfig={{
63
+ getFormData,
64
+ saveFormData,
65
+ formLoading,
66
+ query,
67
+ ajaxForms,
68
+ changeAjaxForms,
69
+ ajaxOptions,
70
+ changeAjaxOptions,
71
+ formData,
72
+ formValue,
73
+ form,
74
+ namespace: "incident",
75
+ view: 'incident',
76
+ scope: 'createIncident',
77
+ formType: 'incident',
78
+ defaultValues: createDefaultValues,
79
+ }}
80
+ onDownload={() => console.log("download")}
81
+ />
140
82
  )
141
83
  }
142
84
 
@@ -1,8 +1,3 @@
1
- export const checkboxConfig = {
2
- name: 'Name',
3
- datastakeId: 'ID'
4
- }
5
-
6
1
  export const getFiltersConfig = ({t}) => {
7
2
  return {
8
3
 
@@ -107,14 +102,14 @@ export const getFiltersConfig = ({t}) => {
107
102
  return true;
108
103
  },
109
104
  },
110
- positionInTheMineralSupplyChain: {
111
- type: 'select',
112
- label: 'Position',
113
- placeholder: (t) => `${t('Filter by')} ${t('Position').toLowerCase()}`,
114
- style: { flex: 1 },
115
- labelStyle: { flex: 1 },
116
- getLabel: (option) => option.label,
117
- getValue: (option) => option.value,
105
+ category:{
106
+ type: 'select',
107
+ label: 'Category',
108
+ placeholder: (t) => `${t('Filter by')} ${t('Category').toLowerCase()}`,
109
+ style: { flex: 1 },
110
+ labelStyle: { flex: 1 },
111
+ getLabel: (option) => option.label,
112
+ getValue: (option) => option.value,
118
113
  },
119
114
  status: {
120
115
  type: "select",
@@ -125,50 +120,39 @@ export const getFiltersConfig = ({t}) => {
125
120
  getLabel: (option) => option.label,
126
121
  getValue: (option) => option.value,
127
122
  },
128
- category:{
129
- type: 'select',
130
- label: 'Category',
131
- placeholder: (t) => `${t('Filter by')} ${t('Category').toLowerCase()}`,
132
- style: { flex: 1 },
133
- labelStyle: { flex: 1 },
134
- getLabel: (option) => option.label,
135
- getValue: (option) => option.value,
136
- }
137
123
  }
138
124
  }
139
125
 
140
- export const filtersConfig = {
141
- name: '',
142
- datastakeId: '',
143
- };
144
-
145
126
  export const getFilterOptions = (options, t) => {
146
127
  const {
147
128
  timeframe = [],
148
129
  status = [],
149
130
  categoryOptions = [],
150
131
  countries = [],
151
-
152
132
  category=[],
133
+ eventCategoryOptions = [],
153
134
  } = options || {};
154
135
 
155
- const _default = {
136
+ const catOptions = eventCategoryOptions?.map((item) => ({
137
+ value: item.value,
138
+ label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label,
139
+ }))
140
+
141
+ return {
156
142
  timeframe: timeframe,
157
143
  country: countries,
158
- category: category,
159
-
144
+ category: catOptions,
160
145
  status: [
161
146
  {
162
147
  value: "submitted",
163
- label: "Submitted",
148
+ label: t("Submitted"),
164
149
  },
165
150
  {
166
151
  value: "private",
167
- label: "Private",
152
+ label: t("Private"),
168
153
  },
169
154
  ],
170
155
 
171
156
  }
172
157
 
173
- return _default;
174
158
  }
@@ -1,5 +1,4 @@
1
1
  export const getEventCategoryBySubject = (eventCategoryObject, subject, isSingular = false) => {
2
- console.log({eventCategoryObject, subject})
3
2
  if (!eventCategoryObject || typeof eventCategoryObject !== 'object') {
4
3
  return null;
5
4
  }