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

[IMP] clipboard: keep cell formatting when copy/pasting cells from one spreadsheet to another #4053

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rachico
Copy link

@Rachico Rachico commented Apr 11, 2024

[IMP] clipboard: keep cell formatting when copy/pasting cells from one spreadsheet to another

Problem

Currently, copy/pasting cells from one spreadsheet to another external spreadsheet removes all cell formatting and only keeps cell values. This is because the model clipboard is invalidated from one instance to another.

Solution

This commit solves the issue by adding a new custom type in the browser clipboard object and using the content saved in this key to re-create the cell formatting in the new spreadsheet.

Task: 3597039

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Apr 11, 2024

src/plugins/ui_stateful/clipboard.ts Outdated Show resolved Hide resolved
src/types/commands.ts Outdated Show resolved Hide resolved
src/types/commands.ts Outdated Show resolved Hide resolved
src/types/commands.ts Outdated Show resolved Hide resolved
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 5 times, most recently from 7a773c4 to 8f650d2 Compare April 15, 2024 09:43
@Rachico Rachico changed the title [IMP] Keep cell formatting when copy/pasting data from a spreadsheet to another [IMP] clipboard: keep cell formatting when copy/pasting data from a spreadsheet to another Apr 15, 2024
@Rachico Rachico changed the title [IMP] clipboard: keep cell formatting when copy/pasting data from a spreadsheet to another [IMP] clipboard: keep cell formatting when copy/pasting cells from a spreadsheet to another Apr 15, 2024
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 2 times, most recently from 0c59953 to c5c78c4 Compare April 15, 2024 14:21
@Rachico Rachico marked this pull request as ready for review April 15, 2024 14:21
@Rachico Rachico changed the title [IMP] clipboard: keep cell formatting when copy/pasting cells from a spreadsheet to another [IMP] clipboard: keep cell formatting when copy/pasting cells from one spreadsheet to another Apr 15, 2024
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 4 times, most recently from f2bee9d to 4c94ede Compare April 16, 2024 13:24
src/actions/menu_items_actions.ts Outdated Show resolved Hide resolved
tests/test_helpers/commands_helpers.ts Outdated Show resolved Hide resolved
src/plugins/ui_stateful/clipboard.ts Show resolved Hide resolved
src/plugins/ui_stateful/clipboard.ts Outdated Show resolved Hide resolved
src/plugins/ui_stateful/clipboard.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/test_helpers/commands_helpers.ts Outdated Show resolved Hide resolved
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 5 times, most recently from f9fcdec to b140631 Compare April 26, 2024 10:08
src/plugins/ui_stateful/clipboard.ts Outdated Show resolved Hide resolved
src/helpers/range.ts Outdated Show resolved Hide resolved
src/actions/menu_items_actions.ts Outdated Show resolved Hide resolved
src/actions/menu_items_actions.ts Outdated Show resolved Hide resolved
src/components/grid/grid.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
tests/clipboard/clipboard_plugin.test.ts Outdated Show resolved Hide resolved
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 2 times, most recently from e32b699 to 069cb8d Compare May 6, 2024 12:01
@Rachico Rachico requested a review from LucasLefevre May 6, 2024 12:02
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 2 times, most recently from d659d47 to 50546cf Compare May 8, 2024 08:34
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 7 times, most recently from f4daa3d to 61bf025 Compare May 14, 2024 18:25
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch 3 times, most recently from 07c4101 to 8870877 Compare May 15, 2024 10:54
…e spreadsheet to another

Currently, copy/pasting cells from one spreadsheet to another external spreadsheet removes all cell formatting and only keeps cell values. This is because the model clipboard is invalidated from one instance to another.

This commit solves the issue by adding a new custom type in the browser clipboard object and using the content saved in this key to re-create the cell formatting in the new spreadsheet.

Task: 3597039
@Rachico Rachico force-pushed the master-copy-paste-to-other-spreadsheets-mera branch from 8870877 to 557088a Compare May 15, 2024 11:23
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.

None yet

3 participants