Hi, I am very new to Javascript so excuse me if the question is obvious. I am working on Hue 4.9.0.
The functionality I want to add is sending saved queries to review.
To do that I added:
- ko.observable field reviewTitle in the notebook/notebook.js and in editor/notebook.js.
- sendToReview2 method in notebook/notebook.js which sends a post request handled in python.
- sendToReview1 method in NotebookViewModel.js and EditorViewModel.js.
- Another button right under “Save as…” named “Send to review”.
- After that a popup window (structured like “Save as”) for inputting review title. Change applied to editor_components.mako.
- In the popup window I set up a condition to check if the review title is not empty.
- “Send” button in the popup window is bound to sendToReview1 method.
Question
After pressing the button, sendToReview1 is not triggered, condition check is not working for reviewTitle as if the field is not recognized.
I get this error: “Unable to process binding “enable: function(){return $root.selectedNotebook().reviewTitle().length > 0 }”
Message: $root.selectedNotebook(…).reviewTitle is not a function”.
What could be the reason for a new field to not be recognized? Have I missed another file where I should add it?
I am not sure why it’s separated to Notebook/Editor for both ViewModel and Model classes - so I don’t know where exactly should I be adding new stuff.