From 5dcdd26c2208005f659707a0b1ec6782d85ad59a Mon Sep 17 00:00:00 2001 From: stefano bovio Date: Tue, 21 Dec 2021 11:10:08 +0100 Subject: [PATCH] restore thumbnail save (#685) --- geonode_mapstore_client/client/js/epics/gnsave.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/epics/gnsave.js b/geonode_mapstore_client/client/js/epics/gnsave.js index 84377f3b78..d57a7b6bdd 100644 --- a/geonode_mapstore_client/client/js/epics/gnsave.js +++ b/geonode_mapstore_client/client/js/epics/gnsave.js @@ -53,7 +53,8 @@ import { getResourceData, getResourceId, getDataPayload, - getCompactPermissions + getCompactPermissions, + getResourceThumbnail } from '@js/selectors/resource'; import { @@ -128,6 +129,7 @@ export const gnSaveContent = (action$, store) => const data = getDataPayload(state, contentType); const body = { 'title': action.metadata.name, + ...(action.metadata.thumbnail && { 'thumbnail_url': action.metadata.thumbnail }), ...(action.metadata.description && { 'abstract': action.metadata.description }), ...(data && { 'data': JSON.parse(JSON.stringify(data)) }) }; @@ -226,9 +228,11 @@ export const gnSaveDirectContent = (action$, store) => const geoLimitsErrors = geoLimitsResponses.filter(({ error }) => error); const name = getResourceName(state); const description = getResourceDescription(state); + const thumbnail = getResourceThumbnail(state); const metadata = { name: (name) ? name : resource?.title, description: (description) ? description : resource?.abstract, + ...(thumbnail && { thumbnail }), extension: resource?.extension, href: resource?.href };