datastake-daf 0.6.795 → 0.6.797

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 (45) hide show
  1. package/dist/components/index.js +258 -89
  2. package/dist/pages/index.js +789 -174
  3. package/dist/style/datastake/mapbox-gl.css +330 -0
  4. package/dist/utils/index.js +1 -1
  5. package/package.json +1 -1
  6. package/public/Vegetation/black-default.svg +23 -0
  7. package/public/Vegetation/black.svg +12 -0
  8. package/public/Vegetation/damage-from-insects-default.svg +14 -0
  9. package/public/Vegetation/damage-from-insects.svg +8 -0
  10. package/public/Vegetation/dry-or-dead-default.svg +16 -0
  11. package/public/Vegetation/dry-or-dead.svg +7 -0
  12. package/public/Vegetation/healthy-default.svg +14 -0
  13. package/public/Vegetation/healthy.svg +34 -0
  14. package/public/Vegetation/mosaic-default.svg +17 -0
  15. package/public/Vegetation/mosaic.svg +9 -0
  16. package/public/Vegetation/no-leaves-default.svg +6 -0
  17. package/public/Vegetation/no-leaves.svg +5 -0
  18. package/public/Vegetation/reddish-default.svg +23 -0
  19. package/public/Vegetation/reddish.svg +79 -0
  20. package/public/Vegetation/spider-webs-default.svg +10 -0
  21. package/public/Vegetation/spider-webs.svg +10 -0
  22. package/public/Vegetation/white-default.svg +25 -0
  23. package/public/Vegetation/white.svg +12 -0
  24. package/public/Vegetation/yellowing-default.svg +7 -0
  25. package/public/Vegetation/yellowing.svg +8 -0
  26. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/index.jsx +24 -6
  27. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/style.js +2 -6
  28. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/VegetationWidget.stories.jsx +76 -0
  29. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/config.js +31 -0
  30. package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/index.jsx +137 -0
  31. package/src/@daf/core/components/ViewForm/components/Records/config.js +3 -0
  32. package/src/@daf/pages/Summary/Activities/Monitoring/components/ActivityImagery/index.jsx +12 -10
  33. package/src/@daf/pages/Summary/Activities/Monitoring/components/BiodiversityAndHabitat/helper.js +86 -0
  34. package/src/@daf/pages/Summary/Activities/Monitoring/components/BiodiversityAndHabitat/index.jsx +65 -0
  35. package/src/@daf/pages/Summary/Activities/Monitoring/components/EnvironmentalMetrics/index.jsx +30 -0
  36. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/PlantedSpecies/index.jsx +15 -28
  37. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/SeedlingsHeight/index.jsx +17 -30
  38. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/components/SurvivalRate/index.jsx +38 -45
  39. package/src/@daf/pages/Summary/Activities/Monitoring/components/MangroveGrowthAndSurvival/index.jsx +87 -8
  40. package/src/@daf/pages/Summary/Activities/Monitoring/config.js +21 -4
  41. package/src/@daf/pages/Summary/Activities/Monitoring/helper.js +7 -1
  42. package/src/@daf/pages/Summary/Activities/Monitoring/index.jsx +31 -8
  43. package/src/@daf/utils/numbers.js +1 -1
  44. package/src/constants/Vegetation.js +15 -0
  45. package/src/index.js +1 -0
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
- import { camelCaseToTitle } from "../../../../../utils";
3
-
4
-
2
+ import { camelCaseToTitle, findOptions, renderNumber } from "../../../../../utils";
5
3
 
6
4
  export const getKeyIndicatorsRowConfig = ({ t, data = {} }) => [
7
5
 
@@ -22,7 +20,7 @@ export const getKeyIndicatorsRowConfig = ({ t, data = {} }) => [
22
20
  },
23
21
  {
24
22
  label: t('Monitored Area'),
25
- render: () => <div>{data?.totalAreaParcelMonitored ? `${data?.totalAreaParcelMonitored} ha` : '0 ha'}</div>
23
+ render: () => <div>{data?.totalAreaParcelMonitored ? `${renderNumber(data?.totalAreaParcelMonitored)} ha` : '0 ha'}</div>
26
24
  },
27
25
 
28
26
  ];
@@ -49,3 +47,22 @@ export const getSiteConditionsConfig = ({ t, data = {} }) => [
49
47
  render: () => <div>{data?.hasDisturbances ? t('Yes') : t('No')}</div>
50
48
  },
51
49
  ];
50
+
51
+ export const getEnvironmentalMetricsConfig = ({ t, data = {}, options }) => [
52
+ {
53
+ label: t('Soil Type'),
54
+ render: () => <div>{camelCaseToTitle(data?.soilType) || '-'}</div>
55
+ },
56
+ {
57
+ label: t('Soil Salinity'),
58
+ render: () => <div>{data?.soilSalinity ? `${ renderNumber(data.soilSalinity)} ${data?.soilSalinityUnit || 'dS/m'}` : '-'}</div>
59
+ },
60
+ {
61
+ label: t('pH Level'),
62
+ render: () => <div>{renderNumber(data?.phLevel) || '-'}</div>
63
+ },
64
+ {
65
+ label: t('Water Quality'),
66
+ render: () => <div>{ findOptions(data?.waterQuality, options?.waterQuality) || '-'}</div>
67
+ },
68
+ ];
@@ -17,7 +17,13 @@ export const getActivityImages = (activityData) => {
17
17
  { data: activityData?.groupPhotos, label: 'Group Photo' },
18
18
  { data: activityData?.photosStartActivity, label: 'Start of Activity' },
19
19
  { data: activityData?.photosDuringActivity, label: 'During Activity' },
20
- { data: activityData?.photosEndActivity, label: 'End of Activity' }
20
+ { data: activityData?.photosEndActivity, label: 'End of Activity' },
21
+ { data: activityData?.plotPhotosMonitoring, label: 'Plot Photos Monitoring' },
22
+ { data: activityData?.faunaFloraPictures, label: 'Fauna and Flora Photos' },
23
+ { data: activityData?.pestPlantPhotos, label: 'Pest Plant Photos' },
24
+ { data: activityData?.soilPhotos, label: 'Soil Photos' },
25
+ { data: activityData?.otherPictures, label: 'Other Pictures' },
26
+ { data: activityData?.damagedPlantPhotos, label: 'Damaged Plant Photos' }
21
27
  ];
