datastake-daf 0.6.787 → 0.6.788

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 (62) 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 +579 -722
  7. package/dist/pages/index.js +774 -33
  8. package/dist/services/index.js +1 -10
  9. package/dist/style/datastake/mapbox-gl.css +330 -0
  10. package/dist/utils/index.js +12 -28
  11. package/package.json +1 -1
  12. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/ActivityIndicators.stories.js +24 -0
  13. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/index.jsx +1 -0
  14. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/style.js +34 -0
  15. package/src/@daf/core/components/Dashboard/Widget/KeyIndicators/KeyIndicators.stories.js +39 -0
  16. package/src/@daf/core/components/Dashboard/Widget/KeyIndicators/LabelWithIcon.jsx +38 -0
  17. package/src/@daf/core/components/Dashboard/Widget/KeyIndicators/index.jsx +16 -3
  18. package/src/@daf/core/components/Dashboard/Widget/KeyIndicators/style.js +33 -0
  19. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +1 -0
  20. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
  21. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
  22. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
  23. package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +1 -0
  24. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +1 -1
  25. package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
  26. package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
  27. package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +5 -5
  28. package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
  29. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +5 -23
  30. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +36 -36
  31. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +21 -12
  32. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +8 -13
  33. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
  34. package/src/@daf/core/components/Screens/Admin/adminRoutes.js +2 -2
  35. package/src/@daf/pages/Summary/Activities/Monitoring/components/ActivityImagery/index.jsx +29 -0
  36. package/src/@daf/pages/Summary/Activities/Monitoring/components/ActivityLocation/index.jsx +94 -0
  37. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/PlantedSpecies/index.jsx +56 -0
  38. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/SeedlingsHeight/index.jsx +121 -0
  39. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/SurvivalRate/index.jsx +94 -0
  40. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/index.jsx +54 -0
  41. package/src/@daf/pages/Summary/Activities/Monitoring/components/WorkersDistribution/index.jsx +49 -0
  42. package/src/@daf/pages/Summary/Activities/Monitoring/config.js +51 -0
  43. package/src/@daf/pages/Summary/Activities/Monitoring/helper.js +236 -0
  44. package/src/@daf/pages/Summary/Activities/Monitoring/index.jsx +66 -0
  45. package/src/@daf/services/AdminService.js +3 -12
  46. package/src/@daf/services/DashboardService.js +1 -2
  47. package/src/@daf/utils/filters.js +89 -89
  48. package/src/constants/locales/en/translation.js +0 -3
  49. package/src/constants/locales/fr/translation.js +1 -1
  50. package/src/constants/locales/sp/translation.js +1 -1
  51. package/src/pages.js +1 -0
  52. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +0 -224
  53. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +0 -65
  54. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +0 -180
  55. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
  56. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +0 -27
  57. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +0 -157
  58. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +0 -31
  59. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +0 -77
  60. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +0 -117
  61. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +0 -54
  62. package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
@@ -765,7 +765,7 @@ class AdminService extends BaseService {
765
765
  params
766
766
  }) {
767
767
  return this.apiGet({
768
- url: `/management/subjects/${subject}`,
768
+ url: `${subject}`,
769
769
  params
770
770
  });
771
771
  }
@@ -778,15 +778,6 @@ class AdminService extends BaseService {
778
778
  data
779
779
  });
780
780
  }
781
- getUserGrowth(activeFilter) {
782
- return this.apiGet({
783
- url: `/accounts/dashboard/user-growth`,
784
- isUserManager: true,
785
- params: {
786
- activeFilter
787
- }
788
- });
789
- }
790
781
  }
791
782
  var AdminService$1 = createLazyService(AdminService);
792
783
 
@@ -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
+ }
@@ -7506,6 +7506,7 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
7506
7506
  });
7507
7507
  return o;
7508
7508
  };
