Skip to content

Conversation

@gparlakov
Copy link
Contributor

  • 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
file-preview-small.mp4

- 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
@github-actions
Copy link

github-actions bot commented Sep 28, 2024

✅ Tests will run for this PR. Once they succeed it can be merged.

@sashko9807 sashko9807 added the run tests Allows running the tests workflows for forked repos label Sep 29, 2024
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Sep 29, 2024
Copy link
Contributor

@slavcho slavcho left a 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)}
Copy link
Contributor

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()

Copy link
Contributor Author

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slavcho ^^^

Copy link
Contributor

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) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here...

@slavcho slavcho merged commit c87dcd4 into podkrepi-bg:master Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants