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

[stable25] fix: paste tables into document #4326

Merged
merged 2 commits into from
Jun 22, 2023

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Jun 20, 2023

Manual backport of #4285.

Fixes #2708.

Try to read the first table row as headings.

Pasting works via insertContent while opening uses setContent. They use the schema in different ways.
So we also need to make sure to test both for some corner cases.

setContent is fairly flexible in turning the input into a valid document structure.
insertContent however fails to resolve structures that would require picking lower priority parent elements.

Note: Some tests in src/tests/nodes/Table.spec.js
fail when using insertContent instead of setContent. Pasting the correponding html table is fixed never the less.

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation is not required

@mejo- mejo- changed the title fix: paste tables into document [stable25] fix: paste tables into document Jun 20, 2023
@mejo- mejo- mentioned this pull request Jun 20, 2023
4 tasks
Copy link

@datenangebot datenangebot left a comment

Choose a reason for hiding this comment

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

Code looks good, but I don't have deeper knowledge here.

@cypress
Copy link

cypress bot commented Jun 20, 2023

1 flaky tests on run #10412 ↗︎

0 100 0 0 Flakiness 1

Details:

Merge f7833f6 into 01e73f1...
Project: Text Commit: db85f03270 ℹ️
Status: Passed Duration: 10:13 💡
Started: Jun 22, 2023 4:07 PM Ended: Jun 22, 2023 4:18 PM
Flakiness  cypress/e2e/sections.spec.js • 1 flaky test

View Output Video

Test Artifacts
Content Sections > Heading anchors > Anchor scrolls into view Output Screenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

Fixes #2708.

Try to read the first table row as headings.

Pasting works via `insertContent` while opening uses `setContent`.
They use the schema in different ways.
So we also need to make sure to test both for some corner cases.

`setContent` is fairly flexible in turning the input
into a valid document structure.
`insertContent` however fails to resolve structures
that would require picking lower priority parent elements.

Note: Some tests in src/tests/nodes/Table.spec.js
fail when using `insertContent` instead of `setContent`.
Pasting the correponding html table is fixed never the less.

Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Jonas <jonas@freesources.org>
@juliusknorr
Copy link
Member

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@juliusknorr juliusknorr merged commit 0a7c8de into stable25 Jun 22, 2023
@delete-merged-branch delete-merged-branch bot deleted the backport/4285/stable25 branch June 22, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants