datastake-daf 0.6.792 → 0.6.794
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 +4377 -3187
- package/dist/pages/index.js +1401 -589
- package/dist/services/index.js +69 -3
- package/dist/utils/index.js +14 -17
- package/package.json +1 -1
- package/src/@daf/core/components/ProgressBar/ProgressBarWithIcon/index.jsx +23 -0
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +79 -0
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +18 -8
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +6 -7
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +272 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +223 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +65 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +73 -45
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +48 -22
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +81 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +76 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +38 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +13 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +77 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +38 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +75 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +3 -1
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +5 -3
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +13 -8
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +3 -4
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +81 -2
- package/src/@daf/core/components/Table/NavigationAction/index.jsx +5 -3
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/columns.js +248 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +68 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/style.js +29 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +93 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/index.jsx +43 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +127 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +52 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/style.js +26 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +39 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +180 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +27 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +157 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +31 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +77 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +117 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +54 -0
- package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
- package/src/@daf/services/AdminService.js +79 -7
- package/src/@daf/services/DashboardService.js +2 -1
- package/src/@daf/utils/filters.js +15 -13
- package/src/constants/locales/en/translation.js +7 -0
- package/src/constants/locales/fr/translation.js +1 -1
- package/src/constants/locales/sp/translation.js +1 -1
- package/src/index.js +1 -0
- package/src/pages.js +1 -0
- 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
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Tooltip } from "antd";
|
|
3
|
+
import { renderDateFormatted } from '../../../../../../helpers/Forms.js';
|
|
4
|
+
import { findOptions, getLinkValue } from '../../../../../../helpers/StringHelper.js';
|
|
5
|
+
import CustomIcon from '../../../../../core/components/Icon/CustomIcon.jsx';
|
|
6
|
+
import NavigationAction from '../../../../../core/components/Table/NavigationAction/index.jsx';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink, theme }) =>
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
dataIndex: "datastakeId",
|
|
13
|
+
title: t("ID"),
|
|
14
|
+
ellipsis: true,
|
|
15
|
+
show: true,
|
|
16
|
+
render: (v, all) => {
|
|
17
|
+
if (all.empty) {
|
|
18
|
+
return <div className="daf-default-cell" />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Tooltip title={v}>{v || "-"}</Tooltip>
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
dataIndex: "name",
|
|
28
|
+
title: activeTab === "documents" || activeTab === "events" ? t("Title") : t("Name"),
|
|
29
|
+
ellipsis: true,
|
|
30
|
+
show: true,
|
|
31
|
+
render: (v, all) => {
|
|
32
|
+
if (all.empty) {
|
|
33
|
+
return <div className="daf-default-cell" />;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Tooltip title={v}>{v || "-"}</Tooltip>
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
dataIndex: "keyStakeholders",
|
|
43
|
+
title: t("Key Stakeholders"),
|
|
44
|
+
ellipsis: true,
|
|
45
|
+
show: activeTab === "events",
|
|
46
|
+
render: (v, all) => {
|
|
47
|
+
if (all.empty) {
|
|
48
|
+
return <div className="daf-default-cell" />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Tooltip title={v}>{v || "-"}</Tooltip>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
dataIndex: "category",
|
|
58
|
+
title: t("Category"),
|
|
59
|
+
ellipsis: true,
|
|
60
|
+
show: activeTab === "stakeholders" || activeTab === "locations",
|
|
61
|
+
render: (v, all) => {
|
|
62
|
+
if (all.empty) {
|
|
63
|
+
return <div className="daf-default-cell" />;
|
|
64
|
+
}
|
|
65
|
+
const label = findOptions(v, options?.categoriesOptions) || "-";
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Tooltip title={label}>{label || "-"}</Tooltip>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
dataIndex: "subCategory",
|
|
74
|
+
title: t("Legal Form"),
|
|
75
|
+
ellipsis: true,
|
|
76
|
+
show: activeTab === "stakeholders",
|
|
77
|
+
render: (v, all) => {
|
|
78
|
+
if (all.empty) {
|
|
79
|
+
return <div className="daf-default-cell" />;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const label = findOptions(v, options?.subCategoriesOptionsSbgi) || "-";
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<Tooltip title={label}>{label || "-"}</Tooltip>
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
dataIndex: "country",
|
|
91
|
+
title: t("Country"),
|
|
92
|
+
ellipsis: true,
|
|
93
|
+
show: activeTab === "stakeholders" || activeTab === "locations",
|
|
94
|
+
render: (v, all) => {
|
|
95
|
+
if (all.empty) {
|
|
96
|
+
return <div className="daf-default-cell" />;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const label = findOptions(v, options?.countries) || "-";
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<Tooltip title={label}>{label || "-"}</Tooltip>
|
|
103
|
+
);
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
dataIndex: 'region',
|
|
108
|
+
title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
|
|
109
|
+
ellipsis: true,
|
|
110
|
+
show: activeTab === "locations",
|
|
111
|
+
render: (v, all) => {
|
|
112
|
+
if (all.empty) {
|
|
113
|
+
return <div className="daf-default-cell" />
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
|
|
117
|
+
|
|
118
|
+
return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
dataIndex: 'territory',
|
|
123
|
+
title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
|
|
124
|
+
ellipsis: true,
|
|
125
|
+
show: activeTab === "locations",
|
|
126
|
+
render: (v, all) => {
|
|
127
|
+
if (all.empty) {
|
|
128
|
+
return <div className="daf-default-cell" />
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
|
|
132
|
+
|
|
133
|
+
return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
dataIndex: "type",
|
|
138
|
+
show: activeTab === "documents",
|
|
139
|
+
title: t("Type"),
|
|
140
|
+
ellipsis: true,
|
|
141
|
+
render: (v, all) => {
|
|
142
|
+
if (all.empty) {
|
|
143
|
+
return <div className="daf-default-cell" />;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const label = findOptions(v, options?.documentationTypesOptions) || "-";
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<Tooltip title={label}>{label || "-"}</Tooltip>
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
dataIndex: "date",
|
|
155
|
+
title: t("Date"),
|
|
156
|
+
ellipsis: true,
|
|
157
|
+
show: activeTab === "events",
|
|
158
|
+
render: (v, all) => {
|
|
159
|
+
if (all.empty) {
|
|
160
|
+
return <div className="daf-default-cell" />;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const language = user?.language === 'sp' ? 'es' : user?.language
|
|
164
|
+
const date = v ? renderDateFormatted(v, 'DD MMM YYYY', language || 'en') : '-';
|
|
165
|
+
|
|
166
|
+
return <Tooltip title={date}>{date}</Tooltip>;
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
dataIndex: "lastUpdated",
|
|
171
|
+
title: t("Last Update"),
|
|
172
|
+
ellipsis: true,
|
|
173
|
+
show: true,
|
|
174
|
+
render: (v, all) => {
|
|
175
|
+
if (all.empty) {
|
|
176
|
+
return <div className="daf-default-cell" />;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const language = user?.language === 'sp' ? 'es' : user?.language
|
|
180
|
+
const date = v ? renderDateFormatted(v, 'DD MMM YYYY', language || 'en') : '-';
|
|
181
|
+
|
|
182
|
+
return <Tooltip title={date}>{date}</Tooltip>;
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
dataIndex: "scope",
|
|
187
|
+
title: t("Scope"),
|
|
188
|
+
ellipsis: true,
|
|
189
|
+
show: activeTab === "events",
|
|
190
|
+
render: (v, all) => {
|
|
191
|
+
if (all.empty) {
|
|
192
|
+
return <div className="daf-default-cell" />;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<Tooltip title={v}>{v || "-"}</Tooltip>
|
|
197
|
+
);
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
dataIndex: "content",
|
|
202
|
+
title: t("Content"),
|
|
203
|
+
ellipsis: true,
|
|
204
|
+
show: activeTab === "documents",
|
|
205
|
+
render: (_, all) => {
|
|
206
|
+
if (all.empty) {
|
|
207
|
+
return <div className="daf-default-cell" />;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const content = {
|
|
211
|
+
name: all?.content?.[0]?.name,
|
|
212
|
+
link:all?.content?.[0]?.url
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<a
|
|
217
|
+
href={content.link}
|
|
218
|
+
target="_blank"
|
|
219
|
+
rel="noopener noreferrer"
|
|
220
|
+
style={{
|
|
221
|
+
// maxWidth: "100px",
|
|
222
|
+
whiteSpace: "nowrap",
|
|
223
|
+
overflow: "hidden",
|
|
224
|
+
textOverflow: "ellipsis",
|
|
225
|
+
}}
|
|
226
|
+
>
|
|
227
|
+
{content.name}
|
|
228
|
+
</a>
|
|
229
|
+
);
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
title: t(""),
|
|
234
|
+
dataIndex: "actions",
|
|
235
|
+
key: "actions",
|
|
236
|
+
width: 60,
|
|
237
|
+
show: true,
|
|
238
|
+
render: (v, all) => {
|
|
239
|
+
if (all.empty) {
|
|
240
|
+
return <div className="daf-default-cell" />;
|
|
241
|
+
}
|
|
242
|
+
const link = `/app/view/${activeTab}/${all.datastakeId}`;
|
|
243
|
+
|
|
244
|
+
return <NavigationAction onClick={() => goTo(getRedirectLink(link))} theme={theme} />
|
|
245
|
+
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
].filter((column) => column.show);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useState, useMemo } from 'react'
|
|
2
|
+
import Widget from '../../../../../core/components/Dashboard/Widget/index.jsx';
|
|
3
|
+
import Style from './style.js';
|
|
4
|
+
import SearchFilters from '../../../../../core/components/Filters/searchFilters/index.jsx';
|
|
5
|
+
import DafTable from '../../../../../core/components/Table/index.jsx';
|
|
6
|
+
import TabsHeader from '../../../../../core/components/Header/TabsHeader/index.jsx';
|
|
7
|
+
import { getColumns } from './columns.js';
|
|
8
|
+
|
|
9
|
+
function AssociatedInformation({
|
|
10
|
+
t = () => {},
|
|
11
|
+
user = {},
|
|
12
|
+
goTo = () => {},
|
|
13
|
+
getRedirectLink = () => {},
|
|
14
|
+
options = {},
|
|
15
|
+
}) {
|
|
16
|
+
const tabs = [
|
|
17
|
+
{ value: "stakeholders", label: t("Stakeholders") },
|
|
18
|
+
{ value: "locations", label: t("Locations") },
|
|
19
|
+
{ value: "documents", label: t("Documents") },
|
|
20
|
+
{ value: "events", label: t("Events") },
|
|
21
|
+
];
|
|
22
|
+
const [activeTab, setActiveTab] = useState("stakeholders");
|
|
23
|
+
|
|
24
|
+
const data = [];
|
|
25
|
+
|
|
26
|
+
const columns = useMemo(
|
|
27
|
+
() => getColumns({ t, isMonitoring: false, activeTab, options, getRedirectLink, user }),
|
|
28
|
+
[t, activeTab, options, getRedirectLink, user],
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Widget
|
|
33
|
+
title={t("Associated Information")}
|
|
34
|
+
expandable
|
|
35
|
+
className="with-border-header no-px-body overflow-hidden"
|
|
36
|
+
>
|
|
37
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "24px", marginLeft: "12px" }}>
|
|
38
|
+
<TabsHeader
|
|
39
|
+
tabs={tabs}
|
|
40
|
+
onChange={setActiveTab}
|
|
41
|
+
value={activeTab}
|
|
42
|
+
className="mt-0"
|
|
43
|
+
/>
|
|
44
|
+
<Style>
|
|
45
|
+
<div>
|
|
46
|
+
<SearchFilters t={t} />
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<div className="daf-table-wrapper">
|
|
50
|
+
<DafTable
|
|
51
|
+
columns={columns}
|
|
52
|
+
data={data[activeTab]}
|
|
53
|
+
className="pr-0"
|
|
54
|
+
doEmptyRows
|
|
55
|
+
rowKey={"datas"}
|
|
56
|
+
hideOnLoading={false}
|
|
57
|
+
scroll={{ x: false, y: 55 * 5 }}
|
|
58
|
+
key={activeTab}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</Style>
|
|
63
|
+
</div>
|
|
64
|
+
</Widget>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default AssociatedInformation
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
const Style = styled.div`
|
|
4
|
+
max-width: 98%;
|
|
5
|
+
margin-left: var(--size-lg);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
padding-right: 24px;
|
|
8
|
+
|
|
9
|
+
.daf-table {
|
|
10
|
+
padding: 0px;
|
|
11
|
+
margin-top: 0px;
|
|
12
|
+
|
|
13
|
+
.ant-tag {
|
|
14
|
+
text-align: center;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.daf-select-filters .filters {
|
|
19
|
+
padding-top: 16px;
|
|
20
|
+
padding-left: 0;
|
|
21
|
+
padding-right: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.daf-table {
|
|
25
|
+
padding-top: 16px;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export default Style;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Tooltip } from "antd";
|
|
2
|
+
import ProgressBarWithIcon from "../../../../../core/components/ProgressBar/ProgressBarWithIcon/index.jsx";
|
|
3
|
+
import { renderDateFormatted } from "../../../../../../helpers/Forms.js";
|
|
4
|
+
import MoreMenu from "../../../../../core/components/Table/MoreMenu/index.jsx";
|
|
5
|
+
import NavigationAction from "../../../../../core/components/Table/NavigationAction/index.jsx";
|
|
6
|
+
|
|
7
|
+
export const getColumns = ({
|
|
8
|
+
t,
|
|
9
|
+
data,
|
|
10
|
+
user,
|
|
11
|
+
goTo,
|
|
12
|
+
getRedirectLink,
|
|
13
|
+
theme,
|
|
14
|
+
}) => [
|
|
15
|
+
{
|
|
16
|
+
dataIndex: 'name',
|
|
17
|
+
title: t('Name'),
|
|
18
|
+
ellipsis: true,
|
|
19
|
+
show: true,
|
|
20
|
+
render: (v, all) => {
|
|
21
|
+
if (all.empty) {
|
|
22
|
+
return <div className="daf-default-cell" />
|
|
23
|
+
}
|
|
24
|
+
return <Tooltip title={v}>{v}</Tooltip>
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
dataIndex: 'completion',
|
|
29
|
+
title: t('Completion'),
|
|
30
|
+
ellipsis: true,
|
|
31
|
+
show: true,
|
|
32
|
+
render: (v, all) => {
|
|
33
|
+
if (all.empty) {
|
|
34
|
+
return <div className="daf-default-cell" />
|
|
35
|
+
}
|
|
36
|
+
const published = false;
|
|
37
|
+
|
|
38
|
+
return <ProgressBarWithIcon published={published} data={v} t={t} />
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
dataIndex: 'lastUpdate',
|
|
43
|
+
title: t('Last Update'),
|
|
44
|
+
ellipsis: true,
|
|
45
|
+
show: true,
|
|
46
|
+
render: (v, all) => {
|
|
47
|
+
if (all.empty) {
|
|
48
|
+
return <div className="daf-default-cell" />
|
|
49
|
+
}
|
|
50
|
+
const date = v ? renderDateFormatted(v, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
51
|
+
return <Tooltip title={date}>{date}</Tooltip>
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'actions',
|
|
56
|
+
title: "",
|
|
57
|
+
width: 60,
|
|
58
|
+
render: (_, all) => {
|
|
59
|
+
if (all.empty) {
|
|
60
|
+
return <div className="daf-default-cell" />;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const moreMenuItems = [
|
|
64
|
+
{
|
|
65
|
+
label: t("Summary"),
|
|
66
|
+
value: "Summary",
|
|
67
|
+
onClick: () => {
|
|
68
|
+
let link = `/app/operator-summary/${all.datastakeId}`
|
|
69
|
+
goTo(getRedirectLink(link));
|
|
70
|
+
},
|
|
71
|
+
disabled: true,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: t("Details"),
|
|
75
|
+
value: "details",
|
|
76
|
+
onClick: () => {
|
|
77
|
+
let link = `/app/view/kyc/user`;
|
|
78
|
+
goTo(getRedirectLink(link));
|
|
79
|
+
},
|
|
80
|
+
disabled: true,
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
const managementSystemsOnClick = () => {
|
|
85
|
+
let link = `/app/view/management-systems/user`;
|
|
86
|
+
goTo(getRedirectLink(link));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return all?.key === 'kyc' ? <MoreMenu items={moreMenuItems} />
|
|
90
|
+
: <NavigationAction onClick={managementSystemsOnClick} theme={theme} disabled />
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import Widget from '../../../../../core/components/Dashboard/Widget/index.jsx';
|
|
3
|
+
import DAFTable from '../../../../../core/components/Table/index.jsx';
|
|
4
|
+
import { getColumns } from './columns.js';
|
|
5
|
+
|
|
6
|
+
function OrganisationInformation({
|
|
7
|
+
t = () => {},
|
|
8
|
+
user = {},
|
|
9
|
+
goTo = () => {},
|
|
10
|
+
getRedirectLink = () => {},
|
|
11
|
+
theme = {},
|
|
12
|
+
}) {
|
|
13
|
+
const organistionInfo = [
|
|
14
|
+
{key: 'kyc', label: t("My KYC")},
|
|
15
|
+
{key: 'management-systems', label: t("Management Systems")},
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const tableData = useMemo(() => {
|
|
19
|
+
return organistionInfo.map((item) => {
|
|
20
|
+
return {
|
|
21
|
+
key: item.key,
|
|
22
|
+
name: item.label,
|
|
23
|
+
completion: 0,
|
|
24
|
+
lastUpdate: "",
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
}, [organistionInfo])
|
|
28
|
+
|
|
29
|
+
const columns = useMemo(() => {
|
|
30
|
+
return getColumns({ t, data: tableData, user, goTo, getRedirectLink, theme })
|
|
31
|
+
}, [tableData, user, goTo, getRedirectLink, theme])
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Widget
|
|
35
|
+
title={t("Organisation Information")}
|
|
36
|
+
className="with-border-header daf-table-wrapper no-pagination no-px-body"
|
|
37
|
+
>
|
|
38
|
+
<DAFTable columns={columns} data={tableData} />
|
|
39
|
+
</Widget>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default OrganisationInformation
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip } from 'antd';
|
|
3
|
+
import { findOptions, getLinkValue } from '../../../../../../helpers/StringHelper.js';
|
|
4
|
+
import MoreMenu from '../../../../../core/components/Table/MoreMenu/index.jsx';
|
|
5
|
+
import { renderDateFormatted } from '../../../../../../helpers/Forms.js';
|
|
6
|
+
|
|
7
|
+
export const getColumns = ({
|
|
8
|
+
t = () => {},
|
|
9
|
+
options = {},
|
|
10
|
+
user = {},
|
|
11
|
+
goTo = () => {},
|
|
12
|
+
getRedirectLink = () => {},
|
|
13
|
+
}) => [
|
|
14
|
+
{
|
|
15
|
+
title: t("ID"),
|
|
16
|
+
dataIndex: "datastakeId",
|
|
17
|
+
key: "datastakeId",
|
|
18
|
+
render: (v, all) => {
|
|
19
|
+
if (all.empty) {
|
|
20
|
+
return <div className="daf-default-cell" />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: t("Name"),
|
|
28
|
+
dataIndex: "name",
|
|
29
|
+
key: "name",
|
|
30
|
+
render: (v, all) => {
|
|
31
|
+
if (all.empty) {
|
|
32
|
+
return <div className="daf-default-cell" />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
dataIndex: 'category',
|
|
40
|
+
title: t('type'),
|
|
41
|
+
ellipsis: true,
|
|
42
|
+
show: true,
|
|
43
|
+
render: (v, all) => {
|
|
44
|
+
if (all.empty) {
|
|
45
|
+
return <div className="daf-default-cell" />
|
|
46
|
+
}
|
|
47
|
+
const locationCategories = [...(options?.locationCategories || []), ...(options?.productionSiteCategories || [])]
|
|
48
|
+
const category = findOptions(v, locationCategories);
|
|
49
|
+
|
|
50
|
+
return <Tooltip title={category}>{category}</Tooltip>;
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
dataIndex: 'region',
|
|
55
|
+
title: findOptions(user?.company?.country, options?.administrativeLevel1)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel1) : t("Province"),
|
|
56
|
+
ellipsis: true,
|
|
57
|
+
show: true,
|
|
58
|
+
render: (v, all) => {
|
|
59
|
+
if (all.empty) {
|
|
60
|
+
return <div className="daf-default-cell" />
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
|
|
64
|
+
|
|
65
|
+
return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
dataIndex: 'territory',
|
|
70
|
+
title: findOptions(user?.company?.country, options?.administrativeLevel2)?.length > 2 ? findOptions(user?.company?.country, options?.administrativeLevel2) : t("Territory"),
|
|
71
|
+
ellipsis: true,
|
|
72
|
+
show: true,
|
|
73
|
+
render: (v, all) => {
|
|
74
|
+
if (all.empty) {
|
|
75
|
+
return <div className="daf-default-cell" />
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
|
|
79
|
+
|
|
80
|
+
return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
dataIndex: 'lastUpdate',
|
|
85
|
+
title: t('Last Update'),
|
|
86
|
+
ellipsis: true,
|
|
87
|
+
show: true,
|
|
88
|
+
render: (v, all) => {
|
|
89
|
+
if (all.empty) {
|
|
90
|
+
return <div className="daf-default-cell" />
|
|
91
|
+
}
|
|
92
|
+
const date = v ? renderDateFormatted(v, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
93
|
+
return <Tooltip title={date}>{date}</Tooltip>
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'actions',
|
|
98
|
+
title: "",
|
|
99
|
+
width: 60,
|
|
100
|
+
render: (_, all) => {
|
|
101
|
+
if (all.empty) {
|
|
102
|
+
return <div className="daf-default-cell" />;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const moreMenuItems = [
|
|
106
|
+
{
|
|
107
|
+
label: t("Summary"),
|
|
108
|
+
value: "Summary",
|
|
109
|
+
onClick: () => {
|
|
110
|
+
let link = `/app/mine-summary/${all.datastakeId}`
|
|
111
|
+
goTo(getRedirectLink(link));
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: t("Details"),
|
|
116
|
+
value: "details",
|
|
117
|
+
onClick: () => {
|
|
118
|
+
let link = `/app/view/production-sites/${all.datastakeId}`;
|
|
119
|
+
goTo(getRedirectLink(link));
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
return <MoreMenu items={moreMenuItems} />
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useMemo } from 'react'
|
|
2
|
+
import ComponentWithFocus from '../../../../../core/components/Dashboard/ComponentWithFocus/index.jsx';
|
|
3
|
+
import StickyTable from '../../../../../core/components/Table/StickyTable/index.jsx';
|
|
4
|
+
import Widget from '../../../../../core/components/Dashboard/Widget/index.jsx';
|
|
5
|
+
import Style from './style.js';
|
|
6
|
+
import { getColumns } from './columns.js';
|
|
7
|
+
|
|
8
|
+
function ProductionSites({
|
|
9
|
+
t = () => {},
|
|
10
|
+
options = {},
|
|
11
|
+
user = {},
|
|
12
|
+
goTo = () => {},
|
|
13
|
+
getRedirectLink = () => {},
|
|
14
|
+
}) {
|
|
15
|
+
const data = [];
|
|
16
|
+
|
|
17
|
+
const Wrapper = useMemo(() => {
|
|
18
|
+
return data.length > 5 ? ComponentWithFocus : "div";
|
|
19
|
+
}, [data.length]);
|
|
20
|
+
|
|
21
|
+
const columns = useMemo(() => {
|
|
22
|
+
return getColumns({ t, options, user, goTo, getRedirectLink });
|
|
23
|
+
}, [t, options, user, goTo, getRedirectLink]);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Widget
|
|
27
|
+
title={t("Production Sites")}
|
|
28
|
+
className="with-border-header no-px-body"
|
|
29
|
+
>
|
|
30
|
+
<Wrapper>
|
|
31
|
+
<Style>
|
|
32
|
+
<div
|
|
33
|
+
className="daf-table-wrapper"
|
|
34
|
+
style={{
|
|
35
|
+
maxHeight: "526px",
|
|
36
|
+
overflowY: "auto",
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<StickyTable
|
|
40
|
+
columns={columns}
|
|
41
|
+
dataSource={data}
|
|
42
|
+
hideOnLoading={false}
|
|
43
|
+
doEmptyRows={true}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</Style>
|
|
47
|
+
</Wrapper>
|
|
48
|
+
</Widget>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default ProductionSites
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
const Style = styled.div`
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
|
|
6
|
+
.daf-table {
|
|
7
|
+
padding: 0px;
|
|
8
|
+
margin-top: 0px;
|
|
9
|
+
|
|
10
|
+
.ant-tag {
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.daf-select-filters .filters {
|
|
16
|
+
padding-top: 16px;
|
|
17
|
+
padding-left: 0;
|
|
18
|
+
padding-right: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.daf-table {
|
|
22
|
+
padding-top: 16px;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export default Style;
|