datastake-daf 0.6.793 → 0.6.794
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 +4321 -3157
- package/dist/services/index.js +69 -3
- package/dist/utils/index.js +14 -17
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +79 -0
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +18 -8
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +6 -7
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +272 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +223 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +65 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +73 -45
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +48 -22
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +81 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +76 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +38 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +13 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +77 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +38 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +75 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +3 -1
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +5 -3
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +13 -8
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +3 -4
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +81 -2
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +180 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +27 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +157 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +31 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +77 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +117 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +54 -0
- package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
- package/src/@daf/services/AdminService.js +79 -7
- package/src/@daf/services/DashboardService.js +2 -1
- package/src/@daf/utils/filters.js +15 -13
- package/src/constants/locales/en/translation.js +7 -0
- package/src/constants/locales/fr/translation.js +1 -1
- package/src/constants/locales/sp/translation.js +1 -1
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
package/dist/services/index.js
CHANGED
|
@@ -765,19 +765,85 @@ class AdminService extends BaseService {
|
|
|
765
765
|
params
|
|
766
766
|
}) {
|
|
767
767
|
return this.apiGet({
|
|
768
|
-
url:
|
|
768
|
+
url: `/management/subjects/${subject}`,
|
|
769
769
|
params
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
|
+
mergeLocations({
|
|
773
|
+
ids,
|
|
774
|
+
data
|
|
775
|
+
}) {
|
|
776
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
777
|
+
if (!id1 || !id2) {
|
|
778
|
+
throw new Error('At least two IDs are required for merging');
|
|
779
|
+
}
|
|
780
|
+
const url = `/management/merge/location/${id1}/${id2}`;
|
|
781
|
+
const payload = {
|
|
782
|
+
...data
|
|
783
|
+
};
|
|
784
|
+
if (remainingIds.length > 0) {
|
|
785
|
+
payload.additionalIds = remainingIds;
|
|
786
|
+
}
|
|
787
|
+
return this.apiPost({
|
|
788
|
+
url,
|
|
789
|
+
data: payload
|
|
790
|
+
});
|
|
791
|
+
}
|
|
772
792
|
mergeSubjects({
|
|
773
793
|
subject,
|
|
774
|
-
|
|
794
|
+
ids,
|
|
795
|
+
data
|
|
775
796
|
}) {
|
|
797
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
798
|
+
if (!id1 || !id2) {
|
|
799
|
+
throw new Error('At least two IDs are required for merging');
|
|
800
|
+
}
|
|
801
|
+
const url = `/management/merge/${subject}/${id1}/${id2}`;
|
|
802
|
+
const payload = {
|
|
803
|
+
...data
|
|
804
|
+
};
|
|
805
|
+
if (remainingIds.length > 0) {
|
|
806
|
+
payload.additionalIds = remainingIds;
|
|
807
|
+
}
|
|
776
808
|
return this.apiPost({
|
|
777
|
-
url
|
|
809
|
+
url,
|
|
810
|
+
data: payload
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
viewLocation({
|
|
814
|
+
id
|
|
815
|
+
}) {
|
|
816
|
+
return this.apiGet({
|
|
817
|
+
url: `/management/subject/location/${id}`
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
viewStakeholder({
|
|
821
|
+
id
|
|
822
|
+
}) {
|
|
823
|
+
return this.apiGet({
|
|
824
|
+
url: `/management/subject/stakeholder/${id}`
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
updateSubject({
|
|
828
|
+
subject,
|
|
829
|
+
id,
|
|
830
|
+
data
|
|
831
|
+
}) {
|
|
832
|
+
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
833
|
+
return this.apiPut({
|
|
834
|
+
url: `/management/subject/${type}/${id}`,
|
|
778
835
|
data
|
|
779
836
|
});
|
|
780
837
|
}
|
|
838
|
+
getUserGrowth(activeFilter) {
|
|
839
|
+
return this.apiGet({
|
|
840
|
+
url: `/accounts/dashboard/user-growth`,
|
|
841
|
+
isUserManager: true,
|
|
842
|
+
params: {
|
|
843
|
+
activeFilter
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
}
|
|
781
847
|
}
|
|
782
848
|
var AdminService$1 = createLazyService(AdminService);
|
|
783
849
|
|
package/dist/utils/index.js
CHANGED
|
@@ -7506,15 +7506,14 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
7506
7506
|
});
|
|
7507
7507
|
return o;
|
|
7508
7508
|
};
|
|
7509
|
-
const NEW_PAGINATION_APPS = ["nashiriki"];
|
|
7510
7509
|
const filterParams = (value, module) => {
|
|
7511
7510
|
const {
|
|
7512
7511
|
activeFilters,
|
|
7513
7512
|
...rest
|
|
7514
7513
|
} = value;
|
|
7515
7514
|
const {
|
|
7516
|
-
page,
|
|
7517
|
-
pageSize,
|
|
7515
|
+
page = 1,
|
|
7516
|
+
pageSize = 20,
|
|
7518
7517
|
sortDir,
|
|
7519
7518
|
sortBy,
|
|
7520
7519
|
search,
|
|
@@ -7523,9 +7522,10 @@ const filterParams = (value, module) => {
|
|
|
7523
7522
|
} = activeFilters || {};
|
|
7524
7523
|
const params = {};
|
|
7525
7524
|
params.pagination = JSON.stringify({
|
|
7526
|
-
|
|
7527
|
-
|
|
7525
|
+
page,
|
|
7526
|
+
pageSize
|
|
7528
7527
|
});
|
|
7528
|
+
params.filters = JSON.stringify(filters);
|
|
7529
7529
|
if (search && searchParams) {
|
|
7530
7530
|
params.search = JSON.stringify({
|
|
7531
7531
|
qs: search,
|
|
@@ -7538,16 +7538,6 @@ const filterParams = (value, module) => {
|
|
|
7538
7538
|
by: sortBy
|
|
7539
7539
|
});
|
|
7540
7540
|
}
|
|
7541
|
-
if (Object.keys(filters).length) {
|
|
7542
|
-
if (value.sourceId && value.sourceId === "overview") {
|
|
7543
|
-
params.filters = JSON.stringify(filters);
|
|
7544
|
-
} else {
|
|
7545
|
-
params.filters = JSON.stringify({
|
|
7546
|
-
...filters,
|
|
7547
|
-
authorId: undefined
|
|
7548
|
-
});
|
|
7549
|
-
}
|
|
7550
|
-
}
|
|
7551
7541
|
return {
|
|
7552
7542
|
...rest,
|
|
7553
7543
|
...params
|
|
@@ -7752,6 +7742,13 @@ function getRedirectPath(user, fallback = '', app, isDatastake) {
|
|
|
7752
7742
|
}
|
|
7753
7743
|
|
|
7754
7744
|
const en = {
|
|
7745
|
+
"sbg-admin::remove-user-title": "Remove User Title",
|
|
7746
|
+
"sbg-admin::remove-user-body": "Remove User Body",
|
|
7747
|
+
"Administrative-level-1": "Administrative Level 1",
|
|
7748
|
+
"Administrative-level-2": "Administrative Level 2",
|
|
7749
|
+
"merge-output": "Merge Output",
|
|
7750
|
+
"admin::current_subjects": "Current Subjects",
|
|
7751
|
+
"add-account": "Add Account",
|
|
7755
7752
|
"Site": "Site",
|
|
7756
7753
|
"Production Sites": "Production Sites",
|
|
7757
7754
|
"Type of account": "Type of account",
|
|
@@ -9451,7 +9448,7 @@ const fr = {
|
|
|
9451
9448
|
Documentation: "Documents",
|
|
9452
9449
|
"Edit project": "Modifier le projet",
|
|
9453
9450
|
Name: "Nom",
|
|
9454
|
-
Type: "
|
|
9451
|
+
Type: "Type",
|
|
9455
9452
|
type: "Type",
|
|
9456
9453
|
Province: "Province",
|
|
9457
9454
|
Territory: "Territoire",
|
|
@@ -11262,7 +11259,7 @@ const sp = {
|
|
|
11262
11259
|
"Documentation": "Documentos",
|
|
11263
11260
|
"Edit project": "Modificar proyecto",
|
|
11264
11261
|
"Name": "Nombre",
|
|
11265
|
-
"Type": "
|
|
11262
|
+
"Type": "Tipo",
|
|
11266
11263
|
"type": "Tipo",
|
|
11267
11264
|
"Province": "Provincia",
|
|
11268
11265
|
"Territory": "Territorio",
|
package/package.json
CHANGED
|
@@ -10,7 +10,6 @@ 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
|
-
|
|
14
13
|
useEffect(() => {
|
|
15
14
|
if (container.current) {
|
|
16
15
|
if (mainGraph) {
|
|
@@ -12,7 +12,7 @@ export default function useUserGrowth({ container, data: mainData = {}, t, trans
|
|
|
12
12
|
const [mainGraph, setMainGraph] = useState(null);
|
|
13
13
|
const [data, setData] = useState([]);
|
|
14
14
|
const { token } = useToken();
|
|
15
|
-
|
|
15
|
+
console.log("mainData", mainData);
|
|
16
16
|
const fetchData = () => {
|
|
17
17
|
const { dates = [] } = mainData;
|
|
18
18
|
const _data = [];
|
|
@@ -9,7 +9,7 @@ export default function UserGrowth({ loading, data = [], t, translationKeys, fet
|
|
|
9
9
|
const [selectValue, setSelectValue] = useState(selectOptions[0]?.value);
|
|
10
10
|
|
|
11
11
|
useUserGrowth({ container, data, t, translationKeys });
|
|
12
|
-
|
|
12
|
+
console.log("usergrowthhhhh", data);
|
|
13
13
|
|
|
14
14
|
useEffect(() => {
|
|
15
15
|
if (typeof fetchUserGrowth === "function") {
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
};
|
|
@@ -47,7 +47,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
47
47
|
dataIndex: "administrativeLevel1",
|
|
48
48
|
key: "administrativeLevel1",
|
|
49
49
|
ellipsis: true,
|
|
50
|
-
show: entity
|
|
50
|
+
show: entity?.includes("location"),
|
|
51
51
|
render: (value, all) => {
|
|
52
52
|
let label;
|
|
53
53
|
if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
@@ -63,7 +63,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
63
63
|
title: t("Territory"),
|
|
64
64
|
dataIndex: "administrativeLevel2",
|
|
65
65
|
key: "administrativeLevel2",
|
|
66
|
-
show: entity
|
|
66
|
+
show: entity?.includes("location"),
|
|
67
67
|
render: (value, all) => {
|
|
68
68
|
let label;
|
|
69
69
|
if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import Modal from "../../../../Modal/index.jsx";
|
|
2
2
|
import { Form, Input, Select, theme } from "antd";
|
|
3
3
|
import { Container } from "../CombineModalStyle.js";
|
|
4
|
-
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
5
4
|
import DAFTable from "../../../../Table/index.jsx";
|
|
6
5
|
import { useMemo, useState } from "react";
|
|
7
|
-
import { getColumns } from "./helper.js";
|
|
8
6
|
import { getNameByLevel } from "../../AdminTables/SubjectsTable/helper.js";
|
|
7
|
+
import { getColumns } from "./helper.js";
|
|
9
8
|
|
|
10
9
|
const { useToken } = theme;
|
|
11
10
|
|
|
@@ -35,10 +34,22 @@ export default function CombineLocationModal({
|
|
|
35
34
|
|
|
36
35
|
const onSubmit = () => {
|
|
37
36
|
MainForm.validateFields().then((data) => {
|
|
38
|
-
const ids = selectedLocations.map((location) => location.
|
|
37
|
+
const ids = selectedLocations.map((location) => location.id);
|
|
38
|
+
const allowedKeys = [
|
|
39
|
+
"id",
|
|
40
|
+
"name",
|
|
41
|
+
"country",
|
|
42
|
+
"category",
|
|
43
|
+
"administrativeLevel1",
|
|
44
|
+
"administrativeLevel2"
|
|
45
|
+
];
|
|
46
|
+
const filteredData = Object.fromEntries(
|
|
47
|
+
Object.entries(data).filter(([key]) => allowedKeys.includes(key))
|
|
48
|
+
);
|
|
49
|
+
|
|
39
50
|
onSuccess({
|
|
40
51
|
ids,
|
|
41
|
-
data,
|
|
52
|
+
data: filteredData,
|
|
42
53
|
});
|
|
43
54
|
});
|
|
44
55
|
};
|
|
@@ -57,8 +68,7 @@ export default function CombineLocationModal({
|
|
|
57
68
|
setIsDisabled(() => {
|
|
58
69
|
const values = MainForm.getFieldsValue();
|
|
59
70
|
|
|
60
|
-
const requiredFields =
|
|
61
|
-
entity === "location"
|
|
71
|
+
const requiredFields = entity?.includes("location")
|
|
62
72
|
? ["id", "name", "category", "country", "administrativeLevel1", "administrativeLevel2"]
|
|
63
73
|
: ["id", "name", "category", "country"];
|
|
64
74
|
|
|
@@ -114,7 +124,7 @@ export default function CombineLocationModal({
|
|
|
114
124
|
options={selectedLocations.map((location) => {
|
|
115
125
|
return {
|
|
116
126
|
label: location?.datastakeId || "-",
|
|
117
|
-
|
|
127
|
+
value: location?.id || "-",
|
|
118
128
|
};
|
|
119
129
|
})}
|
|
120
130
|
placeholder={t("ID")}
|
|
@@ -169,7 +179,7 @@ export default function CombineLocationModal({
|
|
|
169
179
|
></Select>
|
|
170
180
|
</Form.Item>
|
|
171
181
|
|
|
172
|
-
{entity
|
|
182
|
+
{entity?.includes("location") && (
|
|
173
183
|
<>
|
|
174
184
|
<Form.Item className="flex-1" name="administrativeLevel1">
|
|
175
185
|
<Select
|
|
@@ -36,7 +36,7 @@ export default function CombineSubjectsModal({
|
|
|
36
36
|
|
|
37
37
|
const onSubmit = () => {
|
|
38
38
|
MainForm.validateFields().then((data) => {
|
|
39
|
-
const ids = selectedSubjects.map((subject) => subject.
|
|
39
|
+
const ids = selectedSubjects.map((subject) => subject.id);
|
|
40
40
|
onSuccess({
|
|
41
41
|
ids,
|
|
42
42
|
data,
|
|
@@ -47,7 +47,7 @@ export default function CombineSubjectsModal({
|
|
|
47
47
|
return (
|
|
48
48
|
<Modal
|
|
49
49
|
open={isOpen}
|
|
50
|
-
title={t("
|
|
50
|
+
title={t("merge")}
|
|
51
51
|
onClose={onClose}
|
|
52
52
|
onSuccess={onSubmit}
|
|
53
53
|
withModalFormWrapper={false}
|
|
@@ -59,7 +59,7 @@ export default function CombineSubjectsModal({
|
|
|
59
59
|
const values = MainForm.getFieldsValue();
|
|
60
60
|
|
|
61
61
|
const requiredFields =
|
|
62
|
-
entity
|
|
62
|
+
entity.includes("location")
|
|
63
63
|
? ["id", "name", "category", "country", "administrativeLevel1", "administrativeLevel2"]
|
|
64
64
|
: ["id", "name", "category", "country"];
|
|
65
65
|
|
|
@@ -75,7 +75,7 @@ export default function CombineSubjectsModal({
|
|
|
75
75
|
color: token.baseGray90,
|
|
76
76
|
}}
|
|
77
77
|
>
|
|
78
|
-
{t("
|
|
78
|
+
{t("current_subjects")}
|
|
79
79
|
</span>
|
|
80
80
|
<DAFTable
|
|
81
81
|
columns={columns}
|
|
@@ -93,7 +93,7 @@ export default function CombineSubjectsModal({
|
|
|
93
93
|
marginTop: 14,
|
|
94
94
|
}}
|
|
95
95
|
>
|
|
96
|
-
{t("
|
|
96
|
+
{t("merged_output")}
|
|
97
97
|
</span>
|
|
98
98
|
|
|
99
99
|
<Form
|
|
@@ -135,7 +135,7 @@ export default function CombineSubjectsModal({
|
|
|
135
135
|
></Select>
|
|
136
136
|
</Form.Item>
|
|
137
137
|
|
|
138
|
-
{entity.includes("
|
|
138
|
+
{entity.includes("location") && (
|
|
139
139
|
<>
|
|
140
140
|
<Form.Item className="flex-1" name="administrativeLevel1">
|
|
141
141
|
<Select
|
|
@@ -20,7 +20,7 @@ export default function AdminDashboardScreen({ config }) {
|
|
|
20
20
|
userGrowthDataLoading,
|
|
21
21
|
} = useWidgetFetch();
|
|
22
22
|
|
|
23
|
-
console.log({userGrowthData});
|
|
23
|
+
// console.log({userGrowthData});
|
|
24
24
|
|
|
25
25
|
const actionsWidgetsConfig = useMemo(
|
|
26
26
|
() => getActionWidgetsConfig({ getRedirectLink }),
|
|
@@ -39,7 +39,7 @@ export default function AdminDashboardScreen({ config }) {
|
|
|
39
39
|
const safeUserActivity = Array.isArray(data?.data?.userActivity) ? data.data.userActivity : [];
|
|
40
40
|
const safeTopContributors = Array.isArray(data?.topContributors) ? data.topContributors : [];
|
|
41
41
|
const safeUserGrowth = Array.isArray(data?.userGrowthData) ? data.userGrowthData : [];
|
|
42
|
-
|
|
42
|
+
console.log("safeUserGrowth", safeUserGrowth);
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<AdminDashboard
|
|
@@ -48,11 +48,11 @@ export default function AdminLocationScreen({ config }) {
|
|
|
48
48
|
async (mergeData) => {
|
|
49
49
|
try {
|
|
50
50
|
if (AdminService.mergeLocations) {
|
|
51
|
-
await AdminService.mergeLocations(mergeData);
|
|
51
|
+
await AdminService.mergeLocations({ subject: 'location', ...mergeData });
|
|
52
52
|
message.success(t("Locations merged successfully"));
|
|
53
53
|
} else {
|
|
54
54
|
console.warn("AdminService.mergeLocations is not implemented");
|
|
55
|
-
message.
|
|
55
|
+
message.error(t("Locations not merged"));
|
|
56
56
|
}
|
|
57
57
|
} catch (err) {
|
|
58
58
|
handleError?.(err);
|
|
@@ -61,12 +61,11 @@ export default function AdminLocationScreen({ config }) {
|
|
|
61
61
|
[AdminService, t, handleError]
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
const getLocations = useCallback((params) => {
|
|
64
|
+
const getSubjects = useCallback((params) => {
|
|
66
65
|
if (getData) {
|
|
67
66
|
return getData(params);
|
|
68
67
|
}
|
|
69
|
-
return AdminService.
|
|
68
|
+
return AdminService.getSubjects({ subject: 'location', params });
|
|
70
69
|
}, [getData, AdminService]);
|
|
71
70
|
|
|
72
71
|
return (
|
|
@@ -77,12 +76,12 @@ export default function AdminLocationScreen({ config }) {
|
|
|
77
76
|
location={location}
|
|
78
77
|
module={module}
|
|
79
78
|
headerTitle={headerTitle}
|
|
80
|
-
getData={
|
|
79
|
+
getData={getSubjects}
|
|
81
80
|
isMobile={isMobile}
|
|
82
81
|
defaultPageSize={defaultPageSize}
|
|
83
82
|
view={view}
|
|
84
83
|
breadcrumbs={breadcrumbs}
|
|
85
|
-
|
|
84
|
+
mergeLocationsFunction={handleMergeLocations}
|
|
86
85
|
refetchTrigger={refetchTrigger}
|
|
87
86
|
config={{
|
|
88
87
|
options: {
|
|
@@ -48,7 +48,7 @@ export default function AdminSubjectsScreen({ config }) {
|
|
|
48
48
|
async (mergeData) => {
|
|
49
49
|
try {
|
|
50
50
|
if (AdminService.mergeSubjects) {
|
|
51
|
-
await AdminService.mergeSubjects(mergeData);
|
|
51
|
+
await AdminService.mergeSubjects({ subject: 'stakeholder', ...mergeData });
|
|
52
52
|
message.success(t("Subjects merged successfully"));
|
|
53
53
|
} else {
|
|
54
54
|
console.warn("AdminService.mergeSubjects is not implemented");
|
|
@@ -66,7 +66,7 @@ export default function AdminSubjectsScreen({ config }) {
|
|
|
66
66
|
if (getData) {
|
|
67
67
|
return getData(params);
|
|
68
68
|
}
|
|
69
|
-
return AdminService.getSubjects(params);
|
|
69
|
+
return AdminService.getSubjects({ subject: 'stakeholder', params });
|
|
70
70
|
}, [getData, AdminService]);
|
|
71
71
|
|
|
72
72
|
return (
|