-
Notifications
You must be signed in to change notification settings - Fork 98
Removing tight coupling in recipe-editing vue components #386
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
Removing tight coupling in recipe-editing vue components #386
Conversation
4a7f62a
to
fe1a2cd
Compare
fe1a2cd
to
e37dc44
Compare
Hey, and sorry for the delay. I'm afraid I don't have quite enough time to review all the Vue-related pull requests at the moment, but one of the great things about Vue is that it's easy to grasp. @seyfeb probably can do it just as well as I at this point. There is one thing that caught my attention. Some of the components have a prop named 'value' that is not explicitly passed down to the component from the parent. I can only assume this is an implicit feature that binds the v-model attribute to the value prop and as such is probably just fine. My personal design philosophy, however, has been to always avoid implicity for a number of reasons (it relies on features that may change, it may behave unexpectedly in edge scenarios, the code is harder to read or requires intimate familiarity with the framework etc.), and am happy that Nextcloud is (probably) deprecating jQuery in the near future. One potential issue is that if we have to add another input element to one of the components in question, someone has to decide which of them carries the "primary" value and which is only a secondary one. In the end of the day it's still just a matter of taste, but something to think about nevertheless. Bottom line: I think moving away from tight coupling is the right way to go and if these changes work in a test environment, I'd say go for it. Sorry that I can't devote the time for a proper review right now. |
tl;dr I’m going to explicitly state which property is used by the Thank you @sam-19, for your comments! Regarding v-model some thoughts from my side:
|
e37dc44
to
28c7501
Compare
Codecov Report
@@ Coverage Diff @@
## master #386 +/- ##
========================================
Coverage 0.91% 0.91%
Complexity 414 414
========================================
Files 13 13
Lines 1307 1307
========================================
Hits 12 12
Misses 1295 1295
Flags with carried forward coverage won't be shown. Click here to find out more. |
0f6bb4b
to
3d154bf
Compare
3d154bf
to
310ced8
Compare
Another thing I found just now: When creating a new recipe from scratch the nutrition settings are hidden. Saving and reopening for editing allows to set them correctly. |
Thank you for the feedback. It seems like the rebase didn’t go as smooth as hoped. The problems you found should be fixed now, @christianlupus ! |
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
ac17a5b
to
ecc40bb
Compare
I noticed that the editing components (
EditInputField
,EditInputGroup
, etc.) are tightly coupled withRecipeEdit
due to the references from the child to the parent component. As an example, look at theEditInputField
component which sets a field in the$parent
.In this PR I removed the tight coupling which should allow/lead to
@sam-19 Could you have a look at this?