-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: add onBeforePasteCell
event to excel copy buffer
#1298
feat: add onBeforePasteCell
event to excel copy buffer
#1298
Conversation
I wasn't sure where to document this since there doesn't seem to be any kind of docs around for the CellExcelCopyManager. If you could point me to the proper place I'll update the docs as well. Furthermore, I'm again not sure in which example to add this so that I can write a couple of Cypress tests. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1298 +/- ##
========================================
+ Coverage 93.7% 95.5% +1.9%
========================================
Files 198 198
Lines 21317 21336 +19
Branches 7089 7093 +4
========================================
+ Hits 19956 20366 +410
+ Misses 1361 970 -391 ☔ View full report in Codecov by Sentry. |
@@ -345,6 +371,12 @@ export class SlickCellExternalCopyManager { | |||
} | |||
} | |||
|
|||
protected trigger<ArgType = any>(evt: SlickEvent, args?: ArgType, e?: Event | SlickEventData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this looks like a full copy of the trigger
method from SlickGrid, so perhaps we could just make the SlickGrid method as a public method and call it from here (and probably better to rename it as something like triggerEvent
, or any other name, to be a little more specific)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hesitant to ask for that but yep this would be my prefered solution as well
I do have a |
alright your mentioned feedback should be addressed wit hthe last commit. The last part would be to define which example to take. I thought I'd go with example19 and deny pasting on a couple of cells and a complete row to show off how it works. |
looking good, did you wanted me to merge it now or did you wanted to add the Example 19 changes in this PR? ohh I just noticed that |
just wanted to make sure no 19 is the right one. yep I'll address the unit tests along with the cypress tests. but thats gonna happen next year. wish you a great new year 🥳 |
hmmm cant figure out how to properly simulate copy & paste witb cypress. I've prepped the sample, although with a little linter issue. maybe you could take a look at how to achieve those e2e tests? |
There's a small build error preventing the Cypress to run, just changing As for the Copy+Paste, I found this article Handling Copy and Paste in Cypress on eggheade.io, he's using |
yep I've tried that but its not exactly doing whats expected since it works around the original browser paste behavior. I tried copying 3 consecutive cells and pasting them so that 2 cells are written but the 3rd overlaps with a blocked region. no matter what I tried I couldnt get it to perform the original browser behavior. so yeah I agree on skipping these. I'll later push the linter fix. |
note that I often have to use the |
@ghiscoding sry I've been sick the last two days and slowly recovering. I've fixed the linter issue and yeah I think we can go ahead and merge this, so that I can continue on my other branch |
hmm there is still an issue with coverage as it seems. need too check that. havent been able to notice which part is yet to be covered |
ok so it complains because I touched slickGrid.ts but it hasn't enough coverage I guess right? not sure that's something related to this PR, so from my side all fine and rdy for merge |
no problem there, I've completed full coverage of SlickDataView yesterday but SlickGrid coverage will take a while longer, so it's fine don't worry about it, Codecov is a bit weird when coverage is missing, it will display that coverage is missing for x lines if you did touch these lines even if coverage didn't actually change. Alright I'll go ahead and merge then, hopefully you recover soon, it's not a good year start but probably expected with all Christmas reunions 😅 |
onBeforePasteCell
event to excel copy buffer
This adds the ability to define on a per cell basis whether a paste should be denied or allowed.
It can be configured with the new excelCopyBufferOption:
This is going to be a pre-requisite for the Row Based Edit Plugin