-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom empty prompt for solution navs
- Loading branch information
Showing
6 changed files
with
186 additions
and
42 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/plugins/management/public/components/landing/classic_empty_prompt.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,51 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
import React, { type FC } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { EuiHorizontalRule } from '@elastic/eui'; | ||
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; | ||
|
||
interface Props { | ||
kibanaVersion: string; | ||
} | ||
|
||
export const ClassicEmptyPrompt: FC<Props> = ({ kibanaVersion }) => { | ||
return ( | ||
<KibanaPageTemplate.EmptyPrompt | ||
data-test-subj="managementHome" | ||
iconType="managementApp" | ||
title={ | ||
<h1> | ||
<FormattedMessage | ||
id="management.landing.header" | ||
defaultMessage="Welcome to Stack Management {version}" | ||
values={{ version: kibanaVersion }} | ||
/> | ||
</h1> | ||
} | ||
body={ | ||
<> | ||
<p> | ||
<FormattedMessage | ||
id="management.landing.subhead" | ||
defaultMessage="Manage your indices, data views, saved objects, Kibana settings, and more." | ||
/> | ||
</p> | ||
<EuiHorizontalRule /> | ||
<p> | ||
<FormattedMessage | ||
id="management.landing.text" | ||
defaultMessage="A complete list of apps is in the menu on the left." | ||
/> | ||
</p> | ||
</> | ||
} | ||
/> | ||
); | ||
}; |
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
100 changes: 100 additions & 0 deletions
100
src/plugins/management/public/components/landing/solution_empty_prompt.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,100 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
import React, { type FC } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { EuiButton, EuiHorizontalRule, EuiLink } from '@elastic/eui'; | ||
import { type CoreStart } from '@kbn/core/public'; | ||
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; | ||
|
||
interface Props { | ||
kibanaVersion: string; | ||
coreStart: CoreStart; | ||
} | ||
|
||
const IndicesLink: FC<{ coreStart: CoreStart }> = ({ coreStart }) => ( | ||
<EuiLink href={coreStart.application.getUrlForApp('management/data/index_management')}> | ||
{i18n.translate('management.landing.subhead.indicesLink', { | ||
defaultMessage: 'indices', | ||
})} | ||
</EuiLink> | ||
); | ||
|
||
const DataViewsLink: FC<{ coreStart: CoreStart }> = ({ coreStart }) => ( | ||
<EuiLink href={coreStart.application.getUrlForApp('management/kibana/dataViews')}> | ||
{i18n.translate('management.landing.subhead.dataViewsLink', { | ||
defaultMessage: 'data views', | ||
})} | ||
</EuiLink> | ||
); | ||
|
||
const IngestPipelinesLink: FC<{ coreStart: CoreStart }> = ({ coreStart }) => ( | ||
<EuiLink href={coreStart.application.getUrlForApp('management/ingest/ingest_pipelines')}> | ||
{i18n.translate('management.landing.subhead.ingestPipelinesLink', { | ||
defaultMessage: 'ingest pipelines', | ||
})} | ||
</EuiLink> | ||
); | ||
|
||
const UsersLink: FC<{ coreStart: CoreStart }> = ({ coreStart }) => ( | ||
<EuiLink href={coreStart.application.getUrlForApp('management/security/users')}> | ||
{i18n.translate('management.landing.subhead.usersLink', { | ||
defaultMessage: 'users', | ||
})} | ||
</EuiLink> | ||
); | ||
|
||
export const SolutionEmptyPrompt: FC<Props> = ({ kibanaVersion, coreStart }) => { | ||
return ( | ||
<KibanaPageTemplate.EmptyPrompt | ||
data-test-subj="managementHome" | ||
iconType="managementApp" | ||
title={ | ||
<h1> | ||
<FormattedMessage | ||
id="management.landing.header" | ||
defaultMessage="Stack Management {version}" | ||
values={{ version: kibanaVersion }} | ||
/> | ||
</h1> | ||
} | ||
body={ | ||
<> | ||
<p> | ||
<FormattedMessage | ||
id="management.landing.subhead" | ||
defaultMessage="Manage your {indicesLink}, {dataViewsLink}, {ingestPipelinesLink}, {usersLink}, and more." | ||
values={{ | ||
indicesLink: <IndicesLink coreStart={coreStart} />, | ||
dataViewsLink: <DataViewsLink coreStart={coreStart} />, | ||
ingestPipelinesLink: <IngestPipelinesLink coreStart={coreStart} />, | ||
usersLink: <UsersLink coreStart={coreStart} />, | ||
}} | ||
/> | ||
</p> | ||
|
||
<p> | ||
<EuiButton | ||
fill | ||
iconType="spaces" | ||
onClick={() => { | ||
console.log('open panel!'); | ||
}} | ||
> | ||
<FormattedMessage | ||
id="management.landing.viewAllPagesButton" | ||
defaultMessage="View all pages" | ||
/> | ||
</EuiButton> | ||
</p> | ||
</> | ||
} | ||
/> | ||
); | ||
}; |
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