-
-
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(plugin): new Row Based Editor #1323
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1323 +/- ##
========================================
+ Coverage 98.0% 99.4% +1.5%
========================================
Files 198 199 +1
Lines 21286 21571 +285
Branches 7098 7203 +105
========================================
+ Hits 20847 21429 +582
+ Misses 439 142 -297 ☔ View full report in Codecov by Sentry. |
ok I'm still not sure I really understand how to approach the i18n part. the mentioned function |
ah sorry that wasn't a good explanation, without looking at the patch you linked (I'm supposed to be off on Sundays ;)). So anyway, I'll assume you might be looking for code when the locale changes, below is the code that calls that. slickgrid-universal/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts Lines 733 to 752 in 1d759f7
So you probably need to add a method that will be called to from the callback above. If that is still not helping, just let me know and I'll take a proper look at the patch |
ok think I got it working. There was still a nasty bug with Cypress but I got a workaround to force drop the old cached items. |
} | ||
} | ||
|
||
& .active { |
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 think you missed that one when I mentioned it couple days ago, I mean just remove &
since it's not needed here
} | ||
} | ||
|
||
& .active { |
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.
same as previous, &
can be removed
this.gridOptions.rowBasedEditOptions?.actionButtons?.updateButtonTitleKey | ||
)) || | ||
this.gridOptions.rowBasedEditOptions?.actionButtons?.updateButtonTitle || | ||
'Update the Row'; |
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 see a lot of the same code repeated, perhaps we could migrate this to an external protected function? Something along these lines
protected getTitleOrDefault(key: string, defaultTitle: string) {
const actionBtnOptions = this.gridOptions.rowBasedEditOptions?.actionButtons;
const hasTranslateService = this.extensionUtility.translaterService?.translate;
// another approach might be to move the line above to GETTERs in the class?
return hasTranslateService ? actionBtnOptions[key] : defaultTitle;
}
this.btnUpdateTitle = this.getTitleOrDefault('updateButtonTitleKey', 'Update the Row');
I should probably do that in some other extensions like the GridMenu that I think I did something like you did and I think that this could make the code more readable.
this is out of context but, it's a nice story... so I keep adding unit tests for the core files and it's not exactly a fun exercise but I keep finding and fixing small bugs and also removed a bunch of unused/unreachable code. So it does seem to be worth the extra work (I'm now at 99.4% coverage, the end of the tunnel is in sight woohoo) |
yeah its great when you see that type of payoff. I wasnt able to invest time the last few days sadly but hope to manage it in the next few ones. |
ah yeah I saw the inference type you added, at first glance I thought it was a little overkill since it's only used once hahah but nonetheless it's quite powerful and you can't go wrong with that approach. Feel free to put it where you think is best, when I started the project, I used to create a file per interface but I see my folder is getting quite large now and lately, I started grouping some of them by feature depending on what it is. So you could add it to
|
yeah I'm a bit nervous when magic strings are floating around as my future self isn't that mindful of knowing what the intention was. So it serves as a real well gatekeeper to focus the type and be more expressive (all of that just to save one line of comment 🤣 ) Nevertheless the docs are now also added. A quick review on those would be very appreciated. |
You can override the styling, the hover text as well as whether a prompt — and with what text — should be shown. It is done by overriding the `actionButtons` property of the [plugins options](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/rowBasedEditOption.interface.ts). | ||
|
||
## Support for the Excel Copy Buffer Plugin | ||
If the [Excel Copy Buffer Plugin](grid-functionalities/excel-copy-buffer.md) is configured, the Row based edting pluging will override it's behavior by denying pastes on all cells not within a editmode row. Nevertheless, any existing `BeforePasteCellHandler` will be respected. |
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.
"the Row based edting pluging", the word "edting" has a typo
alright I think I got everything in that I've planned for. How do you want to proceed from here? |
looking good.... let's hit the Merge button 🚀 I think the next steps will be to replicate the new Example into the external repos (Angular-Slickgrid, ...), did you wanted to me to do that or did you wanted to do it too (for Angular I mean)? |
I can do so for Angular whenever you release slickgrid universal and bump it as dependency in Angular-slickgrid. |
this adds the new row based edit plugin
closes #1299