Closed pkalita-lbl closed 7 months ago
Taking a look.
I could be wrong but there are no templates in DataHarmonizer right now that take "xsd:datetime" and "xsd:time" as ranges, only "date". That said the copy-paste function did work for me when testing ambr/AMBR
's "sample received date" slot, after picking a date in the control.
The edits look good, will merge.
@pkalita-lbl is there anything about how the HOT editors currently work which should also apply to the other editors we maintain in this codebase?
Thanks Patrick - it works great; and thx Ken for testing. I'll ensure the other cut/paste changes in mpox rename branch dataharmonizer.js are removed.
Hmm, there may be one lingering problem. When DH loads, do a paste into a date field. Then switch templates. I'm getting something that hopefully is easy to remedy in FlatpickrEditor.js:
Uncaught runtime errors:
×
ERROR
Cannot read properties of undefined (reading 'destroy')
TypeError: Cannot read properties of undefined (reading 'destroy')
at DateEditor.destroyElements (webpack-internal:///../lib/editors/FlatpickrEditor.js:88:13)
...
I could be wrong but there are no templates in DataHarmonizer right now that take "xsd:datetime" and "xsd:time" as ranges, only "date".
No you're right. NMDC uses datetimes though. Since this fix is in the FlatpickrEditor
base class it should apply to the date, datetime, and time cell editors.
is there anything about how the HOT editors currently work which should also apply to the other editors we maintain in this codebase?
Not that I'm aware of!
When DH loads, do a paste into a date field. Then switch templates. I'm getting something that hopefully is easy to remedy in FlatpickrEditor.js
Oops, yeah, I see. Sounds like a timing issue between when the HT instance is recreated for the new template and some asynchronous event callbacks get handled on the old editor. Should be straightforward to fix. I'll get a PR in shortly.
I believe this is the necessary fix to get keyboard copy and paste working for date/datetime cells. In HT 8.0.0 they introduced a new mechanism to identify which elements are "owned" by HT. Previously, when we were using HT 7.4.x, adding the
handsontableInput
class was sufficient. Now they use an attribute calleddata-hot-input
. See: https://github.com/handsontable/handsontable/issues/6383. Without this identification the right document-level event listeners aren't attached when those cells are selected prior to copying.Secondarily I updated the calls to a few HT helper methods to reflect the preferred ones in 13.1.x.
Lastly, unrelated to all of that I removed the erroneous
package-lock.json
file and updatedyarn.lock
to reflect the current dependencies. If we want to switch to usingnpm
for this project instead ofyarn
I have no strong feelings, but we shouldn't mix the two.