@bindu-dashing/dam-solution-v2 5.9.259 → 5.9.261
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.
|
@@ -95,6 +95,6 @@ export default function CreateOrEditAssetTemplate() {
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
return (_jsx("div", { className: "md-lib-h-auto", style: {
|
|
98
|
-
backgroundColor: (styles === null || styles === void 0 ? void 0 : styles.
|
|
98
|
+
backgroundColor: (styles === null || styles === void 0 ? void 0 : styles.colorSecondary) || (variables === null || variables === void 0 ? void 0 : variables.secondaryColor),
|
|
99
99
|
}, children: (state === null || state === void 0 ? void 0 : state.inputTypesLoading) || (state === null || state === void 0 ? void 0 : state.templatesDataLoading) ? (_jsx(Loader, {})) : (_jsx(EditAssetTemplate, { assetTemplate: get(state, "templateData", {}), inputTypes: get(state, "inputTypesData", []) })) }));
|
|
100
100
|
}
|
|
@@ -45,11 +45,12 @@ export default function OptionsField({ field, supportedTypes, currentInputType,
|
|
|
45
45
|
message: "At least one option is required",
|
|
46
46
|
},
|
|
47
47
|
], children: _jsx(Form.List, { name: "options", children: (fields, { add, remove }) => (_jsxs(_Fragment, { children: [fields.map((_a) => {
|
|
48
|
+
var _b;
|
|
48
49
|
var { key, name } = _a, restField = __rest(_a, ["key", "name"]);
|
|
49
50
|
return (_jsxs(Row, { gutter: 8, className: "md-lib-items-center", children: [_jsx(Col, { span: 10, children: _jsx(Form.Item, Object.assign({}, restField, { name: [name, "label"], label: "Label", rules: [
|
|
50
51
|
{ required: true, message: "Label is required" },
|
|
51
52
|
], children: _jsx(Input, { placeholder: "Enter Label", className: "md-lib-h-12" }) })) }), _jsx(Col, { span: 10, children: _jsx(Form.Item, Object.assign({}, restField, { name: [name, "value"], label: "Value", rules: [
|
|
52
53
|
{ required: true, message: "Value is required" },
|
|
53
|
-
], children: _jsx(Input, { placeholder: "Enter Value", className: "md-lib-h-12" }) })) }), _jsx(Col, { span: 4, className: "md-lib-flex md-lib-items-end", children: _jsx(TiDeleteOutlineIcon, { size: ICON_SIZE, className: "md-lib-cursor-pointer", color: theme === null || theme === void 0 ? void 0 : theme.primaryColor, onClick: () => remove(name) }) })] }, key));
|
|
54
|
+
], children: _jsx(Input, { placeholder: "Enter Value", className: "md-lib-h-12" }) })) }), _jsx(Col, { span: 4, className: "md-lib-flex md-lib-items-end", children: _jsx(TiDeleteOutlineIcon, { size: ICON_SIZE, className: "md-lib-cursor-pointer", color: (_b = theme === null || theme === void 0 ? void 0 : theme.variables) === null || _b === void 0 ? void 0 : _b.primaryColor, onClick: () => remove(name) }) })] }, key));
|
|
54
55
|
}), _jsx(Form.Item, { children: _jsx(Button, { icon: _jsx(FaPlusIcon, {}), onClick: () => add(), children: "Add Option" }) })] })) }) })] }))] }));
|
|
55
56
|
}
|
|
@@ -316,7 +316,7 @@ const BulkUploadModal = ({ toggleUpload, userEmail, folderId, thumbnailsOnly, })
|
|
|
316
316
|
},
|
|
317
317
|
], children: _jsx(Input, { placeholder: "Email", disabled: !assetTypeId }) })), !thumbnailsOnly && (_jsx(Form.Item, { name: "reject_invalid_meta_file", valuePropName: "checked", children: _jsxs(Checkbox, { name: "reject_invalid_meta_file", children: ["Reject invalid meta file", _jsx(Popover, { content: _jsxs("span", { style: { color: "grey", padding: "5px" }, children: ["When this option is selected the uploaded metadata", _jsx("br", {}), " file will be rejected if it contains invalid values"] }), children: _jsx(QuestionCircleOutlined, { style: { marginLeft: "5px", color: "silver" } }) })] }) })), _jsx(Form.Item, { children: _jsx(Button, { block: true, type: "primary", htmlType: "submit", style: {
|
|
318
318
|
marginBottom: "10px",
|
|
319
|
-
backgroundColor: styles === null || styles === void 0 ? void 0 : styles.
|
|
319
|
+
backgroundColor: styles === null || styles === void 0 ? void 0 : styles.colorPrimary,
|
|
320
320
|
}, loading: loading, disabled: isSubmitDisabled, children: "Submit" }) })] }) }));
|
|
321
321
|
};
|
|
322
322
|
export default BulkUploadModal;
|
|
@@ -20,7 +20,7 @@ import CustomButton from "../../common/Button";
|
|
|
20
20
|
import { showNotification } from "../../common/notifications";
|
|
21
21
|
import { FILE_UPLOAD_ERROR, SOMETHING_WENT_WRONG, UPDATE_SUCCESS, } from "../../utilities/constants/messages";
|
|
22
22
|
import { CREATE_FILE_URL, FILE_UPLOAD_URL, SAVE_EDITED_FILE_THUMBNAIL_URL, SAVE_EDITED_FILE_URL, } from "../../utilities/constants/apiUrls";
|
|
23
|
-
import {
|
|
23
|
+
import { QueryKeys } from "../../utilities/constants/queryKeys";
|
|
24
24
|
import { useQueryClient } from "react-query";
|
|
25
25
|
import { useDamConfig } from "../../hocs/DamConfigContext";
|
|
26
26
|
import { createApiClient } from "../../hocs/configureAxios";
|
|
@@ -39,8 +39,12 @@ const ImageEditorComponent = ({ file, handleClose, }) => {
|
|
|
39
39
|
const { rootFolderId, brand } = damConfig;
|
|
40
40
|
const brandId = get(brand, "_id");
|
|
41
41
|
const api = useMemo(() => createApiClient(damConfig), [damConfig]);
|
|
42
|
-
const {
|
|
43
|
-
|
|
42
|
+
const { folderId } = useAppParams();
|
|
43
|
+
// file.folderId is the folder the file actually lives in. Prefer it because
|
|
44
|
+
// `useAppParams().folderId` is undefined when the picker is opened as a
|
|
45
|
+
// modal (no URL change) — that was causing uploads to land in the root
|
|
46
|
+
// folder and invalidations to miss the picker's active query.
|
|
47
|
+
const currentFolderId = get(file, "folderId") || folderId || rootFolderId;
|
|
44
48
|
const [state, setState] = useState({
|
|
45
49
|
loading: false,
|
|
46
50
|
confirmOpen: false,
|
|
@@ -48,12 +52,13 @@ const ImageEditorComponent = ({ file, handleClose, }) => {
|
|
|
48
52
|
const { loading, confirmOpen } = state;
|
|
49
53
|
const editorRef = useRef(null);
|
|
50
54
|
const invalidateAfterChange = () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
55
|
+
// Prefix-only invalidation so we hit every relevant query regardless of
|
|
56
|
+
// its second key segment (folderId, picker id, mode, etc.). Going by
|
|
57
|
+
// exact key was missing the picker's active query because its folderId
|
|
58
|
+
// doesn't match useAppParams().folderId when the picker is a modal.
|
|
59
|
+
queryClient.invalidateQueries({ queryKey: [QueryKeys.FOLDERS] });
|
|
56
60
|
queryClient.invalidateQueries({ queryKey: [QueryKeys.IMAGE_PICKERS] });
|
|
61
|
+
queryClient.invalidateQueries({ queryKey: [QueryKeys.FILE] });
|
|
57
62
|
};
|
|
58
63
|
const handleOverwrite = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
64
|
var _a;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* <img> wrapper that bypasses the browser HTTP cache when `version` changes.
|
|
4
|
-
*
|
|
5
|
-
* Why: S3 presigned URLs don't change after a file is overwritten in place
|
|
6
|
-
* (same key → same signed URL). The browser's HTTP cache then serves the
|
|
7
|
-
* old binary even when react-query refetches the file list. Appending
|
|
8
|
-
* query params would break the S3 signature, so instead we re-fetch the URL
|
|
9
|
-
* with `cache: 'reload'` and display the result via an object URL — the
|
|
10
|
-
* blob URL is unique so the browser must paint the fresh bytes.
|
|
11
|
-
*/
|
|
12
2
|
type Props = Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> & {
|
|
13
3
|
src: string;
|
|
14
4
|
version?: string | number | null;
|