Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
This commit is contained in:
parent
69afa5ee45
commit
4b20ae765c
|
@ -403,7 +403,7 @@ security and spaces filtering as well as performing audit logging.
|
|||
|
||||
|
||||
|{kib-repo}blob/{branch}/x-pack/plugins/enterprise_search/README.md[enterpriseSearch]
|
||||
|This plugin provides beta Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search.
|
||||
|This plugin provides Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search.
|
||||
|
||||
|
||||
|{kib-repo}blob/{branch}/x-pack/plugins/event_log/README.md[eventLog]
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
## Overview
|
||||
|
||||
This plugin provides beta Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search.
|
||||
|
||||
> :warning: The Kibana interface for Enterprise Search is a beta feature. It is subject to change and is not covered by the same level of support as generally available features. This interface will become the sole management panel for Enterprise Search with the 8.0 release. Until then, the standalone Enterprise Search UI remains available and supported.
|
||||
This plugin provides Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search.
|
||||
|
||||
### App Search
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import { EuiEmptyPrompt, EuiCode } from '@elastic/eui';
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { KibanaLogic } from '../kibana';
|
||||
import { BetaNotification } from '../layout/beta';
|
||||
import { EuiButtonTo } from '../react_router_helpers';
|
||||
|
||||
import './error_state_prompt.scss';
|
||||
|
@ -100,7 +99,6 @@ export const ErrorStatePrompt: React.FC = () => {
|
|||
defaultMessage="Review setup guide"
|
||||
/>
|
||||
</EuiButtonTo>,
|
||||
<BetaNotification buttonProps={{ size: 'm', flush: undefined }} />,
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@include euiBreakpoint('m', 'l', 'xl') {
|
||||
.betaSidebarNotification {
|
||||
.euiSideNav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.euiSideNav__content {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.betaNotification {
|
||||
width: 350px;
|
||||
}
|
|
@ -1,129 +0,0 @@
|
|||
/*
|
||||
* 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 '../../__mocks__/enterprise_search_url.mock';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { shallow, ShallowWrapper } from 'enzyme';
|
||||
|
||||
import { EuiPopover, EuiPopoverTitle, EuiLink } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { shallowWithIntl } from '../../test_helpers';
|
||||
|
||||
import { BetaNotification, appendBetaNotificationItem } from './beta';
|
||||
|
||||
describe('BetaNotification', () => {
|
||||
const getToggleButton = (wrapper: ShallowWrapper) => {
|
||||
return shallow(<div>{wrapper.prop('button')}</div>).childAt(0);
|
||||
};
|
||||
|
||||
it('renders', () => {
|
||||
const wrapper = shallow(<BetaNotification />);
|
||||
|
||||
expect(wrapper.type()).toEqual(EuiPopover);
|
||||
expect(wrapper.find(EuiPopoverTitle).prop('children')).toEqual(
|
||||
'Enterprise Search in Kibana is a beta user interface'
|
||||
);
|
||||
});
|
||||
|
||||
describe('open/close popover state', () => {
|
||||
const wrapper = shallow(<BetaNotification />);
|
||||
|
||||
it('is initially closed', () => {
|
||||
expect(wrapper.find(EuiPopover).prop('isOpen')).toBe(false);
|
||||
});
|
||||
|
||||
it('opens the popover when the toggle button is pressed', () => {
|
||||
getToggleButton(wrapper).simulate('click');
|
||||
|
||||
expect(wrapper.find(EuiPopover).prop('isOpen')).toBe(true);
|
||||
});
|
||||
|
||||
it('closes the popover', () => {
|
||||
wrapper.prop('closePopover')();
|
||||
|
||||
expect(wrapper.find(EuiPopover).prop('isOpen')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toggle button props', () => {
|
||||
it('defaults to a size of xs and flush', () => {
|
||||
const wrapper = shallow(<BetaNotification />);
|
||||
const toggleButton = getToggleButton(wrapper);
|
||||
|
||||
expect(toggleButton.prop('size')).toEqual('xs');
|
||||
expect(toggleButton.prop('flush')).toEqual('both');
|
||||
});
|
||||
|
||||
it('passes down custom button props', () => {
|
||||
const wrapper = shallow(<BetaNotification buttonProps={{ size: 'm' }} />);
|
||||
const toggleButton = getToggleButton(wrapper);
|
||||
|
||||
expect(toggleButton.prop('size')).toEqual('m');
|
||||
});
|
||||
});
|
||||
|
||||
describe('links', () => {
|
||||
const wrapper = shallowWithIntl(<BetaNotification />);
|
||||
const links = wrapper.find(FormattedMessage).dive();
|
||||
|
||||
it('renders a documentation link', () => {
|
||||
const docLink = links.find(EuiLink).first();
|
||||
|
||||
expect(docLink.prop('href')).toContain('/user-interfaces.html');
|
||||
});
|
||||
|
||||
it('renders a link back to the standalone UI', () => {
|
||||
const switchLink = links.find(EuiLink).last();
|
||||
|
||||
expect(switchLink.prop('href')).toBe('http://localhost:3002');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('appendBetaNotificationItem', () => {
|
||||
const mockSideNav = {
|
||||
name: 'Hello world',
|
||||
items: [
|
||||
{ id: '1', name: 'Link 1' },
|
||||
{ id: '2', name: 'Link 2' },
|
||||
],
|
||||
};
|
||||
|
||||
it('inserts a beta notification into a side nav items array', () => {
|
||||
appendBetaNotificationItem(mockSideNav);
|
||||
|
||||
expect(mockSideNav).toEqual({
|
||||
name: 'Hello world',
|
||||
items: [
|
||||
{ id: '1', name: 'Link 1' },
|
||||
{ id: '2', name: 'Link 2' },
|
||||
{
|
||||
id: 'beta',
|
||||
name: '',
|
||||
renderItem: expect.any(Function),
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it('renders the BetaNotification component as a side nav item', () => {
|
||||
const SideNavItem = (mockSideNav.items[2] as any).renderItem;
|
||||
const wrapper = shallow(<SideNavItem />);
|
||||
|
||||
expect(wrapper.find(BetaNotification)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('does nothing if no side nav was passed', () => {
|
||||
const mockEmptySideNav = undefined;
|
||||
appendBetaNotificationItem(mockEmptySideNav);
|
||||
|
||||
expect(mockEmptySideNav).toEqual(undefined);
|
||||
});
|
||||
});
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* 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, { useState } from 'react';
|
||||
|
||||
import {
|
||||
EuiPopover,
|
||||
EuiPopoverTitle,
|
||||
EuiPopoverFooter,
|
||||
EuiButtonEmpty,
|
||||
EuiButtonEmptyProps,
|
||||
EuiText,
|
||||
EuiLink,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { KibanaPageTemplateProps } from '../../../../../../../src/plugins/kibana_react/public';
|
||||
|
||||
import { docLinks } from '../doc_links';
|
||||
import { getEnterpriseSearchUrl } from '../enterprise_search_url';
|
||||
|
||||
import './beta.scss';
|
||||
|
||||
interface Props {
|
||||
buttonProps?: EuiButtonEmptyProps;
|
||||
}
|
||||
|
||||
export const BetaNotification: React.FC<Props> = ({ buttonProps }) => {
|
||||
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
||||
const togglePopover = () => setIsPopoverOpen((isOpen) => !isOpen);
|
||||
const closePopover = () => setIsPopoverOpen(false);
|
||||
|
||||
return (
|
||||
<EuiPopover
|
||||
button={
|
||||
<EuiButtonEmpty
|
||||
size="xs"
|
||||
flush="both"
|
||||
iconType="alert"
|
||||
{...buttonProps}
|
||||
onClick={togglePopover}
|
||||
>
|
||||
{i18n.translate('xpack.enterpriseSearch.beta.buttonLabel', {
|
||||
defaultMessage: 'This is a beta user interface',
|
||||
})}
|
||||
</EuiButtonEmpty>
|
||||
}
|
||||
isOpen={isPopoverOpen}
|
||||
closePopover={closePopover}
|
||||
anchorPosition="rightDown"
|
||||
repositionOnScroll
|
||||
>
|
||||
<EuiPopoverTitle>
|
||||
{i18n.translate('xpack.enterpriseSearch.beta.popover.title', {
|
||||
defaultMessage: 'Enterprise Search in Kibana is a beta user interface',
|
||||
})}
|
||||
</EuiPopoverTitle>
|
||||
<div className="betaNotification">
|
||||
<EuiText size="s">
|
||||
<p>
|
||||
{i18n.translate('xpack.enterpriseSearch.beta.popover.description', {
|
||||
defaultMessage:
|
||||
'The Kibana interface for Enterprise Search is a beta feature. It is subject to change and is not covered by the same level of support as generally available features. This interface will become the sole management panel for Enterprise Search with the 8.0 release. Until then, the standalone Enterprise Search UI remains available and supported.',
|
||||
})}
|
||||
</p>
|
||||
</EuiText>
|
||||
</div>
|
||||
<EuiPopoverFooter>
|
||||
<FormattedMessage
|
||||
id="xpack.enterpriseSearch.beta.popover.footerDetail"
|
||||
defaultMessage="{learnMoreLink} or {standaloneUILink}."
|
||||
values={{
|
||||
learnMoreLink: (
|
||||
<EuiLink
|
||||
href={`${docLinks.enterpriseSearchBase}/user-interfaces.html`}
|
||||
target="_blank"
|
||||
>
|
||||
Learn more
|
||||
</EuiLink>
|
||||
),
|
||||
standaloneUILink: (
|
||||
<EuiLink href={getEnterpriseSearchUrl()}>switch to the Enterprise Search UI</EuiLink>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</EuiPopoverFooter>
|
||||
</EuiPopover>
|
||||
);
|
||||
};
|
||||
|
||||
export const appendBetaNotificationItem = (sideNav: KibanaPageTemplateProps['solutionNav']) => {
|
||||
if (sideNav) {
|
||||
sideNav.items.push({
|
||||
id: 'beta',
|
||||
name: '',
|
||||
renderItem: () => <BetaNotification />,
|
||||
});
|
||||
}
|
||||
};
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
import { setMockValues } from '../../__mocks__/kea_logic';
|
||||
|
||||
jest.mock('./beta', () => ({ appendBetaNotificationItem: jest.fn() })); // Mostly adding this to get tests passing. Should be removed once we're out of beta
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
|
|
|
@ -23,8 +23,6 @@ import { HttpLogic } from '../http';
|
|||
import { BreadcrumbTrail } from '../kibana_chrome/generate_breadcrumbs';
|
||||
import { Loading } from '../loading';
|
||||
|
||||
import { appendBetaNotificationItem } from './beta';
|
||||
|
||||
import './page_template.scss';
|
||||
|
||||
/*
|
||||
|
@ -63,8 +61,6 @@ export const EnterpriseSearchPageTemplate: React.FC<PageTemplateProps> = ({
|
|||
const hasCustomEmptyState = !!emptyState;
|
||||
const showCustomEmptyState = hasCustomEmptyState && isEmptyState;
|
||||
|
||||
appendBetaNotificationItem(solutionNav);
|
||||
|
||||
return (
|
||||
<KibanaPageTemplate
|
||||
restrictWidth={false}
|
||||
|
@ -79,7 +75,6 @@ export const EnterpriseSearchPageTemplate: React.FC<PageTemplateProps> = ({
|
|||
}}
|
||||
isEmptyState={isEmptyState && !isLoading}
|
||||
solutionNav={solutionNav ? { icon: 'logoEnterpriseSearch', ...solutionNav } : undefined}
|
||||
pageSideBarProps={{ className: 'betaSidebarNotification' }}
|
||||
>
|
||||
{setPageChrome}
|
||||
{readOnlyMode && (
|
||||
|
|
|
@ -9863,10 +9863,6 @@
|
|||
"xpack.enterpriseSearch.appSearch.tokens.search.description": "エンドポイントのみの検索では、公開検索キーが使用されます。",
|
||||
"xpack.enterpriseSearch.appSearch.tokens.search.name": "公開検索キー",
|
||||
"xpack.enterpriseSearch.appSearch.tokens.update": "APIキー'{name}'が更新されました",
|
||||
"xpack.enterpriseSearch.beta.buttonLabel": "これはベータ版のユーザーインターフェースです",
|
||||
"xpack.enterpriseSearch.beta.popover.description": "エンタープライズサーチのKibanaインターフェースはベータ版の機能です。この機能は変更される可能性があり、公開されている機能と同じレベルのサポートは受けられません。このインターフェースは、8.0リリースのエンタープライズサーチの唯一の管理パネルです。それまでは、スタンドアロンのエンタープライズサーチUIが提供され、サポートされます。",
|
||||
"xpack.enterpriseSearch.beta.popover.footerDetail": "{learnMoreLink}または{standaloneUILink}。",
|
||||
"xpack.enterpriseSearch.beta.popover.title": "Kibanaのエンタープライズサーチはベータ版のユーザーインターフェースです",
|
||||
"xpack.enterpriseSearch.emailLabel": "メール",
|
||||
"xpack.enterpriseSearch.enterpriseSearch.setupGuide.description": "場所を問わず、何でも検索。組織を支える多忙なチームのために、パワフルでモダンな検索エクスペリエンスを簡単に導入できます。Webサイトやアプリ、ワークプレイスに事前調整済みの検索をすばやく追加しましょう。何でもシンプルに検索できます。",
|
||||
"xpack.enterpriseSearch.enterpriseSearch.setupGuide.notConfigured": "エンタープライズサーチはまだKibanaインスタンスで構成されていません。",
|
||||
|
|
|
@ -9964,10 +9964,6 @@
|
|||
"xpack.enterpriseSearch.appSearch.tokens.search.description": "公有搜索密钥仅用于搜索终端。",
|
||||
"xpack.enterpriseSearch.appSearch.tokens.search.name": "公有搜索密钥",
|
||||
"xpack.enterpriseSearch.appSearch.tokens.update": "API 密钥“{name}”已更新",
|
||||
"xpack.enterpriseSearch.beta.buttonLabel": "这是公测版用户界面",
|
||||
"xpack.enterpriseSearch.beta.popover.description": "Kibana 的企业搜索界面是公测版功能。其可能会进行更改,不提供与正式发行的功能一样的支持等级。此界面将成为 8.0 版本中企业搜索的唯一管理面板。届时,单机版企业搜索 UI 仍可用且受支持。",
|
||||
"xpack.enterpriseSearch.beta.popover.footerDetail": "{learnMoreLink}或{standaloneUILink}。",
|
||||
"xpack.enterpriseSearch.beta.popover.title": "Kibana 中的 Enterprise Search 是公测版用户界面",
|
||||
"xpack.enterpriseSearch.emailLabel": "电子邮件",
|
||||
"xpack.enterpriseSearch.enterpriseSearch.setupGuide.description": "随时随地进行全面搜索。为工作繁忙的团队轻松实现强大的现代搜索体验。将预先调整的搜索功能快速添加到您的网站、应用或工作区。全面搜索就是这么简单。",
|
||||
"xpack.enterpriseSearch.enterpriseSearch.setupGuide.notConfigured": "企业搜索尚未在您的 Kibana 实例中配置。",
|
||||
|
|
Loading…
Reference in a new issue