From edefcc3b5bc3450996c0184713079608e2d612a5 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 20 Oct 2023 11:03:16 +0200 Subject: [PATCH] lib: Support non-string ModalError.dialogErrorDetail The Kdump dialog sets this to a `` aka. `
` element,
which cannot be a child of a `

`. However, we do need the `

` for plain strings according to the PF docs. So do a type check and support both cases. --- pkg/lib/cockpit-components-inline-notification.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/lib/cockpit-components-inline-notification.jsx b/pkg/lib/cockpit-components-inline-notification.jsx index a0cff583388f..94985ce22ef1 100644 --- a/pkg/lib/cockpit-components-inline-notification.jsx +++ b/pkg/lib/cockpit-components-inline-notification.jsx @@ -90,7 +90,7 @@ InlineNotification.propTypes = { export const ModalError = ({ dialogError, dialogErrorDetail, id, isExpandable }) => { return ( - { dialogErrorDetail &&

{dialogErrorDetail}

} + { typeof dialogErrorDetail === 'string' ?

{dialogErrorDetail}

: dialogErrorDetail } ); };