-
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
Applying necessary changes to cadastrapp to support MapStore layout changes #156
Conversation
…ible to track if cadastrapp panel is open.
- Making menu item toggleable; - Alternative set of actions for cadastrapp when tool should be toggled without affecting drawing status - Close feature editor when cadastrapp is open. - Reset annotation editing session when cadastrapp selection tool is activated. - Toggle cadastrapp tool off when annotation triggers drawing.
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.
The rest of the code looks good to me. Not tested yet.
Only a change and a question
js/extension/epics/setup.js
Outdated
action$.ofType(SET_CONTROL_PROPERTIES) | ||
action$.ofType(SET_CONTROL_PROPERTIES, SET_CONTROL_PROPERTY, TOGGLE_CONTROL) | ||
.filter(() => isCadastrappOpen(store)) | ||
.filter(({ control, properties }) => control === "metadataexplorer" && properties?.enabled) // open the catalog from TOC | ||
.map( () => setControlProperty(CONTROL_NAME, "enabled", false)); | ||
.filter(({control, property, properties = [], type}) => { | ||
const state = store.getState(); | ||
const controlState = state.controls[control].enabled; | ||
switch (type) { | ||
case SET_CONTROL_PROPERTY: | ||
case TOGGLE_CONTROL: | ||
return (property === 'enabled' || !property) && controlState && shutdownList.includes(control); | ||
default: | ||
return findIndex(keys(properties), prop => prop === 'enabled') > -1 && controlState && shutdownList.includes(control); | ||
} | ||
}) | ||
.map( () => { | ||
return setControlProperty(CONTROL_NAME, "enabled", false); | ||
}); | ||
|
||
export const closeCadastrappOnFeatureGridOpen = (action$) => | ||
action$.ofType(OPEN_FEATURE_GRID) | ||
.switchMap( () => { | ||
let actions = [ | ||
setControlProperty('cadastrapp', 'enabled', false) | ||
]; | ||
return Rx.Observable.from(actions); |
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.
merge these two, and toggle only when cadastrapp it is open, to prevent unnecessary actions.
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.
Thanks, merged and added optional chaining for controlState variable because state branch may not exist in such subset of actions.
* @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) => { |
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.
Good job |
Description
This PR applies several changes and improvements to the cadastrapp to make it compatible with the updated MapStore layout (geosolutions-it/MapStore2#8086)
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
#150
What is the new behavior?
As per PR description
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information