Skip to content

Commit c7d48a5

Browse files
Geonode homepage (#2042)
* replace resources catalog components * Add missing translations (#2011) * Remove duplicated fullscreen button (#2014) * Fix - Metadata side panel list style (#2012) * Add space to avoid overlapping of resource and pagination (#2013) * Accordion style update (#2033) * Fix - ActionNavbar style (#2015) * Fix - Resource cards are not highlighted when the details are open (#2018) * Move Permissions to Resource details panel (#2017) * Update geonode-home to latest MS master (#2041) * add existing changes * code refactor * update unit tests --------- Co-authored-by: allyoucanmap <[email protected]>
1 parent 8fbc966 commit c7d48a5

File tree

223 files changed

+3606
-13362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+3606
-13362
lines changed

geonode_mapstore_client/apps.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def run_setup_hooks(*args, **kwargs):
8585
),
8686
re_path(r"^metadata/(?P<pk>[^/]*)$", views.metadata, name='metadata'),
8787
re_path(r"^metadata/(?P<pk>[^/]*)/embed$", views.metadata_embed, name='metadata'),
88+
re_path(r"^(?P<resource_type>[^/]*)$", views.resource_type_catalog, name='resource_type_catalog'),
8889
# required, otherwise will raise no-lookup errors to be analysed
8990
re_path(r"^api/v2/", include(router.urls)),
9091
]
@@ -120,7 +121,9 @@ def run_setup_hooks(*args, **kwargs):
120121
"subtype",
121122
"title",
122123
"executions",
123-
"thumbnail_url"
124+
"thumbnail_url",
125+
"created",
126+
"favorite"
124127
],
125128
}
126129
settings.REST_API_PRESETS["dataset_list"] = {
@@ -230,6 +233,11 @@ def run_setup_hooks(*args, **kwargs):
230233
"featured"
231234
],
232235
}
236+
settings.REST_API_PRESETS["map_details"] = {
237+
"include[]": [
238+
"maplayers"
239+
]
240+
}
233241
settings.REST_API_PRESETS["map_viewer"] = {
234242
"include[]": [
235243
"data",
Submodule MapStore2 updated 368 files

geonode_mapstore_client/client/js/actions/gnresource.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const SET_DEFAULT_VIEWER_PLUGINS = 'GEONODE:SET_DEFAULT_VIEWER_PLUGINS';
4242
export const SET_SELECTED_LAYER = 'GEONODE:SET_SELECTED_LAYER';
4343
export const UPDATE_LAYER_DATASET = 'GEONODE:UPDATE_LAYER_DATASET';
4444
export const SET_SELECTED_LAYER_DATASET = 'GEONODE:SET_SELECTED_LAYER_DATASET';
45+
export const REQUEST_RESOURCE = 'GEONODE:REQUEST_RESOURCE';
4546

4647
/**
4748
* Actions for GeoNode resource
@@ -394,3 +395,10 @@ export function setLayerDataset(layerId) {
394395
layerId
395396
};
396397
}
398+
399+
export function requestResource(resource) {
400+
return {
401+
type: REQUEST_RESOURCE,
402+
resource
403+
};
404+
}

geonode_mapstore_client/client/js/actions/gnsearch.js

Lines changed: 0 additions & 155 deletions
This file was deleted.

geonode_mapstore_client/client/js/api/geonode/v2/constants.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import {
1111
getApiToken,
1212
getGeoNodeLocalConfig
1313
} from '@js/utils/APIUtils';
14+
import mergeWith from 'lodash/mergeWith';
15+
import isArray from 'lodash/isArray';
16+
import isString from 'lodash/isString';
17+
import castArray from 'lodash/castArray';
18+
import omit from 'lodash/omit';
1419

1520
let endpoints = {
1621
// default values
@@ -69,3 +74,37 @@ export const getEndpoints = () => {
6974
return data;
7075
});
7176
};
77+
78+
function mergeCustomQuery(params, customQuery) {
79+
if (customQuery) {
80+
return mergeWith(
81+
{ ...params },
82+
{ ...customQuery },
83+
(objValue, srcValue) => {
84+
if (isArray(objValue) && isArray(srcValue)) {
85+
return [...objValue, ...srcValue];
86+
}
87+
if (isString(objValue) && isArray(srcValue)) {
88+
return [objValue, ...srcValue];
89+
}
90+
if (isArray(objValue) && isString(srcValue)) {
91+
return [...objValue, srcValue];
92+
}
93+
if (isString(objValue) && isString(srcValue)) {
94+
return [ objValue, srcValue ];
95+
}
96+
return undefined; // eslint-disable-line consistent-return
97+
}
98+
);
99+
}
100+
return params;
101+
}
102+
export const getQueryParams = (params, customFilters) => {
103+
const customQuery = customFilters
104+
.filter(({ id }) => castArray(params?.f ?? []).indexOf(id) !== -1)
105+
.reduce((acc, filter) => mergeCustomQuery(acc, filter.query || {}), {}) || {};
106+
return {
107+
...mergeCustomQuery(omit(params, "f"), customQuery)
108+
};
109+
};
110+

0 commit comments

Comments
 (0)