diff options
author | David Reyna <David.Reyna@windriver.com> | 2018-10-03 23:10:51 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-04 23:00:24 +0100 |
commit | fa8ade3695b836fb788c57c0d56b546b47f1603a (patch) | |
tree | 8f98535c7d73496867c2850012fd3d2cc2dc30fe /bitbake/lib/toaster/toastergui/static | |
parent | f0cf4b0972173d5463a31a2543098cee7d6e11c3 (diff) | |
download | poky-fa8ade3695b836fb788c57c0d56b546b47f1603a.tar.gz |
bitbake: toaster: custom image enable layer add, protect pre-cloned layers
When creating custom image recipes, the layer add for new layers
needs missing xhrLayerUrl data. Also, code is needed to check
and inform user if the newly added layer has not been cloned yet,
and provide helpful error message instead of the current frozen
dialog.
[YOCTO #12887]
(Bitbake rev: b310031972a53d0881a87a627f07bdcf7d9c6b79)
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 3 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 2e8863af26..f2c45c833e 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js | |||
@@ -275,7 +275,8 @@ var libtoaster = (function () { | |||
275 | 275 | ||
276 | function _addRmLayer(layerObj, add, doneCb){ | 276 | function _addRmLayer(layerObj, add, doneCb){ |
277 | if (layerObj.xhrLayerUrl === undefined){ | 277 | if (layerObj.xhrLayerUrl === undefined){ |
278 | throw("xhrLayerUrl is undefined") | 278 | alert("ERROR: missing xhrLayerUrl object. Please file a bug."); |
279 | return; | ||
279 | } | 280 | } |
280 | 281 | ||
281 | if (add === true) { | 282 | if (add === true) { |
diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js index dace8e3258..e55fffcef5 100644 --- a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js +++ b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | |||
@@ -25,6 +25,8 @@ function newCustomImageModalInit(){ | |||
25 | var duplicateNameMsg = "An image with this name already exists. Image names must be unique."; | 25 | var duplicateNameMsg = "An image with this name already exists. Image names must be unique."; |
26 | var duplicateImageInProjectMsg = "An image with this name already exists in this project." | 26 | var duplicateImageInProjectMsg = "An image with this name already exists in this project." |
27 | var invalidBaseRecipeIdMsg = "Please select an image to customise."; | 27 | var invalidBaseRecipeIdMsg = "Please select an image to customise."; |
28 | var missingParentRecipe = "The parent recipe file was not found. Cancel this action, build any target (like 'quilt-native') to force all new layers to clone, and try again"; | ||
29 | var unknownError = "Unexpected error: "; | ||
28 | 30 | ||
29 | // set button to "submit" state and enable text entry so user can | 31 | // set button to "submit" state and enable text entry so user can |
30 | // enter the custom recipe name | 32 | // enter the custom recipe name |
@@ -62,6 +64,7 @@ function newCustomImageModalInit(){ | |||
62 | if (nameInput.val().length > 0) { | 64 | if (nameInput.val().length > 0) { |
63 | libtoaster.createCustomRecipe(nameInput.val(), baseRecipeId, | 65 | libtoaster.createCustomRecipe(nameInput.val(), baseRecipeId, |
64 | function(ret) { | 66 | function(ret) { |
67 | showSubmitState(); | ||
65 | if (ret.error !== "ok") { | 68 | if (ret.error !== "ok") { |
66 | console.warn(ret.error); | 69 | console.warn(ret.error); |
67 | if (ret.error === "invalid-name") { | 70 | if (ret.error === "invalid-name") { |
@@ -73,6 +76,10 @@ function newCustomImageModalInit(){ | |||
73 | } else if (ret.error === "image-already-exists") { | 76 | } else if (ret.error === "image-already-exists") { |
74 | showNameError(duplicateImageInProjectMsg); | 77 | showNameError(duplicateImageInProjectMsg); |
75 | return; | 78 | return; |
79 | } else if (ret.error === "recipe-parent-not-exist") { | ||
80 | showNameError(missingParentRecipe); | ||
81 | } else { | ||
82 | showNameError(unknownError + ret.error); | ||
76 | } | 83 | } |
77 | } else { | 84 | } else { |
78 | imgCustomModal.modal('hide'); | 85 | imgCustomModal.modal('hide'); |