Skip to content

feat(UniverSheet): improving data handling#347

Merged
ArgoZhang merged 11 commits intomasterfrom
refactor-sheet
Mar 4, 2025
Merged

feat(UniverSheet): improving data handling#347
ArgoZhang merged 11 commits intomasterfrom
refactor-sheet

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Mar 4, 2025

add Push command logic

Summary of the changes (Less than 80 chars)

简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号

This pull request includes several changes to the BootstrapBlazor.UniverSheet component, focusing on improving data handling, enhancing the plugin system, and updating CSS styles. The most important changes include modifying data push methods, enhancing the plugin's data handling capabilities, and updating CSS classes for better styling.

Data Handling Improvements:

Plugin Enhancements:

CSS Updates:

Version Update:

Localization Update:

Description

fixes #346

Customer Impact

Regression?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

[是否影响老版本]

Risk

  • High
  • Medium
  • Low

[Justify the selection above]

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Improve data handling in the UniverSheet component by modifying data push methods, enhancing the plugin system, and updating CSS styles. Also, update the project version and add new localization entries.

New Features:

  • Enhance the DefaultPlugin class to handle workbook data more effectively, including new methods setWorkbookData and getWorkbookData.
  • Add new localization entries for better support of Chinese language users.
  • Add new CSS classes for better styling and layout control.
  • Update CSS to include new utility classes for improved UI consistency.

@bb-auto bb-auto Bot added the enhancement New feature or request label Mar 4, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone Mar 4, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Mar 4, 2025

Reviewer's Guide by Sourcery

This pull request improves data handling, enhances the plugin system, updates CSS styles, updates the project version, and adds new localization entries to the BootstrapBlazor.UniverSheet component. The most important changes include modifying data push methods, enhancing the plugin's data handling capabilities, and updating CSS classes for better styling. The data handling improvements involve modifying the return type of PushDataAsync and updating the execute function to return data from pushData. The plugin enhancements include new methods setWorkbookData and getWorkbookData in the DefaultPlugin class. The CSS updates involve adding new CSS classes for better styling and layout control.

Sequence diagram for PushDataAsync execution

sequenceDiagram
  participant RazorComponent as UniverSheet.razor.cs
  participant JavaScript as UniverSheet.razor.js
  participant DataService as data-service.js
  participant Plugin as plugin.js

  RazorComponent->>JavaScript: InvokeAsync("execute", Id, data)
  activate JavaScript
  JavaScript->>DataService: univerSheet.pushData(data)
  activate DataService
  DataService->>Plugin: _callback(data) // data-service.js
  activate Plugin
  Plugin-->>DataService: return this.receiveData(data) // plugin.js
  deactivate Plugin
  DataService-->>JavaScript: return data // data-service.js
  deactivate DataService
  JavaScript-->>RazorComponent: return data // UniverSheet.razor.js
  deactivate JavaScript
Loading

Updated class diagram for DefaultPlugin

classDiagram
  class DefaultPlugin {
    - _dataService: DataService
    - _sheet: any
    + constructor()
    + onReady(): void
    + install(): void
    + receiveData(payload: any): any
    + setWorkbookData(data: string): void
    + getWorkbookData(): any
  }

  class DataService {
    + registerUniverSheet(sheet: any): void
  }

  DefaultPlugin -- DataService: uses
Loading

File-Level Changes

Change Details Files
Improved data handling in UniverSheet component by modifying data push methods and enhancing plugin's data handling capabilities.
  • Modified PushDataAsync to return UniverSheetData instead of Task.
  • Updated the execute function to return data from pushData.
  • Enhanced the DefaultPlugin class to handle workbook data more effectively, including new methods setWorkbookData and getWorkbookData.
  • Modified the registerUniverSheet method to return data from the callback.
src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.cs
src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js
src/components/BootstrapBlazor.UniverSheet/wwwroot/plugin.js
src/components/BootstrapBlazor.UniverSheet/wwwroot/data-service.js
Updated CSS styles for better styling and layout control.
  • Added new CSS classes for better styling and layout control.
  • Updated CSS to include new utility classes for improved UI consistency.
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer/css/univer-sheet.bundle.css
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer/css/univerjs.preset-sheets-drawing.css
Updated the project version.
  • Updated the project version from 9.0.0-beta01 to 9.0.0-beta02.
src/components/BootstrapBlazor.UniverSheet/BootstrapBlazor.UniverSheet.csproj
Added new localization entries for better support of Chinese language users.
  • Added new localization entries.
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer/js/univerjs.preset-sheets-core.locales.zh-CN.js

Assessment against linked issues

Issue Objective Addressed Explanation
#346 Implement push command logic for UniverSheet.
#346 Improve data handling in the UniverSheet component.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ArgoZhang ArgoZhang merged commit f54baa0 into master Mar 4, 2025
@ArgoZhang ArgoZhang deleted the refactor-sheet branch March 4, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(UniverSheet): improving data handling

2 participants