datastake-daf 0.6.763 → 0.6.765
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 +45 -19
- package/dist/hooks/index.js +1 -1
- package/dist/layouts/index.js +36 -11
- package/dist/pages/index.js +1974 -999
- package/dist/services/index.js +1 -21
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +9 -4
- package/src/@daf/core/components/Table/index.jsx +2 -2
- package/src/@daf/core/components/UI/KeyIndicatorNavigateLabel/index.jsx +29 -0
- package/src/@daf/hooks/useFilters.js +1 -1
- package/src/@daf/layouts/AppLayout/components/MobileDrawer/index.js +4 -2
- package/src/@daf/layouts/AppLayout/components/UserDropdown/index.js +23 -2
- package/src/@daf/layouts/AppLayout/index.jsx +2 -0
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/GenderDistribution/config.js +7 -6
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +2 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/config.js +29 -53
- package/src/@daf/pages/Dashboards/SupplyChain/index.jsx +2 -2
- package/src/@daf/pages/Dashboards/UserDashboard/components/KeyIndicators/config.js +36 -70
- package/src/@daf/pages/Documents/index.jsx +9 -13
- package/src/@daf/pages/Events/Activities/index.jsx +8 -21
- package/src/@daf/pages/Events/Incidents/index.jsx +8 -21
- package/src/@daf/pages/Events/index.jsx +8 -20
- package/src/@daf/pages/Locations/MineSite/index.jsx +8 -21
- package/src/@daf/pages/Locations/index.jsx +9 -12
- package/src/@daf/pages/Partners/columns.js +421 -0
- package/src/@daf/pages/Partners/config.js +32 -0
- package/src/@daf/pages/Partners/create.jsx +145 -0
- package/src/@daf/pages/Partners/edit.jsx +98 -0
- package/src/@daf/pages/Partners/hook.js +153 -0
- package/src/@daf/pages/Partners/index.jsx +233 -8
- package/src/@daf/pages/Stakeholders/Operators/index.jsx +8 -22
- package/src/@daf/pages/Stakeholders/Workers/index.jsx +8 -21
- package/src/@daf/pages/Stakeholders/index.jsx +9 -10
- package/src/@daf/pages/Summary/Activities/PlantingCycle/config.js +40 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/helper.js +122 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/index.jsx +46 -0
- package/src/@daf/pages/Summary/Activities/Restoration/config.js +1 -1
- package/src/@daf/pages/hook.js +34 -0
- package/src/@daf/services/PartnerService.js +1 -16
- package/src/index.js +1 -1
- package/src/pages.js +2 -0
package/dist/services/index.js
CHANGED
|
@@ -1532,30 +1532,10 @@ var OperatorService$1 = createLazyService(OperatorService);
|
|
|
1532
1532
|
|
|
1533
1533
|
class PartnerService extends BaseService {
|
|
1534
1534
|
get(tab, filters) {
|
|
1535
|
-
const {
|
|
1536
|
-
page,
|
|
1537
|
-
pageSize,
|
|
1538
|
-
search,
|
|
1539
|
-
searchParams,
|
|
1540
|
-
...rest
|
|
1541
|
-
} = filters;
|
|
1542
|
-
const params = {
|
|
1543
|
-
filters: rest,
|
|
1544
|
-
pagination: {
|
|
1545
|
-
skip: page,
|
|
1546
|
-
take: pageSize
|
|
1547
|
-
}
|
|
1548
|
-
};
|
|
1549
|
-
if (search && searchParams.length > 0) {
|
|
1550
|
-
params.search = {
|
|
1551
|
-
qs: search,
|
|
1552
|
-
fields: searchParams
|
|
1553
|
-
};
|
|
1554
|
-
}
|
|
1555
1535
|
return this.apiGet({
|
|
1556
1536
|
url: "/partner",
|
|
1557
1537
|
isApp: true,
|
|
1558
|
-
params
|
|
1538
|
+
params: filters
|
|
1559
1539
|
});
|
|
1560
1540
|
}
|
|
1561
1541
|
create(data) {
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/* Isolated Mapbox GL CSS - Scoped to prevent Leaflet conflicts */
|
|
2
|
+
|
|
3
|
+
/* Mapbox GL Core Styles - Scoped with .mapbox-gl-scope */
|
|
4
|
+
.mapbox-gl-scope .mapboxgl-map {
|
|
5
|
+
font: 12px/20px Helvetica Neue, Arial, Helvetica, sans-serif;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
position: relative;
|
|
8
|
+
-webkit-tap-highlight-color: rgb(0 0 0/0);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.mapbox-gl-scope .mapboxgl-canvas {
|
|
12
|
+
left: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.mapbox-gl-scope .mapboxgl-map:-webkit-full-screen {
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.mapbox-gl-scope .mapboxgl-canary {
|
|
23
|
+
background-color: salmon;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive,
|
|
27
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {
|
|
28
|
+
cursor: grab;
|
|
29
|
+
-webkit-user-select: none;
|
|
30
|
+
user-select: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer {
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive:active,
|
|
38
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active {
|
|
39
|
+
cursor: grabbing;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,
|
|
43
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas {
|
|
44
|
+
touch-action: pan-x pan-y;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan,
|
|
48
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas {
|
|
49
|
+
touch-action: pinch-zoom;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,
|
|
53
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {
|
|
54
|
+
touch-action: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Control positioning */
|
|
58
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom,
|
|
59
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-left,
|
|
60
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-right,
|
|
61
|
+
.mapbox-gl-scope .mapboxgl-ctrl-left,
|
|
62
|
+
.mapbox-gl-scope .mapboxgl-ctrl-right,
|
|
63
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top,
|
|
64
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-left,
|
|
65
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-right {
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
position: absolute;
|
|
68
|
+
z-index: 2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-left {
|
|
72
|
+
left: 0;
|
|
73
|
+
top: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top {
|
|
77
|
+
left: 50%;
|
|
78
|
+
top: 0;
|
|
79
|
+
transform: translateX(-50%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-right {
|
|
83
|
+
right: 0;
|
|
84
|
+
top: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.mapbox-gl-scope .mapboxgl-ctrl-right {
|
|
88
|
+
right: 0;
|
|
89
|
+
top: 50%;
|
|
90
|
+
transform: translateY(-50%);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-right {
|
|
94
|
+
bottom: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom {
|
|
99
|
+
bottom: 0;
|
|
100
|
+
left: 50%;
|
|
101
|
+
transform: translateX(-50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-left {
|
|
105
|
+
bottom: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mapbox-gl-scope .mapboxgl-ctrl-left {
|
|
110
|
+
left: 0;
|
|
111
|
+
top: 50%;
|
|
112
|
+
transform: translateY(-50%);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.mapbox-gl-scope .mapboxgl-ctrl {
|
|
116
|
+
clear: both;
|
|
117
|
+
pointer-events: auto;
|
|
118
|
+
transform: translate(0);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
|
|
122
|
+
float: left;
|
|
123
|
+
margin: 10px 0 0 10px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top .mapboxgl-ctrl {
|
|
127
|
+
float: left;
|
|
128
|
+
margin: 10px 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
|
|
132
|
+
float: right;
|
|
133
|
+
margin: 10px 10px 0 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,
|
|
137
|
+
.mapbox-gl-scope .mapboxgl-ctrl-right .mapboxgl-ctrl {
|
|
138
|
+
float: right;
|
|
139
|
+
margin: 0 10px 10px 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom .mapboxgl-ctrl {
|
|
143
|
+
float: left;
|
|
144
|
+
margin: 10px 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,
|
|
148
|
+
.mapbox-gl-scope .mapboxgl-ctrl-left .mapboxgl-ctrl {
|
|
149
|
+
float: left;
|
|
150
|
+
margin: 0 0 10px 10px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Control group styling */
|
|
154
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group {
|
|
155
|
+
background: #fff;
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group:not(:empty) {
|
|
160
|
+
box-shadow: 0 0 0 2px #0000001a;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button {
|
|
164
|
+
background-color: initial;
|
|
165
|
+
border: 0;
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
display: block;
|
|
169
|
+
height: 29px;
|
|
170
|
+
outline: none;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
padding: 0;
|
|
173
|
+
width: 29px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button+button {
|
|
177
|
+
border-top: 1px solid #ddd;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.mapbox-gl-scope .mapboxgl-ctrl button .mapboxgl-ctrl-icon {
|
|
181
|
+
background-position: 50%;
|
|
182
|
+
background-repeat: no-repeat;
|
|
183
|
+
display: block;
|
|
184
|
+
height: 100%;
|
|
185
|
+
width: 100%;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attrib-button:focus,
|
|
189
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:focus {
|
|
190
|
+
box-shadow: 0 0 2px 2px #0096ff;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.mapbox-gl-scope .mapboxgl-ctrl button:disabled {
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.mapbox-gl-scope .mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon {
|
|
198
|
+
opacity: .25;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:first-child {
|
|
202
|
+
border-radius: 4px 4px 0 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:last-child {
|
|
206
|
+
border-radius: 0 0 4px 4px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:only-child {
|
|
210
|
+
border-radius: inherit;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.mapbox-gl-scope .mapboxgl-ctrl button:not(:disabled):hover {
|
|
214
|
+
background-color: #0000000d;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Marker styles */
|
|
218
|
+
.mapbox-gl-scope .mapboxgl-marker {
|
|
219
|
+
position: absolute;
|
|
220
|
+
z-index: 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.mapbox-gl-scope .mapboxgl-marker svg {
|
|
224
|
+
display: block;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Popup styles */
|
|
228
|
+
.mapbox-gl-scope .mapboxgl-popup {
|
|
229
|
+
position: absolute;
|
|
230
|
+
text-align: center;
|
|
231
|
+
margin-bottom: 20px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.mapbox-gl-scope .mapboxgl-popup-content-wrapper {
|
|
235
|
+
padding: 1px;
|
|
236
|
+
text-align: left;
|
|
237
|
+
border-radius: 12px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.mapbox-gl-scope .mapboxgl-popup-content {
|
|
241
|
+
margin: 13px 24px 13px 20px;
|
|
242
|
+
line-height: 1.3;
|
|
243
|
+
font-size: 13px;
|
|
244
|
+
min-height: 1px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.mapbox-gl-scope .mapboxgl-popup-content p {
|
|
248
|
+
margin: 17px 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.mapbox-gl-scope .mapboxgl-popup-tip-container {
|
|
252
|
+
width: 40px;
|
|
253
|
+
height: 20px;
|
|
254
|
+
position: absolute;
|
|
255
|
+
left: 50%;
|
|
256
|
+
margin-top: -1px;
|
|
257
|
+
margin-left: -20px;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
pointer-events: none;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.mapbox-gl-scope .mapboxgl-popup-tip {
|
|
263
|
+
width: 17px;
|
|
264
|
+
height: 17px;
|
|
265
|
+
padding: 1px;
|
|
266
|
+
margin: -10px auto 0;
|
|
267
|
+
pointer-events: auto;
|
|
268
|
+
-webkit-transform: rotate(45deg);
|
|
269
|
+
-moz-transform: rotate(45deg);
|
|
270
|
+
-ms-transform: rotate(45deg);
|
|
271
|
+
transform: rotate(45deg);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.mapbox-gl-scope .mapboxgl-popup-content-wrapper,
|
|
275
|
+
.mapbox-gl-scope .mapboxgl-popup-tip {
|
|
276
|
+
background: white;
|
|
277
|
+
color: #333;
|
|
278
|
+
box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.mapbox-gl-scope .mapboxgl-popup-close-button {
|
|
282
|
+
position: absolute;
|
|
283
|
+
top: 0;
|
|
284
|
+
right: 0;
|
|
285
|
+
border: none;
|
|
286
|
+
text-align: center;
|
|
287
|
+
width: 24px;
|
|
288
|
+
height: 24px;
|
|
289
|
+
font: 16px/24px Tahoma, Verdana, sans-serif;
|
|
290
|
+
color: #757575;
|
|
291
|
+
text-decoration: none;
|
|
292
|
+
background: transparent;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.mapbox-gl-scope .mapboxgl-popup-close-button:hover,
|
|
296
|
+
.mapbox-gl-scope .mapboxgl-popup-close-button:focus {
|
|
297
|
+
color: #585858;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Attribution */
|
|
301
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution {
|
|
302
|
+
background: #fff;
|
|
303
|
+
background: rgba(255, 255, 255, 0.8);
|
|
304
|
+
margin: 0;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution,
|
|
308
|
+
.mapbox-gl-scope .mapboxgl-ctrl-scale-line {
|
|
309
|
+
padding: 0 5px;
|
|
310
|
+
color: #333;
|
|
311
|
+
line-height: 1.4;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution a {
|
|
315
|
+
text-decoration: none;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution a:hover,
|
|
319
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution a:focus {
|
|
320
|
+
text-decoration: underline;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* Hide attribution by default */
|
|
324
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution {
|
|
325
|
+
display: none !important;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.mapbox-gl-scope .mapboxgl-ctrl-logo {
|
|
329
|
+
display: none !important;
|
|
330
|
+
}
|
package/package.json
CHANGED
|
@@ -25,10 +25,13 @@ const TablePageWithTabs = ({
|
|
|
25
25
|
isMobile,
|
|
26
26
|
view,
|
|
27
27
|
getActiveTab = () => {},
|
|
28
|
-
onDownload
|
|
28
|
+
onDownload,
|
|
29
29
|
downloadDisabled = false,
|
|
30
30
|
drawerTitle = "",
|
|
31
31
|
onCreateModalClose = () => {},
|
|
32
|
+
tabs = [],
|
|
33
|
+
headerTooltip,
|
|
34
|
+
drawerTooltip,
|
|
32
35
|
children
|
|
33
36
|
}) => {
|
|
34
37
|
const params = new URLSearchParams(location?.search);
|
|
@@ -57,11 +60,12 @@ const TablePageWithTabs = ({
|
|
|
57
60
|
icon: "Add",
|
|
58
61
|
},
|
|
59
62
|
]}
|
|
60
|
-
onDownload={onDownload}
|
|
63
|
+
onDownload={(onDownload && typeof onDownload === 'function') ? onDownload : undefined}
|
|
61
64
|
downloadDisabled={downloadDisabled}
|
|
65
|
+
tooltip={headerTooltip}
|
|
62
66
|
/>
|
|
63
67
|
<Tabs
|
|
64
|
-
items={[
|
|
68
|
+
items={tabs.length > 0 ? tabs : [
|
|
65
69
|
{ label: t("All Data"), key: "all" },
|
|
66
70
|
{ label: t("Own Data"), key: "own" },
|
|
67
71
|
{ label: t("Partners"), key: "shared" },
|
|
@@ -109,13 +113,14 @@ const TablePageWithTabs = ({
|
|
|
109
113
|
title={t(drawerTitle)}
|
|
110
114
|
/>
|
|
111
115
|
}
|
|
116
|
+
tooltip={drawerTooltip}
|
|
112
117
|
open={openCreateModal}
|
|
113
118
|
onClose={() => setOpenCreateModal(false)}
|
|
114
119
|
width={CREATE_DRAWER_WIDTH}
|
|
115
120
|
bodyStyle={{ padding: 0 }}
|
|
116
121
|
>
|
|
117
122
|
{typeof children === 'function'
|
|
118
|
-
? children({ onDrawerClose: () => setOpenCreateModal(false) })
|
|
123
|
+
? children({ onDrawerClose: () => setOpenCreateModal(false), open: openCreateModal })
|
|
119
124
|
: children
|
|
120
125
|
}
|
|
121
126
|
</Drawer>
|
|
@@ -86,10 +86,10 @@ export default function DAFTable({
|
|
|
86
86
|
}, [sourcesKey, sources, filtersConfig, t]);
|
|
87
87
|
|
|
88
88
|
useEffect(() => {
|
|
89
|
-
if (data) {
|
|
89
|
+
if (data && Array.isArray(data)) {
|
|
90
90
|
setSource(data);
|
|
91
91
|
}
|
|
92
|
-
}, [data]);
|
|
92
|
+
}, [data, data.length]);
|
|
93
93
|
|
|
94
94
|
const paginationPageSize = pagination?.pageSize;
|
|
95
95
|
const dataSource = useMemo(() => {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import CustomIcon from '../../Icon/CustomIcon.jsx'
|
|
3
|
+
|
|
4
|
+
function KeyIndicatorNavigateLabel({
|
|
5
|
+
t,
|
|
6
|
+
getRedirectLink,
|
|
7
|
+
theme,
|
|
8
|
+
label,
|
|
9
|
+
link
|
|
10
|
+
}) {
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex">
|
|
13
|
+
<div className="flex-1">{t(label)}</div>
|
|
14
|
+
<div
|
|
15
|
+
className="cursor-pointer"
|
|
16
|
+
onClick={() => window.open(getRedirectLink(link), '_blank')}
|
|
17
|
+
>
|
|
18
|
+
<CustomIcon
|
|
19
|
+
name="LinkNewTab"
|
|
20
|
+
width={16}
|
|
21
|
+
height={16}
|
|
22
|
+
color={theme.colorPrimary}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default KeyIndicatorNavigateLabel
|
|
@@ -232,7 +232,7 @@ export const useFilters = ({
|
|
|
232
232
|
}, [pagination]);
|
|
233
233
|
|
|
234
234
|
const canGoPrev = useMemo(() => pagination.current !== 1, [pagination]);
|
|
235
|
-
const canGoNext = useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
235
|
+
const canGoNext = useMemo(() => pagination.current !== totalPages && totalPages > 0, [pagination, totalPages]);
|
|
236
236
|
|
|
237
237
|
const goPrev = () => {
|
|
238
238
|
if (!canGoPrev) {
|
|
@@ -28,10 +28,12 @@ export default function MobileDrawer({
|
|
|
28
28
|
isDev = false,
|
|
29
29
|
selectedProject,
|
|
30
30
|
theme = {},
|
|
31
|
+
dropdownItems = [],
|
|
31
32
|
}) {
|
|
32
33
|
const items = useMemo(() => sidenavConfig[mod] || [], [sidenavConfig, mod]);
|
|
34
|
+
const appsWithPartners = ['tazama', 'nashiriki', 'wazi', 'hatua'];
|
|
33
35
|
|
|
34
|
-
const canViewPartners = useMemo(() => mod
|
|
36
|
+
const canViewPartners = useMemo(() => appsWithPartners.includes(mod), [mod]);
|
|
35
37
|
const canViewProjects = checkPermission({
|
|
36
38
|
permission: 'projects.canView',
|
|
37
39
|
permissions: user?.role?.permissions
|
|
@@ -93,7 +95,7 @@ export default function MobileDrawer({
|
|
|
93
95
|
{
|
|
94
96
|
type: 'link',
|
|
95
97
|
name: t('Partners'),
|
|
96
|
-
path: `/app
|
|
98
|
+
path: `/app/partners`,
|
|
97
99
|
isDashboard: true,
|
|
98
100
|
visible: canViewPartners
|
|
99
101
|
},
|
|
@@ -6,6 +6,7 @@ import { formatClassname } from '../../../../../helpers/ClassesHelper.js';
|
|
|
6
6
|
import { useResizeContext } from '../../../../core/context/Resize/index.js';
|
|
7
7
|
import { MOBILE_W } from '../../../../../constants/Style.js';
|
|
8
8
|
import MobileDrawer from '../MobileDrawer/index.js';
|
|
9
|
+
import { userIsAdmin } from '../../../../../helpers/user.js';
|
|
9
10
|
|
|
10
11
|
export const UserDropdownMenu = ({
|
|
11
12
|
user,
|
|
@@ -24,11 +25,11 @@ export const UserDropdownMenu = ({
|
|
|
24
25
|
isDev = false,
|
|
25
26
|
theme = {},
|
|
26
27
|
moduleInterfaceConfig = null,
|
|
28
|
+
dropdownItems = [],
|
|
27
29
|
}) => {
|
|
28
30
|
const resizeContext = useResizeContext();
|
|
29
31
|
const { windowWidth } = resizeContext || {};
|
|
30
|
-
const
|
|
31
|
-
const isAdmin = useMemo(() => userIsAdmin?.(user), [user, userIsAdmin]);
|
|
32
|
+
const isAdmin = useMemo(() => userIsAdmin(user), [user]);
|
|
32
33
|
|
|
33
34
|
// Add fallback for windowWidth
|
|
34
35
|
const actualWidth = windowWidth || (typeof window !== 'undefined' ? window.innerWidth : 1920);
|
|
@@ -87,6 +88,7 @@ export const UserDropdownMenu = ({
|
|
|
87
88
|
appName={appName}
|
|
88
89
|
theme={theme}
|
|
89
90
|
moduleInterfaceConfig={moduleInterfaceConfig}
|
|
91
|
+
dropdownItems={dropdownItems}
|
|
90
92
|
/>
|
|
91
93
|
</div>
|
|
92
94
|
) : (
|
|
@@ -104,6 +106,25 @@ export const UserDropdownMenu = ({
|
|
|
104
106
|
<p>{user?.firstName || ''} {user?.lastName || ''}</p>
|
|
105
107
|
</div>
|
|
106
108
|
<div className='list'>
|
|
109
|
+
{dropdownItems && dropdownItems
|
|
110
|
+
.filter((item) => {
|
|
111
|
+
if (typeof item.condition === 'function') {
|
|
112
|
+
return item.condition({ user, isAdmin, module, checkPermission, appName });
|
|
113
|
+
}
|
|
114
|
+
if ('condition' in item) {
|
|
115
|
+
return !!item.condition;
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
})
|
|
119
|
+
.map((item) => (
|
|
120
|
+
<div
|
|
121
|
+
key={item.key}
|
|
122
|
+
className='list-item'
|
|
123
|
+
onClick={() => handlegoTo(getRedirectLink(item.path))}
|
|
124
|
+
>
|
|
125
|
+
{item.name}
|
|
126
|
+
</div>
|
|
127
|
+
))}
|
|
107
128
|
{user.company && !isDemoEnv && canViewUsers && !isAdmin ? (
|
|
108
129
|
<div
|
|
109
130
|
className='list-item'
|
|
@@ -66,6 +66,7 @@ function AppLayout({
|
|
|
66
66
|
updateLanguage,
|
|
67
67
|
getUserOptions,
|
|
68
68
|
selectedProject,
|
|
69
|
+
dropdownItems = [],
|
|
69
70
|
|
|
70
71
|
// Navigation (injected from app)
|
|
71
72
|
goTo = () => {},
|
|
@@ -414,6 +415,7 @@ function AppLayout({
|
|
|
414
415
|
isDev={isDev}
|
|
415
416
|
theme={theme}
|
|
416
417
|
moduleInterfaceConfig={moduleInterfaceConfig}
|
|
418
|
+
dropdownItems={dropdownItems}
|
|
417
419
|
/>
|
|
418
420
|
</div>
|
|
419
421
|
</div>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
]
|
|
1
|
+
export const getConfig = (theme) => {
|
|
2
|
+
return [
|
|
3
|
+
{ key: "male", label: "Male", color: theme.colorPrimary7 },
|
|
4
|
+
{ key: "female", label: "Female", color: theme.colorPrimary4 },
|
|
5
|
+
{ key: "other", label: "Other", color: theme.colorPrimary3 },
|
|
6
|
+
]
|
|
7
|
+
}
|
|
7
8
|
|
|
8
9
|
export const getRoleColors = (theme) => {
|
|
9
10
|
return [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useCallback } from 'react'
|
|
2
|
-
import { getRoleColors,
|
|
2
|
+
import { getRoleColors, getConfig } from './config';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { renderTooltipJsx } from '../../../../../../../utils/tooltip.js';
|
|
5
5
|
import Widget from '../../../../../../../core/components/Dashboard/Widget/index.jsx';
|
|
@@ -15,6 +15,7 @@ function GenderDistribution({
|
|
|
15
15
|
options = {},
|
|
16
16
|
}) {
|
|
17
17
|
const roleColors = getRoleColors(theme);
|
|
18
|
+
const config = getConfig(theme);
|
|
18
19
|
|
|
19
20
|
const pieData = useMemo(() => {
|
|
20
21
|
const total = Object.values(data).reduce((all, val) => all + (val || 0), 0);
|