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(facade): add Facade Worksheet row column API #3163

Merged
merged 9 commits into from
Aug 30, 2024

Conversation

Dushusir
Copy link
Member

@Dushusir Dushusir commented Aug 23, 2024

Facade Worksheet row/column API

API

  • insertRowAfter
  • insertRowBefore
  • insertRows
  • insertRowsAfter
  • insertRowsBefore
  • deleteRow
  • deleteRows
  • moveRows
  • hideRow
  • hideRows
  • unhideRow
  • showRows
  • setRowHeight
  • setRowHeights
  • setRowHeightsForced
  • insertColumnAfter
  • insertColumnBefore
  • insertColumns
  • insertColumnsAfter
  • insertColumnsBefore
  • deleteColumn
  • deleteColumns
  • moveColumns
  • hideColumn
  • hideColumns
  • unhideColumn
  • showColumns
  • setColumnWidth
  • setColumnWidths

How to test?

Use Google Sheets Apps Script to test whether the result of Univer is the same as Google Sheets. Reference https://developers.google.com/apps-script/reference/spreadsheet/sheet#methods

e.g.
Google Sheets Apps Script:

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];

// This inserts a row after the first row position
sheet.insertRowAfter(1);

image

Uniscript

const activeSheet = univerAPI.getActiveWorkbook()?.getActiveSheet()
activeSheet?.insertRowAfter(0);

image

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

Copy link

github-actions bot commented Aug 23, 2024

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 98.02372% with 5 lines in your changes missing coverage. Please review.

Project coverage is 28.78%. Comparing base (e293aca) to head (27b6c80).
Report is 21 commits behind head on dev.

Files with missing lines Patch % Lines
packages/facade/src/apis/sheets/f-worksheet.ts 98.79% 2 Missing ⚠️
...ts/src/commands/commands/move-rows-cols.command.ts 94.44% 2 Missing ⚠️
...der-controllers/header-resize.render-controller.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3163      +/-   ##
==========================================
+ Coverage   28.63%   28.78%   +0.15%     
==========================================
  Files        2025     2025              
  Lines      106970   107160     +190     
  Branches    23129    23149      +20     
==========================================
+ Hits        30629    30849     +220     
+ Misses      76341    76311      -30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dushusir Dushusir force-pushed the dushusir/worksheet-facade branch 3 times, most recently from 36fbe89 to 29d7b45 Compare August 27, 2024 02:29
@Dushusir Dushusir marked this pull request as ready for review August 27, 2024 12:53
@Dushusir Dushusir changed the title chore(formula): test formula convert chore(formula): add Facade Worksheet API Aug 27, 2024
@Dushusir Dushusir changed the title chore(formula): add Facade Worksheet API feat(facade): add Facade Worksheet API Aug 27, 2024
@Dushusir Dushusir added the qa:untested This PR is ready to be tested label Aug 27, 2024
@Dushusir Dushusir changed the title feat(facade): add Facade Worksheet API feat(facade): add Facade Worksheet row column API Aug 27, 2024
@zhaolixin7
Copy link

@Dushusir 1、有背景色时子修改行高失败,
2、无背景时再次执行时杭盖会被改变,预期不变
2024_8_28 15_55_06 video.webm

@Dushusir
Copy link
Member Author

Dushusir commented Aug 28, 2024

@Dushusir 1、有背景色时子修改行高失败, 2、无背景时再次执行时行高会被改变,预期不变 2024_8_28 15_55_06 video.webm

fixed

@univer-bot
Copy link

univer-bot bot commented Aug 28, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

@Dushusir 1. Modifying the row height fails when there is a background color. 2. The row height will be changed when executed again without a background, and the expectation remains unchanged [2024_8_28 15_55_06 video.webm](https://github.com/user- attachments/assets/3ffb1cb5-391a-4af0-bbec-5739c3c711fe)

fixed

@zhaolixin7 zhaolixin7 added the qa:verified This PR has already by verified by a QA and is considered good enough to be merge label Aug 28, 2024
@univer-bot univer-bot bot removed the qa:untested This PR is ready to be tested label Aug 28, 2024
Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

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

LGTM

@wzhudev wzhudev merged commit 7d903d7 into dev Aug 30, 2024
17 checks passed
@wzhudev wzhudev deleted the dushusir/worksheet-facade branch August 30, 2024 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qa:verified This PR has already by verified by a QA and is considered good enough to be merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants