datastake-daf 0.6.794 → 0.6.795

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 (86) hide show
  1. package/build/favicon.ico +0 -0
  2. package/build/logo192.png +0 -0
  3. package/build/logo512.png +0 -0
  4. package/build/manifest.json +25 -0
  5. package/build/robots.txt +3 -0
  6. package/dist/components/index.js +3159 -4303
  7. package/dist/pages/index.js +2045 -3246
  8. package/dist/services/index.js +3 -69
  9. package/dist/utils/index.js +20 -14
  10. package/package.json +1 -1
  11. package/src/@daf/core/components/Dashboard/Map/hook.js +25 -1
  12. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +1 -0
  13. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
  14. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
  15. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
  16. package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +1 -0
  17. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
  18. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +8 -18
  19. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
  20. package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
  21. package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
  22. package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +7 -6
  23. package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
  24. package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +0 -1
  25. package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +0 -1
  26. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +45 -73
  27. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
  28. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +22 -48
  29. package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +0 -1
  30. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +1 -3
  31. package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +3 -5
  32. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +8 -13
  33. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
  34. package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +4 -3
  35. package/src/@daf/core/components/Screens/Admin/adminRoutes.js +2 -81
  36. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +1 -1
  37. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +0 -1
  38. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +3 -2
  39. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +13 -4
  40. package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +22 -20
  41. package/src/@daf/pages/Events/Activities/columns.js +1 -1
  42. package/src/@daf/pages/Events/Activities/config.js +23 -30
  43. package/src/@daf/pages/Events/Incidents/columns.js +1 -1
  44. package/src/@daf/pages/Events/Incidents/config.js +23 -30
  45. package/src/@daf/pages/Events/config.js +7 -7
  46. package/src/@daf/pages/Locations/MineSite/columns.js +3 -3
  47. package/src/@daf/pages/Locations/MineSite/config.js +20 -14
  48. package/src/@daf/pages/Locations/config.js +3 -3
  49. package/src/@daf/pages/Stakeholders/Operators/columns.js +2 -2
  50. package/src/@daf/pages/Stakeholders/Operators/config.js +9 -16
  51. package/src/@daf/pages/Stakeholders/Workers/columns.js +1 -1
  52. package/src/@daf/pages/Stakeholders/Workers/config.js +23 -29
  53. package/src/@daf/pages/Stakeholders/config.js +3 -3
  54. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +1 -1
  55. package/src/@daf/pages/TablePage/helper.js +17 -1
  56. package/src/@daf/pages/TablePage/hook.js +3 -1
  57. package/src/@daf/pages/TablePage/index.jsx +8 -6
  58. package/src/@daf/pages/View/index.jsx +4 -2
  59. package/src/@daf/services/AdminService.js +7 -79
  60. package/src/@daf/services/DashboardService.js +1 -2
  61. package/src/@daf/utils/filters.js +26 -15
  62. package/src/constants/locales/en/translation.js +1 -7
  63. package/src/constants/locales/fr/translation.js +2 -1
  64. package/src/constants/locales/sp/translation.js +2 -1
  65. package/src/pages.js +1 -10
  66. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +0 -79
  67. package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +0 -272
  68. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +0 -223
  69. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +0 -65
  70. package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +0 -81
  71. package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +0 -76
  72. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +0 -38
  73. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +0 -13
  74. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +0 -77
  75. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +0 -38
  76. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
  77. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +0 -75
  78. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +0 -180
  79. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
  80. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +0 -27
  81. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +0 -157
  82. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +0 -31
  83. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +0 -77
  84. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +0 -117
  85. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +0 -54
  86. package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
@@ -60,7 +60,8 @@ export const getColumns = ({
60
60
  return <div className="daf-default-cell" />
61
61
  }
62
62
 
63
- const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
63
+ // const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
64
+ const region = Object.values(all?.linking?.SCL || {}).find(obj => obj?.level === 'level_1')?.name
64
65
 
65
66
  return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
66
67
  },
