]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toaster: ui handles duplicate project name in project page
authorSujith H <sujith.h@gmail.com>
Mon, 9 May 2016 23:01:50 +0000 (00:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 May 2016 10:32:14 +0000 (11:32 +0100)
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 <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/toastergui/static/js/projecttopbar.js
lib/toaster/toastergui/templates/projecttopbar.html

index b09f974e4774a15076863041a86072e58bbd8768..f0cd18bf484ae13554e4788eb1fecd075bb31d4c 100644 (file)
@@ -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"));
+
 }
index 007de06ffb7861e1829830c205bb5475ce159a95..e878caba8b6aef0fda8bc2ef6ecace1d391ca90c 100644 (file)
     {% endif %}
   </h1>
   <form id="project-name-change-form" style="margin-bottom: 0px; display: none;">
-    <div class="input-append">
+    <div class="input-append" id="validate-project-name">
       <input class="huge input-xxlarge" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}">
         <button id="project-name-change-btn" class="btn btn-large" type="button">Save</button>
         <a href="#" id="project-name-change-cancel" class="btn btn-large btn-link">Cancel</a>
     </div>
+    <p class="help-block error" style="display: none;margin-top: 10px;" id="hint-error-project-name">A project with this name exists. Project names must be unique.</p>
   </form>
 </div>