Skip to content

Commit 971cd42

Browse files
Anup DahalAnup Dahal
authored andcommitted
Merge branch 'master' of github.com:GeoNode/geonode-mapstore-client into feat_geotag_photo
2 parents 4f2ec0f + bcc23f3 commit 971cd42

File tree

553 files changed

+1249
-1886
lines changed

Some content is hidden

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

553 files changed

+1249
-1886
lines changed

.github/workflows/static.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
2+
name: Deploy static master branch content to Pages
33

44
on:
55
# Runs on pushes targeting the default branch
@@ -21,54 +21,46 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
jobs:
24-
# Single deploy job since we're just deploying
24+
2525
deploy:
2626
environment:
2727
name: github-pages
2828
url: ${{ steps.deployment.outputs.page_url }}
2929
runs-on: ubuntu-latest
3030
steps:
31+
3132
- name: Checkout master
3233
uses: actions/checkout@v4
3334
with:
3435
ref: master
3536

36-
###########
37-
# SET UP
38-
#########
3937
- name: "Setting up npm"
4038
uses: actions/setup-node@v4
4139
with:
4240
node-version: 20
4341

44-
############
45-
# CACHING
46-
##########
47-
- name: "Cache node modules"
48-
uses: actions/cache@v4
49-
env:
50-
cache-name: cache-node-modules
51-
with:
52-
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
53-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
54-
restore-keys: |
55-
${{ runner.os }}-build-${{ env.cache-name }}-
56-
${{ runner.os }}-build-
57-
${{ runner.os }}-
58-
5942
- name: Install build dependencies
6043
run: |
61-
mkdir ../gh-pages
6244
npm install [email protected] -g
6345
npm install @jsdoc/[email protected] -g
6446
47+
- name: Restore previous github-pages artifact
48+
run: |
49+
wget https://geonode.org/geonode-mapstore-client/artifact.zip
50+
unzip artifact.zip
51+
mv gh-pages/ ../gh-pages
52+
6553
- name: Build master documentation
6654
run: |
6755
cd ./geonode_mapstore_client/client/
6856
npm run docs
6957
cd ../../
7058
cp -a ./geonode_mapstore_client/static/fonts/. ./docs/fonts/
59+
rm -rf ../gh-pages/master
7160
mv ./docs ../gh-pages/master
61+
cd ../
62+
zip -r artifact.zip gh-pages/
63+
mv artifact.zip gh-pages/artifact.zip
7264
7365
- name: Setup Pages
7466
uses: actions/configure-pages@v2
@@ -77,6 +69,7 @@ jobs:
7769
uses: actions/upload-pages-artifact@v3
7870
with:
7971
# Upload entire repository
72+
name: github-pages
8073
path: '../gh-pages'
8174

8275
- name: Deploy to GitHub Pages

CHANGELOG.md

