-
Notifications
You must be signed in to change notification settings - Fork 10
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
Applying necessary changes to cadastrapp to support MapStore layout changes #156
Merged
tdipisa
merged 6 commits into
georchestra:master
from
alexander-fedorenko:8086-layout-changes
May 10, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
143f8f5
Cadastrapp changes to support new SidebarMenu plugin
alexander-fedorenko f3369ff
Minor fixes and priority change for BurgerMenu
alexander-fedorenko f2e85a9
Make cadastrapp write to layout.rightPanel property to make it's poss…
alexander-fedorenko 6047129
- Fix of dependency for cadastrapp;
alexander-fedorenko 0cc75e1
Function documentation
alexander-fedorenko 789ba0b
Merging epics into one.
alexander-fedorenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
} | ||
}, | ||
"dependencies": [ | ||
"BurgerMenu" | ||
"SidebarMenu" | ||
] | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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)`, | ||
transform: `translateX(-${(dockStyle?.right ?? 0)}px)`, | ||
pointerEvents: 'none' | ||
}; | ||
return ( | ||
<div id={id} className={classnames({ | ||
...(className ? {[className]: true} : {}), | ||
'dock-container': true | ||
})} style={{...persistentStyle, ...style}}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
export default DockContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {mapLayoutSelector} from "@mapstore/selectors/maplayout"; | ||
import {memoize} from "lodash"; | ||
|
||
export const boundingSidebarRectSelector = (state) => state.maplayout && state.maplayout.boundingSidebarRect || {}; | ||
|
||
/** | ||
* Retrieve only specific attribute from map layout | ||
* @function | ||
* @memberof selectors.mapLayout | ||
* @param {object} state the state | ||
* @param {object} attributes attributes to retrieve, bool {left: true} | ||
* @param {boolean} isDock flag to use dock paddings instead of toolbar paddings | ||
* @return {object} selected attributes of layout of the map | ||
*/ | ||
export const mapLayoutValuesSelector = memoize((state, attributes = {}, isDock = false) => { | ||
const layout = mapLayoutSelector(state); | ||
const boundingSidebarRect = boundingSidebarRectSelector(state); | ||
return layout && Object.keys(layout).filter(key => | ||
attributes[key]).reduce((a, key) => { | ||
if (isDock) { | ||
return ({...a, [key]: (boundingSidebarRect[key] ?? layout[key])}); | ||
} | ||
return ({...a, [key]: layout[key]}); | ||
}, | ||
{}) || {}; | ||
}, (state, attributes, isDock) => | ||
JSON.stringify(mapLayoutSelector(state)) + | ||
JSON.stringify(boundingSidebarRectSelector(state)) + | ||
JSON.stringify(attributes) + (isDock ? '_isDock' : '')); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically is the copy of selector from upstream repo. isDock needed to apply offset from the right equal to sidebar width. If it's false - sidebar width + panel width offset is applied instead.