diff --git a/CHANGELOG.md b/CHANGELOG.md index c74c4ed0..2ead96bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- LogsModal now use a key so we can use logs not linked with a compute task (#270) + ## [0.46.0] - 2023-10-18 ### Added diff --git a/src/routes/tasks/components/ErrorAlert.tsx b/src/routes/tasks/components/ErrorAlert.tsx index f0f5008d..bed5f9dc 100644 --- a/src/routes/tasks/components/ErrorAlert.tsx +++ b/src/routes/tasks/components/ErrorAlert.tsx @@ -93,7 +93,11 @@ const ErrorAlert = ({ task }: { task: TaskT }): JSX.Element | null => { } /> - + ); } @@ -139,7 +143,11 @@ const ErrorAlert = ({ task }: { task: TaskT }): JSX.Element | null => { } /> - + ); } diff --git a/src/routes/tasks/components/LogsModal.tsx b/src/routes/tasks/components/LogsModal.tsx index b1f78e4b..bfaa6aac 100644 --- a/src/routes/tasks/components/LogsModal.tsx +++ b/src/routes/tasks/components/LogsModal.tsx @@ -14,7 +14,6 @@ import { import CopyIconButton from '@/features/copy/CopyIconButton'; import { API_PATHS, compilePath } from '@/paths'; -import { TaskT } from '@/types/TasksTypes'; import DownloadIconButton from '@/components/DownloadIconButton'; @@ -27,16 +26,16 @@ const CodeHighlighter = React.lazy( type LogsModalProps = { isOpen: boolean; onClose: () => void; - task: TaskT; + reportKey: string; }; -const LogsModal = ({ isOpen, onClose, task }: LogsModalProps) => { +const LogsModal = ({ isOpen, onClose, reportKey }: LogsModalProps) => { const initialFocusRef = useRef(null); const { logs, fetchingLogs, fetchLogs } = useTaskStore(); useEffect(() => { - fetchLogs(task.key); - }, [fetchLogs, task.key]); + fetchLogs(reportKey); + }, [fetchLogs, reportKey]); return ( { />