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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { DashboardLayout, Header, KeyIndicators, MineSiteMap, Widget } from '../../../../../../src/index.js'
|
|
3
|
+
import { getKeyIndicatorsRowConfig } from './config';
|
|
4
|
+
|
|
5
|
+
const PlantingCycleSummary = ({ activityData, supportText, onDownload, downloadDisabled, actionButtons, breadcrumbs, goBackTo, loading, t = () => { } }) => {
|
|
6
|
+
const keyIndicatorsConfig = useMemo(() => getKeyIndicatorsRowConfig({ t, data: {} }), [t]);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<DashboardLayout
|
|
10
|
+
header={
|
|
11
|
+
<Header
|
|
12
|
+
title={'Planting Cycle Summary'}
|
|
13
|
+
supportText={supportText || ''}
|
|
14
|
+
onDownload={onDownload}
|
|
15
|
+
downloadDisabled={downloadDisabled}
|
|
16
|
+
actionButtons={actionButtons}
|
|
17
|
+
breadcrumbs={breadcrumbs}
|
|
18
|
+
goBackTo={goBackTo}
|
|
19
|
+
loading={loading}
|
|
20
|
+
/>
|
|
21
|
+
}
|
|
22
|
+
>
|
|
23
|
+
<section>
|
|
24
|
+
<KeyIndicators title={t("Key Information")} config={keyIndicatorsConfig} loading={loading} />
|
|
25
|
+
</section>
|
|
26
|
+
|
|
27
|
+
<section>
|
|
28
|
+
<Widget
|
|
29
|
+
title={t("Planting Locations")}
|
|
30
|
+
className="no-px h-w-btn-header no-pt-body no-p-body no-pb-body"
|
|
31
|
+
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
|
|
32
|
+
>
|
|
33
|
+
<MineSiteMap
|
|
34
|
+
loading={loading}
|
|
35
|
+
t={t}
|
|
36
|
+
isSatellite
|
|
37
|
+
data={[]}
|
|
38
|
+
/>
|
|
39
|
+
</Widget>
|
|
40
|
+
</section>
|
|
41
|
+
</DashboardLayout>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default PlantingCycleSummary;
|
|
46
|
+
|
|
@@ -26,7 +26,7 @@ export const getKeyIndicatorsRowConfig = ({ t, data = {} }) => [
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
label: t('Activity Participants'),
|
|
29
|
-
render: () => <div>{'0'}</div>
|
|
29
|
+
render: () => <div> {data?.totalNumberOfParticipantsArrival || '0'}</div>
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
label: t('Hectares Planted'),
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useGetQueryParams } from "../hooks/useGetQueryParams";
|
|
3
|
+
|
|
4
|
+
export const useFetchData = ({
|
|
5
|
+
location,
|
|
6
|
+
getData,
|
|
7
|
+
activeTab,
|
|
8
|
+
extendingFilters,
|
|
9
|
+
subject,
|
|
10
|
+
}) => {
|
|
11
|
+
const { paginationQuery, searchParams, otherParams, sortBy, sortDir, } = useGetQueryParams({location});
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const cleanSearchParams = Object.fromEntries(
|
|
14
|
+
Object.entries(searchParams).filter(([_, value]) => value != null && value !== '')
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const hasPagination = paginationQuery.skip != null || paginationQuery.take != null;
|
|
18
|
+
|
|
19
|
+
if (!hasPagination) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getData({
|
|
24
|
+
pagination: paginationQuery,
|
|
25
|
+
...(Object.keys(otherParams).length > 0 && otherParams ),
|
|
26
|
+
...(Object.keys(cleanSearchParams).length > 0 && { search: cleanSearchParams }),
|
|
27
|
+
tab: activeTab,
|
|
28
|
+
sortBy: {
|
|
29
|
+
[sortBy || "updatedAt"]: sortDir ? (sortDir === "ascend" ? 1 : -1) : -1,
|
|
30
|
+
},
|
|
31
|
+
...extendingFilters,
|
|
32
|
+
}, subject)
|
|
33
|
+
}, [location.search, activeTab, JSON.stringify(extendingFilters)]);
|
|
34
|
+
}
|
|
@@ -3,25 +3,10 @@ import { createLazyService } from "./helpers/LazyService.js";
|
|
|
3
3
|
|
|
4
4
|
class PartnerService extends BaseService {
|
|
5
5
|
get(tab, filters) {
|
|
6
|
-
const { page, pageSize, search, searchParams, ...rest } = filters;
|
|
7
|
-
const params = {
|
|
8
|
-
filters: rest,
|
|
9
|
-
pagination: {
|
|
10
|
-
skip: page,
|
|
11
|
-
take: pageSize,
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
if (search && searchParams.length > 0) {
|
|
15
|
-
params.search = {
|
|
16
|
-
qs: search,
|
|
17
|
-
fields: searchParams,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
6
|
return this.apiGet({
|
|
22
7
|
url: "/partner",
|
|
23
8
|
isApp: true,
|
|
24
|
-
params,
|
|
9
|
+
params: filters,
|
|
25
10
|
});
|
|
26
11
|
}
|
|
27
12
|
|
package/src/index.js
CHANGED
|
@@ -190,7 +190,7 @@ export { InformationChannelProvider } from "./@daf/core/components/Screens/Infor
|
|
|
190
190
|
// UI
|
|
191
191
|
export { default as SDGIcons } from "./@daf/core/components/UI/SDGIcon/index.jsx";
|
|
192
192
|
export { default as CountryFlag } from "./@daf/core/components/UI/CountryFlag/index.jsx"
|
|
193
|
-
|
|
193
|
+
export { default as KeyIndicatorNavigateLabel } from "./@daf/core/components/UI/KeyIndicatorNavigateLabel/index.jsx";
|
|
194
194
|
|
|
195
195
|
//Settings
|
|
196
196
|
export { default as Settings } from "./@daf/core/components/Screens/Settings/index.js";
|
package/src/pages.js
CHANGED
|
@@ -12,8 +12,10 @@ export { default as ActivitiesTable } from './@daf/pages/Events/Activities/index
|
|
|
12
12
|
export { default as IncidentsTable } from './@daf/pages/Events/Incidents/index.jsx';
|
|
13
13
|
export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
|
|
14
14
|
export { default as UsersTable } from './@daf/core/components/Screens/Users/index.jsx';
|
|
15
|
+
export { default as PartnersTable } from './@daf/pages/Partners/index.jsx';
|
|
15
16
|
|
|
16
17
|
// Summary
|
|
17
18
|
export { default as OperatorSummary } from './@daf/pages/Summary/Operator/index.jsx';
|
|
18
19
|
export { default as RestorationActivitySummary } from './@daf/pages/Summary/Activities/Restoration/index.jsx';
|
|
20
|
+
export { default as PlantingCycleSummary } from './@daf/pages/Summary/Activities/PlantingCycle/index.jsx';
|
|
19
21
|
export { default as MineSummary } from './@daf/pages/Summary/Minesite/index.jsx';
|