datastake-daf 0.6.811 → 0.6.813
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 +1509 -379
- package/dist/hooks/index.js +11 -4
- package/dist/pages/index.js +138 -16
- package/dist/services/index.js +56 -6
- package/dist/utils/index.js +28 -5
- package/package.json +1 -1
- package/src/@daf/core/components/AuthForm/index.jsx +12 -3
- package/src/@daf/core/components/Dashboard/Widget/FaunaWidget/index.jsx +1 -2
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -3
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +51 -51
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +56 -31
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewUser/index.jsx +36 -10
- package/src/@daf/core/components/Screens/Admin/AdminModals/TransferRights/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Accounts.jsx +37 -10
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Documents.jsx +81 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Events.jsx +77 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +2 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/helper.js +22 -30
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +25 -13
- package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/column.js +127 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/helper.js +43 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/index.jsx +201 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/column.js +146 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/helper.js +58 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/index.jsx +176 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +17 -2
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +27 -13
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminTables/components/index.jsx +4 -2
- package/src/@daf/core/components/Screens/Admin/AdminTables/hook.js +3 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +12 -9
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +16 -4
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/View/helpers.js +9 -17
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +9 -8
- package/src/@daf/core/components/Screens/Admin/AppInvitation/index.jsx +124 -99
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +48 -1
- package/src/@daf/hooks/useAdminDashboard.js +7 -4
- package/src/@daf/pages/Summary/Activities/Monitoring/components/BiodiversityAndHabitat/index.jsx +2 -2
- package/src/@daf/pages/Summary/Activities/Monitoring/helper.js +24 -0
- package/src/@daf/pages/View/hooks/useViewActions.js +13 -0
- package/src/@daf/pages/View/hooks/useViewPermissions.js +16 -0
- package/src/@daf/pages/View/index.jsx +29 -4
- package/src/@daf/services/AdminService.js +47 -5
- package/src/@daf/services/DashboardService.js +3 -3
- package/src/@daf/utils/filters.js +13 -15
- package/src/constants/locales/en/translation.js +13 -0
- package/src/helpers/copyToClipboard.js +60 -0
- 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/style/datastake/mapbox-gl.css +0 -330
package/dist/hooks/index.js
CHANGED
|
@@ -2229,14 +2229,17 @@ class DashboardService extends BaseService {
|
|
|
2229
2229
|
isApp: true
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
2232
|
-
getUserGrowth(activeFilter) {
|
|
2233
|
-
|
|
2232
|
+
async getUserGrowth(activeFilter) {
|
|
2233
|
+
const {
|
|
2234
|
+
data
|
|
2235
|
+
} = await this.apiGet({
|
|
2234
2236
|
url: `/accounts/dashboard/user-growth`,
|
|
2235
2237
|
isUserManager: true,
|
|
2236
2238
|
params: {
|
|
2237
2239
|
activeFilter
|
|
2238
2240
|
}
|
|
2239
2241
|
});
|
|
2242
|
+
return data;
|
|
2240
2243
|
}
|
|
2241
2244
|
getAdminDashboard() {
|
|
2242
2245
|
return this.apiGet({
|
|
@@ -2338,14 +2341,18 @@ function useAdminDashboard({
|
|
|
2338
2341
|
setLoading(false);
|
|
2339
2342
|
}
|
|
2340
2343
|
}, [dashboardService, onError]);
|
|
2341
|
-
const fetchUserGrowth = React.useCallback(async
|
|
2344
|
+
const fetchUserGrowth = React.useCallback(async activeFilter => {
|
|
2342
2345
|
if (!dashboardService?.getUserGrowth) {
|
|
2343
2346
|
console.warn("dashboardService.getUserGrowth not provided");
|
|
2344
2347
|
return;
|
|
2345
2348
|
}
|
|
2349
|
+
if (activeFilter === undefined || activeFilter === null) {
|
|
2350
|
+
console.warn("activeFilter not provided to fetchUserGrowth");
|
|
2351
|
+
return;
|
|
2352
|
+
}
|
|
2346
2353
|
setUserGrowthDataLoading(true);
|
|
2347
2354
|
try {
|
|
2348
|
-
const response = await dashboardService.getUserGrowth(
|
|
2355
|
+
const response = await dashboardService.getUserGrowth(activeFilter);
|
|
2349
2356
|
setUserGrowthData(response || []);
|
|
2350
2357
|
} catch (err) {
|
|
2351
2358
|
if (onError) {
|
package/dist/pages/index.js
CHANGED
|
@@ -7297,6 +7297,9 @@ class ErrorService {
|
|
|
7297
7297
|
return e.join('\n');
|
|
7298
7298
|
}
|
|
7299
7299
|
}
|
|
7300
|
+
const handleError = err => {
|
|
7301
|
+
antd.message.error(err?.response?.data?.message);
|
|
7302
|
+
};
|
|
7300
7303
|
|
|
7301
7304
|
// In datastake-daf - src/services/BaseService.js
|
|
7302
7305
|
class BaseService extends BaseHTTPService {
|
|
@@ -7414,14 +7417,17 @@ class DashboardService extends BaseService {
|
|
|
7414
7417
|
isApp: true
|
|
7415
7418
|
});
|
|
7416
7419
|
}
|
|
7417
|
-
getUserGrowth(activeFilter) {
|
|
7418
|
-
|
|
7420
|
+
async getUserGrowth(activeFilter) {
|
|
7421
|
+
const {
|
|
7422
|
+
data
|
|
7423
|
+
} = await this.apiGet({
|
|
7419
7424
|
url: `/accounts/dashboard/user-growth`,
|
|
7420
7425
|
isUserManager: true,
|
|
7421
7426
|
params: {
|
|
7422
7427
|
activeFilter
|
|
7423
7428
|
}
|
|
7424
7429
|
});
|
|
7430
|
+
return data;
|
|
7425
7431
|
}
|
|
7426
7432
|
getAdminDashboard() {
|
|
7427
7433
|
return this.apiGet({
|
|
@@ -49119,8 +49125,6 @@ function FaunaWidget({
|
|
|
49119
49125
|
$itemWidth: itemWidth,
|
|
49120
49126
|
$itemHeight: itemHeight,
|
|
49121
49127
|
children: faunaConfig.map(item => {
|
|
49122
|
-
// Use colored SVG if the item's key exists in faunaPresent array
|
|
49123
|
-
// Otherwise use default SVG
|
|
49124
49128
|
const isPresent = Array.isArray(faunaPresent) && faunaPresent.includes(item.key);
|
|
49125
49129
|
const shouldUseColored = isPresent;
|
|
49126
49130
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
@@ -51696,6 +51700,20 @@ class AdminService extends BaseService {
|
|
|
51696
51700
|
data
|
|
51697
51701
|
});
|
|
51698
51702
|
}
|
|
51703
|
+
resendInvitation({
|
|
51704
|
+
invitationToken
|
|
51705
|
+
}) {
|
|
51706
|
+
return this.apiPost({
|
|
51707
|
+
url: `/accounts/resendInvitation/${invitationToken}`
|
|
51708
|
+
});
|
|
51709
|
+
}
|
|
51710
|
+
copyInvitation({
|
|
51711
|
+
invitationToken
|
|
51712
|
+
}) {
|
|
51713
|
+
return this.apiPost({
|
|
51714
|
+
url: `/accounts/copyInvitation/${invitationToken}`
|
|
51715
|
+
});
|
|
51716
|
+
}
|
|
51699
51717
|
inviteAccount(data) {
|
|
51700
51718
|
return this.apiPost({
|
|
51701
51719
|
url: `/accounts/inviteAccount`,
|
|
@@ -51712,8 +51730,15 @@ class AdminService extends BaseService {
|
|
|
51712
51730
|
}
|
|
51713
51731
|
updateAccount({
|
|
51714
51732
|
data,
|
|
51715
|
-
id
|
|
51733
|
+
id,
|
|
51734
|
+
isPending = false
|
|
51716
51735
|
}) {
|
|
51736
|
+
if (isPending) {
|
|
51737
|
+
return this.apiPut({
|
|
51738
|
+
data,
|
|
51739
|
+
url: `/accounts/invitation/${id}`
|
|
51740
|
+
});
|
|
51741
|
+
}
|
|
51717
51742
|
return this.apiPut({
|
|
51718
51743
|
data,
|
|
51719
51744
|
url: `/accounts/${id}`
|
|
@@ -51828,6 +51853,21 @@ class AdminService extends BaseService {
|
|
|
51828
51853
|
url: `/management/subject/${subject}/${id}`
|
|
51829
51854
|
});
|
|
51830
51855
|
}
|
|
51856
|
+
getItems({
|
|
51857
|
+
item
|
|
51858
|
+
}) {
|
|
51859
|
+
return this.apiGet({
|
|
51860
|
+
url: `/management/items/${item}`
|
|
51861
|
+
});
|
|
51862
|
+
}
|
|
51863
|
+
getItemData({
|
|
51864
|
+
item,
|
|
51865
|
+
id
|
|
51866
|
+
}) {
|
|
51867
|
+
return this.apiGet({
|
|
51868
|
+
url: `/management/item/${item}/${id}`
|
|
51869
|
+
});
|
|
51870
|
+
}
|
|
51831
51871
|
viewLocation({
|
|
51832
51872
|
id
|
|
51833
51873
|
}) {
|
|
@@ -51850,7 +51890,7 @@ class AdminService extends BaseService {
|
|
|
51850
51890
|
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
51851
51891
|
return this.apiPut({
|
|
51852
51892
|
url: `/management/subject/${type}/${id}`,
|
|
51853
|
-
data:
|
|
51893
|
+
data: data
|
|
51854
51894
|
});
|
|
51855
51895
|
}
|
|
51856
51896
|
deleteSubject({
|
|
@@ -51862,17 +51902,28 @@ class AdminService extends BaseService {
|
|
|
51862
51902
|
url: `/management/subject/${type}/${id}`
|
|
51863
51903
|
});
|
|
51864
51904
|
}
|
|
51865
|
-
getUserGrowth(activeFilter) {
|
|
51866
|
-
|
|
51905
|
+
async getUserGrowth(activeFilter) {
|
|
51906
|
+
const {
|
|
51907
|
+
data
|
|
51908
|
+
} = await this.apiGet({
|
|
51867
51909
|
url: `/accounts/dashboard/user-growth`,
|
|
51868
51910
|
isUserManager: true,
|
|
51869
51911
|
params: {
|
|
51870
51912
|
activeFilter
|
|
51871
51913
|
}
|
|
51872
51914
|
});
|
|
51915
|
+
return data;
|
|
51916
|
+
}
|
|
51917
|
+
removeUserFromAccount({
|
|
51918
|
+
accountId,
|
|
51919
|
+
userId
|
|
51920
|
+
}) {
|
|
51921
|
+
return this.apiPut({
|
|
51922
|
+
url: `/companies/${accountId}/remove-user/${userId}`
|
|
51923
|
+
});
|
|
51873
51924
|
}
|
|
51874
51925
|
}
|
|
51875
|
-
createLazyService(AdminService);
|
|
51926
|
+
var AdminService$1 = createLazyService(AdminService);
|
|
51876
51927
|
|
|
51877
51928
|
const Styles = styled__default["default"].div`
|
|
51878
51929
|
width: 100%;
|
|
@@ -58733,6 +58784,30 @@ const getMapDataFromActivity = (activityData, t) => {
|
|
|
58733
58784
|
});
|
|
58734
58785
|
}
|
|
58735
58786
|
|
|
58787
|
+
// Entry 4: Generic locationCheck marker (independent - show if it exists)
|
|
58788
|
+
const locationCheckLat = activityData?.locationCheck?.latitude;
|
|
58789
|
+
const locationCheckLng = activityData?.locationCheck?.longitude;
|
|
58790
|
+
if (isValidCoordinate(locationCheckLat) && isValidCoordinate(locationCheckLng)) {
|
|
58791
|
+
mapData.push({
|
|
58792
|
+
_id: {},
|
|
58793
|
+
id: `${activityData?.id || activityData?.datastakeId || 'locationcheck'}-locationcheck`,
|
|
58794
|
+
// Include area if it exists, so marker can show on top of polygon
|
|
58795
|
+
area: area && area.length >= 3 ? area : null,
|
|
58796
|
+
color: baseColor,
|
|
58797
|
+
gps: {
|
|
58798
|
+
latitude: typeof locationCheckLat === 'number' ? locationCheckLat : parseFloat(locationCheckLat),
|
|
58799
|
+
longitude: typeof locationCheckLng === 'number' ? locationCheckLng : parseFloat(locationCheckLng)
|
|
58800
|
+
},
|
|
58801
|
+
name: t("Location Check"),
|
|
58802
|
+
plotName: locationName,
|
|
58803
|
+
territoryTitle: t("Associated Plot"),
|
|
58804
|
+
datastakeId: `${datastakeId}-locationcheck`,
|
|
58805
|
+
markerColor: "#016C6E",
|
|
58806
|
+
sources: null,
|
|
58807
|
+
link: null
|
|
58808
|
+
});
|
|
58809
|
+
}
|
|
58810
|
+
|
|
58736
58811
|
// Return mapData even if empty - let the map component handle empty arrays
|
|
58737
58812
|
return mapData;
|
|
58738
58813
|
};
|
|
@@ -59188,8 +59263,8 @@ const BiodiversityAndHabitat = ({
|
|
|
59188
59263
|
title: t("Observed Fauna"),
|
|
59189
59264
|
faunaPresent: faunaPresent,
|
|
59190
59265
|
columnsPerRow: 5,
|
|
59191
|
-
itemWidth:
|
|
59192
|
-
itemHeight:
|
|
59266
|
+
itemWidth: 130,
|
|
59267
|
+
itemHeight: 130,
|
|
59193
59268
|
loading: loading,
|
|
59194
59269
|
t: t
|
|
59195
59270
|
})
|
|
@@ -60074,7 +60149,8 @@ const useViewPermissions = ({
|
|
|
60074
60149
|
id,
|
|
60075
60150
|
namespaceOverrides = {
|
|
60076
60151
|
supportedNamespaces: {},
|
|
60077
|
-
canEdit: {}
|
|
60152
|
+
canEdit: {},
|
|
60153
|
+
canDelete: {}
|
|
60078
60154
|
},
|
|
60079
60155
|
namespace,
|
|
60080
60156
|
user,
|
|
@@ -60085,6 +60161,9 @@ const useViewPermissions = ({
|
|
|
60085
60161
|
viewConfig
|
|
60086
60162
|
}) => {
|
|
60087
60163
|
const baseNamespaceKeys = Object.keys(namespaceConfig || {});
|
|
60164
|
+
console.log({
|
|
60165
|
+
namespaceConfig
|
|
60166
|
+
});
|
|
60088
60167
|
const baseSupportedNamespaces = baseNamespaceKeys?.reduce((acc, key) => {
|
|
60089
60168
|
acc[key] = () => true;
|
|
60090
60169
|
return acc;
|
|
@@ -60108,6 +60187,16 @@ const useViewPermissions = ({
|
|
|
60108
60187
|
};
|
|
60109
60188
|
return canEditAction[namespace] ? canEditAction[namespace]() : false;
|
|
60110
60189
|
}, [namespace, data, user]);
|
|
60190
|
+
const canDelete = React.useMemo(() => {
|
|
60191
|
+
baseNamespaceKeys.reduce((acc, key) => {
|
|
60192
|
+
acc[key] = () => isUserData();
|
|
60193
|
+
return acc;
|
|
60194
|
+
}, {});
|
|
60195
|
+
const canDeleteAction = {
|
|
60196
|
+
...namespaceOverrides.canDelete
|
|
60197
|
+
};
|
|
60198
|
+
return canDeleteAction[namespace] ? canDeleteAction[namespace]() : false;
|
|
60199
|
+
}, [namespace, data, user, namespaceOverrides]);
|
|
60111
60200
|
React.useEffect(() => {
|
|
60112
60201
|
if (data) {
|
|
60113
60202
|
if (typeof isSupportedNamespaces[namespace] === "function") {
|
|
@@ -60120,7 +60209,8 @@ const useViewPermissions = ({
|
|
|
60120
60209
|
return {
|
|
60121
60210
|
isSupportedNamespaces,
|
|
60122
60211
|
canEdit,
|
|
60123
|
-
isSupported
|
|
60212
|
+
isSupported,
|
|
60213
|
+
canDelete
|
|
60124
60214
|
};
|
|
60125
60215
|
};
|
|
60126
60216
|
|
|
@@ -60239,7 +60329,9 @@ const useViewActions = ({
|
|
|
60239
60329
|
getRedirectLink,
|
|
60240
60330
|
t,
|
|
60241
60331
|
viewConfig,
|
|
60242
|
-
buttonActions
|
|
60332
|
+
buttonActions,
|
|
60333
|
+
canDelete,
|
|
60334
|
+
deleteSubject
|
|
60243
60335
|
}) => {
|
|
60244
60336
|
const [pageActions, setPageActions] = React.useState([]);
|
|
60245
60337
|
const [extraPageActions, setExtraPageActions] = React.useState([]);
|
|
@@ -60270,9 +60362,19 @@ const useViewActions = ({
|
|
|
60270
60362
|
}
|
|
60271
60363
|
}
|
|
60272
60364
|
}
|
|
60365
|
+
if (canDelete) {
|
|
60366
|
+
if (viewConfig.deleteNamespaces.includes(namespace)) {
|
|
60367
|
+
actions.push(buttonActions.createDeleteButton(t, deleteSubject));
|
|
60368
|
+
}
|
|
60369
|
+
}
|
|
60273
60370
|
if (viewConfig.summaryNamespaces.includes(namespace)) {
|
|
60274
60371
|
extraActions.push(buttonActions.createSummaryButton(t, namespace, data, push, getRedirectLink));
|
|
60275
60372
|
extraActions.push(buttonActions.createRecordsButton(t, setOpenRecordsModal));
|
|
60373
|
+
if (canDelete) {
|
|
60374
|
+
if (viewConfig.deleteNamespaces.includes(namespace)) {
|
|
60375
|
+
extraActions.push(buttonActions.createDeleteButton(t, deleteSubject));
|
|
60376
|
+
}
|
|
60377
|
+
}
|
|
60276
60378
|
}
|
|
60277
60379
|
setPageActions(actions);
|
|
60278
60380
|
setExtraPageActions(extraActions);
|
|
@@ -60786,7 +60888,8 @@ const View = ({
|
|
|
60786
60888
|
});
|
|
60787
60889
|
const {
|
|
60788
60890
|
canEdit,
|
|
60789
|
-
isSupported
|
|
60891
|
+
isSupported,
|
|
60892
|
+
canDelete
|
|
60790
60893
|
} = useViewPermissions({
|
|
60791
60894
|
data,
|
|
60792
60895
|
id,
|
|
@@ -60819,6 +60922,23 @@ const View = ({
|
|
|
60819
60922
|
data,
|
|
60820
60923
|
serviceMap
|
|
60821
60924
|
});
|
|
60925
|
+
const subjects = {
|
|
60926
|
+
"management-location": "location",
|
|
60927
|
+
"management-stakeholder": "stakeholder"
|
|
60928
|
+
};
|
|
60929
|
+
const handleDeleteSubject = React.useCallback(async () => {
|
|
60930
|
+
try {
|
|
60931
|
+
await AdminService$1.deleteSubject({
|
|
60932
|
+
subject: subjects[namespace],
|
|
60933
|
+
id: id
|
|
60934
|
+
});
|
|
60935
|
+
antd.message.success(t("Subject deleted successfully"));
|
|
60936
|
+
goTo(getRedirectLink(`/app/management/subject/${subjects[namespace]}`));
|
|
60937
|
+
} catch (error) {
|
|
60938
|
+
handleError(error);
|
|
60939
|
+
antd.message.error(t("Failed to delete subject"));
|
|
60940
|
+
}
|
|
60941
|
+
}, [namespace, id, t]);
|
|
60822
60942
|
const {
|
|
60823
60943
|
pageActions,
|
|
60824
60944
|
extraPageActions
|
|
@@ -60838,7 +60958,9 @@ const View = ({
|
|
|
60838
60958
|
getRedirectLink,
|
|
60839
60959
|
t,
|
|
60840
60960
|
viewConfig,
|
|
60841
|
-
buttonActions
|
|
60961
|
+
buttonActions,
|
|
60962
|
+
canDelete,
|
|
60963
|
+
deleteSubject: handleDeleteSubject
|
|
60842
60964
|
});
|
|
60843
60965
|
React.useEffect(() => {
|
|
60844
60966
|
if (namespace && id && namespaceConfig && typeof getSubjectsDetails === 'function') {
|
package/dist/services/index.js
CHANGED
|
@@ -780,6 +780,20 @@ class AdminService extends BaseService {
|
|
|
780
780
|
data
|
|
781
781
|
});
|
|
782
782
|
}
|
|
783
|
+
resendInvitation({
|
|
784
|
+
invitationToken
|
|
785
|
+
}) {
|
|
786
|
+
return this.apiPost({
|
|
787
|
+
url: `/accounts/resendInvitation/${invitationToken}`
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
copyInvitation({
|
|
791
|
+
invitationToken
|
|
792
|
+
}) {
|
|
793
|
+
return this.apiPost({
|
|
794
|
+
url: `/accounts/copyInvitation/${invitationToken}`
|
|
795
|
+
});
|
|
796
|
+
}
|
|
783
797
|
inviteAccount(data) {
|
|
784
798
|
return this.apiPost({
|
|
785
799
|
url: `/accounts/inviteAccount`,
|
|
@@ -796,8 +810,15 @@ class AdminService extends BaseService {
|
|
|
796
810
|
}
|
|
797
811
|
updateAccount({
|
|
798
812
|
data,
|
|
799
|
-
id
|
|
813
|
+
id,
|
|
814
|
+
isPending = false
|
|
800
815
|
}) {
|
|
816
|
+
if (isPending) {
|
|
817
|
+
return this.apiPut({
|
|
818
|
+
data,
|
|
819
|
+
url: `/accounts/invitation/${id}`
|
|
820
|
+
});
|
|
821
|
+
}
|
|
801
822
|
return this.apiPut({
|
|
802
823
|
data,
|
|
803
824
|
url: `/accounts/${id}`
|
|
@@ -912,6 +933,21 @@ class AdminService extends BaseService {
|
|
|
912
933
|
url: `/management/subject/${subject}/${id}`
|
|
913
934
|
});
|
|
914
935
|
}
|
|
936
|
+
getItems({
|
|
937
|
+
item
|
|
938
|
+
}) {
|
|
939
|
+
return this.apiGet({
|
|
940
|
+
url: `/management/items/${item}`
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
getItemData({
|
|
944
|
+
item,
|
|
945
|
+
id
|
|
946
|
+
}) {
|
|
947
|
+
return this.apiGet({
|
|
948
|
+
url: `/management/item/${item}/${id}`
|
|
949
|
+
});
|
|
950
|
+
}
|
|
915
951
|
viewLocation({
|
|
916
952
|
id
|
|
917
953
|
}) {
|
|
@@ -934,7 +970,7 @@ class AdminService extends BaseService {
|
|
|
934
970
|
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
935
971
|
return this.apiPut({
|
|
936
972
|
url: `/management/subject/${type}/${id}`,
|
|
937
|
-
data:
|
|
973
|
+
data: data
|
|
938
974
|
});
|
|
939
975
|
}
|
|
940
976
|
deleteSubject({
|
|
@@ -946,14 +982,25 @@ class AdminService extends BaseService {
|
|
|
946
982
|
url: `/management/subject/${type}/${id}`
|
|
947
983
|
});
|
|
948
984
|
}
|
|
949
|
-
getUserGrowth(activeFilter) {
|
|
950
|
-
|
|
985
|
+
async getUserGrowth(activeFilter) {
|
|
986
|
+
const {
|
|
987
|
+
data
|
|
988
|
+
} = await this.apiGet({
|
|
951
989
|
url: `/accounts/dashboard/user-growth`,
|
|
952
990
|
isUserManager: true,
|
|
953
991
|
params: {
|
|
954
992
|
activeFilter
|
|
955
993
|
}
|
|
956
994
|
});
|
|
995
|
+
return data;
|
|
996
|
+
}
|
|
997
|
+
removeUserFromAccount({
|
|
998
|
+
accountId,
|
|
999
|
+
userId
|
|
1000
|
+
}) {
|
|
1001
|
+
return this.apiPut({
|
|
1002
|
+
url: `/companies/${accountId}/remove-user/${userId}`
|
|
1003
|
+
});
|
|
957
1004
|
}
|
|
958
1005
|
}
|
|
959
1006
|
var AdminService$1 = createLazyService(AdminService);
|
|
@@ -1405,14 +1452,17 @@ class DashboardService extends BaseService {
|
|
|
1405
1452
|
isApp: true
|
|
1406
1453
|
});
|
|
1407
1454
|
}
|
|
1408
|
-
getUserGrowth(activeFilter) {
|
|
1409
|
-
|
|
1455
|
+
async getUserGrowth(activeFilter) {
|
|
1456
|
+
const {
|
|
1457
|
+
data
|
|
1458
|
+
} = await this.apiGet({
|
|
1410
1459
|
url: `/accounts/dashboard/user-growth`,
|
|
1411
1460
|
isUserManager: true,
|
|
1412
1461
|
params: {
|
|
1413
1462
|
activeFilter
|
|
1414
1463
|
}
|
|
1415
1464
|
});
|
|
1465
|
+
return data;
|
|
1416
1466
|
}
|
|
1417
1467
|
getAdminDashboard() {
|
|
1418
1468
|
return this.apiGet({
|
package/dist/utils/index.js
CHANGED
|
@@ -7578,14 +7578,15 @@ const getDefaultActiveFilters = (params, selectFiltersConfig, defaultPageSize, d
|
|
|
7578
7578
|
});
|
|
7579
7579
|
return o;
|
|
7580
7580
|
};
|
|
7581
|
+
const NEW_PAGINATION_APPS = ["nashiriki"];
|
|
7581
7582
|
const filterParams = (value, module) => {
|
|
7582
7583
|
const {
|
|
7583
7584
|
activeFilters,
|
|
7584
7585
|
...rest
|
|
7585
7586
|
} = value;
|
|
7586
7587
|
const {
|
|
7587
|
-
page
|
|
7588
|
-
pageSize
|
|
7588
|
+
page,
|
|
7589
|
+
pageSize,
|
|
7589
7590
|
sortDir,
|
|
7590
7591
|
sortBy,
|
|
7591
7592
|
search,
|
|
@@ -7594,10 +7595,9 @@ const filterParams = (value, module) => {
|
|
|
7594
7595
|
} = activeFilters || {};
|
|
7595
7596
|
const params = {};
|
|
7596
7597
|
params.pagination = JSON.stringify({
|
|
7597
|
-
page,
|
|
7598
|
-
pageSize
|
|
7598
|
+
[NEW_PAGINATION_APPS.includes(module) ? "skip" : "page"]: page,
|
|
7599
|
+
[NEW_PAGINATION_APPS.includes(module) ? "take" : "pageSize"]: pageSize
|
|
7599
7600
|
});
|
|
7600
|
-
params.filters = JSON.stringify(filters);
|
|
7601
7601
|
if (search && searchParams) {
|
|
7602
7602
|
params.search = JSON.stringify({
|
|
7603
7603
|
qs: search,
|
|
@@ -7610,6 +7610,16 @@ const filterParams = (value, module) => {
|
|
|
7610
7610
|
by: sortBy
|
|
7611
7611
|
});
|
|
7612
7612
|
}
|
|
7613
|
+
if (Object.keys(filters).length) {
|
|
7614
|
+
if (value.sourceId && value.sourceId === "overview") {
|
|
7615
|
+
params.filters = JSON.stringify(filters);
|
|
7616
|
+
} else {
|
|
7617
|
+
params.filters = JSON.stringify({
|
|
7618
|
+
...filters,
|
|
7619
|
+
authorId: undefined
|
|
7620
|
+
});
|
|
7621
|
+
}
|
|
7622
|
+
}
|
|
7613
7623
|
return {
|
|
7614
7624
|
...rest,
|
|
7615
7625
|
...params
|
|
@@ -7814,6 +7824,19 @@ function getRedirectPath(user, fallback = '', app, isDatastake) {
|
|
|
7814
7824
|
}
|
|
7815
7825
|
|
|
7816
7826
|
const en = {
|
|
7827
|
+
"admin::events": "Events",
|
|
7828
|
+
"admin::document": "Documents",
|
|
7829
|
+
"events": "Events",
|
|
7830
|
+
"merge-locations": "Merge Locations",
|
|
7831
|
+
"edit-account": "Edit Account",
|
|
7832
|
+
"Are-you-sure-you-want-to-remove-the-user-from-this-account?": "Are you sure you want to remove the user from this account?",
|
|
7833
|
+
"The-user-will-lose-access-to-the-application-and-to-all-data-created-for-this-account.": "The user will lose access to the application and to all data created for this account.",
|
|
7834
|
+
"merge": "Merge",
|
|
7835
|
+
"Are-you-sure-you-want-to-suspend-this-account?": "Are you sure you want to suspend this account?",
|
|
7836
|
+
"Associated-users-will-lose-access-to-the-application-and-to-all-data-created-for-this-account.": "Associated users will lose access to the application and to all data created for this account.",
|
|
7837
|
+
"current_subjects": "Current Subjects",
|
|
7838
|
+
"merged_output": "Merged Output",
|
|
7839
|
+
"merge-subjects": "Merge Subjects",
|
|
7817
7840
|
"All Data": "All Data",
|
|
7818
7841
|
"sbg-admin::remove-user-title": "Remove User Title",
|
|
7819
7842
|
"sbg-admin::remove-user-body": "Remove User Body",
|
package/package.json
CHANGED
|
@@ -13,13 +13,20 @@ function AuthForm ({
|
|
|
13
13
|
errors,
|
|
14
14
|
t = (key) => key,
|
|
15
15
|
executeRecaptcha = () => {},
|
|
16
|
-
getCurrentStep = () => {}
|
|
16
|
+
getCurrentStep = () => {},
|
|
17
|
+
theme,
|
|
17
18
|
}){
|
|
18
19
|
const [formInstance] = Form.useForm(form);
|
|
19
20
|
const [currentStep, setCurrentStep] = useState(0);
|
|
20
21
|
const [allFormValues, setAllFormValues] = useState(initialValues);
|
|
21
22
|
const [formErrors, setFormErrors] = useState(null);
|
|
22
23
|
|
|
24
|
+
const buttonStyle = theme?.colorPrimary ? {
|
|
25
|
+
backgroundColor: theme.colorPrimary,
|
|
26
|
+
borderColor: theme.colorPrimary,
|
|
27
|
+
} : {};
|
|
28
|
+
|
|
29
|
+
|
|
23
30
|
const isMultiStep = !!steps;
|
|
24
31
|
const currentFields = isMultiStep ? steps?.[currentStep]?.fields : fields || [];
|
|
25
32
|
|
|
@@ -166,6 +173,7 @@ function AuthForm ({
|
|
|
166
173
|
name: field.name,
|
|
167
174
|
label: field.label,
|
|
168
175
|
rules: field.rules,
|
|
176
|
+
dependencies: field.dependencies,
|
|
169
177
|
style: { marginBottom: 0 }
|
|
170
178
|
};
|
|
171
179
|
if (field.valuePropName && field.type !== 'select') {
|
|
@@ -217,6 +225,7 @@ function AuthForm ({
|
|
|
217
225
|
htmlType="submit"
|
|
218
226
|
disabled={isLastStep && !allFieldsFilled}
|
|
219
227
|
block className="normal-br"
|
|
228
|
+
style={buttonStyle}
|
|
220
229
|
>
|
|
221
230
|
{isLastStep ? submitText : t("Next")}
|
|
222
231
|
</BorderedButton>
|
|
@@ -225,14 +234,14 @@ function AuthForm ({
|
|
|
225
234
|
}}
|
|
226
235
|
</Form.Item>
|
|
227
236
|
<div className="buttons" style={{ marginTop: 0}}>
|
|
228
|
-
<BorderedButton onClick={prev} block className="normal-br">
|
|
237
|
+
<BorderedButton onClick={prev} block className="normal-br" style={buttonStyle}>
|
|
229
238
|
{t("Back")}
|
|
230
239
|
</BorderedButton>
|
|
231
240
|
</div>
|
|
232
241
|
</div>
|
|
233
242
|
) : (
|
|
234
243
|
<div className="buttons" style={{ marginTop: isMultiStep ? '16px' : 0}}>
|
|
235
|
-
<BorderedButton type="primary" htmlType="submit" block className="normal-br">
|
|
244
|
+
<BorderedButton type="primary" htmlType="submit" block className="normal-br" style={buttonStyle}>
|
|
236
245
|
{isMultiStep ? t("Next") : submitText}
|
|
237
246
|
</BorderedButton>
|
|
238
247
|
</div>
|
|
@@ -29,8 +29,7 @@ export default function FaunaWidget({
|
|
|
29
29
|
$itemHeight={itemHeight}
|
|
30
30
|
>
|
|
31
31
|
{faunaConfig.map((item) => {
|
|
32
|
-
|
|
33
|
-
// Otherwise use default SVG
|
|
32
|
+
|
|
34
33
|
const isPresent = Array.isArray(faunaPresent) && faunaPresent.includes(item.key);
|
|
35
34
|
const shouldUseColored = isPresent;
|
|
36
35
|
|
|
@@ -12,7 +12,6 @@ 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);
|
|
16
15
|
const fetchData = () => {
|
|
17
16
|
const { dates = [] } = mainData;
|
|
18
17
|
const _data = [];
|
|
@@ -9,13 +9,11 @@ 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);
|
|
13
|
-
|
|
14
12
|
useEffect(() => {
|
|
15
13
|
if (typeof fetchUserGrowth === "function") {
|
|
16
14
|
fetchUserGrowth(selectValue);
|
|
17
15
|
}
|
|
18
|
-
}, [selectValue]);
|
|
16
|
+
}, [selectValue, fetchUserGrowth]);
|
|
19
17
|
|
|
20
18
|
return (
|
|
21
19
|
<Widget
|