diff --git a/geonode_mapstore_client/client/README.md b/geonode_mapstore_client/client/README.md
index 48dc85a0d8..8ee18951aa 100644
--- a/geonode_mapstore_client/client/README.md
+++ b/geonode_mapstore_client/client/README.md
@@ -1,29 +1,14 @@
# GeoNode MapStore Client Project
This directory is the root folder where to initialize all the npm scripts. See the main [README.md](../../README.md) for more information about this directory.
+## Configuration
-This project contains following applications:
-
-- [MapStore js API](#mapStore-js-api)
-- [GeoStory](#geostory)
-- [Homepage](#homepage)
-
-## MapStore js API
-Api used inside django templates to show map and layer viewers
-
-## GeoStory
-This application allow to show and edit stories with map and geospatial data
-## Homepage
-
-This single application is an alternative homepage that interact with the GeoNode API v2 and shows available resources. You can enable this app by replacing the content of the index.html of a GeoNode project with the [home.html](home.html) template.
-
-The homepage configuration file is located in [localConfig.json](static/mapstore/configs/localConfig.json) and it exposes specific properties to customize the homepage theme and structure:
+The configuration file is located in [localConfig.json](static/mapstore/configs/localConfig.json) and it exposes specific properties to customize:
### localConfig.json
| property | type | description | |
| --- | --- | --- | --- |
-| `geoNodeApi` | {object} | | |
| `supportedLocales` | {object} | | |
| `geoNodeConfiguration` | {object} | contains all the configuration needed to change the theme, filters and navbar structures | [see available properties](#geonode-configuration) |
@@ -33,7 +18,6 @@ The homepage configuration file is located in [localConfig.json](static/mapstore
| property | type | description | |
| --- | --- | --- | --- |
-| `theme` | {object} | general theme configuration variables | [see available properties](#theme-configuration) |
| `filters` | {object} | configuration of filter | |
| `filters.order` | {object} | configuration of order dropdown | |
| `filters.order.defaultLabelId` | {string} | label id to use for the order dropdown button | |
@@ -41,44 +25,12 @@ The homepage configuration file is located in [localConfig.json](static/mapstore
| `filters.extent` | {object} | configuration of extent filter | |
| `filters.extent.layers` | {array} | a list of MapStore layers object used as extent background | |
| `filters.extent.style` | {object} | a MapStore vector style object | |
-| `navbar` | {object} | configuration of the brand navbar (top) | |
-| `navbar.logo` | {array} | list of logo items | [logo item entry](#logo-item) |
-| `navbar.items` | {array} | list of menu item objects, right placement | [menu item object entry](#menu-item-object) |
-| `menu` | {object} | configuration of the main menu | |
-| `menu.items` | {array} | list of menu item objects, left placement | [menu item object entry](#menu-item-object) |
-| `menu.rightItems` | {array} | list of menu item objects, right placement | [menu item object entry](#menu-item-object) |
-| `menu.cfg.rightContents.style.width` | {number} | value to fix width in right side of action navbar | [menu item object entry](#menu-item-object) |
-| `footer` | {object} | configuration of the footer | |
-| `footer.items` | {array} | list of menu item objects, left placement | [menu item object entry](#menu-item-object) |
| `cardsMenu` | {object} | configuration of the menu of resource cards | |
| `cardsMenu.items` | {array} | list of menu item objects, right placement | [menu item object entry](#menu-item-object) |
| `cardOptions` | {object} | configuration of the resource cards dropdown | |
| `cardOptions.items` | {array} | list of menu item objects, dropdown placement | [menu item object entry](#menu-item-object) |
| `filtersForm` | {object} | configuration of the resource cards dropdown | |
| `filtersForm.items` | {array} | list of filter objects, panel placement | [filter object](#filter-object) |
-### Theme configuration
-
-[geoNodeConfiguration](#geonode-configuration).theme
-
-| property | type | description |
-| --- | --- | --- |
-| `variant` | {string} | "light" or "dark" |
-| `color` | {string} | main theme color |
-| `navbar` | {object} | navbar theme properties |
-| `navbar.style` | {object} | a css style object to apply on the navbar container node |
-| `hero` | {object} | hero image theme properties |
-| `hero.style` | {object} | a css style object to apply on the hero image container node, use backgroundImage css property to apply a background image |
-| `jumbotron` | {object} | jumbotron text content theme properties |
-| `jumbotron.style` | {object} | a css style object to apply on the jumbotron container node |
-| `languageSelector` | {object} | language selector theme properties |
-| `languageSelector.inline` | {boolean} | shows languages as inline text if true, default false shows a dropdown |
-| `footer` | {object} | footer theme properties |
-| `footer.color` | {string} | footer text color (css variable --gn-footer-color) |
-| `footer.bg` | {string} | footer background color (css variable --gn-footer-bg) |
-| `footer.link` | {object} | theme for footer link |
-| `footer.link.color` | {string} | footer link text color (css variable --gn-footer-link-color) |
-| `footer.link.hoverColor` | {string} | footer link text color on hover (css variable --gn-footer-link-hover-color) |
-| `footer.style` | {string} | a css style object to apply on the footer container node |
### Order Object
@@ -90,31 +42,6 @@ Order object contains properties for an entry of the order dropdown. Configurati
"value": "title" // value used in the sort filter
}
```
-### Logo Item
-
-Logo item contains properties for an image rendered in the top navbar. Configuration:
-
-```js
-{
- "src": "path/to/image.png", // image source
- "href": "#/", // logo href
- "style": { // default css style object
- "minHeight": 80
- },
- "sm": { // page size key small screen
- "style": { // small screen css style object
- "minHeight": 40
- }
- },
- "md": { // page size key medium screen
- "style": {} // medium screen css style object
- },
- "lg": { // page size key large screen
- "style": {} // large screen css style object
- }
-}
-```
-
### Menu Item Object
Menu item object contains properties for a list item rendered in a menu. Configuration:
@@ -214,4 +141,4 @@ Filter object contains properties for a select input rendered inside the filter
]
}
```
-Filter items supports also the following types from [menu object configuration](#menu-item-object): filter, divider and link.
\ No newline at end of file
+Filter items supports also the following types from [menu object configuration](#menu-item-object): filter, divider and link.
diff --git a/geonode_mapstore_client/client/js/actions/gnresource.js b/geonode_mapstore_client/client/js/actions/gnresource.js
index 8f6112db09..2e6fe590cb 100644
--- a/geonode_mapstore_client/client/js/actions/gnresource.js
+++ b/geonode_mapstore_client/client/js/actions/gnresource.js
@@ -82,11 +82,11 @@ export function editAbstractResource(abstract) {
* @param {string} image resource
*/
-export function editThumbnailResource(thumbnail_url) {
+export function editThumbnailResource(thumbnailUrl) {
return {
type: EDIT_THUMBNAIL_RESOURCE,
- thumbnail_url
+ thumbnailUrl
};
}
diff --git a/geonode_mapstore_client/client/js/actions/gnsearch.js b/geonode_mapstore_client/client/js/actions/gnsearch.js
index 64001a4ae0..0ef84dadea 100644
--- a/geonode_mapstore_client/client/js/actions/gnsearch.js
+++ b/geonode_mapstore_client/client/js/actions/gnsearch.js
@@ -6,9 +6,6 @@
* LICENSE file in the root directory of this source tree.
*/
-export const FETCH_SUGGESTIONS = 'GEONODE_SEARCH:FETCH_SUGGESTIONS';
-export const UPDATE_SUGGESTIONS = 'GEONODE_SEARCH:UPDATE_SUGGESTIONS';
-export const LOADING_SUGGESTIONS = 'GEONODE_SEARCH:LOADING_SUGGESTIONS';
export const SEARCH_RESOURCES = 'GEONODE_SEARCH:SEARCH_RESOURCES';
export const UPDATE_RESOURCES = 'GEONODE_SEARCH:UPDATE_RESOURCES';
export const LOADING_RESOURCES = 'GEONODE_SEARCH:LOADING_RESOURCES';
@@ -18,27 +15,6 @@ export const UPDATE_RESOURCES_METADATA = 'GEONODE_SEARCH:UPDATE_RESOURCES_METADA
export const SET_FEATURED_RESOURCES = 'GEONODE:SET_FEATURED_RESOURCES';
export const UPDATE_FEATURED_RESOURCES = 'GEONODE_SEARCH:UPDATE_FEATURED_RESOURCES';
-export function fetchSuggestions(text) {
- return {
- type: FETCH_SUGGESTIONS,
- text
- };
-}
-
-export function updateSuggestions(suggestions) {
- return {
- type: UPDATE_SUGGESTIONS,
- suggestions
- };
-}
-
-export function loadingSuggestions(loading) {
- return {
- type: LOADING_SUGGESTIONS,
- loading
- };
-}
-
export function searchResources(params, pathname) {
return {
type: SEARCH_RESOURCES,
@@ -106,12 +82,6 @@ export function loadFeaturedResources(action, pageSize = 4) {
}
export default {
- FETCH_SUGGESTIONS,
- fetchSuggestions,
- UPDATE_SUGGESTIONS,
- updateSuggestions,
- LOADING_SUGGESTIONS,
- loadingSuggestions,
SEARCH_RESOURCES,
searchResources,
UPDATE_RESOURCES,
diff --git a/geonode_mapstore_client/client/js/api/geonode.js b/geonode_mapstore_client/client/js/api/geonode.js
deleted file mode 100644
index ed199fb880..0000000000
--- a/geonode_mapstore_client/client/js/api/geonode.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2018, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import Rx from 'rxjs';
-import axios from '@mapstore/framework/libs/ajax';
-import { getConfigProp } from "@mapstore/framework/utils/ConfigUtils";
-
-const getLayerEditPerimissions = (name) => {
- const baseUrl = getConfigProp("geonodeUrl") || "./";
- return axios.get(`${baseUrl}gs/${name}/edit-check`);
-};
-const getStyleEditPerimissions = (name) => {
- const baseUrl = getConfigProp("geonodeUrl") || "./";
- return axios.get(`${baseUrl}gs/${name}/style-check`);
-};
-
-/**
- * Retrieve layer's edit permission from local gs otherwise are false
- */
-export const layerEditPermissions = (layer) =>
- Rx.Observable.defer(() => getLayerEditPerimissions(layer.name))
- .pluck("data")
- .map(({ authorized }) => ({ canEdit: authorized }));
-export const styleEditPermissions = (layer) =>
- Rx.Observable.defer(() => getStyleEditPerimissions(layer.name))
- .pluck("data")
- .map(({ authorized }) => ({ canEdit: authorized }));
-
-export default {
- layerEditPermissions,
- styleEditPermissions
-};
diff --git a/geonode_mapstore_client/client/js/api/geonode/user/index.js b/geonode_mapstore_client/client/js/api/geonode/user/index.js
new file mode 100644
index 0000000000..41847526c3
--- /dev/null
+++ b/geonode_mapstore_client/client/js/api/geonode/user/index.js
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2020, GeoSolutions Sas.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import axios from '@mapstore/framework/libs/ajax';
+import { getConfigProp } from '@mapstore/framework/utils/ConfigUtils';
+
+/**
+* Api for GeoNode user
+* @name api.geonode.user
+*/
+
+export const getUserInfo = () => {
+ const { endpointV1 = '/api' } = getConfigProp('geoNodeApi') || {};
+ return axios.get(`${endpointV1}/o/v4/userinfo`)
+ .then(({ data }) => data);
+};
diff --git a/geonode_mapstore_client/client/js/api/geonode/v1/__tests__/index-test.js b/geonode_mapstore_client/client/js/api/geonode/v1/__tests__/index-test.js
deleted file mode 100644
index 7728a5da5f..0000000000
--- a/geonode_mapstore_client/client/js/api/geonode/v1/__tests__/index-test.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import expect from 'expect';
-import MockAdapter from 'axios-mock-adapter';
-import axios from '@mapstore/framework/libs/ajax';
-import {
- getResourceByPk
-} from '@js/api/geonode/v1';
-
-let mockAxios;
-
-describe('GeoNode v1 api', () => {
- beforeEach(done => {
- global.__DEVTOOLS__ = true;
- mockAxios = new MockAdapter(axios);
- setTimeout(done);
- });
-
- afterEach(done => {
- delete global.__DEVTOOLS__;
- mockAxios.restore();
- setTimeout(done);
- });
-
- it('should request a resource by primary key (getResourceByPk)', (done) => {
- const pk = 1;
- const resource = {
- 'id': pk,
- 'title': 'Map',
- 'abstract': 'Description',
- 'thumbnail_url': 'thumbnail.jpeg'
- };
- mockAxios.onGet(new RegExp(`/base/${pk}`))
- .reply(() => {
- return [ 200, resource];
- });
- getResourceByPk(pk)
- .then((response) => {
- expect(response).toEqual({ ...resource, pk });
- done();
- });
- });
-});
diff --git a/geonode_mapstore_client/client/js/api/geonode/v1/index.js b/geonode_mapstore_client/client/js/api/geonode/v1/index.js
deleted file mode 100644
index 50850edc41..0000000000
--- a/geonode_mapstore_client/client/js/api/geonode/v1/index.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import axios from '@mapstore/framework/libs/ajax';
-import { getConfigProp } from '@mapstore/framework/utils/ConfigUtils';
-import cookies from 'js-cookie';
-
-/**
-* Api for GeoNode v1
-* @name api.geonode.v1
-*/
-
-/**
-* Get resource by primary key
-* @memberof api.geonode.v1
-* @param {number|string} pk primary key
-* @return {promise} it returns an object with requested resource
-*/
-export const getResourceByPk = (pk) => {
- const { endpointV1 = '/api' } = getConfigProp('geoNodeApi') || {};
- return axios.get(`${endpointV1}/base/${pk}`)
- // add pk as alias to id
- // used in save and save as for map
- .then(({ data }) => ({ pk: data.id, ...data }));
-};
-
-export const autocomplete = (params) => {
- const { endpointAutocomplete = '/base/autocomplete_response' } = getConfigProp('geoNodeApi') || {};
- return axios.get(endpointAutocomplete, { params })
- .then(({ data }) => {
- return {
- suggestions: (data?.results || [])
- .map(({ id, text }) => {
- return {
- id,
- label: text,
- value: text
- };
- })
- };
- });
-};
-
-export const getUserInfo = () => {
- const { endpointV1 = '/api' } = getConfigProp('geoNodeApi') || {};
- return axios.get(`${endpointV1}/o/v4/userinfo`)
- .then(({ data }) => data);
-};
-
-
-export const setLanguage = (languageCode) => {
- const csrfMiddlewareToken = cookies.get('csrftoken');
- return axios.post('/i18n/setlang/', `csrfmiddlewaretoken=${csrfMiddlewareToken}&language=${languageCode}`, {
- params: {
- next: '/static/mapstore/configs/placeholder.json'
- }
- });
-};
-
-export default {
- getResourceByPk,
- setLanguage
-};
diff --git a/geonode_mapstore_client/client/js/api/geonode/v2/index.js b/geonode_mapstore_client/client/js/api/geonode/v2/index.js
index 3a10acd02f..7edf26f285 100644
--- a/geonode_mapstore_client/client/js/api/geonode/v2/index.js
+++ b/geonode_mapstore_client/client/js/api/geonode/v2/index.js
@@ -19,7 +19,7 @@ import isString from 'lodash/isString';
import isObject from 'lodash/isObject';
import castArray from 'lodash/castArray';
import get from 'lodash/get';
-import { getUserInfo } from '@js/api/geonode/v1';
+import { getUserInfo } from '@js/api/geonode/user';
import { setFilterById } from '@js/utils/GNSearchUtils';
let endpoints = {
diff --git a/geonode_mapstore_client/client/js/apps/gn-catalogue.js b/geonode_mapstore_client/client/js/apps/gn-catalogue.js
index 81e40befae..ea691549aa 100644
--- a/geonode_mapstore_client/client/js/apps/gn-catalogue.js
+++ b/geonode_mapstore_client/client/js/apps/gn-catalogue.js
@@ -67,7 +67,6 @@ import {
} from '@js/epics';
import gnviewerEpics from '@js/epics/gnviewer';
import gnsearchEpics from '@js/epics/gnsearch';
-import gnlocaleEpics from '@js/epics/gnlocale';
import maplayout from '@mapstore/framework/reducers/maplayout';
import pluginsDefinition from '@js/plugins/index';
@@ -235,8 +234,7 @@ Promise.all([
gnSetLayersPermissions,
...pluginsDefinition.epics,
...gnviewerEpics,
- ...gnsearchEpics,
- ...gnlocaleEpics
+ ...gnsearchEpics
},
geoNodeConfiguration,
initialActions: [
diff --git a/geonode_mapstore_client/client/js/apps/gn-home.jsx b/geonode_mapstore_client/client/js/apps/gn-home.jsx
index c16cc2e2ac..712088cdbe 100644
--- a/geonode_mapstore_client/client/js/apps/gn-home.jsx
+++ b/geonode_mapstore_client/client/js/apps/gn-home.jsx
@@ -19,7 +19,6 @@ import Home from '@js/routes/Home';
import gnsearch from '@js/reducers/gnsearch';
import gnresource from '@js/reducers/gnresource';
import gnsearchEpics from '@js/epics/gnsearch';
-import gnlocaleEpics from '@js/epics/gnlocale';
import gnsaveEpics from '@js/epics/gnsave';
import {
@@ -84,7 +83,6 @@ Promise.all([
},
appEpics: {
...gnsearchEpics,
- ...gnlocaleEpics,
...gnsaveEpics
},
geoNodeConfiguration
diff --git a/geonode_mapstore_client/client/js/components/ResourceCard/ResourceCard.jsx b/geonode_mapstore_client/client/js/components/ResourceCard/ResourceCard.jsx
index 43403aa28a..cdd53d577a 100644
--- a/geonode_mapstore_client/client/js/components/ResourceCard/ResourceCard.jsx
+++ b/geonode_mapstore_client/client/js/components/ResourceCard/ResourceCard.jsx
@@ -9,7 +9,6 @@
import React, { forwardRef } from 'react';
import Message from '@mapstore/framework/components/I18N/Message';
import FaIcon from '@js/components/FaIcon';
-import Tag from '@js/components/Tag';
import Dropdown from '@js/components/Dropdown';
import {
getUserName,
@@ -49,14 +48,14 @@ const ResourceCard = forwardRef(({
{icon &&
<>
-
-
+
>}
variables[key])
- .map((key) => `\t${key}: ${variables[key]};`).join('\n') +
- '\n}';
-}
-
-function buttonTheme(style, name) {
- const prefix = name ? '-' + name : '';
- const bg = style.bg;
- const color = style.color || tinycolor.mostReadable(bg, ['#ffffff', '#000000'], {
- includeFallbackColors: true
- }).toHexString();
-
- const borderColor = style.borderColor || bg;
- const focusColor = style.focusColor || color;
- const focusBg = style.focusBg || tinycolor(bg).darken(10).toString();
- const focusBorderColor = style.focusBorderColor || tinycolor(bg).darken(25).toString();
- const hoverColor = style.hoverColor || color;
- const hoverBg = style.hoverBg || tinycolor(bg).darken(10).toString();
- const hoverBorderColor = style.hoverBorderColor || tinycolor(bg).darken(12).toString();
- const activeColor = style.activeColor || color;
- const activeBg = style.activeBg || tinycolor(bg).darken(10).toString();
- const activeBorderColor = style.activeBorderColor || tinycolor(bg).darken(12).toString();
- const activeHoverColor = style.activeHoverColor || color;
- const activeHoverBg = style.activeHoverBg || tinycolor(bg).darken(17).toString();
- const activeHoverBorderColor = style.activeHoverBorderColor || tinycolor(bg).darken(25).toString();
- const disableColor = style.disableColor || color;
- const disabledBg = style.disabledBg || tinycolor(tinycolor(bg).desaturate(30).toString()).lighten(20).toString();
- const disabledBorderColor = style.disabledBorderColor || tinycolor(tinycolor(bg).desaturate(30).toString()).lighten(20).toString();
- const badgeColor = style.badgeColor || bg;
- const badgeBg = style.badgeBg || color;
- return {
- [`--gn-button${prefix}-color`]: color,
- [`--gn-button${prefix}-bg`]: bg,
- [`--gn-button${prefix}-border-color`]: borderColor,
- [`--gn-button${prefix}-focus-color`]: focusColor,
- [`--gn-button${prefix}-focus-bg`]: focusBg,
- [`--gn-button${prefix}-focus-border-color`]: focusBorderColor,
- [`--gn-button${prefix}-hover-color`]: hoverColor,
- [`--gn-button${prefix}-hover-bg`]: hoverBg,
- [`--gn-button${prefix}-hover-border-color`]: hoverBorderColor,
- [`--gn-button${prefix}-active-color`]: activeColor,
- [`--gn-button${prefix}-active-bg`]: activeBg,
- [`--gn-button${prefix}-active-border-color`]: activeBorderColor,
- [`--gn-button${prefix}-active-hover-color`]: activeHoverColor,
- [`--gn-button${prefix}-active-hover-bg`]: activeHoverBg,
- [`--gn-button${prefix}-active-hover-border-color`]: activeHoverBorderColor,
- [`--gn-button${prefix}-disabled-color`]: disableColor,
- [`--gn-button${prefix}-disabled-bg`]: disabledBg,
- [`--gn-button${prefix}-disabled-border-color`]: disabledBorderColor,
- [`--gn-button${prefix}-badge-color`]: badgeColor,
- [`--gn-button${prefix}-badge-bg`]: badgeBg
- };
-}
-
-function RootStyle({
- targetId,
- theme
-}) {
-
- const variables = useMemo(() => {
- if (theme) {
- const {
- color: themeColor,
- body,
- bodyShade,
- placeholder,
- disabled,
- info,
- success,
- warning,
- danger,
- primary,
- link,
- image,
- jumbotron,
- focus,
- tag,
- badge,
- footer,
- buttonDefault,
- buttonPrimary,
- buttonInfo,
- buttonSuccess,
- buttonWarning,
- buttonDanger
- } = theme;
-
- const bg = primary?.value || themeColor;
- const color = primary?.contrast || bg && tinycolor.mostReadable(bg, ['#ffffff', '#000000'], {
- includeFallbackColors: true
- }).toHexString();
-
- const btnPrimary = (bg || buttonPrimary) && {
- ...(bg && { bg }),
- ...(color && { color }),
- ...buttonPrimary
- };
-
- return {
- ...(bg && {
- '--gn-primary-contrast': color,
- '--gn-primary': bg,
- '--gn-loader-primary-color': bg,
- '--gn-loader-primary-fade-color': tinycolor(bg).setAlpha(0.2).toString(),
- '--gn-loader-primary-contrast-color': color,
- '--gn-loader-primary-contrast-fade-color': tinycolor(color).setAlpha(0.2).toString()
- }),
- ...(body && {
- ' --gn-main-color': body.color || '#000000',
- '--gn-main-bg': body.bg || '#ffffff',
- '--gn-main-border-color': body.borderColor || '#dddddd',
- '--gn-loader-color': '',
- '--gn-loader-fade-color': ''
- }),
- ...(bodyShade && {
- '--gn-main-variant-color': bodyShade.color || '#000000',
- '--gn-main-variant-bg': bodyShade.bg || '#f2f0f0'
- }),
- ...(placeholder && {
- '--gn-placeholder-color': placeholder.color || '#aaaaaa',
- '--gn-placeholder-bg': placeholder.bg || '#dddddd'
- }),
- ...(disabled && {
- '--gn-disabled-color': disabled.color || '#acacac',
- '--gn-disabled-bg': disabled.bg || '#fcfcfc'
- }),
- ...(primary && {
- '--gn-primary-contrast': primary.contrast || '#ffffff',
- '--gn-primary': primary.value || '#397AAB'
- }),
- ...(info && {
- '--gn-info-contrast': info.contrast || '#ffffff',
- '--gn-info': info.value || '#639fcc'
- }),
- ...(success && {
- '--gn-success-contrast': success.contrast || '#ffffff',
- '--gn-success': success.value || '#58cf80'
- }),
- ...(warning && {
- '--gn-warning-contrast': warning.contrast || '#ffffff',
- '--gn-warning': warning.value || '#ebbc35'
- }),
- ...(danger && {
- '--gn-danger-contrast': danger.contrast || '#ffffff',
- '--gn-danger': danger.value || '#bb4940'
- }),
- ...(link && {
- '--gn-link-color': link.color || '#397AAB',
- '--gn-link-hover-color': link.hoverColor || '#1b4d74'
- }),
- ...(image && {
- '--gn-image-color': image.color || '#ffffff',
- '--gn-image-bg': image.bg || '#333333'
- }),
- ...(jumbotron && {
- '--gn-jumbotron-color': jumbotron.color || '#ffffff',
- '--gn-jumbotron-bg': jumbotron.bg || '#333333'
- }),
- ...(focus && {
- '--gn-focus-color': focus.color || 'rgba(#397AAB, 0.4)'
- }),
- ...(tag && {
- '--gn-tag-color': tag.color || '#000000',
- '--gn-tag-hover-color': tag.hoverColor || '#ffffff',
- '--gn-tag-hover-bg': tag.hoverBg || 'rgba(#397AAB, 0.75)',
- '--gn-tag-active-color': tag.activeColor || '#ffffff',
- '--gn-tag-active-bg': tag.activeBg || '#397AAB'
- }),
- ...(tag && {
- '--gn-badge-color': badge.color || '#f2f2f2',
- '--gn-badge-bg': badge.bg || '#777777'
- }),
- ...(footer && {
- '--gn-footer-color': footer.color || '#000000',
- '--gn-footer-bg': footer.bg || '#ffffff',
- ...(footer?.link && {
- '--gn-footer-link-color': footer.link.color || '#397AAB',
- '--gn-footer-link-hover-color': footer.link.hoverColor || '#1b4d74'
- })
- }),
- ...(buttonDefault?.bg && buttonTheme(buttonDefault)),
- ...(buttonInfo?.bg && buttonTheme(buttonInfo, 'info')),
- ...(buttonSuccess?.bg && buttonTheme(buttonSuccess, 'success')),
- ...(buttonWarning?.bg && buttonTheme(buttonWarning, 'warning')),
- ...(buttonDanger?.bg && buttonTheme(buttonDanger, 'danger')),
- ...(btnPrimary?.bg && buttonTheme(btnPrimary, 'primary'))
- };
- }
- return {};
- }, [theme]);
- return (
-
- );
-}
-
-RootStyle.defaultProps = {
- theme: {}
-};
-
-export default RootStyle;
diff --git a/geonode_mapstore_client/client/js/components/RootStyle/index.js b/geonode_mapstore_client/client/js/components/RootStyle/index.js
deleted file mode 100644
index e76034c679..0000000000
--- a/geonode_mapstore_client/client/js/components/RootStyle/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './RootStyle';
diff --git a/geonode_mapstore_client/client/js/components/Router/Router.jsx b/geonode_mapstore_client/client/js/components/Router/Router.jsx
index 42196e1a9c..257c79d410 100644
--- a/geonode_mapstore_client/client/js/components/Router/Router.jsx
+++ b/geonode_mapstore_client/client/js/components/Router/Router.jsx
@@ -16,7 +16,6 @@ import Theme from '@mapstore/framework/components/theme/Theme';
import { ErrorBoundary } from 'react-error-boundary';
import history from '@mapstore/framework/stores/History';
import ErrorFallback from '@js/components/ErrorFallback';
-import RootStyle from '@js/components/RootStyle';
export const withRoutes = (routes) => (Component) => {
const WithRoutes = forwardRef((props, ref) => {
@@ -62,10 +61,6 @@ const Router = forwardRef(({
}, ref) => {
return (
<>
-
}
/>
diff --git a/geonode_mapstore_client/client/js/components/Tag/Tag.jsx b/geonode_mapstore_client/client/js/components/Tag/Tag.jsx
deleted file mode 100644
index 5f78e8cfc8..0000000000
--- a/geonode_mapstore_client/client/js/components/Tag/Tag.jsx
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-import FaIcon from '@js/components/FaIcon';
-function Tag({
- active,
- children,
- href,
- className,
- style,
- draggable,
- tabIndex,
- onClick,
- showTimesIcon
-}) {
- return (
-
- {children}
- {showTimesIcon && active && }
-
- );
-}
-
-Tag.defaultProps = {};
-
-export default Tag;
diff --git a/geonode_mapstore_client/client/js/components/Tag/index.js b/geonode_mapstore_client/client/js/components/Tag/index.js
deleted file mode 100644
index 15774bff20..0000000000
--- a/geonode_mapstore_client/client/js/components/Tag/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from './Tag';
diff --git a/geonode_mapstore_client/client/js/epics/gnlocale.js b/geonode_mapstore_client/client/js/epics/gnlocale.js
deleted file mode 100644
index 879a4e2d14..0000000000
--- a/geonode_mapstore_client/client/js/epics/gnlocale.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import { Observable } from 'rxjs';
-import {
- CHANGE_LOCALE
-} from '@mapstore/framework/actions/locale';
-
-import {
- setLanguage
-} from '@js/api/geonode/v1';
-
-import {
- getSupportedLocales
-} from '@mapstore/framework/utils/LocaleUtils';
-
-export const gnSetLanguageEpic = (action$) =>
- action$.ofType(CHANGE_LOCALE)
- .switchMap(({ locale }) => {
- const supportedLocales = getSupportedLocales();
- const localeKey = Object.keys(supportedLocales)
- .find(key => supportedLocales[key]?.code === locale);
- return Observable
- // update the language in django
- .defer(() => setLanguage(localeKey))
- .switchMap(() => {
- return Observable.empty();
- });
- });
-
-export default {
- gnSetLanguageEpic
-};
diff --git a/geonode_mapstore_client/client/js/epics/gnsearch.js b/geonode_mapstore_client/client/js/epics/gnsearch.js
index 81fc42628f..afd8f9e95a 100644
--- a/geonode_mapstore_client/client/js/epics/gnsearch.js
+++ b/geonode_mapstore_client/client/js/epics/gnsearch.js
@@ -10,18 +10,12 @@ import { Observable } from 'rxjs';
import isEqual from 'lodash/isEqual';
import isArray from 'lodash/isArray';
import isNil from 'lodash/isNil';
-import {
- autocomplete
-} from '@js/api/geonode/v1';
import {
getResources,
getResourceByPk,
getFeaturedResources
} from '@js/api/geonode/v2';
import {
- FETCH_SUGGESTIONS,
- updateSuggestions,
- loadingSuggestions,
SEARCH_RESOURCES,
REQUEST_RESOURCE,
updateResources,
@@ -86,21 +80,6 @@ const getNextPage = (action, state) => {
return isPreviousPageAvailable ? currentPage - 1 : 1;
};
-export const gnsFetchSuggestionsEpic = (action$) =>
- action$.ofType(FETCH_SUGGESTIONS)
- .debounceTime(300)
- .switchMap(({ text }) => {
- return Observable
- .defer(() => autocomplete({ q: text }))
- .switchMap(({ suggestions }) => {
- return Observable.of(
- updateSuggestions(suggestions),
- loadingSuggestions(false)
- );
- })
- .startWith(loadingSuggestions(true));
- });
-
export const gnsSearchResourcesEpic = (action$, store) =>
action$.ofType(SEARCH_RESOURCES)
.switchMap(action => {
@@ -164,7 +143,6 @@ const requestResourcesObservable = ({
);
})
.startWith(
- updateSuggestions([]),
loadingResources(true)
);
};
@@ -258,7 +236,6 @@ export const getFeaturedResourcesEpic = (action$, {getState = () => {}}) =>
export default {
- gnsFetchSuggestionsEpic,
gnsSearchResourcesEpic,
gnsSearchResourcesOnLocationChangeEpic,
gnsSelectResourceEpic,
diff --git a/geonode_mapstore_client/client/js/hooks/useLocalStorage.js b/geonode_mapstore_client/client/js/hooks/useLocalStorage.js
index ac4a66fe95..e05ed42987 100644
--- a/geonode_mapstore_client/client/js/hooks/useLocalStorage.js
+++ b/geonode_mapstore_client/client/js/hooks/useLocalStorage.js
@@ -20,7 +20,7 @@ export default (key, initialValue) => {
return item ? JSON.parse(item) : initialValue;
} catch (error) {
// Todo log error in persistent solution
- console.log(`Error to get item key “${key}”:`, error);
+ console.log(`Error to get item key “${key}”:`, error); // eslint-disable-line no-console
return initialValue;
}
};
@@ -36,7 +36,7 @@ export default (key, initialValue) => {
window.dispatchEvent(new Event('localStorage'));
} catch (error) {
// Todo log error in persistent solution
- console.log(`Error “${key}”:`, error);
+ console.log(`Error “${key}”:`, error); // eslint-disable-line no-console
}
};
diff --git a/geonode_mapstore_client/client/js/reducers/gnresource.js b/geonode_mapstore_client/client/js/reducers/gnresource.js
index df5b5a3f6b..0eace36a44 100644
--- a/geonode_mapstore_client/client/js/reducers/gnresource.js
+++ b/geonode_mapstore_client/client/js/reducers/gnresource.js
@@ -107,7 +107,7 @@ function gnresource(state = {selectedLayerPermissions: [], data: {}}, action) {
...state,
data: {
...state?.data,
- thumbnail_url: action?.thumbnail_url
+ thumbnail_url: action?.thumbnailUrl
}
};
}
diff --git a/geonode_mapstore_client/client/js/reducers/gnsearch.js b/geonode_mapstore_client/client/js/reducers/gnsearch.js
index 05eb35bea4..93e4f511f8 100644
--- a/geonode_mapstore_client/client/js/reducers/gnsearch.js
+++ b/geonode_mapstore_client/client/js/reducers/gnsearch.js
@@ -9,8 +9,6 @@
import isNil from 'lodash/isNil';
import {
- UPDATE_SUGGESTIONS,
- LOADING_SUGGESTIONS,
SEARCH_RESOURCES,
UPDATE_RESOURCES,
LOADING_RESOURCES,
@@ -28,18 +26,6 @@ function gnsearch(state = {
}
}, action) {
switch (action.type) {
- case UPDATE_SUGGESTIONS: {
- return {
- ...state,
- suggestions: action.suggestions
- };
- }
- case LOADING_SUGGESTIONS: {
- return {
- ...state,
- loading: action.loading
- };
- }
case SEARCH_RESOURCES: {
return {
...state,
diff --git a/geonode_mapstore_client/client/js/selectors/__tests__/config-test.js b/geonode_mapstore_client/client/js/selectors/__tests__/config-test.js
index 5a41149770..01521e3e3d 100644
--- a/geonode_mapstore_client/client/js/selectors/__tests__/config-test.js
+++ b/geonode_mapstore_client/client/js/selectors/__tests__/config-test.js
@@ -27,43 +27,9 @@ describe('config selector', () => {
}
]);
setConfigProp('geoNodeConfiguration', {
- "menu": {
- "items": [
- {
- "type": "link",
- "href": "{'/user/' + state('user').pk}",
- "labelId": "labelId",
- "authenticated": true
- }
- ],
- "rightItems": [
- {
- "type": "link",
- "href": "/#",
- "labelId": "labelId",
- "authenticated": false
- }
- ]
- },
- "navbar": {
- "items": [
- {
- "type": "link",
- "href": "/#",
- "labelId": "labelId"
- }
- ]
- },
"cardsMenu": {
"items": []
},
- "footer": {
- "items": [{
- "type": "link",
- "href": "/#",
- "labelId": "labelId"
- }]
- },
"cardOptions": {
"items": [{
"type": "link",
@@ -87,24 +53,7 @@ describe('config selector', () => {
}
};
const parsedConfiguration = getParsedGeoNodeConfiguration(state);
- expect(parsedConfiguration.menuItemsLeftAllowed).toEqual([{
- "type": "link",
- "href": "/user/1",
- "labelId": "labelId",
- "authenticated": true
- }]);
- expect(parsedConfiguration.menuItemsRightAllowed).toEqual([]);
- expect(parsedConfiguration.navbarItemsAllowed).toEqual([{
- "type": "link",
- "href": "/#",
- "labelId": "labelId"
- }]);
expect(parsedConfiguration.filterMenuItemsAllowed).toEqual([]);
- expect(parsedConfiguration.footerMenuItemsAllowed).toEqual([{
- "type": "link",
- "href": "/#",
- "labelId": "labelId"
- }]);
expect(parsedConfiguration.cardOptionsItemsAllowed).toEqual([{
"type": "link",
"href": "/#",
@@ -117,7 +66,7 @@ describe('config selector', () => {
"options": []
}]);
});
- it('getParsedGeoNodeConfiguration', () => {
+ it('getCustomMenuFilters', () => {
setConfigProp('monitorState', [
{
"name": "user",
@@ -125,28 +74,6 @@ describe('config selector', () => {
}
]);
setConfigProp('geoNodeConfiguration', {
- "menu": {
- "items": [
- {
- "id": "my-resources",
- "labelId": "myResources",
- "type": "filter",
- "query": {
- "filter{owner.pk}": "{state('user') && state('user').pk}"
- },
- "authenticated": true
- },
- {
- "id": "map",
- "labelId": "map",
- "type": "filter",
- "query": {
- "filter{resource_type}": "map"
- },
- "authenticated": false
- }
- ]
- },
"filtersForm": {
"items": [{
"id": "pending-approval",
@@ -182,13 +109,6 @@ describe('config selector', () => {
};
const menuFilters = getCustomMenuFilters(state);
expect(menuFilters).toEqual([
- {
- id: 'my-resources',
- labelId: 'myResources',
- type: 'filter',
- query: { 'filter{owner.pk}': 1 },
- authenticated: true
- },
{
id: 'pending-approval',
labelId: 'pendingApproval',
diff --git a/geonode_mapstore_client/client/js/selectors/config.js b/geonode_mapstore_client/client/js/selectors/config.js
index 13baf50ae6..261fefe6b5 100644
--- a/geonode_mapstore_client/client/js/selectors/config.js
+++ b/geonode_mapstore_client/client/js/selectors/config.js
@@ -30,20 +30,12 @@ export const getParsedGeoNodeConfiguration = (state) => {
};
const userState = { user };
const confWithHandleExpression = mapObjectFunc(v => handleExpression(getMonitorState, {}, v))(geoNodeConfiguration);
- const menuItemsLeftAllowed = reduceArrayRecursive(confWithHandleExpression?.menu?.items, (item) => filterMenuItems(userState, item));
- const menuItemsRightAllowed = reduceArrayRecursive(confWithHandleExpression?.menu?.rightItems, (item) => filterMenuItems(userState, item));
- const navbarItemsAllowed = reduceArrayRecursive(confWithHandleExpression?.navbar?.items, (item) => filterMenuItems(userState, item));
const filterMenuItemsAllowed = reduceArrayRecursive(confWithHandleExpression?.cardsMenu?.items, (item) => filterMenuItems(userState, item));
- const footerMenuItemsAllowed = reduceArrayRecursive(confWithHandleExpression?.footer?.items, (item) => filterMenuItems(userState, item));
const cardOptionsItemsAllowed = reduceArrayRecursive(confWithHandleExpression?.cardOptions?.items, (item) => filterMenuItems(userState, item));
const filtersFormItemsAllowed = reduceArrayRecursive(confWithHandleExpression?.filtersForm?.items, (item) => filterMenuItems(userState, item));
return {
...confWithHandleExpression,
- menuItemsLeftAllowed,
- menuItemsRightAllowed,
- navbarItemsAllowed,
filterMenuItemsAllowed,
- footerMenuItemsAllowed,
cardOptionsItemsAllowed,
filtersFormItemsAllowed
};
@@ -62,10 +54,8 @@ export const getCustomMenuFilters = (state) => {
};
const userState = { user };
const confWithHandleExpression = mapObjectFunc(v => handleExpression(getMonitorState, {}, v))(geoNodeConfiguration);
- const menuItemsLeftAllowed = reduceArrayRecursive(confWithHandleExpression?.menu?.items, (item) => filterMenuItems(userState, item));
const filtersFormItemsAllowed = reduceArrayRecursive(confWithHandleExpression?.filtersForm?.items, (item) => filterMenuItems(userState, item));
const menuFilters = [
- ...menuItemsLeftAllowed,
...filtersFormItemsAllowed.reduce((acc, item) => [
...acc,
...(item.type === 'group'
diff --git a/geonode_mapstore_client/client/js/utils/AppUtils.js b/geonode_mapstore_client/client/js/utils/AppUtils.js
index 9299c889c2..0a664442fa 100644
--- a/geonode_mapstore_client/client/js/utils/AppUtils.js
+++ b/geonode_mapstore_client/client/js/utils/AppUtils.js
@@ -108,7 +108,7 @@ export function setupConfiguration({
);
const supportedLocales = defaultSupportedLocales || getSupportedLocales();
setSupportedLocales(supportedLocales);
- const locale = supportedLocales[geoNodePageConfig.languageCode]?.code;
+ const locale = supportedLocales[geoNodePageConfig.languageCode]?.code || 'en';
setConfigProp('locale', locale);
const geoNodeResourcesInfo = getConfigProp('geoNodeResourcesInfo') || {};
setConfigProp('geoNodeResourcesInfo', { ...geoNodeResourcesInfo, ...resourcesTotalCount });
diff --git a/geonode_mapstore_client/client/package.json b/geonode_mapstore_client/client/package.json
index 9f53d3f17f..f44c1aafd7 100644
--- a/geonode_mapstore_client/client/package.json
+++ b/geonode_mapstore_client/client/package.json
@@ -32,7 +32,6 @@
"dependencies": {
"@fortawesome/fontawesome-free": "5.15.1",
"dompurify": "2.2.6",
- "js-cookie": "2.2.1",
"mapstore": "file:MapStore2",
"react-helmet": "6.1.0"
},
diff --git a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json
index 34f0b3a16b..53f0f99ac6 100644
--- a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json
+++ b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json
@@ -22,8 +22,6 @@
],
"defaultLayerFormat": "image/png",
"geoNodeApi": {
- "endpointAdapter": "/mapstore/rest/",
- "endpointAutocomplete": "/base/autocomplete_response",
"endpointV1": "/api",
"endpointV2": "/api/v2"
},
@@ -190,15 +188,6 @@
}
},
"geoNodeConfiguration": {
- "theme": {
- "variant": "light",
- "navbar": {
- "style": {}
- },
- "hero": {
- "style": {}
- }
- },
"filtersForm": {
"items": [
{
@@ -372,278 +361,6 @@
}
]
},
- "navbar": {
- "logo": [
- {
- "src": "/static/mapstore/img/geonode-logo.svg",
- "href": "/"
- }
- ],
- "items": [
- {
- "labelId": "gnhome.register",
- "type": "link",
- "href": "/account/signup/?next=/",
- "authenticated": false
- },
- {
- "labelId": "gnhome.signIn",
- "type": "link",
- "href": "/account/login/?next=",
- "authenticated": false
- },
- {
- "image": "{state('user') && state('user').avatar}",
- "type": "dropdown",
- "authenticated": true,
- "items": [
- {
- "type": "link",
- "href": "{state('user') && state('user').hrefProfile}",
- "labelId": "gnhome.profile"
- },
- {
- "type": "link",
- "href": "/social/recent-activity",
- "labelId": "gnhome.recentActivity"
- },
- {
- "type": "link",
- "href": "/favourite/list/",
- "labelId": "gnhome.favorites"
- },
- {
- "type": "link",
- "href": "/messages/inbox/",
- "labelId": "gnhome.inbox"
- },
- {
- "type": "divider"
- },
- {
- "type": "link",
- "href": "/admin/",
- "labelId": "gnhome.admin",
- "allowedRoles": [
- "admin"
- ]
- },
- {
- "type": "link",
- "href": "/geoserver/",
- "labelId": "gnhome.geoServer",
- "allowedRoles": [
- "admin"
- ]
- },
- {
- "type": "divider",
- "allowedRoles": [
- "admin"
- ]
- },
- {
- "type": "link",
- "href": "/help/",
- "labelId": "gnhome.help"
- },
- {
- "type": "divider"
- },
- {
- "type": "link",
- "href": "/account/logout/?next=/",
- "labelId": "gnhome.logOut"
- }
- ]
- }
- ]
- },
- "menu": {
- "items": [
- {
- "labelId": "gnhome.layers",
- "type": "dropdown",
- "items": [
- {
- "type": "link",
- "href": "#/search/?filter{resource_type.in}=layer",
- "labelId": "gnhome.layers",
- "badge": "{state('geoNodeResourcesInfo') && state('geoNodeResourcesInfo').layersTotalCount}",
- "permissions": [],
- "allowedRoles": []
- },
- {
- "type": "divider",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/layers/upload",
- "labelId": "gnhome.uploadLayer",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- }
- ]
- },
- {
- "labelId": "gnhome.documents",
- "type": "dropdown",
- "items": [
- {
- "type": "link",
- "href": "#/search/?filter{resource_type.in}=document",
- "labelId": "gnhome.documents",
- "badge": "{state('geoNodeResourcesInfo') && state('geoNodeResourcesInfo').documentsTotalCount}",
- "permissions": [],
- "allowedRoles": []
- },
- {
- "type": "divider",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/documents/upload",
- "labelId": "gnhome.uploadDocument",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- }
- ]
- },
- {
- "type": "divider"
- },
- {
- "labelId": "gnhome.maps",
- "type": "dropdown",
- "items": [
- {
- "type": "link",
- "href": "#/search/?filter{resource_type.in}=map",
- "labelId": "gnhome.exploreMaps",
- "badge": "{state('geoNodeResourcesInfo') && state('geoNodeResourcesInfo').mapsTotalCount}"
- },
- {
- "type": "divider",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/catalogue/#/map/new",
- "labelId": "gnhome.createMap",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- }
- ]
- },
- {
- "labelId": "gnhome.geostories",
- "type": "dropdown",
- "items": [
- {
- "type": "link",
- "href": "#/search/?filter{resource_type.in}=geostory",
- "labelId": "gnhome.geostories",
- "badge": "{state('geoNodeResourcesInfo') && state('geoNodeResourcesInfo').geoappsTotalCount}"
- },
- {
- "type": "divider",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/catalogue/#/geostory/new",
- "labelId": "gnhome.createGeostory",
- "authenticated": true,
- "permissions": [],
- "allowedRoles": [],
- "perms": [{ "type": "user", "value": "add_resource" }]
- }
- ]
- },
- {
- "labelId": "gnhome.about",
- "type": "dropdown",
- "items": [
- {
- "type": "link",
- "href": "/people/",
- "labelId": "gnhome.people"
- },
- {
- "type": "link",
- "href": "/groups/",
- "labelId": "gnhome.groups"
- },
- {
- "type": "link",
- "href": "/groups/categories/",
- "labelId": "gnhome.groupsCategories"
- },
- {
- "type": "link",
- "href": "/announcements/",
- "labelId": "gnhome.announcements",
- "authenticated": true,
- "allowedRoles": [
- "admin"
- ]
- },
- {
- "type": "divider",
- "authenticated": true,
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/invitations/geonode-send-invite/",
- "labelId": "gnhome.inviteUsers",
- "authenticated": true,
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/admin/people/profile/add/",
- "labelId": "gnhome.addUser",
- "authenticated": true,
- "allowedRoles": [
- "admin"
- ],
- "perms": [{ "type": "user", "value": "add_resource" }]
- },
- {
- "type": "link",
- "href": "/groups/create/",
- "labelId": "gnhome.createGroup",
- "authenticated": true,
- "allowedRoles": [
- "admin"
- ],
- "perms": [{ "type": "user", "value": "add_resource" }]
- }
- ]
- }
- ]
- },
"cardOptions": {
"items":[
{
@@ -676,25 +393,6 @@
]
}
]
- },
- "footer": {
- "items": [
- {
- "labelId": "geonode.org",
- "type": "link",
- "href": "https://geonode.org/"
- },
- {
- "labelId": "gnhome.developers",
- "type": "link",
- "href": "/developer/"
- },
- {
- "labelId": "gnhome.about",
- "type": "link",
- "href": "/about/"
- }
- ]
}
},
"plugins": {
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_resource-card.less b/geonode_mapstore_client/client/themes/geonode/less/_resource-card.less
index b66ae85b46..c447c9c7a6 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_resource-card.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_resource-card.less
@@ -26,16 +26,6 @@
}
}
- .gn-tag {
- .color-var(@theme-vars[main-color]);
- font-size: inherit;
-
- &:hover {
- color: inherit;
- background-color: transparent;
- }
- }
-
&.active {
.border-color-var(@theme-vars[focus-color]);
.outline-color-var(@theme-vars[focus-color]);
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_tag.less b/geonode_mapstore_client/client/themes/geonode/less/_tag.less
deleted file mode 100644
index 52c7bc0c35..0000000000
--- a/geonode_mapstore_client/client/themes/geonode/less/_tag.less
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2020, GeoSolutions Sas.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-// **************
-// Theme
-// **************
-
-#gn-components-theme(@theme-vars) {
- .gn-tag {
- .color-var(@theme-vars[tag-color]);
- background-color: transparent;
- &.active {
- .color-var(@theme-vars[tag-active-color]);
- .background-color-var(@theme-vars[tag-active-bg]);
- }
- &:hover {
- .color-var(@theme-vars[tag-hover-color]);
- .background-color-var(@theme-vars[tag-hover-bg]);
- }
- }
-}
-
-// **************
-// Layout
-// **************
-
-.gn-tag {
- font-size: @font-size-sm;
- padding: 0.1rem 0.25rem;
- .fa,
- + .gn-tag:not(.dropdown-item) {
- margin-left: 0.5rem;
- }
- &.dropdown-item {
- margin: 0.2rem;
- width: calc(100% - 0.4rem);
- }
-}
diff --git a/geonode_mapstore_client/client/themes/geonode/less/_variables.less b/geonode_mapstore_client/client/themes/geonode/less/_variables.less
index 002e18b339..e18fbd034f 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/_variables.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/_variables.less
@@ -51,12 +51,6 @@
@gn-focus-color: rgba(#397AAB, 0.4);
-@gn-tag-color: #000000;
-@gn-tag-hover-color: #ffffff;
-@gn-tag-hover-bg: rgba(#397AAB, 0.75);
-@gn-tag-active-color: #ffffff;
-@gn-tag-active-bg: #397AAB;
-
@gn-footer-color: #ffffff;
@gn-footer-bg: rgba(#397AAB, 0.75);
@gn-footer-link-color: #ffffff;
@@ -306,16 +300,10 @@
focus-color: --gn-focus-color, @gn-focus-color;
- tag-color: --gn-tag-color, @gn-tag-color;
- tag-hover-color: --gn-tag-hover-color, @gn-tag-hover-color;
- tag-hover-bg: --gn-tag-hover-bg, @gn-tag-hover-bg;
- tag-active-color: --gn-tag-active-color, @gn-tag-active-color;
- tag-active-bg: --gn-tag-active-bg, @gn-tag-active-bg;
-
- footer-color: --gn-footer-color, @gn-main-color;
- footer-bg: --gn-footer-bg, @gn-main-bg;
- footer-link-color: --gn-footer-link-color, @gn-link-color;
- footer-link-hover-color: --gn-footer-link-hover-color, @gn-link-hover-color;
+ footer-color: --gn-footer-color, @gn-footer-color;
+ footer-bg: --gn-footer-bg, @gn-footer-bg;
+ footer-link-color: --gn-footer-link-color, @gn-footer-link-color;
+ footer-link-hover-color: --gn-footer-link-hover-color, @gn-footer-link-hover-color;
badge-color: --gn-badge-color, @gn-badge-color;
badge-bg: --gn-badge-bg, @gn-badge-bg;
@@ -323,8 +311,8 @@
loader-color: --gn-loader-color, @gn-main-color;
loader-fade-color: --gn-loader-fade-color, rgba(@gn-main-color, 0.2);
- loader-primary-contrast-color: --gn-loader-primary-color, @gn-primary-contrast;
- loader-primary-contrast-fade-color: --gn-loader-primary-fade-color, rgba(@gn-primary-contrast, 0.2);
+ loader-primary-contrast-color: --gn-loader-primary-contrast-color, @gn-primary-contrast;
+ loader-primary-contrast-fade-color: --gn-loader-primary-contrast-fade-color, rgba(@gn-primary-contrast, 0.2);
loader-primary-color: --gn-loader-primary-color, @gn-primary;
loader-primary-fade-color: --gn-loader-primary-fade-color, rgba(@gn-primary, 0.2);
diff --git a/geonode_mapstore_client/client/themes/geonode/less/geonode.less b/geonode_mapstore_client/client/themes/geonode/less/geonode.less
index 975933dd10..48822e258c 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/geonode.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/geonode.less
@@ -17,7 +17,6 @@
@import '_spinner.less';
@import '_home-container.less';
@import '_sub-flat-menu.less';
-@import '_tag.less';
@import '_mixins.less';
@import '_bootstrap-variables.less';
diff --git a/geonode_mapstore_client/client/themes/geonode/less/variants/dark.less b/geonode_mapstore_client/client/themes/geonode/less/variants/dark.less
index 0129addf0a..f3621fc8fe 100644
--- a/geonode_mapstore_client/client/themes/geonode/less/variants/dark.less
+++ b/geonode_mapstore_client/client/themes/geonode/less/variants/dark.less
@@ -43,12 +43,6 @@
@gn-focus-color: rgba(#70b0e0, 0.4);
- @gn-tag-color: #000000;
- @gn-tag-hover-color: #292929;
- @gn-tag-hover-bg: rgba(#a7d0f0, 0.75);
- @gn-tag-active-color: #292929;
- @gn-tag-active-bg: #a7d0f0;
-
@gn-footer-color: #dddddd;
@gn-footer-bg: #222222;
@gn-footer-link-color: #70b0e0;
diff --git a/geonode_mapstore_client/hooksets.py b/geonode_mapstore_client/hooksets.py
index e63b129516..f515695f1a 100644
--- a/geonode_mapstore_client/hooksets.py
+++ b/geonode_mapstore_client/hooksets.py
@@ -102,32 +102,32 @@ def layer_detail_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/layer_detail.html'
+ return 'geonode-mapstore-client/legacy/layer_detail.html'
def layer_new_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/layer_detail.html'
+ return 'geonode-mapstore-client/legacy/layer_detail.html'
def layer_view_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/layer_detail.html'
+ return 'geonode-mapstore-client/legacy/layer_detail.html'
# -- Not implemented yet
# def layer_edit_template(self, context=None):
# self.initialize_context(
# context,
# callback=ms2_config_converter.convert)
- # return 'geonode-mapstore-client/map_new.html'
+ # return 'geonode-mapstore-client/legacy/map_new.html'
def layer_update_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/layer_detail.html'
+ return 'geonode-mapstore-client/legacy/layer_detail.html'
def layer_embed_template(self, context=None):
self.initialize_context(
@@ -139,13 +139,13 @@ def layer_download_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/layer_detail.html'
+ return 'geonode-mapstore-client/legacy/layer_detail.html'
def layer_style_edit_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/layer_style_edit.html'
+ return 'geonode-mapstore-client/legacy/layer_style_edit.html'
def layer_list_url(self):
return resource_list_url('layer')
@@ -158,30 +158,30 @@ def map_detail_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/map_detail.html'
+ return 'geonode-mapstore-client/legacy/map_detail.html'
def map_new_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
if self.isEditLayer(context):
- return 'geonode-mapstore-client/layer_data_edit.html'
+ return 'geonode-mapstore-client/legacy/layer_data_edit.html'
elif self.isViewLayer(context):
- return 'geonode-mapstore-client/layer_view.html'
+ return 'geonode-mapstore-client/legacy/layer_view.html'
else:
- return 'geonode-mapstore-client/map_new.html'
+ return 'geonode-mapstore-client/legacy/map_new.html'
def map_view_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/map_view.html'
+ return 'geonode-mapstore-client/legacy/map_view.html'
def map_edit_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/map_edit.html'
+ return 'geonode-mapstore-client/legacy/map_edit.html'
def map_embed_template(self, context=None):
self.initialize_context(
@@ -199,7 +199,7 @@ def map_detail_url(self, resource):
# self.initialize_context(
# context,
# callback=ms2_config_converter.convert)
- # return 'geonode-mapstore-client/map_view.html'
+ # return 'geonode-mapstore-client/legacy/map_view.html'
# Documents
def document_list_url(self):
@@ -213,31 +213,31 @@ def geoapp_list_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/app_list.html'
+ return 'geonode-mapstore-client/legacy/app_list.html'
def geoapp_new_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/app_new.html'
+ return 'geonode-mapstore-client/legacy/app_new.html'
def geoapp_view_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/app_view.html'
+ return 'geonode-mapstore-client/legacy/app_view.html'
def geoapp_edit_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/app_edit.html'
+ return 'geonode-mapstore-client/legacy/app_edit.html'
def geoapp_update_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/app_update.html'
+ return 'geonode-mapstore-client/legacy/app_update.html'
def geoapp_embed_template(self, context=None):
self.initialize_context(
@@ -249,7 +249,7 @@ def geoapp_download_template(self, context=None):
self.initialize_context(
context,
callback=ms2_config_converter.convert)
- return 'geonode-mapstore-client/app_download.html'
+ return 'geonode-mapstore-client/legacy/app_download.html'
def geoapp_list_url(self):
return resource_list_url('geostory')
@@ -268,7 +268,7 @@ def viewer_json(self, conf, context=None):
def update_from_viewer(self, conf, context=None):
conf = self.viewer_json(conf, context=context)
context['config'] = conf
- return 'geonode-mapstore-client/edit_map.html'
+ return 'geonode-mapstore-client/legacy/edit_map.html'
def metadata_update_redirect(self, url):
url = url.replace('/metadata', '')
diff --git a/geonode_mapstore_client/templates/base.html b/geonode_mapstore_client/templates/base.html
index 6a867a8b14..f9b85cb692 100644
--- a/geonode_mapstore_client/templates/base.html
+++ b/geonode_mapstore_client/templates/base.html
@@ -7,6 +7,7 @@
{% block extra_head %}
+ {% include './geonode-mapstore-client/snippets/custom_theme.html' %}
{% endblock %}
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html b/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html
index 8ab28a155c..b996e1f3bd 100644
--- a/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/_geonode_config.html
@@ -64,8 +64,6 @@
useCORS: []
},
geoNodeApi: {
- endpointAdapter: '{{ SITEURL }}mapstore/rest',
- endpointAutocomplete: '{{ SITEURL }}base/autocomplete_response',
endpointV1: '{{ SITEURL }}api',
endpointV2: '{{ SITEURL }}api/v2'
},
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/app/geostory.html b/geonode_mapstore_client/templates/geonode-mapstore-client/app/geostory.html
deleted file mode 100644
index cd0baa4b28..0000000000
--- a/geonode_mapstore_client/templates/geonode-mapstore-client/app/geostory.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% load static %}
-{% load client_version %}
-
-{% include '../_geonode_config.html' with is_embed=is_embed is_app=True plugins_config_key=plugins_config_key|default:'geostory' is_new_resource=is_new|default:'true' %}
-
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/app_embed.html b/geonode_mapstore_client/templates/geonode-mapstore-client/app_embed.html
index af9afbac43..6f8db8e9c2 100644
--- a/geonode_mapstore_client/templates/geonode-mapstore-client/app_embed.html
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/app_embed.html
@@ -1,4 +1,4 @@
-{% include "./app_new.html" with plugins_config_key="geostory_embed" is_new="false" is_embed="true"%}
+{% include "./legacy/app_new.html" with plugins_config_key="geostory_embed" is_new="false" is_embed="true"%}
{% block style %}
{% block map_content %}
-{% include './_geonode_config.html' with plugins_config_key=plugins_config_key|default:'map_edit' is_new_resource=is_new|default:'false' %}
+{% include '../_geonode_config.html' with plugins_config_key=plugins_config_key|default:'map_edit' is_new_resource=is_new|default:'false' %}
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/map_new.html b/geonode_mapstore_client/templates/geonode-mapstore-client/legacy/map_new.html
similarity index 100%
rename from geonode_mapstore_client/templates/geonode-mapstore-client/map_new.html
rename to geonode_mapstore_client/templates/geonode-mapstore-client/legacy/map_new.html
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/map_view.html b/geonode_mapstore_client/templates/geonode-mapstore-client/legacy/map_view.html
similarity index 100%
rename from geonode_mapstore_client/templates/geonode-mapstore-client/map_view.html
rename to geonode_mapstore_client/templates/geonode-mapstore-client/legacy/map_view.html
diff --git a/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/custom_theme.html b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/custom_theme.html
new file mode 100644
index 0000000000..9c9559703c
--- /dev/null
+++ b/geonode_mapstore_client/templates/geonode-mapstore-client/snippets/custom_theme.html
@@ -0,0 +1,207 @@
+{% block content %}
+ {% comment %}
+
+
+ {% endcomment %}
+{% endblock %}
diff --git a/geonode_mapstore_client/templates/index.html b/geonode_mapstore_client/templates/index.html
index 13e795709d..c7af93818d 100644
--- a/geonode_mapstore_client/templates/index.html
+++ b/geonode_mapstore_client/templates/index.html
@@ -11,6 +11,11 @@
{{ SITE_NAME }}
{% include './geonode-mapstore-client/snippets/loader_style.html' %}
+
+ {% block custom_theme %}
+ {% include './geonode-mapstore-client/snippets/custom_theme.html' %}
+ {% endblock %}
+
{% block extra_style %}
{% endblock %}