From 1d6218cb7d3e4f76cc8399482e644e7afc4baf48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Mon, 27 Jul 2026 14:51:08 +0200 Subject: [PATCH] Disable row selection for non-lockable documents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Public / already-authorized and already-requested rows could be ticked even though they never contribute to "Request Access (N)", making the selection count look inconsistent with the CTA. Restrict selection to locked rows: their checkbox is disabled otherwise, and "Select all" now picks only the lockable rows. Signed-off-by: Émile Ré --- .../src/pages/documents/_components/DocumentEntry.tsx | 10 ++++++++-- .../documents/_components/DocumentsSelectionBar.tsx | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/compliance-portal/src/pages/documents/_components/DocumentEntry.tsx b/apps/compliance-portal/src/pages/documents/_components/DocumentEntry.tsx index 821e06382..7f69d0cff 100644 --- a/apps/compliance-portal/src/pages/documents/_components/DocumentEntry.tsx +++ b/apps/compliance-portal/src/pages/documents/_components/DocumentEntry.tsx @@ -66,6 +66,11 @@ export function DocumentEntry({ }: DocumentEntryProps) { const { t } = useTranslation("documents"); + // Only locked rows (not yet authorized, no pending request) can be requested, + // so only they are selectable — the checkbox is disabled otherwise to avoid a + // selection that wouldn't contribute to "Request Access". + const selectable = !isAuthorized && !requested; + const mobileHitLabel = requested ? null : isAuthorized @@ -84,8 +89,9 @@ export function DocumentEntry({ // triggers the row's view / request-access activation. )} diff --git a/apps/compliance-portal/src/pages/documents/_components/DocumentsSelectionBar.tsx b/apps/compliance-portal/src/pages/documents/_components/DocumentsSelectionBar.tsx index 684535de3..dd577090b 100644 --- a/apps/compliance-portal/src/pages/documents/_components/DocumentsSelectionBar.tsx +++ b/apps/compliance-portal/src/pages/documents/_components/DocumentsSelectionBar.tsx @@ -68,7 +68,7 @@ export function DocumentsSelectionBar({ entries }: DocumentsSelectionBarProps) {