datastake-daf 0.6.793 → 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.
- package/dist/components/index.js +56 -36
- package/dist/pages/index.js +2045 -3246
- package/dist/utils/index.js +3 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Map/hook.js +25 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +1 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +0 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +3 -2
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +13 -4
- package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +22 -20
- package/src/@daf/pages/Events/Activities/columns.js +1 -1
- package/src/@daf/pages/Events/Activities/config.js +23 -30
- package/src/@daf/pages/Events/Incidents/columns.js +1 -1
- package/src/@daf/pages/Events/Incidents/config.js +23 -30
- package/src/@daf/pages/Events/config.js +7 -7
- package/src/@daf/pages/Locations/MineSite/columns.js +3 -3
- package/src/@daf/pages/Locations/MineSite/config.js +20 -14
- package/src/@daf/pages/Locations/config.js +3 -3
- package/src/@daf/pages/Stakeholders/Operators/columns.js +2 -2
- package/src/@daf/pages/Stakeholders/Operators/config.js +9 -16
- package/src/@daf/pages/Stakeholders/Workers/columns.js +1 -1
- package/src/@daf/pages/Stakeholders/Workers/config.js +23 -29
- package/src/@daf/pages/Stakeholders/config.js +3 -3
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +1 -1
- package/src/@daf/pages/TablePage/helper.js +17 -1
- package/src/@daf/pages/TablePage/hook.js +3 -1
- package/src/@daf/pages/TablePage/index.jsx +8 -6
- package/src/@daf/pages/View/index.jsx +4 -2
- package/src/@daf/utils/filters.js +13 -0
- package/src/constants/locales/en/translation.js +1 -0
- package/src/constants/locales/fr/translation.js +1 -0
- package/src/constants/locales/sp/translation.js +1 -0
- package/src/pages.js +1 -10
package/dist/utils/index.js
CHANGED
|
@@ -7752,6 +7752,7 @@ function getRedirectPath(user, fallback = '', app, isDatastake) {
|
|
|
7752
7752
|
}
|
|
7753
7753
|
|
|
7754
7754
|
const en = {
|
|
7755
|
+
"All Data": "All Data",
|
|
7755
7756
|
"Site": "Site",
|
|
7756
7757
|
"Production Sites": "Production Sites",
|
|
7757
7758
|
"Type of account": "Type of account",
|
|
@@ -9073,6 +9074,7 @@ const en = {
|
|
|
9073
9074
|
};
|
|
9074
9075
|
|
|
9075
9076
|
const fr = {
|
|
9077
|
+
"All Data": "Toutes les données",
|
|
9076
9078
|
"Site": "Site",
|
|
9077
9079
|
"Production Sites": "Sites de production",
|
|
9078
9080
|
"Type of account": "Type de compte",
|
|
@@ -11028,6 +11030,7 @@ const fr = {
|
|
|
11028
11030
|
};
|
|
11029
11031
|
|
|
11030
11032
|
const sp = {
|
|
11033
|
+
"All Data": "Todos los datos",
|
|
11031
11034
|
"Site": "Sitio",
|
|
11032
11035
|
"Production Sites": "Centros de producción",
|
|
11033
11036
|
"Type of account": "Tipo de cuenta",
|
package/package.json
CHANGED
|
@@ -11,6 +11,21 @@ import {
|
|
|
11
11
|
import { useMapHelper } from "./helper";
|
|
12
12
|
import { isLocation, isStakeholder } from "./ChainIcon/utils";
|
|
13
13
|
|
|
14
|
+
const calculatePolygonArea = (coordinates) => {
|
|
15
|
+
if (!coordinates || !Array.isArray(coordinates) || coordinates.length < 3) return 0;
|
|
16
|
+
let area = 0;
|
|
17
|
+
for (let i = 0; i < coordinates.length; i++) {
|
|
18
|
+
const j = (i + 1) % coordinates.length;
|
|
19
|
+
const lat1 = coordinates[i][0];
|
|
20
|
+
const lng1 = coordinates[i][1];
|
|
21
|
+
const lat2 = coordinates[j][0];
|
|
22
|
+
const lng2 = coordinates[j][1];
|
|
23
|
+
area += lat1 * lng2;
|
|
24
|
+
area -= lng1 * lat2;
|
|
25
|
+
}
|
|
26
|
+
return Math.abs(area / 2);
|
|
27
|
+
};
|
|
28
|
+
|
|
14
29
|
export const useMap = ({
|
|
15
30
|
type,
|
|
16
31
|
data: allData = null,
|
|
@@ -240,7 +255,16 @@ export const useMap = ({
|
|
|
240
255
|
const maxTotal = Math.max(...(data || []).map((d) => d.total));
|
|
241
256
|
|
|
242
257
|
const dataToRender = type === "chain" ? filteredData : data;
|
|
243
|
-
|
|
258
|
+
|
|
259
|
+
const sortedData = type === "territory"
|
|
260
|
+
? [...dataToRender].sort((a, b) => {
|
|
261
|
+
const areaA = calculatePolygonArea(a.area);
|
|
262
|
+
const areaB = calculatePolygonArea(b.area);
|
|
263
|
+
return areaB - areaA;
|
|
264
|
+
})
|
|
265
|
+
: dataToRender;
|
|
266
|
+
|
|
267
|
+
sortedData.forEach((d, i) => {
|
|
244
268
|
addIconToMapInitialy(
|
|
245
269
|
[d?.marker?.lat, d?.marker?.lng],
|
|
246
270
|
"location",
|
|
@@ -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 =
|
|
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
|
-
|
|
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
|
|
19
|
-
}, [
|
|
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={
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
153
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
152
|
-
|
|
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:
|
|
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
|
|
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('
|
|
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
|
},
|