Skip to content

Commit

Permalink
[Enterprise Search] Error state UI tweaks to account for current Clou…
Browse files Browse the repository at this point in the history
…d SSO behavior (elastic#73324) (elastic#73370)

* Do not disable the Launch App Search button on the error page

- so users always have access to App Search

* Add troubleshooting steps that mention user authentication

- more info can be found in setup guide

* Tweak styling/spacing on troubleshooting steps

* Copyedits (thanks Chris!)
  • Loading branch information
Constance authored Jul 27, 2020
1 parent 07e6fba commit dd6bc18
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 27 deletions.
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

0 comments on commit dd6bc18

Please sign in to comment.