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
@@ -69,18 +69,90 @@ class AdminService extends BaseService {
69
69
  }
70
70
 
71
71
  getSubjects({ subject, params }) {
72
- return this.apiGet({
73
- url: `${subject}`,
72
+ return this.apiGet({
73
+ url: `/management/subjects/${subject}`,
74
74
  params,
75
- })
75
+ });
76
76
  }
77
77
 
78
- mergeSubjects({ subject, ...data }) {
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
+ });
99
+ }
100
+
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
+
79
121
  return this.apiPost({
80
- url: `/merge/${subject}`,
81
- data,
82
- })
122
+ url,
123
+ data: payload,
124
+ });
83
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
+ });
153
+ }
154
+
155
+
84
156
  }
85
157
 
86
158
  export default createLazyService(AdminService);
@@ -26,4 +26,5 @@ class DashboardService extends BaseService {
26
26
  }
27
27
  }
28
28
 
29
- export default createLazyService(DashboardService);
29
+ export default createLazyService(DashboardService);
30
+
@@ -63,19 +63,29 @@ export const getDefaultActiveFilters = (
63
63
  };
64
64
 
65
65
  const NEW_PAGINATION_APPS = ["nashiriki"];
66
+
66
67
  export const filterParams = (value, module) => {
67
68
  const { activeFilters, ...rest } = value;
68
69
 
69
- const { page, pageSize, sortDir, sortBy, search, searchParams, ...filters } =
70
- activeFilters || {};
70
+ const {
71
+ page = 1,
72
+ pageSize = 20,
73
+ sortDir,
74
+ sortBy,
75
+ search,
76
+ searchParams,
77
+ ...filters
78
+ } = activeFilters || {};
71
79
 
72
80
  const params = {};
73
-
81
+
74
82
  params.pagination = JSON.stringify({
75
- [NEW_PAGINATION_APPS.includes(module) ? "skip" : "page"]: page,
76
- [NEW_PAGINATION_APPS.includes(module) ? "take" : "pageSize"]: pageSize,
83
+ page,
84
+ pageSize,
77
85
  });
78
86
 
87
+ params.filters = JSON.stringify(filters);
88
+
79
89
  if (search && searchParams) {
80
90
  params.search = JSON.stringify({
81
91
  qs: search,
@@ -90,13 +100,5 @@ export const filterParams = (value, module) => {
90
100
  });
91
101
  }
92
102
 
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
-
101
103
  return { ...rest, ...params };
102
104
  };
@@ -1,4 +1,11 @@
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
9
  "Site": "Site",
3
10
  "Production Sites": "Production Sites",
4
11
  "Type of account": "Type of account",
@@ -420,7 +420,7 @@ const fr = {
420
420
  Documentation: "Documents",
421
421
  "Edit project": "Modifier le projet",
422
422
  Name: "Nom",
423
- Type: "Tapez",
423
+ Type: "Type",
424
424
  type: "Type",
425
425
  Province: "Province",
426
426
  Territory: "Territoire",
@@ -233,7 +233,7 @@ const sp = {
233
233
  "Documentation": "Documentos",
234
234
  "Edit project": "Modificar proyecto",
235
235
  "Name": "Nombre",
236
- "Type": "Escribe",
236
+ "Type": "Tipo",
237
237
  "type": "Tipo",
238
238
  "Province": "Provincia",
239
239
  "Territory": "Territorio",
package/src/index.js CHANGED
@@ -97,6 +97,7 @@ export { default as ProgressBar } from "./@daf/core/components/ProgressBar/index
97
97
  export { default as MultiBarProgress } from "./@daf/core/components/ProgressBar/MultiBarProgress/index.jsx";
98
98
  export { default as MultiColorProgressBar } from "./@daf/core/components/ProgressBar/MultiColorProgressBar/index.jsx";
99
99
  export { default as ProgressBarSideIcon } from "./@daf/core/components/ProgressBar/components/SideIcon/index.jsx";
100
+ export { default as ProgressBarWithIcon } from "./@daf/core/components/ProgressBar/ProgressBarWithIcon/index.jsx";
100
101
  export { default as ProgressTabs } from "./@daf/core/components/ProgressTabs/index.jsx";
101
102
 
102
103
  // Data Store
package/src/pages.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Dashboards
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
+ export { default as SelfAssesment } from './@daf/pages/Dashboards/SelfAssesment/index.jsx';
4
5
  export { default as OperatorsTable } from './@daf/pages/Stakeholders/Operators/index.jsx';
5
6
  export { default as LocationsTable } from './@daf/pages/Locations/index.jsx';
6
7
  export { default as StakeholdersTable } from './@daf/pages/Stakeholders/index.jsx';
package/build/favicon.ico DELETED
Binary file
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow: