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

* rephrase flout title

* fix host validation error display

* Make text even more consistent

* Make text even more consistent

* trim values before submitting
This commit is contained in:
Mark Hopkin 2022-08-09 08:58:19 +01:00 committed by GitHub
parent f3f7498b76
commit 46a2c63ab3
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',