Skip to content
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 @@ -12,8 +12,8 @@ import { EuiEmptyPrompt, EuiButton, EuiCode, EuiLoadingContent } from '@elastic/
import { FormattedMessage } from '@kbn/i18n/react';
import { shallowWithIntl } from '../../../__mocks__';

jest.mock('../../utils/get_username', () => ({ getUserName: jest.fn() }));
import { getUserName } from '../../utils/get_username';
jest.mock('../../../shared/get_username', () => ({ getUserName: jest.fn() }));
import { getUserName } from '../../../shared/get_username';

jest.mock('../../../shared/telemetry', () => ({
sendTelemetry: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { FormattedMessage } from '@kbn/i18n/react';

import { SetAppSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs';
import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';
import { getUserName } from '../../../shared/get_username';
import { EngineOverviewHeader } from '../engine_overview_header';
import { getUserName } from '../../utils/get_username';

import './empty_states.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

import React from 'react';
import { shallow } from 'enzyme';
import { EuiPageSideBar, EuiSteps } from '@elastic/eui';

import { SetAppSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs';
import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide';
import { SetupGuide } from './';

describe('SetupGuide', () => {
it('renders', () => {
const wrapper = shallow(<SetupGuide />);

expect(wrapper.find(EuiSteps)).toHaveLength(1);
expect(wrapper.find(EuiPageSideBar)).toHaveLength(1);
expect(wrapper.find(SetupGuideLayout)).toHaveLength(1);
expect(wrapper.find(SetBreadcrumbs)).toHaveLength(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,237 +5,58 @@
*/

import React from 'react';
import {
EuiPage,
EuiPageSideBar,
EuiPageBody,
EuiPageContent,
EuiSpacer,
EuiFlexGroup,
EuiFlexItem,
EuiTitle,
EuiText,
EuiIcon,
EuiSteps,
EuiCode,
EuiCodeBlock,
EuiAccordion,
EuiLink,
} from '@elastic/eui';
import { EuiSpacer, EuiTitle, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { SetupGuide as SetupGuideLayout } from '../../../shared/setup_guide';
import { SetAppSearchBreadcrumbs as SetBreadcrumbs } from '../../../shared/kibana_breadcrumbs';
import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry';

import GettingStarted from '../../assets/getting_started.png';
import './setup_guide.scss';

export const SetupGuide: React.FC = () => {
return (
<EuiPage className="setupGuide">
<SetBreadcrumbs text="Setup Guide" />
<SendTelemetry action="viewed" metric="setup_guide" />

<EuiPageSideBar className="setupGuide__sidebar">
<EuiText color="subdued" size="s">
<strong>
<FormattedMessage id="xpack.appSearch.setupGuide.title" defaultMessage="Setup Guide" />
</strong>
</EuiText>
<EuiSpacer size="s" />

<EuiFlexGroup gutterSize="s" alignItems="center" responsive={false}>
<EuiFlexItem grow={false}>
<EuiIcon type="logoAppSearch" size="l" />
</EuiFlexItem>
<EuiFlexItem>
<EuiTitle size="m">
<h1>
<FormattedMessage id="xpack.appSearch.productTitle" defaultMessage="App Search" />
</h1>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>

<a
href="https://www.elastic.co/webinars/getting-started-with-elastic-app-search"
target="_blank"
rel="noopener noreferrer"
>
<img
className="setupGuide__thumbnail"
src={GettingStarted}
alt={i18n.translate('xpack.appSearch.setupGuide.videoAlt', {
defaultMessage:
"Getting started with App Search - in this short video we'll guide you through how to get App Search up and running",
})}
width="1280"
height-="720"
/>
</a>

<EuiTitle size="s">
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.description"
defaultMessage="Elastic App Search provides user-friendly tools to design and deploy a powerful search to your websites or web/mobile applications."
/>
</p>
</EuiTitle>
<EuiSpacer size="m" />
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.notConfigured"
defaultMessage="App Search has not been configured in your Kibana instance yet. To get started, follow the instructions on this page."
/>
</p>
</EuiText>
</EuiPageSideBar>

<EuiPageBody className="setupGuide__body">
<EuiPageContent>
<EuiSteps
headingElement="h2"
steps={[
{
title: i18n.translate('xpack.appSearch.setupGuide.step1.title', {
defaultMessage: 'Add your App Search host URL to your Kibana configuration',
}),
children: (
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.step1.instruction1"
defaultMessage="Within your {configFile} file, set {configSetting} to the URL of your App Search instance. For example:"
values={{
configFile: <EuiCode>config/kibana.yml</EuiCode>,
configSetting: <EuiCode>enterpriseSearch.host</EuiCode>,
}}
/>
</p>
<EuiCodeBlock language="yml">
enterpriseSearch.host: &apos;http://localhost:3002&apos;
</EuiCodeBlock>
</EuiText>
),
},
{
title: i18n.translate('xpack.appSearch.setupGuide.step2.title', {
defaultMessage: 'Reload your Kibana instance',
}),
children: (
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.step2.instruction1"
defaultMessage="Restart Kibana to pick up the configuration changes from the previous step."
/>
</p>
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.step2.instruction2"
defaultMessage="If you’re using {elasticsearchNativeAuthLink} within App Search - you’re all set! All users should be able to use App Search in Kibana automatically, inheriting the existing access and permissions they have within App Search."
values={{
elasticsearchNativeAuthLink: (
<EuiLink
href="https://swiftype.com/documentation/app-search/self-managed/security#elasticsearch-native-realm"
target="_blank"
>
Elasticsearch Native Auth
</EuiLink>
),
}}
/>
</p>
</EuiText>
),
},
{
title: i18n.translate('xpack.appSearch.setupGuide.step3.title', {
defaultMessage: 'Troubleshooting issues',
}),
children: (
<>
<EuiAccordion
buttonContent={i18n.translate(
'xpack.appSearch.troubleshooting.differentEsClusters.title',
{
defaultMessage:
'App Search and Kibana are on different Elasticsearch clusters',
}
)}
id="differentEsClusters"
paddingSize="s"
>
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.troubleshooting.differentEsClusters.description"
defaultMessage="This plugin does not currently support App Search and Kibana running on different clusters."
/>
</p>
</EuiText>
</EuiAccordion>
<EuiSpacer />
<EuiAccordion
buttonContent={i18n.translate(
'xpack.appSearch.troubleshooting.differentAuth.title',
{
defaultMessage:
'App Search and Kibana are on different authentication methods',
}
)}
id="differentAuth"
paddingSize="s"
>
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.troubleshooting.differentAuth.description"
defaultMessage="This plugin does not currently support App Search and Kibana operating on different authentication methods (for example, App Search using a different SAML provider than Kibana)."
/>
</p>
</EuiText>
</EuiAccordion>
<EuiSpacer />
<EuiAccordion
buttonContent={i18n.translate(
'xpack.appSearch.troubleshooting.standardAuth.title',
{
defaultMessage: 'App Search on Standard authentication',
}
)}
id="standardAuth"
paddingSize="s"
>
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.troubleshooting.standardAuth.description"
defaultMessage='App Search operating on {standardAuthLink} is currently not fully supported by this plugin. Users created in App Search must be granted Kibana access. Users created in Kibana will see "Cannot find App Search account" error messages.'
values={{
standardAuthLink: (
<EuiLink
href="https://swiftype.com/documentation/app-search/self-managed/security#standard"
target="_blank"
>
Standard Auth
</EuiLink>
),
}}
/>
</p>
</EuiText>
</EuiAccordion>
</>
),
},
]}
/>
</EuiPageContent>
</EuiPageBody>
</EuiPage>
);
};
export const SetupGuide: React.FC = () => (
<SetupGuideLayout
productName={i18n.translate('xpack.appSearch.productName', { defaultMessage: 'App Search' })}
productEuiIcon="logoAppSearch"
standardAuthLink="https://swiftype.com/documentation/app-search/self-managed/security#standard"
elasticsearchNativeAuthLink="https://swiftype.com/documentation/app-search/self-managed/security#elasticsearch-native-realm"
Comment on lines +21 to +22
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hoping we can potentially lose these two per-product props if I get approval from @chriscressman for opening up a PR for pulling out

https://www.elastic.co/guide/en/app-search/current/security-and-users.html
and
https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html

into its own section in the general https://www.elastic.co/guide/en/enterprise-search/current/index.html docs 🤞

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@constancecchen - I'm not sure if you'd still like to make this change, but if so, I welcome that PR. I'm tracking a larger, related docs project in https://github.com/elastic/enterprise-search-pubs/issues/630, but I don't expect to act on it for a while. More broadly, I favor moving shared concerns out of product-specific books and into the Enterprise Search book.

If you proceed, here are some considerations:

  • @jonas updated the Workplace Search version of the doc for 7.7.0, so it's more likely to be up to date than the App Search version.
  • The existing Workplace Search URL will need to be redirected. In the PR, you can do a manual redirect (have the old doc link to the new), and then after it's deployed, I can get the website team to implement an HTTP redirect.
  • The existing Workplace Search page is part of an "Administration & management" section, so you may need to modify the contents of the other docs in that section if they depend on the doc that's moving (I haven't checked).
  • You'll have to find any links to the product-specific docs in the App Search and Workplace Search books and update them to point to the Enterprise Search book.

I wish moving docs wasn't so hard 😢

>
<SetBreadcrumbs text="Setup Guide" />
<SendTelemetry action="viewed" metric="setup_guide" />

<a
href="https://www.elastic.co/webinars/getting-started-with-elastic-app-search"
target="_blank"
rel="noopener noreferrer"
>
<img
className="setupGuide__thumbnail"
src={GettingStarted}
alt={i18n.translate('xpack.appSearch.setupGuide.videoAlt', {
defaultMessage:
"Getting started with App Search - in this short video we'll guide you through how to get App Search up and running",
})}
width="1280"
height-="720"
/>
</a>

<EuiTitle size="s">
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.description"
defaultMessage="Elastic App Search provides user-friendly tools to design and deploy a powerful search to your websites or web/mobile applications."
/>
</p>
</EuiTitle>
<EuiSpacer size="m" />
<EuiText>
<p>
<FormattedMessage
id="xpack.appSearch.setupGuide.notConfigured"
defaultMessage="App Search has not been configured in your Kibana instance yet. To get started, follow the instructions on this page."
/>
</p>
</EuiText>
</SetupGuideLayout>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export { getUserName } from './get_username';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export { SetupGuide } from './setup_guide';
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { shallow } from 'enzyme';
import { EuiSteps, EuiIcon, EuiLink } from '@elastic/eui';

import { mountWithContext } from '../../__mocks__';

import { SetupGuide } from './';

describe('SetupGuide', () => {
it('renders', () => {
const wrapper = shallow(
<SetupGuide productName="Enterprise Search" productEuiIcon="logoEnterpriseSearch">
<p data-test-subj="test">Wow!</p>
</SetupGuide>
);

expect(wrapper.find('h1').text()).toEqual('Enterprise Search');
expect(wrapper.find(EuiIcon).prop('type')).toEqual('logoEnterpriseSearch');
expect(wrapper.find('[data-test-subj="test"]').text()).toEqual('Wow!');
expect(wrapper.find(EuiSteps)).toHaveLength(1);
});

it('renders with optional auth links', () => {
const wrapper = mountWithContext(
<SetupGuide
productName="Foo"
productEuiIcon="Bar"
standardAuthLink="http://foo.com"
elasticsearchNativeAuthLink="http://bar.com"
>
Baz
</SetupGuide>
);

expect(wrapper.find('EuiLink').first().prop('href')).toEqual('http://bar.com');
expect(wrapper.find('EuiLink').last().prop('href')).toEqual('http://foo.com');
});
});
Loading