datastake-daf 0.6.743 → 0.6.745
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 +549 -893
- package/dist/context/index.js +0 -3
- package/dist/hooks/index.js +19 -4658
- package/dist/layouts/index.js +573 -916
- package/dist/pages/index.js +2630 -1243
- package/dist/services/index.js +3 -9
- package/dist/utils/index.js +466 -808
- package/package.json +3 -1
- package/rollup.config.js +7 -2
- package/src/@daf/core/components/DynamicForm/components/ajaxModal.js +1 -1
- package/src/@daf/core/components/EditForm/components/Comment/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLink/ajaxSelectDataLink.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLink/flat.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLink/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLinkGroup/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/Repeatable/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/ajaxSelect.js +1 -1
- package/src/@daf/core/components/EditForm/components/geolocation.js +1 -0
- package/src/@daf/core/components/EditForm/helper.js +0 -4
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineAccount/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +1 -1
- package/src/@daf/layouts/AppLayout/index.jsx +5 -4
- package/src/@daf/layouts/AuthLayout/components/Select/style.js +1 -1
- package/src/@daf/layouts/AuthLayout/style.js +1 -1
- package/src/@daf/pages/Documents/columns.js +102 -0
- package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/create.jsx +7 -6
- package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/index.jsx +20 -27
- package/src/@daf/pages/Events/Activities/columns.js +222 -0
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/index.jsx +6 -6
- package/src/@daf/pages/{dashboards/DueDilligence/Activities → Events/Incidents}/columns.js +5 -5
- package/src/@daf/pages/Events/Incidents/create.jsx +104 -0
- package/src/@daf/pages/Events/Incidents/index.jsx +157 -0
- package/src/@daf/pages/Events/Incidents2/columns.js +176 -0
- package/src/@daf/pages/Events/Incidents2/config.js +170 -0
- package/src/@daf/pages/Events/Incidents2/create.jsx +104 -0
- package/src/@daf/pages/Events/Incidents2/index.jsx +156 -0
- package/src/@daf/pages/Events/columns.js +226 -0
- package/src/@daf/pages/Events/config.js +183 -0
- package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/create.jsx +4 -4
- package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/index.jsx +13 -9
- package/src/@daf/pages/{dashboards/AllInformation/Events → Locations/MineSite}/columns.js +52 -53
- package/src/@daf/pages/Locations/MineSite/config.js +165 -0
- package/src/@daf/pages/Locations/MineSite/create.jsx +104 -0
- package/src/@daf/pages/Locations/MineSite/index.jsx +155 -0
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/create.jsx +3 -3
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/index.jsx +13 -5
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/columns.js +5 -5
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/columns.js +6 -6
- package/src/@daf/pages/Stakeholders/Workers/config.js +166 -0
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/create.jsx +3 -3
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/index.jsx +14 -6
- package/src/@daf/pages/dashboards/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -2
- package/src/@daf/pages/dashboards/UserDashboard/components/KeyIndicators/config.js +2 -2
- package/src/@daf/pages/dashboards/UserDashboard/components/MineSites/index.jsx +1 -5
- package/src/@daf/pages/dashboards/UserDashboard/config.js +2 -2
- package/src/@daf/pages/pages/TablePageWithTabs/index.jsx +2 -2
- package/src/@daf/services/AuthenticationService.js +0 -1
- package/src/@daf/services/LinkedSubjects.js +3 -4
- package/src/pages.js +10 -7
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/src/@daf/pages/dashboards/AllInformation/Documents/columns.js +0 -107
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/config.js +0 -31
- /package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations/Workers → Events/Incidents}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Events → Locations}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Locations → Stakeholders}/config.js +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export const checkboxConfig = {
|
|
2
|
+
name: 'Name',
|
|
3
|
+
datastakeId: 'ID'
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const getFiltersConfig = ({t}) => {
|
|
7
|
+
return {
|
|
8
|
+
country: {
|
|
9
|
+
type: 'select',
|
|
10
|
+
label: 'Country',
|
|
11
|
+
placeholder: (t) => `${t('Filter by')} ${t('Country').toLowerCase()}`,
|
|
12
|
+
style: { flex: 1 },
|
|
13
|
+
labelStyle: { flex: 1 },
|
|
14
|
+
getLabel: (option) => option.label,
|
|
15
|
+
getValue: (option) => option.value,
|
|
16
|
+
},
|
|
17
|
+
administrativeLevel1: {
|
|
18
|
+
type: 'ajaxSelect',
|
|
19
|
+
label: ({ t = (s) => s, options = {}, filters = {}, language = 'en' }) => {
|
|
20
|
+
const { administrativeLevel1 } = options;
|
|
21
|
+
|
|
22
|
+
if (administrativeLevel1) {
|
|
23
|
+
if (options.country) {
|
|
24
|
+
const _item = administrativeLevel1[filters.country];
|
|
25
|
+
if (_item) {
|
|
26
|
+
if (_item[language]) {
|
|
27
|
+
return _item[language]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return t('Province');
|
|
34
|
+
},
|
|
35
|
+
placeholder: (t) => `${t('Filter by')} ${t('Province').toLowerCase()}`,
|
|
36
|
+
filters: (data) => ({
|
|
37
|
+
country: data.country,
|
|
38
|
+
level: 'level_1',
|
|
39
|
+
}),
|
|
40
|
+
show: (data) => !data.country,
|
|
41
|
+
disabled: (data) => !data.country,
|
|
42
|
+
mapper: { label: "name", value: "id" },
|
|
43
|
+
method: 'getOptions',
|
|
44
|
+
entity: 'AdministrativeLevel',
|
|
45
|
+
style: { flex: 1 },
|
|
46
|
+
labelStyle: { flex: 1 },
|
|
47
|
+
},
|
|
48
|
+
administrativeLevel2: {
|
|
49
|
+
type: 'ajaxSelect',
|
|
50
|
+
label: ({ t = (s) => s, options = {}, filters = {}, language = 'en' }) => {
|
|
51
|
+
const { administrativeLevel2 } = options;
|
|
52
|
+
|
|
53
|
+
if (administrativeLevel2) {
|
|
54
|
+
if (options.country) {
|
|
55
|
+
const _item = administrativeLevel2[filters.country];
|
|
56
|
+
if (_item) {
|
|
57
|
+
if (_item[language]) {
|
|
58
|
+
return _item[language]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return t('Province');
|
|
65
|
+
},
|
|
66
|
+
show: (data) => !(data.country && data.administrativeLevel1),
|
|
67
|
+
placeholder: (t) => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
|
|
68
|
+
filters: (data) => ({
|
|
69
|
+
country: data.country,
|
|
70
|
+
level: 'level_2',
|
|
71
|
+
administrativeLevel1: data.administrativeLevel1,
|
|
72
|
+
}),
|
|
73
|
+
disabled: (data) => !(data.country && data.administrativeLevel1),
|
|
74
|
+
mapper: { label: "name", value: "id" },
|
|
75
|
+
method: 'getOptions',
|
|
76
|
+
entity: 'AdministrativeLevel',
|
|
77
|
+
style: { flex: 1 },
|
|
78
|
+
labelStyle: { flex: 1 },
|
|
79
|
+
},
|
|
80
|
+
activity: {
|
|
81
|
+
type: 'select',
|
|
82
|
+
label: 'Activity',
|
|
83
|
+
placeholder: (t) => `${t('Filter by')} ${t('Activity').toLowerCase()}`,
|
|
84
|
+
style: { flex: 1 },
|
|
85
|
+
labelStyle: { flex: 1 },
|
|
86
|
+
getLabel: (option) => option.label,
|
|
87
|
+
getValue: (option) => option.value,
|
|
88
|
+
filterOptions: (val) => {
|
|
89
|
+
if (val) {
|
|
90
|
+
const { option, filters } = val
|
|
91
|
+
if (filters && option) {
|
|
92
|
+
const { filters: optionFilters } = option;
|
|
93
|
+
if (Array.isArray(optionFilters) && optionFilters.length) {
|
|
94
|
+
const { value, condition } = optionFilters[0];
|
|
95
|
+
if (condition === 'includes') {
|
|
96
|
+
return value.includes('corporation');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
},
|
|
103
|
+
},
|
|
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
|
+
},
|
|
113
|
+
status: {
|
|
114
|
+
type: "select",
|
|
115
|
+
label: "Status",
|
|
116
|
+
placeholder: (t) => `${t("Filter by")} ${t("Status").toLowerCase()}`,
|
|
117
|
+
style: { flex: 1 },
|
|
118
|
+
labelStyle: { fley: 1 },
|
|
119
|
+
getLabel: (option) => option.label,
|
|
120
|
+
getValue: (option) => option.value,
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const filtersConfig = {
|
|
126
|
+
name: '',
|
|
127
|
+
datastakeId: '',
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const getFilterOptions = (options, t) => {
|
|
131
|
+
const {
|
|
132
|
+
statusOptions = [],
|
|
133
|
+
categoryOptions = [],
|
|
134
|
+
countries = [],
|
|
135
|
+
subCategory = [],
|
|
136
|
+
activityAtSiteOptions = [],
|
|
137
|
+
stakeholderCategoryOptions,
|
|
138
|
+
stakeholderSubCategoriesOptions,
|
|
139
|
+
administrativeLevel1,
|
|
140
|
+
administrativeLevel2,
|
|
141
|
+
positionInMineralSupplyChainOptions,
|
|
142
|
+
subCategoriesOptions,
|
|
143
|
+
} = options || {};
|
|
144
|
+
|
|
145
|
+
const _default = {
|
|
146
|
+
status: [
|
|
147
|
+
{
|
|
148
|
+
value: "submitted",
|
|
149
|
+
label: "Submitted",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
value: "private",
|
|
153
|
+
label: "Private",
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
category: stakeholderCategoryOptions || categoryOptions,
|
|
157
|
+
country: countries,
|
|
158
|
+
subCategory: subCategoriesOptions,
|
|
159
|
+
activity: activityAtSiteOptions,
|
|
160
|
+
administrativeLevel1,
|
|
161
|
+
administrativeLevel2,
|
|
162
|
+
positionInTheMineralSupplyChain: positionInMineralSupplyChainOptions,
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return _default;
|
|
166
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect} from 'react'
|
|
2
2
|
import { message } from 'antd';
|
|
3
|
-
import { MessageTypes } from '
|
|
4
|
-
import DynamicForm from '
|
|
3
|
+
import { MessageTypes } from '../../../../helpers/messages.js';
|
|
4
|
+
import DynamicForm from '../../../core/components/DynamicForm/index.jsx';
|
|
5
5
|
|
|
6
6
|
const StakeholdersCreate = ({
|
|
7
7
|
namespace = "WORKERS",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../../pages/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
|
-
import { useGetQueryParams } from '
|
|
5
|
+
import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
|
|
6
6
|
import StakeholdersCreate from './create.jsx';
|
|
7
|
-
import { displayMessage } from '
|
|
7
|
+
import { displayMessage } from '../../../../helpers/messages.js';
|
|
8
8
|
|
|
9
9
|
const WorkersTable = ({
|
|
10
10
|
t = () => {},
|
|
@@ -37,7 +37,7 @@ const WorkersTable = ({
|
|
|
37
37
|
applications = [],
|
|
38
38
|
}) => {
|
|
39
39
|
const [selectOptions, setSelectOptions] = useState();
|
|
40
|
-
const [activeTab, setActiveTab] = useState();
|
|
40
|
+
const [activeTab, setActiveTab] = useState('own');
|
|
41
41
|
|
|
42
42
|
const columns = useMemo(() => getColumns({
|
|
43
43
|
t,
|
|
@@ -99,7 +99,7 @@ const WorkersTable = ({
|
|
|
99
99
|
location={location}
|
|
100
100
|
loading={loading}
|
|
101
101
|
goTo={goTo}
|
|
102
|
-
defaultActiveTab={"
|
|
102
|
+
defaultActiveTab={"own"}
|
|
103
103
|
columns={columns}
|
|
104
104
|
data={data}
|
|
105
105
|
checkboxConfig={checkboxConfig}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Tooltip } from 'antd';
|
|
3
|
-
import { findOptions } from '
|
|
4
|
-
import { renderDateFormatted } from '
|
|
5
|
-
import CustomIcon from '
|
|
6
|
-
import AvatarGroup from '
|
|
7
|
-
import sourceAvatarConfig from '
|
|
3
|
+
import { findOptions } from '../../../helpers/StringHelper.js';
|
|
4
|
+
import { renderDateFormatted } from '../../../helpers/Forms.js';
|
|
5
|
+
import CustomIcon from '../../core/components/Icon/CustomIcon.jsx';
|
|
6
|
+
import AvatarGroup from '../../core/components/AvatarGroup/index.jsx';
|
|
7
|
+
import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
|
|
8
8
|
|
|
9
9
|
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, applications}) => [
|
|
10
10
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect} from 'react'
|
|
2
2
|
import { message } from 'antd';
|
|
3
|
-
import { MessageTypes } from '
|
|
4
|
-
import DynamicForm from '
|
|
3
|
+
import { MessageTypes } from '../../../helpers/messages.js';
|
|
4
|
+
import DynamicForm from '../../core/components/DynamicForm/index.jsx';
|
|
5
5
|
|
|
6
6
|
const StakeholdersCreate = ({
|
|
7
7
|
namespace = 'stakeholders',
|
|
@@ -39,7 +39,7 @@ const StakeholdersCreate = ({
|
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
if (Object.keys(form).length === 0 && !formData[`${APP}-${view}`]) {
|
|
41
41
|
if (!edit) {
|
|
42
|
-
getData({ namespace, module: APP, view, scope: '
|
|
42
|
+
getData({ namespace, module: APP, view, scope: 'create' });
|
|
43
43
|
} else {
|
|
44
44
|
form = formConfig;
|
|
45
45
|
data = formValue;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useMemo, useState, useEffect, useCallback } from 'react'
|
|
2
|
-
import TablePageWithTabs from '
|
|
2
|
+
import TablePageWithTabs from '../pages/TablePageWithTabs/index.jsx'
|
|
3
3
|
import { getColumns } from './columns.js';
|
|
4
4
|
import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
|
|
5
|
-
import { useGetQueryParams } from '
|
|
5
|
+
import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
|
|
6
6
|
import StakeholdersCreate from './create.jsx';
|
|
7
|
-
import { displayMessage } from '
|
|
7
|
+
import { displayMessage } from '../../../helpers/messages.js';
|
|
8
8
|
|
|
9
9
|
const StakeholdersTable = ({
|
|
10
10
|
t = () => {},
|
|
@@ -33,9 +33,10 @@ const StakeholdersTable = ({
|
|
|
33
33
|
formValue = {},
|
|
34
34
|
form = {},
|
|
35
35
|
applications = [],
|
|
36
|
+
subjectClear = () => {},
|
|
36
37
|
}) => {
|
|
37
38
|
const [selectOptions, setSelectOptions] = useState();
|
|
38
|
-
const [activeTab, setActiveTab] = useState();
|
|
39
|
+
const [activeTab, setActiveTab] = useState("own");
|
|
39
40
|
const columns = useMemo(() => getColumns({
|
|
40
41
|
t,
|
|
41
42
|
goTo,
|
|
@@ -76,6 +77,13 @@ const StakeholdersTable = ({
|
|
|
76
77
|
setActiveTab(value);
|
|
77
78
|
}, []);
|
|
78
79
|
|
|
80
|
+
useEffect(
|
|
81
|
+
() => () => {
|
|
82
|
+
subjectClear();
|
|
83
|
+
},
|
|
84
|
+
[],
|
|
85
|
+
);
|
|
86
|
+
|
|
79
87
|
return (
|
|
80
88
|
<TablePageWithTabs
|
|
81
89
|
t={t}
|
|
@@ -84,7 +92,7 @@ const StakeholdersTable = ({
|
|
|
84
92
|
location={location}
|
|
85
93
|
loading={loading}
|
|
86
94
|
goTo={goTo}
|
|
87
|
-
defaultActiveTab={"
|
|
95
|
+
defaultActiveTab={"own"}
|
|
88
96
|
columns={columns}
|
|
89
97
|
data={data}
|
|
90
98
|
checkboxConfig={checkboxConfig}
|
|
@@ -119,7 +127,7 @@ const StakeholdersTable = ({
|
|
|
119
127
|
type,
|
|
120
128
|
t("affirmations::subject-created-successfully") || m,
|
|
121
129
|
);
|
|
122
|
-
goTo(`/app/stakeholders`);
|
|
130
|
+
goTo(`/app/edit/stakeholders/${data.datastakeId}`);
|
|
123
131
|
}
|
|
124
132
|
}}
|
|
125
133
|
onCancel={onDrawerClose}
|
|
@@ -48,7 +48,7 @@ export const getRowConfig = ({ t, data = {}, goTo, getRedirectLink, theme = {} }
|
|
|
48
48
|
<div className="flex-1">{t("Corrective Actions")}</div>
|
|
49
49
|
<div
|
|
50
50
|
className="cursor-pointer"
|
|
51
|
-
onClick={() => goTo(getRedirectLink("/app/
|
|
51
|
+
onClick={() => goTo(getRedirectLink("/app/activities"))}
|
|
52
52
|
>
|
|
53
53
|
<CustomIcon
|
|
54
54
|
name="LinkNewTab"
|
|
@@ -77,7 +77,7 @@ export const getRowConfig = ({ t, data = {}, goTo, getRedirectLink, theme = {} }
|
|
|
77
77
|
<div className="flex-1">{t("Reported Incidents")}</div>
|
|
78
78
|
<div
|
|
79
79
|
className="cursor-pointer"
|
|
80
|
-
onClick={() => goTo(getRedirectLink("/app/
|
|
80
|
+
onClick={() => goTo(getRedirectLink("/app/incidents"))}
|
|
81
81
|
>
|
|
82
82
|
<CustomIcon
|
|
83
83
|
name="LinkNewTab"
|
|
@@ -63,11 +63,7 @@ function MineSites({
|
|
|
63
63
|
}),
|
|
64
64
|
[activeTab, selectedPartners],
|
|
65
65
|
);
|
|
66
|
-
|
|
67
|
-
console.log({activeTab})
|
|
68
|
-
console.log({dataFetchConfig})
|
|
69
|
-
|
|
70
|
-
const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
|
|
66
|
+
const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
|
|
71
67
|
|
|
72
68
|
const tabs = useMemo(() => getTabs(t), [t]);
|
|
73
69
|
|
|
@@ -7,12 +7,12 @@ export const getActionWidgetsConfig = ({ goTo, getRedirectLink, APP, t }) => [
|
|
|
7
7
|
{
|
|
8
8
|
icon: "FileEdit",
|
|
9
9
|
title: "Report Activity",
|
|
10
|
-
onClick: () => goTo(getRedirectLink("/app/
|
|
10
|
+
onClick: () => goTo(getRedirectLink("/app/activities?create=true")),
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
icon: "ReportIncidents",
|
|
14
14
|
title: "Report Incident",
|
|
15
|
-
onClick: () => goTo(getRedirectLink("/app/
|
|
15
|
+
onClick: () => goTo(getRedirectLink("/app/incidents?create=true")),
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
icon: "Search",
|
|
@@ -33,7 +33,7 @@ const TablePageWithTabs = ({
|
|
|
33
33
|
}) => {
|
|
34
34
|
const params = new URLSearchParams(location?.search);
|
|
35
35
|
const [activeTab, setActiveTab] = useState(params.get("tab") || defaultActiveTab);
|
|
36
|
-
const [openCreateModal, setOpenCreateModal] = useState(
|
|
36
|
+
const [openCreateModal, setOpenCreateModal] = useState(params.has("create"));
|
|
37
37
|
|
|
38
38
|
const getActiveTabRef = useRef(getActiveTab);
|
|
39
39
|
useEffect(() => {
|
|
@@ -103,7 +103,7 @@ const TablePageWithTabs = ({
|
|
|
103
103
|
/>
|
|
104
104
|
{openCreateModal && (
|
|
105
105
|
<Drawer
|
|
106
|
-
|
|
106
|
+
destroyOnHidden
|
|
107
107
|
title={
|
|
108
108
|
<DrawerHeader
|
|
109
109
|
title={t(drawerTitle)}
|
|
@@ -4,7 +4,6 @@ import { filterCreateData } from "../../helpers/Forms.js";
|
|
|
4
4
|
import { removeKeysFromObject } from "../utils/object.js";
|
|
5
5
|
|
|
6
6
|
export const getNamespace = (namespace) => {
|
|
7
|
-
console.log({namespace})
|
|
8
7
|
let _namespace = namespace;
|
|
9
8
|
switch (namespace) {
|
|
10
9
|
case "locations":
|
|
@@ -27,12 +26,12 @@ export const getNamespace = (namespace) => {
|
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
class LinkedSubjectsService extends BaseService {
|
|
30
|
-
getForm({ namespace }, language = "en") {
|
|
29
|
+
getForm({ namespace }, language = "en", scope) {
|
|
31
30
|
return this.apiGet({
|
|
32
31
|
url: `forms/${namespace === "documents" ? namespace : getNamespace(namespace)}`,
|
|
33
32
|
isApp: true,
|
|
34
33
|
params: {
|
|
35
|
-
scope:"create",
|
|
34
|
+
scope: scope || "create",
|
|
36
35
|
language,
|
|
37
36
|
},
|
|
38
37
|
});
|
|
@@ -117,7 +116,7 @@ class LinkedSubjectsService extends BaseService {
|
|
|
117
116
|
url: `/forms/options`,
|
|
118
117
|
isApp: true,
|
|
119
118
|
params: {
|
|
120
|
-
id: "categoryOptions,locationCategories,countries,category,subCategory,optionPositionSupplyChain",
|
|
119
|
+
id: "categoryOptions,eventsType,locationCategories,countries,category,subCategory,optionPositionSupplyChain",
|
|
121
120
|
},
|
|
122
121
|
});
|
|
123
122
|
}
|
package/src/pages.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
// Dashboards
|
|
2
2
|
export { default as SupplyChainDashboard } from './@daf/pages/dashboards/SupplyChain/index.jsx';
|
|
3
3
|
export { default as UserDashboard } from './@daf/pages/dashboards/UserDashboard/index.jsx';
|
|
4
|
-
export { default as OperatorsTable } from './@daf/pages/
|
|
5
|
-
export { default as LocationsTable } from './@daf/pages/
|
|
6
|
-
export { default as StakeholdersTable } from './@daf/pages/
|
|
7
|
-
export { default as EventsTable } from './@daf/pages/
|
|
8
|
-
export { default as DocumentsTable } from './@daf/pages/
|
|
9
|
-
export { default as WorkersTable } from './@daf/pages/
|
|
10
|
-
export { default as ActivitiesTable } from './@daf/pages/
|
|
4
|
+
export { default as OperatorsTable } from './@daf/pages/Stakeholders/Operators/index.jsx';
|
|
5
|
+
export { default as LocationsTable } from './@daf/pages/Locations/index.jsx';
|
|
6
|
+
export { default as StakeholdersTable } from './@daf/pages/Stakeholders/index.jsx';
|
|
7
|
+
export { default as EventsTable } from './@daf/pages/Events/index.jsx';
|
|
8
|
+
export { default as DocumentsTable } from './@daf/pages/Documents/index.jsx';
|
|
9
|
+
export { default as WorkersTable } from './@daf/pages/Stakeholders/Workers/index.jsx';
|
|
10
|
+
export { default as ActivitiesTable } from './@daf/pages/Events/Activities/index.jsx';
|
|
11
|
+
|
|
12
|
+
export { default as IncidentsTable } from './@daf/pages/Events/Incidents/index.jsx';
|
|
13
|
+
export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
|
|
11
14
|
|
|
12
15
|
// Pages
|
|
13
16
|
export { default as TablePageWithTabs } from './@daf/pages/pages/TablePageWithTabs/index.jsx';
|
package/build/favicon.ico
DELETED
|
Binary file
|
package/build/logo192.png
DELETED
|
Binary file
|
package/build/logo512.png
DELETED
|
Binary file
|
package/build/manifest.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
package/build/robots.txt
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Tooltip } from 'antd';
|
|
3
|
-
import { findOptions } from '../../../../../helpers/StringHelper.js';
|
|
4
|
-
import { renderDateFormatted } from '../../../../../helpers/Forms.js';
|
|
5
|
-
import CustomIcon from '../../../../core/components/Icon/CustomIcon.jsx';
|
|
6
|
-
import AvatarGroup from '../../../../core/components/AvatarGroup/index.jsx';
|
|
7
|
-
import sourceAvatarConfig from '../../../../../helpers/sourceAvatarConfig.js';
|
|
8
|
-
|
|
9
|
-
const getLinkValue = (value, linkingObject) => {
|
|
10
|
-
if(linkingObject && linkingObject?.[value]) {
|
|
11
|
-
return linkingObject?.[value]?.name;
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
17
|
-
{
|
|
18
|
-
dataIndex: 'datastakeId',
|
|
19
|
-
title: t('ID'),
|
|
20
|
-
ellipsis: true,
|
|
21
|
-
show: true,
|
|
22
|
-
render: (v, all) => {
|
|
23
|
-
if (all.empty) {
|
|
24
|
-
return <div className="daf-default-cell" />
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return <Tooltip title={v}>{v}</Tooltip>;
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
dataIndex: 'title',
|
|
32
|
-
title: t('Title'),
|
|
33
|
-
ellipsis: true,
|
|
34
|
-
show: true,
|
|
35
|
-
render: (v, all) => {
|
|
36
|
-
if (all.empty) {
|
|
37
|
-
return <div className="daf-default-cell" />
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return <Tooltip title={v}>{v}</Tooltip>;
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
dataIndex: 'type',
|
|
45
|
-
title: t('Type'),
|
|
46
|
-
ellipsis: true,
|
|
47
|
-
show: true,
|
|
48
|
-
render: (v, all) => {
|
|
49
|
-
if (all.empty) {
|
|
50
|
-
return <div className="daf-default-cell" />
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const type = findOptions(v, data?.options?.locationCategories);
|
|
54
|
-
|
|
55
|
-
return type ? <Tooltip title={type}>{type}</Tooltip> : '-';
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
title: t("Last Update"),
|
|
61
|
-
dataIndex: "updatedAt",
|
|
62
|
-
key: "updatedAt",
|
|
63
|
-
width: 125,
|
|
64
|
-
render: (date, all) => {
|
|
65
|
-
if (all.empty) {
|
|
66
|
-
return <div className="daf-default-cell" />;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
70
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
71
|
-
},
|
|
72
|
-
ellipsis: true,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
title: t("Sources"),
|
|
76
|
-
dataIndex: "sources",
|
|
77
|
-
key: "sources",
|
|
78
|
-
show: activeTab !== "own",
|
|
79
|
-
render: (val, all) => {
|
|
80
|
-
if (all.empty) {
|
|
81
|
-
return <div className="daf-default-cell" />;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const sources = sourceAvatarConfig(val, user, applications);
|
|
85
|
-
|
|
86
|
-
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: 'actions',
|
|
91
|
-
title: "",
|
|
92
|
-
width: 60,
|
|
93
|
-
render: (_, all) => {
|
|
94
|
-
if (all.empty) {
|
|
95
|
-
return <div className="daf-default-cell" />;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
99
|
-
|
|
100
|
-
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
101
|
-
<a href={getRedirectLink(link)}>
|
|
102
|
-
<CustomIcon name="Link" size={15} color={theme.baseGray70} />
|
|
103
|
-
</a>
|
|
104
|
-
</div>;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
].filter((column) => column.show !== false);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export const checkboxConfig = {
|
|
2
|
-
name: 'Name',
|
|
3
|
-
datastakeId: 'ID'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const getFiltersConfig = ({t}) => {
|
|
7
|
-
return {
|
|
8
|
-
country: {
|
|
9
|
-
type: 'select',
|
|
10
|
-
placeholder: t('Country'),
|
|
11
|
-
style: { flex: 1 },
|
|
12
|
-
labelStyle: { flex: 1 },
|
|
13
|
-
getLabel: (option) => option.label,
|
|
14
|
-
getValue: (option) => option.value,
|
|
15
|
-
},
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const filtersConfig = {
|
|
20
|
-
name: '',
|
|
21
|
-
datastakeId: '',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const getFilterOptions = (options, t) => {
|
|
25
|
-
const { countries } = options || {};
|
|
26
|
-
const _default = {
|
|
27
|
-
country: countries,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return _default;
|
|
31
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|