Skip to content

Commit 9ec42ca

Browse files
committed
improve graph missing workspace error message
1 parent 91330d2 commit 9ec42ca

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

x-pack/legacy/plugins/graph/public/app.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,20 @@ export function initGraphApp(angularModule, deps) {
132132
template: appTemplate,
133133
badge: getReadonlyBadge,
134134
resolve: {
135-
savedWorkspace: function($route) {
135+
savedWorkspace: function($rootScope, $route, $location) {
136136
return $route.current.params.id
137-
? savedWorkspaceLoader.get($route.current.params.id).catch(function() {
138-
toastNotifications.addDanger(
139-
i18n.translate('xpack.graph.missingWorkspaceErrorMessage', {
140-
defaultMessage: 'Missing workspace',
141-
})
142-
);
137+
? savedWorkspaceLoader.get($route.current.params.id).catch(function(e) {
138+
toastNotifications.addError(e, {
139+
title: i18n.translate('xpack.graph.missingWorkspaceErrorMessage', {
140+
defaultMessage: "Couldn't load graph with ID",
141+
}),
142+
});
143+
$rootScope.$eval(() => {
144+
$location.path('/home');
145+
$location.replace();
146+
});
147+
// return promise that never returns to prevent the controller from loading
148+
return new Promise();
143149
})
144150
: savedWorkspaceLoader.get();
145151
},

x-pack/plugins/translations/translations/ja-JP.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5734,7 +5734,6 @@
57345734
"xpack.graph.listing.table.entityNamePlural": "グラフ",
57355735
"xpack.graph.listing.table.titleColumnName": "タイトル",
57365736
"xpack.graph.loadWorkspace.missingIndexPatternErrorMessage": "インデックスパターンが見つかりませんでした",
5737-
"xpack.graph.missingWorkspaceErrorMessage": "ワークスペースがありません",
57385737
"xpack.graph.newGraphTitle": "保存されていないグラフ",
57395738
"xpack.graph.noDataSourceNotificationMessageText": "データソースが見つかりませんでした。{managementIndexPatternsLink} に移動して Elasticsearch インデックスのインデックスパターンを作成してください。",
57405739
"xpack.graph.noDataSourceNotificationMessageText.managementIndexPatternLinkText": "管理>インデックスパターン",

x-pack/plugins/translations/translations/zh-CN.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5734,7 +5734,6 @@
57345734
"xpack.graph.listing.table.entityNamePlural": "图表",
57355735
"xpack.graph.listing.table.titleColumnName": "标题",
57365736
"xpack.graph.loadWorkspace.missingIndexPatternErrorMessage": "未找到索引模式",
5737-
"xpack.graph.missingWorkspaceErrorMessage": "缺少工作空间",
57385737
"xpack.graph.newGraphTitle": "未保存图表",
57395738
"xpack.graph.noDataSourceNotificationMessageText": "未找到数据源。前往 {managementIndexPatternsLink},为您的 Elasticsearch 索引创建索引模式。",
57405739
"xpack.graph.noDataSourceNotificationMessageText.managementIndexPatternLinkText": "管理 > 索引模式",

0 commit comments

Comments
 (0)