From 4e1a84bbd5cc53ec885d2ec6120ddaced8a22ec1 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 20 Dec 2025 04:15:21 +0000
Subject: [PATCH 1/3] Initial plan
From 1743606b9a27c7ee94c840580fb61925cff1be74 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 20 Dec 2025 04:24:04 +0000
Subject: [PATCH 2/3] Fix FileLocationDownload and FileLocationCopy onClick
handlers
The onClick handlers were incorrectly calling run directly instead of wrapping it.
Changed from onClick={() => requireLogin(run)} to onClick={() => requireLogin(() => run())}
so that requireLogin receives a proper callback function that will execute run().
---
.../components/FileLocationCopy/fileLocationCopy.tsx | 2 +-
.../components/FileLocationDownload/fileLocationDownload.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx
index 614106f2e..e673db893 100644
--- a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx
+++ b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx
@@ -30,7 +30,7 @@ export const FileLocationCopy = ({
action="Copy project matrix"
label={}
loading={isLoading}
- onClick={() => requireLogin(run)}
+ onClick={() => requireLogin(() => run())}
/>
);
};
diff --git a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx
index e5a77863d..f5be5216f 100644
--- a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx
+++ b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx
@@ -24,7 +24,7 @@ export const FileLocationDownload = ({
action="Download project matrix"
label={}
loading={isLoading}
- onClick={() => requireLogin(run)}
+ onClick={() => requireLogin(() => run())}
/>
>
From dd2ee749ba99e52591803f6f824801a06f8c697e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sat, 20 Dec 2025 05:10:51 +0000
Subject: [PATCH 3/3] Remove requireLogin wrapper from matrix download/copy
buttons
The requireLogin wrapper was preventing the buttons from functioning.
The useFileLocation hook's run() method should be called directly on click
to fetch the file location. Authentication is handled at the API level,
not at the button level.
---
.../components/FileLocationCopy/fileLocationCopy.tsx | 6 +-----
.../FileLocationDownload/fileLocationDownload.tsx | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx
index e673db893..cccb0d3e0 100644
--- a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx
+++ b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationCopy/fileLocationCopy.tsx
@@ -1,7 +1,6 @@
import { ButtonGroupButton } from "@databiosphere/findable-ui/lib/components/common/ButtonGroup/components/ButtonGroupButton/buttonGroupButton";
import { ContentCopyIconSmall } from "@databiosphere/findable-ui/lib/components/common/CustomIcon/common/constants";
import { useFileLocation } from "@databiosphere/findable-ui/lib/hooks/useFileLocation";
-import { useLoginGuard } from "@databiosphere/findable-ui/lib/providers/loginGuard/hook";
import copy from "copy-to-clipboard";
import { useEffect } from "react";
import { ProjectMatrixView } from "../../../../../../viewModelBuilders/azul/hca-dcp/common/projectMatrixMapper/entities";
@@ -16,9 +15,6 @@ export const FileLocationCopy = ({
const { url } = projectMatrixView;
const { fileUrl, isLoading, isSuccess, run } = useFileLocation(url);
- // Prompt user for login before download, if required.
- const { requireLogin } = useLoginGuard();
-
useEffect(() => {
if (fileUrl && isSuccess) {
copy(fileUrl);
@@ -30,7 +26,7 @@ export const FileLocationCopy = ({
action="Copy project matrix"
label={}
loading={isLoading}
- onClick={() => requireLogin(() => run())}
+ onClick={run}
/>
);
};
diff --git a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx
index f5be5216f..341adac5b 100644
--- a/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx
+++ b/app/components/Detail/components/GeneratedMatricesTables/components/FileLocationDownload/fileLocationDownload.tsx
@@ -2,7 +2,6 @@ import { FileDownloadButton } from "@databiosphere/findable-ui/lib/components/co
import { ButtonGroupButton } from "@databiosphere/findable-ui/lib/components/common/ButtonGroup/components/ButtonGroupButton/buttonGroupButton";
import { DownloadIconSmall } from "@databiosphere/findable-ui/lib/components/common/CustomIcon/common/constants";
import { useFileLocation } from "@databiosphere/findable-ui/lib/hooks/useFileLocation";
-import { useLoginGuard } from "@databiosphere/findable-ui/lib/providers/loginGuard/hook";
import { ProjectMatrixView } from "../../../../../../viewModelBuilders/azul/hca-dcp/common/projectMatrixMapper/entities";
export interface FileLocationDownloadProps {
@@ -15,16 +14,13 @@ export const FileLocationDownload = ({
const { fileName, url } = projectMatrixView;
const { fileUrl, isLoading, run } = useFileLocation(url);
- // Prompt user for login before download, if required.
- const { requireLogin } = useLoginGuard();
-
return (
<>
}
loading={isLoading}
- onClick={() => requireLogin(() => run())}
+ onClick={run}
/>
>