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
@@ -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
  }
@@ -90,7 +90,7 @@ export const mapItem = (data, options, goTo, getRedirectLink, operatorData = {},
90
90
  );
91
91
  }
92
92
  return goTo(
93
- getRedirectLink(`/app/${APP === 'nashiriki' ? 'summary/operators' : 'operator-summary'}/${data.datastakeId}`),
93
+ getRedirectLink(`/app/operator-summary/${data.datastakeId}`),
94
94
  );
95
95
  },
96
96
  }
@@ -58,7 +58,9 @@ import {
58
58
  getFiltersConfig as getFiltersConfigProductionSites,
59
59
  getFilterOptions as getFilterOptionsProductionSites,
60
60
  formConfig as formConfigProductionSites,
61
- viewConfig as viewConfigProductionSites
61
+ viewConfig as viewConfigProductionSites,
62
+ sclFormConfig as sclFormConfigProductionSites,
63
+ sclViewConfig as sclViewConfigProductionSites
62
64
  } from '../Locations/MineSite/config.js';
63
65
  import { getColumns as getColumnsProductionSites } from "../Locations/MineSite/columns.js";
64
66
 
@@ -106,6 +108,13 @@ export const FILTER_REGISTRY = {
106
108
  formConfig: formConfigActivities,
107
109
  viewConfig: viewConfigActivities,
108
110
  columns: getColumnsActivities,
111
+ },
112
+ 'corrective-actions': {
113
+ config: getFiltersConfigActivities,
114
+ options: getFilterOptionsActivities,
115
+ formConfig: formConfigActivities,
116
+ viewConfig: viewConfigActivities,
117
+ columns: getColumnsActivities,
109
118
  },
