From 6a37530906d29fc8e06b21870af74c77f0fa1fe0 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Mon, 16 Aug 2021 12:10:54 +0200 Subject: [PATCH 01/13] add fullscreen plugin --- .../js/plugins/actionnavbar/buttons.jsx | 23 +++++++++++++ .../client/js/plugins/index.js | 14 ++++++-- .../static/mapstore/configs/localConfig.json | 32 ++++++++++++++++++- 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx index 88b17cb9c6..d1e8f32fe5 100644 --- a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx +++ b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx @@ -11,6 +11,10 @@ import { toggleControl, setControlProperty } from '@mapstore/framework/actions/controls'; +import { + toggleFullscreen +} from '@mapstore/framework/actions/fullscreen'; + import Message from '@mapstore/framework/components/I18N/Message'; import Button from '@js/components/Button'; @@ -75,6 +79,25 @@ export const MeasureActionButton = connect( ); }); +export const FullScreenActionButton = connect( + () => ({}), + { onClick: toggleFullscreen.bind(true, true, "#page-map-viewer") } +)(({ + onClick, + variant, + size +}) => { + return ( + + ); +}); + export const LayerDownloadActionButton = connect( () => ({}), { onClick: setControlProperty.bind(null, 'layerdownload', 'enabled', true, true) } diff --git a/geonode_mapstore_client/client/js/plugins/index.js b/geonode_mapstore_client/client/js/plugins/index.js index 383bc22f19..2c2b2ed09f 100644 --- a/geonode_mapstore_client/client/js/plugins/index.js +++ b/geonode_mapstore_client/client/js/plugins/index.js @@ -15,7 +15,8 @@ import { CatalogActionButton, MeasureActionButton, LayerDownloadActionButton, - AnnotationsActionButton + AnnotationsActionButton, + FullScreenActionButton } from '@js/plugins/actionnavbar/buttons'; import { getMetadataUrl } from '@js/utils/ResourceUtils'; @@ -189,7 +190,16 @@ export const plugins = { ), FullScreenPlugin: toLazyPlugin( 'FullScreen', - import(/* webpackChunkName: 'plugins/fullscreen-plugin' */ '@mapstore/framework/plugins/FullScreen') + import(/* webpackChunkName: 'plugins/fullscreen-plugin' */ '@mapstore/framework/plugins/FullScreen'), + { + containers: { + ActionNavbar: { + name: 'FullScreen', + Component: FullScreenActionButton, + priority: 5 + } + } + } ), AddGroupPlugin: toLazyPlugin( 'AddGroup', diff --git a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json index 06c9dfce65..45588f3e0d 100644 --- a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json +++ b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json @@ -846,6 +846,10 @@ "type": "plugin", "name": "Measure" }, + { + "type": "plugin", + "name": "FullScreen" + }, { "type": "plugin", "name": "DeleteResource", @@ -981,6 +985,9 @@ { "name": "Measure" }, + { + "name": "FullScreen" + }, { "name": "Print", "cfg": { @@ -1103,7 +1110,7 @@ "name": "FullScreen", "override": { "Toolbar": { - "alwaysVisible": false + "alwaysVisible": true } } }, @@ -1409,6 +1416,10 @@ "type": "plugin", "name": "Measure" }, + { + "type": "plugin", + "name": "FullScreen" + }, { "type": "plugin", "name": "DeleteResource", @@ -1539,6 +1550,9 @@ { "name": "Measure" }, + { + "name": "FullScreen" + }, { "name": "Print", "cfg": { @@ -1852,6 +1866,10 @@ "type": "plugin", "name": "Share" }, + { + "type": "plugin", + "name": "FullScreen" + }, { "type": "plugin", "name": "DeleteResource", @@ -1868,6 +1886,10 @@ { "name": "DetailViewer" }, + { + "type": "plugin", + "name": "FullScreen" + }, { "name": "DeleteResource" }, @@ -2027,6 +2049,10 @@ "type": "plugin", "name": "Share" }, + { + "type": "plugin", + "name": "FullScreen" + }, { "type": "plugin", "name": "DeleteResource", @@ -2040,6 +2066,10 @@ ] } }, + { + "type": "plugin", + "name": "FullScreen" + }, { "name": "DetailViewer" }, From 58e7d7c70afa89fe3bdee4e03cac42fe64ca9679 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Mon, 16 Aug 2021 12:11:39 +0200 Subject: [PATCH 02/13] fullscreen button translate --- .../client/static/mapstore/translations/data.de-DE.json | 3 ++- .../client/static/mapstore/translations/data.en-US.json | 3 ++- .../client/static/mapstore/translations/data.es-ES.json | 3 ++- .../client/static/mapstore/translations/data.fr-FR.json | 3 ++- .../client/static/mapstore/translations/data.it-IT.json | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json b/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json index b719809ebb..efa43fd286 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json @@ -166,7 +166,8 @@ "deleteResourceNo": "{count, plural, =1 {Nein, nicht löschen} other {Nein, lösche sie nicht}}", "deleteResourceYes": "Ja, ich bin sicher", "underApproval": "In Genehmigung", - "unpublish": "Nicht veröffentlicht" + "unpublish": "Nicht veröffentlicht", + "fullscreen": "Vollbild" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json b/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json index f0a2ae3b4d..d062de51c7 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json @@ -167,7 +167,8 @@ "deleteResourceNo": "{count, plural, =1 {No, don't delete it} other {No, don't delete them}}", "deleteResourceYes": "Yes, I am sure", "underApproval": "Under approval", - "unpublish": "Unpublish" + "unpublish": "Unpublish", + "fullscreen": "Full screen" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json b/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json index ab74bb01f2..a5a452836c 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json @@ -166,7 +166,8 @@ "deleteResourceNo": "{count, plural, =1 {No, no lo borres} other {No, no los borres}}", "deleteResourceYes": "Sí, estoy seguro", "underApproval": "Bajo aprobación", - "unpublish": "No publicado" + "unpublish": "No publicado", + "fullscreen": "Pantalla completa" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json b/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json index eca816044a..2c0bcc6efd 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json @@ -166,7 +166,8 @@ "deleteResourceNo": "{count, plural, =1 {Non, ne le supprime pas} other {Non, ne les supprime pas}}", "deleteResourceYes": "Oui, je suis sûr", "underApproval": "En cours d'approbation", - "unpublish": "Dépublier" + "unpublish": "Dépublier", + "fullscreen": "Plein écran" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json b/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json index 36dc497025..52a4d04534 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json @@ -168,7 +168,8 @@ "deleteResourceNo": "{count, plural, =1 {No, non eliminarlo} other {No, non eliminarli}}", "deleteResourceYes": "Sì, sono sicuro", "underApproval": "In approvazione", - "unpublish": "Non pubblicato" + "unpublish": "Non pubblicato", + "fullscreen": "Schermo intero" } } } From e887f484586c6d9357e3da701c688a46e9546efd Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Mon, 16 Aug 2021 12:35:45 +0200 Subject: [PATCH 03/13] change param bind --- .../client/js/plugins/actionnavbar/buttons.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx index d1e8f32fe5..e567d56395 100644 --- a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx +++ b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx @@ -81,7 +81,7 @@ export const MeasureActionButton = connect( export const FullScreenActionButton = connect( () => ({}), - { onClick: toggleFullscreen.bind(true, true, "#page-map-viewer") } + { onClick: toggleFullscreen.bind(null, true, "#page-map-viewer") } )(({ onClick, variant, From 927465c6821091352723ff56b822e4f31b4770c6 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Mon, 16 Aug 2021 14:41:42 +0200 Subject: [PATCH 04/13] change querySelector --- .../client/js/plugins/actionnavbar/buttons.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx index e567d56395..4a37b64ee1 100644 --- a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx +++ b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx @@ -81,7 +81,7 @@ export const MeasureActionButton = connect( export const FullScreenActionButton = connect( () => ({}), - { onClick: toggleFullscreen.bind(null, true, "#page-map-viewer") } + { onClick: toggleFullscreen.bind(null, true, "#ms-container") } )(({ onClick, variant, From b7d853d1a217c48aac964155a4273000c4a83101 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 14:44:36 +0200 Subject: [PATCH 05/13] add check un current --- geonode_mapstore_client/client/js/hooks/useResizeElement.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/hooks/useResizeElement.js b/geonode_mapstore_client/client/js/hooks/useResizeElement.js index ba70e7725f..06b3c4846b 100644 --- a/geonode_mapstore_client/client/js/hooks/useResizeElement.js +++ b/geonode_mapstore_client/client/js/hooks/useResizeElement.js @@ -13,7 +13,7 @@ const useResizeElement = (elemRef) => { const [height, setHeight] = useState(0); const handleResize = () => { - if (elemRef.current) { + if (elemRef?.current) { setWidth(elemRef.current.offsetWidth); setHeight(elemRef.current.offsetHeight); } From 15635c4a8f5ba5cae03882e3cd6321a729b87256 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 14:45:48 +0200 Subject: [PATCH 06/13] add right items --- .../client/js/plugins/ActionNavbar.jsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx b/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx index 1c263b5065..c94ace974c 100644 --- a/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx +++ b/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx @@ -12,6 +12,7 @@ import { createPlugin } from '@mapstore/framework/utils/PluginsUtils'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import ActionNavbar from '@js/components/ActionNavbar'; + import FaIcon from '@js/components/FaIcon'; import usePluginItems from '@js/hooks/usePluginItems'; import { getResourcePerms, canAddResource, getResourceData } from '@js/selectors/resource'; @@ -31,6 +32,7 @@ function checkResourcePerms(menuItem, resourcePerms) { function ActionNavbarPlugin({ items, leftMenuItems, + rightMenuItems, resourcePerms, resource }, context) { @@ -49,16 +51,33 @@ function ActionNavbarPlugin({ return (item); }); + const rightMenuItemsPlugins = reduceArrayRecursive(rightMenuItems, (item) => { + configuredItems.find(plugin => { + if ( item.type === 'plugin' && plugin.name === item.name ) { + item.Component = plugin?.Component; + } + }); + return (item); + }); + const leftItems = reduceArrayRecursive( leftMenuItemsPlugins, menuItem => checkResourcePerms(menuItem, resourcePerms) ); + + const rightItems = reduceArrayRecursive( + rightMenuItemsPlugins, + menuItem => checkResourcePerms(menuItem, resourcePerms) + ); + return (

{icon && }{' '}{resource?.title}

@@ -67,12 +86,14 @@ function ActionNavbarPlugin({ ActionNavbarPlugin.propTypes = { items: PropTypes.array, - leftMenuItems: PropTypes.array + leftMenuItems: PropTypes.array, + rightMenuItems: PropTypes.array }; ActionNavbarPlugin.defaultProps = { items: [], - leftMenuItems: [] + leftMenuItems: [], + rightMenuItems: [] }; const ConnectedActionNavbarPlugin = connect( From 2afca477dcb1236ba25c7c65f6eb10c66c0f63c3 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 14:47:01 +0200 Subject: [PATCH 07/13] add state fullscreenbutton --- .../js/plugins/actionnavbar/buttons.jsx | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx index 4a37b64ee1..ed0eb11b0b 100644 --- a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx +++ b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx @@ -7,6 +7,7 @@ */ import React from 'react'; import { connect } from 'react-redux'; +import { createSelector } from 'reselect'; import { toggleControl, setControlProperty @@ -17,7 +18,8 @@ import { import Message from '@mapstore/framework/components/I18N/Message'; import Button from '@js/components/Button'; - +import FaIcon from '@js/components/FaIcon'; +import tooltip from '@mapstore/framework/components/misc/enhancers/tooltip'; /** * buttons override to use in ActionNavbar for plugin imported from mapstore */ @@ -36,7 +38,7 @@ export const PrintActionButton = connect( size={size} onClick={() => onClick()} > - + ); }); @@ -49,14 +51,17 @@ export const CatalogActionButton = connect( variant, size }) => { + return ( + + ); }); @@ -74,27 +79,35 @@ export const MeasureActionButton = connect( size={size} onClick={() => onClick()} > - + ); }); -export const FullScreenActionButton = connect( - () => ({}), - { onClick: toggleFullscreen.bind(null, true, "#ms-container") } +export const FullScreenActionButton = connect(createSelector([ + state => state?.controls?.fullscreen?.enabled || false +], (enabled) => ({ + enabled +})), { + onClick: (enabled) => toggleFullscreen(enabled, "#ms-container") +} )(({ onClick, variant, - size + size, + enabled }) => { + const FullScreenButton = tooltip(Button); return ( - + + ); }); @@ -112,7 +125,7 @@ export const LayerDownloadActionButton = connect( size={size} onClick={() => onClick()} > - + ); }); @@ -131,7 +144,7 @@ export const AnnotationsActionButton = connect( size={size} onClick={() => onClick()} > - + ); }); From 653615cd2152fe7a31566b9b30a0b2321f54ad77 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 14:47:40 +0200 Subject: [PATCH 08/13] add traslantion --- .../client/static/mapstore/translations/data.de-DE.json | 3 ++- .../client/static/mapstore/translations/data.en-US.json | 4 +++- .../client/static/mapstore/translations/data.es-ES.json | 3 ++- .../client/static/mapstore/translations/data.fr-FR.json | 3 ++- .../client/static/mapstore/translations/data.it-IT.json | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json b/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json index efa43fd286..f3b681482d 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.de-DE.json @@ -167,7 +167,8 @@ "deleteResourceYes": "Ja, ich bin sicher", "underApproval": "In Genehmigung", "unpublish": "Nicht veröffentlicht", - "fullscreen": "Vollbild" + "fullscreen": "Vollbild", + "nativescreen": "Vollbildmodus beenden" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json b/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json index d062de51c7..93b57bff1f 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.en-US.json @@ -168,7 +168,9 @@ "deleteResourceYes": "Yes, I am sure", "underApproval": "Under approval", "unpublish": "Unpublish", - "fullscreen": "Full screen" + "fullscreen": "Full screen", + "nativescreen": "Exit full screen mode" + } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json b/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json index a5a452836c..3b3bb9d954 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.es-ES.json @@ -167,7 +167,8 @@ "deleteResourceYes": "Sí, estoy seguro", "underApproval": "Bajo aprobación", "unpublish": "No publicado", - "fullscreen": "Pantalla completa" + "fullscreen": "Pantalla completa", + "nativescreen": "Salir del modo de pantalla completa" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json b/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json index 2c0bcc6efd..08bfff543e 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.fr-FR.json @@ -167,7 +167,8 @@ "deleteResourceYes": "Oui, je suis sûr", "underApproval": "En cours d'approbation", "unpublish": "Dépublier", - "fullscreen": "Plein écran" + "fullscreen": "Plein écran", + "nativescreen": "Quitter le mode plein écran" } } } diff --git a/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json b/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json index 52a4d04534..ff59bc722b 100644 --- a/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json +++ b/geonode_mapstore_client/client/static/mapstore/translations/data.it-IT.json @@ -169,7 +169,8 @@ "deleteResourceYes": "Sì, sono sicuro", "underApproval": "In approvazione", "unpublish": "Non pubblicato", - "fullscreen": "Schermo intero" + "fullscreen": "Schermo intero", + "nativescreen": "Esci da modalità schermo intero" } } } From 8e0c2f4f6f6e26714ed87bb925486e703b08fac3 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 14:50:29 +0200 Subject: [PATCH 09/13] add fullscreen button in right menu items --- .../static/mapstore/configs/localConfig.json | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json index 45588f3e0d..01115b8b77 100644 --- a/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json +++ b/geonode_mapstore_client/client/static/mapstore/configs/localConfig.json @@ -846,10 +846,6 @@ "type": "plugin", "name": "Measure" }, - { - "type": "plugin", - "name": "FullScreen" - }, { "type": "plugin", "name": "DeleteResource", @@ -860,6 +856,12 @@ } ] } + ], + "rightMenuItems": [ + { + "type": "plugin", + "name": "FullScreen" + } ] } }, @@ -1416,10 +1418,6 @@ "type": "plugin", "name": "Measure" }, - { - "type": "plugin", - "name": "FullScreen" - }, { "type": "plugin", "name": "DeleteResource", @@ -1430,7 +1428,14 @@ } ] } + ], + "rightMenuItems": [ + { + "type": "plugin", + "name": "FullScreen" + } ] + } }, { @@ -1866,10 +1871,6 @@ "type": "plugin", "name": "Share" }, - { - "type": "plugin", - "name": "FullScreen" - }, { "type": "plugin", "name": "DeleteResource", @@ -1880,6 +1881,12 @@ } ] } + ], + "rightMenuItems": [ + { + "type": "plugin", + "name": "FullScreen" + } ] } }, @@ -2049,10 +2056,6 @@ "type": "plugin", "name": "Share" }, - { - "type": "plugin", - "name": "FullScreen" - }, { "type": "plugin", "name": "DeleteResource", @@ -2063,6 +2066,12 @@ } ] } + ], + "rightMenuItems": [ + { + "type": "plugin", + "name": "FullScreen" + } ] } }, From 470cbc2726a550491e515c201d8d3ecb7c0f81c5 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 15:19:47 +0200 Subject: [PATCH 10/13] tooltip position --- .../client/js/plugins/actionnavbar/buttons.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx index ed0eb11b0b..8adc594f19 100644 --- a/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx +++ b/geonode_mapstore_client/client/js/plugins/actionnavbar/buttons.jsx @@ -100,7 +100,7 @@ export const FullScreenActionButton = connect(createSelector([ const FullScreenButton = tooltip(Button); return ( : } variant={variant} size={size} From 1b6907e8aef2116ea6541df5a23379e098d05078 Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 17:15:40 +0200 Subject: [PATCH 11/13] remove burger menu logic for right menu --- .../components/ActionNavbar/ActionNavbar.jsx | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx b/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx index d9c59d0889..b2198828bc 100644 --- a/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx +++ b/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx @@ -52,31 +52,16 @@ const LeftContentMenu = ({ items, formatHref, query, variant, size }) => { }; -const RightContentMenu = ({ items, formatHref, query, parentRef, cfg, variant, size }) => { +const RightContentMenu = ({ items, formatHref, query, variant, size }) => { - const navbarContentRight = useRef(); const navbarRight = useRef(); - const { width: widthNavbarRight } = useResizeElement(navbarRight); - const { width: widthParent } = useResizeElement(parentRef); - const { width: widthNavbarContentRight } = useResizeElement(navbarContentRight); - const isSpaceRight = (cfg?.style) ? widthNavbarRight >= widthNavbarContentRight : widthNavbarRight >= widthParent; - const [switchToBurgerMenu, setSwitchToBurgerMenu] = useState(false); - useEffect(() => { - setSwitchToBurgerMenu(isSpaceRight); - }, [isSpaceRight]); return (
- { - (switchToBurgerMenu) && items && - } - - {(!switchToBurgerMenu) && items && + {items && From 3ccef48751a2b2279c8926451de5894ebabe458d Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 17:16:06 +0200 Subject: [PATCH 12/13] remove burger menu logic for right menu --- geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx b/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx index d7b4c3b459..7c4ea9f401 100644 --- a/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx +++ b/geonode_mapstore_client/client/js/plugins/ActionNavbar.jsx @@ -85,7 +85,6 @@ function ActionNavbarPlugin({ rightItems={rightItems} variant="default" size="sm" - cfg={{rightContents: {style: {width: "40px"}}}} >

{icon && }{' '}{resource?.title}

From 3f9cbc3894c51b3cd87d7bd3732fd41e1b86c22b Mon Sep 17 00:00:00 2001 From: Luca Orlandini Date: Thu, 19 Aug 2021 17:24:54 +0200 Subject: [PATCH 13/13] remove burger menu logic for right menu --- .../client/js/components/ActionNavbar/ActionNavbar.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx b/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx index b2198828bc..1c43fc1f4a 100644 --- a/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx +++ b/geonode_mapstore_client/client/js/components/ActionNavbar/ActionNavbar.jsx @@ -88,7 +88,6 @@ const ActionNavbar = forwardRef(({ rightItems, query, formatHref, - cfg, variant, size, children