All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex DAMIAN <alexandru.damian@intel.com>
To: bitbake-devel@lists.openembedded.org
Cc: David Reyna <David.Reyna@windriver.com>
Subject: [PATCH 14/14] toaster: insure IMAGE_INSTALL_append values have a space prefix
Date: Fri, 20 Mar 2015 10:25:31 +0000	[thread overview]
Message-ID: <9f63ca33d65fdd813120ab39f15486a5d049571e.1426598797.git.alexandru.damian@intel.com> (raw)
In-Reply-To: <dae2559f8e6d87d54939bc73f4044916df29d93c.1426598797.git.alexandru.damian@intel.com>
In-Reply-To: <cover.1426598797.git.alexandru.damian@intel.com>

From: David Reyna <David.Reyna@windriver.com>

When the IMAGE_INSTALL_append value is not empty, it must have a space prefix
in order for the "append" operator to concatenate the values correctly, so we
enforce it in this variable's submit javascript.

[YOCTO #7394]

Signed-off-by: David Reyna <David.Reyna@windriver.com>
---
 lib/toaster/toastergui/templates/projectconf.html | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/toaster/toastergui/templates/projectconf.html b/lib/toaster/toastergui/templates/projectconf.html
index ffdf760..d8ead81 100644
--- a/lib/toaster/toastergui/templates/projectconf.html
+++ b/lib/toaster/toastergui/templates/projectconf.html
@@ -468,7 +468,7 @@
             // re-assert the event handlers
         }
 
-	/* ensure cookie exists {% csrf_token %} */
+        /* ensure cookie exists {% csrf_token %} */
         function postEditAjaxRequest(reqdata) {
             var ajax = $.ajax({
                     type:"POST",
@@ -621,10 +621,13 @@
             // change IMAGE_INSTALL_append variable
             $('#change-image_install-icon').click(function() {
                 // preset the edit value
-                var current_val = $("span#image_install").text();
+                var current_val = $("span#image_install").text().trim();
                 if (current_val == "Not set") {
                     current_val="";
                     $("#apply-change-image_install").attr("disabled","disabled");
+                } else {
+                    // insure these non-empty values have single space prefix
+                    current_val=" " + current_val;
                 }
                 $("input#new-image_install").val(current_val);
 
@@ -643,7 +646,7 @@
             });
 
             $("#new-image_install").on('input', function(){
-                if ($(this).val().length == 0) {
+                if ($(this).val().trim().length == 0) {
                     $("#apply-change-image_install").attr("disabled","disabled");
                 }
                 else {
@@ -652,13 +655,14 @@
             });
 
             $('#apply-change-image_install').click(function(){
-                var name = $('#new-image_install').val();
-                postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+name});
-                $('#image_install').text(name);
+                // insure these non-empty values have single space prefix
+                var value = " " + $('#new-image_install').val().trim();
+                postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+value});
+                $('#image_install').text(value);
                 $('#image_install').removeClass('muted');
                 $("#change-image_install-form").slideUp(function () {
                     $('#image_install, #change-image_install-icon').show();
-                    if (name.length > -1) {
+                    if (value.length > -1) {
                         $('#delete-image_install-icon').show();
                         setDeleteTooltip($('#delete-image_install-icon'));
                     }
-- 
1.9.1



      parent reply	other threads:[~2015-03-20 10:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 13:28 [PATCH 00/14] Toaster patchset Alex DAMIAN
2015-03-17 13:27 ` [PATCH 01/14] toasterui: improve info in the toaster_ui.log Alex DAMIAN
2015-03-20 10:25 ` [PATCH 02/14] toaster: targets page performance improvement Alex DAMIAN
2015-03-20 10:25 ` [PATCH 03/14] toaster: display bitbake output after process start Alex DAMIAN
2015-03-20 10:25 ` [PATCH 04/14] toastergui: fix machines page search Alex DAMIAN
2015-03-20 10:25 ` [PATCH 05/14] toastergui: builds and projects outcome filter Alex DAMIAN
2015-03-20 10:25 ` [PATCH 06/14] toaster: do not throw exception on misconfigured data Alex DAMIAN
2015-03-20 10:25 ` [PATCH 07/14] toasterui: fix error message parameter Alex DAMIAN
2015-03-20 10:25 ` [PATCH 08/14] toastergui: recipe and layer identification Alex DAMIAN
2015-03-20 10:25 ` [PATCH 09/14] toaster: leave cancel enabled for release change Alex DAMIAN
2015-03-20 10:25 ` [PATCH 10/14] toaster: Incorrect breadcrumb behaviour in the project page Alex DAMIAN
2015-03-20 10:25 ` [PATCH 11/14] toaster: Add cancel build to latest build section Alex DAMIAN
2015-03-20 10:25 ` [PATCH 12/14] toaster: tasks trigger the select related tables before ordering Alex DAMIAN
2015-03-20 10:25 ` [PATCH 13/14] toaster: display machine and project values in input fields Alex DAMIAN
2015-03-20 10:25 ` Alex DAMIAN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f63ca33d65fdd813120ab39f15486a5d049571e.1426598797.git.alexandru.damian@intel.com \
    --to=alexandru.damian@intel.com \
    --cc=David.Reyna@windriver.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.