110
119
  incidents: {
111
120
  config: getFiltersConfigIncidents,
@@ -127,6 +136,13 @@ export const FILTER_REGISTRY = {
127
136
  formConfig: formConfigProductionSites,
128
137
  viewConfig: viewConfigProductionSites,
129
138
  columns: getColumnsProductionSites,
139
+ },
140
+ scl: {
141
+ config: getFiltersConfigProductionSites,
142
+ options: getFilterOptionsProductionSites,
143
+ formConfig: sclFormConfigProductionSites,
144
+ viewConfig: sclViewConfigProductionSites,
145
+ columns: getColumnsProductionSites,
130
146
  },
131
147
  documents: {
132
148
  config: getFilterConfigDocuments,
@@ -56,6 +56,7 @@ export const useTablePage = ({
56
56
  data,
57
57
  applications,
58
58
  subjectClear,
59
+ APP,
59
60
  }) => {
60
61
  const [selectOptions, setSelectOptions] = useState();
61
62
  const [activeTab, setActiveTab] = useState("own");
@@ -80,8 +81,9 @@ export const useTablePage = ({
80
81
  subject,
81
82
  data,
82
83
  applications,
84
+ APP,
83
85
  }),
84
- [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications, subject, getColumns]
86
+ [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications, subject, getColumns, APP]
85
87
  );
86
88
 
87
89
  const selectFiltersConfig = useMemo(() =>
@@ -29,6 +29,7 @@ const TablePage = ({
29
29
  formValue: {},
30
30
  form: {},
31
31
  },
32
+ headerInfo = {},
32
33
  defaultValues = {},
33
34
  extendingFilters = {},
34
35
  getData = () => {},
@@ -71,12 +72,13 @@ const TablePage = ({
71
72
  data,
72
73
  applications,
73
74
  subjectClear,
75
+ APP,
74
76
  });
75
77
 
76
78
  return (
77
79
  <TablePageWithTabs
78
80
  t={t}
79
- title={t(viewConfig?.title || "")}
81
+ title={t(headerInfo?.title || viewConfig?.title || "")}
80
82
  breadCrumbs={breadcrumbs}
81
83
  location={location}
82
84
  loading={loading}
@@ -95,7 +97,7 @@ const TablePage = ({
95
97
  view={subject}
96
98
  getActiveTab={handleActiveTabChange}
97
99
  onDownload={onDownload && typeof onDownload === 'function' ? onDownload : undefined}
98
- drawerTitle={t(viewConfig?.createTitle || "")}
100
+ drawerTitle={t(headerInfo?.createTitle || viewConfig?.createTitle || "")}
99
101
  >
100
102
  {({onDrawerClose}) => (
101
103
  <Create
@@ -126,10 +128,10 @@ const TablePage = ({
126
128
  formData={formConfig.formData}
127
129
  formValue={formConfig.formValue}
128
130
  form={formConfig.form}
129
- namespace={formInfo.namespace}
130
- view={formInfo.view}
131
- scope={formInfo.scope}
132
- formType={formInfo.formType}
131
+ namespace={formConfig?.namespace || formInfo?.namespace}
132
+ view={formConfig?.view || formInfo.view}
133
+ scope={formConfig?.scope || formInfo.scope}
134
+ formType={formConfig?.formType || formInfo.formType}
133
135
  defaultData={defaultValues}
134
136
  />
135
137
  )}
@@ -49,6 +49,7 @@ const View = ({
49
49
  addData,
50
50
  options,
51
51
  getSubjectsDetails,
52
+ namespaceOverrides,
52
53
  // ADD CALLBACK TO GET THE CURRENT NAMESPACE CONFIG
53
54
  }) => {
54
55
  const getNamespaceConfig = (namespace) => namespaceConfiguration?.[namespace] || {};
@@ -110,6 +111,7 @@ const View = ({
110
111
  namespaceConfig: namespaceConfiguration,
111
112
  APP,
112
113
  viewConfig,
114
+ namespaceOverrides: namespaceOverrides,
113
115
  });
114
116
 
115
117
  const groupForm = useMemo(() => {
@@ -167,7 +169,7 @@ const View = ({
167
169
  module: APP,
168
170
  view: namespaceConfig?.view,
169
171
  ...(namespaceConfig?.scope && { scope: namespaceConfig.scope }),
170
- datastakeId: id,
172
+ datastakeId: id ? id : 'user',
171
173
  version,
172
174
  source,
173
175
  })
@@ -220,7 +222,7 @@ const View = ({
220
222
  <>
221
223
  <div className={"daf-view-form"}>
222
224
  <Header
223
- title={data?.name || ""}
225
+ title={(namespace === 'kyc' ? "KYC" : data?.name) || ""}
224
226
  breadcrumbs={breadcrumbs}
225
227
  goBackTo={goBack}
226
228
  actionButtons={actionButtons}
@@ -69,90 +69,18 @@ class AdminService extends BaseService {
69
69
  }
70
70
 
71
71
  getSubjects({ subject, params }) {
72
- return this.apiGet({
73
- url: `/management/subjects/${subject}`,
72
+ return this.apiGet({
73
+ url: `${subject}`,
74
74
  params,
75
- });
76
- }
77
-
78
- mergeLocations({ ids, data }) {
79
- const [id1, id2, ...remainingIds] = ids || [];
80
-
81
- if (!id1 || !id2) {
82
- throw new Error('At least two IDs are required for merging');
83
- }
84
-
85
- const url = `/management/merge/location/${id1}/${id2}`;
86
-
87
- const payload = {
88
- ...data,
89
- };
90
-
91
- if (remainingIds.length > 0) {
92
- payload.additionalIds = remainingIds;
93
- }
94
-
95
- return this.apiPost({
96
- url,
97
- data: payload,
98
- });
75
+ })
99
76
  }
100
77
 
101
-
102
-
103
- mergeSubjects({ subject, ids, data }) {
104
- const [id1, id2, ...remainingIds] = ids || [];
105
-
106
- if (!id1 || !id2) {
107
- throw new Error('At least two IDs are required for merging');
108
- }
109
-
110
- const url = `/management/merge/${subject}/${id1}/${id2}`;
111
-
112
- const payload = {
113
- ...data,
114
-
115
- };
116
-
117
- if (remainingIds.length > 0) {
118
- payload.additionalIds = remainingIds;
119
- }
120
-
78
+ mergeSubjects({ subject, ...data }) {
121
79
  return this.apiPost({
122
- url,
123
- data: payload,
124
- });
125
- }
126
-
127
- viewLocation({ id }) {
128
- return this.apiGet({
129
- url: `/management/subject/location/${id}`,
130
- });
131
- }
132
-
133
- viewStakeholder({ id }) {
134
- return this.apiGet({
135
- url: `/management/subject/stakeholder/${id}`,
136
- });
137
- }
138
-
139
- updateSubject({ subject, id, data }) {
140
- const type = subject === 'location' ? 'location' : 'stakeholder';
141
- return this.apiPut({
142
- url: `/management/subject/${type}/${id}`,
143
- data,
144
- });
145
- }
146
-
147
- getUserGrowth(activeFilter) {
148
- return this.apiGet({
149
- url: `/accounts/dashboard/user-growth`,
150
- isUserManager: true,
151
- params: { activeFilter },
152
- });
80
+ url: `/merge/${subject}`,
81
+ data,
82
+ })
153
83
  }
154
-
155
-
156
84
  }
157
85
 
158
86
  export default createLazyService(AdminService);
@@ -26,5 +26,4 @@ class DashboardService extends BaseService {
26
26
  }
27
27
  }
28
28
 
29
- export default createLazyService(DashboardService);
30
-
29
+ export default createLazyService(DashboardService);
@@ -63,29 +63,19 @@ export const getDefaultActiveFilters = (
63
63
  };
64
64
 
65
65
  const NEW_PAGINATION_APPS = ["nashiriki"];
66
-
67
66
  export const filterParams = (value, module) => {
68
67
  const { activeFilters, ...rest } = value;
69
68
 
70
- const {
71
- page = 1,
72
- pageSize = 20,
73
- sortDir,
74
- sortBy,
75
- search,
76
- searchParams,
77
- ...filters
78
- } = activeFilters || {};
69
+ const { page, pageSize, sortDir, sortBy, search, searchParams, ...filters } =
70
+ activeFilters || {};
79
71
 
80
72
  const params = {};
81
-
73
+
82
74
  params.pagination = JSON.stringify({
83
- page,
84
- pageSize,
75
+ [NEW_PAGINATION_APPS.includes(module) ? "skip" : "page"]: page,
76
+ [NEW_PAGINATION_APPS.includes(module) ? "take" : "pageSize"]: pageSize,
85
77
  });
86
78
 
87
- params.filters = JSON.stringify(filters);
88
-
89
79
  if (search && searchParams) {
90
80
  params.search = JSON.stringify({
91
81
  qs: search,
@@ -100,5 +90,26 @@ export const filterParams = (value, module) => {
100
90
  });
101
91
  }
102
92
 
93
+ if (Object.keys(filters).length) {
94
+ if (value.sourceId && value.sourceId === "overview") {
95
+ params.filters = JSON.stringify(filters);
96
+ } else {
97
+ params.filters = JSON.stringify({ ...filters, authorId: undefined });
98
+ }
99
+ }
100
+
103
101
  return { ...rest, ...params };
104
102
  };
103
+
104
+ export const getStatusOptions = (t) => {
105
+ return [
106
+ {
107
+ value: "submitted",
108
+ label: t("Submitted"),
109
+ },
110
+ {
111
+ value: "private",
112
+ label: t("Private"),
113
+ },
114
+ ]
115
+ }
@@ -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
+
@@ -1,11 +1,5 @@
1
1
  const en = {
2
- "sbg-admin::remove-user-title":"Remove User Title",
3
- "sbg-admin::remove-user-body":"Remove User Body",
4
- "Administrative-level-1": "Administrative Level 1",
5
- "Administrative-level-2": "Administrative Level 2",
6
- "merge-output": "Merge Output",
7
- "admin::current_subjects": "Current Subjects",
8
- "add-account":"Add Account",
2
+ "All Data": "All Data",
9
3
  "Site": "Site",
10
4
  "Production Sites": "Production Sites",
11
5
  "Type of account": "Type of account",
@@ -1,4 +1,5 @@
1
1
  const fr = {
2
+ "All Data": "Toutes les données",
2
3
  "Site": "Site",
3
4
  "Production Sites": "Sites de production",
4
5
  "Type of account": "Type de compte",
@@ -420,7 +421,7 @@ const fr = {
420
421
  Documentation: "Documents",
421
422
  "Edit project": "Modifier le projet",
422
423
  Name: "Nom",
423
- Type: "Type",
424
+ Type: "Tapez",
424
425
  type: "Type",
425
426
  Province: "Province",
426
427
  Territory: "Territoire",
@@ -1,4 +1,5 @@
1
1
  const sp = {
2
+ "All Data": "Todos los datos",
2
3
  "Site": "Sitio",
3
4
  "Production Sites": "Centros de producción",
4
5
  "Type of account": "Tipo de cuenta",
@@ -233,7 +234,7 @@ const sp = {
233
234
  "Documentation": "Documentos",
234
235
  "Edit project": "Modificar proyecto",
235
236
  "Name": "Nombre",
236
- "Type": "Tipo",
237
+ "Type": "Escribe",
237
238
  "type": "Tipo",
238
239
  "Province": "Provincia",
239
240
  "Territory": "Territorio",
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
package/src/pages.js CHANGED
@@ -2,17 +2,8 @@
2
2
  export { default as SupplyChainDashboard } from './@daf/pages/Dashboards/SupplyChain/index.jsx';
3
3
  export { default as UserDashboard } from './@daf/pages/Dashboards/UserDashboard/index.jsx';
4
4
  export { default as SelfAssesment } from './@daf/pages/Dashboards/SelfAssesment/index.jsx';
5
- export { default as OperatorsTable } from './@daf/pages/Stakeholders/Operators/index.jsx';
6
- export { default as LocationsTable } from './@daf/pages/Locations/index.jsx';
7
- export { default as StakeholdersTable } from './@daf/pages/Stakeholders/index.jsx';
8
- export { default as EventsTable } from './@daf/pages/Events/index.jsx';
9
- export { default as DocumentsTable } from './@daf/pages/Documents/index.jsx';
10
- export { default as WorkersTable } from './@daf/pages/Stakeholders/Workers/index.jsx';
11
- export { default as ActivitiesTable } from './@daf/pages/Events/Activities/index.jsx';
12
5
 
13
- export { default as IncidentsTable } from './@daf/pages/Events/Incidents/index.jsx';
14
- export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
15
- export { default as UsersTable } from './@daf/core/components/Screens/Users/index.jsx';
6
+ // Tables
16
7
  export { default as PartnersTable } from './@daf/pages/Partners/index.jsx';
17
8
  export { default as TablePage } from './@daf/pages/TablePage/index.jsx';
18
9
 
@@ -1,79 +0,0 @@
1
- import { findOptions } from "../../../../../../../helpers/StringHelper.js";
2
- import { Tooltip } from "antd";
3
- import { getNameByLevel } from "../../AdminTables/SubjectsTable/helper.js";
4
-
5
- export const getColumns = ({ t, selectOptions, module, entity }) => {
6
- return [
7
- {
8
- title: t("admin::organisation_id"),
9
- dataIndex: "datastakeId",
10
- key: "datastakeId",
11
- show: true,
12
- render: (value, all) => {
13
- return <Tooltip title={value}>{value}</Tooltip>;
14
- },
15
- },
16
- {
17
- title: t("Name"),
18
- dataIndex: "name",
19
- key: "name",
20
- show: true,
21
- render: (value, all) => {
22
- return <Tooltip title={value}>{value}</Tooltip>;
23
- },
24
- },
25
- {
26
- title: t("Category"),
27
- dataIndex: "category",
28
- key: "category",
29
- show: true,
30
- render: (value, all) => {
31
- const label = findOptions(value, selectOptions?.category);
32
- return <Tooltip title={label}>{label}</Tooltip>;
33
- },
34
- },
35
- {
36
- title: t("Country"),
37
- dataIndex: "country",
38
- key: "country",
39
- show: true,
40
- render: (value, all) => {
41
- const label = findOptions(value, selectOptions?.country);
42
- return <Tooltip title={label}>{label}</Tooltip>;
43
- },
44
- },
45
- {
46
- title: t("Province"),
47
- dataIndex: "administrativeLevel1",
48
- key: "administrativeLevel1",
49
- ellipsis: true,
50
- show: entity.includes("locations"),
51
- render: (value, all) => {
52
- let label;
53
- if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
54
- label = all?.linking?.SCL?.[value]?.name
55
- } else {
56
- label = getNameByLevel(all?.linking?.SCL, "level_1")?.name
57
- }
58
-
59
- return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
60
- },
61
- },
62
- {
63
- title: t("Territory"),
64
- dataIndex: "administrativeLevel2",
65
- key: "administrativeLevel2",
66
- show: entity.includes("locations"),
67
- render: (value, all) => {
68
- let label;
69
- if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
70
- label = all?.linking?.SCL?.[value]?.name
71
- } else {
72
- label = getNameByLevel(all?.linking?.SCL, "level_2")?.name
73
- }
74
-
75
- return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
76
- },
77
- },
78
- ].filter((c) => c?.show);
79
- };