datastake-daf 0.6.794 → 0.6.796

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.
Files changed (126) hide show
  1. package/build/favicon.ico +0 -0
  2. package/build/logo192.png +0 -0
  3. package/build/logo512.png +0 -0
  4. package/build/manifest.json +25 -0
  5. package/build/robots.txt +3 -0
  6. package/dist/components/index.js +3354 -4327
  7. package/dist/pages/index.js +2853 -3439
  8. package/dist/services/index.js +3 -69
  9. package/dist/style/datastake/mapbox-gl.css +330 -0
  10. package/dist/utils/index.js +20 -14
  11. package/package.json +1 -1
  12. package/public/Vegetation/black-default.svg +23 -0
  13. package/public/Vegetation/black.svg +12 -0
  14. package/public/Vegetation/damage-from-insects-default.svg +14 -0
  15. package/public/Vegetation/damage-from-insects.svg +8 -0
  16. package/public/Vegetation/dry-or-dead-default.svg +16 -0
  17. package/public/Vegetation/dry-or-dead.svg +7 -0
  18. package/public/Vegetation/healthy-default.svg +14 -0
  19. package/public/Vegetation/healthy.svg +34 -0
  20. package/public/Vegetation/mosaic-default.svg +17 -0
  21. package/public/Vegetation/mosaic.svg +9 -0
  22. package/public/Vegetation/no-leaves-default.svg +6 -0
  23. package/public/Vegetation/no-leaves.svg +5 -0
  24. package/public/Vegetation/reddish-default.svg +23 -0
  25. package/public/Vegetation/reddish.svg +79 -0
  26. package/public/Vegetation/spider-webs-default.svg +10 -0
  27. package/public/Vegetation/spider-webs.svg +10 -0
  28. package/public/Vegetation/white-default.svg +25 -0
  29. package/public/Vegetation/white.svg +12 -0
  30. package/public/Vegetation/yellowing-default.svg +7 -0
  31. package/public/Vegetation/yellowing.svg +8 -0
  32. package/src/@daf/core/components/Dashboard/Map/hook.js +25 -1
  33. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/index.jsx +24 -6
  34. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/style.js +2 -6
  35. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/VegetationWidget.stories.jsx +76 -0
  36. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/config.js +31 -0
  37. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/index.jsx +137 -0
  38. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +1 -0
  39. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
  40. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
  41. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
  42. package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +1 -0
  43. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
  44. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +8 -18
  45. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
  46. package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
  47. package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
  48. package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +7 -6
  49. package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
  50. package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +0 -1
  51. package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +0 -1
  52. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +45 -73
  53. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
  54. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +22 -48
  55. package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +0 -1
  56. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +1 -3
  57. package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +3 -5
  58. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +8 -13
  59. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
  60. package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +4 -3
  61. package/src/@daf/core/components/Screens/Admin/adminRoutes.js +2 -81
  62. package/src/@daf/core/components/ViewForm/components/Records/config.js +3 -0
  63. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +1 -1
  64. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +0 -1
  65. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +3 -2
  66. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +13 -4
  67. package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +22 -20
  68. package/src/@daf/pages/Events/Activities/columns.js +1 -1
  69. package/src/@daf/pages/Events/Activities/config.js +23 -30
  70. package/src/@daf/pages/Events/Incidents/columns.js +1 -1
  71. package/src/@daf/pages/Events/Incidents/config.js +23 -30
  72. package/src/@daf/pages/Events/config.js +7 -7
  73. package/src/@daf/pages/Locations/MineSite/columns.js +3 -3
  74. package/src/@daf/pages/Locations/MineSite/config.js +20 -14
  75. package/src/@daf/pages/Locations/config.js +3 -3
  76. package/src/@daf/pages/Stakeholders/Operators/columns.js +2 -2
  77. package/src/@daf/pages/Stakeholders/Operators/config.js +9 -16
  78. package/src/@daf/pages/Stakeholders/Workers/columns.js +1 -1
  79. package/src/@daf/pages/Stakeholders/Workers/config.js +23 -29
  80. package/src/@daf/pages/Stakeholders/config.js +3 -3
  81. package/src/@daf/pages/Summary/Activities/Monitoring/components/ActivityImagery/index.jsx +12 -10
  82. package/src/@daf/pages/Summary/Activities/Monitoring/components/BiodiversityAndHabitat/helper.js +86 -0
  83. package/src/@daf/pages/Summary/Activities/Monitoring/components/BiodiversityAndHabitat/index.jsx +65 -0
  84. package/src/@daf/pages/Summary/Activities/Monitoring/components/EnvironmentalMetrics/index.jsx +30 -0
  85. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/PlantedSpecies/index.jsx +15 -28
  86. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/SeedlingsHeight/index.jsx +17 -30
  87. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/SurvivalRate/index.jsx +38 -45
  88. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/index.jsx +87 -8
  89. package/src/@daf/pages/Summary/Activities/Monitoring/config.js +21 -4
  90. package/src/@daf/pages/Summary/Activities/Monitoring/helper.js +7 -1
  91. package/src/@daf/pages/Summary/Activities/Monitoring/index.jsx +31 -8
  92. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +1 -1
  93. package/src/@daf/pages/TablePage/helper.js +17 -1
  94. package/src/@daf/pages/TablePage/hook.js +3 -1
  95. package/src/@daf/pages/TablePage/index.jsx +8 -6
  96. package/src/@daf/pages/View/index.jsx +4 -2
  97. package/src/@daf/services/AdminService.js +7 -79
  98. package/src/@daf/services/DashboardService.js +1 -2
  99. package/src/@daf/utils/filters.js +26 -15
  100. package/src/constants/Vegetation.js +15 -0
  101. package/src/constants/locales/en/translation.js +1 -7
  102. package/src/constants/locales/fr/translation.js +2 -1
  103. package/src/constants/locales/sp/translation.js +2 -1
  104. package/src/index.js +1 -0
  105. package/src/pages.js +1 -10
  106. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +0 -79
  107. package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +0 -272
  108. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +0 -223
  109. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +0 -65
  110. package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +0 -81
  111. package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +0 -76
  112. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +0 -38
  113. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +0 -13
  114. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +0 -77
  115. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +0 -38
  116. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
  117. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +0 -75
  118. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +0 -180
  119. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
  120. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +0 -27
  121. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +0 -157
  122. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +0 -31
  123. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +0 -77
  124. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +0 -117
  125. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +0 -54
  126. package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