22
28
 
23
29
  return photoArrays
@@ -4,11 +4,13 @@ import { getKeyIndicatorsRowConfig, getSiteConditionsConfig } from './config';
4
4
  import { getActivityIndicatorsConfig } from './helper';
5
5
  import ActivityLocation from './components/ActivityLocation/index.jsx';
6
6
  import ActivityImagery from './components/ActivityImagery/index.jsx';
7
+ import EnvironmentalMetrics from './components/EnvironmentalMetrics/index.jsx';
7
8
  import WorkersDistribution from './components/WorkersDistribution/index.jsx';
8
9
  import MangroveGrowthAndSurvival from './components/MangroveGrowthAndSurvival/index.jsx';
10
+ import BiodiversityAndHabitat from './components/BiodiversityAndHabitat/index.jsx';
9
11
 
10
12
 
11
- const MonitoringActivitySummary = ({ activityData, supportText, onDownload, downloadDisabled, actionButtons, breadcrumbs, goBackTo, loading, t = () => { } }) => {
13
+ const MonitoringActivitySummary = ({ activityData, supportText, onDownload, downloadDisabled, actionButtons, breadcrumbs, goBackTo, loading, t = () => { }, options }) => {
12
14
  const keyIndicatorsConfig = useMemo(() => getKeyIndicatorsRowConfig({ t, data: activityData }), [t, activityData]);
13
15
 
14
16
  // Activity Indicators Config - mapped from activityData
@@ -18,13 +20,11 @@ const MonitoringActivitySummary = ({ activityData, supportText, onDownload, do
18
20
  );
19
21
 
20
22
  // Site Conditions Config
21
- const siteConditionsConfig = useMemo(() =>
23
+ const siteConditionsConfig = useMemo(() =>
22
24
  getSiteConditionsConfig({ t, data: activityData }),
23
25
  [t, activityData]
24
26
  );
25
27
 
26
-
27
- console.log({activityData});
28
28
  return (
29
29
  <DashboardLayout
30
30
  header={
@@ -53,12 +53,35 @@ const MonitoringActivitySummary = ({ activityData, supportText, onDownload, do
53
53
  widgetClassName="h-w-btn-header"
54
54
  />
55
55
 
56
- <MangroveGrowthAndSurvival
57
- activityData={activityData}
58
- loading={loading}
59
- t={t}
56
+ <MangroveGrowthAndSurvival
57
+ options={options}
58
+ activityData={activityData}
59
+ loading={loading}
60
+ t={t}
61
+ />
62
+
63
+ <BiodiversityAndHabitat
64
+ faunaPresent={activityData?.faunaPresent}
65
+ invasiveSpecies={activityData?.invasiveSpecies}
66
+ hasInvasiveSpecies={activityData?.hasInvasiveSpecies}
67
+ loading={loading}
68
+ t={t}
60
69
  />
61
70
 
71
+ <section style={{ display: 'flex', gap: '24px', }}>
72
+ <EnvironmentalMetrics
73
+ options={options}
74
+ activityData={activityData}
75
+ loading={loading}
76
+ t={t}
77
+ />
78
+ <ActivityImagery
79
+ activityData={activityData}
80
+ loading={loading}
81
+ t={t}
82
+ />
83
+ </section>
84
+
62
85
  </DashboardLayout>
63
86
  )
64
87
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export const renderNumber = (val, doubleDigit = false) => {
8
8
  if (typeof val !== 'number') {
9
- return '--';
9
+ return '-';
10
10
  }
11
11
 
12
12
  const _string = Number(val).toLocaleString('en-us');
@@ -0,0 +1,15 @@
1
+ const VEGETATION_KEYS = {
2
+ HEALTHY: "healthy",
3
+ WHITE_SPOTS: "white",
4
+ BLACK_SPOTS: "black",
5
+ REDDISH_SPOTS: "reddish",
6
+ YELLOWING: "yellowing",
7
+ MOSAIC: "mosaic",
8
+ DRY_OR_DEAD: "dryOrDead",
9
+ NO_LEAVES: "noLeaves",
10
+ SPIDER_WEBS: "spiderWebs",
11
+ DAMAGE_FROM_INSECTS: "damageFromInsects",
12
+ };
13
+
14
+ export { VEGETATION_KEYS };
15
+
package/src/index.js CHANGED
@@ -78,6 +78,7 @@ export { default as WidgetCard } from "./@daf/core/components/Dashboard/Widget/W
78
78
  export { default as CarouselWidget } from "./@daf/core/components/Dashboard/Widget/CarouselWidget/index.jsx";
79
79
  export { default as ImageCarousel } from "./@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx";
80
80
  export { default as StatCard } from "./@daf/core/components/Dashboard/Widget/StatCard/index.js";
81
+ export { default as VegetationHealth } from "./@daf/core/components/Dashboard/Widget/VegetationWidget/index.jsx";
81
82
  // export { default as WidgetCatalogue } from "./@daf/core/components/Dashboard/Widget/WidgetCatalogue/index.jsx";
82
83
 
83
84
  // Forms