datastake-daf 0.6.744 → 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 +792 -988
- package/dist/services/index.js +1 -7
- 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 +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/index.jsx +9 -6
- package/src/@daf/pages/{dashboards/DueDilligence/Incidents → Events/Activities}/columns.js +8 -7
- 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/{dashboards/DueDilligence → Events}/Incidents/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/columns.js +4 -4
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/config.js +0 -1
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/index.jsx +5 -5
- package/src/@daf/pages/Events/columns.js +226 -0
- package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/index.jsx +5 -9
- package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/columns.js +4 -4
- package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/index.jsx +5 -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/{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/Documents → Stakeholders}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/index.jsx +5 -5
- 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 +1 -2
- package/src/pages.js +9 -9
- 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/Events/columns.js +0 -151
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/columns.js +0 -132
- /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/DueDilligence → Events}/Incidents/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/config.js +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, Tag } 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 CustomIcon from '../../core/components/';
|
|
7
|
+
import AvatarGroup from '../../core/components/AvatarGroup/index.jsx';
|
|
8
|
+
import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
|
|
9
|
+
import MoreTags from '../../core/components/Table/MoreTags/index.jsx';
|
|
10
|
+
|
|
11
|
+
const getLinkValue = (value, linkingObject) => {
|
|
12
|
+
if (linkingObject && linkingObject?.[value]) {
|
|
13
|
+
return linkingObject?.[value]?.name;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const renderEventStatusTag = ({ value, t = (s) => s }) => {
|
|
19
|
+
const width = 87;
|
|
20
|
+
|
|
21
|
+
switch (value) {
|
|
22
|
+
case "edited":
|
|
23
|
+
return (
|
|
24
|
+
<Tag color="orange" style={{ width }} className="text-center">
|
|
25
|
+
{t("Edited")}
|
|
26
|
+
</Tag>
|
|
27
|
+
);
|
|
28
|
+
case "submitted":
|
|
29
|
+
return (
|
|
30
|
+
<Tag color="green" style={{ width }} className="text-center">
|
|
31
|
+
{t("Submitted")}
|
|
32
|
+
</Tag>
|
|
33
|
+
);
|
|
34
|
+
default:
|
|
35
|
+
return (
|
|
36
|
+
<Tag color="blue" style={{ width }} className="text-center">
|
|
37
|
+
{t("Private")}
|
|
38
|
+
</Tag>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications }) => [
|
|
44
|
+
{
|
|
45
|
+
dataIndex: 'datastakeId',
|
|
46
|
+
title: t('ID'),
|
|
47
|
+
ellipsis: true,
|
|
48
|
+
show: true,
|
|
49
|
+
render: (v, all) => {
|
|
50
|
+
if (all.empty) {
|
|
51
|
+
return <div className="daf-default-cell" />
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
dataIndex: 'name',
|
|
59
|
+
title: t('Title'),
|
|
60
|
+
ellipsis: true,
|
|
61
|
+
show: true,
|
|
62
|
+
render: (v, all) => {
|
|
63
|
+
if (all.empty) {
|
|
64
|
+
return <div className="daf-default-cell" />
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
dataIndex: 'typeOfEvent',
|
|
72
|
+
title: t('Type'),
|
|
73
|
+
ellipsis: true,
|
|
74
|
+
show: true,
|
|
75
|
+
render: (v, all) => {
|
|
76
|
+
if (all.empty) {
|
|
77
|
+
return <div className="daf-default-cell" />
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const type = findOptions(v, data?.options?.eventsType);
|
|
81
|
+
|
|
82
|
+
return type ? <Tooltip title={type}>{type}</Tooltip> : '-';
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
dataIndex: 'keyStakeholder',
|
|
87
|
+
title: t('Key Stakeholder'),
|
|
88
|
+
ellipsis: true,
|
|
89
|
+
show: true,
|
|
90
|
+
render: (v, all) => {
|
|
91
|
+
if (all.empty) {
|
|
92
|
+
return <div className="daf-default-cell" />
|
|
93
|
+
}
|
|
94
|
+
const val = (all?.stakeholderKey || []).map((sk) => {
|
|
95
|
+
return sk?.name;
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
if (val?.length === 0) {
|
|
99
|
+
return "--";
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return <MoreTags values={val} />;
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: t("Date"),
|
|
107
|
+
dataIndex: "date",
|
|
108
|
+
key: "date",
|
|
109
|
+
testimonials: true,
|
|
110
|
+
incident: true,
|
|
111
|
+
correctiveActions: true,
|
|
112
|
+
show: true,
|
|
113
|
+
sorter: () => 0 + 0,
|
|
114
|
+
searchType: "date",
|
|
115
|
+
width: 125,
|
|
116
|
+
render: (date, all) => {
|
|
117
|
+
if (all.empty) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const title = date ? renderDateFormatted(date, "DD MMM YYYY") : "--";
|
|
122
|
+
return <Tooltip title={title}>{title}</Tooltip>;
|
|
123
|
+
},
|
|
124
|
+
ellipsis: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
dataIndex: 'scope',
|
|
128
|
+
title: t('Scope'),
|
|
129
|
+
ellipsis: true,
|
|
130
|
+
show: true,
|
|
131
|
+
render: (value, all) => {
|
|
132
|
+
if (all.empty) {
|
|
133
|
+
return <div className="daf-default-cell" />;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (!value) {
|
|
137
|
+
return "--";
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Form the moment the intend of the if block is to be executed only in event table
|
|
141
|
+
if (typeof value === "string") {
|
|
142
|
+
if (all.navigationEventType === "other") {
|
|
143
|
+
return "--";
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const categoryOptions = (data?.options?.categoryOptions || []).map((c) => {
|
|
147
|
+
const searchTerm = `typeOfEvent is ${all.navigationEventType}`;
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
value: c.value,
|
|
151
|
+
label: c.label[searchTerm],
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const relaxantOptions = [
|
|
156
|
+
...categoryOptions,
|
|
157
|
+
...(data?.options?.eventsType || []),
|
|
158
|
+
...(data?.options?.testimonialsType || []),
|
|
159
|
+
];
|
|
160
|
+
|
|
161
|
+
const title = relaxantOptions.find((v) => v.value === value)?.label || "--";
|
|
162
|
+
|
|
163
|
+
return <Tooltip title={title}>{title}</Tooltip>;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const val = value.map((v, i) => ({ label: v.name, value: `${v.name}-${i}` }));
|
|
167
|
+
return val.length ? <MoreTags values={val} /> : "--";
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
title: t("Sources"),
|
|
172
|
+
dataIndex: "sources",
|
|
173
|
+
key: "sources",
|
|
174
|
+
show: activeTab !== "own",
|
|
175
|
+
render: (val, all) => {
|
|
176
|
+
if (all.empty) {
|
|
177
|
+
return <div className="daf-default-cell" />;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const sources = sourceAvatarConfig(val, user, applications);
|
|
181
|
+
|
|
182
|
+
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
title: t("Status"),
|
|
187
|
+
dataIndex: "status",
|
|
188
|
+
key: "status",
|
|
189
|
+
show: activeTab === "own",
|
|
190
|
+
correctiveActions: activeTab === "own",
|
|
191
|
+
testimonials: activeTab === "own",
|
|
192
|
+
incident: activeTab === "own",
|
|
193
|
+
width: 120,
|
|
194
|
+
render: (value, all) => {
|
|
195
|
+
if (all.empty) {
|
|
196
|
+
return <div className="daf-default-cell" />;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (activeTab !== "own") {
|
|
200
|
+
return all?.authorId?.name;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const _val = all?.published || all?.status === "submitted" ? "submitted" : value;
|
|
204
|
+
return renderEventStatusTag({ value: _val, t });
|
|
205
|
+
},
|
|
206
|
+
ellipsis: true,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: 'actions',
|
|
210
|
+
title: "",
|
|
211
|
+
width: 60,
|
|
212
|
+
render: (_, all) => {
|
|
213
|
+
if (all.empty) {
|
|
214
|
+
return <div className="daf-default-cell" />;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
218
|
+
|
|
219
|
+
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
220
|
+
<a href={getRedirectLink(link)}>
|
|
221
|
+
<CustomIcon name="Link" size={15} color={theme.baseGray70} />
|
|
222
|
+
</a>
|
|
223
|
+
</div>;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
].filter((column) => column.show !== false);
|
|
@@ -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 EventsCreate = ({
|
|
7
7
|
namespace = 'event',
|
|
@@ -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 EventsCreate from './create.jsx';
|
|
7
|
-
import { displayMessage } from '
|
|
7
|
+
import { displayMessage } from '../../../helpers/messages.js';
|
|
8
8
|
|
|
9
9
|
const EventsTable = ({
|
|
10
10
|
t = () => {},
|
|
@@ -37,7 +37,7 @@ const EventsTable = ({
|
|
|
37
37
|
subjectClear = () => {},
|
|
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,
|
|
@@ -64,7 +64,6 @@ const EventsTable = ({
|
|
|
64
64
|
}, [otherParams, extendingFilters])
|
|
65
65
|
|
|
66
66
|
useEffect(() => {
|
|
67
|
-
console.log("fetching data")
|
|
68
67
|
getData({
|
|
69
68
|
pagination: paginationQuery,
|
|
70
69
|
...(Object.keys(filters).length > 0 && { filters: filters }),
|
|
@@ -74,11 +73,8 @@ const EventsTable = ({
|
|
|
74
73
|
[sortBy || "updatedAt"]: sortDir ? (sortDir === "ascend" ? 1 : -1) : -1,
|
|
75
74
|
}
|
|
76
75
|
}, 'events')
|
|
77
|
-
console.log("data fetched")
|
|
78
76
|
}, [location.search, activeTab, JSON.stringify(extendingFilters)]);
|
|
79
77
|
|
|
80
|
-
console.log({data})
|
|
81
|
-
|
|
82
78
|
const selectFiltersConfig = useMemo(() => {
|
|
83
79
|
return getFiltersConfig({t});
|
|
84
80
|
}, [t]);
|
|
@@ -109,7 +105,7 @@ const EventsTable = ({
|
|
|
109
105
|
location={location}
|
|
110
106
|
loading={loading}
|
|
111
107
|
goTo={goTo}
|
|
112
|
-
defaultActiveTab={"
|
|
108
|
+
defaultActiveTab={"own"}
|
|
113
109
|
columns={columns}
|
|
114
110
|
data={data}
|
|
115
111
|
checkboxConfig={checkboxConfig}
|
package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/columns.js
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
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 '
|
|
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
7
|
|
|
8
8
|
const getLinkValue = (value, linkingObject) => {
|
|
9
9
|
if(linkingObject && linkingObject?.[value]) {
|
package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/create.jsx
RENAMED
|
@@ -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 ProductionSitesCreate = ({
|
|
7
7
|
namespace = "PRODUCTION SITES",
|
package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/index.jsx
RENAMED
|
@@ -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 ProductionSitesCreate from './create.jsx';
|
|
7
|
-
import { displayMessage } from '
|
|
7
|
+
import { displayMessage } from '../../../../helpers/messages.js';
|
|
8
8
|
|
|
9
9
|
const ProductionSitesTable = ({
|
|
10
10
|
t = () => {},
|
|
@@ -36,7 +36,7 @@ const ProductionSitesTable = ({
|
|
|
36
36
|
createDefaultValues = {},
|
|
37
37
|
}) => {
|
|
38
38
|
const [selectOptions, setSelectOptions] = useState();
|
|
39
|
-
const [activeTab, setActiveTab] = useState();
|
|
39
|
+
const [activeTab, setActiveTab] = useState('own');
|
|
40
40
|
|
|
41
41
|
const columns = useMemo(() => getColumns({
|
|
42
42
|
t,
|
|
@@ -97,7 +97,7 @@ const ProductionSitesTable = ({
|
|
|
97
97
|
location={location}
|
|
98
98
|
loading={loading}
|
|
99
99
|
goTo={goTo}
|
|
100
|
-
defaultActiveTab={"
|
|
100
|
+
defaultActiveTab={"own"}
|
|
101
101
|
columns={columns}
|
|
102
102
|
data={data}
|
|
103
103
|
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
|
const getLinkValue = (value, linkingObject) => {
|
|
10
10
|
if(linkingObject && linkingObject?.[value]) {
|
|
@@ -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 = 'locations',
|
|
@@ -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 LocationsTable = ({
|
|
10
10
|
t = () => {},
|
|
@@ -36,7 +36,7 @@ const LocationsTable = ({
|
|
|
36
36
|
subjectClear = () => {},
|
|
37
37
|
}) => {
|
|
38
38
|
const [selectOptions, setSelectOptions] = useState();
|
|
39
|
-
const [activeTab, setActiveTab] = useState();
|
|
39
|
+
const [activeTab, setActiveTab] = useState("own");
|
|
40
40
|
|
|
41
41
|
const columns = useMemo(() => getColumns({
|
|
42
42
|
t,
|
|
@@ -96,7 +96,7 @@ const LocationsTable = ({
|
|
|
96
96
|
location={location}
|
|
97
97
|
loading={loading}
|
|
98
98
|
goTo={goTo}
|
|
99
|
-
defaultActiveTab={"
|
|
99
|
+
defaultActiveTab={"own"}
|
|
100
100
|
columns={columns}
|
|
101
101
|
data={data}
|
|
102
102
|
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
|
const getLinkValue = (value, linkingObject) => {
|
|
10
10
|
if(linkingObject && linkingObject?.[value]) {
|
|
@@ -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 = "OPERATOR",
|
|
@@ -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 OperatorsTable = ({
|
|
10
10
|
t = () => {},
|
|
@@ -37,7 +37,7 @@ const OperatorsTable = ({
|
|
|
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 OperatorsTable = ({
|
|
|
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, Tag } 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
|
const getLinkValue = (value, linkingObject) => {
|
|
10
10
|
if(linkingObject && linkingObject?.[value]) {
|
|
@@ -137,7 +137,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
137
137
|
|
|
138
138
|
const sources = sourceAvatarConfig(val, user, applications);
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
141
141
|
},
|
|
142
142
|
},
|
|
143
143
|
{
|
|
@@ -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',
|
|
@@ -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 = () => {},
|
|
@@ -36,7 +36,7 @@ const StakeholdersTable = ({
|
|
|
36
36
|
subjectClear = () => {},
|
|
37
37
|
}) => {
|
|
38
38
|
const [selectOptions, setSelectOptions] = useState();
|
|
39
|
-
const [activeTab, setActiveTab] = useState();
|
|
39
|
+
const [activeTab, setActiveTab] = useState("own");
|
|
40
40
|
const columns = useMemo(() => getColumns({
|
|
41
41
|
t,
|
|
42
42
|
goTo,
|
|
@@ -92,7 +92,7 @@ const StakeholdersTable = ({
|
|
|
92
92
|
location={location}
|
|
93
93
|
loading={loading}
|
|
94
94
|
goTo={goTo}
|
|
95
|
-
defaultActiveTab={"
|
|
95
|
+
defaultActiveTab={"own"}
|
|
96
96
|
columns={columns}
|
|
97
97
|
data={data}
|
|
98
98
|
checkboxConfig={checkboxConfig}
|
|
@@ -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",
|