Lines changed: 0 additions & 1343 deletions
This file was deleted.
Submodule MapStore2 updated 83 files

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
paramsSerializer,
1313
getGeoNodeConfig,
1414
getGeoNodeLocalConfig,
15-
API_PRESET
15+
API_PRESET,
16+
getResourcesSearchIndex
1617
} from '@js/utils/APIUtils';
1718
import merge from 'lodash/merge';
1819
import mergeWith from 'lodash/mergeWith';
@@ -62,7 +63,7 @@ export const getResources = ({
6263
...getQueryParams({...params, f}, customFilters),
6364
...(q && {
6465
search: q,
65-
search_fields: ['title', 'abstract']
66+
search_index: getResourcesSearchIndex()
6667
}),
6768
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
6869
page,
@@ -102,7 +103,7 @@ export const getMaps = ({
102103
...params,
103104
...(q && {
104105
search: q,
105-
search_fields: ['title', 'abstract']
106+
search_index: getResourcesSearchIndex()
106107
}),
107108
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
108109
page,
@@ -138,7 +139,7 @@ export const getDatasets = ({
138139
'filter{metadata_only}': false,
139140
...(q && {
140141
search: q,
141-
search_fields: ['title', 'abstract']
142+
search_index: getResourcesSearchIndex()
142143
}),
143144
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
144145
page,
@@ -211,7 +212,7 @@ export const getDocumentsByDocType = (docType = 'image', {
211212
...params,
212213
...(q && {
213214
search: q,
214-
search_fields: ['title', 'abstract']
215+
search_index: getResourcesSearchIndex()
215216
}),
216217
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
217218
'filter{subtype}': [docType],
@@ -375,7 +376,7 @@ export const getGeoApps = ({
375376
...params,
376377
...(q && {
377378
search: q,
378-
search_fields: ['title', 'abstract']
379+
search_index: getResourcesSearchIndex()
379380
}),
380381
...(sort && { sort: isArray(sort) ? sort : [ sort ]}),
381382
page,

geonode_mapstore_client/client/js/epics/gnresource.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ import {
113113
success as successNotification,
114114
warning as warningNotification
115115
} from '@mapstore/framework/actions/notifications';
116-
import { convertDependenciesMappingForCompatibility } from '@mapstore/framework/utils/WidgetsUtils';
116+
import {
117+
convertDependenciesMappingForCompatibility,
118+
updateDependenciesForMultiViewCompatibility
119+
} from '@mapstore/framework/utils/WidgetsUtils';
117120
import {
118121
setResource as setContextCreatorResource,
119122
enableMandatoryPlugins,
@@ -320,9 +323,10 @@ const resourceTypes = {
320323
newResourceObservable: (options) =>
321324
Observable.defer(() => getNewGeoStoryConfig())
322325
.switchMap((gnGeoStory) => {
326+
const currentStory = options.data || {...gnGeoStory, sections: [{...gnGeoStory.sections[0], id: uuid(),
327+
contents: [{...gnGeoStory.sections[0].contents[0], id: uuid()}]}]};
323328
return Observable.of(
324-
setCurrentStory(options.data || {...gnGeoStory, sections: [{...gnGeoStory.sections[0], id: uuid(),
325-
contents: [{...gnGeoStory.sections[0].contents[0], id: uuid()}]}]}),
329+
setCurrentStory({...currentStory, defaultGeoStoryConfig: {...currentStory}}),
326330
setEditing(true),
327331
setGeoStoryResource({
328332
canEdit: true
@@ -358,7 +362,9 @@ const resourceTypes = {
358362
lastUpdate: resource.last_updated,
359363
name: resource.title
360364
},
361-
options.data ? convertDependenciesMappingForCompatibility(options.data) : convertDependenciesMappingForCompatibility(resource.data)
365+
options.data
366+
? updateDependenciesForMultiViewCompatibility(convertDependenciesMappingForCompatibility(options.data))
367+
: updateDependenciesForMultiViewCompatibility(convertDependenciesMappingForCompatibility(resource.data))
362368
),
363369
setResource(resource),
364370
setResourceId(pk)
@@ -374,7 +380,7 @@ const resourceTypes = {
374380
canDelete: true,
375381
canEdit: true
376382
},
377-
convertDependenciesMappingForCompatibility(options.data)
383+
updateDependenciesForMultiViewCompatibility(convertDependenciesMappingForCompatibility(options.data))
378384
)
379385
] : []),
380386
dashboardLoading(false)

geonode_mapstore_client/client/js/observables/persistence/index.js

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,36 @@
88

99
import { Observable } from 'rxjs';
1010
import { addApi, setApi } from '@mapstore/framework/api/persistence';
11-
import { getMaps, getMapByPk, getResources as gnGetResources } from '@js/api/geonode/v2';
11+
import { getMaps, getMapByPk, getGeoAppByPk, getResources as gnGetResources } from '@js/api/geonode/v2';
1212
import { getFacetItems } from '@js/api/geonode/v2/facets';
13-
import { parseCatalogResource } from '@js/utils/ResourceUtils';
13+
import { parseCatalogResource, ResourceTypes } from '@js/utils/ResourceUtils';
1414
import { getCustomMenuFilters } from '@js/selectors/config';
1515

16-
const getResource = (pk) => {
17-
return Observable.defer(() => {
18-
return getMapByPk(pk)
19-
.then((resource) => {
20-
return {
21-
...resource,
22-
data: {
23-
...resource?.data,
24-
map: {
25-
...resource?.data?.map,
26-
extraParams: {
27-
...resource?.data?.map?.extraParams,
28-
// add the original pk to keep track in future synchronizations
29-
pk: resource?.pk
16+
const getResource = (pk, category) => {
17+
return Observable.defer(() =>
18+
category === ResourceTypes.DASHBOARD
19+
? getGeoAppByPk(pk)
20+
.then((resource) => {
21+
return resource;
22+
})
23+
: getMapByPk(pk)
24+
.then((resource) => {
25+
return {
26+
...resource,
27+
data: {
28+
...resource?.data,
29+
map: {
30+
...resource?.data?.map,
31+
extraParams: {
32+
...resource?.data?.map?.extraParams,
33+
// add the original pk to keep track in future synchronizations
34+
pk: resource?.pk
35+
}
3036
}
3137
}
32-
}
33-
};
34-
});
35-
});
38+
};
39+
})
40+
);
3641
};
3742

3843
const getResources = ({ category, options, query }) => {

geonode_mapstore_client/client/js/plugins/CreateDataset/containers/CreateDataset.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { getEndpointUrl, EXECUTION_REQUEST } from '@js/api/geonode/v2/constants'
4343
* @param {Object} props - The component props
4444
* @param {Function} props.onError - The function to handle errors
4545
* @param {number} props.refreshTime - The time in milliseconds to refresh the execution status
46+
* @ignore
4647
*/
4748
const CreateDataset = ({
4849
onError = () => {},

geonode_mapstore_client/client/js/plugins/CreateDataset/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ import React, { Suspense, lazy } from 'react';
1111
import { createPlugin } from "@mapstore/framework/utils/PluginsUtils";
1212
const CreateDataset = lazy(() => import('./containers/CreateDataset'));
1313

14+
/**
15+
* @module CreateDataset
16+
*/
17+
1418
/**
1519
* Create new datasets with custom attributes and restrictions.
1620
* Also supports manual attribute creation or loading from JSON schema files.
1721
* @name CreateDataset
18-
* @memberof plugins
1922
* @example
2023
* // Sample JSON schema that can be loaded:
2124
* {

geonode_mapstore_client/client/js/plugins/CreateDataset/utils/CreateDatasetUtils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const DEFAULT_ATTRIBUTE = {
4141
* Parse a number string to a number
4242
* @param {string} value - The value to parse
4343
* @returns {number} The parsed number
44+
* @ignore
4445
*/
4546
export const parseNumber = (value) => {
4647
if (value === '') {
@@ -54,13 +55,15 @@ export const parseNumber = (value) => {
5455
* @param {Object} data - The data to get the attribute control id from
5556
* @param {string} suffix - The suffix to add to the attribute control id
5657
* @returns {string} The attribute control id
58+
* @ignore
5759
*/
5860
export const getAttributeControlId = (data, suffix) =>
5961
`attribute-${data?.id ?? ''}-${suffix}`;
6062

6163
/**
6264
* The JSON schema for the dataset
6365
* @type {Object}
66+
* @ignore
6467
*/
6568
export const validateSchema = {
6669
"type": "object",
@@ -260,6 +263,7 @@ export const validateSchema = {
260263
* Validate attribute data including range values and unique names
261264
* @param {Object} data - The data to validate
262265
* @returns {Array} The array of errors
266+
* @ignore
263267
*/
264268
export const validateAttributes = (data = {}) => {
265269
const errors = [];
@@ -308,6 +312,7 @@ export const validateAttributes = (data = {}) => {
308312
* @param {string} path - The path to the error
309313
* @param {Array} allErrors - The array of errors
310314
* @returns {string} The error message
315+
* @ignore
311316
*/
312317
export const getErrorByPath = (path, allErrors) => {
313318
const error = allErrors?.find(err => err.instancePath === path);
@@ -339,6 +344,7 @@ const JSON_SCHEMA_TYPE_TO_ATTRIBUTE_TYPE = {
339344
* Parse JSON Schema and convert it to dataset attributes
340345
* @param {Object} schema - The JSON Schema object
341346
* @returns {Object} - Parsed result with dataset data and any errors
347+
* @ignore
342348
*/
343349
export const parseJSONSchema = (schema) => {
344350
const errors = [];

geonode_mapstore_client/client/js/plugins/Favorites/containers/Favorites.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { castArray } from 'lodash';
2222
* @prop {function} onSearch trigger a refresh request after changing the favorite association
2323
* @prop {number} delayTime delay time to complete the request
2424
* @prop {string} renderType define the component type (eg. menuItem)
25+
* @ignore
2526
*/
2627
function Favorites({
2728
user,

0 commit comments

Comments
 (0)