| Summary: | The "Add layer" button in the import layer page is always disabled | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Toaster | Reporter: | Belen Barros Pena <belen.barros.pena> |
| Component: | toaster | Assignee: | Michael Wood <michael.g.wood> |
| Status: | VERIFIED FIXED | QA Contact: | Libertad <libertad.gonzalez.de.la.cruz> |
| Severity: | normal | ||
| Priority: | Medium | CC: | belen.barros.pena, brian.avery, david.reyna, davidx.lopez.barriba, jessica.zhang, libertad.gonzalez.de.la.cruz, michael.g.wood, stanciux.mihail |
| Version: | 2.2 | ||
| Target Milestone: | 2.2 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Belen Barros Pena
2016-07-14 12:56:15 UTC
Comment from Michael Wood: "that bug with the layer dependencies in the import layer page is because the typeahead isn't populating layerDepsChoices which is what is checked to see if you've selected a valid choice" Also from Michael:
"the event for the new typehead is .on("typeahead:select", .. instead of "typeahead-choices-change'. if you changed that, and added the button toggle disabled/enabled that might be it"
*** Bug 10042 has been marked as a duplicate of this bug. *** The current "typeahead-choices-change" method does not work, as Michael observed.
If I replace with this function, then selecting a layer from the typeahead list will safely enable the "Add" button, and disable it when the user manually changes the edit box.
// when a typeahead choice is selected, enabling the "Add layer" button
// since we know for sure this is a valid layer
layerDepInput.on("typeahead:select", function (event, data) {
if (data.name) {
layerDepBtn.removeAttr("disabled");
}
});
What I cannot yet figure out is how to fetch the active list of lookahead layer names from the widget, so that I can test against that list when the layerDepInput.on("input change",...) is invoked - doing what "typeahead-choices-change" was supposed to provide.
Patch submitted for review to the toaster mailing list https://lists.yoctoproject.org/pipermail/toaster/2016-August/005131.html http://git.yoctoproject.org/cgit/cgit.cgi/poky/atom/8df56061f63b63b77a0c7a7ddd75812e3b5a88c4 Fix regression introduced by switching typeahead library. Make sure we enable and disable the add button based on whether the selection event has fired or not. [YOCTO #9936] (Bitbake rev: cfef79e98b023252cd116d6cc4f90d261d47d13f) Verified on commit : 4b94b498e21aeba945fe7e72a6b7c4bb0314fb83 works ok |