Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1741: Update master with changes from mapviewer #1743

Merged
merged 53 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
591fc14
update mapstore submodule to latest master
allyoucanmap Jan 18, 2024
28972c2
add mapviewer resource type
allyoucanmap Jan 18, 2024
31cfe93
add context creator for map viewer
allyoucanmap Jan 19, 2024
3c5cdbc
add initial connection betweem mapviewer and map resources
allyoucanmap Jan 24, 2024
dca69e6
review plugins available in the map viewer resource
allyoucanmap Jan 26, 2024
ae1a867
Mapviewer resource are made unadvertized by default (#1668)
dsuren1 Feb 13, 2024
0800aa4
User extension plugin invocation improvement (#1671)
dsuren1 Feb 13, 2024
23ce936
Implement delete workflow for mapviewer resource (#1669)
dsuren1 Feb 13, 2024
bdddb2b
Enhance the action navbar menu items (#1672)
dsuren1 Feb 13, 2024
0dddb4a
Upgrade to Django 4 (#1673)
giohappy Feb 13, 2024
83395ac
Builds for mapviewer branch
giohappy Feb 13, 2024
7eba26e
build pr on right branch
giohappy Feb 13, 2024
b4f9906
[create-pull-request] automated change (#1674)
geosolutions-pr-generator[bot] Feb 13, 2024
87f1ac9
Fix - Duplicated API requests on viewer resource load (#1676)
dsuren1 Feb 29, 2024
23c0ffc
Enhance link system between map and mapviewers (#1677)
dsuren1 Feb 29, 2024
9f842a0
Configuration update for the plugins available inside the context cre…
dsuren1 Feb 29, 2024
49c2b35
Merge upstream (#1681)
giohappy Feb 29, 2024
7236329
[create-pull-request] automated change (#1682)
geosolutions-pr-generator[bot] Feb 29, 2024
173f420
#1683: Enable the 3D plugin in the default GeoNode map configuration …
dsuren1 Mar 1, 2024
a8ea649
#1685 - Fix: Mapviewer doesn't show configure plugin steps (#1686)
dsuren1 Mar 4, 2024
b849994
Merge branch 'mapviewer-resource-built' into mapviewer-resource
dsuren1 Mar 4, 2024
902c94c
Merge #1685 (#1687)
giohappy Mar 4, 2024
05fa301
[create-pull-request] automated change (#1688)
geosolutions-pr-generator[bot] Mar 4, 2024
a6102ff
#1689: Add a warning when closing an unsaved map viewer (#1690)
dsuren1 Mar 5, 2024
cc524c2
Merge branch 'mapviewer-resource-built' into mapviewer-resource
giohappy Mar 5, 2024
60d963a
Revert "Merge branch 'mapviewer-resource-built' into mapviewer-resource"
giohappy Mar 6, 2024
fef5ab4
[create-pull-request] automated change (#1694)
geosolutions-pr-generator[bot] Mar 6, 2024
a9fdc6e
#1695 - Remove selection of LongitudinalProfileTool plugin from map v…
dsuren1 Mar 13, 2024
4e50ce3
#1695 - Remove selection of LongitudinalProfileTool plugin from map v…
giohappy Mar 13, 2024
c8737d9
#1699: Add mapviewers to filter panel (#1700)
dsuren1 Mar 15, 2024
716e32e
Mapviewer resource (#1701)
giohappy Mar 15, 2024
e3fb844
[create-pull-request] automated change (#1702)
geosolutions-pr-generator[bot] Mar 15, 2024
c6115e5
#1704: Enhance fetching linked resources in map viewer (#1705)
dsuren1 Mar 28, 2024
07d12ef
Merge branch 'mapviewer-resource' into mapviewer-resource-built
giohappy Mar 28, 2024
0448139
[create-pull-request] automated change (#1706)
geosolutions-pr-generator[bot] Mar 28, 2024
4cbbf97
update mapstore submodule to branch 2024.01.xx
allyoucanmap Apr 11, 2024
58c8e34
[create-pull-request] automated change (#1713)
geosolutions-pr-generator[bot] Apr 12, 2024
963c47b
fix ifc lib location
allyoucanmap Apr 12, 2024
0d45111
[create-pull-request] automated change (#1714)
geosolutions-pr-generator[bot] Apr 12, 2024
9b81f3f
Update mapstore submodule to branch 2024.01.xx (#1712)
allyoucanmap Apr 15, 2024
eb49593
[Backport] #1710 - Update calls with catalog_list preset (#1711) (#1716)
dsuren1 Apr 17, 2024
b9af3d3
Merge updates (#1717)
giohappy Apr 17, 2024
45baeb3
[create-pull-request] automated change (#1718)
geosolutions-pr-generator[bot] Apr 17, 2024
c885618
#1720: Improve layer setting visualisation (#1721)
dsuren1 Apr 18, 2024
90578be
#1722: Fix - LayerSettings select dropdown are covered by titles (#1723)
dsuren1 Apr 18, 2024
7d3f646
Mapviewer resource (#1724)
giohappy Apr 18, 2024
cca247a
#1726: Fix - Tile format select input not shown (#1727)
dsuren1 Apr 18, 2024
22ca1df
#1732: Fix - Chart widget header style (#1733)
dsuren1 Apr 22, 2024
4f80dac
Merge branch 'mapviewer-resource-built' into mapviewer-resource
dsuren1 Apr 22, 2024
1ddecd8
#1735: Fix - Map and other resources are loading indefinitely (#1736)
dsuren1 Apr 24, 2024
3e39cfa
#1728: Fix - Missing scrollbar for legend in datasets (#1729)
dsuren1 Apr 29, 2024
e74e922
#1730: Fix - Incorrect positioning of panels (#1731)
dsuren1 Apr 29, 2024
72014ed
#1741: Merge mapviewer branch into master
dsuren1 May 6, 2024
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 .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 = 2022.02.xx
branch = 2024.01.xx
13 changes: 11 additions & 2 deletions geonode_mapstore_client/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def run_setup_hooks(*args, **kwargs):
"default": OWNER_PERMISSIONS,
groups_settings.REGISTERED_MEMBERS_GROUP_NAME: OWNER_PERMISSIONS,
}
setattr(settings, "CLIENT_APP_LIST", ["geostory", "dashboard"])
setattr(settings, "CLIENT_APP_LIST", ["geostory", "dashboard", "mapviewer"])
setattr(
settings,
"CLIENT_APP_ALLOWED_PERMS_LIST",
[{"geostory": allowed_perms}, {"dashboard": allowed_perms}],
[{"geostory": allowed_perms}, {"dashboard": allowed_perms}, {"mapviewer": allowed_perms}],
)
setattr(
settings,
Expand All @@ -58,6 +58,14 @@ def run_setup_hooks(*args, **kwargs):
"manage": _("Manage"),
"owner": _("Owner"),
},
"mapviewer": {
"none": _("None"),
"view": _("View"),
"download": _("Download"),
"edit": _("Edit"),
"manage": _("Manage"),
"owner": _("Owner"),
},
},
)

Expand Down Expand Up @@ -85,6 +93,7 @@ def run_setup_hooks(*args, **kwargs):
**{
"geostory": settings.DEFAULT_EXTRA_METADATA_SCHEMA,
"dashboard": settings.DEFAULT_EXTRA_METADATA_SCHEMA,
"mapviewer": settings.DEFAULT_EXTRA_METADATA_SCHEMA,
},
}

Expand Down
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/MapStore2
Submodule MapStore2 updated 2104 files
2 changes: 1 addition & 1 deletion geonode_mapstore_client/client/devServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ module.exports = (devServerDefault, projectConfig) => {
}
]
};
};
};
36 changes: 33 additions & 3 deletions geonode_mapstore_client/client/js/actions/gnresource.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export const DOWNLOAD_RESOURCE = 'GEONODE_DOWNLOAD_RESOURCE';
export const DOWNLOAD_COMPLETE = 'GEONODE_DOWNLOAD_COMPLETE';
export const UPDATE_SINGLE_RESOURCE = 'GEONODE_UPDATE_SINGLE_RESOURCE';
export const SET_RESOURCE_EXTENT = 'GEONODE_SET_RESOURCE_EXTENT';

export const SET_RESOURCE_PATH_PARAMETERS = 'GEONODE:SET_RESOURCE_PATH_PARAMETERS';
export const SET_MAP_VIEWER_LINKED_RESOURCE = 'GEONODE:SET_MAP_VIEWER_LINKED_RESOURCE';
export const MANAGE_LINKED_RESOURCE = 'GEONODE:MANAGE_LINKED_RESOURCE';

/**
* Actions for GeoNode resource
Expand Down Expand Up @@ -243,10 +245,11 @@ export function requestResourceConfig(resourceType, pk, options) {
options
};
}
export function requestNewResourceConfig(resourceType) {
export function requestNewResourceConfig(resourceType, options) {
return {
type: REQUEST_NEW_RESOURCE_CONFIG,
resourceType
resourceType,
options
};
}

Expand Down Expand Up @@ -319,3 +322,30 @@ export function setResourceExtent(coords) {
coords
};
}

export function setResourcePathParameters(params) {
return {
type: SET_RESOURCE_PATH_PARAMETERS,
params
};
}

/**
* Manage linked resource by process type
*/
export function manageLinkedResource(payload) {
return {
type: MANAGE_LINKED_RESOURCE,
payload
};
}

/**
* Set map viewer linked resource
*/
export function setMapViewerLinkedResource(resource) {
return {
type: SET_MAP_VIEWER_LINKED_RESOURCE,
resource
};
}
17 changes: 16 additions & 1 deletion geonode_mapstore_client/client/js/api/geonode/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/

import axios from '@mapstore/framework/libs/ajax';
import getPluginsConfig from '@mapstore/framework/observables/config/getPluginsConfig';
import { getGeoNodeLocalConfig } from '@js/utils/APIUtils';

let cache = {};

Expand Down Expand Up @@ -45,8 +47,21 @@ export const getStyleTemplates = (styleTemplatesUrl = '/static/mapstore/configs/
});
};

export const getDefaultPluginsConfig = () => {
return cache?.pluginsConfig
? Promise.resolve(cache.pluginsConfig)
: getPluginsConfig(
getGeoNodeLocalConfig('geoNodeSettings.staticPath', '/static/') + 'mapstore/configs/pluginsConfig.json'
)
.then((pluginsConfig) => {
cache.pluginsConfig = pluginsConfig;
return pluginsConfig;
});
};

export default {
getNewMapConfiguration,
getNewGeoStoryConfig,
getStyleTemplates
getStyleTemplates,
getDefaultPluginsConfig
};
83 changes: 69 additions & 14 deletions geonode_mapstore_client/client/js/api/geonode/v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const getResources = ({
};
return axios.get(parseDevHostname(endpoints[RESOURCES]), {
params: _params,
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => {
return {
Expand Down Expand Up @@ -182,7 +182,7 @@ export const getMaps = ({
page_size: pageSize,
api_preset: API_PRESET.MAPS
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => {
return {
Expand Down Expand Up @@ -218,7 +218,7 @@ export const getDatasets = ({
page_size: pageSize,
api_preset: API_PRESET.DATASETS
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => {
return {
Expand Down Expand Up @@ -255,7 +255,7 @@ export const getDocumentsByDocType = (docType = 'image', {
page_size: pageSize,
api_preset: API_PRESET.DOCUMENTS
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => {
return {
Expand Down Expand Up @@ -304,6 +304,24 @@ export const getLinkedResourcesByPk = (pk) => {
.then(({ data }) => data ?? {});
};

export const setLinkedResourcesByPk = (sourcePk, targetPks) => {
return axios.post(parseDevHostname(`${endpoints[RESOURCES]}/${sourcePk}/linked_resources`),
{
target: castArray(targetPks)
}
)
.then(({ data }) => data ?? {});
};

export const removeLinkedResourcesByPk = (sourcePk, targetPks) => {
return axios.delete(parseDevHostname(`${endpoints[RESOURCES]}/${sourcePk}/linked_resources`), {
data: {
target: castArray(targetPks)
}
})
.then(({ data }) => data ?? {});
};

export const getResourceByUuid = (uuid) => {
return axios.get(parseDevHostname(`${endpoints[RESOURCES]}`), {
params: {
Expand All @@ -319,7 +337,7 @@ export const getDatasetByPk = (pk) => {
params: {
api_preset: [API_PRESET.VIEWER_COMMON, API_PRESET.DATASET]
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => data.dataset);
};
Expand All @@ -329,7 +347,7 @@ export const getDocumentByPk = (pk) => {
params: {
api_preset: [API_PRESET.VIEWER_COMMON, API_PRESET.DOCUMENT]
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => data.document);
};
Expand All @@ -342,7 +360,7 @@ export const getDocumentsByPk = (pk) => {
page_size: pks.length,
api_preset: [API_PRESET.VIEWER_COMMON, API_PRESET.DOCUMENT]
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => data.documents);
};
Expand All @@ -367,6 +385,40 @@ export const getGeoAppByPk = (pk) => {
.then(({ data }) => data.geoapp);
};

export const getGeoApps = ({
q,
pageSize = 20,
page = 1,
sort,
...params
}) => {
return axios
.get(
parseDevHostname(endpoints[GEOAPPS]), {
// axios will format query params array to `key[]=value1&key[]=value2`
params: {
...params,
...(q && {
search: q,
search_fields: ['title', 'abstract']
}),
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
page,
page_size: pageSize
},
...paramsSerializer()
})
.then(({ data }) => {
return {
totalCount: data.total,
isNextPageAvailable: !!data.links.next,
resources: (data.geoapps || [])
.map((resource) => {
return resource;
})
};
});
};

export const updateGeoApp = (pk, body) => {
return axios.patch(parseDevHostname(`${endpoints[GEOAPPS]}/${pk}`), body, {
Expand Down Expand Up @@ -406,7 +458,7 @@ export const getUsers = ({
page,
page_size: pageSize
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => {
return {
Expand Down Expand Up @@ -435,7 +487,7 @@ export const getGroups = ({
page,
page_size: pageSize
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => {
return {
Expand Down Expand Up @@ -599,7 +651,8 @@ export const updateMap = (id, body = {}) => {
/**
* Get a map configuration
* @memberof api.geonode.adapter
* @param {number|string} id resource id
* @param {number|string} pk resource id
* @param {string[]} includes property to be included in the response
* @return {promise} it returns an object with the success map object response
*/
export const getMapByPk = (pk) => {
Expand All @@ -608,7 +661,7 @@ export const getMapByPk = (pk) => {
params: {
api_preset: [API_PRESET.VIEWER_COMMON, API_PRESET.MAP]
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => data?.map);
};
Expand All @@ -622,7 +675,7 @@ export const getMapsByPk = (pk) => {
page_size: pks.length,
api_preset: API_PRESET.MAPS
},
paramsSerializer
...paramsSerializer()
})
.then(({ data }) => data?.maps);
};
Expand Down Expand Up @@ -786,7 +839,7 @@ export const getFacetItemsByFacetName = ({ name: facetName, style, filterKey, fi
return axios.get(`${parseDevHostname(endpoints[FACETS])}/${facetName}`,
{ ...config,
params: updatedParams,
paramsSerializer
...paramsSerializer()
}
).then(({data}) => {
const {page: _page = 0, items: _items = [], total, page_size: size} = data?.topics ?? {};
Expand Down Expand Up @@ -837,7 +890,7 @@ export const getFacetItemsByFacetName = ({ name: facetName, style, filterKey, fi

export const getFacetsByKey = (facet, filterParams) => {
return axios
.get(parseDevHostname(endpoints[FACETS] + `/${facet}`), {params: {...filterParams}, paramsSerializer})
.get(parseDevHostname(endpoints[FACETS] + `/${facet}`), {params: {...filterParams}, ...paramsSerializer()})
.then(({ data } = {}) => ({
...data?.topics,
items: data?.topics?.items?.map(item => ({...item, facetName: facet}))
Expand Down Expand Up @@ -865,6 +918,8 @@ export default {
getResources,
getResourceByPk,
getLinkedResourcesByPk,
setLinkedResourcesByPk,
removeLinkedResourcesByPk,
getResourceByUuid,
createGeoApp,
getGeoAppByPk,
Expand Down
20 changes: 6 additions & 14 deletions geonode_mapstore_client/client/js/apps/gn-catalogue.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ import mapPopups from '@mapstore/framework/reducers/mapPopups';
import catalog from '@mapstore/framework/reducers/catalog';
import searchconfig from '@mapstore/framework/reducers/searchconfig';
import widgets from '@mapstore/framework/reducers/widgets';
import annotations from '@mapstore/framework/reducers/annotations';
import context from '@mapstore/framework/reducers/context';
// end

import ViewerRoute from '@js/routes/Viewer';
import UploadDatasetRoute from '@js/routes/UploadDataset';
import UploadDocumentRoute from '@js/routes/UploadDocument';
import CatalogueRoute from '@js/routes/Catalogue';
import MapViewerRoute from '@js/routes/MapViewer';

import gnsearch from '@js/reducers/gnsearch';
import gnresource from '@js/reducers/gnresource';
Expand Down Expand Up @@ -104,7 +105,8 @@ const viewers = {
[appRouteComponentTypes.VIEWER]: ViewerRoute,
[appRouteComponentTypes.CATALOGUE]: CatalogueRoute,
[appRouteComponentTypes.DATASET_UPLOAD]: UploadDatasetRoute,
[appRouteComponentTypes.DOCUMENT_UPLOAD]: UploadDocumentRoute
[appRouteComponentTypes.DOCUMENT_UPLOAD]: UploadDocumentRoute,
[appRouteComponentTypes.MAP_VIEWER]: MapViewerRoute
};

const routes = CATALOGUE_ROUTES.map(({ component, ...config }) => ({ ...config, component: viewers[component] }));
Expand Down Expand Up @@ -163,17 +165,7 @@ getEndpoints()
loaderComponent: MainLoader,
initialState: {
defaultState: {
...securityState,
maptype: {
mapType
},
annotations: {
config: {
multiGeometry: true,
validationErrors: {}
},
defaultTextAnnotation: 'New'
}
...securityState
}
},
themeCfg: null,
Expand Down Expand Up @@ -209,8 +201,8 @@ getEndpoints()
widgets,
geostory,
gnsearch,
annotations,
notifications,
context,
...pluginsDefinition.reducers
},
appEpics,
Expand Down
Loading
Loading