Skip to content

Commit d2bec76

Browse files
committed
Migrate Index Management to new solutions nav (#101548)
* Migrate index template and component template wizard pages to new nav. * Convert index templates and component templates pages to new nav. * Convert indices and data streams pages to new nav. * Add PageLoading component to es_ui_shared. * Refactor index table component tests. * Add missing error reporting to get all templates API route handler. # Conflicts: # x-pack/plugins/index_management/server/routes/api/templates/register_get_routes.ts
1 parent d3ed179 commit d2bec76

34 files changed

Lines changed: 663 additions & 566 deletions

File tree

src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/page_error.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Error } from '../types';
1313

1414
interface Props {
1515
title: React.ReactNode;
16-
error: Error;
16+
error?: Error;
1717
actions?: JSX.Element;
1818
isCentered?: boolean;
1919
}
@@ -32,30 +32,30 @@ export const PageError: React.FunctionComponent<Props> = ({
3232
isCentered,
3333
...rest
3434
}) => {
35-
const {
36-
error: errorString,
37-
cause, // wrapEsError() on the server adds a "cause" array
38-
message,
39-
} = error;
35+
const errorString = error?.error;
36+
const cause = error?.cause; // wrapEsError() on the server adds a "cause" array
37+
const message = error?.message;
4038

4139
const errorContent = (
4240
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
4341
<EuiEmptyPrompt
4442
title={<h2>{title}</h2>}
4543
body={
46-
<>
47-
{cause ? message || errorString : <p>{message || errorString}</p>}
48-
{cause && (
49-
<>
50-
<EuiSpacer size="s" />
51-
<ul>
52-
{cause.map((causeMsg, i) => (
53-
<li key={i}>{causeMsg}</li>
54-
))}
55-
</ul>
56-
</>
57-
)}
58-
</>
44+
error && (
45+
<>
46+
{cause ? message || errorString : <p>{message || errorString}</p>}
47+
{cause && (
48+
<>
49+
<EuiSpacer size="s" />
50+
<ul>
51+
{cause.map((causeMsg, i) => (
52+
<li key={i}>{causeMsg}</li>
53+
))}
54+
</ul>
55+
</>
56+
)}
57+
</>
58+
)
5959
}
6060
iconType="alert"
6161
actions={actions}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
export { PageLoading } from './page_loading';
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
import React from 'react';
10+
import { EuiEmptyPrompt, EuiLoadingSpinner, EuiText, EuiPageContent } from '@elastic/eui';
11+
12+
export const PageLoading: React.FunctionComponent = ({ children }) => {
13+
return (
14+
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
15+
<EuiEmptyPrompt
16+
title={<EuiLoadingSpinner size="xl" />}
17+
body={<EuiText color="subdued">{children}</EuiText>}
18+
data-test-subj="sectionLoading"
19+
/>
20+
</EuiPageContent>
21+
);
22+
};

src/plugins/es_ui_shared/public/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import * as XJson from './xjson';
1717

1818
export { JsonEditor, OnJsonEditorUpdateHandler, JsonEditorState } from './components/json_editor';
1919

20+
export { PageLoading } from './components/page_loading';
2021
export { SectionLoading } from './components/section_loading';
2122

2223
export { Frequency, CronEditor } from './components/cron_editor';

0 commit comments

Comments
 (0)