forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Snapshot + Restore] Migrate to new page layout structure (elastic#10…
- Loading branch information
1 parent
51cf185
commit 95541e6
Showing
21 changed files
with
464 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/page_error.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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 { EuiSpacer, EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; | ||
import React from 'react'; | ||
import { APP_WRAPPER_CLASS } from '../../../../../../src/core/public'; | ||
import { Error } from '../types'; | ||
|
||
interface Props { | ||
title: React.ReactNode; | ||
error: Error; | ||
actions?: JSX.Element; | ||
isCentered?: boolean; | ||
} | ||
|
||
/* | ||
* A reusable component to handle full page errors. | ||
* This is based on Kibana design guidelines related | ||
* to the new management navigation structure. | ||
* In some scenarios, it replaces the usage of <SectionError />. | ||
*/ | ||
|
||
export const PageError: React.FunctionComponent<Props> = ({ | ||
title, | ||
error, | ||
actions, | ||
isCentered, | ||
...rest | ||
}) => { | ||
const { | ||
error: errorString, | ||
cause, // wrapEsError() on the server adds a "cause" array | ||
message, | ||
} = error; | ||
|
||
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> | ||
</> | ||
)} | ||
</> | ||
} | ||
iconType="alert" | ||
actions={actions} | ||
{...rest} | ||
/> | ||
</EuiPageContent> | ||
); | ||
|
||
if (isCentered) { | ||
return <div className={APP_WRAPPER_CLASS}>{errorContent}</div>; | ||
} | ||
|
||
return errorContent; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
x-pack/plugins/snapshot_restore/public/application/components/loading.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { | ||
EuiEmptyPrompt, | ||
EuiLoadingSpinner, | ||
EuiText, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiTextColor, | ||
EuiPageContent, | ||
} from '@elastic/eui'; | ||
|
||
interface Props { | ||
inline?: boolean; | ||
children: React.ReactNode; | ||
[key: string]: any; | ||
} | ||
|
||
export const InlineLoading: React.FunctionComponent<Props> = ({ children, ...rest }) => { | ||
return ( | ||
<EuiFlexGroup justifyContent="flexStart" alignItems="center" gutterSize="s"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner size="m" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiText {...rest}> | ||
<EuiTextColor color="subdued">{children}</EuiTextColor> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
}; | ||
|
||
export const SectionLoading: React.FunctionComponent<Props> = ({ children }) => { | ||
return ( | ||
<EuiEmptyPrompt | ||
title={<EuiLoadingSpinner size="xl" />} | ||
body={<EuiText color="subdued">{children}</EuiText>} | ||
data-test-subj="sectionLoading" | ||
/> | ||
); | ||
}; | ||
|
||
/* | ||
* Loading component used for full page loads. | ||
* For tabbed sections, or within the context of a wizard, | ||
* the <SectionLoading/> component may be more appropriate | ||
*/ | ||
export const PageLoading: React.FunctionComponent<Props> = ({ 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> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
x-pack/plugins/snapshot_restore/public/application/components/section_loading.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.