mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Show warning instead of fatal error when map-proxy is not available
This used to show a fatal error, which was too intrusive and not necessary. This would also prevented users to navigate to another visualization on refresh since Kibana would auto-rereoute to the last shown visualization on refresh (which was the crashed tilemap).
This commit is contained in:
parent
d1a42a487f
commit
c0bec83a6d
2 changed files with 11 additions and 4 deletions
|
@ -161,7 +161,6 @@ uiModules.get('kibana')
|
|||
url: requestUrl,
|
||||
method: 'GET'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,8 +13,9 @@ export default function MapFactory(Private, tilemapSettings, Notifier) {
|
|||
const defaultMarkerType = 'Scaled Circle Markers';
|
||||
|
||||
const notify = new Notifier({
|
||||
location: 'Vis'
|
||||
location: 'Tilemap'
|
||||
});
|
||||
const previousErrors = [];
|
||||
|
||||
const markerTypes = {
|
||||
'Scaled Circle Markers': Private(VislibVisualizationsMarkerTypesScaledCirclesProvider),
|
||||
|
@ -60,10 +61,17 @@ export default function MapFactory(Private, tilemapSettings, Notifier) {
|
|||
fadeAnimation: false,
|
||||
};
|
||||
|
||||
let url;
|
||||
if (tilemapSettings.hasError()) {
|
||||
notify.fatal(tilemapSettings.getError());
|
||||
if (!previousErrors.includes(tilemapSettings.getError())) {
|
||||
notify.warning(tilemapSettings.getError().message);
|
||||
previousErrors.push(tilemapSettings.getError());
|
||||
}
|
||||
url = '';
|
||||
} else {
|
||||
url = tilemapSettings.getUrl();
|
||||
}
|
||||
this._createMap(options, tilemapSettings.getUrl());
|
||||
this._createMap(options, url);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue