Skip to content

Commit

Permalink
improve graph missing workspace error message (elastic#58876)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Mar 2, 2020
1 parent d007b0a commit 28522b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
20 changes: 13 additions & 7 deletions x-pack/legacy/plugins/graph/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,20 @@ export function initGraphApp(angularModule, deps) {
template: appTemplate,
badge: getReadonlyBadge,
resolve: {
savedWorkspace: function($route) {
savedWorkspace: function($rootScope, $route, $location) {
return $route.current.params.id
? savedWorkspaceLoader.get($route.current.params.id).catch(function() {
toastNotifications.addDanger(
i18n.translate('xpack.graph.missingWorkspaceErrorMessage', {
defaultMessage: 'Missing workspace',
})
);
? savedWorkspaceLoader.get($route.current.params.id).catch(function(e) {
toastNotifications.addError(e, {
title: i18n.translate('xpack.graph.missingWorkspaceErrorMessage', {
defaultMessage: "Couldn't load graph with ID",
}),
});
$rootScope.$eval(() => {
$location.path('/home');
$location.replace();
});
// return promise that never returns to prevent the controller from loading
return new Promise();
})
: savedWorkspaceLoader.get();
},
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -5734,7 +5734,6 @@
"xpack.graph.listing.table.entityNamePlural": "グラフ",
"xpack.graph.listing.table.titleColumnName": "タイトル",
"xpack.graph.loadWorkspace.missingIndexPatternErrorMessage": "インデックスパターンが見つかりませんでした",
"xpack.graph.missingWorkspaceErrorMessage": "ワークスペースがありません",
"xpack.graph.newGraphTitle": "保存されていないグラフ",
"xpack.graph.noDataSourceNotificationMessageText": "データソースが見つかりませんでした。{managementIndexPatternsLink} に移動して Elasticsearch インデックスのインデックスパターンを作成してください。",
"xpack.graph.noDataSourceNotificationMessageText.managementIndexPatternLinkText": "管理>インデックスパターン",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5734,7 +5734,6 @@
"xpack.graph.listing.table.entityNamePlural": "图表",
"xpack.graph.listing.table.titleColumnName": "标题",
"xpack.graph.loadWorkspace.missingIndexPatternErrorMessage": "未找到索引模式",
"xpack.graph.missingWorkspaceErrorMessage": "缺少工作空间",
"xpack.graph.newGraphTitle": "未保存图表",
"xpack.graph.noDataSourceNotificationMessageText": "未找到数据源。前往 {managementIndexPatternsLink},为您的 Elasticsearch 索引创建索引模式。",
"xpack.graph.noDataSourceNotificationMessageText.managementIndexPatternLinkText": "管理 > 索引模式",
Expand Down

0 comments on commit 28522b4

Please sign in to comment.