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

fix(sheet): support bind delete & date type source #4487

Merged
merged 8 commits into from
Jan 16, 2025

Conversation

VicKun4937
Copy link
Contributor

@VicKun4937 VicKun4937 commented Jan 15, 2025

  • support delete bind path when delete cell

image

const fWorkbook = univerAPI.getActiveWorkbook();
const fSheet = fWorkbook.getActiveSheet();

const source = fWorkbook.createSource(univerAPI.Enum.DataBindingNodeTypeEnum.Object);
source.setSourceData({
    user: {
        name: '猿婶'
    }
})

fSheet.setBindingNode({
    row: 1,
    column: 2,
    path: 'user.name',
    type: univerAPI.Enum.DataBindingNodeTypeEnum.Object,
    sourceId: source.getId()
})

const listSource = fWorkbook.createSource(univerAPI.Enum.DataBindingNodeTypeEnum.List, false);
listSource.setSourceData({
    fields: ['商品', '种类','日期'],
    records: [['苹果', '水果', 1736942545041], ['香蕉', '水果',1736942545041], ['圆珠笔', '文具',1736942545041]]
})
fSheet.setBindingNode({
    row: 1,
    column: 4,
    path: '商品',
    type: univerAPI.Enum.DataBindingNodeTypeEnum.List,
    sourceId: listSource.getId()
})

fSheet.setBindingNode({
    row: 1,
    column: 5,
    path: '种类',
    type: univerAPI.Enum.DataBindingNodeTypeEnum.List,
    sourceId: listSource.getId()
})
fSheet.setBindingNode({
    row: 1,
    column: 6,
    path: '日期',
    type: univerAPI.Enum.DataBindingNodeTypeEnum.List,
    sourceId: listSource.getId(),
    isDate:true,
})

Copy link

github-actions bot commented Jan 15, 2025

View Deployment

📑 Examples 📚 Storybook
🔗 Preview link 🔗 Preview link

Copy link

github-actions bot commented Jan 15, 2025

Playwright test results

passed  23 passed

Details

stats  23 tests across 10 suites
duration  5 minutes, 8 seconds
commit  a45a662
info  For more information, see full report

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 120 lines in your changes missing coverage. Please review.

Project coverage is 32.79%. Comparing base (7957d95) to head (a45a662).
Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
...-source-binding/src/controllers/binding-manager.ts 0.00% 34 Missing ⚠️
...al/sheets-source-binding/src/model/source-model.ts 0.00% 31 Missing ⚠️
...s-source-binding/src/controllers/source-manager.ts 0.00% 24 Missing ⚠️
...tal/sheets-source-binding/src/facade/f-workbook.ts 0.00% 14 Missing ⚠️
...rce-binding/src/services/source-binding-service.ts 0.00% 9 Missing ⚠️
...l/sheets-source-binding/src/model/binding-model.ts 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4487      +/-   ##
==========================================
- Coverage   32.82%   32.79%   -0.03%     
==========================================
  Files        2595     2595              
  Lines      133973   134075     +102     
  Branches    29805    29820      +15     
==========================================
  Hits        43975    43975              
- Misses      89998    90100     +102     

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

@VicKun4937 VicKun4937 requested a review from weird94 as a code owner January 15, 2025 09:25
@univer-bot
Copy link

univer-bot bot commented Jan 15, 2025

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

Origin Title: fix(sheet): support bind delete & date type source

Title: fix(sheet): support bind delete & date type source


  • support delete bind path when delete cell

image

@VicKun4937 VicKun4937 force-pushed the feat-sheet-bind-delete branch from b293d60 to ae0e705 Compare January 15, 2025 13:25
@VicKun4937 VicKun4937 changed the title fix(sheet): support bind delete fix(sheet): support bind delete & date type source Jan 15, 2025
@VicKun4937 VicKun4937 force-pushed the feat-sheet-bind-delete branch from ae0e705 to b4233b8 Compare January 16, 2025 06:37
@VicKun4937 VicKun4937 force-pushed the feat-sheet-bind-delete branch from b4233b8 to bf00b2a Compare January 16, 2025 06:40
@VicKun4937 VicKun4937 merged commit 4aff7f7 into dev Jan 16, 2025
9 checks passed
@VicKun4937 VicKun4937 deleted the feat-sheet-bind-delete branch January 16, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants