datastake-daf 0.6.794 → 0.6.795

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 (86) 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 +3159 -4303
  7. package/dist/pages/index.js +2045 -3246
  8. package/dist/services/index.js +3 -69
  9. package/dist/utils/index.js +20 -14
  10. package/package.json +1 -1
  11. package/src/@daf/core/components/Dashboard/Map/hook.js +25 -1
  12. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +1 -0
  13. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
  14. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
  15. package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
  16. package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +1 -0
  17. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
  18. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +8 -18
  19. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
  20. package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
  21. package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
  22. package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +7 -6
  23. package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
  24. package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +0 -1
  25. package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +0 -1
  26. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +45 -73
  27. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
  28. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +22 -48
  29. package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +0 -1
  30. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +1 -3
  31. package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +3 -5
  32. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +8 -13
  33. package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
  34. package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +4 -3
  35. package/src/@daf/core/components/Screens/Admin/adminRoutes.js +2 -81
  36. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +1 -1
  37. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +0 -1
  38. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/columns.js +3 -2
  39. package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +13 -4
  40. package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +22 -20
  41. package/src/@daf/pages/Events/Activities/columns.js +1 -1
  42. package/src/@daf/pages/Events/Activities/config.js +23 -30
  43. package/src/@daf/pages/Events/Incidents/columns.js +1 -1
  44. package/src/@daf/pages/Events/Incidents/config.js +23 -30
  45. package/src/@daf/pages/Events/config.js +7 -7
  46. package/src/@daf/pages/Locations/MineSite/columns.js +3 -3
  47. package/src/@daf/pages/Locations/MineSite/config.js +20 -14
  48. package/src/@daf/pages/Locations/config.js +3 -3
  49. package/src/@daf/pages/Stakeholders/Operators/columns.js +2 -2
  50. package/src/@daf/pages/Stakeholders/Operators/config.js +9 -16
  51. package/src/@daf/pages/Stakeholders/Workers/columns.js +1 -1
  52. package/src/@daf/pages/Stakeholders/Workers/config.js +23 -29
  53. package/src/@daf/pages/Stakeholders/config.js +3 -3
  54. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +1 -1
  55. package/src/@daf/pages/TablePage/helper.js +17 -1
  56. package/src/@daf/pages/TablePage/hook.js +3 -1
  57. package/src/@daf/pages/TablePage/index.jsx +8 -6
  58. package/src/@daf/pages/View/index.jsx +4 -2
  59. package/src/@daf/services/AdminService.js +7 -79
  60. package/src/@daf/services/DashboardService.js +1 -2
  61. package/src/@daf/utils/filters.js +26 -15
  62. package/src/constants/locales/en/translation.js +1 -7
  63. package/src/constants/locales/fr/translation.js +2 -1
  64. package/src/constants/locales/sp/translation.js +2 -1
  65. package/src/pages.js +1 -10
  66. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +0 -79
  67. package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +0 -272
  68. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +0 -223
  69. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +0 -65
  70. package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +0 -81
  71. package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +0 -76
  72. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +0 -38
  73. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +0 -13
  74. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +0 -77
  75. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +0 -38
  76. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
  77. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +0 -75
  78. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +0 -180
  79. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
  80. package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +0 -27
  81. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +0 -157
  82. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +0 -31
  83. package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +0 -77
  84. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +0 -117
  85. package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +0 -54
  86. package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
@@ -765,85 +765,19 @@ class AdminService extends BaseService {
765
765
  params
766
766
  }) {
767
767
  return this.apiGet({
768
- url: `/management/subjects/${subject}`,
768
+ url: `${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
- }
792
772
  mergeSubjects({
793
773
  subject,
794
- ids,
795
- data
774
+ ...data
796
775
  }) {
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
- }
808
776
  return this.apiPost({
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}`,
777
+ url: `/merge/${subject}`,
835
778
  data
836
779
  });
837
780
  }
838
- getUserGrowth(activeFilter) {
839
- return this.apiGet({
840
- url: `/accounts/dashboard/user-growth`,
841
- isUserManager: true,
842
- params: {
843
- activeFilter
844
- }
845
- });
846
- }
847
781
  }
848
782
  var AdminService$1 = createLazyService(AdminService);
849
783
 
@@ -7506,14 +7506,15 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
7506
7506
  });
7507
7507
  return o;
7508
7508
  };
7509
+ const NEW_PAGINATION_APPS = ["nashiriki"];
7509
7510
  const filterParams = (value, module) => {
7510
7511
  const {
7511
7512
  activeFilters,
7512
7513
  ...rest
7513
7514
  } = value;
7514
7515
  const {
7515
- page = 1,
7516
- pageSize = 20,
7516
+ page,
7517
+ pageSize,
7517
7518
  sortDir,
7518
7519
  sortBy,
7519
7520
  search,
@@ -7522,10 +7523,9 @@ const filterParams = (value, module) => {
7522
7523
  } = activeFilters || {};
7523
7524
  const params = {};
7524
7525
  params.pagination = JSON.stringify({
7525
- page,
7526
- pageSize
7526
+ [NEW_PAGINATION_APPS.includes(module) ? "skip" : "page"]: page,
7527
+ [NEW_PAGINATION_APPS.includes(module) ? "take" : "pageSize"]: pageSize
7527
7528
  });
7528
- params.filters = JSON.stringify(filters);
7529
7529
  if (search && searchParams) {
7530
7530
  params.search = JSON.stringify({
7531
7531
  qs: search,
@@ -7538,6 +7538,16 @@ 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
+ }
7541
7551
  return {
7542
7552
  ...rest,
7543
7553
  ...params
@@ -7742,13 +7752,7 @@ function getRedirectPath(user, fallback = '', app, isDatastake) {
7742
7752
  }
7743
7753
 
7744
7754
  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
+ "All Data": "All Data",
7752
7756
  "Site": "Site",
7753
7757
  "Production Sites": "Production Sites",
7754
7758
  "Type of account": "Type of account",
@@ -9070,6 +9074,7 @@ const en = {
9070
9074
  };
9071
9075
 
9072
9076
  const fr = {
9077
+ "All Data": "Toutes les données",
9073
9078
  "Site": "Site",
9074
9079
  "Production Sites": "Sites de production",
9075
9080
  "Type of account": "Type de compte",
@@ -9448,7 +9453,7 @@ const fr = {
9448
9453
  Documentation: "Documents",
9449
9454
  "Edit project": "Modifier le projet",
9450
9455
  Name: "Nom",
9451
- Type: "Type",
9456
+ Type: "Tapez",
9452
9457
  type: "Type",
9453
9458
  Province: "Province",
9454
9459
  Territory: "Territoire",
@@ -11025,6 +11030,7 @@ const fr = {
11025
11030
  };
11026
11031
 
11027
11032
  const sp = {
11033
+ "All Data": "Todos los datos",
11028
11034
  "Site": "Sitio",
11029
11035
  "Production Sites": "Centros de producción",
11030
11036
  "Type of account": "Tipo de cuenta",
@@ -11259,7 +11265,7 @@ const sp = {
11259
11265
  "Documentation": "Documentos",
11260
11266
  "Edit project": "Modificar proyecto",
11261
11267
  "Name": "Nombre",
11262
- "Type": "Tipo",
11268
+ "Type": "Escribe",
11263
11269
  "type": "Tipo",
11264
11270
  "Province": "Provincia",
11265
11271
  "Territory": "Territorio",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.794",
3
+ "version": "0.6.795",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -11,6 +11,21 @@ import {
11
11
  import { useMapHelper } from "./helper";
12
12
  import { isLocation, isStakeholder } from "./ChainIcon/utils";
13
13
 
14
+ const calculatePolygonArea = (coordinates) => {
15
+ if (!coordinates || !Array.isArray(coordinates) || coordinates.length < 3) return 0;
16
+ let area = 0;
17
+ for (let i = 0; i < coordinates.length; i++) {
18
+ const j = (i + 1) % coordinates.length;
19
+ const lat1 = coordinates[i][0];
20
+ const lng1 = coordinates[i][1];
21
+ const lat2 = coordinates[j][0];
22
+ const lng2 = coordinates[j][1];
23
+ area += lat1 * lng2;
24
+ area -= lng1 * lat2;
25
+ }
26
+ return Math.abs(area / 2);
27
+ };
28
+
14
29
  export const useMap = ({
15
30
  type,
16
31
  data: allData = null,
@@ -240,7 +255,16 @@ export const useMap = ({
240
255
  const maxTotal = Math.max(...(data || []).map((d) => d.total));
241
256
 
242
257
  const dataToRender = type === "chain" ? filteredData : data;
243
- dataToRender.forEach((d, i) => {
258
+
259
+ const sortedData = type === "territory"
260
+ ? [...dataToRender].sort((a, b) => {
261
+ const areaA = calculatePolygonArea(a.area);
262
+ const areaB = calculatePolygonArea(b.area);
263
+ return areaB - areaA;
264
+ })
265
+ : dataToRender;
266
+
267
+ sortedData.forEach((d, i) => {
244
268
  addIconToMapInitialy(
245
269
  [d?.marker?.lat, d?.marker?.lng],
246
270
  "location",
@@ -10,6 +10,7 @@ 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
+
13
14
  useEffect(() => {
14
15
  if (container.current) {
15
16
  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
- console.log("topcontributorshhhh", data);
11
+
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
- console.log("mainData", mainData);
15
+
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
- console.log("usergrowthhhhh", data);
12
+
13
13
 
14
14
  useEffect(() => {
15
15
  if (typeof fetchUserGrowth === "function") {
@@ -24,6 +24,7 @@ export default function AddUserModal({ isOpen, defaultData = {}, userRoles = [],
24
24
  .catch(() => {});
25
25
  };
26
26
 
27
+ console.log("hellooooooooooooooooooooooooo");
27
28
 
28
29
  return (
29
30
  <Modal
@@ -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("location"),
50
+ show: entity.includes("locations"),
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("location"),
66
+ show: entity.includes("locations"),
67
67
  render: (value, all) => {
68
68
  let label;
69
69
  if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
@@ -1,10 +1,11 @@
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";
4
5
  import DAFTable from "../../../../Table/index.jsx";
5
6
  import { useMemo, useState } from "react";
6
- import { getNameByLevel } from "../../AdminTables/SubjectsTable/helper.js";
7
7
  import { getColumns } from "./helper.js";
8
+ import { getNameByLevel } from "../../AdminTables/SubjectsTable/helper.js";
8
9
 
9
10
  const { useToken } = theme;
10
11
 
@@ -34,22 +35,10 @@ export default function CombineLocationModal({
34
35
 
35
36
  const onSubmit = () => {
36
37
  MainForm.validateFields().then((data) => {
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
-
38
+ const ids = selectedLocations.map((location) => location._id);
50
39
  onSuccess({
51
40
  ids,
52
- data: filteredData,
41
+ data,
53
42
  });
54
43
  });
55
44
  };
@@ -68,7 +57,8 @@ export default function CombineLocationModal({
68
57
  setIsDisabled(() => {
69
58
  const values = MainForm.getFieldsValue();
70
59
 
71
- const requiredFields = entity?.includes("location")
60
+ const requiredFields =
61
+ entity === "location"
72
62
  ? ["id", "name", "category", "country", "administrativeLevel1", "administrativeLevel2"]
73
63
  : ["id", "name", "category", "country"];
74
64
 
@@ -124,7 +114,7 @@ export default function CombineLocationModal({
124
114
  options={selectedLocations.map((location) => {
125
115
  return {
126
116
  label: location?.datastakeId || "-",
127
- value: location?.id || "-",
117
+ value: location?.datastakeId || "-",
128
118
  };
129
119
  })}
130
120
  placeholder={t("ID")}
@@ -179,7 +169,7 @@ export default function CombineLocationModal({
179
169
  ></Select>
180
170
  </Form.Item>
181
171
 
182
- {entity?.includes("location") && (
172
+ {entity.includes("locations") && (
183
173
  <>
184
174
  <Form.Item className="flex-1" name="administrativeLevel1">
185
175
  <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("merge")}
50
+ title={t("admin::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.includes("location")
62
+ entity === "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("current_subjects")}
78
+ {t("admin::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("merged_output")}
96
+ {t("admin::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("location") && (
138
+ {entity.includes("locations") && (
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 ? "edit-account" : "add-account")}
50
+ title={t(isEdit ? "admin::edit-account" : "admin::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
- console.log("safeUserGrowth", safeUserGrowth);
42
+
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({ subject: 'location', ...mergeData });
51
+ await AdminService.mergeLocations(mergeData);
52
52
  message.success(t("Locations merged successfully"));
53
53
  } else {
54
54
  console.warn("AdminService.mergeLocations is not implemented");
55
- message.error(t("Locations not merged"));
55
+ message.success(t("Locations merged successfully"));
56
56
  }
57
57
  } catch (err) {
58
58
  handleError?.(err);
@@ -61,11 +61,12 @@ export default function AdminLocationScreen({ config }) {
61
61
  [AdminService, t, handleError]
62
62
  );
63
63
 
64
- const getSubjects = useCallback((params) => {
64
+ // Use custom getData if provided, otherwise use default AdminService.getLocations
65
+ const getLocations = useCallback((params) => {
65
66
  if (getData) {
66
67
  return getData(params);
67
68
  }
68
- return AdminService.getSubjects({ subject: 'location', params });
69
+ return AdminService.getLocations(params);
69
70
  }, [getData, AdminService]);
70
71
 
71
72
  return (
@@ -76,12 +77,12 @@ export default function AdminLocationScreen({ config }) {
76
77
  location={location}
77
78
  module={module}
78
79
  headerTitle={headerTitle}
79
- getData={getSubjects}
80
+ getData={getLocations}
80
81
  isMobile={isMobile}
81
82
  defaultPageSize={defaultPageSize}
82
83
  view={view}
83
84
  breadcrumbs={breadcrumbs}
84
- mergeLocationsFunction={handleMergeLocations}
85
+ mergeSubjectsFunction={handleMergeLocations}
85
86
  refetchTrigger={refetchTrigger}
86
87
  config={{
87
88
  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({ subject: 'stakeholder', ...mergeData });
51
+ await AdminService.mergeSubjects(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({ subject: 'stakeholder', params });
69
+ return AdminService.getSubjects(params);
70
70
  }, [getData, AdminService]);
71
71
 
72
72
  return (
@@ -10,4 +10,3 @@ export { default as AdminAccountsScreen } from "./Accounts.jsx";
10
10
  export { default as AdminAccountsViewScreen } from "./AccountsView.jsx";
11
11
  export { default as AdminSubjectsScreen } from "./Subjects.jsx";
12
12
  export { default as AdminLocationScreen } from "./Location.jsx";
13
- export { default as AdminSubjectsViewScreen } from "./SubjectsView.jsx";
@@ -60,7 +60,6 @@ export default function AccountTable({
60
60
  filtersConfig,
61
61
  getRedirectLink,
62
62
  getData,
63
- fetchPendingOnMount: true,
64
63
  });
65
64
 
66
65
  const selectOptions = useMemo(() => {