-
Notifications
You must be signed in to change notification settings - Fork 88
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: preview files #1945
feat: preview files #1945
Conversation
- download and preview file for a campaign application - create a UploadedFilesList component that takes the fetch and delete query and labels and shows a list of uploaded files with download/preview/delete actions
✅ Tests will run for this PR. Once they succeed it can be merged. |
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.
I love the preview feature.
We can integrate the same in the campaign reports later.
return ( | ||
<UploadedFilesList | ||
files={files} | ||
downloadQuery={(f) => fetchCampaignApplicationFile(f.id, session).then((r) => r.data)} |
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.
maybe we should use await, insead of .then()
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.
Help me understand what makes the async
way preferable here? Can we agree it does the same thing in the end or did I miss something?
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.
@slavcho ^^^
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.
Sure - I will merge it although I don't agree with it.
Following the project style and guidelines makes the code easier to read and understand.
CamelCase and snake_case are both good naming conventions, yet merging them is not a good idea.
return blobUrls[file.id] | ||
} else { | ||
return downloadQuery(file) | ||
.then((blob) => { |
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.
same here...
file-preview-small.mp4