-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tech preview label for search applications #155649
Changes from all commits
4e6c110
8719ae5
7814259
589f29a
12e875f
5e9d4bc
9e3b5a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,34 +120,6 @@ describe('EnginesList', () => { | |
|
||
describe('CreateEngineButton', () => { | ||
describe('disabled={true}', () => { | ||
it('renders a disabled button that shows a popover when focused', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I repurposed the popover for the platinum license acknowledgement based on the design. |
||
const wrapper = mount(<CreateEngineButton disabled />); | ||
|
||
const button = wrapper.find( | ||
'button[data-test-subj="enterprise-search-content-engines-creation-button"]' | ||
); | ||
|
||
expect(button).toHaveLength(1); | ||
expect(button.prop('disabled')).toBeTruthy(); | ||
|
||
let popover = wrapper.find('div[data-test-subj="create-engine-button-popover-content"]'); | ||
|
||
expect(popover).toHaveLength(0); | ||
|
||
const hoverTarget = wrapper.find('div[data-test-subj="create-engine-button-hover-target"]'); | ||
|
||
expect(hoverTarget).toHaveLength(1); | ||
|
||
hoverTarget.simulate('focus'); | ||
|
||
wrapper.update(); | ||
|
||
popover = wrapper.find('div[data-test-subj="create-engine-button-popover-content"]'); | ||
|
||
expect(popover).toHaveLength(1); | ||
expect(popover.text()).toMatch('Search Applications require a Platinum license'); | ||
}); | ||
|
||
it('renders a disabled button that shows a popover when hovered', () => { | ||
const wrapper = mount(<CreateEngineButton disabled />); | ||
|
||
|
@@ -173,37 +145,13 @@ describe('CreateEngineButton', () => { | |
popover = wrapper.find('div[data-test-subj="create-engine-button-popover-content"]'); | ||
|
||
expect(popover).toHaveLength(1); | ||
expect(popover.text()).toMatch('Search Applications require a Platinum license'); | ||
expect(popover.text()).toMatch( | ||
'This functionality is in technical preview and may be changed or removed completely in a future release.' | ||
); | ||
}); | ||
}); | ||
describe('disabled={false}', () => { | ||
it('renders a button and does not show a popover when focused', () => { | ||
const wrapper = mount(<CreateEngineButton disabled={false} />); | ||
|
||
const button = wrapper.find( | ||
'button[data-test-subj="enterprise-search-content-engines-creation-button"]' | ||
); | ||
|
||
expect(button).toHaveLength(1); | ||
expect(button.prop('disabled')).toBeFalsy(); | ||
|
||
let popover = wrapper.find('div[data-test-subj="create-engine-button-popover-content"]'); | ||
|
||
expect(popover).toHaveLength(0); | ||
|
||
const hoverTarget = wrapper.find('div[data-test-subj="create-engine-button-hover-target"]'); | ||
|
||
expect(hoverTarget).toHaveLength(1); | ||
|
||
hoverTarget.simulate('focus'); | ||
|
||
wrapper.update(); | ||
|
||
popover = wrapper.find('div[data-test-subj="create-engine-button-popover-content"]'); | ||
|
||
expect(popover).toHaveLength(0); | ||
}); | ||
it('renders a button and does not show a popover when hovered', () => { | ||
it('renders a button and shows a popover when hovered', () => { | ||
const wrapper = mount(<CreateEngineButton disabled={false} />); | ||
|
||
const button = wrapper.find( | ||
|
@@ -227,7 +175,10 @@ describe('CreateEngineButton', () => { | |
|
||
popover = wrapper.find('div[data-test-subj="create-engine-button-popover-content"]'); | ||
|
||
expect(popover).toHaveLength(0); | ||
expect(popover).toHaveLength(1); | ||
expect(popover.text()).toMatch( | ||
'This functionality is in technical preview and may be changed or removed completely in a future release.' | ||
); | ||
}); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import { | |
EuiFieldSearch, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiIcon, | ||
EuiLink, | ||
EuiPopover, | ||
EuiPopoverTitle, | ||
|
@@ -30,7 +31,6 @@ import { docLinks } from '../../../shared/doc_links'; | |
|
||
import { KibanaLogic } from '../../../shared/kibana'; | ||
import { LicensingLogic } from '../../../shared/licensing'; | ||
import { EXPLORE_PLATINUM_FEATURES_LINK } from '../../../workplace_search/constants'; | ||
import { ENGINES_PATH, ENGINE_CREATION_PATH } from '../../routes'; | ||
import { EnterpriseSearchEnginesPageTemplate } from '../layout/engines_page_template'; | ||
|
||
|
@@ -52,13 +52,13 @@ export const CreateEngineButton: React.FC<CreateEngineButtonProps> = ({ disabled | |
|
||
return ( | ||
<EuiPopover | ||
isOpen={disabled && showPopover} | ||
isOpen={showPopover} | ||
closePopover={() => setShowPopover(false)} | ||
button={ | ||
<div | ||
data-test-subj="create-engine-button-hover-target" | ||
onMouseEnter={() => setShowPopover(true)} | ||
onFocus={() => setShowPopover(true)} | ||
onMouseLeave={() => setShowPopover(false)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we may still want a focus event for users navigating with a keyboard There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we should definitely have that. I am also concerned about other potential accessibility issues here. Does the popover announce its presence when opened? Does tabIndex 0 make sense in the context of this page? Does onFocus get triggered when someone tabs to the button, or only when it tabs to the div? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll get these fixed in a follow up PR. thanks for the feedback |
||
tabIndex={0} | ||
> | ||
<EuiButton | ||
|
@@ -72,30 +72,34 @@ export const CreateEngineButton: React.FC<CreateEngineButtonProps> = ({ disabled | |
{i18n.translate( | ||
'xpack.enterpriseSearch.content.searchApplications.createEngineButtonLabel', | ||
{ | ||
defaultMessage: 'Create Search Application', | ||
defaultMessage: 'Create', | ||
} | ||
)} | ||
</EuiButton> | ||
</div> | ||
} | ||
> | ||
<EuiPopoverTitle> | ||
<FormattedMessage | ||
id="xpack.enterpriseSearch.content.searchApplications.createEngineDisabledPopover.title" | ||
defaultMessage="Platinum only feature" | ||
/> | ||
<EuiFlexGroup justifyContent="center" gutterSize="s"> | ||
<EuiFlexItem grow={false}> | ||
<EuiIcon type="beaker" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<FormattedMessage | ||
id="xpack.enterpriseSearch.content.searchApplications.createEngineTechnicalPreviewPopover.title" | ||
defaultMessage="Technical Preview" | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That works for me Ioana! |
||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPopoverTitle> | ||
<div style={{ width: '300px' }} data-test-subj="create-engine-button-popover-content"> | ||
<EuiFlexGroup direction="column" gutterSize="m"> | ||
<EuiText size="s"> | ||
<FormattedMessage | ||
id="xpack.enterpriseSearch.content.searchApplications.createEngineDisabledPopover.body" | ||
defaultMessage="Search Applications require a Platinum license or higher and are not available to Standard license self-managed deployments." | ||
id="xpack.enterpriseSearch.content.searchApplications.createEngineTechnicalPreviewPopover.body" | ||
defaultMessage="This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features." | ||
/> | ||
</EuiText> | ||
<EuiLink target="_blank" href={docLinks.licenseManagement}> | ||
{EXPLORE_PLATINUM_FEATURES_LINK} | ||
</EuiLink> | ||
</EuiFlexGroup> | ||
</div> | ||
</EuiPopover> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we quickly change this to say:
To make it less wordy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized this was in the wrong place, need this for the popover, not the callout. Callout is fine as is.