Skip to content
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

[7.x] [Enterprise Search] Error state UI tweaks to account for current Cloud SSO behavior (#73324) #73369

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ErrorState: React.FC = () => {
<SendTelemetry action="error" metric="cannot_connect" />

<EuiPageBody>
<EngineOverviewHeader isButtonDisabled />
<EngineOverviewHeader />
<EuiPageContent>
<ErrorStatePrompt />
</EuiPageContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,4 @@ describe('EngineOverviewHeader', () => {
button.simulate('click');
expect(sendTelemetry).toHaveBeenCalled();
});

it('renders a disabled button when isButtonDisabled is true', () => {
const wrapper = shallow(<EngineOverviewHeader isButtonDisabled />);
const button = wrapper.find('[data-test-subj="launchButton"]');

expect(button.prop('isDisabled')).toBe(true);
expect(button.prop('href')).toBeUndefined();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,23 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { sendTelemetry } from '../../../shared/telemetry';
import { KibanaContext, IKibanaContext } from '../../../index';

interface IEngineOverviewHeaderProps {
isButtonDisabled?: boolean;
}

export const EngineOverviewHeader: React.FC<IEngineOverviewHeaderProps> = ({
isButtonDisabled,
}) => {
export const EngineOverviewHeader: React.FC = () => {
const { enterpriseSearchUrl, http } = useContext(KibanaContext) as IKibanaContext;

const buttonProps = {
fill: true,
iconType: 'popout',
'data-test-subj': 'launchButton',
} as EuiButtonProps & EuiLinkProps;

if (isButtonDisabled) {
buttonProps.isDisabled = true;
} else {
buttonProps.href = `${enterpriseSearchUrl}/as`;
buttonProps.target = '_blank';
buttonProps.onClick = () =>
href: `${enterpriseSearchUrl}/as`,
target: '_blank',
onClick: () =>
sendTelemetry({
http,
product: 'app_search',
action: 'clicked',
metric: 'header_launch_button',
});
}
}),
} as EuiButtonProps & EuiLinkProps;

return (
<EuiPageHeader>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.troubleshootingSteps {
text-align: left;

li {
margin: $euiSizeS auto;
}

ul,
ol {
margin-bottom: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { EuiButton } from '../react_router_helpers';
import { KibanaContext, IKibanaContext } from '../../index';

import './error_state_prompt.scss';

export const ErrorStatePrompt: React.FC = () => {
const { enterpriseSearchUrl } = useContext(KibanaContext) as IKibanaContext;

Expand Down Expand Up @@ -38,7 +40,7 @@ export const ErrorStatePrompt: React.FC = () => {
}}
/>
</p>
<ol className="eui-textLeft">
<ol className="troubleshootingSteps">
<li>
<FormattedMessage
id="xpack.enterpriseSearch.errorConnectingState.description2"
Expand All @@ -54,6 +56,26 @@ export const ErrorStatePrompt: React.FC = () => {
defaultMessage="Confirm that the Enterprise Search server is responsive."
/>
</li>
<li>
<FormattedMessage
id="xpack.enterpriseSearch.errorConnectingState.troubleshootAuth"
defaultMessage="Check your user authentication:"
/>
<ul>
<li>
<FormattedMessage
id="xpack.enterpriseSearch.errorConnectingState.troubleshootAuthNative"
defaultMessage="You must authenticate using Elasticsearch Native auth or SSO/SAML."
/>
</li>
<li>
<FormattedMessage
id="xpack.enterpriseSearch.errorConnectingState.troubleshootAuthSAML"
defaultMessage="If using SSO/SAML, your SAML realm must also be set up on Enterprise Search."
/>
</li>
</ul>
</li>
<li>
<FormattedMessage
id="xpack.enterpriseSearch.errorConnectingState.description4"
Expand Down