Skip to content

Commit

Permalink
Merge branch 'merge_4.4.1' into feature/plasticops_trigger-ai-inference
Browse files Browse the repository at this point in the history
  • Loading branch information
ridoo committed Nov 14, 2024
2 parents a1984f7 + f17b907 commit fb96bc2
Show file tree
Hide file tree
Showing 1,661 changed files with 3,068 additions and 2,010 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This is a basic workflow to help you get started with Actions

name: GeoNode Client CI 4.3.x (build)
name: GeoNode Client 4.4.x CI (build)

concurrency:
group: "client_build"
group: "client_build_4.4.x"
cancel-in-progress: true
# Controls when the workflow will run
on:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This is a basic workflow to help you get started with Actions

name: GeoNode Client CI 4.3.x (tests)
name: GeoNode Client 4.4.x CI (tests)

# Controls when the workflow will run
on:
# Triggers the workflow pull request events but only for the 4.3.x branch
# Triggers the workflow pull request events but only for the 4.4.x branch
pull_request:
branches: [ 4.3.x ]
branches: [ 4.4.x ]
paths:
- "geonode_mapstore_client/client/**"

Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "geonode_mapstore_client/client/MapStore2"]
path = geonode_mapstore_client/client/MapStore2
url = https://github.com/geosolutions-it/MapStore2.git
branch = 2024.01.xx
branch = 2024.02.xx
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

GeoNode MapStore Client is a frontend application that interacts with the GeoNode API V2 to allows users to navigate and discover GeoNode resources. The client application provided by this repository is a MapStore downstream project an Open Source WebGIS framework based on ReactJS.

## Tools supported versions
## Tools tested versions

