Skip to content
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: file asset v2 [WPB-16104] #18749

Merged
merged 10 commits into from
Feb 17, 2025
Merged

feat: file asset v2 [WPB-16104] #18749

merged 10 commits into from
Feb 17, 2025

Conversation

olafsulich
Copy link
Contributor

@olafsulich olafsulich commented Feb 14, 2025

TaskWPB-16104 [Web] File assets card

Description

New file asset based on the #18692. The logic mostly remained the same as it was before.

Demo

Uploaded:

image

Uploading:

image

Error:

image

File sharing restricted:

image

Checklist

  • mentions the JIRA issue in the PR name (Ex. [WPB-XXXX])
  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

@olafsulich olafsulich marked this pull request as ready for review February 14, 2025 12:16
@olafsulich olafsulich requested review from otto-the-bot and a team as code owners February 14, 2025 12:16
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 2.70270% with 36 lines in your changes missing coverage. Please review.

Project coverage is 45.59%. Comparing base (dfe1d68) to head (c2654a8).
Report is 15 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #18749      +/-   ##
==========================================
- Coverage   45.65%   45.59%   -0.06%     
==========================================
  Files         968      974       +6     
  Lines       27937    27977      +40     
  Branches     6302     6312      +10     
==========================================
+ Hits        12754    12757       +3     
- Misses      13594    13628      +34     
- Partials     1589     1592       +3     

Comment on lines +43 to +46
const formattedName = transferNames[transferState as keyof typeof transferNames] ?? name;

return {
name: formattedName,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think You can return directly, because You not reusing this :) And we don't want to support canceled? WE don't display anything if it's canceled ?

Suggested change
const formattedName = transferNames[transferState as keyof typeof transferNames] ?? name;
return {
name: formattedName,
return {
name: transferNames[transferState as keyof typeof transferNames] ?? name,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's necessary - if someone cancels they know what they're doing, and they don't need additional "feedback" on the screen.

Currently, we don't have it, so I'll leave it as it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And when it comes to having the variable or not, it's a matter of preference I think - let me leave it like that, for more "complex" syntax, I rather have it separated

AssetTransferState.UPLOAD_PENDING,
AssetTransferState.UPLOADING,
AssetTransferState.DOWNLOADING,
].includes(assetStatus as AssetTransferState);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... smth wrong is here.. assetStatus should be AssetTransferState, So You don't have to assert this type as, could You check this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah, the condition above was wrong, it's fixed now

@olafsulich olafsulich merged commit 3176f63 into dev Feb 17, 2025
15 checks passed
@olafsulich olafsulich deleted the feat/file-asset-v2 branch February 17, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants