Revert "[Synthetics] update private locations callout (#138952)"

This reverts commit da682f49dc.
This commit is contained in:
Tyler Smalley 2022-08-16 16:26:48 -07:00
parent da682f49dc
commit f487883108
7 changed files with 29 additions and 80 deletions

View file

@ -251,7 +251,9 @@ describe('<CustomFields />', () => {
expect(node).toBeInTheDocument();
});
expect(
getByText(/To create a "Browser" monitor, please ensure you are using the/)
getByText(
/To create a "Browser" monitor, please ensure you are using the elastic-agent-complete Docker container, which contains the dependencies to run these mon/
)
).toBeInTheDocument();
// expect tls options to be available for browser

View file

@ -16,7 +16,6 @@ import {
EuiSpacer,
EuiSwitch,
EuiCallOut,
EuiCode,
EuiLink,
} from '@elastic/eui';
import { DescribedFormGroupWithWrap } from './common/described_form_group_with_wrap';
@ -155,32 +154,27 @@ export const CustomFields = memo<Props>(
<EuiCallOut
title={
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.monitorType.browser.warning.title"
defaultMessage="Requirement"
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.monitorType.browser.warning.description"
defaultMessage='To create a "Browser" monitor, please ensure you are using the elastic-agent-complete Docker container, which contains the dependencies to run these monitors. For more information, please visit our {link}.'
values={{
link: (
<EuiLink
target="_blank"
href="https://www.elastic.co/guide/en/observability/current/synthetics-quickstart-fleet.html"
external
>
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.monitorType.browser.warning.link"
defaultMessage="synthetics documentation"
/>
</EuiLink>
),
}}
/>
}
iconType="help"
size="s"
>
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.monitorType.browser.warning.content"
defaultMessage='To create a "Browser" monitor, please ensure you are using the {agent} Docker container, which contains the dependencies to run these monitors. For more information, please visit our {link}.'
values={{
agent: <EuiCode>elastic-agent-complete</EuiCode>,
link: (
<EuiLink
target="_blank"
href="https://www.elastic.co/guide/en/observability/current/synthetics-quickstart-fleet.html"
external
>
<FormattedMessage
id="xpack.synthetics.createPackagePolicy.stepConfigure.monitorIntegrationSettingsSection.monitorType.browser.warning.link"
defaultMessage="synthetics documentation"
/>
</EuiLink>
),
}}
/>
</EuiCallOut>
/>
)}
<EuiSpacer size="s" />
{renderSimpleFields(monitorType)}

View file

@ -15,6 +15,7 @@ import {
EuiFlyoutBody,
EuiFlyoutFooter,
EuiFlyoutHeader,
EuiSpacer,
EuiTitle,
EuiFlyout,
EuiButton,
@ -76,6 +77,8 @@ export const AddLocationFlyout = ({
<p>{NEED_FLEET_READ_AGENT_POLICIES_PERMISSION}</p>
</EuiCallOut>
)}
<EuiSpacer />
<LocationForm privateLocations={privateLocations} />
</EuiFlyoutBody>
<EuiFlyoutFooter>

View file

@ -26,11 +26,10 @@ export const EmptyLocations = ({
<EuiEmptyPrompt
hasBorder
title={<h2>{ADD_FIRST_LOCATION}</h2>}
titleSize="s"
body={
<EuiText size="s">
<p>
{!inFlyout ? FIRST_MONITOR : ''} {START_ADDING_LOCATIONS_DESCRIPTION}
</EuiText>
</p>
}
actions={
<EuiButton

View file

@ -5,16 +5,7 @@
* 2.0.
*/
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import {
EuiFieldText,
EuiForm,
EuiFormRow,
EuiSpacer,
EuiCallOut,
EuiCode,
EuiLink,
} from '@elastic/eui';
import { EuiFieldText, EuiForm, EuiFormRow, EuiSpacer } from '@elastic/eui';
import { useSelector } from 'react-redux';
import { i18n } from '@kbn/i18n';
import { useFormContext, useFormState } from 'react-hook-form';
@ -61,44 +52,11 @@ export const LocationForm = ({
</EuiFormRow>
<EuiSpacer />
<PolicyHostsField errors={errors} control={control} privateLocations={privateLocations} />
<EuiSpacer />
<EuiCallOut title={AGENT_CALLOUT_TITLE} size="s" style={{ textAlign: 'left' }}>
<p>
{
<FormattedMessage
id="xpack.synthetics.monitorManagement.agentCallout.content"
defaultMessage='If you intend to run "Browser" monitors on this private location, please ensure you are using the {code} Docker container, which contains the dependencies to run these monitors. For more information, {link}.'
values={{
code: <EuiCode>elastic-agent-complete</EuiCode>,
link: (
<EuiLink
target="_blank"
href="https://www.elastic.co/guide/en/observability/current/uptime-set-up-choose-agent.html#private-locations"
external
>
<FormattedMessage
id="xpack.synthetics.monitorManagement.agentCallout.link"
defaultMessage="read the docs"
/>
</EuiLink>
),
}}
/>
}
</p>
</EuiCallOut>
</EuiForm>
</>
);
};
export const AGENT_CALLOUT_TITLE = i18n.translate(
'xpack.synthetics.monitorManagement.agentCallout.title',
{
defaultMessage: 'Requirement',
}
);
export const LOCATION_NAME_LABEL = i18n.translate(
'xpack.synthetics.monitorManagement.locationName',
{

View file

@ -78,7 +78,7 @@ export const ManageLocationsFlyout = () => {
const flyout = (
<EuiFlyout onClose={closeFlyout} size="m" style={{ width: 540 }}>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<EuiTitle size="s">
<h2>{PRIVATE_LOCATIONS}</h2>
</EuiTitle>
</EuiFlyoutHeader>

View file

@ -91,7 +91,7 @@ export const PolicyHostsField = ({
<EuiFormRow
fullWidth
label={POLICY_HOST_LABEL}
helpText={!errors?.agentPolicyId ? SELECT_POLICY_HOSTS_HELP_TEXT : undefined}
helpText={!errors?.agentPolicyId ? SELECT_POLICY_HOSTS : undefined}
isInvalid={!!errors?.agentPolicyId}
error={SELECT_POLICY_HOSTS}
>
@ -126,13 +126,6 @@ const SELECT_POLICY_HOSTS = i18n.translate('xpack.synthetics.monitorManagement.s
defaultMessage: 'Select agent policy',
});
const SELECT_POLICY_HOSTS_HELP_TEXT = i18n.translate(
'xpack.synthetics.monitorManagement.selectPolicyHost.helpText',
{
defaultMessage: 'We recommend using a single Elastic agent per agent policy.',
}
);
const POLICY_HOST_LABEL = i18n.translate('xpack.synthetics.monitorManagement.policyHost', {
defaultMessage: 'Agent policy',
});