@bindu-dashing/dam-solution-v2 5.8.195 → 5.8.197
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.
|
@@ -29,6 +29,7 @@ const CreateClient = ({ onSuccess, clientSubdomain, teamsApi, username, password
|
|
|
29
29
|
setShowForm(!showForm);
|
|
30
30
|
};
|
|
31
31
|
const onRefreshKey = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
var _a, _b;
|
|
32
33
|
if (!(existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.accessKey) || !(existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.secretKey)) {
|
|
33
34
|
showNotification("Access key and secret key are required to refresh", NotificationStatus.ERROR);
|
|
34
35
|
return;
|
|
@@ -63,7 +64,13 @@ const CreateClient = ({ onSuccess, clientSubdomain, teamsApi, username, password
|
|
|
63
64
|
setRefreshingKey(false);
|
|
64
65
|
showNotification(get(response, "data.message", "Key refreshed successfully"), NotificationStatus.SUCCESS);
|
|
65
66
|
if (onSuccess) {
|
|
66
|
-
|
|
67
|
+
// Normalize response: API may return { data: { accessKey, secretKey } } or { accessKey, secretKey }
|
|
68
|
+
const keysData = get(response, "data.data", get(response, "data", {}));
|
|
69
|
+
onSuccess({
|
|
70
|
+
accessKey: (_a = keysData.accessKey) !== null && _a !== void 0 ? _a : accessKey,
|
|
71
|
+
secretKey: (_b = keysData.secretKey) !== null && _b !== void 0 ? _b : secretKey,
|
|
72
|
+
subdomain: subdomain,
|
|
73
|
+
});
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
76
|
catch (error) {
|
|
@@ -244,8 +244,23 @@ function FolderTree({ currentRootId, expandedKeys, selectedKeys, handleExpand, s
|
|
|
244
244
|
fetchFolders(currentRootId);
|
|
245
245
|
}
|
|
246
246
|
else {
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
// Folder not in tree - it may be a nested subfolder (e.g. "Books Sub folder" under "Book")
|
|
248
|
+
// Fetch children for top-level folders until the target appears in the tree
|
|
249
|
+
console.log('## Folder not in tree - fetching children to find nested subfolder:', currentRootId);
|
|
250
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
setState((s) => (Object.assign(Object.assign({}, s), { loading: true })));
|
|
252
|
+
for (const folder of folders) {
|
|
253
|
+
const fid = get(folder, "_id");
|
|
254
|
+
if (!fid)
|
|
255
|
+
continue;
|
|
256
|
+
const hasChildrenLoaded = isArray(folder.children) && folder.children.length > 0;
|
|
257
|
+
if (!hasChildrenLoaded) {
|
|
258
|
+
yield fetchFolderChildren(fid);
|
|
259
|
+
// Effect will re-run when folders update; if target is now in tree, we'll expand
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
setState((s) => (Object.assign(Object.assign({}, s), { loading: false })));
|
|
263
|
+
}))();
|
|
249
264
|
}
|
|
250
265
|
}
|
|
251
266
|
}
|