From: Sujith H Date: Mon, 9 May 2016 23:01:50 +0000 (+0100) Subject: toaster: ui handles duplicate project name in project page X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05ddf48cda6690adab4c097b16387578523e751b;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: ui handles duplicate project name in project page When already existing project name is typed by user, the ui pops up message regarding the existance of the project name. When an existing project is typed the save button will be disabled. Else user can proceed ahead by modifying the project name. [YOCTO #7005] Signed-off-by: Sujith H Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/toastergui/static/js/projecttopbar.js b/lib/toaster/toastergui/static/js/projecttopbar.js index b09f974e477..f0cd18bf484 100644 --- a/lib/toaster/toastergui/static/js/projecttopbar.js +++ b/lib/toaster/toastergui/static/js/projecttopbar.js @@ -25,6 +25,7 @@ function projectTopBarInit(ctx) { e.preventDefault(); projectNameForm.hide(); projectNameContainer.fadeIn(); + $("#project-name-change-input").val(projectName.text()); }); $("#project-name-change-btn").click(function(){ @@ -87,4 +88,10 @@ function projectTopBarInit(ctx) { window.location.replace(libtoaster.ctx.projectBuildsUrl); }, null); }); + + /* Call makeProjectNameValidation function */ + libtoaster.makeProjectNameValidation($("#project-name-change-input"), + $("#hint-error-project-name"), $("#validate-project-name"), + $("#project-name-change-btn")); + } diff --git a/lib/toaster/toastergui/templates/projecttopbar.html b/lib/toaster/toastergui/templates/projecttopbar.html index 007de06ffb7..e878caba8b6 100644 --- a/lib/toaster/toastergui/templates/projecttopbar.html +++ b/lib/toaster/toastergui/templates/projecttopbar.html @@ -33,11 +33,12 @@ {% endif %}