Skip to content

Commit eaa85ec

Browse files
authored
Review documentation (#2274)
1 parent 5342935 commit eaa85ec

File tree

13 files changed

+736
-1754
lines changed

13 files changed

+736
-1754
lines changed

CHANGELOG.md

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

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,

geonode_mapstore_client/client/js/plugins/Favorites/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ const ConnectedFavorites = connect(
2525
)(Favorites);
2626

2727
/**
28-
* renders a button inside the resource card to add/remove a resource to user favorites
28+
* @module Favorites
29+
*/
30+
31+
/**
32+
* Renders a button inside the resource card to add/remove a resource to user favorites
2933
* @name Favorites
30-
* @class
31-
* @memberof plugins
3234
*/
3335
export default createPlugin('Favorites', {
3436
component: () => null,

geonode_mapstore_client/client/js/plugins/ResourceDetails/ResourceDetails.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import DetailsPanel from '@js/plugins/ResourceDetails/containers/DetailsPanel';
4949
* @prop {array} tabs array of tab object representing the structure of the displayed info properties
5050
* @example
5151
* {
52-
* "name": "DetailViewer",
52+
* "name": "ResourceDetails",
5353
* "cfg": {
5454
* "tabs": [
5555
* {

geonode_mapstore_client/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geonode-mapstore-client",
3-
"version": "4.0.0",
3+
"version": "master",
44
"description": "MapStore 2 bundles specific to geonode framework",
55
"eslintConfig": {
66
"extends": [

tutorials/02-theme-variables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The GeoNode theme allows to override colors with [css variables](https://develop
33

44
Here the steps to overrides the variables:
55

6-
- add a style tag in the template. it is possible to use the `geonode-mapstore-client/snippets/custom_theme.html` template included in all the pages.
6+
- add a style tag in the template. it is possible to use the **geonode-mapstore-client/snippets/custom_theme.html** template included in all the pages.
77

88
```html
99
<style>
@@ -16,7 +16,7 @@ Here the steps to overrides the variables:
1616
<style>
1717
/* msgapi is the selector wrapper of the page */
1818
.msgapi .gn-theme {
19-
--gn-primary: #74cfe2;
19+
--ms-primary: #74cfe2;
2020
}
2121
</style>
2222
```

tutorials/03-override-local-config.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,70 @@ Note: not all configuration can be applied to the geonode-mapstore-client becaus
4949
<script>
5050
window.__GEONODE_CONFIG__.overrideLocalConfig = function(localConfig) {
5151
// an example on how you can apply configuration to existing plugins
52-
// example: How to change configuration of visible properties in all DetailViewer panels including the one in the catalog (ResourcesGrid)
53-
52+
// example: How to change configuration of visible properties in all ResourceDetails
53+
// in this example the configuration is using expression to provide value,
54+
// learn more about MapStore dynamic configuration at:
55+
// https://docs.mapstore.geosolutionsgroup.com/en/latest/developer-guide/plugins-documentation/#dynamic-configuration
5456
Object.keys(localConfig.plugins).forEach((pageName) => {
5557
localConfig.plugins[pageName].forEach((plugin) => {
56-
if (['DetailViewer', 'ResourcesGrid'].includes(plugin.name) && plugin.cfg && (plugin.cfg.tabs || plugin.cfg.detailsTabs)) {
57-
(plugin.cfg.tabs || plugin.cfg.detailsTabs).forEach((tab) => {
58-
if (Array.isArray(tab.items)) {
59-
// eg. remove the language row
60-
tab.items = tab.items.filter((item) => !['gnviewer.language'].includes(item.labelId));
61-
}
62-
});
58+
if (['ResourceDetails'].includes(plugin.name)) {
59+
plugin.cfg = {
60+
...plugin.cfg,
61+
"tabs": [
62+
{
63+
"type": "tab",
64+
"id": "info",
65+
"labelId": "gnviewer.info",
66+
"items": [
67+
{
68+
"type": "text",
69+
"labelId": "gnviewer.title",
70+
"value": "{context.get(state('gnResourceData'), 'title')}"
71+
}
72+
]
73+
},
74+
{
75+
"type": "locations",
76+
"id": "locations",
77+
"labelId": "gnviewer.locations",
78+
"items": "{({extent: context.get(state('gnResourceData'), 'extent')})}"
79+
},
80+
{
81+
"type": "relations",
82+
"id": "related",
83+
"labelId": "gnviewer.linkedResources.label",
84+
"items": "{context.get(state('gnResourceData'), 'linkedResources')}"
85+
},
86+
{
87+
"type": "assets",
88+
"id": "assets",
89+
"labelId": "gnviewer.assets",
90+
"items": "{context.get(state('gnResourceData'), 'assets')}",
91+
"disableIf": "{!context.resourceHasPermission(state('gnResourceData'), 'change_resourcebase')}"
92+
},
93+
{
94+
"type": "data",
95+
"id": "data",
96+
"labelId": "gnviewer.data",
97+
"disableIf": "{context.get(state('gnResourceData'), 'resource_type') !== 'dataset'}",
98+
"items": "{context.get(state('gnResourceData'), 'attribute_set')}"
99+
},
100+
{
101+
"type": "share",
102+
"id": "share",
103+
"labelId": "gnviewer.share",
104+
"disableIf": "{!context.canAccessPermissions(state('gnResourceData'))}",
105+
"items": [true]
106+
},
107+
{
108+
"type": "settings",
109+
"id": "settings",
110+
"labelId": "gnviewer.settings",
111+
"disableIf": "{!context.canManageResourceSettings(state('gnResourceData'))}",
112+
"items": [true]
113+
}
114+
]
115+
}
63116
}
64117
});
65118
});

0 commit comments

Comments
 (0)