-
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.
[ILM] Added index templates flyout to the policies list
- Loading branch information
Showing
19 changed files
with
237 additions
and
145 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
x-pack/plugins/index_lifecycle_management/__jest__/__snapshots__/policy_table.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
82 changes: 82 additions & 0 deletions
82
...ugins/index_lifecycle_management/public/application/components/index_templates_flyout.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,82 @@ | ||
/* | ||
* 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, { FunctionComponent } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { | ||
EuiButtonEmpty, | ||
EuiFlyout, | ||
EuiFlyoutBody, | ||
EuiFlyoutFooter, | ||
EuiFlyoutHeader, | ||
EuiInMemoryTable, | ||
EuiLink, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { PolicyFromES } from '../../../common/types'; | ||
import { useKibana } from '../../shared_imports'; | ||
import { getTemplateDetailsLink } from '../../../../index_management/public/'; | ||
|
||
interface Props { | ||
policy: PolicyFromES; | ||
close: () => void; | ||
} | ||
export const IndexTemplatesFlyout: FunctionComponent<Props> = ({ policy, close }) => { | ||
const { | ||
services: { getUrlForApp }, | ||
} = useKibana(); | ||
const getUrlForIndexTemplate = (name: string) => { | ||
return getUrlForApp('management', { | ||
path: `data/index_management${getTemplateDetailsLink(name)}`, | ||
}); | ||
}; | ||
return ( | ||
<EuiFlyout onClose={close}> | ||
<EuiFlyoutHeader hasBorder> | ||
<EuiTitle size="m"> | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.policyTable.indexTemplatesFlyout.headerText" | ||
defaultMessage="Index templates linked to policy {policyName}" | ||
values={{ policyName: policy.name }} | ||
/> | ||
</h2> | ||
</EuiTitle> | ||
</EuiFlyoutHeader> | ||
<EuiFlyoutBody> | ||
<EuiInMemoryTable | ||
pagination={true} | ||
items={policy.indexTemplates ?? []} | ||
columns={[ | ||
{ | ||
name: i18n.translate( | ||
'xpack.indexLifecycleMgmt.policyTable.indexTemplatesTable.nameHeader', | ||
{ defaultMessage: 'Index template name' } | ||
), | ||
render: (value: string) => { | ||
return ( | ||
<EuiLink className="eui-textBreakAll" href={getUrlForIndexTemplate(value)}> | ||
{value} | ||
</EuiLink> | ||
); | ||
}, | ||
}, | ||
]} | ||
/> | ||
</EuiFlyoutBody> | ||
<EuiFlyoutFooter> | ||
<EuiButtonEmpty iconType="cross" onClick={close} flush="left"> | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.indexTemplatesFlyout.closeButtonLabel" | ||
defaultMessage="Close" | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlyoutFooter> | ||
</EuiFlyout> | ||
); | ||
}; |
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
Oops, something went wrong.