7509
+ const NEW_PAGINATION_APPS = ["nashiriki"];
7509
7510
  const filterParams = (value, module) => {
7510
7511
  const {
7511
7512
  activeFilters,
@@ -7521,12 +7522,10 @@ const filterParams = (value, module) => {
7521
7522
  ...filters
7522
7523
  } = activeFilters || {};
7523
7524
  const params = {};
7524
- // Use skip and take inside pagination object
7525
- // Calculate skip from page number (page 1 = skip 1, page 2 = skip 21, etc.)
7526
- params.pagination = {
7527
- skip: page ? (page - 1) * (pageSize || 20) + 1 : 1,
7528
- take: pageSize || 20
7529
- };
7525
+ params.pagination = JSON.stringify({
7526
+ [NEW_PAGINATION_APPS.includes(module) ? "skip" : "page"]: page,
7527
+ [NEW_PAGINATION_APPS.includes(module) ? "take" : "pageSize"]: pageSize
7528
+ });
7530
7529
  if (search && searchParams) {
7531
7530
  params.search = JSON.stringify({
7532
7531
  qs: search,
@@ -7541,24 +7540,12 @@ const filterParams = (value, module) => {
7541
7540
  }
7542
7541
  if (Object.keys(filters).length) {
7543
7542
  if (value.sourceId && value.sourceId === "overview") {
7544
- const {
7545
- activeTab,
7546
- ...restFilters
7547
- } = filters;
7548
- Object.assign(params, restFilters);
7549
- if (activeTab !== undefined) {
7550
- params.tab = activeTab;
7551
- }
7543
+ params.filters = JSON.stringify(filters);
7552
7544
  } else {
7553
- const {
7554
- authorId,
7555
- activeTab,
7556
- ...restFilters
7557
- } = filters;
7558
- Object.assign(params, restFilters);
7559
- if (activeTab !== undefined) {
7560
- params.tab = activeTab;
7561
- }
7545
+ params.filters = JSON.stringify({
7546
+ ...filters,
7547
+ authorId: undefined
7548
+ });
7562
7549
  }
7563
7550
  }
7564
7551
  return {
@@ -7765,9 +7752,6 @@ function getRedirectPath(user, fallback = '', app, isDatastake) {
7765
7752
  }
7766
7753
 
7767
7754
  const en = {
7768
- "sbg-admin::remove-user-title": "Remove User Title",
7769
- "sbg-admin::remove-user-body": "Remove User Body",
7770
- "add-account": "Add Account",
7771
7755
  "Site": "Site",
7772
7756
  "Production Sites": "Production Sites",
7773
7757
  "Type of account": "Type of account",
@@ -9467,7 +9451,7 @@ const fr = {
9467
9451
  Documentation: "Documents",
9468
9452
  "Edit project": "Modifier le projet",
9469
9453
  Name: "Nom",
9470
- Type: "Type",
9454
+ Type: "Tapez",
9471
9455
  type: "Type",
9472
9456
  Province: "Province",
9473
9457
  Territory: "Territoire",
@@ -11278,7 +11262,7 @@ const sp = {
11278
11262
  "Documentation": "Documentos",
11279
11263
  "Edit project": "Modificar proyecto",
11280
11264
  "Name": "Nombre",
11281
- "Type": "Tipo",
11265
+ "Type": "Escribe",
11282
11266
  "type": "Tipo",
11283
11267
  "Province": "Provincia",
11284
11268
  "Territory": "Territorio",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.787",
3
+ "version": "0.6.788",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -250,3 +250,27 @@ export const NoMinWidth = {
250
250
  );
251
251
  },
252
252
  };
253
+
254
+ export const SingleColumn = {
255
+ name: "Single Column Layout",
256
+ args: {
257
+ className: "single-column",
258
+ },
259
+ render: (args) => {
260
+ const config = [
261
+ { icon: "Package", label: "Aid kit availability", type: "compliant" },
262
+ { icon: "SchoolHat", label: "H&S training delivery", type: "compliant" },
263
+ { icon: "UsersCheck", label: "Workers safe pairing", type: "notCompliant" },
264
+ { icon: "User", label: "Children presence", type: "compliant" },
265
+ { icon: "Lock", label: "Security presence", type: "empty" },
266
+ { icon: "Refresh05", label: "Relay presence", type: "compliant" },
267
+ ];
268
+
269
+ return (
270
+ <ActivityIndicators
271
+ {...args}
272
+ config={config}
273
+ />
274
+ );
275
+ },
276
+ };
@@ -27,6 +27,7 @@ import styled from "styled-components";
27
27
  * @param {ReactNode} children - Additional content to render
28
28
  * @param {boolean} noTitle - Hide the widget title
29
29
  * @param {string} filterMode - Filter indicators by type: "all" | "compliant" | "notCompliant" | "empty"
30
+ * @param {string} className - Additional CSS classes. Use "single-column" to force single-column layout
30
31
  */
31
32
  export default function ActivityIndicatorsWidget({
32
33
  t = (s) => s,
@@ -99,6 +99,40 @@ const Style = styled.div`
99
99
  }
100
100
  }
101
101
  }
102
+
103
+ &.single-column {
104
+ grid-template-columns: 1fr;
105
+
106
+ .indicator-item {
107
+ /* Remove the 2-column specific separators first */
108
+ &:nth-child(1),
109
+ &:nth-child(2),
110
+ &:nth-child(3),
111
+ &:nth-child(4) {
112
+ &::after {
113
+ display: none !important;
114
+ }
115
+ }
116
+
117
+ /* On single column, all items except last get separator */
118
+ &:not(:last-child) {
119
+ &::after {
120
+ content: '' !important;
121
+ position: absolute;
122
+ bottom: 0;
123
+ left: var(--size-lg);
124
+ right: var(--size-lg);
125
+ height: 1px;
126
+ background-color: var(--border-color, #E5E7EB);
127
+ display: block !important;
128
+ }
129
+ }
130
+
131
+ &:last-child::after {
132
+ display: none !important;
133
+ }
134
+ }
135
+ }
102
136
  `;
103
137
 
104
138
  export const NoMinWidth = styled.div`
@@ -120,3 +120,42 @@ export const NoMinWidth = {
120
120
  ],
121
121
  },
122
122
  };
123
+
124
+ export const SiteConditions = {
125
+ name: "SiteConditions",
126
+ args: {
127
+ title: "Site Conditions",
128
+ className: "small-content",
129
+ config: [
130
+ {
131
+ label: "Season",
132
+ icon: "Tree",
133
+ render: () => <div>Rainy</div>
134
+ },
135
+ {
136
+ label: "Weather conditions",
137
+ icon: "Globe",
138
+ render: () => <div>Cloudy</div>
139
+ },
140
+ {
141
+ label: "Tide level",
142
+ icon: "WaterDrop",
143
+ render: () => <div>Medium</div>
144
+ },
145
+ {
146
+ label: "Disturbances",
147
+ icon: "Lightning",
148
+ render: () => <div>None</div>
149
+ },
150
+ ],
151
+ },
152
+ render: (args) => {
153
+ return (
154
+ <DashboardLayout>
155
+ <section>
156
+ <KeyIndicators {...args} />
157
+ </section>
158
+ </DashboardLayout>
159
+ );
160
+ },
161
+ };
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import CustomIcon from '../../../Icon/CustomIcon.jsx';
4
+
5
+ const LabelWithIcon = ({ t, name, icon, iconColor = "#028788", iconWidth = 16, iconHeight = 16 }) => {
6
+ // name is expected to be already translated (string) or a translation key
7
+ // If it's a string that looks like a translation key (contains '::'), translate it
8
+ // Otherwise, use it as-is (already translated)
9
+ const displayText = (typeof name === 'string' && name.includes('::') && t && typeof t === 'function')
10
+ ? t(name)
11
+ : name;
12
+
13
+ return (
14
+ <div className="flex items-center" style={{ gap: 8 }}>
15
+ {icon && <CustomIcon name={icon} color={iconColor} width={iconWidth} height={iconHeight} />}
16
+ <span style={{
17
+ fontSize: '14px',
18
+ fontWeight: 500,
19
+ lineHeight: '26px',
20
+ letterSpacing: '0%',
21
+ color: 'var(--base-gray-70)',
22
+ fontFamily: 'SF UI Display, -apple-system, BlinkMacSystemFont, sans-serif'
23
+ }}>{displayText}</span>
24
+ </div>
25
+ );
26
+ };
27
+
28
+ LabelWithIcon.propTypes = {
29
+ t: PropTypes.func,
30
+ name: PropTypes.string.isRequired,
31
+ icon: PropTypes.string,
32
+ iconColor: PropTypes.string,
33
+ iconWidth: PropTypes.number,
34
+ iconHeight: PropTypes.number,
35
+ };
36
+
37
+ export default LabelWithIcon;
38
+
@@ -2,6 +2,7 @@ import Style, { NoMinWidth } from "./style";
2
2
  import Widget from "../index.jsx";
3
3
  import { formatClassname } from "../../../../../../helpers/ClassesHelper";
4
4
  import { Tooltip } from "antd";
5
+ import LabelWithIcon from "./LabelWithIcon.jsx";
5
6
 
6
7
  export default function KeyIndicatorsWidget({
7
8
  t = (s) => s,
@@ -25,8 +26,8 @@ export default function KeyIndicatorsWidget({
25
26
  {children}
26
27
  <Style className={formatClassname(["flex", className])}>
27
28
  {config.map((c, i) => (
28
- <div className="row-item" key={`key-indicators-${i}`}>
29
- <Label label={c.label} withTooltip={withTooltip} />
29
+ <div className={`row-item ${c.icon ? 'row-item-with-icon' : ''}`} key={`key-indicators-${i}`}>
30
+ <Label label={c.label} icon={c.icon} withTooltip={withTooltip} t={t} />
30
31
  <div className="flex">{c.render()}</div>
31
32
  </div>
32
33
  ))}
@@ -40,7 +41,19 @@ export default function KeyIndicatorsWidget({
40
41
  return component;
41
42
  }
42
43
 
43
- function Label({ label, withTooltip }) {
44
+ function Label({ label, icon, withTooltip, t }) {
45
+ if (icon) {
46
+ const labelContent = <LabelWithIcon t={t} name={label} icon={icon} />;
47
+ if (withTooltip) {
48
+ return (
49
+ <Tooltip title={label} placement="topLeft">
50
+ <h4>{labelContent}</h4>
51
+ </Tooltip>
52
+ );
53
+ }
54
+ return <h4>{labelContent}</h4>;
55
+ }
56
+
44
57
  if (withTooltip) {
45
58
  return (
46
59
  <Tooltip title={label} placement="topLeft">
@@ -59,12 +59,45 @@ const Style = styled.div`
59
59
  margin-top: 14px;
60
60
  }
61
61
  }
62
+
63
+ &.row-item-with-icon {
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: space-between;
67
+ gap: 8px;
68
+
69
+ h4 {
70
+ margin-bottom: 0;
71
+ flex: 0 0 auto;
72
+ }
73
+
74
+ .flex {
75
+ flex: 0 0 auto;
76
+ display: flex;
77
+ align-items: center;
78
+ font-size: 16px;
79
+ font-weight: 500;
80
+ line-height: 38px;
81
+ letter-spacing: 0;
82
+ color: var(--base-gray-90);
83
+ font-family: 'SF UI Display', -apple-system, BlinkMacSystemFont, sans-serif;
84
+ }
85
+ }
62
86
  }
63
87
 
64
88
  &.small-content {
65
89
  span {
66
90
  font-size: 16px;
67
91
  }
92
+
93
+ .row-item-with-icon {
94
+ .flex {
95
+ font-size: 16px;
96
+ line-height: 38px;
97
+ font-weight: 500;
98
+ color: var(--base-gray-90);
99
+ }
100
+ }
68
101
  }
69
102
 
70
103
  .ant-tag {
@@ -10,6 +10,7 @@ const { useToken } = theme;
10
10
  export default function useTopContributors({ container, data = [], t }) {
11
11
  const [mainGraph, setMainGraph] = useState(null);
12
12
  const { token } = useToken();
13
+
13
14
  useEffect(() => {
14
15
  if (container.current) {
15
16
  if (mainGraph) {