@bindu-dashing/dam-solution-v2 5.9.242 → 5.9.245
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.
|
@@ -7,6 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
10
21
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
22
|
import { Button, Checkbox, Drawer, Form, Input, Select, Typography } from "antd";
|
|
12
23
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -153,7 +164,7 @@ const CreateClientForm = ({ teamsApi, username, password, toggleShow, onSuccess,
|
|
|
153
164
|
fetchClientData();
|
|
154
165
|
}, [isEditMode, existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.brandId, existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.subdomain, api, form]);
|
|
155
166
|
const onFinish = (data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
156
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
167
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
157
168
|
try {
|
|
158
169
|
setLoading(true);
|
|
159
170
|
let response;
|
|
@@ -240,8 +251,8 @@ const CreateClientForm = ({ teamsApi, username, password, toggleShow, onSuccess,
|
|
|
240
251
|
payload.adminTeams = adminTeamsAsStrings;
|
|
241
252
|
if (((_a = data.showFilePreview) !== null && _a !== void 0 ? _a : false) !== get(clientData, "showFilePreview", false))
|
|
242
253
|
payload.showFilePreview = (_b = data.showFilePreview) !== null && _b !== void 0 ? _b : false;
|
|
243
|
-
if (((_c = data.showEditImagePicker) !== null && _c !== void 0 ? _c : false) !== ((_d = get(clientData, "showEditImagePicker")) !== null && _d !== void 0 ? _d : get(clientData, "ShowEditImagepicker", false)))
|
|
244
|
-
payload.
|
|
254
|
+
if (((_c = data.showEditImagePicker) !== null && _c !== void 0 ? _c : false) !== ((_e = (_d = get(clientData, "showEditImagePicker")) !== null && _d !== void 0 ? _d : get(clientData, "ShowEditImagePicker")) !== null && _e !== void 0 ? _e : get(clientData, "ShowEditImagepicker", false)))
|
|
255
|
+
payload.ShowEditImagepicker = (_f = data.showEditImagePicker) !== null && _f !== void 0 ? _f : false;
|
|
245
256
|
if (teamsApiDetailsChanged)
|
|
246
257
|
payload.teamsApiDetails = {
|
|
247
258
|
teamsApi: newTeamsApiDetails.teamsApi || "",
|
|
@@ -287,7 +298,8 @@ const CreateClientForm = ({ teamsApi, username, password, toggleShow, onSuccess,
|
|
|
287
298
|
locationType: "INTERNAL",
|
|
288
299
|
rootPath: formDamLocation === null || formDamLocation === void 0 ? void 0 : formDamLocation.rootPath,
|
|
289
300
|
};
|
|
290
|
-
const
|
|
301
|
+
const { showEditImagePicker: _showEditImagePickerFromData } = data, restData = __rest(data, ["showEditImagePicker"]);
|
|
302
|
+
const values = Object.assign(Object.assign({}, restData), { adminTeams: adminTeamsAsStrings, showFilePreview: (_g = data.showFilePreview) !== null && _g !== void 0 ? _g : false, ShowEditImagepicker: (_h = data.showEditImagePicker) !== null && _h !== void 0 ? _h : false, accessKey: appType == "reactJs"
|
|
291
303
|
? process.env.REACT_APP_MIXDRIVE_CLIENT_PARENT_ACCESS_KEY
|
|
292
304
|
: process.env.NEXT_PUBLIC_MIXDRIVE_CLIENT_PARENT_ACCESS_KEY, secretKey: appType == "reactJs"
|
|
293
305
|
? process.env.REACT_APP_MIXDRIVE_CLIENT_PARENT_SECRET_KEY
|
|
@@ -301,12 +313,12 @@ const CreateClientForm = ({ teamsApi, username, password, toggleShow, onSuccess,
|
|
|
301
313
|
response = yield api.post(CREATE_SUB_BRAND, values);
|
|
302
314
|
}
|
|
303
315
|
setLoading(false);
|
|
304
|
-
showNotification((
|
|
316
|
+
showNotification((_j = response === null || response === void 0 ? void 0 : response.message) !== null && _j !== void 0 ? _j : (get(response, "message") || (isEditMode ? UPDATE_SUCCESS : CREATE_SUCCESS)), NotificationStatus.SUCCESS);
|
|
305
317
|
// Call onSuccess before closing drawer so parent can show its toast (e.g. d1-admin, ThemePage)
|
|
306
318
|
// Parent expects accessKey, secretKey, subdomain - always provide when in edit mode
|
|
307
319
|
if (onSuccess) {
|
|
308
320
|
const successData = isEditMode
|
|
309
|
-
? Object.assign(Object.assign(Object.assign({}, response === null || response === void 0 ? void 0 : response.data), response), { accessKey: (
|
|
321
|
+
? Object.assign(Object.assign(Object.assign({}, response === null || response === void 0 ? void 0 : response.data), response), { accessKey: (_l = (_k = existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.accessKey) !== null && _k !== void 0 ? _k : get(response, "accessKey")) !== null && _l !== void 0 ? _l : get(clientData, "accessKey"), secretKey: (_o = (_m = existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.secretKey) !== null && _m !== void 0 ? _m : get(response, "secretKey")) !== null && _o !== void 0 ? _o : get(clientData, "secretKey"), subdomain: (_r = (_q = (_p = data === null || data === void 0 ? void 0 : data.subdomain) !== null && _p !== void 0 ? _p : existingClientData === null || existingClientData === void 0 ? void 0 : existingClientData.subdomain) !== null && _q !== void 0 ? _q : get(response, "subdomain")) !== null && _r !== void 0 ? _r : get(clientData, "subdomain") }) : (_s = response === null || response === void 0 ? void 0 : response.data) !== null && _s !== void 0 ? _s : response;
|
|
310
322
|
// Guard: parent (e.g. ThemePage.onCreateDamClient) accesses data.accessKey - never pass undefined
|
|
311
323
|
const safeData = successData && typeof successData === "object"
|
|
312
324
|
? successData
|
|
@@ -328,7 +340,7 @@ const CreateClientForm = ({ teamsApi, username, password, toggleShow, onSuccess,
|
|
|
328
340
|
});
|
|
329
341
|
// Populate form when client data and teams are ready
|
|
330
342
|
useEffect(() => {
|
|
331
|
-
var _a;
|
|
343
|
+
var _a, _b;
|
|
332
344
|
if (clientData && Object.keys(clientData).length > 0) {
|
|
333
345
|
const damLocationDetails = get(clientData, "damLocationDetails", {});
|
|
334
346
|
const locationType = get(damLocationDetails, "locationType", "");
|
|
@@ -347,7 +359,7 @@ const CreateClientForm = ({ teamsApi, username, password, toggleShow, onSuccess,
|
|
|
347
359
|
accessTypes: get(clientData, "accessTypes", []),
|
|
348
360
|
adminTeams: adminTeamsFormatted,
|
|
349
361
|
showFilePreview: get(clientData, "showFilePreview", false),
|
|
350
|
-
showEditImagePicker: (_a = get(clientData, "showEditImagePicker")) !== null && _a !== void 0 ? _a : get(clientData, "ShowEditImagepicker", false),
|
|
362
|
+
showEditImagePicker: (_b = (_a = get(clientData, "showEditImagePicker")) !== null && _a !== void 0 ? _a : get(clientData, "ShowEditImagePicker")) !== null && _b !== void 0 ? _b : get(clientData, "ShowEditImagepicker", false),
|
|
351
363
|
teamsApiDetails: {
|
|
352
364
|
teamsApi: get(teamsApiDetails, "teamsApi", ""),
|
|
353
365
|
username: get(teamsApiDetails, "username", ""),
|
|
@@ -24,11 +24,11 @@ const getEditorType = (file) => {
|
|
|
24
24
|
return null;
|
|
25
25
|
};
|
|
26
26
|
const FilesGridView = ({ files, handleClick, selectedFileIds, isImagePicker, selectedPickerFile, }) => {
|
|
27
|
-
var _a;
|
|
27
|
+
var _a, _b;
|
|
28
28
|
const { type } = useAppParams();
|
|
29
29
|
const damConfig = useDamConfig();
|
|
30
30
|
const brand = get(damConfig, "brand", {});
|
|
31
|
-
const showImagePickerEdit = (_a = get(brand, "showEditImagePicker")) !== null && _a !== void 0 ? _a : get(brand, "ShowEditImagepicker", false);
|
|
31
|
+
const showImagePickerEdit = (_b = (_a = get(brand, "showEditImagePicker")) !== null && _a !== void 0 ? _a : get(brand, "ShowEditImagePicker")) !== null && _b !== void 0 ? _b : get(brand, "ShowEditImagepicker", false);
|
|
32
32
|
const [editState, setEditState] = useState({ editFile: null, showEditModal: false });
|
|
33
33
|
const { editFile, showEditModal } = editState;
|
|
34
34
|
const openEditor = (file) => {
|
|
@@ -102,12 +102,12 @@ const formatMetadataDisplayValue = (value, field, teams) => {
|
|
|
102
102
|
return String(value);
|
|
103
103
|
};
|
|
104
104
|
const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage, selectedFileIds, selectedFolderIds, setSelectedItems, isImagePicker, setSelectedFile, setParentFolderId, selectedPickerFile, location, assets, sortByKey, sortOrder, setSortOrders, onSearch, searchKey, searchValue, metadataKey, metadataValue, setSelectedKeys, }) => {
|
|
105
|
-
var _a;
|
|
105
|
+
var _a, _b;
|
|
106
106
|
const navigate = useAppNavigate();
|
|
107
107
|
const damConfig = useDamConfig();
|
|
108
108
|
const teams = get(damConfig, "teams", []);
|
|
109
109
|
const brand = get(damConfig, "brand", {});
|
|
110
|
-
const showImagePickerEdit = (_a = get(brand, "showEditImagePicker")) !== null && _a !== void 0 ? _a : get(brand, "ShowEditImagepicker", false);
|
|
110
|
+
const showImagePickerEdit = (_b = (_a = get(brand, "showEditImagePicker")) !== null && _a !== void 0 ? _a : get(brand, "ShowEditImagePicker")) !== null && _b !== void 0 ? _b : get(brand, "ShowEditImagepicker", false);
|
|
111
111
|
const [state, setState] = useState({
|
|
112
112
|
selectedFile: {},
|
|
113
113
|
showPreviewModal: false,
|