Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve graph missing workspace error message #58876

Merged
merged 2 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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