Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

#8086 Layout changes and other improvements #8085

Merged
merged 52 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
65b6886
# 150 Layout changes of the UI
alexander-fedorenko Apr 6, 2022
523ba55
Updated test to be align with the changed position of annotations panel
alexander-fedorenko Apr 7, 2022
8e808b2
Changes for print plugin required to support printing of additional l…
alexander-fedorenko Apr 7, 2022
ba43a08
Minor customizations for "Home" and "Login" plugins to make them prop…
alexander-fedorenko Apr 13, 2022
cb1c15a
Update of the rest plugins that were presented in BurgerMenu to appea…
alexander-fedorenko Apr 14, 2022
392d3e9
rollback, was causing problems when some glyphicons were not rendered
alexander-fedorenko Apr 14, 2022
f813ba9
Corrections of style for legacy burger menu
alexander-fedorenko Apr 14, 2022
a793f0e
- Hide burger menu when SidebarMenu is active, keep OmniBar visible a…
alexander-fedorenko Apr 19, 2022
83fb2ad
Skip attempt to sum-up dockSize as percentage amount.
alexander-fedorenko Apr 19, 2022
209e818
Moved layout-based style from omnibar to search plugin to prevent inf…
alexander-fedorenko Apr 19, 2022
b70a82c
Added toggle support for part of the tools;
alexander-fedorenko Apr 19, 2022
a928e43
Selector & reducer update
alexander-fedorenko Apr 19, 2022
d781ccf
Sidebar menu with tracking of the window height and hiding elements i…
alexander-fedorenko Apr 21, 2022
c027eab
- Sidebar - keep last active item tracked.
alexander-fedorenko Apr 25, 2022
29cc37c
Prevent reset of last active item from additional list when user togg…
alexander-fedorenko Apr 25, 2022
66ee8ff
Support of having plugins list that define dock panel that needs to b…
alexander-fedorenko Apr 25, 2022
f8bfb8e
- Updated annotations panels order (since it's moved from right to left)
alexander-fedorenko Apr 26, 2022
a311afb
- Fixes for searchbar when omnibar contains elements;
alexander-fedorenko Apr 27, 2022
144c5b9
Locale strings for sidebar menu
alexander-fedorenko Apr 27, 2022
b3ac0ca
Fixes search to be styled consistently with or without sidebar menu.
alexander-fedorenko Apr 28, 2022
7e496a7
Fixes search to be styled consistently with or without sidebar menu.
alexander-fedorenko Apr 28, 2022
9ed51b1
Amending existing tests to make them work after layout changes;
alexander-fedorenko Apr 29, 2022
16ae536
Basic test coverage for implemented functionality
alexander-fedorenko Apr 29, 2022
395d799
Reverting flex styles for omnibar. Using simpler approach for proper …
alexander-fedorenko May 1, 2022
119ef93
Fix of the bug that prevents prioritized container to be properly sel…
alexander-fedorenko May 2, 2022
f182cec
- Changes in plugin priorities to make them appear in BurgerMenu by d…
alexander-fedorenko May 2, 2022
62f02aa
Reducing button sizes;
alexander-fedorenko May 2, 2022
9901e16
Making option to print additional layers optional and disabled by def…
alexander-fedorenko May 2, 2022
ea18646
Removed monitored state.
alexander-fedorenko May 2, 2022
341017f
Removed BurgerMenu from desktop plugins.
alexander-fedorenko May 2, 2022
5b69fba
Share plugin tests fix.
alexander-fedorenko May 2, 2022
568accc
Order matters
alexander-fedorenko May 2, 2022
fb68718
15/30px size for medium-size buttons
alexander-fedorenko May 2, 2022
b66e26d
- Separate panel component with support of tracking of container width
alexander-fedorenko May 3, 2022
936e91c
Fix for annotations plugin tests
alexander-fedorenko May 3, 2022
6092a52
Revert of hardcoded toolbar buttons in TOC for annotations. Defining …
alexander-fedorenko May 3, 2022
d524a0b
Correction to make cards size approximately same as it was before but…
alexander-fedorenko May 3, 2022
45c8eef
Using common button size in less stylesheet of SidebarMenu;
alexander-fedorenko May 3, 2022
3f0fe68
Merge branch 'master' into 150-layout-change
alexander-fedorenko May 3, 2022
895e89d
- Tracking of the case when left/right panels are open via state.
alexander-fedorenko May 3, 2022
e2bcc35
Updated migration documentation with changes to the pluginsConfig.json
alexander-fedorenko May 4, 2022
a950395
- Map export, Save, SaveAs plugins - making them work again by adding…
alexander-fedorenko May 4, 2022
cd0ca65
DockContainer and ResponsivePanel documentation
alexander-fedorenko May 4, 2022
2106ae1
Added card-height variable.
alexander-fedorenko May 4, 2022
0f51fae
Missed lines
alexander-fedorenko May 4, 2022
7a1256a
Missed lines /2
alexander-fedorenko May 4, 2022
4d8dcef
Use card-height in TOC styles
alexander-fedorenko May 4, 2022
1874d95
Suggested change to the documentation with minor fix
alexander-fedorenko May 4, 2022
4547d60
Update web/client/configs/pluginsConfig.json
alexander-fedorenko May 4, 2022
1b78995
Properly hide overlay layers printing options by default (it is enabl…
alexander-fedorenko May 4, 2022
adf9fab
Properly hide overlay layers printing options by default (it is enabl…
alexander-fedorenko May 5, 2022
1448191
Missing doNotHide for DeleteMap plugin
alexander-fedorenko May 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions docs/developer-guide/mapstore-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,76 @@ formats:
- '*'
```

### Replacing BurgerMenu with SidebarMenu
There were several changes applied to the application layout, one of them is the Sidebar Menu that comes to replace Burger menu on map viewer and in contexts.
Following actions need to be applied to make a switch:
- Update localConfig.json and add "SidebarMenu" entry to the "desktop" section:
```json
{
"desktop": [
...
"SidebarMenu",
...
]
}
```
- Remove "BurgerMenu" entry from "desktop" section.

#### Updating contexts to use Sidebar Menu
Contents of your `pluginsConfig.json` need to be reviewed to allow usage of new "SidebarMenu" in contexts.
- Find "BurgerMenu" plugin confuguration in `pluginsConfig.json` and remove `"hidden": true` line from it:
```json
{
"name": "BurgerMenu",
"glyph": "menu-hamburger",
"title": "plugins.BurgerMenu.title",
"description": "plugins.BurgerMenu.description",
"dependencies": [
"OmniBar"
]
}
```
- Add "SidebarMenu" entry to the "plugins" array:
```json
{
"plugins": [
...
{
"name": "SidebarMenu",
"hidden": true
}
...
]
}
```
- Go through all plugins definitions and replace "BurgerMenu" dependency with "SidebarMenu", e.g.:
```json
{
"name": "MapExport",
"glyph": "download",
"title": "plugins.MapExport.title",
"description": "plugins.MapExport.description",
"dependencies": [
"SidebarMenu"
]
}
```
alexander-fedorenko marked this conversation as resolved.
Show resolved Hide resolved

Existing contexts need to be updated manually using following procedure:
- Edit context and proceed to the step of plugins configuration.
- Remove "BurgerMenu" from list of enabled plugins.
- Save context.

"SidebarMenu" will be used by context if "BurgerMenu" is not in the list of enabled plugins.


## Migration from 2022.01.00 to 2022.01.01

### MailingLists plugin has been removed

`MailingLists` plugin has ben removed from the core of MapStore. This means you can remove it from your `localConfig.json` (if present, it will be anyway ignored by the plugin system).


## Migration from 2021.02.02 to 2022.01.00

This release includes several libraries upgrade on the backend side,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
"react-codemirror2": "4.0.0",
"react-color": "2.17.0",
"react-confirm-button": "0.0.2",
"react-container-dimensions": "1.3.2",
"react-container-dimensions": "1.4.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are currently using two library for the resizing react-container-dimensions and react-resize-detector. If I remember correctly react-resize-detector was introduced to solve the issue of the react-container-dimensions . If this PR is changing all the current instances of react-container-dimensions I would try to use the react-resize-detector instead and going to remove this one instead to update it. This is only a suggestion, I'm not sure if the react-container-dimensions is still use somewhere else

Copy link
Contributor Author

@alexander-fedorenko alexander-fedorenko May 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my comment below #8085 (comment)

"react-contenteditable": "3.3.2",
"react-copy-to-clipboard": "5.0.0",
"react-data-grid": "5.0.4",
Expand Down
19 changes: 19 additions & 0 deletions web/client/actions/__tests__/sidebarmenu-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2022, 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 {SET_LAST_ACTIVE_ITEM, setLastActiveItem} from "../sidebarmenu";

describe('Test correctness of the sidebar actions', () => {

it('test setLastActiveItem', () => {
const action = setLastActiveItem("annotations");
expect(action.type).toBe(SET_LAST_ACTIVE_ITEM);
expect(action.value).toBe("annotations");
});
});
16 changes: 16 additions & 0 deletions web/client/actions/sidebarmenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright 2022, 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.
*/

export const SET_LAST_ACTIVE_ITEM = 'SIDEBARMENU:SET_LAST_ACTIVE_ITEM';

export function setLastActiveItem(value) {
return {
type: SET_LAST_ACTIVE_ITEM,
value
};
}
2 changes: 2 additions & 0 deletions web/client/components/TOC/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Toolbar extends React.Component {
static propTypes = {
groups: PropTypes.array,
items: PropTypes.array,
layers: PropTypes.array,
selectedLayers: PropTypes.array,
generalInfoFormat: PropTypes.string,
selectedGroups: PropTypes.array,
Expand All @@ -41,6 +42,7 @@ class Toolbar extends React.Component {
static defaultProps = {
groups: [],
items: [],
layers: [],
selectedLayers: [],
selectedGroups: [],
onToolsActions: {
Expand Down
190 changes: 97 additions & 93 deletions web/client/components/data/identify/IdentifyContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

import React from 'react';

import { Row } from 'react-bootstrap';
import {Row} from 'react-bootstrap';
import { get } from 'lodash';
import Toolbar from '../../misc/toolbar/Toolbar';
import Message from '../../I18N/Message';
import DockablePanel from '../../misc/panels/DockablePanel';
import GeocodeViewer from './GeocodeViewer';
import ResizableModal from '../../misc/ResizableModal';
import Portal from '../../misc/Portal';
import Coordinate from './coordinates/Coordinate';
import { responseValidForEdit } from '../../../utils/IdentifyUtils';
import LayerSelector from './LayerSelector';
import ResponsivePanel from "../../misc/panels/ResponsivePanel";

/**
* Component for rendering Identify Container inside a Dockable container
Expand Down Expand Up @@ -108,102 +108,106 @@ export default props => {
const missingResponses = requests.length - responses.length;
const revGeocodeDisplayName = reverseGeocodeData.error ? <Message msgId="identifyRevGeocodeError"/> : reverseGeocodeData.display_name;
return (
<div id="identify-container" className={enabled && requests.length !== 0 ? "identify-active" : ""}>
<DockablePanel
bsStyle="primary"
glyph="map-marker"
open={enabled && requests.length !== 0}
size={size}
fluid={fluid}
position={position}
draggable={draggable}
onClose={() => {
onClose();
toggleHighlightFeature(false);
}}
dock={dock}
style={dockStyle}
showFullscreen={showFullscreen}
zIndex={zIndex}
header={[
<Row className="layer-select-row">
<div className="layer-col">
<span className="identify-icon glyphicon glyphicon-1-layer"/>
<LayerSelector
responses={responses}
index={index}
loaded={loaded}
setIndex={setIndex}
missingResponses={missingResponses}
emptyResponses={emptyResponses}
validator={validator}
format={format}
/>
<Toolbar
btnDefaultProps={{ bsStyle: 'primary', className: 'square-button-md' }}
buttons={getFeatureButtons(props)}
transitionProps={null}
/>
</div>
</Row>,
!disableCoordinatesRow &&
(<Row className="coordinates-edit-row">
<span className="identify-icon glyphicon glyphicon-point"/>
<div style={showCoordinateEditor ? {zIndex: 1} : {}} className={"coordinate-editor"}>
<Coordinate
key="coordinate-editor"
formatCoord={formatCoord}
enabledCoordEditorButton={enabledCoordEditorButton}
onSubmit={onSubmitClickPoint}
onChangeFormat={onChangeFormat}
edit={showCoordinateEditor}
coordinate={{
lat: latlng && latlng.lat,
lon: lngCorrected
}}
/>
</div>
<GeocodeViewer latlng={latlng} revGeocodeDisplayName={revGeocodeDisplayName} {...props}/>
<ResponsivePanel
containerStyle={dockStyle}
containerId="identify-container"
containerClassName={enabled && requests.length !== 0 ? "identify-active" : ""}
bsStyle="primary"
glyph="map-marker"
open={enabled && requests.length !== 0}
size={size}
fluid={fluid}
position={position}
draggable={draggable}
onClose={() => {
onClose();
toggleHighlightFeature(false);
}}
dock={dock}
style={dockStyle}
showFullscreen={showFullscreen}
zIndex={zIndex}
header={[
<Row className="layer-select-row">
<div className="layer-col">
<span className="identify-icon glyphicon glyphicon-1-layer"/>
<LayerSelector
responses={responses}
index={index}
loaded={loaded}
setIndex={setIndex}
missingResponses={missingResponses}
emptyResponses={emptyResponses}
validator={validator}
format={format}
/>
<Toolbar
btnDefaultProps={{ bsStyle: 'primary', className: 'square-button-md' }}
buttons={toolButtons}
transitionProps={null
buttons={getFeatureButtons(props)}
transitionProps={null}
/>
</div>
</Row>,
!disableCoordinatesRow &&
(<Row className="coordinates-edit-row">
<span className="identify-icon glyphicon glyphicon-point"/>
<div style={showCoordinateEditor ? {zIndex: 1} : {}} className={"coordinate-editor"}>
<Coordinate
key="coordinate-editor"
formatCoord={formatCoord}
enabledCoordEditorButton={enabledCoordEditorButton}
onSubmit={onSubmitClickPoint}
onChangeFormat={onChangeFormat}
edit={showCoordinateEditor}
coordinate={{
lat: latlng && latlng.lat,
lon: lngCorrected
}}
/>
</div>
<GeocodeViewer latlng={latlng} revGeocodeDisplayName={revGeocodeDisplayName} {...props}/>
<Toolbar
btnDefaultProps={{ bsStyle: 'primary', className: 'square-button-md' }}
buttons={toolButtons}
transitionProps={null
/* transitions was causing a bad rendering of toolbar present in the identify panel
* for this reason they ahve been disabled
*/
}/>
</Row>)
].filter(headRow => headRow)}>
<Viewer
index={index}
setIndex={setIndex}
format={format}
missingResponses={missingResponses}
responses={responses}
requests={requests}
showEmptyMessageGFI={showEmptyMessageGFI}
disableInfoAlert={disableInfoAlert}
{...viewerOptions}/>
</DockablePanel>
<Portal>
<ResizableModal
fade
title={<Message msgId="warning"/>}
size="xs"
show={warning}
onClose={clearWarning}
buttons={[{
text: <Message msgId="close"/>,
onClick: clearWarning,
bsStyle: 'primary'
}]}>
<div className="ms-alert" style={{padding: 15}}>
<div className="ms-alert-center text-center">
<Message msgId="identifyNoQueryableLayers"/>
}/>
</Row>)
].filter(headRow => headRow)}
siblings={
<Portal>
<ResizableModal
fade
title={<Message msgId="warning"/>}
size="xs"
show={warning}
onClose={clearWarning}
buttons={[{
text: <Message msgId="close"/>,
onClick: clearWarning,
bsStyle: 'primary'
}]}>
<div className="ms-alert" style={{padding: 15}}>
<div className="ms-alert-center text-center">
<Message msgId="identifyNoQueryableLayers"/>
</div>
</div>
</div>
</ResizableModal>
</Portal>
</div>
</ResizableModal>
</Portal>
}
>
<Viewer
index={index}
setIndex={setIndex}
format={format}
missingResponses={missingResponses}
responses={responses}
requests={requests}
showEmptyMessageGFI={showEmptyMessageGFI}
disableInfoAlert={disableInfoAlert}
{...viewerOptions}/>
</ResponsivePanel>
);
};
Loading