gristlabs_grist-core/app/client
Alex Hall bf271c822b (core) Copy column type and options when pasting into an empty column
Summary:
Adds a `data-grist-col-ref` attribute to the copied HTML, then uses that when pasting to look up the source column and retrieve info about it. Copies the info into the target column if:

- The document is the same (the docId hash matches)
- The source column still exists and has the same type as when copied
- The source type isn't Text, because in that case it's nice if type guessing still happens
- The target column is empty, meaning it has type Any (we check earlier that it's not a formula column)

The info copied is the type, widgetOptions, and reference column settings (visible and display columns) but not conditional formatting.

The changes are mostly in a function `parsePasteForView` which is based on `BaseView._parsePasteForView` but ported to TypeScript in a new file `BaseView2.ts`.

Added a useraction `MaybeCopyDisplayFormula` exposing an existing Python function `maybe_copy_display_formula` because the target column needs a slightly different display formula.

Test Plan: Added a new nbrowser test file and fixture doc.

Reviewers: cyprien

Reviewed By: cyprien

Subscribers: jarek, dsagal

Differential Revision: https://phab.getgrist.com/D3344
2022-04-04 14:53:16 +02:00
..
aclui (core) add a user.SessionID value for trigger formulas and granular access rules 2022-02-22 12:50:43 -05:00
components (core) Copy column type and options when pasting into an empty column 2022-04-04 14:53:16 +02:00
lib (core) Copy column type and options when pasting into an empty column 2022-04-04 14:53:16 +02:00
models (core) Add new Grist login page 2022-04-01 15:24:19 -07:00
ui (core) Add new Grist login page 2022-04-01 15:24:19 -07:00
ui2018 (core) Conditional formatting rules 2022-03-23 13:15:02 +01:00
widgets (core) Don't treat Attachments as RefList in creator panel 2022-04-01 22:10:22 +02:00
accountMain.ts (core) Enable MFA configuration (and add SMS) 2022-01-19 13:55:54 -08:00
app.css (core) Make mobile the default mode. 2021-02-25 11:31:43 -05:00
app.js (core) Disable bfcache for all browsers 2021-11-24 09:47:00 -08:00
browserCheck.ts (core) fix browser check and favicon in grist-core 2022-01-05 18:15:05 -05:00
declarations.d.ts (core) Conditional formatting rules 2022-03-23 13:15:02 +01:00
errorMain.ts (core) Enable MFA configuration (and add SMS) 2022-01-19 13:55:54 -08:00
exposeModulesForTests.js (core) Some cleanup: remove old unused modules. 2020-11-20 11:23:20 -05:00
logo.css (core) Cleanup removing some old unused files, fixing logo.css, and removing #grist-app. 2020-10-09 17:04:09 -04:00
tsconfig.json (core) Migrate to SRP and add change password dialog 2022-03-16 21:35:06 -07:00