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

Edit text strings and links in add logstash output UI #129551

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
},
logstash: {
base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`,
inputElasticAgent: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/plugins-inputs-elastic_agent.html`,
},
functionbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/functionbeat/${DOC_LINK_VERSION}`,
Expand Down Expand Up @@ -579,7 +580,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
guide: `${FLEET_DOCS}index.html`,
fleetServer: `${FLEET_DOCS}fleet-server.html`,
fleetServerAddFleetServer: `${FLEET_DOCS}add-a-fleet-server.html`,
settings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`,
settings: `${FLEET_DOCS}fleet-settings.html`,
settingsFleetServerHostSettings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`,
settingsFleetServerProxySettings: `${KIBANA_DOCS}fleet-settings-kb.html#fleet-data-visualizer-settings`,
troubleshooting: `${FLEET_DOCS}fleet-troubleshooting.html`,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/public/applications/fleet/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ const FleetTopNav = memo(
const topNavConfig: TopNavMenuData[] = [
{
label: i18n.translate('xpack.fleet.appNavigation.sendFeedbackButton', {
defaultMessage: 'Send Feedback',
defaultMessage: 'Send feedback',
}),
iconType: 'popout',
run: () => window.open(FEEDBACK_URL),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface EditOutputFlyoutProps {

const OUTPUT_TYPE_OPTIONS = [
{ value: 'elasticsearch', text: 'Elasticsearch' },
{ value: 'logstash', text: 'Logstash (BETA)' },
{ value: 'logstash', text: 'Logstash (beta)' },
];

export const EditOutputFlyout: React.FunctionComponent<EditOutputFlyoutProps> = ({
Expand Down Expand Up @@ -138,16 +138,7 @@ export const EditOutputFlyout: React.FunctionComponent<EditOutputFlyoutProps> =
isLogstashOutput && (
<FormattedMessage
id="xpack.fleet.editOutputFlyout.logstashTypeOutputBetaHelpText"
defaultMessage="Logstash output is in BETA, Please help by reporting any bugs. {learnMoreLink}."
values={{
learnMoreLink: (
<EuiLink href={docLinks.links.fleet.guide} external>
{i18n.translate('xpack.fleet.editOutputFlyout.learnMoreLink', {
defaultMessage: 'Learn more',
})}
</EuiLink>
),
}}
defaultMessage="Logstash output is in beta. Please send feedback to report bugs or suggest improvements."
/>
)
}
Expand Down Expand Up @@ -203,13 +194,13 @@ export const EditOutputFlyout: React.FunctionComponent<EditOutputFlyoutProps> =
helpText={
<FormattedMessage
id="xpack.fleet.settings.editOutputFlyout.logstashHostsInputDescription"
defaultMessage="Specify the URLs that your agents will use to connect to a Logstash. For more information, see the {guideLink}."
defaultMessage="Specify the URLs that your agents will use to connect to Logstash. {guideLink}."
values={{
guideLink: (
<EuiLink href={docLinks.links.fleet.guide} target="_blank" external>
<EuiLink href={docLinks.links.fleet.settings} target="_blank" external>
<FormattedMessage
id="xpack.fleet.settings.fleetUserGuideLink"
defaultMessage="Fleet User Guide"
defaultMessage="Learn more"
/>
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Output form validation', () => {
const res = validateLogstashHosts(['https://test.fr:5044']);

expect(res).toEqual([
{ index: 0, message: 'Invalid logstash host should not start with http(s)' },
{ index: 0, message: 'Host URL must begin with a domain name or IP address.' },
]);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function validateLogstashHosts(value: string[]) {
if (val.match(/^http([s]){0,1}:\/\//)) {
res.push({
message: i18n.translate('xpack.fleet.settings.outputForm.logstashHostProtocolError', {
defaultMessage: 'Invalid logstash host should not start with http(s)',
defaultMessage: 'Host URL must begin with a domain name or IP address',
}),
index: idx,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ export const LogstashInstructions = () => {
title={
<FormattedMessage
id="xpack.fleet.settings.logstashInstructions.calloutTitle"
defaultMessage="Configure Logstash for Elastic Agent"
defaultMessage="You must configure Logstash for Elastic Agent"
/>
}
>
<>
<FormattedMessage
id="xpack.fleet.settings.logstashInstructions.description"
defaultMessage="You must add a pipeline for Elastic Agent to Logstash. For more information, visit our
defaultMessage="You must add an Elastic Agent pipeline configuration to Logstash.
{documentationLink}."
values={{
documentationLink: (
<EuiLink external={true} href={docLinks.links.fleet.guide}>
<EuiLink external={true} href={docLinks.links.logstash.inputElasticAgent}>
<FormattedMessage
id="xpack.fleet.settings.logstashInstructions.documentationLink"
defaultMessage="documentation"
defaultMessage="Learn more"
/>
</EuiLink>
),
Expand All @@ -71,14 +71,14 @@ const CollapsibleCallout: React.FunctionComponent<EuiCallOutProps> = ({ children
<EuiButton onClick={() => setIsOpen(false)}>
<FormattedMessage
id="xpack.fleet.settings.logstashInstructions.collapseInstructionsButtonLabel"
defaultMessage="Collapse instructions"
defaultMessage="Collapse steps"
/>
</EuiButton>
) : (
<EuiButton onClick={() => setIsOpen(true)} fill={true}>
<FormattedMessage
id="xpack.fleet.settings.logstashInstructions.viewInstructionButtonLabel"
defaultMessage="View instructions"
defaultMessage="View steps"
/>
</EuiButton>
)}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/server/types/models/output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Output model', () => {

it('should return an error for an invalid host with http scheme', () => {
expect(validateLogstashHost('https://test.fr:5044')).toMatchInlineSnapshot(
`"Invalid logstash host should not start with http(s)"`
`"Host URL must begin with a domain name or IP address"`
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/fleet/server/types/models/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { outputType } from '../../../common/constants';

export function validateLogstashHost(val: string) {
if (val.match(/^http([s]){0,1}:\/\//)) {
return 'Invalid logstash host should not start with http(s)';
return 'Host URL must begin with a domain name or IP address';
}

try {
Expand All @@ -21,7 +21,7 @@ export function validateLogstashHost(val: string) {
return 'Invalid host';
}
} catch (err) {
return 'Invalid logstash host';
return 'Invalid Logstash host';
}
}

Expand Down