diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx
index 94bb49d751283..53945f86e09e7 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.test.tsx
@@ -75,4 +75,20 @@ describe('SecretFormRow', () => {
expect(onUsePlainText).toHaveBeenCalled();
});
+
+ it('should not display the cancel change button when no initial value is provided', () => {
+ const { queryByTestId } = render(
+
+
+
+ );
+
+ expect(queryByTestId('secretCancelChangeBtn')).not.toBeInTheDocument();
+ });
});
diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.tsx
index f483503af9e43..868c80b895fa3 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_secret_form_row.tsx
@@ -41,7 +41,7 @@ export const SecretFormRow: React.FC<{
onUsePlainText,
cancelEdit,
}) => {
- const hasInitialValue = initialValue !== undefined;
+ const hasInitialValue = !!initialValue;
const [editMode, setEditMode] = useState(!initialValue);
const valueHiddenPanel = (
@@ -98,7 +98,7 @@ export const SecretFormRow: React.FC<{
<>
{children}
{hasInitialValue && (
-
+
{cancelButton}
)}
diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.test.tsx
index 7aa29322229db..a666dda3bac4c 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.test.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.test.tsx
@@ -72,7 +72,7 @@ describe('OutputHealth', () => {
await waitFor(async () => {
expect(utils.getByTestId('outputHealthDegradedCallout').textContent).toContain(
- 'Unable to connect to "Remote ES" at https://remote-es:443. Please check the details are correct.'
+ 'Unable to connect to "Remote ES" at https://remote-es:443.Please check the details are correct.'
);
});
});
diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.tsx
index c26a122287d01..0d71bb075cf25 100644
--- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.tsx
+++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_health.tsx
@@ -51,7 +51,7 @@ export const OutputHealth: React.FunctionComponent = ({ output, showBadge
iconType="error"
data-test-subj="outputHealthDegradedCallout"
>
-
+
{i18n.translate('xpack.fleet.output.calloutText', {
defaultMessage: 'Unable to connect to "{name}" at {host}.',
values: {
@@ -59,7 +59,7 @@ export const OutputHealth: React.FunctionComponent = ({ output, showBadge
host: output.hosts?.join(',') ?? '',
},
})}
-
{' '}
+
{i18n.translate('xpack.fleet.output.calloutPromptText', {
defaultMessage: 'Please check the details are correct.',