Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B09EBE009C5; Thu, 13 Aug 2015 03:19:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.180 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6B58FE00947 for ; Thu, 13 Aug 2015 03:19:24 -0700 (PDT) Received: by wicne3 with SMTP id ne3so133345960wic.0 for ; Thu, 13 Aug 2015 03:19:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=y6t4M/MgQff4OaLBwS+ScSYa8KjeVI2NpveBKv82D4U=; b=XDFvahMlTyQz3vEItG99Syt5V+CLjZ0j8M7Jl7WYYOopSMLqSz8Zgo4goBp3EkvwvT Bc8cyIXY6q9NF6/BfX0PqCBza7hOnRBvbIyMAhe+mO/S1B7V7DHSbVpRZnoifauwSetF ic/e5cY/ADo9y/zodcc8tv18omb4lKHXuX3mxvBVAQ2L3jeJ6SHCcXjwIHFzylwrwuj9 ve4rGOdEX84Af8FC1BkVd7AYqgNv1OdT1OwdTc5CoqtSHDK3M5jJSSHF6JW4/VxnUXaL UAxq8DpUtlUQTQuHtezxhfPr/hV8NqmT32VKkCF1rAaTEkzYa07DVv2uJrR+7B+M/kGD FLdQ== X-Gm-Message-State: ALoCoQnvxymZJpr6SCyUkakhzOQyfbiv2ZIdIhxqlwtVbQP0LN5b2WK1M+aOdmBmut3rZgu9/0lE X-Received: by 10.180.91.196 with SMTP id cg4mr56599394wib.16.1439461164303; Thu, 13 Aug 2015 03:19:24 -0700 (PDT) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id pg9sm2601430wjb.40.2015.08.13.03.19.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Aug 2015 03:19:23 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 13 Aug 2015 11:19:14 +0100 Message-Id: <1439461154-26832-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [review-request][PATCH] toastergui: importlayer Update property names for duplicate layer check X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2015 10:19:27 -0000 In a move to standardise the JSON layer object across API calls we've renamed a few of the property names/fields. This updates the importlayer duplicate layer check to use these fields. Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastergui/static/js/importlayer.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index 2fadbc0..8e3031f 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js @@ -195,8 +195,8 @@ function importLayerPageInit (ctx) { var dupLayerInfo = $("#duplicate-layer-info"); dupLayerInfo.find(".dup-layer-name").text(layer.name); dupLayerInfo.find(".dup-layer-link").attr("href", layer.layerdetailurl); - dupLayerInfo.find("#dup-layer-vcs-url").text(layer.layer__vcs_url); - dupLayerInfo.find("#dup-layer-revision").text(layer.revision.commit); + dupLayerInfo.find("#dup-layer-vcs-url").text(layer.vcs_url); + dupLayerInfo.find("#dup-layer-revision").text(layer.vcs_reference); $(".fields-apart-from-layer-name").fadeOut(function(){ @@ -212,13 +212,12 @@ function importLayerPageInit (ctx) { /* Check if the layer name exists */ $.getJSON(libtoaster.ctx.layersTypeAheadUrl, - { include_added: "true" , search: name, format: "json" }, + { include_added: "true" , search: name }, function(layer) { - if (layer.rows.length > 0) { - for (var i in layer.rows){ - if (layer.rows[i].name == name) { - console.log(layer.rows[i]) - layerExistsError(layer.rows[i]); + if (layer.results && layer.results.length > 0) { + for (var i in layer.results){ + if (layer.results[i].name == name) { + layerExistsError(layer.results[i]); } } } -- 2.1.4