-
-
Notifications
You must be signed in to change notification settings - Fork 532
DataGrid: Export: Architecture, csv exporter, external binary data exporter #6067
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
Open
tesar-tech
wants to merge
12
commits into
master
Choose a base branch
from
dev/datagrid-export
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
25a7002
DataGrid Exporters - architecture, csv exporter, external binary data…
tesar-tech f61f768
Adds sources, reorganize export functionality.
tesar-tech 5c06267
Merge branch 'master' into dev/datagrid-export
stsrki 4b8f69f
IsSuccess to Success
tesar-tech 87d5f28
Binary and Text exporters rename
tesar-tech e62f35c
exporters to own project
tesar-tech 13a03e8
Merge branch 'master' into dev/datagrid-export
stsrki 8ac284c
Cleanup
stsrki 8c19dcd
Remove JSExportersModule and use JSUtilitiesModule
stsrki 4aad500
Comments
stsrki a2dec8d
Refactor file export options to consolidate 'FileName' properties and…
tesar-tech 6d828c2
Formating
stsrki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
Source/Extensions/Blazorise.DataGrid/Configuration/DataGridExportOptions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Blazorise.DataGrid; | ||
|
||
/// <summary> | ||
/// Specifies the number of rows to export from a data grid. | ||
/// </summary> | ||
public class DataGridExportOptions | ||
{ | ||
/// <summary> | ||
/// -1 means all rows | ||
/// </summary> | ||
public int NumberOfRows { get; init; } = -1; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Source/Extensions/Blazorise.Exporters.Bson/Blazorise.Exporters.Bson.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\..\Build\Blazorise.props" /> | ||
|
||
<PropertyGroup> | ||
<PackageTags>blazorise blazor exporter bson</PackageTags> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Blazorise\Blazorise.csproj" /> | ||
<ProjectReference Include="..\Blazorise.Exporters\Blazorise.Exporters.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="MongoDB.Bson" Version="3.3.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\..\LICENSE.md" Pack="true" Visible="false" PackagePath="" /> | ||
<None Include="..\..\..\NuGet\Blazorise.png" Pack="true" Visible="false" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
</Project> |
22 changes: 22 additions & 0 deletions
22
Source/Extensions/Blazorise.Exporters.Bson/BsonFileExportOptions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Blazorise.Exporters.Bson; | ||
|
||
/// <summary> | ||
/// Options for exporting files in BSON format, including file extension and MIME type. | ||
/// </summary> | ||
public class BsonFileExportOptions : FileExportOptions | ||
{ | ||
/// <summary> | ||
/// Represents the file extension for the object, initialized to 'bson'. | ||
/// </summary> | ||
public override string FileName { get; init; } = "exported-data.bson"; | ||
|
||
/// <summary> | ||
/// Represents the MIME type for BSON data format. It is initialized to 'application/bson'. | ||
/// </summary> | ||
public override string MimeType { get; init; } = "application/bson"; | ||
|
||
/// <summary> | ||
/// Indicates whether type information should be included. Defaults to true. | ||
/// </summary> | ||
public bool IncludeTypeInformation { get; init; } = true; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think we can add more options here
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.
That's a question. My idea was to keep it consistent with the "rich markup properties". Basically specify these in markup using column parameters - for example the
BaseDataGridColumn.Func<object, object> ExportValue
orExportHeader
,SupressExport
or similar.And keep the
DataGridExportOptions
only for the export itself (that cannot be specified per-column).The
ExportValue
is an ultimate customization that would have to be there anyway. And keeping the "column export customization" insideDataGridExportOptions
will duplicate the functionality in potentially confusing way.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 don't think adding them in markup makes much since we are already having an
Export()
method that works in an "imperative" way. So it is only natural that we want to expand onDataGridExportOptions
on what to actually export.