From 4e00e50ca3b2caad7918aa1c61b722119503666a Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 18 Oct 2023 08:53:44 +0200 Subject: [PATCH] shell: Add dummy jump prop to host selector's CockpitNav The property is required, and from the component's PoV that is right as it gets called unconditionally. In the host selector we don't use jumps/links, but React's property check cannot know that. To quiesce these warnings, add a dummy jump property to the host selector instantiation. --- pkg/shell/hosts.jsx | 12 ++++++++++-- test/common/testlib.py | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/shell/hosts.jsx b/pkg/shell/hosts.jsx index f3d143b044f7..9250d2eba3bf 100644 --- a/pkg/shell/hosts.jsx +++ b/pkg/shell/hosts.jsx @@ -142,7 +142,7 @@ export class CockpitHosts extends React.Component { return null; } - // HACK: using HTMl rather than Select PF4 component as: + // HACK: using HTML rather than Select PF4 component as: // 1. It does not change the arrow when opened/closed // 2. It closes the dropdown even when trying to search... and cannot tell it not to render() { @@ -197,7 +197,15 @@ export class CockpitHosts extends React.Component { { this.state.opened && - true} filtering={this.filterHosts} current={label} /> + true} + filtering={this.filterHosts} + current={label} + jump={() => console.error("internal error: jump not supported in hosts selector")} + />
{this.props.machines.list.length > 1 && } diff --git a/test/common/testlib.py b/test/common/testlib.py index fc8500662f90..648a8436490b 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -1705,7 +1705,6 @@ def login_and_go(self, path: Optional[str] = None, user: Optional[str] = None, h # HACK: Fix these ASAP, these are major bugs "Warning: validateDOMNesting.*cannot appear as a", "Warning: Failed.*type.*prop Invalid prop", - "Warning: Failed.*type:.*is marked as required in.*but its value is `undefined`", "Warning: React does not recognize the.*prop on a DOM element", "Warning: .*prop on .* should not be null", # HACK: this should be fixed, it's completely expected on OSes without tracer