Skip to content

Commit

Permalink
[Maps] disable fit to data for geo_shape fields until elasticsearch s…
Browse files Browse the repository at this point in the history
…upports a way to get the bounds (elastic#31638) (elastic#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
nreese authored Feb 21, 2019
1 parent a7f76cc commit 3754dbb
Show file tree
Hide file tree
Showing 9 changed files with 623 additions and 19 deletions.
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>
`;
Loading

0 comments on commit 3754dbb

Please sign in to comment.