[Fleet] minor agent binary host flyout fixes (#138310) (#138357)

* rephrase flout title

* fix host validation error display

* Make text even more consistent

* Make text even more consistent

* trim values before submitting

(cherry picked from commit 46a2c63ab3)

Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
This commit is contained in:
Kibana Machine 2022-08-09 05:09:41 -04:00 committed by GitHub
parent 12bee76b6b
commit d831a8122d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -54,13 +54,13 @@ export const EditDownloadSourceFlyout: React.FunctionComponent<EditDownloadSourc
{!downloadSource ? (
<FormattedMessage
id="xpack.fleet.settings.editDownloadSourcesFlyout.createTitle"
defaultMessage="Add new agent download binary host"
defaultMessage="Add new agent binary source"
data-test-subj="editDownloadSourcesFlyout.add.title"
/>
) : (
<FormattedMessage
id="xpack.fleet.settings.editDownloadSourcesFlyout.editTitle"
defaultMessage="Edit agent download binary host"
defaultMessage="Edit agent binary source"
data-test-subj="editDownloadSourcesFlyout.edit.title"
/>
)}
@ -116,6 +116,7 @@ export const EditDownloadSourceFlyout: React.FunctionComponent<EditDownloadSourc
defaultMessage="Host"
/>
}
{...inputs.hostInput.formRowProps}
>
<EuiFieldText
data-test-subj="editDownloadSourcesFlyout.hostInput"

View file

@ -58,8 +58,8 @@ export function useDowloadSourceFlyoutForm(onSuccess: () => void, downloadSource
setIsloading(true);
const data: PostDownloadSourceRequest['body'] = {
name: nameInput.value,
host: hostInput.value,
name: nameInput.value.trim(),
host: hostInput.value.trim(),
is_default: defaultDownloadSourceInput.value,
};
@ -123,7 +123,7 @@ function validateName(value: string) {
export function validateHost(value: string) {
try {
if (!value || value === '') {
if (!value) {
return [
i18n.translate('xpack.fleet.settings.dowloadSourceFlyoutForm.HostIsRequiredErrorMessage', {
defaultMessage: 'Host is required',