Skip to content

Commit

Permalink
feat: change logs endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
  • Loading branch information
SdgJlbl committed Feb 15, 2024
1 parent 3d1f648 commit 06d1f0f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- LogsModal now use a key so we can use logs not linked with a compute task (#270)
- Replace `function.function` by `function.archive` (#296)
- LogsModel now use the latest endpoint (#298)

## [0.46.0] - 2023-10-18

Expand Down
2 changes: 1 addition & 1 deletion src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const API_PATHS = {
INFO: '/info/',
LOGIN: '/me/login/?format=json',
LOGOUT: '/me/logout/',
LOGS: '/logs/:key/file/',
LOGS: '/task/:key/logs/',
METADATA: '/compute_plan_metadata/',
NEWS_FEED: '/news_feed/',
ORGANIZATIONS: '/organization/',
Expand Down
4 changes: 2 additions & 2 deletions src/routes/tasks/components/ErrorAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const ErrorAlert = ({ task }: { task: TaskT }): JSX.Element | null => {
<LogsModal
isOpen={isOpen}
onClose={onClose}
reportKey={task.function.key}
taskKey={task.key}

Check failure on line 99 in src/routes/tasks/components/ErrorAlert.tsx

View workflow job for this annotation

GitHub Actions / validate

Type '{ isOpen: boolean; onClose: () => void; taskKey: string; }' is not assignable to type 'IntrinsicAttributes & LogsModalProps'.
/>
</>
);
Expand Down Expand Up @@ -146,7 +146,7 @@ const ErrorAlert = ({ task }: { task: TaskT }): JSX.Element | null => {
<LogsModal
isOpen={isOpen}
onClose={onClose}
reportKey={task.key}
taskKey={task.key}

Check failure on line 149 in src/routes/tasks/components/ErrorAlert.tsx

View workflow job for this annotation

GitHub Actions / validate

Type '{ isOpen: boolean; onClose: () => void; taskKey: string; }' is not assignable to type 'IntrinsicAttributes & LogsModalProps'.
/>
</>
);
Expand Down
10 changes: 5 additions & 5 deletions src/routes/tasks/components/LogsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ type LogsModalProps = {
onClose: () => void;
reportKey: string;
};
const LogsModal = ({ isOpen, onClose, reportKey }: LogsModalProps) => {
const LogsModal = ({ isOpen, onClose, taskKey }: LogsModalProps) => {

Check failure on line 31 in src/routes/tasks/components/LogsModal.tsx

View workflow job for this annotation

GitHub Actions / validate

Property 'taskKey' does not exist on type 'LogsModalProps'.
const initialFocusRef = useRef(null);

const { logs, fetchingLogs, fetchLogs } = useTaskStore();

useEffect(() => {
fetchLogs(reportKey);
}, [fetchLogs, reportKey]);
fetchLogs(taskKey);
}, [fetchLogs, taskKey]);

return (
<Modal
Expand Down Expand Up @@ -72,9 +72,9 @@ const LogsModal = ({ isOpen, onClose, reportKey }: LogsModalProps) => {
/>
<DownloadIconButton
storageAddress={compilePath(API_PATHS.LOGS, {
key: reportKey,
key: taskKey,
})}
filename={`logs_${reportKey}`}
filename={`logs_${taskKey}`}
aria-label="Download logs"
variant="ghost"
/>
Expand Down

0 comments on commit 06d1f0f

Please sign in to comment.