Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/MapStore2
Submodule MapStore2 updated 103 files
7 changes: 6 additions & 1 deletion geonode_mapstore_client/client/js/api/geonode/v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ export const deleteAsset = (pk, assetId) => {
});
};

export const getMetadataDownloadLinkByPk = (pk) => {
return getEndpointUrl(RESOURCES, `/${pk}/iso_metadata_xml`);
}
Comment on lines +726 to +728

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For conciseness and improved readability, this function can be simplified into a single-line arrow function with an implicit return. This is a common pattern for functions that only contain a return statement.

export const getMetadataDownloadLinkByPk = (pk) => getEndpointUrl(RESOURCES, `/${pk}/iso_metadata_xml`);


export default {
getEndpoints,
getResources,
Expand Down Expand Up @@ -759,5 +763,6 @@ export default {
downloadResource,
getDatasets,
deleteExecutionRequest,
getResourceByTypeAndByPk
getResourceByTypeAndByPk,
getMetadataDownloadLinkByPk
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { gnDownloadMetaData } from '@js/epics/gndownload';

describe('gnDownloadMetaData epic', () => {
beforeEach(done => {
global.__DEVTOOLS__ = true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line appears to be a debugging leftover. Setting global variables within tests is generally discouraged as it can lead to side effects and make tests less isolated and predictable. Please remove this line.

setTimeout(done);
});
afterEach(done => {
Copy link

@dsuren1 dsuren1 Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
afterEach(done => {
afterEach(done => {
delete global.__DEVTOOLS__;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding cleanup after test

Expand Down
4 changes: 3 additions & 1 deletion geonode_mapstore_client/client/js/epics/gndownload.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import { DOWNLOAD_METADATA, downloadMetaDataComplete } from '@js/actions/gndownl
import {
error as errorNotification
} from '@mapstore/framework/actions/notifications';
import { getMetadataDownloadLinkByPk } from '@js/api/geonode/v2/index';


export const gnDownloadMetaData = (action$, store) =>
action$.ofType(DOWNLOAD_METADATA)
.switchMap((action) => {
const state = store.getState();
const url = state.gnresource?.data?.links?.find((link) => link.name === action.link).url;
const url = getMetadataDownloadLinkByPk(action.pk)
const resourceTitle = state.gnresource?.data?.title?.replace(/[\.\s]/g, '_');

return Observable
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions geonode_mapstore_client/client/js/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,6 @@ export const plugins = {
'IsoDownload',
() => import(/* webpackChunkName: 'plugins/iso-download-plugin' */ '@js/plugins/downloads/IsoDownload')
),
DublinCoreDownloadPlugin: toModulePlugin(
'DublinCoreDownload',
() => import(/* webpackChunkName: 'plugins/iso-download-plugin' */ '@js/plugins/downloads/DublinCoreDownload')
),
MapViewersCatalogPlugin: toModulePlugin(
'MapViewersCatalog',
() => import(/* webpackChunkName: 'plugins/map-viewers-catalog' */ '@js/plugins/MapViewersCatalog')
Expand Down
14 changes: 0 additions & 14 deletions geonode_mapstore_client/static/mapstore/configs/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,6 @@
{
"type": "plugin",
"name": "IsoDownload"
},
{
"type": "plugin",
"name": "DublinCoreDownload"
}
]
},
Expand Down Expand Up @@ -885,9 +881,6 @@
{
"name": "IsoDownload"
},
{
"name": "DublinCoreDownload"
},
{
"name": "LayerDownload",
"cfg": {
Expand Down Expand Up @@ -2489,10 +2482,6 @@
{
"type": "plugin",
"name": "IsoDownload"
},
{
"type": "plugin",
"name": "DublinCoreDownload"
}
]
}
Expand All @@ -2508,9 +2497,6 @@
{
"name": "IsoDownload"
},
{
"name": "DublinCoreDownload"
},
{
"name": "ResourceDetails",
"cfg": {
Expand Down