gristlabs_grist-core/app/client/lib
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
..
ACIndex.ts
ACSelect.ts
autocomplete.ts
browserGlobals.js
browserInfo.ts
chartUtil.ts
copyToClipboard.ts
CustomSectionElement.ts
dblclick.ts
Delay.ts
dispose.d.ts
dispose.js
DocPluginManager.ts
dom.js
domAsync.ts
download.js
FocusLayer.ts
formUtils.ts (core) Migrate to SRP and add change password dialog 2022-03-16 21:35:06 -07:00
fromKoSave.ts
guessTimezone.ts
helpScout.ts (core) Reopen HelpScout beacon to the last-opened article 2022-03-31 14:54:55 -04:00
HomePluginManager.ts
imports.d.ts
imports.js
ImportSourceElement.ts
koArray.d.ts
koArray.js
koArrayWrap.ts
koDom.js
koDomScrolly.css
koDomScrolly.js
koForm.css
koForm.js
koSession.js
koUtil.js (core) Conditional formatting rules 2022-03-23 13:15:02 +01:00
loadScript.js
localStorageObs.ts (core) New UI for raw data views 2022-03-12 13:51:48 +01:00
log.ts
Mousetrap.js
multiselect.css
multiselect.js
ObservableMap.js
ObservableSet.js
ReferenceUtils.ts
SafeBrowser.ts
SafeBrowserProcess.css
sessionObs.ts
sortUtil.ts
tableUtil.ts (core) Copy column type and options when pasting into an empty column 2022-04-04 14:53:16 +02:00
testState.ts
textUtils.ts
TokenField.ts
uploads.ts
UrlState.ts