-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cross-links back and forth between the Indices and Data Streams t…
…abs. - Refactor routing service to expose decodePathFromReactRouter and encodePathForReactRouter methods to clarify their purpose. - Add stub data stream detail panel, with the intention to populate it with content in the future. - Converted index_list to TS.
- Loading branch information
Showing
18 changed files
with
243 additions
and
31 deletions.
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
...tion/sections/home/data_stream_list/data_stream_detail_panel/data_stream_detail_panel.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,99 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { Fragment } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { | ||
EuiFlyout, | ||
EuiFlyoutHeader, | ||
EuiTitle, | ||
EuiFlyoutBody, | ||
EuiFlyoutFooter, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiButtonEmpty, | ||
} from '@elastic/eui'; | ||
|
||
import { SectionLoading, SectionError, Error } from '../../../../components'; | ||
import { useLoadDataStream } from '../../../../services/api'; | ||
|
||
interface Props { | ||
dataStreamName: string; | ||
onClose: () => void; | ||
} | ||
|
||
export const DataStreamDetailPanel: React.FunctionComponent<Props> = ({ | ||
dataStreamName, | ||
onClose, | ||
}) => { | ||
const { error, data: dataStream, isLoading } = useLoadDataStream(dataStreamName); | ||
|
||
let content; | ||
|
||
if (isLoading) { | ||
content = ( | ||
<SectionLoading> | ||
<FormattedMessage | ||
id="xpack.idxMgmt.dataStreamDetailPanel.loadingDataStreamDescription" | ||
defaultMessage="Loading data stream" | ||
/> | ||
</SectionLoading> | ||
); | ||
} else if (error) { | ||
content = ( | ||
<SectionError | ||
title={ | ||
<FormattedMessage | ||
id="xpack.idxMgmt.dataStreamDetailPanel.loadingDataStreamErrorMessage" | ||
defaultMessage="Error loading data stream" | ||
/> | ||
} | ||
error={error as Error} | ||
data-test-subj="sectionError" | ||
/> | ||
); | ||
} else if (dataStream) { | ||
content = <Fragment>{JSON.stringify(dataStream)}</Fragment>; | ||
} | ||
|
||
return ( | ||
<EuiFlyout | ||
onClose={onClose} | ||
data-test-subj="dataStreamDetailPanel" | ||
aria-labelledby="dataStreamDetailPanelTitle" | ||
size="m" | ||
maxWidth={500} | ||
> | ||
<EuiFlyoutHeader> | ||
<EuiTitle size="m"> | ||
<h2 id="dataStreamDetailPanelTitle" data-test-subj="title"> | ||
{dataStreamName} | ||
</h2> | ||
</EuiTitle> | ||
</EuiFlyoutHeader> | ||
|
||
<EuiFlyoutBody data-test-subj="content">{content}</EuiFlyoutBody> | ||
|
||
<EuiFlyoutFooter> | ||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty | ||
iconType="cross" | ||
flush="left" | ||
onClick={onClose} | ||
data-test-subj="closeDetailsButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.idxMgmt.dataStreamDetailPanel.closeButtonLabel" | ||
defaultMessage="Close" | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlyoutFooter> | ||
</EuiFlyout> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
...ement/public/application/sections/home/data_stream_list/data_stream_detail_panel/index.ts
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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { DataStreamDetailPanel } from './data_stream_detail_panel'; |
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
7 changes: 7 additions & 0 deletions
7
...ment/public/application/sections/home/index_list/detail_panel/detail_panel.container.d.ts
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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export declare function DetailPanel(props: any): any; |
File renamed without changes.
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
File renamed without changes.
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
Oops, something went wrong.