@@ -75,7 +76,7 @@ export const getColumns = ({
75
76
  return <div className="daf-default-cell" />
76
77
  }
77
78
 
78
- const district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
79
+ const district = Object.values(all?.linking?.SCL || {}).find(obj => obj?.level === 'level_2')?.name
79
80
 
80
81
  return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
81
82
  },
@@ -11,12 +11,20 @@ function ProductionSites({
11
11
  user = {},
12
12
  goTo = () => {},
13
13
  getRedirectLink = () => {},
14
+ data = [],
15
+ loading = false,
14
16
  }) {
15
- const data = [];
17
+
18
+ const productionSites = useMemo(() => {
19
+ if(Array.isArray(data?.productionSites)) {
20
+ return data?.productionSites;
21
+ }
22
+ return data?.data?.productionSites || [];
23
+ }, [data?.productionSites, data?.data?.productionSites]);
16
24
 
17
25
  const Wrapper = useMemo(() => {
18
- return data.length > 5 ? ComponentWithFocus : "div";
19
- }, [data.length]);
26
+ return productionSites?.length > 5 ? ComponentWithFocus : "div";
27
+ }, [productionSites]);
20
28
 
21
29
  const columns = useMemo(() => {
22
30
  return getColumns({ t, options, user, goTo, getRedirectLink });
@@ -26,6 +34,7 @@ function ProductionSites({
26
34
  <Widget
27
35
  title={t("Production Sites")}
28
36
  className="with-border-header no-px-body"
37
+ loading={loading}
29
38
  >
30
39
  <Wrapper>
31
40
  <Style>
@@ -38,7 +47,7 @@ function ProductionSites({
38
47
  >
39
48
  <StickyTable
40
49
  columns={columns}
41
- dataSource={data}
50
+ dataSource={productionSites || []}
42
51
  hideOnLoading={false}
43
52
  doEmptyRows={true}
44
53
  />
@@ -13,27 +13,29 @@ function SelfAssesment({
13
13
  getRedirectLink = () => {},
14
14
  theme = {},
15
15
  options = {},
16
+ data,
17
+ loading
16
18
  }) {
17
- return (
18
- <DashboardLayout
19
- header={
20
- <Header
21
- title={t("Self Assesment")}
22
- breadcrumbs={breadcrumbs}
23
- />
24
- }
25
- >
26
- <section>
27
- <OrganisationInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} theme={theme} />
28
- </section>
29
- <section>
30
- <ProductionSites t={t} options={options} user={user} goTo={goTo} getRedirectLink={getRedirectLink} />
31
- </section>
32
- <section>
33
- <AssociatedInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} />
34
- </section>
35
- </DashboardLayout>
36
- )
19
+ return (
20
+ <DashboardLayout
21
+ header={
22
+ <Header
23
+ title={t("Self Assessment")}
24
+ breadcrumbs={breadcrumbs}
25
+ />
26
+ }
27
+ >
28
+ <section>
29
+ <OrganisationInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} theme={theme} data={data} loading={loading}/>
30
+ </section>
31
+ <section>
32
+ <ProductionSites t={t} options={options} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} />
33
+ </section>
34
+ <section>
35
+ <AssociatedInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} />
36
+ </section>
37
+ </DashboardLayout>
38
+ )
37
39
  }
38
40
 
39
41
  export default SelfAssesment
@@ -110,7 +110,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
110
110
  return <div className="daf-default-cell" />
111
111
  }
112
112
 
113
- const eventCategory = findOptions(v, data?.options?.eventCategoryOptions);
113
+ const eventCategory = findOptions(v, data?.options?.eventCategoryOptions || data?.options?.categoryOptions);
114
114
  const categoryValue = getEventCategoryBySubject(eventCategory, "correctiveActions", true);
115
115
 
116
116
  return categoryValue ? <Tooltip title={categoryValue}>{categoryValue}</Tooltip> : '-';
