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 3 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
39 changes: 39 additions & 0 deletions docs/developer-guide/mapstore-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,45 @@ Following actions need to be applied to make a switch:
- 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.
Expand Down
13 changes: 13 additions & 0 deletions web/client/components/misc/panels/DockContainer.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import React from 'react';
import classnames from "classnames";

/**
* Wrapper for DockablePanel with main intension to support applying of custom styling to make dock panels have proper
* offset depending on the sidebars presence on the page
* @memberof components.misc.panels
* @name DockContainer
* @param id {string} - id applied to the container
* @param children {JSX.Element}
* @param dockStyle {object} - style object obtained from mapLayoutValuesSelector and used to calculate offsets
* @param className {string} - class name
* @param style - style object to apply to the container. Can be used to overwrite styles applied by dockStyle calculations
* @returns {JSX.Element}
* @constructor
*/
const DockContainer = ({ id, children, dockStyle, className, style = {}}) => {
const persistentStyle = {
width: `calc(100% - ${(dockStyle?.right ?? 0) + (dockStyle?.left ?? 0)}px)`,
Expand Down
33 changes: 21 additions & 12 deletions web/client/components/misc/panels/ResponsivePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,30 @@ import DockablePanel from "./DockablePanel";
import React from "react";

/**
* Component for rendering DockPanel that supposed to:
* - Get dynamic width if panel cannot fit to the screen width. It will be automatically resized to the window width.
* - Get proper offsets based on the current map layout: with or without sidebar
* @memberof components.misc.panels
* @name ResponsivePanel
* @param props
* @param {boolean} dock - rendered as a dock if true, otherwise rendered as a modal window
* @param {object} containerStyle - style object to be applied to the DockContainer.
* @param {string} containerClassName - class name to be applied to the DockContainer.
* @param {string} containerId - id to be applied to the DockContainer.
* @param {number} size - maximum width of the dock panel.
* @param {JSX.Element} children - components to be rendered inside the dock panel.
* @param {JSX.Element} siblings - components to be rendered inside container after dock panel.
* @param {object} panelProps - props that will be applied to the DockablePanel component.
* @returns {JSX.Element}
*/
export default (props) => {
const {
dock = true,
containerStyle,
containerClassName,
containerId,
size,
children,
siblings,
...panelProps
} = props;
export default ({
children,
containerClassName,
containerId,
containerStyle,
dock = true,
siblings,
size,
...panelProps}) => {
return (
<DockContainer
dockStyle={containerStyle}
Expand Down
6 changes: 4 additions & 2 deletions web/client/plugins/MapExport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ const MapExportPlugin = createPlugin('MapExport', {
() => toggleControl('export') :
() => exportMap(enabledFormats[0] || 'mapstore2'),
priority: 1,
toggle: true
toggle: true,
doNotHide: true
};
},
BurgerMenu: config => {
Expand All @@ -119,7 +120,8 @@ const MapExportPlugin = createPlugin('MapExport', {
() => toggleControl('export') :
() => exportMap(enabledFormats[0] || 'mapstore2'),
priority: 2,
toggle: true
toggle: true,
doNotHide: true
};
}
},
Expand Down
6 changes: 4 additions & 2 deletions web/client/plugins/Save.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export default createPlugin('Save', {
style: loggedIn && id && canEdit ? {} : { display: "none" }// the resource is new (no resource) or if present, is editable
})
),
priority: 2
priority: 2,
doNotHide: true
},
SidebarMenu: {
name: 'mapSave',
Expand All @@ -71,7 +72,8 @@ export default createPlugin('Save', {
style: loggedIn && id && canEdit ? {} : { display: "none" }// the resource is new (no resource) or if present, is editable
})
),
priority: 1
priority: 1,
doNotHide: true
}
}
});
6 changes: 4 additions & 2 deletions web/client/plugins/SaveAs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export default createPlugin('SaveAs', {
}
return { style: isLoggedIn(state) ? {} : {display: "none"} };
},
priority: 2
priority: 2,
doNotHide: true
},
SidebarMenu: {
name: 'saveAs',
Expand All @@ -77,7 +78,8 @@ export default createPlugin('SaveAs', {

};
},
priority: 1
priority: 1,
doNotHide: true
}
}
});
16 changes: 16 additions & 0 deletions web/client/plugins/StreetView/StreetView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ export default createPlugin(
tooltip: "streetView.tooltip",
icon: <Glyphicon glyph="road" />,
action: () => toggleStreetView()
},
SidebarMenu: {
position: 40,
priority: 1,
doNotHide: true,
name: CONTROL_NAME,
text: <Message msgId="streetView.title"/>,
tooltip: "streetView.tooltip",
icon: <Glyphicon glyph="road" />,
action: () => toggleStreetView(),
selector: (state) => {
return {
bsStyle: state.controls["street-view"] && state.controls["street-view"].enabled ? 'primary' : 'tray',
active: state.controls["street-view"] && state.controls["street-view"].enabled || false
};
}
}
}
}
Expand Down