diff --git a/geonode_mapstore_client/client/js/utils/ResourceUtils.js b/geonode_mapstore_client/client/js/utils/ResourceUtils.js index 850228fc0f..a2c2b6ec26 100644 --- a/geonode_mapstore_client/client/js/utils/ResourceUtils.js +++ b/geonode_mapstore_client/client/js/utils/ResourceUtils.js @@ -337,8 +337,7 @@ export const getResourceTypesInfo = () => ({ name: 'Dataset', formatMetadataUrl: (resource) => isDefaultDatasetSubtype(resource?.subtype) ? `/datasets/${resource.store ? resource.store + ":" : ''}${resource.alternate}/metadata` - : `/resources/${resource.pk}/metadata`, - catalogPageUrl: '/datasets' + : `/resources/${resource.pk}/metadata` }, [ResourceTypes.MAP]: { icon: 'map', @@ -348,8 +347,7 @@ export const getResourceTypesInfo = () => ({ config: 'map_preview' })), formatDetailUrl: (resource) => resource?.detail_url && parseDevHostname(resource.detail_url), - formatMetadataUrl: (resource) => (`/maps/${resource.pk}/metadata`), - catalogPageUrl: '/maps' + formatMetadataUrl: (resource) => (`/maps/${resource.pk}/metadata`) }, [ResourceTypes.DOCUMENT]: { icon: 'file', @@ -359,8 +357,7 @@ export const getResourceTypesInfo = () => ({ formatEmbedUrl: (resource) => isDocumentExternalSource(resource) ? undefined : resource?.embed_url && parseDevHostname(resource.embed_url), formatDetailUrl: (resource) => resource?.detail_url && parseDevHostname(resource.detail_url), formatMetadataUrl: (resource) => (`/documents/${resource.pk}/metadata`), - metadataPreviewUrl: (resource) => (`/documents/${resource.pk}/metadata_detail?preview`), - catalogPageUrl: '/documents' + metadataPreviewUrl: (resource) => (`/documents/${resource.pk}/metadata_detail?preview`) }, [ResourceTypes.GEOSTORY]: { icon: 'book', @@ -368,8 +365,7 @@ export const getResourceTypesInfo = () => ({ canPreviewed: (resource) => resourceHasPermission(resource, 'view_resourcebase'), formatEmbedUrl: (resource) => resource?.embed_url && parseDevHostname(resource.embed_url), formatDetailUrl: (resource) => resource?.detail_url && parseDevHostname(resource.detail_url), - formatMetadataUrl: (resource) => (`/apps/${resource.pk}/metadata`), - catalogPageUrl: '/geostories' + formatMetadataUrl: (resource) => (`/apps/${resource.pk}/metadata`) }, [ResourceTypes.DASHBOARD]: { icon: 'dashboard', @@ -377,8 +373,7 @@ export const getResourceTypesInfo = () => ({ canPreviewed: (resource) => resourceHasPermission(resource, 'view_resourcebase'), formatEmbedUrl: (resource) => resource?.embed_url && parseDevHostname(resource.embed_url), formatDetailUrl: (resource) => resource?.detail_url && parseDevHostname(resource.detail_url), - formatMetadataUrl: (resource) => (`/apps/${resource.pk}/metadata`), - catalogPageUrl: '/dashboards' + formatMetadataUrl: (resource) => (`/apps/${resource.pk}/metadata`) }, [ResourceTypes.VIEWER]: { icon: 'cogs', @@ -386,8 +381,7 @@ export const getResourceTypesInfo = () => ({ canPreviewed: (resource) => resourceHasPermission(resource, 'view_resourcebase'), formatEmbedUrl: () => false, formatDetailUrl: (resource) => resource?.detail_url && parseDevHostname(resource.detail_url), - formatMetadataUrl: (resource) => (`/apps/${resource.pk}/metadata`), - catalogPageUrl: '/all' + formatMetadataUrl: (resource) => (`/apps/${resource.pk}/metadata`) } }); @@ -831,14 +825,6 @@ export const getResourceAdditionalProperties = (_resource = {}) => { }; }; -export const onDeleteRedirectTo = (resources = []) => { - let redirectUrl = '/'; - if (!isEmpty(resources) && resources?.length === 1) { - const types = getResourceTypesInfo(); - const { catalogPageUrl } = types[resources[0].resource_type] ?? {}; - if (catalogPageUrl) { - redirectUrl = catalogPageUrl; - } - } - return redirectUrl; +export const onDeleteRedirectTo = () => { + return '/'; };