-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] disable fit to data for geo_shape fields until elasticsearch s…
…upports a way to get the bounds (#31638) (#31699) * [Maps] disable fit to data for geo_shape fields until elasticsearch supports a way to get the bounds * add function test for fit to bounds * add jest test for layer_toc_actions component * review feedback
- Loading branch information
Showing
9 changed files
with
623 additions
and
19 deletions.
There are no files selected for viewing
390 changes: 390 additions & 0 deletions
390
x-pack/plugins/maps/public/shared/components/__snapshots__/layer_toc_actions.test.js.snap
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,390 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`LayerTocActions is rendered 1`] = ` | ||
<EuiPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<EuiButtonEmpty | ||
color="text" | ||
data-test-subj="layerTocActionsPanelToggleButtonlayer1" | ||
flush="left" | ||
iconSide="left" | ||
onClick={[Function]} | ||
size="xs" | ||
type="button" | ||
> | ||
<div> | ||
icon mock | ||
</div> | ||
</EuiButtonEmpty> | ||
} | ||
closePopover={[Function]} | ||
hasArrow={true} | ||
id="contextMenu" | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
withTitle={true} | ||
> | ||
<EuiContextMenu | ||
data-test-subj="layerTocActionsPanellayer1" | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"data-test-subj": "fitToBoundsButton", | ||
"disabled": false, | ||
"icon": <EuiIcon | ||
size="m" | ||
type="search" | ||
/>, | ||
"name": "Fit to data", | ||
"onClick": [Function], | ||
"toolTipContent": null, | ||
}, | ||
Object { | ||
"data-test-subj": "layerVisibilityToggleButton", | ||
"icon": <EuiIcon | ||
size="m" | ||
type="eye" | ||
/>, | ||
"name": "Hide layer", | ||
"onClick": [Function], | ||
}, | ||
], | ||
"title": "Layer actions", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; | ||
|
||
exports[`LayerTocActions should disable fit to data when supportsFitToBounds is false 1`] = ` | ||
<EuiPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<EuiButtonEmpty | ||
color="text" | ||
data-test-subj="layerTocActionsPanelToggleButtonlayer1" | ||
flush="left" | ||
iconSide="left" | ||
onClick={[Function]} | ||
size="xs" | ||
type="button" | ||
> | ||
<div> | ||
icon mock | ||
</div> | ||
</EuiButtonEmpty> | ||
} | ||
closePopover={[Function]} | ||
hasArrow={true} | ||
id="contextMenu" | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
withTitle={true} | ||
> | ||
<EuiContextMenu | ||
data-test-subj="layerTocActionsPanellayer1" | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"data-test-subj": "fitToBoundsButton", | ||
"disabled": true, | ||
"icon": <EuiIcon | ||
size="m" | ||
type="search" | ||
/>, | ||
"name": "Fit to data", | ||
"onClick": [Function], | ||
"toolTipContent": "Layer does not support fit to data", | ||
}, | ||
Object { | ||
"data-test-subj": "layerVisibilityToggleButton", | ||
"icon": <EuiIcon | ||
size="m" | ||
type="eye" | ||
/>, | ||
"name": "Hide layer", | ||
"onClick": [Function], | ||
}, | ||
], | ||
"title": "Layer actions", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; | ||
|
||
exports[`LayerTocActions should display spinner when layer is loading 1`] = ` | ||
<EuiPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<EuiButtonEmpty | ||
color="text" | ||
data-test-subj="layerTocActionsPanelToggleButtonlayer1" | ||
flush="left" | ||
iconSide="left" | ||
onClick={[Function]} | ||
size="xs" | ||
type="button" | ||
> | ||
<EuiLoadingSpinner | ||
size="m" | ||
/> | ||
</EuiButtonEmpty> | ||
} | ||
closePopover={[Function]} | ||
hasArrow={true} | ||
id="contextMenu" | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
withTitle={true} | ||
> | ||
<EuiContextMenu | ||
data-test-subj="layerTocActionsPanellayer1" | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"data-test-subj": "fitToBoundsButton", | ||
"disabled": false, | ||
"icon": <EuiIcon | ||
size="m" | ||
type="search" | ||
/>, | ||
"name": "Fit to data", | ||
"onClick": [Function], | ||
"toolTipContent": null, | ||
}, | ||
Object { | ||
"data-test-subj": "layerVisibilityToggleButton", | ||
"icon": <EuiIcon | ||
size="m" | ||
type="eye" | ||
/>, | ||
"name": "Hide layer", | ||
"onClick": [Function], | ||
}, | ||
], | ||
"title": "Layer actions", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; | ||
|
||
exports[`LayerTocActions should provide feedback when layer is not visible because of current zoom level 1`] = ` | ||
<EuiPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<EuiButtonEmpty | ||
color="text" | ||
data-test-subj="layerTocActionsPanelToggleButtonlayer1" | ||
flush="left" | ||
iconSide="left" | ||
onClick={[Function]} | ||
size="xs" | ||
type="button" | ||
> | ||
<EuiToolTip | ||
content="Map is at zoom level 0. | ||
This layer is only visible between zoom levels 2 to 3." | ||
delay="regular" | ||
position="top" | ||
> | ||
<div> | ||
icon mock | ||
</div> | ||
</EuiToolTip> | ||
</EuiButtonEmpty> | ||
} | ||
closePopover={[Function]} | ||
hasArrow={true} | ||
id="contextMenu" | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
withTitle={true} | ||
> | ||
<EuiContextMenu | ||
data-test-subj="layerTocActionsPanellayer1" | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"data-test-subj": "fitToBoundsButton", | ||
"disabled": false, | ||
"icon": <EuiIcon | ||
size="m" | ||
type="search" | ||
/>, | ||
"name": "Fit to data", | ||
"onClick": [Function], | ||
"toolTipContent": null, | ||
}, | ||
Object { | ||
"data-test-subj": "layerVisibilityToggleButton", | ||
"icon": <EuiIcon | ||
size="m" | ||
type="eye" | ||
/>, | ||
"name": "Hide layer", | ||
"onClick": [Function], | ||
}, | ||
], | ||
"title": "Layer actions", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; | ||
|
||
exports[`LayerTocActions should show visible toggle when layer is not visible 1`] = ` | ||
<EuiPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<EuiButtonEmpty | ||
color="text" | ||
data-test-subj="layerTocActionsPanelToggleButtonlayer1" | ||
flush="left" | ||
iconSide="left" | ||
onClick={[Function]} | ||
size="xs" | ||
type="button" | ||
> | ||
<div> | ||
icon mock | ||
</div> | ||
</EuiButtonEmpty> | ||
} | ||
closePopover={[Function]} | ||
hasArrow={true} | ||
id="contextMenu" | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
withTitle={true} | ||
> | ||
<EuiContextMenu | ||
data-test-subj="layerTocActionsPanellayer1" | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"data-test-subj": "fitToBoundsButton", | ||
"disabled": false, | ||
"icon": <EuiIcon | ||
size="m" | ||
type="search" | ||
/>, | ||
"name": "Fit to data", | ||
"onClick": [Function], | ||
"toolTipContent": null, | ||
}, | ||
Object { | ||
"data-test-subj": "layerVisibilityToggleButton", | ||
"icon": <EuiIcon | ||
size="m" | ||
type="eyeClosed" | ||
/>, | ||
"name": "Show layer", | ||
"onClick": [Function], | ||
}, | ||
], | ||
"title": "Layer actions", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; | ||
|
||
exports[`LayerTocActions should show warning when layer has errors 1`] = ` | ||
<EuiPopover | ||
anchorPosition="leftUp" | ||
button={ | ||
<EuiButtonEmpty | ||
color="text" | ||
data-test-subj="layerTocActionsPanelToggleButtonlayer1" | ||
flush="left" | ||
iconSide="left" | ||
onClick={[Function]} | ||
size="xs" | ||
type="button" | ||
> | ||
<EuiIconTip | ||
aria-label="Load warning" | ||
color="warning" | ||
content="simulated layer error" | ||
size="m" | ||
type="alert" | ||
/> | ||
</EuiButtonEmpty> | ||
} | ||
closePopover={[Function]} | ||
hasArrow={true} | ||
id="contextMenu" | ||
isOpen={false} | ||
ownFocus={false} | ||
panelPaddingSize="none" | ||
withTitle={true} | ||
> | ||
<EuiContextMenu | ||
data-test-subj="layerTocActionsPanellayer1" | ||
initialPanelId={0} | ||
panels={ | ||
Array [ | ||
Object { | ||
"id": 0, | ||
"items": Array [ | ||
Object { | ||
"data-test-subj": "fitToBoundsButton", | ||
"disabled": false, | ||
"icon": <EuiIcon | ||
size="m" | ||
type="search" | ||
/>, | ||
"name": "Fit to data", | ||
"onClick": [Function], | ||
"toolTipContent": null, | ||
}, | ||
Object { | ||
"data-test-subj": "layerVisibilityToggleButton", | ||
"icon": <EuiIcon | ||
size="m" | ||
type="eye" | ||
/>, | ||
"name": "Hide layer", | ||
"onClick": [Function], | ||
}, | ||
], | ||
"title": "Layer actions", | ||
}, | ||
] | ||
} | ||
/> | ||
</EuiPopover> | ||
`; |
Oops, something went wrong.