datastake-daf 0.6.744 → 0.6.746
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 +620 -900
- 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.css +1 -0
- package/dist/pages/index.js +4391 -997
- package/dist/services/index.js +1 -7
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/dist/utils/index.js +466 -808
- package/package.json +3 -1
- package/rollup.config.js +7 -2
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx +75 -54
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/style.js +44 -0
- 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/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +128 -0
- package/src/@daf/{pages/pages → core/components/TableScreen}/TablePageWithTabs/index.jsx +5 -5
- 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/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -2
- package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/config.js +2 -2
- package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/index.jsx +1 -5
- package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/config.js +2 -2
- 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/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/Summary/Activities/Restoration/config.js +36 -0
- package/src/@daf/pages/Summary/Activities/Restoration/helper.js +98 -0
- package/src/@daf/pages/Summary/Activities/Restoration/index.jsx +178 -0
- package/src/@daf/pages/Summary/minesite/index.js +0 -0
- package/src/@daf/pages/Summary/operator/index.jsx +76 -0
- package/src/@daf/services/AuthenticationService.js +0 -1
- package/src/@daf/services/LinkedSubjects.js +1 -2
- package/src/pages.js +15 -13
- 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/DueDilligence/Incidents2/columns.js +0 -176
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/config.js +0 -171
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/create.jsx +0 -104
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/index.jsx +0 -156
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/SupplyChainMap/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/TradeRelationships/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/CustomSegment/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataChainOfCustody/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataCompilation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataConsilidation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/helper.js +0 -0
- /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,76 @@
|
|
|
1
|
+
import React, { useMemo, useEffect } from 'react'
|
|
2
|
+
import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
|
|
3
|
+
import DashboardLayout from '../../../core/components/Dashboard/DashboardLayout/index.jsx';
|
|
4
|
+
import Header from '../../../core/components/Header/index.jsx';
|
|
5
|
+
import Multiselect from '../../../core/components/Select/MultiSelect/index.jsx';
|
|
6
|
+
|
|
7
|
+
function OperatorSummary({
|
|
8
|
+
t = () => { },
|
|
9
|
+
goTo = () => { },
|
|
10
|
+
getRedirectLink = () => { },
|
|
11
|
+
theme = {},
|
|
12
|
+
user = {},
|
|
13
|
+
options = {},
|
|
14
|
+
partners,
|
|
15
|
+
selectedPartners,
|
|
16
|
+
setSelectedPartners,
|
|
17
|
+
informationSources,
|
|
18
|
+
hardcodedData,
|
|
19
|
+
breadCrumbs = [],
|
|
20
|
+
}) {
|
|
21
|
+
|
|
22
|
+
const sourceOptions = useMemo(() => {
|
|
23
|
+
if (!partners?.length) return [];
|
|
24
|
+
|
|
25
|
+
return partners?.map((partner) => {
|
|
26
|
+
const isOwnData = partner.id === user?.company?.id;
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
label: partner.nickName,
|
|
30
|
+
value: partner.id,
|
|
31
|
+
avatar: isOwnData ? <span>OWN</span> : <CustomIcon name={"Search02"} size={14} />,
|
|
32
|
+
background: isOwnData ? theme.colorPrimary7 : undefined,
|
|
33
|
+
color: isOwnData ? "white" : undefined,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
}, [partners, user]);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
window.theme = theme;
|
|
40
|
+
}, [theme])
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<DashboardLayout
|
|
45
|
+
header={
|
|
46
|
+
<Header
|
|
47
|
+
title={t('Operator Summary')}
|
|
48
|
+
addedHeader={
|
|
49
|
+
<div>
|
|
50
|
+
<Multiselect
|
|
51
|
+
options={[...sourceOptions]}
|
|
52
|
+
isAvatarGroup
|
|
53
|
+
selectionType="checkbox"
|
|
54
|
+
canUnselectLast={false}
|
|
55
|
+
key={partners?.length}
|
|
56
|
+
onChange={(selected) => {
|
|
57
|
+
setSelectedPartners((prev) => ({
|
|
58
|
+
...prev,
|
|
59
|
+
partners: selected,
|
|
60
|
+
loading: false,
|
|
61
|
+
}));
|
|
62
|
+
}}
|
|
63
|
+
dropDownWidth={200}
|
|
64
|
+
defaultSelected={partners?.map((p) => p.id) || []}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
}
|
|
68
|
+
breadcrumbs={breadCrumbs}
|
|
69
|
+
/>
|
|
70
|
+
}
|
|
71
|
+
>
|
|
72
|
+
</DashboardLayout>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default OperatorSummary;
|
|
@@ -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":
|
|
@@ -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,17 +1,19 @@
|
|
|
1
1
|
// Dashboards
|
|
2
|
-
export { default as SupplyChainDashboard } from './@daf/pages/
|
|
3
|
-
export { default as UserDashboard } from './@daf/pages/
|
|
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/
|
|
2
|
+
export { default as SupplyChainDashboard } from './@daf/pages/Dashboards/SupplyChain/index.jsx';
|
|
3
|
+
export { default as UserDashboard } from './@daf/pages/Dashboards/UserDashboard/index.jsx';
|
|
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
11
|
|
|
12
|
-
export { default as IncidentsTable } from './@daf/pages/
|
|
13
|
-
export { default as ProductionSitesTable } from './@daf/pages/
|
|
12
|
+
export { default as IncidentsTable } from './@daf/pages/Events/Incidents/index.jsx';
|
|
13
|
+
export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
// Summary
|
|
17
|
+
export { default as OperatorSummary } from './@daf/pages/Summary/operator/index.jsx';
|
|
18
|
+
export { default as RestorationActivitySummary } from './@daf/pages/Summary/Activities/Restoration/index.jsx';
|
|
17
19
|
|
|
@@ -1,151 +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: 'name',
|
|
32
|
-
title: t('Name'),
|
|
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
|
-
dataIndex: 'keyStakeholder',
|
|
60
|
-
title: t('Key Stakeholder'),
|
|
61
|
-
ellipsis: true,
|
|
62
|
-
show: true,
|
|
63
|
-
render: (v, all) => {
|
|
64
|
-
if (all.empty) {
|
|
65
|
-
return <div className="daf-default-cell" />
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const country = findOptions(v, options?.countries);
|
|
69
|
-
|
|
70
|
-
return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
dataIndex: 'scope',
|
|
75
|
-
title: t('Scope'),
|
|
76
|
-
ellipsis: true,
|
|
77
|
-
show: true,
|
|
78
|
-
render: (v, all) => {
|
|
79
|
-
if (all.empty) {
|
|
80
|
-
return <div className="daf-default-cell" />
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const scope = getLinkValue(v, all?.linking?.SCL);
|
|
84
|
-
|
|
85
|
-
return scope ? <Tooltip title={scope}>{scope}</Tooltip> : '-';
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
title: t("Start Date"),
|
|
90
|
-
dataIndex: "startDate",
|
|
91
|
-
key: "startDate",
|
|
92
|
-
width: 125,
|
|
93
|
-
render: (date, all) => {
|
|
94
|
-
if (all.empty) {
|
|
95
|
-
return <div className="daf-default-cell" />;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
99
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
100
|
-
},
|
|
101
|
-
ellipsis: true,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
title: t("End Date"),
|
|
105
|
-
dataIndex: "endDate",
|
|
106
|
-
key: "endDate",
|
|
107
|
-
width: 125,
|
|
108
|
-
render: (date, all) => {
|
|
109
|
-
if (all.empty) {
|
|
110
|
-
return <div className="daf-default-cell" />;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
114
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
115
|
-
},
|
|
116
|
-
ellipsis: true,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
title: t("Sources"),
|
|
120
|
-
dataIndex: "sources",
|
|
121
|
-
key: "sources",
|
|
122
|
-
show: activeTab !== "own",
|
|
123
|
-
render: (val, all) => {
|
|
124
|
-
if (all.empty) {
|
|
125
|
-
return <div className="daf-default-cell" />;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const sources = sourceAvatarConfig(val, user, applications);
|
|
129
|
-
|
|
130
|
-
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: 'actions',
|
|
135
|
-
title: "",
|
|
136
|
-
width: 60,
|
|
137
|
-
render: (_, all) => {
|
|
138
|
-
if (all.empty) {
|
|
139
|
-
return <div className="daf-default-cell" />;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
143
|
-
|
|
144
|
-
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
145
|
-
<a href={getRedirectLink(link)}>
|
|
146
|
-
<CustomIcon name="Link" size={15} color={theme.baseGray70} />
|
|
147
|
-
</a>
|
|
148
|
-
</div>;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
].filter((column) => column.show !== false);
|
|
@@ -1,132 +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
|
-
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, applications}) => [
|
|
10
|
-
{
|
|
11
|
-
dataIndex: 'datastakeId',
|
|
12
|
-
title: t('ID'),
|
|
13
|
-
ellipsis: true,
|
|
14
|
-
show: true,
|
|
15
|
-
render: (v, all) => {
|
|
16
|
-
if (all.empty) {
|
|
17
|
-
return <div className="daf-default-cell" />
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return <Tooltip title={v}>{v}</Tooltip>;
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
dataIndex: 'name',
|
|
25
|
-
title: t('Name'),
|
|
26
|
-
ellipsis: true,
|
|
27
|
-
show: true,
|
|
28
|
-
render: (v, all) => {
|
|
29
|
-
if (all.empty) {
|
|
30
|
-
return <div className="daf-default-cell" />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return <Tooltip title={v}>{v}</Tooltip>;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
dataIndex: 'category',
|
|
38
|
-
title: t('Category'),
|
|
39
|
-
ellipsis: true,
|
|
40
|
-
show: true,
|
|
41
|
-
render: (v, all) => {
|
|
42
|
-
if (all.empty) {
|
|
43
|
-
return <div className="daf-default-cell" />
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const category = findOptions(v, options?.categoriesOptions);
|
|
47
|
-
|
|
48
|
-
return category ? <Tooltip title={category}>{category}</Tooltip> : '-';
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
dataIndex: 'subCategory',
|
|
53
|
-
title: t('Sub Category'),
|
|
54
|
-
ellipsis: true,
|
|
55
|
-
show: true,
|
|
56
|
-
render: (v, all) => {
|
|
57
|
-
if (all.empty) {
|
|
58
|
-
return <div className="daf-default-cell" />
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const subCategory = findOptions(v, options?.subCategoriesOptions);
|
|
62
|
-
|
|
63
|
-
return subCategory ? <Tooltip title={subCategory}>{subCategory}</Tooltip> : '-';
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
dataIndex: 'country',
|
|
68
|
-
title: t('Country'),
|
|
69
|
-
ellipsis: true,
|
|
70
|
-
show: true,
|
|
71
|
-
render: (v, all) => {
|
|
72
|
-
if (all.empty) {
|
|
73
|
-
return <div className="daf-default-cell" />
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const country = findOptions(v, options?.countries);
|
|
77
|
-
|
|
78
|
-
return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
title: t("Last Update"),
|
|
83
|
-
dataIndex: "updatedAt",
|
|
84
|
-
key: "updatedAt",
|
|
85
|
-
width: 125,
|
|
86
|
-
render: (date, all) => {
|
|
87
|
-
if (all.empty) {
|
|
88
|
-
return <div className="daf-default-cell" />;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
92
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
93
|
-
},
|
|
94
|
-
ellipsis: true,
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
title: t("Sources"),
|
|
98
|
-
dataIndex: "sources",
|
|
99
|
-
key: "sources",
|
|
100
|
-
show: activeTab !== "own",
|
|
101
|
-
render: (val, all) => {
|
|
102
|
-
if (all.empty) {
|
|
103
|
-
return <div className="daf-default-cell" />;
|
|
104
|
-
}
|
|
105
|
-
if (!val || val?.length === 0) {
|
|
106
|
-
return "--";
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const sources = sourceAvatarConfig(val, user, applications);
|
|
110
|
-
|
|
111
|
-
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'actions',
|
|
116
|
-
title: "",
|
|
117
|
-
width: 60,
|
|
118
|
-
render: (_, all) => {
|
|
119
|
-
if (all.empty) {
|
|
120
|
-
return <div className="daf-default-cell" />;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
124
|
-
|
|
125
|
-
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
126
|
-
<a href={getRedirectLink(link)}>
|
|
127
|
-
<CustomIcon name="Link" size={15} color={theme.baseGray70} />
|
|
128
|
-
</a>
|
|
129
|
-
</div>;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
].filter((column) => column.show !== false);
|
|
@@ -1,176 +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
|
-
|
|
8
|
-
const getLinkValue = (value, linkingObject) => {
|
|
9
|
-
if(linkingObject && linkingObject?.[value]) {
|
|
10
|
-
return linkingObject?.[value]?.name;
|
|
11
|
-
}
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data}) => [
|
|
16
|
-
{
|
|
17
|
-
dataIndex: 'datastakeId',
|
|
18
|
-
title: t('ID'),
|
|
19
|
-
ellipsis: true,
|
|
20
|
-
show: true,
|
|
21
|
-
render: (v, all) => {
|
|
22
|
-
if (all.empty) {
|
|
23
|
-
return <div className="daf-default-cell" />
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return <Tooltip title={v}>{v}</Tooltip>;
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
dataIndex: 'title',
|
|
31
|
-
title: t('Title'),
|
|
32
|
-
ellipsis: true,
|
|
33
|
-
show: true,
|
|
34
|
-
render: (v, all) => {
|
|
35
|
-
if (all.empty) {
|
|
36
|
-
return <div className="daf-default-cell" />
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return <Tooltip title={v}>{v}</Tooltip>;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
title: t("Date"),
|
|
44
|
-
dataIndex: "date",
|
|
45
|
-
key: "date",
|
|
46
|
-
width: 125,
|
|
47
|
-
render: (date, all) => {
|
|
48
|
-
if (all.empty) {
|
|
49
|
-
return <div className="daf-default-cell" />;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
53
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
54
|
-
},
|
|
55
|
-
ellipsis: true,
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
dataIndex: 'location',
|
|
60
|
-
title: t('Location'),
|
|
61
|
-
ellipsis: true,
|
|
62
|
-
show: true,
|
|
63
|
-
render: (v, all) => {
|
|
64
|
-
if (all.empty) {
|
|
65
|
-
return <div className="daf-default-cell" />
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const location = getLinkValue(all?.location, all?.linking);
|
|
69
|
-
|
|
70
|
-
return location ? <Tooltip title={location}>{location}</Tooltip> : '-';
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
title: t("Province"),
|
|
75
|
-
dataIndex: "province",
|
|
76
|
-
key: "province",
|
|
77
|
-
show: activeTab !== "own",
|
|
78
|
-
render: (val, all) => {
|
|
79
|
-
if (all.empty) {
|
|
80
|
-
return <div className="daf-default-cell" />;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
console.log({val, all})
|
|
84
|
-
|
|
85
|
-
return <AvatarGroup items={val}></AvatarGroup>;
|
|
86
|
-
},
|
|
87
|
-
}
|
|
88
|
-
, {
|
|
89
|
-
dataIndex: 'territory',
|
|
90
|
-
title: t('Territory'),
|
|
91
|
-
ellipsis: true,
|
|
92
|
-
show: true,
|
|
93
|
-
render: (v, all) => {
|
|
94
|
-
if (all.empty) {
|
|
95
|
-
return <div className="daf-default-cell" />
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const territory = getLinkValue(all?.territory, all?.linking);
|
|
99
|
-
|
|
100
|
-
return territory ? <Tooltip title={territory}>{territory}</Tooltip> : '-';
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
title: t("Category"),
|
|
105
|
-
dataIndex: 'category',
|
|
106
|
-
ellipsis: true,
|
|
107
|
-
show: activeTab !== "own",
|
|
108
|
-
render: (v, all) => {
|
|
109
|
-
if (all.empty) {
|
|
110
|
-
return <div className="daf-default-cell" />
|
|
111
|
-
}
|
|
112
|
-
const category = findOptions(v, data?.options?.categoryOptions);
|
|
113
|
-
return category ? <Tooltip title={category}>{category}</Tooltip> : '-';
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
title: t("Sources"),
|
|
118
|
-
dataIndex: 'sources',
|
|
119
|
-
ellipsis: true,
|
|
120
|
-
show: activeTab !== "own",
|
|
121
|
-
render: (v, all) => {
|
|
122
|
-
if (all.empty) {
|
|
123
|
-
return <div className="daf-default-cell" />
|
|
124
|
-
}
|
|
125
|
-
const sources = findOptions(v, data?.options?.sourcesOptions);
|
|
126
|
-
return sources ? <Tooltip title={sources}>{sources}</Tooltip> : '-';
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
title: t("Status"),
|
|
131
|
-
dataIndex: 'status',
|
|
132
|
-
ellipsis: true,
|
|
133
|
-
show: activeTab == "own",
|
|
134
|
-
render: (v, all) => {
|
|
135
|
-
if (all.empty) {
|
|
136
|
-
return <div className="daf-default-cell" />
|
|
137
|
-
}
|
|
138
|
-
const status = findOptions(v, data?.options?.statusOptions);
|
|
139
|
-
return status ? <Tooltip title={status}>{status}</Tooltip> : '-';
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
title: t("Last Update"),
|
|
145
|
-
dataIndex: "updatedAt",
|
|
146
|
-
key: "updatedAt",
|
|
147
|
-
width: 125,
|
|
148
|
-
render: (date, all) => {
|
|
149
|
-
if (all.empty) {
|
|
150
|
-
return <div className="daf-default-cell" />;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
154
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
155
|
-
},
|
|
156
|
-
ellipsis: true,
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
id: 'actions',
|
|
160
|
-
title: "",
|
|
161
|
-
width: 60,
|
|
162
|
-
render: (_, all) => {
|
|
163
|
-
if (all.empty) {
|
|
164
|
-
return <div className="daf-default-cell" />;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
168
|
-
|
|
169
|
-
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
170
|
-
<a href={getRedirectLink(link)}>
|
|
171
|
-
<CustomIcon name="Link" size={15} color={theme.baseGray70} />
|
|
172
|
-
</a>
|
|
173
|
-
</div>;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
].filter((column) => column.show !== false);
|