@@ -1,38 +0,0 @@
1
- export const config = [
2
- {
3
- label: "Core Data",
4
- key: "core-data",
5
- title: "Core Data",
6
- items: [
7
- {
8
- label: "Name",
9
- key: "name",
10
- type: "input"
11
- },
12
- {
13
- label: "Category",
14
- key: "category",
15
- type: "select",
16
- optionsName: "category"
17
- },
18
- {
19
- label: "Country",
20
- key: "country",
21
- type: "select",
22
- optionsName: "countries"
23
- },
24
- {
25
- label: "Province",
26
- key: "administrativeLevel1",
27
- type: "administrative",
28
- level: "level_1"
29
- },
30
- {
31
- label: "Territory",
32
- key: "administrativeLevel2",
33
- type: "administrative",
34
- level: "level_2"
35
- },
36
- ],
37
- },
38
- ];
@@ -1,13 +0,0 @@
1
- export const getNameByLevel = (data, level) => {
2
- const entry = Object.values(data || {}).find(item => item.level === level);
3
- return entry?.name || "-";
4
- };
5
-
6
- export const getAdministrativeLevel1 = (location) => {
7
- return getNameByLevel(location?.linking?.SCL, "level_1");
8
- };
9
-
10
- export const getAdministrativeLevel2 = (location) => {
11
- return getNameByLevel(location?.linking?.SCL, "level_2");
12
- };
13
-
@@ -1,77 +0,0 @@
1
- import { findOptions } from "../../../../../../../helpers/StringHelper.js";
2
- import { getNameByLevel } from "./helpers.js";
3
- import LocationTable from "../../AdminTables/LocationTable/index.jsx";
4
-
5
- const isView = true;
6
-
7
- export default function View({
8
- userRoles = [],
9
- conf,
10
- data = {},
11
- formOptions = {},
12
- t,
13
- goTo,
14
- location,
15
- getRedirectLink,
16
- accountStatuses,
17
- module,
18
- }) {
19
- const renderItem = (item) => {
20
- if (item.type === "location") {
21
- return (
22
- <LocationTable
23
- isView={isView}
24
- entityData={data}
25
- goTo={goTo}
26
- getRedirectLink={getRedirectLink}
27
- t={t}
28
- location={location}
29
- module={module}
30
- />
31
- );
32
- }
33
-
34
- const getValue = () => {
35
- const val =
36
- item.getFormApps === true
37
- ? data?.apps?.find((app) => app.app === module)?.[item?.propertyName]
38
- : data?.[item.key];
39
-
40
- if (item.type === "select") {
41
- const option = findOptions(val, formOptions[item.optionsName] || []);
42
- return option ? t(option) : "-";
43
- }
44
-
45
- if (item.type === "administrative") {
46
- return getNameByLevel(data?.linking?.SCL, item.level) || "-";
47
- }
48
-
49
- return val ?? "-";
50
- };
51
-
52
- return (
53
- <div className="input" key={item.key}>
54
- <p className="label">
55
- <span>{t(item.label)}</span>
56
- </p>
57
- <p className="value">{getValue()}</p>
58
- </div>
59
- );
60
- };
61
-
62
-
63
-
64
- return (
65
- <div className="content">
66
- <div className="wrapper" style={{ width: 700 }}>
67
- <div className="group">
68
- <div className="daf-title with-subtitle">
69
- <h1>{t(conf.title)}</h1>
70
- </div>
71
-
72
- {conf.items.map((item) => renderItem(item))}
73
- </div>
74
- </div>
75
- </div>
76
- );
77
- }
@@ -1,38 +0,0 @@
1
- export const config = [
2
- {
3
- label: "Core Data",
4
- key: "core-data",
5
- title: "Core Data",
6
- items: [
7
- {
8
- label: "Name",
9
- key: "name",
10
- type: "input"
11
- },
12
- {
13
- label: "Category",
14
- key: "category",
15
- type: "select",
16
- optionsName: "category"
17
- },
18
- {
19
- label: "Country",
20
- key: "country",
21
- type: "select",
22
- optionsName: "countries"
23
- },
24
- // {
25
- // label: "Province",
26
- // key: "administrativeLevel1",
27
- // type: "administrative",
28
- // level: "level_1"
29
- // },
30
- // {
31
- // label: "Territory",
32
- // key: "administrativeLevel2",
33
- // type: "administrative",
34
- // level: "level_2"
35
- // },
36
- ],
37
- },
38
- ];
@@ -1,75 +0,0 @@
1
- import { findOptions } from "../../../../../../../helpers/StringHelper.js";
2
- import StakeholderTable from "../../AdminTables/SubjectsTable/index.jsx";
3
- const isView = true;
4
-
5
- export default function View({
6
- userRoles = [],
7
- conf,
8
- data = {},
9
- formOptions = {},
10
- t,
11
- goTo,
12
- stakeholder,
13
- getRedirectLink,
14
- accountStatuses,
15
- module,
16
- }) {
17
- const renderItem = (item) => {
18
- if (item.type === "stakeholder") {
19
- return (
20
- <StakeholderTable
21
- isView={isView}
22
- entityData={data}
23
- goTo={goTo}
24
- getRedirectLink={getRedirectLink}
25
- t={t}
26
- stakeholder={stakeholder}
27
- module={module}
28
- />
29
- );
30
- }
31
-
32
- const getValue = () => {
33
- const val =
34
- item.getFormApps === true
35
- ? data?.apps?.find((app) => app.app === module)?.[item?.propertyName]
36
- : data?.[item.key];
37
-
38
- if (item.type === "select") {
39
- const option = findOptions(val, formOptions[item.optionsName] || []);
40
- return option ? t(option) : "-";
41
- }
42
-
43
- if (item.type === "administrative") {
44
- return getNameByLevel(data?.linking?.SCL, item.level) || "-";
45
- }
46
-
47
- return val ?? "-";
48
- };
49
-
50
- return (
51
- <div className="input" key={item.key}>
52
- <p className="label">
53
- <span>{t(item.label)}</span>
54
- </p>
55
- <p className="value">{getValue()}</p>
56
- </div>
57
- );
58
- };
59
-
60
-
61
-
62
- return (
63
- <div className="content">
64
- <div className="wrapper" style={{ width: 700 }}>
65
- <div className="group">
66
- <div className="daf-title with-subtitle">
67
- <h1>{t(conf.title)}</h1>
68
- </div>
69
-
70
- {conf.items.map((item) => renderItem(item))}
71
- </div>
72
- </div>
73
- </div>
74
- );
75
- }
@@ -1,180 +0,0 @@
1
- import React from 'react';
2
- import { Tooltip } from 'antd';
3
- import { findOptions, getLinkValue } 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
- import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
9
- import MoreOptions from '../../../core/components/Table/MoreOptions/index.jsx';
10
- import { renderStatusTag } from '../../../utils/tags.js';
11
-
12
- export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
13
- {
14
- dataIndex: 'datastakeId',
15
- title: t('ID'),
16
- ellipsis: true,
17
- show: true,
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
- dataIndex: 'name',
28
- 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 <Tooltip title={v}>{v}</Tooltip>;
37
- },
38
- },
39
- {
40
- dataIndex: 'category',
41
- title: t('Category'),
42
- ellipsis: true,
43
- show: true,
44
- render: (v, all) => {
45
- if (all.empty) {
46
- return <div className="daf-default-cell" />
47
- }
48
- const category = findOptions(v, options?.locationCategories);
49
-
50
- return <Tooltip title={category}>{category}</Tooltip>;
51
- },
52
- },
53
- {
54
- dataIndex: 'lealForm',
55
- title: t('Legal Form'),
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 legalForm = findOptions(v, options?.legalFormOptions);
64
-
65
- return legalForm ? <Tooltip title={legalForm}>{legalForm}</Tooltip> : '-';
66
- },
67
- },
68
- {
69
- dataIndex: 'country',
70
- title: t('Country'),
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 country = findOptions(v, options?.countryOptions);
79
-
80
- return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
81
- },
82
- },
83
-
84
- // {
85
- // dataIndex: 'operator',
86
- // title: t('Operator'),
87
- // ellipsis: true,
88
- // show: true,
89
- // render: (v, all) => {
90
- // if (all.empty) {
91
- // return <div className="daf-default-cell" />
92
- // }
93
-
94
- // const operators = all?.operator?.map((operator) => operator?.locationClient?.name)?.filter(Boolean);
95
- // return (operators && operators.length > 0) ? <MoreOptions data={operators || []} toolTipPlacement={operators?.length < 2 ? "topLeft" : "top"} /> : '-';
96
- // },
97
- // },
98
- {
99
- title: t("Last Update"),
100
- dataIndex: "updatedAt",
101
- key: "updatedAt",
102
- width: 125,
103
- render: (date, all) => {
104
- if (all.empty) {
105
- return <div className="daf-default-cell" />;
106
- }
107
-
108
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
109
- return <Tooltip title={_date}>{_date}</Tooltip>;
110
- },
111
- ellipsis: true,
112
- },
113
- // {
114
- // title: t("Status"),
115
- // dataIndex: 'status',
116
- // ellipsis: true,
117
- // show: activeTab == "own",
118
- // render: (v, all) => {
119
- // if (all.empty) {
120
- // return <div className="daf-default-cell" />
121
- // }
122
- // const _val = all?.published || all?.status === "submitted" ? "submitted" : v;
123
-
124
- // return renderStatusTag({ value: _val, t });
125
- // },
126
- // },
127
-
128
- // {
129
- // title: t("Sources"),
130
- // dataIndex: 'sources',
131
- // ellipsis: true,
132
- // show: activeTab !== "own",
133
- // render: (v, all) => {
134
- // if (all.empty) {
135
- // return <div className="daf-default-cell" />
136
- // }
137
- // const sources = sourceAvatarConfig(v, user, applications);
138
- // return <AvatarGroup items={sources}></AvatarGroup>;
139
- // },
140
- // },
141
- {
142
- id: 'actions',
143
- title: "",
144
- width: 60,
145
- render: (_, all) => {
146
- if (all.empty) {
147
- return <div className="daf-default-cell" />;
148
- }
149
- const onClick = () => {
150
- let link = `/app/view/${subject}/${all.datastakeId}`;
151
- if (activeTab === "shared") {
152
- link += `?sourceId=${all?.authorId?.id}`;
153
- }
154
- goTo(getRedirectLink(link));
155
- };
156
- const moreMenuItems = [
157
- {
158
- label: t("Details"),
159
- value: "details",
160
- onClick: onClick,
161
- },
162
- {
163
- label: t("Summary"),
164
- value: "Summary",
165
- onClick: () => {
166
- let link = `/app/mine-summary/${all.datastakeId}`
167
- if (activeTab === "shared") {
168
- link += `?sourceId=${all?.authorId?.id}`;
169
- }
170
- goTo(getRedirectLink(link));
171
- },
172
- // disabled: true,
173
- },
174
- ];
175
- return <div >
176
- <MoreMenu items={moreMenuItems} />
177
- </div>;
178
- }
179
- }
180
- ].filter((column) => column.show !== false);
@@ -1,27 +0,0 @@
1
- import React, { useState, useEffect, useRef } from 'react'
2
- import TabsHeader from '../../../../core/components/Header/TabsHeader'
3
- import {Widget} from '../../../../core/components/Dashboard/Widget'
4
- import {getColumns} from './columns.js'
5
- import {useParams} from 'react-router-dom'
6
- import {DAFTable} from '../../../../core/components/Table'
7
- import {useIsDatastake} from '../../../../hooks/useIsDatastake.js'
8
-
9
- const AssociatedInformationTable = () => {
10
- const tabs =[
11
- {value:"stakeholders", label:"Stakeholders"},
12
- {value:"locations", label:"Locations"},
13
- {values:"events", label:"Events"},
14
- {values:"DOcuments",label:"Documents"},
15
- ]
16
- const [activeTab, setActiveTab] = useState("stakeholders");
17
- const [data,setData]= useState({
18
- stakeholders:[],
19
- locations:[],
20
- events:[],
21
- documents:[],
22
- })
23
- const [_options, _setOptions] = useState({});
24
- const params = useParams();
25
- const { user } = useSelector((state) => state.authentication);
26
- const { getRedirectLink } = useIsDatastake();
27
- }
@@ -1,157 +0,0 @@
1
- import { Tooltip } from "antd";
2
- import CustomIcon from "../../../../core/components/Icon/CustomIcon.jsx";
3
- // import {findOptions} from "../../../../helpers/StringHelper.js";
4
- import ProgressBar from "../../../../core/components/ProgressBar/index.jsx";
5
- import ProgressBarSideIcon from "../../../../core/components/ProgressBar/components/SideIcon/index.jsx";
6
- import { Link } from "react-router-dom";
7
- import { renderDateFormatted } from "../../../../../helpers/Forms.js";
8
-
9
- export const getColumns = ({
10
- t,
11
- goTo = () => {},
12
- show = "show",
13
- getRedirectLink = () => {},
14
- token,
15
- selectedSubjects,
16
- setSelectedSubjects,
17
- selectOptions,
18
- entity,
19
- }) => {
20
- const cols = [
21
- {
22
- dataIndex: "formName",
23
- title: t("form"),
24
- ellipsis: true,
25
- show: true,
26
- render: (v, all) => {
27
- if (all.empty) {
28
- return <div className="daf-default-cell" />;
29
- }
30
-
31
- const title = all?.published
32
- ? t("general-information")
33
- : t("registration");
34
-
35
- return <Tooltip title={title}>{title}</Tooltip>;
36
- },
37
- },
38
- {
39
- dataIndex: "completion",
40
- title: t("completion"),
41
- ellipsis: true,
42
- show: !isMonitoring,
43
- render: (v, all) => {
44
- if (all.empty) {
45
- return <div className="daf-default-cell" />;
46
- }
47
-
48
- const submittedStages = ["evaluation", "planning", "improvement"];
49
-
50
- const step1Stage = data?.stepStages?.["step-1"];
51
- const step2Stage = data?.stepStages?.["step-2"];
52
- const isSubmitted =
53
- data?.published &&
54
- submittedStages.includes(step1Stage) &&
55
- submittedStages.includes(step2Stage);
56
-
57
- return (
58
- <div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
59
- <ProgressBar
60
- tooltipTitle={isSubmitted && t("Submitted")}
61
- style={{ width: "100%" }}
62
- percentage={v || 0}
63
- isSubmitted={isSubmitted}
64
- ></ProgressBar>
65
- {isSubmitted ? (
66
- <ProgressBarSideIcon size={16} iconSize={10} />
67
- ) : (
68
- <span>{v || 0}%</span>
69
- )}
70
- </div>
71
- );
72
- },
73
- },
74
- {
75
- dataIndex: "monitoring",
76
- title: t("Monitoring"),
77
- ellipsis: true,
78
- show: isMonitoring,
79
- render: (v, all) => {
80
- if (all.empty) {
81
- return <div className="daf-default-cell" />;
82
- }
83
-
84
- return <Tooltip title={v || 0}>{v || 0}</Tooltip>;
85
- },
86
- },
87
- {
88
- dataIndex: "lastUpdate",
89
- title: t("Last Update"),
90
- ellipsis: true,
91
- show: true,
92
- render: (_v, all) => {
93
- if (all.empty) {
94
- return <div className="daf-default-cell" />;
95
- }
96
-
97
- const v = _v
98
- ? renderDateFormatted(_v, "DD MMM YYYY", user?.language || "en")
99
- : "-";
100
-
101
- return <Tooltip title={v}>{v}</Tooltip>;
102
- },
103
- },
104
- {
105
- dataIndex: "action",
106
- title: "",
107
- width: 60,
108
- show: true,
109
- render: (_, all) => {
110
- if (all.empty) {
111
- return <div className="daf-default-cell" />;
112
- }
113
-
114
- let link = `/app/mines/${all.datastakeId}/${all?.key?.toLowerCase()}`;
115
-
116
- if (all?.key.includes("monitoring")) {
117
- return (
118
- <Link to={getRedirectLink(link)}>
119
- <CustomIcon name="Link" width={18} height={18} />
120
- </Link>
121
- );
122
- }
123
-
124
- if (all?.key.includes("identification")) {
125
- link = `/app/view/location/${all.datastakeId}`;
126
- }
127
-
128
- const stage = data?.stage;
129
- const key = all?.key;
130
- let isDisabled = false;
131
-
132
- if (
133
- (stage === "evaluation" && (key === "improvement" || key === "planning")) ||
134
- (stage === "planning" && key === "improvement") ||
135
- (!["evaluation", "planning", "improvement"].includes(stage) &&
136
- key !== "identification")
137
- ) {
138
- isDisabled = true;
139
- }
140
-
141
- return <div style={{ display: "flex", justifyContent: "center" }}>
142
- {isDisabled ? (
143
- <span style={{ cursor: "not-allowed", opacity: 0.5 }}>
144
- <CustomIcon name="Link" width={18} height={18} />
145
- </span>
146
- ) : (
147
- <Link to={getRedirectLink(link)}>
148
- <CustomIcon name="Link" width={18} height={18} />
149
- </Link>
150
- )}
151
- </div>;
152
- },
153
- },
154
- ]
155
-
156
- return cols.filter((c) => c[show]);
157
- };
@@ -1,31 +0,0 @@
1
- export const getFiltersConfig = ({t}) => {
2
- return {
3
- timeframe: {
4
- type: "timeframe",
5
- label: "Timeframe",
6
- style: { flex: 1 },
7
- },
8
- }
9
- }
10
-
11
- export const getFilterOptions = (options, t) => {
12
- const { timeframe = [] } = options || {};
13
- const _default = {
14
- timeframe: timeframe,
15
- }
16
-
17
- return _default;
18
- }
19
-
20
- export const formConfig = {
21
- namespace: 'organisation',
22
- view: 'information',
23
- scope: 'create',
24
- formType: 'organisation',
25
- }
26
-
27
- export const viewConfig = {
28
- title: "Organisations",
29
- createTitle: "Create Organisation",
30
- }
31
-