From e10a0c50e7a14fae983aa14e1c6b2ea9a54d097f Mon Sep 17 00:00:00 2001 From: Carlos Feria Date: Mon, 29 Jun 2026 19:12:12 +0200 Subject: [PATCH] fix: read-only banner, avoid rendering it while isLoading (#1114) (cherry picked from commit 99bd439f7c375038082370a54ff4e7de97fcd943) --- client/src/app/components/ReadOnlyButton.tsx | 17 ++---- .../ReadOnlyContext/ReadOnlyContext.test.tsx | 30 ++++++----- .../ReadOnlyContext/ReadOnlyContext.tsx | 4 +- .../ReadOnlyContext/ReadOnlyProvider.tsx | 7 +-- .../app/components/ReadOnlyContext/index.ts | 1 - .../app/components/ReadOnlyContext/utils.ts | 11 ---- client/src/app/layout/default-layout.test.tsx | 26 ++++++--- client/src/app/layout/default-layout.tsx | 54 +++++++++++-------- .../pages/advisory-list/advisory-table.tsx | 11 ++-- .../app/pages/importer-list/importer-list.tsx | 13 +++-- .../pages/sbom-groups/sbom-groups-table.tsx | 12 ++--- client/src/app/pages/sbom-list/sbom-table.tsx | 6 +-- .../src/app/pages/sbom-list/sbom-toolbar.tsx | 22 +++----- client/src/app/queries/trustifyInfo.ts | 7 +-- 14 files changed, 105 insertions(+), 116 deletions(-) delete mode 100644 client/src/app/components/ReadOnlyContext/utils.ts diff --git a/client/src/app/components/ReadOnlyButton.tsx b/client/src/app/components/ReadOnlyButton.tsx index 9c085a06d..59e9dbd47 100644 --- a/client/src/app/components/ReadOnlyButton.tsx +++ b/client/src/app/components/ReadOnlyButton.tsx @@ -1,20 +1,11 @@ import React from "react"; -import { Button, type ButtonProps, Tooltip } from "@patternfly/react-core"; +import { Button, type ButtonProps } from "@patternfly/react-core"; -import { READ_ONLY_TOOLTIP, ReadOnlyContext } from "./ReadOnlyContext"; +import { ReadOnlyContext } from "./ReadOnlyContext"; -/** Button that is automatically aria-disabled with a tooltip when the instance is in read-only mode. */ export const ReadOnlyButton: React.FC = (props) => { - const { isReadOnly } = React.useContext(ReadOnlyContext); + const { areMutationsDisabled } = React.useContext(ReadOnlyContext); - if (isReadOnly) { - return ( - -