@@ -1,3 +1,5 @@
1
+ import { getStatusOptions } from '../../../utils/filters';
2
+
1
3
  export const getFiltersConfig = ({t}) => {
2
4
  return {
3
5
  timeframe: {
@@ -102,15 +104,15 @@ export const getFiltersConfig = ({t}) => {
102
104
  return true;
103
105
  },
104
106
  },
105
- positionInTheMineralSupplyChain: {
106
- type: 'select',
107
- label: 'Position',
108
- placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
109
- style: { flex: 1 },
110
- labelStyle: { flex: 1 },
111
- getLabel: (option) => option.label,
112
- getValue: (option) => option.value,
113
- },
107
+ // positionInTheMineralSupplyChain: {
108
+ // type: 'select',
109
+ // label: 'Position',
110
+ // placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
111
+ // style: { flex: 1 },
112
+ // labelStyle: { flex: 1 },
113
+ // getLabel: (option) => option.label,
114
+ // getValue: (option) => option.value,
115
+ // },
114
116
  status: {
115
117
  type: "select",
116
118
  label: "Status",
@@ -126,44 +128,35 @@ export const getFiltersConfig = ({t}) => {
126
128
  export const getFilterOptions = (options, t) => {
127
129
  const {
128
130
  timeframe = [],
129
- statusOptions = [],
130
- categoryOptions = [],
131
- countries = [],
132
- subCategory = [],
133
- category = [],
131
+ statusOptions,
132
+ categoryOptions,
133
+ countries,
134
+ subCategory,
135
+ category,
134
136
  stakeholderCategoryOptions,
135
137
  stakeholderSubCategoriesOptions,
136
138
  administrativeLevel1,
137
139
  administrativeLevel2,
138
140
  positionInMineralSupplyChainOptions,
139
141
  subCategoriesOptions,
140
- eventCategoryOptions = [],
142
+ eventCategoryOptions,
141
143
  } = options || {};
142
144
 
143
- const _categoryOptions = eventCategoryOptions?.map((item) => ({
145
+ const _categoryOptions = (eventCategoryOptions || categoryOptions || [])?.map((item) => ({
144
146
  value: item.value,
145
147
  label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label,
146
148
  }))
147
149
 
148
150
  const _default = {
149
151
  timeframe: timeframe,
150
- status: [
151
- {
152
- value: "submitted",
153
- label: t("Submitted"),
154
- },
155
- {
156
- value: "private",
157
- label: t("Private"),
158
- },
159
- ],
160
- eventCategory: _categoryOptions,
161
- country: countries,
162
- subCategory: subCategoriesOptions,
152
+ status: getStatusOptions(t) || [],
153
+ eventCategory: _categoryOptions || [],
154
+ country: countries || [],
155
+ subCategory: subCategoriesOptions || [],
163
156
  // category: category,
164
157
  administrativeLevel1,
165
158
  administrativeLevel2,
166
- positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
159
+ // positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions || [],
167
160
  }
168
161
 
169
162
  return _default;
@@ -110,7 +110,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
110
110
  return <div className="daf-default-cell" />
111
111
  }
112
112
 
113
- const eventCategory = findOptions(v, data?.options?.eventCategoryOptions);
113
+ const eventCategory = findOptions(v, data?.options?.eventCategoryOptions || data?.options?.categoryOptions);
114
114
  const categoryValue = getEventCategoryBySubject(eventCategory, subject);
115
115
 
116
116
  return categoryValue ? <Tooltip title={categoryValue}>{categoryValue}</Tooltip> : '-';
@@ -1,3 +1,5 @@
1
+ import { getStatusOptions } from '../../../utils/filters';
2
+
1
3
  export const getFiltersConfig = ({t}) => {
2
4
  return {
3
5
  timeframe: {
@@ -101,15 +103,15 @@ export const getFiltersConfig = ({t}) => {
101
103
  return true;
102
104
  },
103
105
  },
104
- positionInTheMineralSupplyChain: {
105
- type: 'select',
106
- label: 'Position',
107
- placeholder: (t) => `${t('Filter by')} ${t('Position').toLowerCase()}`,
108
- style: { flex: 1 },
109
- labelStyle: { flex: 1 },
110
- getLabel: (option) => option.label,
111
- getValue: (option) => option.value,
112
- },
106
+ // positionInTheMineralSupplyChain: {
107
+ // type: 'select',
108
+ // label: 'Position',
109
+ // placeholder: (t) => `${t('Filter by')} ${t('Position').toLowerCase()}`,
110
+ // style: { flex: 1 },
111
+ // labelStyle: { flex: 1 },
112
+ // getLabel: (option) => option.label,
113
+ // getValue: (option) => option.value,
114
+ // },
113
115
  status: {
114
116
  type: "select",
115
117
  label: "Status",
@@ -125,44 +127,35 @@ export const getFiltersConfig = ({t}) => {
125
127
  export const getFilterOptions = (options, t) => {
126
128
  const {
127
129
  timeframe = [],
128
- statusOptions = [],
129
- categoryOptions = [],
130
- countries = [],
131
- subCategory = [],
132
- category = [],
130
+ statusOptions,
131
+ categoryOptions,
132
+ countries,
133
+ subCategory,
134
+ category,
133
135
  stakeholderCategoryOptions,
134
136
  stakeholderSubCategoriesOptions,
135
137
  administrativeLevel1,
136
138
  administrativeLevel2,
137
139
  positionInMineralSupplyChainOptions,
138
140
  subCategoriesOptions,
139
- eventCategoryOptions = [],
141
+ eventCategoryOptions,
140
142
  } = options || {};
141
143
 
142
- const _categoryOptions = eventCategoryOptions?.map((item) => ({
144
+ const _categoryOptions = (eventCategoryOptions || categoryOptions || [])?.map((item) => ({
143
145
  value: item.value,
144
146
  label: typeof item.label === 'object' ? Object.values(item.label)[0] : item.label,
145
147
  }))
146
148
 
147
149
  const _default = {
148
150
  timeframe: timeframe,
149
- status: [
150
- {
151
- value: "submitted",
152
- label: t("Submitted"),
153
- },
154
- {
155
- value: "private",
156
- label: t("Private"),
157
- },
158
- ],
159
- eventCategory: _categoryOptions,
160
- country: countries,
161
- subCategory: subCategoriesOptions,
151
+ status: getStatusOptions(t) || [],
152
+ eventCategory: _categoryOptions || [],
153
+ country: countries || [],
154
+ subCategory: subCategoriesOptions || [],
162
155
  // category: category,
163
156
  administrativeLevel1,
164
157
  administrativeLevel2,
165
- positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
158
+ // positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions || [],
166
159
  }
167
160
 
168
161
  return _default;
@@ -110,11 +110,11 @@ export const getFiltersConfig = ({t}) => {
110
110
  export const getFilterOptions = (options, t) => {
111
111
  const {
112
112
  timeframe = [],
113
- status = [],
114
- categoryOptions = [],
115
- countries = [],
116
- category=[],
117
- eventCategoryOptions = [],
113
+ status,
114
+ categoryOptions,
115
+ countries,
116
+ category,
117
+ eventCategoryOptions,
118
118
  } = options || {};
119
119
 
120
120
  const catOptions = eventCategoryOptions?.map((item) => ({
@@ -124,8 +124,8 @@ export const getFilterOptions = (options, t) => {
124
124
 
125
125
  return {
126
126
  timeframe: timeframe,
127
- country: countries,
128
- category: catOptions,
127
+ country: countries || [],
128
+ category: catOptions || [],
129
129
  status: [
130
130
  {
131
131
  value: "submitted",
@@ -9,7 +9,7 @@ import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
9
9
  import MoreOptions from '../../../core/components/Table/MoreOptions/index.jsx';
10
10
  import { renderStatusTag } from '../../../utils/tags.js';
11
11
 
12
- export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
12
+ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications, APP}) => [
13
13
  {
14
14
  dataIndex: 'datastakeId',
15
15
  title: t('ID'),
@@ -74,7 +74,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
74
74
  dataIndex: 'category',
75
75
  title: t('type'),
76
76
  ellipsis: true,
77
- show: true,
77
+ show: APP === "wazi",
78
78
  render: (v, all) => {
79
79
  if (all.empty) {
80
80
  return <div className="daf-default-cell" />
@@ -167,7 +167,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
167
167
  label: t("Summary"),
168
168
  value: "Summary",
169
169
  onClick: () => {
170
- let link = `/app/mine-summary/${all.datastakeId}`
170
+ let link = `/app/${subject === 'scl' ? 'summary/scl' : 'mine-summary'}/${all.datastakeId}`
171
171
  if (activeTab === "shared") {
172
172
  link += `?sourceId=${all?.authorId?.id}`;
173
173
  }
@@ -1,3 +1,5 @@
1
+ import { getStatusOptions } from '../../../utils/filters';
2
+
1
3
  export const getFiltersConfig = ({t}) => {
2
4
  return {
3
5
  country: {
@@ -124,28 +126,20 @@ export const getFilterOptions = (options, t) => {
124
126
  administrativeLevel1,
125
127
  administrativeLevel2,
126
128
  mineralOptions,
129
+ minerals,
127
130
  productionSiteCategories,
128
131
  locationCategories = [],
129
132
  } = options || {};
130
133
 
131
134
  const _default = {
132
135
  // category: stakeholderCategoryOptions || categoryOptions,
133
- country: countries,
134
- product: mineralOptions,
135
- category: productionSiteCategories || locationCategories,
136
+ country: countries || [],
137
+ product: mineralOptions || minerals || [],
138
+ category: productionSiteCategories || locationCategories || [],
136
139
  administrativeLevel1,
137
140
  administrativeLevel2,
138
- subCategory: subCategoriesOptions,
139
- status: [
140
- {
141
- value: "submitted",
142
- label: t("Submitted"),
143
- },
144
- {
145
- value: "private",
146
- label: t("Private"),
147
- },
148
- ],
141
+ subCategory: subCategoriesOptions || [],
142
+ status: getStatusOptions(t) || [],
149
143
  }
150
144
 
151
145
  return _default;
@@ -161,4 +155,16 @@ export const formConfig = {
161
155
  export const viewConfig = {
162
156
  title: "Production Sites",
163
157
  createTitle: "Create Production Site",
158
+ }
159
+
160
+ export const sclFormConfig = {
161
+ namespace: 'SCL',
162
+ view: ['scoping', 'new'],
163
+ scope: 'create',
164
+ formType: 'scl',
165
+ }
166
+
167
+ export const sclViewConfig = {
168
+ title: "Mine Sites",
169
+ createTitle: "New Mine Site",
164
170
  }
@@ -21,10 +21,10 @@ export const getFiltersConfig = ({t}) => {
21
21
  }
22
22
 
23
23
  export const getFilterOptions = (options, t) => {
24
- const { countries = [], category = [], locationCategories = [] } = options || {};
24
+ const { countries , category , locationCategories } = options || {};
25
25
  return {
26
- country: countries,
27
- category: locationCategories || category,
26
+ country: countries || [],
27
+ category: locationCategories || category || [],
28
28
  };
29
29
  }
30
30
 
@@ -49,7 +49,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
49
49
  return <div className="daf-default-cell" />
50
50
  }
51
51
 
52
- const country = findOptions(v, data?.options?.positionSupplyChainOptions);
52
+ const country = findOptions(v, data?.options?.positionSupplyChainOptions || data?.options?.optionPositionSupplyChain);
53
53
 
54
54
  return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
55
55
  },
@@ -66,7 +66,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
66
66
  return <div className="daf-default-cell" />
67
67
  }
68
68
 
69
- const subCategory = findOptions(v, data?.options?.subCategoriesOptions);
69
+ const subCategory = findOptions(v, data?.options?.subCategoriesOptions || data?.options?.subCategory);
70
70
 
71
71
  return subCategory ? <Tooltip title={subCategory}>{subCategory}</Tooltip> : '-';
72
72
  },
@@ -1,3 +1,5 @@
1
+ import { getStatusOptions } from '../../../utils/filters';
2
+
1
3
  export const getFiltersConfig = ({t}) => {
2
4
  return {
3
5
  country: {
@@ -75,7 +77,7 @@ export const getFiltersConfig = ({t}) => {
75
77
  subCategory: {
76
78
  type: 'select',
77
79
  label: 'Sub Category',
78
- placeholder: () => `${t('Filter by')} ${t('Sub Category').toLowerCase()}`,
80
+ placeholder: () => `${t('Filter by')} ${t('Legal Form').toLowerCase()}`,
79
81
  style: { flex: 1 },
80
82
  labelStyle: { flex: 1 },
81
83
  getLabel: (option) => option.label,
@@ -119,10 +121,10 @@ export const getFiltersConfig = ({t}) => {
119
121
 
120
122
  export const getFilterOptions = (options, t) => {
121
123
  const {
122
- statusOptions = [],
123
- categoryOptions = [],
124
- countries = [],
125
- subCategory = [],
124
+ statusOptions,
125
+ categoryOptions,
126
+ countries,
127
+ subCategory,
126
128
  subCategoriesOptions,
127
129
  stakeholderCategoryOptions,
128
130
  stakeholderSubCategoriesOptions,
@@ -135,17 +137,8 @@ export const getFilterOptions = (options, t) => {
135
137
  country: countries,
136
138
  administrativeLevel1,
137
139
  administrativeLevel2,
138
- subCategory: subCategoriesOptions,
139
- status: [
140
- {
141
- value: "submitted",
142
- label: t("Submitted"),
143
- },
144
- {
145
- value: "private",
146
- label: t("Private"),
147
- },
148
- ],
140
+ subCategory: subCategoriesOptions || subCategory,
141
+ status: getStatusOptions(t) || [],
149
142
  }
150
143
 
151
144
  return _default;
@@ -66,7 +66,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
66
66
  return <div className="daf-default-cell" />
67
67
  }
68
68
 
69
- const activity = findOptions(v, data?.options?.activityAtSiteOptions);
69
+ const activity = findOptions(v, data?.options?.activityAtSiteOptions || data?.options?.activityAtSite);
70
70
 
71
71
  return activity ? <Tooltip title={activity}>{activity}</Tooltip> : '-';
72
72
  },
@@ -1,3 +1,5 @@
1
+ import { getStatusOptions } from '../../../utils/filters';
2
+
1
3
  export const getFiltersConfig = ({t}) => {
2
4
  return {
3
5
  country: {
@@ -81,15 +83,15 @@ export const getFiltersConfig = ({t}) => {
81
83
  getLabel: (option) => option.label,
82
84
  getValue: (option) => option.value,
83
85
  },
84
- positionInTheMineralSupplyChain: {
85
- type: 'select',
86
- label: 'Position',
87
- placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
88
- style: { flex: 1 },
89
- labelStyle: { flex: 1 },
90
- getLabel: (option) => option.label,
91
- getValue: (option) => option.value,
92
- },
86
+ // positionInTheMineralSupplyChain: {
87
+ // type: 'select',
88
+ // label: 'Position',
89
+ // placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
90
+ // style: { flex: 1 },
91
+ // labelStyle: { flex: 1 },
92
+ // getLabel: (option) => option.label,
93
+ // getValue: (option) => option.value,
94
+ // },
93
95
  status: {
94
96
  type: "select",
95
97
  label: "Status",
@@ -104,37 +106,29 @@ export const getFiltersConfig = ({t}) => {
104
106
 
105
107
  export const getFilterOptions = (options, t) => {
106
108
  const {
107
- statusOptions = [],
108
- categoryOptions = [],
109
- countries = [],
110
- subCategory = [],
111
- activityAtSiteOptions = [],
109
+ statusOptions,
110
+ categoryOptions,
111
+ countries,
112
+ subCategory,
113
+ activityAtSiteOptions,
112
114
  stakeholderCategoryOptions,
113
115
  stakeholderSubCategoriesOptions,
114
116
  administrativeLevel1,
115
117
  administrativeLevel2,
116
118
  positionInMineralSupplyChainOptions,
117
119
  subCategoriesOptions,
120
+ activityAtSite,
118
121
  } = options || {};
119
122
 
120
123
  const _default = {
121
- status: [
122
- {
123
- value: "submitted",
124
- label: t("Submitted"),
125
- },
126
- {
127
- value: "private",
128
- label: t("Private"),
129
- },
130
- ],
131
- category: stakeholderCategoryOptions || categoryOptions,
132
- country: countries,
133
- subCategory: subCategoriesOptions,
134
- activity: activityAtSiteOptions,
124
+ status: getStatusOptions(t) || [],
125
+ // category: stakeholderCategoryOptions || categoryOptions || [],
126
+ country: countries || [],
127
+ // subCategory: subCategoriesOptions || [],
128
+ activity: activityAtSiteOptions || activityAtSite || [],
135
129
  administrativeLevel1,
136
130
  administrativeLevel2,
137
- positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
131
+ // positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
138
132
  }
139
133
 
140
134
  return _default;
@@ -21,10 +21,10 @@ export const getFiltersConfig = ({t}) => {
21
21
  }
22
22
 
23
23
  export const getFilterOptions = (options, t) => {
24
- const { countries = [], category = [], categoriesOptions = [] } = options || {};
24
+ const { countries, category, categoriesOptions } = options || {};
25
25
  return {
26
- country: countries,
27
- category: categoriesOptions || category,
26
+ country: countries || [],
27
+ category: categoriesOptions || category || [],
28
28
  }
29
29
  }
30
30
 
@@ -90,7 +90,7 @@ export const mapItem = (data, options, goTo, getRedirectLink, operatorData = {},
90
90
  );
91
91
  }
92
92
  return goTo(
93
- getRedirectLink(`/app/${APP === 'nashiriki' ? 'summary/operators' : 'operator-summary'}/${data.datastakeId}`),
93
+ getRedirectLink(`/app/operator-summary/${data.datastakeId}`),
94
94
  );
95
95
  },
96
96
  }
@@ -58,7 +58,9 @@ import {
58
58
  getFiltersConfig as getFiltersConfigProductionSites,
59
59
  getFilterOptions as getFilterOptionsProductionSites,
60
60
  formConfig as formConfigProductionSites,
61
- viewConfig as viewConfigProductionSites
61
+ viewConfig as viewConfigProductionSites,
62
+ sclFormConfig as sclFormConfigProductionSites,
63
+ sclViewConfig as sclViewConfigProductionSites
62
64
  } from '../Locations/MineSite/config.js';
63
65
  import { getColumns as getColumnsProductionSites } from "../Locations/MineSite/columns.js";
64
66
 
@@ -106,6 +108,13 @@ export const FILTER_REGISTRY = {
106
108
  formConfig: formConfigActivities,
107
109
  viewConfig: viewConfigActivities,
108
110
  columns: getColumnsActivities,
111
+ },
112
+ 'corrective-actions': {
113
+ config: getFiltersConfigActivities,
114
+ options: getFilterOptionsActivities,
115
+ formConfig: formConfigActivities,
116
+ viewConfig: viewConfigActivities,
117
+ columns: getColumnsActivities,
109
118
  },
110
119
  incidents: {
111
120
  config: getFiltersConfigIncidents,
@@ -127,6 +136,13 @@ export const FILTER_REGISTRY = {
127
136
  formConfig: formConfigProductionSites,
128
137
  viewConfig: viewConfigProductionSites,
129
138
  columns: getColumnsProductionSites,
139
+ },
140
+ scl: {
141
+ config: getFiltersConfigProductionSites,
142
+ options: getFilterOptionsProductionSites,
143
+ formConfig: sclFormConfigProductionSites,
144
+ viewConfig: sclViewConfigProductionSites,
145
+ columns: getColumnsProductionSites,
130
146
  },
131
147
  documents: {
132
148
  config: getFilterConfigDocuments,