Skip to content

feat(UniverSheet): add WorkbookData on UniverSheetData#396

Merged
ArgoZhang merged 7 commits intomasterfrom
refactor-universheet
Mar 29, 2025
Merged

feat(UniverSheet): add WorkbookData on UniverSheetData#396
ArgoZhang merged 7 commits intomasterfrom
refactor-universheet

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Mar 29, 2025

Link issues

fixes #395

Summary By Copilot

This pull request includes several updates to the BootstrapBlazor.UniverSheet component, including a version bump, new properties for handling workbook data, and a refactor of the createUniverSheetAsync function. The most important changes are listed below:

Version update:

Enhancements to UniverSheetData class:

Refactor of createUniverSheetAsync function:

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

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

Add WorkbookData property to UniverSheetData and simplify workbook creation logic in UniverSheet component

New Features:

  • Introduced a new WorkbookData property in UniverSheetData to store workbook-specific data

Bug Fixes:

  • Refactored workbook creation to use a more straightforward approach

Enhancements:

  • Simplified the createUniverSheetAsync function to use workbookData directly
  • Added a separate Data property for custom business data

@bb-auto bb-auto Bot added the enhancement New feature or request label Mar 29, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Mar 29, 2025

Reviewer's Guide by Sourcery

This pull request introduces changes to the UniverSheet component. It adds WorkbookData and Data properties to the UniverSheetData class, refactors the createUniverSheetAsync function to use workboolData for workbook creation, and updates the component version.

Sequence diagram for createUniverSheetAsync function

sequenceDiagram
    participant Sheet
    participant UniverAPI

    Sheet->>Sheet: options.data
    alt workboolData exists
        Sheet->>UniverAPI: createWorkbook(workboolData)
    end
Loading

File-Level Changes

Change Details Files
Added new properties to the UniverSheetData class for handling workbook data and additional business data.
  • Added a WorkbookData property for storing workbook data.
  • Added a Data property for storing additional business data.
src/components/BootstrapBlazor.UniverSheet/Components/UniverSheetData.cs
Refactored the createUniverSheetAsync function to simplify workbook creation.
  • Modified the function to use workboolData from sheet.options.data to create the workbook.
  • Removed the conditional logic for handling different data structures.
  • Removed the code that parses the template from the data object.
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js
Updated the version of the BootstrapBlazor.UniverSheet component.
  • Bumped the version from 9.0.0 to 9.0.1.
src/components/BootstrapBlazor.UniverSheet/BootstrapBlazor.UniverSheet.csproj

Assessment against linked issues

Issue Objective Addressed Explanation
#395 Add WorkbookData property on UniverSheetData class.

Possibly linked issues


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

@bb-auto bb-auto Bot added this to the v9.2.0 milestone Mar 29, 2025
@ArgoZhang ArgoZhang requested a review from Copilot March 29, 2025 09:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the UniverSheet component by adding new properties for workbook and additional business data, along with a refactor to simplify workbook creation logic.

  • Bumped component version from 9.0.0 to 9.0.1.
  • Added WorkbookData and Data properties to UniverSheetData for workbook-specific and custom business data.
  • Refactored the createUniverSheetAsync function in univer.js to use a specific workbook data property.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js Refactored workbook creation logic to use a new workbook data property.
src/components/BootstrapBlazor.UniverSheet/Components/UniverSheetData.cs Added new WorkbookData and Data properties with updated documentation.
Files not reviewed (1)
  • src/components/BootstrapBlazor.UniverSheet/BootstrapBlazor.UniverSheet.csproj: Language not supported
Comments suppressed due to low confidence (1)

src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js:73

  • The property 'workboolData' appears to be a typo; consider renaming it to 'workbookData' for consistency with the UniverSheetData property.
const { workboolData } = sheet.options.data || {};

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @ArgoZhang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider renaming workboolData to workbookData in univer.js for consistency.
  • The new properties WorkbookData and Data in UniverSheetData are both of type object; consider using more specific types.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit 1e3c0b4 into master Mar 29, 2025
1 check passed
@ArgoZhang ArgoZhang deleted the refactor-universheet branch March 29, 2025 10:03
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): bump version 9.0.2

2 participants