Skip to content

Commit

Permalink
Migrate Index Management to new solutions nav (#101548)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
cjcenizal committed Jun 23, 2021
1 parent e53da4e commit 5df858a
Show file tree
Hide file tree
Showing 34 changed files with 660 additions and 563 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Error } from '../types';

interface Props {
title: React.ReactNode;
error: Error;
error?: Error;
actions?: JSX.Element;
isCentered?: boolean;
}
Expand All @@ -32,30 +32,30 @@ export const PageError: React.FunctionComponent<Props> = ({
isCentered,
...rest
}) => {
const {
error: errorString,
cause, // wrapEsError() on the server adds a "cause" array
message,
} = error;
const errorString = error?.error;
const cause = error?.cause; // wrapEsError() on the server adds a "cause" array
const message = error?.message;

const errorContent = (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
<EuiEmptyPrompt
title={<h2>{title}</h2>}
body={
<>
{cause ? message || errorString : <p>{message || errorString}</p>}
{cause && (
<>
<EuiSpacer size="s" />
<ul>
{cause.map((causeMsg, i) => (
<li key={i}>{causeMsg}</li>
))}
</ul>
</>
)}
</>
error && (
<>
{cause ? message || errorString : <p>{message || errorString}</p>}
{cause && (
<>
<EuiSpacer size="s" />
<ul>
{cause.map((causeMsg, i) => (
<li key={i}>{causeMsg}</li>
))}
</ul>
</>
)}
</>
)
}
iconType="alert"
actions={actions}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { PageLoading } from './page_loading';
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';
import { EuiEmptyPrompt, EuiLoadingSpinner, EuiText, EuiPageContent } from '@elastic/eui';

export const PageLoading: React.FunctionComponent = ({ children }) => {
return (
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
<EuiEmptyPrompt
title={<EuiLoadingSpinner size="xl" />}
body={<EuiText color="subdued">{children}</EuiText>}
data-test-subj="sectionLoading"
/>
</EuiPageContent>
);
};
1 change: 1 addition & 0 deletions src/plugins/es_ui_shared/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as XJson from './xjson';

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

export { PageLoading } from './components/page_loading';
export { SectionLoading } from './components/section_loading';

export { Frequency, CronEditor } from './components/cron_editor';
Expand Down
Loading

0 comments on commit 5df858a

Please sign in to comment.