- node >= v12.18.4
- npm >= 6.14.6 and < 7
- node 20.13.1
- npm 10.5.2
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1
4.4.1
1 change: 1 addition & 0 deletions geonode_mapstore_client/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def run_setup_hooks(*args, **kwargs):
settings.PROXY_ALLOWED_PARAMS_NEEDLES += (
"request=getfeatureinfo",
"request=getcapabilities",
"request=getmap",
)
settings.PROXY_ALLOWED_PATH_NEEDLES += (
"tileset.json",
Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/MapStore2
Submodule MapStore2 updated 344 files
6 changes: 3 additions & 3 deletions geonode_mapstore_client/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

GeoNode MapStore Client is a frontend application that interacts with the GeoNode API V2 to allows users to navigate and discover GeoNode resources. The client application provided by this repository is a MapStore downstream project an Open Source WebGIS framework based on ReactJS.

### Tools supported versions
## Tools tested versions

- node >= v12.18.4
- npm >= 6.14.6 and < 7
- node 20.13.1
- npm 10.5.2
6 changes: 3 additions & 3 deletions geonode_mapstore_client/client/js/actions/gnresource.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const SET_RESOURCE_PATH_PARAMETERS = 'GEONODE:SET_RESOURCE_PATH_PARAMETER
export const SET_MAP_VIEWER_LINKED_RESOURCE = 'GEONODE:SET_MAP_VIEWER_LINKED_RESOURCE';
export const MANAGE_LINKED_RESOURCE = 'GEONODE:MANAGE_LINKED_RESOURCE';
export const SET_DEFAULT_VIEWER_PLUGINS = 'GEONODE:SET_DEFAULT_VIEWER_PLUGINS';
export const SET_SELECTED_LAYER_DATASET = 'GEONODE:SET_SELECTED_LAYER_DATASET';
export const SET_SELECTED_LAYER = 'GEONODE:SET_SELECTED_LAYER';

/**
* Actions for GeoNode resource
Expand Down Expand Up @@ -366,9 +366,9 @@ export function setDefaultViewerPlugins(plugins) {
* Set selected layer type is from dataset
* @param {Object} layer selected
*/
export function setSelectedLayerType(layer) {
export function setSelectedLayer(layer) {
return {
type: SET_SELECTED_LAYER_DATASET,
type: SET_SELECTED_LAYER,
layer
};
}
5 changes: 3 additions & 2 deletions geonode_mapstore_client/client/js/actions/gnsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ export function loadingResources(loading) {
};
}

export function requestResource(pk, ctype) {
export function requestResource(pk, ctype, subtype) {
return {
type: REQUEST_RESOURCE,
pk,
ctype
ctype,
subtype
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getGeoNodeLocalConfig, parseDevHostname } from "@js/utils/APIUtils";

export const getUserInfo = (apikey) => {
const endpointV1 = getGeoNodeLocalConfig('geoNodeApi.endpointV1', '/api');
return axios.get(`${parseDevHostname(endpointV1)}/o/v4/userinfo`, {
return axios.get(parseDevHostname(`${endpointV1}/o/v4/userinfo`), {
params: {
...(apikey && { apikey })
}
Expand Down
36 changes: 24 additions & 12 deletions geonode_mapstore_client/client/js/api/geonode/v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import pick from 'lodash/pick';
import isEmpty from 'lodash/isEmpty';
import isNil from 'lodash/isNil';
import { getUserInfo } from '@js/api/geonode/user';
import { ResourceTypes, availableResourceTypes, setAvailableResourceTypes, getDownloadUrlInfo } from '@js/utils/ResourceUtils';
import { ResourceTypes, availableResourceTypes, setAvailableResourceTypes, getDownloadUrlInfo, isDefaultDatasetSubtype } from '@js/utils/ResourceUtils';
import { getConfigProp } from '@mapstore/framework/utils/ConfigUtils';
import { mergeConfigsPatch } from '@mapstore/patcher';
import { parseIcon } from '@js/utils/SearchUtils';
Expand Down Expand Up @@ -200,34 +200,31 @@ export const getDatasets = ({
q,
pageSize = 20,
page = 1,
sort,
...params
sort
}) => {
return axios
.get(
parseDevHostname(endpoints[DATASETS]), {
parseDevHostname(endpoints[RESOURCES]), {
// axios will format query params array to `key[]=value1&key[]=value2`
params: {
...params,
'filter{resource_type.in}': 'dataset',
'filter{metadata_only}': false,
...(q && {
search: q,
search_fields: ['title', 'abstract']
}),
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
page,
page_size: pageSize,
api_preset: API_PRESET.DATASETS
api_preset: API_PRESET.CATALOGS
},
...paramsSerializer()
})
.then(({ data }) => {
return {
totalCount: data.total,
isNextPageAvailable: !!data.links.next,
resources: (data.datasets || [])
.map((resource) => {
return resource;
})
resources: (data.resources || [])
};
});
};
Expand Down Expand Up @@ -777,8 +774,21 @@ export const uploadDataset = ({
auxiliaryFiles,
ext,
charset = 'UTF-8',
url,
title,
type,
config
}) => {

if (url) {
return axios.post(`${parseDevHostname(endpoints[UPLOADS])}/upload`, {
url,
title,
type
}, config)
.then(({ data }) => (data));
}

const formData = new FormData();
formData.append('base_file', file);
formData.append('charset', charset);
Expand Down Expand Up @@ -823,12 +833,14 @@ export const deleteExecutionRequest = (executionId) => {
return axios.delete(`${parseDevHostname(endpoints[EXECUTIONREQUEST])}/${executionId}`);
};

export const getResourceByTypeAndByPk = (type, pk) => {
export const getResourceByTypeAndByPk = (type, pk, subtype) => {
switch (type) {
case "document":
return getDocumentByPk(pk);
case "dataset":
return getDatasetByPk(pk);
return isDefaultDatasetSubtype(subtype)
? getDatasetByPk(pk)
: getResourceByPk(pk);
// Add type condition based on requirement
default:
return getResourceByPk(pk);
Expand Down
123 changes: 59 additions & 64 deletions geonode_mapstore_client/client/js/apps/gn-catalogue.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import gnsearchEpics from '@js/epics/gnsearch';
import favoriteEpics from '@js/epics/favorite';
import maplayout from '@mapstore/framework/reducers/maplayout';

import pluginsDefinition, { storeEpicsNamesToExclude } from '@js/plugins/index';
import pluginsDefinition, { storeEpicsNamesToExclude, cleanEpics } from '@js/plugins/index';
import ReactSwipe from 'react-swipeable-views';
import SwipeHeader from '@mapstore/framework/components/data/identify/SwipeHeader';

Expand Down Expand Up @@ -129,7 +129,6 @@ getEndpoints()
pluginsConfigKey,
query,
configEpics,
mapType = 'openlayers',
onStoreInit,
targetId = 'ms-container',
settings
Expand All @@ -138,7 +137,7 @@ getEndpoints()
const mapLayout = getConfigProp('mapLayout') || {};
setConfigProp('mapLayout', mapLayout[query.theme] || mapLayout.viewer);

const appEpics = {
const appEpics = cleanEpics({
...standardEpics,
...configEpics,
gnCheckSelectedDatasetPermissions,
Expand All @@ -151,71 +150,67 @@ getEndpoints()
updateMapLayoutEpic,
// needed to initialize the correct time range
...timelineEpics
};
});

storeEpicsNamesToExclude(appEpics);

// register custom arcgis layer
import('@js/map/' + mapType + '/plugins/ArcGisMapServer')
.then(() => {
main({
targetId,
enableExtensions: true,
appComponent: withRoutes(routes)(ConnectedRouter),
loaderComponent: MainLoader,
initialState: {
defaultState: {
...securityState
}
},
themeCfg: null,
pluginsConfig: getPluginsConfigOverride(getPluginsConfiguration(localConfig.plugins, pluginsConfigKey)),
pluginsDef: {
plugins: {
...pluginsDefinition.plugins
},
requires: {
...requires,
...pluginsDefinition.requires
}
},
printEnabled: true,
rootReducerFunc: standardRootReducerFunc,
onStoreInit,
appReducers: {
...standardReducers,
gnresource,
resourceservice,
gnsettings,
security,
maptype,
print,
maplayout,
controls,
timeline,
dimension,
playback,
mapPopups,
catalog,
searchconfig,
widgets,
geostory,
gnsearch,
notifications,
context,
...pluginsDefinition.reducers
},
appEpics,
geoNodeConfiguration,
initialActions: [
// add some settings in the global state to make them accessible in the monitor state
// later we could use expression in localConfig
updateGeoNodeSettings.bind(null, settings),
loadPrintCapabilities.bind(null, getConfigProp('printUrl'))
]
main({
targetId,
enableExtensions: true,
appComponent: withRoutes(routes)(ConnectedRouter),
loaderComponent: MainLoader,
initialState: {
defaultState: {
...securityState
}
},
themeCfg: null,
pluginsConfig: getPluginsConfigOverride(getPluginsConfiguration(localConfig.plugins, pluginsConfigKey)),
pluginsDef: {
plugins: {
...pluginsDefinition.plugins
},
withExtensions(StandardApp));
});
requires: {
...requires,
...pluginsDefinition.requires
}
},
printEnabled: true,
rootReducerFunc: standardRootReducerFunc,
onStoreInit,
appReducers: {
...standardReducers,
gnresource,
resourceservice,
gnsettings,
security,
maptype,
print,
maplayout,
controls,
timeline,
dimension,
playback,
mapPopups,
catalog,
searchconfig,
widgets,
geostory,
gnsearch,
notifications,
context,
...pluginsDefinition.reducers
},
appEpics,
geoNodeConfiguration,
initialActions: [
// add some settings in the global state to make them accessible in the monitor state
// later we could use expression in localConfig
updateGeoNodeSettings.bind(null, settings),
loadPrintCapabilities.bind(null, getConfigProp('printUrl'))
]
},
withExtensions(StandardApp));
});

})
Expand Down
6 changes: 3 additions & 3 deletions geonode_mapstore_client/client/js/apps/gn-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
getPluginsConfiguration,
getPluginsConfigOverride
} from '@js/utils/AppUtils';
import pluginsDefinition, { storeEpicsNamesToExclude } from '@js/plugins/index';
import pluginsDefinition, { storeEpicsNamesToExclude, cleanEpics } from '@js/plugins/index';
import StandardApp from '@mapstore/framework/components/app/StandardApp';
import withExtensions from '@mapstore/framework/components/app/withExtensions';
import gnsettings from '@js/reducers/gnsettings';
Expand Down Expand Up @@ -62,9 +62,9 @@ document.addEventListener('DOMContentLoaded', function() {
settings
}) => {

const appEpics = {
const appEpics = cleanEpics({
...configEpics
};
});

storeEpicsNamesToExclude(appEpics);

Expand Down
Loading

0 comments on commit fb96bc2

Please sign in to comment.