-
Notifications
You must be signed in to change notification settings - Fork 101
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
Refactor AddResourcesListener and Tooltips #347
Conversation
I just added another refactoring to this PR. However, in retrospect I saw that in some cases |
I just observed, that |
I just tried to add an ajax listener to remove the tooltips to fix #220 and #323, but somehow this got snowballed with every ajax request, if it was added in While fixing this I discovered strange behaviour of |
f6787da
to
49e4a74
Compare
The last commit I added(49e4a74) fixed the #325 related bug, which happened because PrimeFaces components seem to be duplicated. I also solved the problem from the entry post and could replace two similar addResource methods by a generic one. There's only one TODO left, before I consider this PR complete: There's still a nested if statement I marked as TODO in 49e4a74 I'd like to combine, but I'm not sure if that is actually correct as it stands, because it looks like the second statement always yields true if the first did as well. |
I just cleared the last open point on my list, but I would like someone to review my latest change (e6e4e46). @stephanrauh maybe? The old statement looked kind of odd. It seems like it always evaluates to true anyways, what is this needed for? Do we even need those checks? Otherwise I would declare this PR done... before it get's an big ugly abomination of changes I stitched together :O |
425021a
to
178477a
Compare
made yes / no checks more readable and fixed case errors extracted methods to reduce boilerplate code reduced nesting levels fixed typos
- remove useless isProduction parameter - add default values to shouldLibraryBeLoaded - simplification of nested ifs - extract Comparator into its own class - fix TheCoder4eu#325 with PrimeFaces components - replace AddResourceToHeadButAfterJQuery by generic method
Whow! That's a huge one! I'm starting to test and merge this PR. |
It would look smaller, if I wouldn't have named all the little changes I did and put them into separate commits though. I've tested most of this for two weeks now, so I'm rather confident that everything is going to be ok ;) Thanks for testing! |
The AddResourcesListener currently is a bit long and contains a lot of boilerplate code, therefore I made some refactorings.
However, this is still WIP, so probably shouldn't be merged yet. For exampleaddJavascript
is still too long (220 lines for a single method) and theComparator
could be moved into an own class.I just hoped to get some feedback (since it's getting late), e.g. on the difference betweenaddResourceToHeadButAfterJQuery
andaddBasicJSResource
. I couldn't spot any other than the different resource keys, but somehow I couldn't just get it to run with my extractedaddResource
method. The first seems to fail whereby the latter doesn't, so I just keptaddResourceToHeadButAfterJQuery
in place until I found the difference.Changes: