feat: add cloudinary support (#1932)
This commit is contained in:
@ -63,8 +63,8 @@ export function openMediaLibrary(payload = {}) {
|
||||
const state = getState();
|
||||
const mediaLibrary = state.mediaLibrary.get('externalLibrary');
|
||||
if (mediaLibrary) {
|
||||
const { controlID: id, value, config = Map(), forImage } = payload;
|
||||
mediaLibrary.show({ id, value, config: config.toJS(), imagesOnly: forImage });
|
||||
const { controlID: id, value, config = Map(), allowMultiple, forImage } = payload;
|
||||
mediaLibrary.show({ id, value, config: config.toJS(), allowMultiple, imagesOnly: forImage });
|
||||
}
|
||||
dispatch({ type: MEDIA_LIBRARY_OPEN, payload });
|
||||
};
|
||||
|
@ -56,5 +56,12 @@ export const selectUnpublishedEntriesByStatus = (state, status) =>
|
||||
export const selectIntegration = (state, collection, hook) =>
|
||||
fromIntegrations.selectIntegration(state.integrations, collection, hook);
|
||||
|
||||
export const getAsset = (state, path) =>
|
||||
fromMedias.getAsset(state.config.get('public_folder'), state.medias, path);
|
||||
export const getAsset = (state, path) => {
|
||||
/**
|
||||
* If an external media library is in use, just return the path.
|
||||
*/
|
||||
if (state.mediaLibrary.get('externalLibrary')) {
|
||||
return path;
|
||||
}
|
||||
return fromMedias.getAsset(state.config.get('public_folder'), state.medias, path);
|
||||
};
|
||||
|
Reference in New Issue
Block a user