-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui-debug): add download in original file format #2277
base: dev
Are you sure you want to change the base?
Conversation
9aca50f
to
49db115
Compare
* @param params - Parameters for reading the matrix | ||
* @param params.studyId - Unique identifier of the study | ||
* @param params.path - Path to the matrix file | ||
* @param params.format - Optional export format for the matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write @param [params.xxx] - ...
instead of writting "Optional"
For format
, header
and index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bracket notation is outdated and provides no value here since we rely on TypeScript interfaces to define optional parameters. Modern TypeScript/JSDoc doesn't use this syntax and you should only refer to Typescript to get this info
/** | ||
* Uploads a file to a study's raw storage, creating or updating it based on existence. | ||
* | ||
* !Note: This method currently uses a poorly named endpoint (/raw). The endpoint structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is more appropriate in the Python code or a ticket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the API's current structure is leading to problematic usage patterns in the frontend, so it's actually valuable to document this in the client code. but the kind of detailed API design discussion should be in a dedicated ticket yeah
setCurrentJson(fileRes.data); | ||
}, [fileRes.data]); | ||
|
||
const handleDownload = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it in the comment block
const handleDownload = async () => {
const file = await getRawFile(studyId, filePath);
downloadFile(file, filename);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok didn't know the DownloadButton
handles errors thanks it's better
@@ -24,23 +24,39 @@ import { downloadFile } from "../../../../../../utils/fileUtils"; | |||
import { useEffect, useState } from "react"; | |||
import { Filename, Flex, Menubar } from "./styles"; | |||
import UploadFileButton from "../../../../../common/buttons/UploadFileButton"; | |||
import { getRawFile } from "@/services/api/studies/raw"; | |||
|
|||
function Json({ filePath, filename, studyId, canEdit }: DataCompProps) { | |||
const [t] = useTranslation(); | |||
const { enqueueSnackbar } = useSnackbar(); | |||
const [currentJson, setCurrentJson] = useState<JSONEditorProps["json"]>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this state now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about this, I will check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setCurrentJson
still needed
webapp/src/components/App/Singlestudy/explore/Debug/Data/Text.tsx
Outdated
Show resolved
Hide resolved
webapp/src/components/App/Singlestudy/explore/Debug/Data/Text.tsx
Outdated
Show resolved
Hide resolved
webapp/src/components/App/Singlestudy/explore/Debug/Data/Unsupported.tsx
Outdated
Show resolved
Hide resolved
49db115
to
04e415e
Compare
No description provided.