From cfc22d3a9e2434fb5b9001850c19617dda6d57aa Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Tue, 19 Apr 2016 17:28:41 +0100 Subject: bitbake: toaster: only prevent duplicate custom image names within a project We currently prevent the same name being used for multiple custom images, but make the check across all projects. This means that custom image names have to be unique across all projects in the Toaster installation. Modify how we validate the name of a custom image so that we only prevent duplication of custom image names within a project, while ensuring that the name of a custom image doesn't duplicate the name of a recipe which is not a custom image recipe. [YOCTO #9209] (Bitbake rev: 9abbb46e799c06757e03addd54e3f5d3c0fe2886) Signed-off-by: Elliot Smith Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/static/js') diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js index 328997af3b..98e87f4a6b 100644 --- a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js +++ b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js @@ -9,6 +9,8 @@ function newCustomImageModalInit(){ var nameInput = imgCustomModal.find('input'); var invalidMsg = "Image names cannot contain spaces or capital letters. The only allowed special character is dash (-)."; + var duplicateImageMsg = "An image with this name already exists in this project."; + var duplicateRecipeMsg = "A non-image recipe with this name already exists."; newCustomImgBtn.click(function(e){ e.preventDefault(); @@ -22,8 +24,10 @@ function newCustomImageModalInit(){ console.warn(ret.error); if (ret.error === "invalid-name") { showError(invalidMsg); - } else if (ret.error === "already-exists") { - showError("An image with this name already exists. Image names must be unique."); + } else if (ret.error === "image-already-exists") { + showError(duplicateImageMsg); + } else if (ret.error === "recipe-already-exists") { + showError(duplicateRecipeMsg); } } else { imgCustomModal.modal('hide'); -- cgit v1.2.3-54-g00ecf