datastake-daf 0.6.798 → 0.6.800
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 +1206 -311
- package/dist/context/index.js +6 -6
- package/dist/pages/index.js +250 -14
- package/dist/services/index.js +187 -84
- 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/AdminModals/NewUser/index.jsx +61 -38
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Accounts.jsx +1 -4
- package/src/@daf/core/components/Screens/Admin/AdminScreens/AccountsView.jsx +2 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +10 -8
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +5 -3
- package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +395 -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 +225 -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 +78 -46
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +41 -39
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +53 -24
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/configTransformer.js +137 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.js +9 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +196 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/configTransformer.js +216 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.js +7 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +184 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +64 -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 +51 -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 +7 -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 +16 -10
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/View/index.jsx +2 -1
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +66 -26
- package/src/@daf/core/components/Screens/Admin/AppInvitation/index.jsx +193 -0
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +37 -2
- package/src/@daf/layouts/AppLayout/index.jsx +0 -1
- package/src/@daf/pages/Edit/hooks/usePrepareForm.js +1 -1
- 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/pages/View/hooks/usePrepareForm.js +11 -1
- package/src/@daf/pages/View/index.jsx +9 -2
- package/src/@daf/services/AdminService.js +112 -7
- package/src/@daf/services/AuthenticationService.js +1 -0
- 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/src/index.js +1 -0
package/dist/context/index.js
CHANGED
|
@@ -385,7 +385,7 @@ const assignParamsToUrl = (path, params) => {
|
|
|
385
385
|
* @returns storage objects
|
|
386
386
|
* @class StorageManager
|
|
387
387
|
*/
|
|
388
|
-
class StorageManager
|
|
388
|
+
class StorageManager {
|
|
389
389
|
/**
|
|
390
390
|
* @description Set or update given value in localStorage
|
|
391
391
|
* @static
|
|
@@ -520,11 +520,11 @@ class StorageManager$1 {
|
|
|
520
520
|
const isProxy = () => {
|
|
521
521
|
const pathname = window.location.pathname;
|
|
522
522
|
if (pathname.includes('/proxy/pme') || pathname.includes('/proxy/cadd')) {
|
|
523
|
-
return window.opener || !!StorageManager
|
|
523
|
+
return window.opener || !!StorageManager.get('proxy_token');
|
|
524
524
|
}
|
|
525
525
|
return false;
|
|
526
526
|
};
|
|
527
|
-
const getToken = () => isProxy() ? StorageManager
|
|
527
|
+
const getToken = () => isProxy() ? StorageManager.get('proxy_token') : StorageManager.get('token');
|
|
528
528
|
|
|
529
529
|
/**
|
|
530
530
|
* Custom params serializer to maintain JSON format for nested objects
|
|
@@ -870,7 +870,7 @@ class ErrorService {
|
|
|
870
870
|
class BaseService extends BaseHTTPService {
|
|
871
871
|
constructor() {
|
|
872
872
|
const errorHandler = createErrorHandler({
|
|
873
|
-
getStorageManager: () => StorageManager
|
|
873
|
+
getStorageManager: () => StorageManager,
|
|
874
874
|
handleError: ({
|
|
875
875
|
status,
|
|
876
876
|
statusText,
|
|
@@ -890,7 +890,7 @@ class BaseService extends BaseHTTPService {
|
|
|
890
890
|
onUnauthorized: () => {
|
|
891
891
|
console.warn('[BaseService] 401 Unauthorized - Token cleared, redirecting to /');
|
|
892
892
|
console.trace('[BaseService] Unauthorized call stack:');
|
|
893
|
-
StorageManager
|
|
893
|
+
StorageManager.clearOne('token');
|
|
894
894
|
if (typeof window !== 'undefined') {
|
|
895
895
|
window.location.href = '/';
|
|
896
896
|
}
|
|
@@ -907,7 +907,7 @@ class BaseService extends BaseHTTPService {
|
|
|
907
907
|
getHeaders: () => {
|
|
908
908
|
const config = getServicesConfig();
|
|
909
909
|
return {
|
|
910
|
-
Language: StorageManager
|
|
910
|
+
Language: StorageManager.get('datastakeLng') || 'en',
|
|
911
911
|
'ngrok-skip-browser-warning': true,
|
|
912
912
|
Application: config.application
|
|
913
913
|
};
|
package/dist/pages/index.js
CHANGED
|
@@ -4965,7 +4965,7 @@ Timeframe.propTypes = {
|
|
|
4965
4965
|
* @returns storage objects
|
|
4966
4966
|
* @class StorageManager
|
|
4967
4967
|
*/
|
|
4968
|
-
class StorageManager
|
|
4968
|
+
class StorageManager {
|
|
4969
4969
|
/**
|
|
4970
4970
|
* @description Set or update given value in localStorage
|
|
4971
4971
|
* @static
|
|
@@ -5100,11 +5100,11 @@ class StorageManager$1 {
|
|
|
5100
5100
|
const isProxy = () => {
|
|
5101
5101
|
const pathname = window.location.pathname;
|
|
5102
5102
|
if (pathname.includes('/proxy/pme') || pathname.includes('/proxy/cadd')) {
|
|
5103
|
-
return window.opener || !!StorageManager
|
|
5103
|
+
return window.opener || !!StorageManager.get('proxy_token');
|
|
5104
5104
|
}
|
|
5105
5105
|
return false;
|
|
5106
5106
|
};
|
|
5107
|
-
const getToken = () => isProxy() ? StorageManager
|
|
5107
|
+
const getToken = () => isProxy() ? StorageManager.get('proxy_token') : StorageManager.get('token');
|
|
5108
5108
|
|
|
5109
5109
|
/**
|
|
5110
5110
|
* @function
|
|
@@ -7145,7 +7145,7 @@ class ErrorService {
|
|
|
7145
7145
|
class BaseService extends BaseHTTPService {
|
|
7146
7146
|
constructor() {
|
|
7147
7147
|
const errorHandler = createErrorHandler({
|
|
7148
|
-
getStorageManager: () => StorageManager
|
|
7148
|
+
getStorageManager: () => StorageManager,
|
|
7149
7149
|
handleError: ({
|
|
7150
7150
|
status,
|
|
7151
7151
|
statusText,
|
|
@@ -7165,7 +7165,7 @@ class BaseService extends BaseHTTPService {
|
|
|
7165
7165
|
onUnauthorized: () => {
|
|
7166
7166
|
console.warn('[BaseService] 401 Unauthorized - Token cleared, redirecting to /');
|
|
7167
7167
|
console.trace('[BaseService] Unauthorized call stack:');
|
|
7168
|
-
StorageManager
|
|
7168
|
+
StorageManager.clearOne('token');
|
|
7169
7169
|
if (typeof window !== 'undefined') {
|
|
7170
7170
|
window.location.href = '/';
|
|
7171
7171
|
}
|
|
@@ -7182,7 +7182,7 @@ class BaseService extends BaseHTTPService {
|
|
|
7182
7182
|
getHeaders: () => {
|
|
7183
7183
|
const config = getServicesConfig();
|
|
7184
7184
|
return {
|
|
7185
|
-
Language: StorageManager
|
|
7185
|
+
Language: StorageManager.get('datastakeLng') || 'en',
|
|
7186
7186
|
'ngrok-skip-browser-warning': true,
|
|
7187
7187
|
Application: config.application
|
|
7188
7188
|
};
|
|
@@ -17791,7 +17791,7 @@ const useFilters = ({
|
|
|
17791
17791
|
}
|
|
17792
17792
|
return all;
|
|
17793
17793
|
}, {});
|
|
17794
|
-
const filters = StorageManager
|
|
17794
|
+
const filters = StorageManager.saveFilters(module, view, {
|
|
17795
17795
|
...filteredFilters
|
|
17796
17796
|
});
|
|
17797
17797
|
if (!filters.pageSize) {
|
|
@@ -17881,7 +17881,7 @@ const useFilters = ({
|
|
|
17881
17881
|
if (isNaN(page.current)) {
|
|
17882
17882
|
page.current = 1;
|
|
17883
17883
|
}
|
|
17884
|
-
const filters = StorageManager
|
|
17884
|
+
const filters = StorageManager.saveFilters(module, view, {
|
|
17885
17885
|
page: page.current
|
|
17886
17886
|
}, true);
|
|
17887
17887
|
updateQuery(filters, page.current);
|
|
@@ -44287,7 +44287,7 @@ const useSummary = ({
|
|
|
44287
44287
|
label: item?.name,
|
|
44288
44288
|
value: item?.datastakeId
|
|
44289
44289
|
})) : [];
|
|
44290
|
-
const storedData = StorageManager
|
|
44290
|
+
const storedData = StorageManager.get(storageKey);
|
|
44291
44291
|
if (storedData) {
|
|
44292
44292
|
try {
|
|
44293
44293
|
const parsedStoredData = JSON.parse(storedData);
|
|
@@ -44308,7 +44308,7 @@ const useSummary = ({
|
|
|
44308
44308
|
if (isPdf) {
|
|
44309
44309
|
selectedValue = id;
|
|
44310
44310
|
} else {
|
|
44311
|
-
const storedData = StorageManager
|
|
44311
|
+
const storedData = StorageManager.get(storageKey);
|
|
44312
44312
|
if (storedData) {
|
|
44313
44313
|
try {
|
|
44314
44314
|
const parsedData = JSON.parse(storedData);
|
|
@@ -44339,7 +44339,7 @@ const useSummary = ({
|
|
|
44339
44339
|
label: selectedData.name,
|
|
44340
44340
|
value: selectedData.datastakeId
|
|
44341
44341
|
};
|
|
44342
|
-
StorageManager
|
|
44342
|
+
StorageManager.set(storageKey, JSON.stringify(saved));
|
|
44343
44343
|
}
|
|
44344
44344
|
}
|
|
44345
44345
|
}, [selectedItem, storageKey, data]);
|
|
@@ -50765,6 +50765,207 @@ styled__default["default"].div`
|
|
|
50765
50765
|
}
|
|
50766
50766
|
`;
|
|
50767
50767
|
|
|
50768
|
+
class AdminService extends BaseService {
|
|
50769
|
+
updateCompany(id, data) {
|
|
50770
|
+
return this.apiPut({
|
|
50771
|
+
url: `/companies/${id}`,
|
|
50772
|
+
data
|
|
50773
|
+
});
|
|
50774
|
+
}
|
|
50775
|
+
getAccount({
|
|
50776
|
+
id
|
|
50777
|
+
}) {
|
|
50778
|
+
return this.apiGet({
|
|
50779
|
+
url: `/accounts/${id}`
|
|
50780
|
+
});
|
|
50781
|
+
}
|
|
50782
|
+
inviteCompanyAccount({
|
|
50783
|
+
companyId,
|
|
50784
|
+
data
|
|
50785
|
+
}) {
|
|
50786
|
+
return this.apiPost({
|
|
50787
|
+
url: `/accounts/${companyId}/invite`,
|
|
50788
|
+
data
|
|
50789
|
+
});
|
|
50790
|
+
}
|
|
50791
|
+
inviteAccount(data) {
|
|
50792
|
+
return this.apiPost({
|
|
50793
|
+
url: `/accounts/inviteAccount`,
|
|
50794
|
+
data
|
|
50795
|
+
});
|
|
50796
|
+
}
|
|
50797
|
+
getAccounts({
|
|
50798
|
+
params
|
|
50799
|
+
}) {
|
|
50800
|
+
return this.apiGet({
|
|
50801
|
+
params,
|
|
50802
|
+
url: `/accounts`
|
|
50803
|
+
});
|
|
50804
|
+
}
|
|
50805
|
+
updateAccount({
|
|
50806
|
+
data,
|
|
50807
|
+
id
|
|
50808
|
+
}) {
|
|
50809
|
+
return this.apiPut({
|
|
50810
|
+
data,
|
|
50811
|
+
url: `/accounts/${id}`
|
|
50812
|
+
});
|
|
50813
|
+
}
|
|
50814
|
+
toggleAccountStatus({
|
|
50815
|
+
id
|
|
50816
|
+
}) {
|
|
50817
|
+
return this.apiPut({
|
|
50818
|
+
url: `/accounts/suspendActivate/${id}`
|
|
50819
|
+
});
|
|
50820
|
+
}
|
|
50821
|
+
transferAdmin({
|
|
50822
|
+
userId,
|
|
50823
|
+
id
|
|
50824
|
+
}) {
|
|
50825
|
+
return this.apiPut({
|
|
50826
|
+
url: `/accounts/transfer-rights/${id}`,
|
|
50827
|
+
data: {
|
|
50828
|
+
userId
|
|
50829
|
+
}
|
|
50830
|
+
});
|
|
50831
|
+
}
|
|
50832
|
+
getUsers({
|
|
50833
|
+
params
|
|
50834
|
+
}) {
|
|
50835
|
+
return this.apiGet({
|
|
50836
|
+
params,
|
|
50837
|
+
url: `/accounts/users`
|
|
50838
|
+
});
|
|
50839
|
+
}
|
|
50840
|
+
impersonate({
|
|
50841
|
+
id
|
|
50842
|
+
}) {
|
|
50843
|
+
return this.apiGet({
|
|
50844
|
+
url: `/accounts/impersonate/${id}`
|
|
50845
|
+
});
|
|
50846
|
+
}
|
|
50847
|
+
cancelInvitation({
|
|
50848
|
+
token
|
|
50849
|
+
}) {
|
|
50850
|
+
return this.apiPut({
|
|
50851
|
+
url: `/accounts/cancelInvitation/${token}`
|
|
50852
|
+
});
|
|
50853
|
+
}
|
|
50854
|
+
getSubjects({
|
|
50855
|
+
subject,
|
|
50856
|
+
params
|
|
50857
|
+
}) {
|
|
50858
|
+
return this.apiGet({
|
|
50859
|
+
url: `/management/subjects/${subject}`,
|
|
50860
|
+
params
|
|
50861
|
+
});
|
|
50862
|
+
}
|
|
50863
|
+
mergeLocations({
|
|
50864
|
+
ids,
|
|
50865
|
+
data
|
|
50866
|
+
}) {
|
|
50867
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
50868
|
+
if (!id1 || !id2) {
|
|
50869
|
+
throw new Error('At least two IDs are required for merging');
|
|
50870
|
+
}
|
|
50871
|
+
const url = `/management/merge/location/${id1}/${id2}`;
|
|
50872
|
+
const payload = {
|
|
50873
|
+
...data
|
|
50874
|
+
};
|
|
50875
|
+
if (remainingIds.length > 0) {
|
|
50876
|
+
payload.additionalIds = remainingIds;
|
|
50877
|
+
}
|
|
50878
|
+
return this.apiPost({
|
|
50879
|
+
url,
|
|
50880
|
+
data: payload
|
|
50881
|
+
});
|
|
50882
|
+
}
|
|
50883
|
+
mergeSubjects({
|
|
50884
|
+
subject,
|
|
50885
|
+
ids,
|
|
50886
|
+
data
|
|
50887
|
+
}) {
|
|
50888
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
50889
|
+
if (!id1 || !id2) {
|
|
50890
|
+
throw new Error('At least two IDs are required for merging');
|
|
50891
|
+
}
|
|
50892
|
+
const url = `/management/merge/${subject}/${id1}/${id2}`;
|
|
50893
|
+
const payload = {
|
|
50894
|
+
...data
|
|
50895
|
+
};
|
|
50896
|
+
if (remainingIds.length > 0) {
|
|
50897
|
+
payload.additionalIds = remainingIds;
|
|
50898
|
+
}
|
|
50899
|
+
return this.apiPost({
|
|
50900
|
+
url,
|
|
50901
|
+
data: payload
|
|
50902
|
+
});
|
|
50903
|
+
}
|
|
50904
|
+
getSubjectForm({
|
|
50905
|
+
subject,
|
|
50906
|
+
scope = 'global'
|
|
50907
|
+
}) {
|
|
50908
|
+
return this.apiGet({
|
|
50909
|
+
url: `/forms/${subject}`,
|
|
50910
|
+
params: {
|
|
50911
|
+
scope
|
|
50912
|
+
}
|
|
50913
|
+
});
|
|
50914
|
+
}
|
|
50915
|
+
getSubjectData({
|
|
50916
|
+
subject,
|
|
50917
|
+
id
|
|
50918
|
+
}) {
|
|
50919
|
+
return this.apiGet({
|
|
50920
|
+
url: `/management/subject/${subject}/${id}`
|
|
50921
|
+
});
|
|
50922
|
+
}
|
|
50923
|
+
viewLocation({
|
|
50924
|
+
id
|
|
50925
|
+
}) {
|
|
50926
|
+
return this.apiGet({
|
|
50927
|
+
url: `/management/subject/location/${id}`
|
|
50928
|
+
});
|
|
50929
|
+
}
|
|
50930
|
+
viewStakeholder({
|
|
50931
|
+
id
|
|
50932
|
+
}) {
|
|
50933
|
+
return this.apiGet({
|
|
50934
|
+
url: `/management/subject/stakeholder/${id}`
|
|
50935
|
+
});
|
|
50936
|
+
}
|
|
50937
|
+
updateSubject({
|
|
50938
|
+
subject,
|
|
50939
|
+
id,
|
|
50940
|
+
data
|
|
50941
|
+
}) {
|
|
50942
|
+
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
50943
|
+
return this.apiPut({
|
|
50944
|
+
url: `/management/subject/${type}/${id}`,
|
|
50945
|
+
data: filterCreateData(data)
|
|
50946
|
+
});
|
|
50947
|
+
}
|
|
50948
|
+
deleteSubject({
|
|
50949
|
+
subject,
|
|
50950
|
+
id
|
|
50951
|
+
}) {
|
|
50952
|
+
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
50953
|
+
return this.apiDelete({
|
|
50954
|
+
url: `/management/subject/${type}/${id}`
|
|
50955
|
+
});
|
|
50956
|
+
}
|
|
50957
|
+
getUserGrowth(activeFilter) {
|
|
50958
|
+
return this.apiGet({
|
|
50959
|
+
url: `/accounts/dashboard/user-growth`,
|
|
50960
|
+
isUserManager: true,
|
|
50961
|
+
params: {
|
|
50962
|
+
activeFilter
|
|
50963
|
+
}
|
|
50964
|
+
});
|
|
50965
|
+
}
|
|
50966
|
+
}
|
|
50967
|
+
createLazyService(AdminService);
|
|
50968
|
+
|
|
50768
50969
|
const Styles = styled__default["default"].div`
|
|
50769
50970
|
width: 100%;
|
|
50770
50971
|
height: 100vh;
|
|
@@ -57517,9 +57718,28 @@ const usePrepareForm$1 = ({
|
|
|
57517
57718
|
const [linkingForms, setLinkingForms] = React.useState({});
|
|
57518
57719
|
const [loading, setLoading] = React.useState(true);
|
|
57519
57720
|
const [notFound, setNotFound] = React.useState(false);
|
|
57721
|
+
console.log({
|
|
57722
|
+
form,
|
|
57723
|
+
data,
|
|
57724
|
+
groups,
|
|
57725
|
+
linkingForms,
|
|
57726
|
+
loading,
|
|
57727
|
+
notFound
|
|
57728
|
+
});
|
|
57520
57729
|
const prepareForm = currentView => {
|
|
57521
57730
|
const dKey = namespaceConfig?.dataKey;
|
|
57522
57731
|
const nKey = `${APP}-${currentView}`;
|
|
57732
|
+
console.log({
|
|
57733
|
+
dKey,
|
|
57734
|
+
nKey,
|
|
57735
|
+
allData
|
|
57736
|
+
});
|
|
57737
|
+
console.log({
|
|
57738
|
+
condition1: hasKeyInObject(allData, dKey)
|
|
57739
|
+
});
|
|
57740
|
+
console.log({
|
|
57741
|
+
condition2: hasKeyInObject(allData[dKey], nKey)
|
|
57742
|
+
});
|
|
57523
57743
|
if (hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey)) {
|
|
57524
57744
|
const {
|
|
57525
57745
|
form = {},
|
|
@@ -57527,7 +57747,9 @@ const usePrepareForm$1 = ({
|
|
|
57527
57747
|
config = {},
|
|
57528
57748
|
linkingForms = {}
|
|
57529
57749
|
} = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
|
|
57530
|
-
|
|
57750
|
+
console.log("here", dKey, nKey);
|
|
57751
|
+
if (data.datastakeId === id || id === "user" || data.id === id) {
|
|
57752
|
+
console.log("here2", data.datastakeId, id, data.id);
|
|
57531
57753
|
// if (viewConfig.linkingSubjects.includes(namespace)) {
|
|
57532
57754
|
setForm({
|
|
57533
57755
|
...form,
|
|
@@ -57555,6 +57777,7 @@ const usePrepareForm$1 = ({
|
|
|
57555
57777
|
}
|
|
57556
57778
|
}
|
|
57557
57779
|
}
|
|
57780
|
+
console.log('data', data);
|
|
57558
57781
|
};
|
|
57559
57782
|
const getCertainData = allData?.[namespaceConfig?.dataKey];
|
|
57560
57783
|
React.useEffect(() => {
|
|
@@ -58408,6 +58631,19 @@ const View = ({
|
|
|
58408
58631
|
const actionButtons = React.useMemo(() => {
|
|
58409
58632
|
return groupForm?.template === "linkingSubjects" ? pageActions.filter(v => v.key !== "edit") : pageActions;
|
|
58410
58633
|
}, [groupForm, pageActions]);
|
|
58634
|
+
console.log({
|
|
58635
|
+
namespaceConfiguration,
|
|
58636
|
+
namespaceConfig,
|
|
58637
|
+
allData,
|
|
58638
|
+
namespace,
|
|
58639
|
+
id,
|
|
58640
|
+
group,
|
|
58641
|
+
subsection,
|
|
58642
|
+
version,
|
|
58643
|
+
source,
|
|
58644
|
+
isSupported,
|
|
58645
|
+
notFound
|
|
58646
|
+
});
|
|
58411
58647
|
if (!isSupported || notFound) {
|
|
58412
58648
|
return /*#__PURE__*/jsxRuntime.jsx(Loading, {});
|
|
58413
58649
|
}
|
|
@@ -58421,7 +58657,7 @@ const View = ({
|
|
|
58421
58657
|
actionButtons: actionButtons,
|
|
58422
58658
|
extraButtons: extraPageActions,
|
|
58423
58659
|
addedHeaderFirst: true,
|
|
58424
|
-
addedHeader: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
58660
|
+
addedHeader: namespaceConfig?.isAdmin ? null : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
58425
58661
|
className: "flex flex-row gap-4",
|
|
58426
58662
|
children: /*#__PURE__*/jsxRuntime.jsx(Multiselect, {
|
|
58427
58663
|
options: [...sourceOptions],
|
|
@@ -58541,7 +58777,7 @@ const usePrepareForm = ({
|
|
|
58541
58777
|
d[k] = undefined;
|
|
58542
58778
|
}
|
|
58543
58779
|
});
|
|
58544
|
-
if (d.datastakeId === id || d.applicationId === id || id === "user") {
|
|
58780
|
+
if (d.datastakeId === id || d.applicationId === id || id === "user" || d.id === id) {
|
|
58545
58781
|
const formG = mapFormGroup(allData[dKey][nKey].form || {}, d);
|
|
58546
58782
|
setForm(formG);
|
|
58547
58783
|
if (setExtra) {
|