Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/auto-pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
dotnet test test/UnitTest --collect:"XPlat Code Coverage"

- name: Upload to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: BB
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
dotnet test test/UnitTest --collect:"XPlat Code Coverage"

- name: Upload to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ private async Task OnClickCancel(UploadFile item)
private string? GetFileFormatClassString(UploadFile item)
{
var builder = CssBuilder.Default("file-icon");
var fileExtension = Path.GetExtension(item.OriginFileName ?? item.FileName);
var fileExtension = Path.GetExtension(item.GetFileName());
if (!string.IsNullOrEmpty(fileExtension))
{
fileExtension = fileExtension.ToLowerInvariant();
var icon = OnGetFileFormat?.Invoke(fileExtension) ?? GetFileExtensions(fileExtension);
builder.AddClass(icon);
}
var icon = OnGetFileFormat?.Invoke(fileExtension) ?? GetFileExtensions(fileExtension);
builder.AddClass(icon);
return builder.Build();
}

private string? GetFileExtensions(string? fileExtension) => fileExtension switch
private string? GetFileExtensions(string fileExtension) => fileExtension switch
{
".csv" or ".xls" or ".xlsx" => FileIconExcel,
".doc" or ".docx" or ".dot" or ".dotx" => FileIconDocx,
Expand Down
2 changes: 1 addition & 1 deletion test/UnitTest/Components/UploadButtonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ public void ButtonUpload_OnGetFileFormat_Ok()
new() { FileName = "1.doc" },
new() { FileName = "1.docx" },
new() { FileName = "1.dot" },
new() { FileName = "1.dotx" },
new() { FileName = "1.ppt" },
new() { FileName = "1.pptx" },
new() { FileName = "1.wav" },
Expand Down Expand Up @@ -397,7 +398,6 @@ public void ButtonUpload_OnGetFileFormat_Ok()
cut.Contains("fa-file-archive");
cut.Contains("fa-file-text");
cut.Contains("fa-file-image");
cut.Contains("fa-file-archive");
cut.Contains("fa-file");

cut.SetParametersAndRender(pb =>
Expand Down