datastake-daf 0.6.792 → 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.
Files changed (74) hide show
  1. package/dist/components/index.js +4377 -3187
  2. package/dist/pages/index.js +1401 -589
  3. package/dist/services/index.js +69 -3
  4. package/dist/utils/index.js +14 -17
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/ProgressBar/ProgressBarWithIcon/index.jsx +23 -0
  7. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +0 -1
  8. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
  9. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
  10. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
  11. package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +0 -1
  12. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +79 -0
  13. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
  14. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +18 -8
  15. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
  16. package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
  17. package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
  18. package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +6 -7
  19. package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
  20. package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +272 -0
  21. package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +1 -0
  22. package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +1 -0
  23. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +223 -0
  24. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +65 -0
  25. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +73 -45
  26. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
  27. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +48 -22
  28. package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
  29. package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +81 -0
  30. package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +76 -0
  31. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +38 -0
  32. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +13 -0
  33. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +77 -0
  34. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +38 -0
  35. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
  36. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +75 -0
  37. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +3 -1
  38. package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +5 -3
  39. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +13 -8
  40. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
  41. package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +3 -4
  42. package/src/@daf/core/components/Screens/Admin/adminRoutes.js +81 -2
  43. package/src/@daf/core/components/Table/NavigationAction/index.jsx +5 -3
  44. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/columns.js +248 -0
  45. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +68 -0
  46. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/style.js +29 -0
  47. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +93 -0
  48. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/index.jsx +43 -0
  49. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +127 -0
  50. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +52 -0
  51. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/style.js +26 -0
  52. package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +39 -0
  53. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +180 -0
  54. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
  55. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +27 -0
  56. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +157 -0
  57. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +31 -0
  58. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +77 -0
  59. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +117 -0
  60. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +54 -0
  61. package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
  62. package/src/@daf/services/AdminService.js +79 -7
  63. package/src/@daf/services/DashboardService.js +2 -1
  64. package/src/@daf/utils/filters.js +15 -13
  65. package/src/constants/locales/en/translation.js +7 -0
  66. package/src/constants/locales/fr/translation.js +1 -1
  67. package/src/constants/locales/sp/translation.js +1 -1
  68. package/src/index.js +1 -0
  69. package/src/pages.js +1 -0
  70. package/build/favicon.ico +0 -0
  71. package/build/logo192.png +0 -0
  72. package/build/logo512.png +0 -0
  73. package/build/manifest.json +0 -25
  74. package/build/robots.txt +0 -3
@@ -765,19 +765,85 @@ class AdminService extends BaseService {
765
765
  params
766
766
  }) {
767
767
  return this.apiGet({
768
- url: `${subject}`,
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
- ...data
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: `/merge/${subject}`,
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
 
@@ -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
- [NEW_PAGINATION_APPS.includes(module) ? "skip" : "page"]: page,
7527
- [NEW_PAGINATION_APPS.includes(module) ? "take" : "pageSize"]: pageSize
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: "Tapez",
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": "Escribe",
11262
+ "Type": "Tipo",
11266
11263
  "type": "Tipo",
11267
11264
  "Province": "Provincia",
11268
11265
  "Territory": "Territorio",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.792",
3
+ "version": "0.6.794",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -0,0 +1,23 @@
1
+ import React from 'react'
2
+ import ProgressBar from '../index.jsx'
3
+ import ProgressBarSideIcon from '../components/SideIcon/index.jsx'
4
+
5
+ function ProgressBarWithIcon({
6
+ published,
7
+ data,
8
+ t
9
+ }) {
10
+ return (
11
+ <div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
12
+ <ProgressBar
13
+ style={{ width: "100%" }}
14
+ tooltipTitle={published && t("Submitted")}
15
+ percentage={parseInt(data?.completion || 0)}
16
+ isSubmitted={published}
17
+ />
18
+ {published ? <ProgressBarSideIcon size={16} iconSize={10} /> : <span>{parseInt(data?.completion || 0)}%</span>}
19
+ </div>
20
+ )
21
+ }
22
+
23
+ export default ProgressBarWithIcon
@@ -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) {
@@ -8,7 +8,7 @@ export default function TopContributors({ data, loading, t }) {
8
8
  const container = useRef(null);
9
9
 
10
10
  useTopContributors({ container, data, t });
11
-
11
+ console.log("topcontributorshhhh", data);
12
12
  return (
13
13
  <Widget
14
14
  title={t(`admin::top-contributors`)}
@@ -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") {
@@ -24,7 +24,6 @@ export default function AddUserModal({ isOpen, defaultData = {}, userRoles = [],
24
24
  .catch(() => {});
25
25
  };
26
26
 
27
- console.log("hellooooooooooooooooooooooooo");
28
27
 
29
28
  return (
30
29
  <Modal
@@ -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.includes("locations"),
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.includes("locations"),
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._id);
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
- value: location?.datastakeId || "-",
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.includes("locations") && (
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._id);
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("admin::merge")}
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 === "location"
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("admin::current_subjects")}
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("admin::merged_output")}
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("locations") && (
138
+ {entity.includes("location") && (
139
139
  <>
140
140
  <Form.Item className="flex-1" name="administrativeLevel1">
141
141
  <Select
@@ -47,7 +47,7 @@ export default function NewAccount({
47
47
  return (
48
48
  <Modal
49
49
  t={t}
50
- title={t(isEdit ? "admin::edit-account" : "admin::add-account")}
50
+ title={t(isEdit ? "edit-account" : "add-account")}
51
51
  open={isOpen}
52
52
  onClose={onClose}
53
53
  onSuccess={onSubmit}
@@ -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.success(t("Locations merged successfully"));
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
- // Use custom getData if provided, otherwise use default AdminService.getLocations
65
- const getLocations = useCallback((params) => {
64
+ const getSubjects = useCallback((params) => {
66
65
  if (getData) {
67
66
  return getData(params);
68
67
  }
69
- return AdminService.getLocations(params);
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={getLocations}
79
+ getData={getSubjects}
81
80
  isMobile={isMobile}
82
81
  defaultPageSize={defaultPageSize}
83
82
  view={view}
84
83
  breadcrumbs={breadcrumbs}
85
- mergeSubjectsFunction={handleMergeLocations}
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 (