datastake-daf 0.6.783 → 0.6.784
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 +54 -46
- package/dist/hooks/index.js +3 -1
- package/dist/pages/index.js +236 -205
- package/dist/utils/index.js +9 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/BarChart/index.jsx +1 -1
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/utils.js +2 -2
- package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -0
- package/src/@daf/core/components/Select/MultiSelect/index.jsx +4 -2
- package/src/@daf/core/components/Select/MultiSelect/style.js +15 -0
- package/src/@daf/hooks/useGetQueryParams.js +3 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/hook.js +6 -7
- package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/index.jsx +1 -1
- package/src/@daf/pages/Documents/config.js +5 -5
- package/src/@daf/pages/Events/Activities/columns.js +5 -0
- package/src/@daf/pages/Events/Activities/config.js +21 -17
- package/src/@daf/pages/Events/Incidents/columns.js +5 -0
- package/src/@daf/pages/Events/Incidents/config.js +14 -11
- package/src/@daf/pages/Events/columns.js +6 -0
- package/src/@daf/pages/Events/config.js +0 -16
- package/src/@daf/pages/Locations/MineSite/columns.js +5 -1
- package/src/@daf/pages/Locations/MineSite/config.js +21 -24
- package/src/@daf/pages/Partners/columns.js +3 -1
- package/src/@daf/pages/Partners/config.js +13 -9
- package/src/@daf/pages/Partners/create.jsx +5 -2
- package/src/@daf/pages/Partners/edit.jsx +4 -2
- package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -0
- package/src/@daf/pages/Stakeholders/Operators/config.js +8 -8
- package/src/@daf/pages/Stakeholders/Workers/columns.js +19 -13
- package/src/@daf/pages/Stakeholders/Workers/config.js +8 -23
- package/src/@daf/pages/Summary/Minesite/index.jsx +6 -4
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +2 -0
- package/src/@daf/pages/Summary/Operator/index.jsx +6 -3
- package/src/@daf/pages/TablePage/index.jsx +8 -2
- package/src/@daf/pages/Template/components/LinkingTemplate/config.js +14 -1
- package/src/@daf/pages/Template/components/LinkingTemplate/index.jsx +4 -2
- package/src/@daf/pages/Template/index.jsx +1 -10
- package/src/@daf/pages/View/hooks/usePrepareForm.js +4 -4
- package/src/@daf/pages/View/index.jsx +2 -1
- package/src/constants/locales/en/translation.js +3 -0
- package/src/constants/locales/fr/translation.js +3 -0
- package/src/constants/locales/sp/translation.js +3 -0
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'
|
|
|
2
2
|
import { message } from 'antd';
|
|
3
3
|
import PartnerService from '../../services/PartnerService.js';
|
|
4
4
|
import DynamicForm from '../../core/components/DynamicForm/index.jsx';
|
|
5
|
-
import {
|
|
5
|
+
import { getPartnerTypes, getPartnershipTypes } from './config.js';
|
|
6
6
|
|
|
7
7
|
const data = {};
|
|
8
8
|
|
|
@@ -22,6 +22,9 @@ const Create = ({
|
|
|
22
22
|
getApiBaseUrl = () => {},
|
|
23
23
|
}) => {
|
|
24
24
|
|
|
25
|
+
const partnerTypes = useMemo(() => getPartnerTypes(t), [t]);
|
|
26
|
+
const partnershipTypes = useMemo(() => getPartnershipTypes(t), [t]);
|
|
27
|
+
|
|
25
28
|
const form = useMemo(
|
|
26
29
|
() => ({
|
|
27
30
|
identification: {
|
|
@@ -49,7 +52,7 @@ const Create = ({
|
|
|
49
52
|
dataId: "partnerType",
|
|
50
53
|
options: partnerTypes.map((o) => ({ ...o, label: t(o.label) })),
|
|
51
54
|
rules: [{ required: true, message: "errors::field is required" }],
|
|
52
|
-
},
|
|
55
|
+
},
|
|
53
56
|
nickName: {
|
|
54
57
|
label: {
|
|
55
58
|
"partnerType is individual": t("Person name"),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
1
|
+
import React, { useState, useEffect, useMemo } from 'react'
|
|
2
2
|
import { Form, Input, Select } from "antd";
|
|
3
3
|
import PartnerService from '../../services/PartnerService.js';
|
|
4
4
|
import Loading from '../../core/components/Loading/index.jsx';
|
|
5
5
|
import ProjectVisualisationFooter from '../../core/components/ProjectVisualisation/Footer.js';
|
|
6
|
-
import {
|
|
6
|
+
import { getPartnerTypes, getPartnershipTypes } from './config.js';
|
|
7
7
|
import { licensingOptions } from '../../core/components/DataStore/components/Settings/config.js';
|
|
8
8
|
|
|
9
9
|
const Edit = ({
|
|
@@ -14,6 +14,8 @@ const Edit = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
const [MainForm] = Form.useForm();
|
|
16
16
|
const [loading, setLoading] = useState(false);
|
|
17
|
+
const partnerTypes = useMemo(() => getPartnerTypes(t), [t]);
|
|
18
|
+
const partnershipTypes = useMemo(() => getPartnershipTypes(t), [t]);
|
|
17
19
|
|
|
18
20
|
useEffect(() => {
|
|
19
21
|
MainForm.setFieldsValue({ ...partner, licensing: 'no_citation' });
|
|
@@ -14,6 +14,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
14
14
|
title: t('ID'),
|
|
15
15
|
ellipsis: true,
|
|
16
16
|
show: true,
|
|
17
|
+
key: "datastakeId",
|
|
18
|
+
sorter: () => 0 + 0,
|
|
17
19
|
render: (v, all) => {
|
|
18
20
|
if (all.empty) {
|
|
19
21
|
return <div className="daf-default-cell" />
|
|
@@ -27,6 +29,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
27
29
|
title: t('Name'),
|
|
28
30
|
ellipsis: true,
|
|
29
31
|
show: true,
|
|
32
|
+
key: "name",
|
|
33
|
+
sorter: () => 0 + 0,
|
|
30
34
|
render: (v, all) => {
|
|
31
35
|
if (all.empty) {
|
|
32
36
|
return <div className="daf-default-cell" />
|
|
@@ -55,6 +59,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
55
59
|
title: t('Legal Form'),
|
|
56
60
|
ellipsis: true,
|
|
57
61
|
show: true,
|
|
62
|
+
key: "subCategory",
|
|
63
|
+
sorter: () => 0 + 0,
|
|
58
64
|
render: (v, all) => {
|
|
59
65
|
if (all.empty) {
|
|
60
66
|
return <div className="daf-default-cell" />
|
|
@@ -3,7 +3,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
3
3
|
country: {
|
|
4
4
|
type: 'select',
|
|
5
5
|
label: 'Country',
|
|
6
|
-
placeholder: (
|
|
6
|
+
placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
7
7
|
style: { flex: 1 },
|
|
8
8
|
labelStyle: { flex: 1 },
|
|
9
9
|
getLabel: (option) => option.label,
|
|
@@ -27,7 +27,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
27
27
|
|
|
28
28
|
return t('Province');
|
|
29
29
|
},
|
|
30
|
-
placeholder: (
|
|
30
|
+
placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
31
31
|
filters: (data) => ({
|
|
32
32
|
country: data.country,
|
|
33
33
|
level: 'level_1',
|
|
@@ -59,7 +59,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
59
59
|
return t('Province');
|
|
60
60
|
},
|
|
61
61
|
show: (data) => !(data.country && data.administrativeLevel1),
|
|
62
|
-
placeholder: (
|
|
62
|
+
placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
63
63
|
filters: (data) => ({
|
|
64
64
|
country: data.country,
|
|
65
65
|
level: 'level_2',
|
|
@@ -75,7 +75,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
75
75
|
subCategory: {
|
|
76
76
|
type: 'select',
|
|
77
77
|
label: 'Sub Category',
|
|
78
|
-
placeholder: (
|
|
78
|
+
placeholder: () => `${t('Filter by')} ${t('Sub Category').toLowerCase()}`,
|
|
79
79
|
style: { flex: 1 },
|
|
80
80
|
labelStyle: { flex: 1 },
|
|
81
81
|
getLabel: (option) => option.label,
|
|
@@ -99,7 +99,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
99
99
|
positionInTheMineralSupplyChain: {
|
|
100
100
|
type: 'select',
|
|
101
101
|
label: 'Position',
|
|
102
|
-
placeholder: (
|
|
102
|
+
placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
103
103
|
style: { flex: 1 },
|
|
104
104
|
labelStyle: { flex: 1 },
|
|
105
105
|
getLabel: (option) => option.label,
|
|
@@ -108,7 +108,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
108
108
|
status: {
|
|
109
109
|
type: "select",
|
|
110
110
|
label: "Status",
|
|
111
|
-
placeholder: (
|
|
111
|
+
placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
112
112
|
style: { flex: 1 },
|
|
113
113
|
labelStyle: { fley: 1 },
|
|
114
114
|
getLabel: (option) => option.label,
|
|
@@ -139,11 +139,11 @@ export const getFilterOptions = (options, t) => {
|
|
|
139
139
|
status: [
|
|
140
140
|
{
|
|
141
141
|
value: "submitted",
|
|
142
|
-
label: "Submitted",
|
|
142
|
+
label: t("Submitted"),
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
value: "private",
|
|
146
|
-
label: "Private",
|
|
146
|
+
label: t("Private"),
|
|
147
147
|
},
|
|
148
148
|
],
|
|
149
149
|
}
|
|
@@ -8,24 +8,28 @@ import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
|
8
8
|
import { renderStatusTag } from '../../../utils/tags.js';
|
|
9
9
|
|
|
10
10
|
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
{
|
|
12
|
+
dataIndex: 'datastakeId',
|
|
13
|
+
title: t('Title'),
|
|
14
|
+
ellipsis: true,
|
|
15
|
+
show: true,
|
|
16
|
+
key: "datastakeId",
|
|
17
|
+
sorter: () => 0 + 0,
|
|
18
|
+
render: (v, all) => {
|
|
19
|
+
if (all.empty) {
|
|
20
|
+
return <div className="daf-default-cell" />
|
|
21
|
+
}
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
24
26
|
{
|
|
25
27
|
dataIndex: 'name',
|
|
26
28
|
title: t('Name'),
|
|
27
29
|
ellipsis: true,
|
|
28
30
|
show: true,
|
|
31
|
+
key: "name",
|
|
32
|
+
sorter: () => 0 + 0,
|
|
29
33
|
render: (v, all) => {
|
|
30
34
|
if (all.empty) {
|
|
31
35
|
return <div className="daf-default-cell" />
|
|
@@ -36,9 +40,11 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
36
40
|
},
|
|
37
41
|
{
|
|
38
42
|
dataIndex: 'mineSite',
|
|
39
|
-
title: t('
|
|
43
|
+
title: t('Site'),
|
|
40
44
|
ellipsis: true,
|
|
41
45
|
show: true,
|
|
46
|
+
key: "mineSite",
|
|
47
|
+
sorter: () => 0 + 0,
|
|
42
48
|
render: (v, all) => {
|
|
43
49
|
if (all.empty) {
|
|
44
50
|
return <div className="daf-default-cell" />
|
|
@@ -3,7 +3,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
3
3
|
country: {
|
|
4
4
|
type: 'select',
|
|
5
5
|
label: 'Country',
|
|
6
|
-
placeholder: (
|
|
6
|
+
placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
7
7
|
style: { flex: 1 },
|
|
8
8
|
labelStyle: { flex: 1 },
|
|
9
9
|
getLabel: (option) => option.label,
|
|
@@ -27,7 +27,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
27
27
|
|
|
28
28
|
return t('Province');
|
|
29
29
|
},
|
|
30
|
-
placeholder: (
|
|
30
|
+
placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
31
31
|
filters: (data) => ({
|
|
32
32
|
country: data.country,
|
|
33
33
|
level: 'level_1',
|
|
@@ -59,7 +59,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
59
59
|
return t('Province');
|
|
60
60
|
},
|
|
61
61
|
show: (data) => !(data.country && data.administrativeLevel1),
|
|
62
|
-
placeholder: (
|
|
62
|
+
placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
63
63
|
filters: (data) => ({
|
|
64
64
|
country: data.country,
|
|
65
65
|
level: 'level_2',
|
|
@@ -75,31 +75,16 @@ export const getFiltersConfig = ({t}) => {
|
|
|
75
75
|
activity: {
|
|
76
76
|
type: 'select',
|
|
77
77
|
label: 'Activity',
|
|
78
|
-
placeholder: (
|
|
78
|
+
placeholder: () => `${t('Filter by')} ${t('Activity').toLowerCase()}`,
|
|
79
79
|
style: { flex: 1 },
|
|
80
80
|
labelStyle: { flex: 1 },
|
|
81
81
|
getLabel: (option) => option.label,
|
|
82
82
|
getValue: (option) => option.value,
|
|
83
|
-
filterOptions: (val) => {
|
|
84
|
-
if (val) {
|
|
85
|
-
const { option, filters } = val
|
|
86
|
-
if (filters && option) {
|
|
87
|
-
const { filters: optionFilters } = option;
|
|
88
|
-
if (Array.isArray(optionFilters) && optionFilters.length) {
|
|
89
|
-
const { value, condition } = optionFilters[0];
|
|
90
|
-
if (condition === 'includes') {
|
|
91
|
-
return value.includes('corporation');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return true;
|
|
97
|
-
},
|
|
98
83
|
},
|
|
99
84
|
positionInTheMineralSupplyChain: {
|
|
100
85
|
type: 'select',
|
|
101
86
|
label: 'Position',
|
|
102
|
-
placeholder: (
|
|
87
|
+
placeholder: () => `${t('Filter by')} ${t('Position').toLowerCase()}`,
|
|
103
88
|
style: { flex: 1 },
|
|
104
89
|
labelStyle: { flex: 1 },
|
|
105
90
|
getLabel: (option) => option.label,
|
|
@@ -108,7 +93,7 @@ export const getFiltersConfig = ({t}) => {
|
|
|
108
93
|
status: {
|
|
109
94
|
type: "select",
|
|
110
95
|
label: "Status",
|
|
111
|
-
placeholder: (
|
|
96
|
+
placeholder: () => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
112
97
|
style: { flex: 1 },
|
|
113
98
|
labelStyle: { fley: 1 },
|
|
114
99
|
getLabel: (option) => option.label,
|
|
@@ -136,11 +121,11 @@ export const getFilterOptions = (options, t) => {
|
|
|
136
121
|
status: [
|
|
137
122
|
{
|
|
138
123
|
value: "submitted",
|
|
139
|
-
label: "Submitted",
|
|
124
|
+
label: t("Submitted"),
|
|
140
125
|
},
|
|
141
126
|
{
|
|
142
127
|
value: "private",
|
|
143
|
-
label: "Private",
|
|
128
|
+
label: t("Private"),
|
|
144
129
|
},
|
|
145
130
|
],
|
|
146
131
|
category: stakeholderCategoryOptions || categoryOptions,
|
|
@@ -68,13 +68,12 @@ const MineSummary = ({
|
|
|
68
68
|
<DashboardLayout
|
|
69
69
|
header={
|
|
70
70
|
<Header
|
|
71
|
-
title={hasSelect ? t("Mine Review") : (singleItemData?.name || ""
|
|
71
|
+
title={hasSelect ? t("Mine Review") : (`${singleItemData?.name || ""} ${singleItemData?.name ? t("Summary") : ""}`)}
|
|
72
72
|
className="with-border-header h-w-btn-header no-px-body"
|
|
73
73
|
goBackTo={!hasSelect && goBack}
|
|
74
|
-
loading={loading}
|
|
75
74
|
breadcrumbs={breadcrumbs}
|
|
76
75
|
addedHeaderFirst
|
|
77
|
-
actionButtons={[
|
|
76
|
+
actionButtons={hasSelect ? [] :[
|
|
78
77
|
{
|
|
79
78
|
tooltip: t("Details"),
|
|
80
79
|
icon: "FileEdit",
|
|
@@ -90,7 +89,7 @@ const MineSummary = ({
|
|
|
90
89
|
},
|
|
91
90
|
]}
|
|
92
91
|
addedHeader={
|
|
93
|
-
<div className="flex flex-row gap-4"
|
|
92
|
+
<div className="flex flex-row gap-4">
|
|
94
93
|
<Multiselect
|
|
95
94
|
options={[...sourceOptions]}
|
|
96
95
|
isAvatarGroup
|
|
@@ -109,6 +108,9 @@ const MineSummary = ({
|
|
|
109
108
|
/>
|
|
110
109
|
</div>
|
|
111
110
|
}
|
|
111
|
+
onDownload={() => {
|
|
112
|
+
console.log("onDownload");
|
|
113
|
+
}}
|
|
112
114
|
/>
|
|
113
115
|
}
|
|
114
116
|
>
|
|
@@ -69,12 +69,12 @@ const OperatorSummary = ({
|
|
|
69
69
|
<DashboardLayout
|
|
70
70
|
header={
|
|
71
71
|
<Header
|
|
72
|
-
title={hasSelect ? t("Operator Review") : (singleItemData?.name || ""
|
|
72
|
+
title={hasSelect ? t("Operator Review") : (`${singleItemData?.name || ""} ${singleItemData?.name ? t("Summary") : ""}`)}
|
|
73
73
|
className="with-border-header h-w-btn-header no-px-body"
|
|
74
74
|
goBackTo={!hasSelect && goBack}
|
|
75
75
|
breadcrumbs={breadcrumbs}
|
|
76
76
|
addedHeaderFirst
|
|
77
|
-
actionButtons={[
|
|
77
|
+
actionButtons={hasSelect ? [] :[
|
|
78
78
|
{
|
|
79
79
|
tooltip: t("Details"),
|
|
80
80
|
icon: "FileEdit",
|
|
@@ -90,7 +90,7 @@ const OperatorSummary = ({
|
|
|
90
90
|
},
|
|
91
91
|
]}
|
|
92
92
|
addedHeader={
|
|
93
|
-
<div className="flex flex-row gap-4"
|
|
93
|
+
<div className="flex flex-row gap-4">
|
|
94
94
|
<Multiselect
|
|
95
95
|
options={[...sourceOptions]}
|
|
96
96
|
isAvatarGroup
|
|
@@ -109,6 +109,9 @@ const OperatorSummary = ({
|
|
|
109
109
|
/>
|
|
110
110
|
</div>
|
|
111
111
|
}
|
|
112
|
+
onDownload={() => {
|
|
113
|
+
console.log("onDownload");
|
|
114
|
+
}}
|
|
112
115
|
/>
|
|
113
116
|
}
|
|
114
117
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import TablePageWithTabs from '../../core/components/Screens/TableScreen/TablePageWithTabs/index.jsx';
|
|
3
3
|
import Create from './create.jsx';
|
|
4
4
|
import { displayMessage } from '../../../helpers/messages.js';
|
|
@@ -40,6 +40,12 @@ const TablePage = ({
|
|
|
40
40
|
breadcrumbs = [],
|
|
41
41
|
onDownload,
|
|
42
42
|
}) => {
|
|
43
|
+
const _options = useMemo(() => {
|
|
44
|
+
return {
|
|
45
|
+
...options,
|
|
46
|
+
...data?.options,
|
|
47
|
+
}
|
|
48
|
+
},[options, data?.options])
|
|
43
49
|
|
|
44
50
|
const {
|
|
45
51
|
activeTab,
|
|
@@ -56,7 +62,7 @@ const TablePage = ({
|
|
|
56
62
|
location,
|
|
57
63
|
getData,
|
|
58
64
|
extendingFilters,
|
|
59
|
-
options,
|
|
65
|
+
options: _options,
|
|
60
66
|
t,
|
|
61
67
|
goTo,
|
|
62
68
|
user,
|
|
@@ -72,4 +72,17 @@ export const renderType = ({ item = {}, t = (s) => s }) => {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return "--";
|
|
75
|
-
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const namespaceMap = {
|
|
78
|
+
locations: "location",
|
|
79
|
+
documents: "document",
|
|
80
|
+
stakeholders: "stakeholder",
|
|
81
|
+
events: "event",
|
|
82
|
+
incidents: "event",
|
|
83
|
+
correctiveActions: "event",
|
|
84
|
+
"production-sites": "location",
|
|
85
|
+
operators: "stakeholder",
|
|
86
|
+
workers: "stakeholder",
|
|
87
|
+
activities: "event",
|
|
88
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
2
|
import { useFilters } from '../../../../hooks/useFilters.js';
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
|
-
import { redirect } from './config.js';
|
|
4
|
+
import { redirect, namespaceMap } from './config.js';
|
|
5
5
|
import LinkedSubjectsService from '../../../../services/LinkedSubjects.js';
|
|
6
6
|
import { formatClassname } from '../../../../../helpers/ClassesHelper.js';
|
|
7
7
|
import Table from '../../../../core/components/Table/index.jsx';
|
|
@@ -44,9 +44,11 @@ const LinkingTemplate = ({
|
|
|
44
44
|
|
|
45
45
|
const dataSource = conf?.linkingTemplateContextData?.[id];
|
|
46
46
|
|
|
47
|
+
const _namespace = namespaceMap[namespace];
|
|
48
|
+
|
|
47
49
|
const changeData = async () => {
|
|
48
50
|
try {
|
|
49
|
-
const _data = await LinkedSubjectsService.getLinkedSubjects({ namespace, id, mod: conf.mod });
|
|
51
|
+
const _data = await LinkedSubjectsService.getLinkedSubjects({ namespace: _namespace, id, mod: conf.mod });
|
|
50
52
|
const data = (_data?.data || []).map((d, i) => ({ ...d, key: `${d.id}-${i}` }));
|
|
51
53
|
conf?.addData(id, data);
|
|
52
54
|
setPagination((prev) => ({
|
|
@@ -6,14 +6,5 @@ export function Template({
|
|
|
6
6
|
conf,
|
|
7
7
|
namespace,
|
|
8
8
|
}) {
|
|
9
|
-
|
|
10
|
-
case 'locations':
|
|
11
|
-
case 'documents':
|
|
12
|
-
case 'stakeholders':
|
|
13
|
-
case 'events':
|
|
14
|
-
return <LinkingTemplate conf={conf} namespace={namespace} />
|
|
15
|
-
default:
|
|
16
|
-
return null;
|
|
17
|
-
|
|
18
|
-
}
|
|
9
|
+
return <LinkingTemplate conf={conf} namespace={namespace} />
|
|
19
10
|
}
|
|
@@ -31,7 +31,7 @@ export const usePrepareForm = ({
|
|
|
31
31
|
} = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
|
|
32
32
|
|
|
33
33
|
if (data.datastakeId === id || id === "user") {
|
|
34
|
-
|
|
34
|
+
// if (viewConfig.linkingSubjects.includes(namespace)) {
|
|
35
35
|
setForm({
|
|
36
36
|
...form,
|
|
37
37
|
linking: {
|
|
@@ -41,9 +41,9 @@ export const usePrepareForm = ({
|
|
|
41
41
|
template: "linkingSubjects",
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
// } else {
|
|
45
|
+
// setForm(form);
|
|
46
|
+
// }
|
|
47
47
|
setData(data);
|
|
48
48
|
setGroups(config.groups || {});
|
|
49
49
|
setLinkingForms(linkingForms);
|
|
@@ -227,13 +227,14 @@ const View = ({
|
|
|
227
227
|
extraButtons={extraPageActions}
|
|
228
228
|
addedHeaderFirst
|
|
229
229
|
addedHeader={
|
|
230
|
-
<div className="flex flex-row gap-4"
|
|
230
|
+
<div className="flex flex-row gap-4">
|
|
231
231
|
<Multiselect
|
|
232
232
|
options={[...sourceOptions]}
|
|
233
233
|
isAvatarGroup
|
|
234
234
|
selectionType="checkbox"
|
|
235
235
|
key={partners?.length}
|
|
236
236
|
canUnselectLast={false}
|
|
237
|
+
isSingle
|
|
237
238
|
onChange={(selected) => {
|
|
238
239
|
setSelectedPartners((prev) => ({
|
|
239
240
|
...prev,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
const sp = {
|
|
2
|
+
"Site": "Sitio",
|
|
3
|
+
"Production Sites": "Centros de producción",
|
|
4
|
+
"Type of account": "Tipo de cuenta",
|
|
2
5
|
"Identified Customers": "Clientes identificados",
|
|
3
6
|
"Identified Suppliers": "Proveedores identificados",
|
|
4
7
|
"Associated Mine Sites": "Sitios mineros asociados",
|