-
Notifications
You must be signed in to change notification settings - Fork 22
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(#41): Camel preferences #192
Conversation
eab6331
to
b0a0415
Compare
packages/hawtio/src/plugins/camel/camel-preferences-storage-service.ts
Outdated
Show resolved
Hide resolved
packages/hawtio/src/plugins/camel/camel-preferences-storage-service.ts
Outdated
Show resolved
Hide resolved
packages/hawtio/src/plugins/camel/camel-preferences-storage-service.ts
Outdated
Show resolved
Hide resolved
packages/hawtio/src/plugins/camel/camel-preferences-storage-service.ts
Outdated
Show resolved
Hide resolved
And now I realise that this is only half of what #41 should implement. We also need to implement the consumer side of the preferences, since there should be consumers in the Camel plugin that uses these parameters to tune their logics. So, at least, the @phantomjinx @mmelko Are there any places in the Camel views you've implemented where the preferences parameters should be referred to but haven't been yet since the prefs hadn't been implemented yet? |
Yes, that's the latter half of the task. But it can be broad and some may be even yet to be implemented, we can work on it in a separate pull req. In this pull req, I think it's ok so long as the
No, you don't need it. As I explained before, we only need two reset buttons in the entire Hawtio console. One is to reset every setting except connections, and the other is to reset connections specifically. That's why I said
I don't see what it means. The old Hawtio has been having the two buttons and nothing changes at this point. One thing to note is that the old
Good point. Yes, please file another issue and let's tackle it separately. I agree it's good idea to restore the hints.
Possibly my suggestion above to consolidate parameters into a single json could mitigate the overuse of arrows here? I think if prettier makes it look boilerplate then it's already boilerplate... keeping them in single lines is just hiding the complexity, I guess. |
I asked @phantomjinx and he didn't realize if there were any component yet that consumed these settings, but I thought it was cool to ask in the PR as well to see if anyone had any more data. I'll leave the load functions for each preference as before but I'll modify the rest of "loads" to just use an object (I feel like in this case I can do a little more clever coding to ensure that we are always loading a whole object and making sure we don't overwrite any keys, should be simple enough). They should be readily available if something has to consume it :) |
I'll leave all the "load" functions as they are interfaced for now so they are available to be consumed. I'll create a separate issue after this one is merged so we can keep track this is yet to be implemented in the components.
oooooooooooooooooooooh, ok. Now I get it.
Done. #195 for traceability
It "should" in some cases. I'm going to be a bit more clever and just have a single function for the update of each input parameter instead of having them one by one. Most of the boilerplate comes from it actually, even though is configuration code. Btw, the issue about using arrow functions on the onDidSomethingChange functions and the issue about using arrow functions on the Checkbox components are different. The onDidSomethingChange functions will overwrite the this if I pass the function as argument :( (rather, the this is always the one on the environment the function is created. Using an arrow function ensures that the this is the one of the context where the arrow function was created) which is anoying, but is a JS thing. The checkbox one is about checkbox onChange prop having a different type signature than other inputs. Just fyi as I didn't put it very clearly when I made that comment Thank you for your input @tadayosi I'll be refinining this during the following hours |
Also, something that I forgot to add yesterday pertaining to #173 . This PR doesn't has the bug where the input gets unfocused every time I type. I'll be focusing on finishing this PR by now but I'll keep an eye and try to extract why in this case it works and not in the other component (when they are essentially the same as far as I see) |
bd2b269
to
9f6ff90
Compare
Well I just discovered that keyof exists and can be used as a type in a function signature and that makes the code SOOOO MUCH CLEANER. Finishing it up soon and re-requesting a review |
@tadayosi Refactored the class to be stored in an object. I optimized to reduce boilerplate and with the There are some places that might find a little unorthodox but it should make the code more legible and avoid the overuse of arrow functions. Tell me your thoughts :) |
d8bd3a2
to
4b22bc0
Compare
@tadayosi Everything has been addressed. Feel free to close the conversations when you check everything is ok :) |
This together with #191 completes #41
Notes:
I think that's all I will otherwise put another comment tomorrow