-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] disable edit layer button when flyout is open for add layer or…
… map settings (#64230) * [Maps] disable edit layer button to avoid user data loss * remove layer_toc_actions * fix tslint errors * update jest snapshots * review feedback Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
30439f6
commit 4a18894
Showing
10 changed files
with
199 additions
and
113 deletions.
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
36 changes: 5 additions & 31 deletions
36
...mponents/widget_overlay/layer_control/layer_toc/toc_entry/__snapshots__/view.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
17 changes: 14 additions & 3 deletions
17
...napshots__/layer_toc_actions.test.js.snap → ..._/toc_entry_actions_popover.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
...nents/widget_overlay/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/index.ts
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,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { AnyAction, Dispatch } from 'redux'; | ||
import { connect } from 'react-redux'; | ||
import { MapStoreState } from '../../../../../../reducers/store'; | ||
import { | ||
fitToLayerExtent, | ||
toggleLayerVisible, | ||
cloneLayer, | ||
removeLayer, | ||
} from '../../../../../../actions/map_actions'; | ||
import { getMapZoom, isUsingSearch } from '../../../../../../selectors/map_selectors'; | ||
import { getIsReadOnly } from '../../../../../../selectors/ui_selectors'; | ||
import { TOCEntryActionsPopover } from './toc_entry_actions_popover'; | ||
|
||
function mapStateToProps(state: MapStoreState) { | ||
return { | ||
isReadOnly: getIsReadOnly(state), | ||
isUsingSearch: isUsingSearch(state), | ||
zoom: getMapZoom(state), | ||
}; | ||
} | ||
|
||
function mapDispatchToProps(dispatch: Dispatch<AnyAction>) { | ||
return { | ||
cloneLayer: (layerId: string) => { | ||
dispatch(cloneLayer(layerId)); | ||
}, | ||
fitToBounds: (layerId: string) => { | ||
dispatch(fitToLayerExtent(layerId)); | ||
}, | ||
removeLayer: (layerId: string) => { | ||
dispatch(removeLayer(layerId)); | ||
}, | ||
toggleVisible: (layerId: string) => { | ||
dispatch(toggleLayerVisible(layerId)); | ||
}, | ||
}; | ||
} | ||
|
||
const connectedTOCEntryActionsPopover = connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(TOCEntryActionsPopover); | ||
export { connectedTOCEntryActionsPopover as TOCEntryActionsPopover }; |
Oops, something went wrong.