From patchwork Tue Jun 18 14:03:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stevan Radakovic X-Patchwork-Id: 17963 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B9A9325C6D for ; Tue, 18 Jun 2013 14:03:22 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id q12sf5405197vbe.5 for ; Tue, 18 Jun 2013 07:03:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=87o2OWCzF8H7EmIGwuroDfEI3aqpUbX+SYVZzScmXJ0=; b=mLdOhpNrVe3p4WGJvfx7VmDT/hwiYeF6dL1p4l6CyqUTXvp4to3nrl/LXDFPcfGHS+ cDMT8D/qRmQrfhFRt3xhiL1a4Sbes9HuCC3Flj5YrVAcHQOlSYugkmsqE3hnS4bnA1a4 imhU3Te3xtRzsKZt8HPKJuND8sVPw/CRNVGdLrfkiVOjC8X/lah/YqvetQz8wdaAcSdU lh7B6uTw5HRBK06VYp3j26qUXMWoCa5Xf8owUwCpM7msdR7iP1BCX0mib5ws1O5OXDKt 0/Sx/Zk2oW1qw2jVsHlfe4y0r3cNkWu7oY9wXw8q2jclr0RxIsa9UMp2FUDohNLoGgpH gxow== X-Received: by 10.58.133.49 with SMTP id oz17mr2343831veb.24.1371564202414; Tue, 18 Jun 2013 07:03:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.134 with SMTP id o6ls1343783qed.33.gmail; Tue, 18 Jun 2013 07:03:22 -0700 (PDT) X-Received: by 10.52.249.66 with SMTP id ys2mr1589693vdc.55.1371564202141; Tue, 18 Jun 2013 07:03:22 -0700 (PDT) Received: from mail-vb0-x22f.google.com (mail-vb0-x22f.google.com [2607:f8b0:400c:c02::22f]) by mx.google.com with ESMTPS id to9si5300045vdc.136.2013.06.18.07.03.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Jun 2013 07:03:22 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22f; Received: by mail-vb0-f47.google.com with SMTP id x14so2911739vbb.34 for ; Tue, 18 Jun 2013 07:03:22 -0700 (PDT) X-Received: by 10.220.53.7 with SMTP id k7mr6249518vcg.52.1371564202058; Tue, 18 Jun 2013 07:03:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp74274veb; Tue, 18 Jun 2013 07:03:20 -0700 (PDT) X-Received: by 10.14.5.129 with SMTP id 1mr16671839eel.56.1371564199254; Tue, 18 Jun 2013 07:03:19 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id g8si8273636eet.123.2013.06.18.07.03.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 18 Jun 2013 07:03:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UowVA-0006v1-AY for ; Tue, 18 Jun 2013 14:03:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 3B2FAEAC7D for ; Tue, 18 Jun 2013 14:03:16 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 408 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 408: * Table cell width when there are bugs linked Message-Id: <20130618140316.25554.72767.launchpad@ackee.canonical.com> Date: Tue, 18 Jun 2013 14:03:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16667"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 9d8c417038c43f0daddd88c70ca12581af39d3a2 X-Gm-Message-State: ALoCoQklCB6Cn5BGO1EU3505L7+ngJbXwFDi7mmriipDmJNK/bcZTyTdGhI5Ul8Kg826qJNsKUZD X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Stevan Radaković (stevanr) Related merge proposals: https://code.launchpad.net/~stevanr/lava-dashboard/image-reports-feedback/+merge/170074 proposed by: Stevan Radaković (stevanr) review: Approve - Antonio Terceiro (terceiro) ------------------------------------------------------------ revno: 408 [merge] committer: Stevan Radakovic branch nick: trunk timestamp: Tue 2013-06-18 16:02:31 +0200 message: * Table cell width when there are bugs linked * Switch graph on/off checkbox(on by default) * Be able to share a link to the images, timeline, etc.. modified: dashboard_app/static/dashboard_app/css/image-report.css dashboard_app/static/dashboard_app/js/image-report.js dashboard_app/templates/dashboard_app/image-report.html --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/static/dashboard_app/css/image-report.css' --- dashboard_app/static/dashboard_app/css/image-report.css 2013-06-10 15:33:53 +0000 +++ dashboard_app/static/dashboard_app/css/image-report.css 2013-06-18 13:12:18 +0000 @@ -9,7 +9,7 @@ text-align: left; } .inner-table td, .inner-table th { - min-width: 90px; + min-width: 105px; padding: 3px 4px; border: thin solid black; } @@ -60,6 +60,9 @@ #outer-container { overflow: auto; } +#toggle-graph-container { + margin-top: 5px; +} #filters { border: 1px solid #000000; clear: both; @@ -73,6 +76,10 @@ font-size: 16px; margin: 5px 0 0 10px; } +#filter_headline a { + font-weight: normal; + font-size: 12px; +} #test_headline, #build_number_headline, #graph_type_headline, #target_goal_headline { width: 120px; float: left; === modified file 'dashboard_app/static/dashboard_app/js/image-report.js' --- dashboard_app/static/dashboard_app/js/image-report.js 2013-06-14 09:11:32 +0000 +++ dashboard_app/static/dashboard_app/js/image-report.js 2013-06-18 13:50:02 +0000 @@ -23,6 +23,13 @@ } } +function toggle_graph () { + $("#outer-container").toggle(); + $(".tickLabels").toggle(); + update_plot(columns, chart_data, test_names); + store_filters(); +} + function update_filters(column_data, test_run_names) { for (iter in column_data) { build_number = column_data[iter]["number"].split('.')[0]; @@ -74,6 +81,12 @@ return false; } + if (!isNumeric($("#target_goal").val())) { + alert("Target goal must be a numeric value."); + return false; + } + + // Create row headlines. test_name_rows = "Date"; for (iter in test_run_names) { @@ -152,7 +165,20 @@ store_filters(); update_plot(column_data, table_data, test_run_names); update_tooltips(); + update_filter_link(); add_bug_links(); + _fixRowHeights(); +} + +function update_filter_link() { + filter_link = window.location.href.split('?')[0] + '?'; + filter_link += "build_number_start=" + $("#build_number_start").val(); + filter_link += "&build_number_end=" + $("#build_number_end").val(); + filter_link += "&test_select=" + $("#test_select").val(); + filter_link += "&target_goal=" + $("#target_goal").val().trim(); + filter_link += "&graph_type=" + $('input:radio[name=graph_type]:checked').val(); + + $("#filter_link").attr("href", filter_link); } function update_tooltips() { @@ -173,16 +199,23 @@ prefix = window.location.pathname.split('/').pop(); - $.jStorage.set(prefix + "_target_goal", $("#target_goal").val()); + $.jStorage.set(prefix + "_target_goal", $("#target_goal").val().trim()); $.jStorage.set(prefix + "_build_number_start", $("#build_number_start").val()); $.jStorage.set(prefix + "_build_number_end", $("#build_number_end").val()); $.jStorage.set(prefix + "_test_select", $("#test_select").val()); + $.jStorage.set(prefix + "_toggle_graph", $("#toggle_graph").attr("checked")); $.jStorage.set(prefix + "_graph_type", $('input:radio[name=graph_type]:checked').val()); } function load_filters() { // Use jStorage to load the filter values from browser. + // If get parameters are present they are used because of higher priority. + if (location.search != "") { + populate_filters_from_get(); + return; + } + prefix = window.location.pathname.split('/').pop(); if ($.jStorage.get(prefix + "_target_goal")) { @@ -197,6 +230,9 @@ if ($.jStorage.get(prefix + "_test_select")) { $("#test_select").val($.jStorage.get(prefix + "_test_select")); } + if ($.jStorage.get(prefix + "_toggle_graph") != null) { + $("#toggle_graph").attr("checked", $.jStorage.get(prefix + "_toggle_graph")); + } if ($.jStorage.get(prefix + "_graph_type")) { if ($.jStorage.get(prefix + "_graph_type") == "number") { $('input:radio[name=graph_type][value="number"]').attr("checked", true); @@ -206,6 +242,39 @@ } } +function populate_filters_from_get() { + // Populate filter fields from get request parameters. + var parameters = get_parameters_from_request(); + for (iter in parameters) { + if (parameters[iter][0] == "build_number_start" && parameters[iter][1] != "") { + $("#build_number_start").val(unescape(parameters[iter][1])); + } + if (parameters[iter][0] == "build_number_end" && parameters[iter][1] != "") { + $("#build_number_end").val(unescape(parameters[iter][1])); + } + if (parameters[iter][0] == "test_select" && parameters[iter][1] != "") { + $("#test_select").val(parameters[iter][1].split(',')); + } + if (parameters[iter][0] == "target_goal" && parameters[iter][1] != "") { + $("#target_goal").val(unescape(parameters[iter][1])); + } + if (parameters[iter][0] == "graph_type" && parameters[iter][1] != "") { + if (parameters[iter][1] == "number") { + $('input:radio[name=graph_type][value="number"]').attr("checked", true); + } else { + $('input:radio[name=graph_type][value="percentage"]').attr("checked", true); + } + } + } +} + +function get_parameters_from_request() { + var params = location.search.replace('?', '').split('&').map(function(val) { + return val.split('='); + }); + return params; +} + function update_plot(column_data, table_data, test_run_names) { // Get the plot data. @@ -452,7 +521,9 @@ _fixRowHeights(); add_bug_links(); - + if (!$("#toggle_graph").attr("checked")) { + $("#outer-container").toggle(); + } }); // Because what resize does depends on the final sizes of elements, // run it again after everything is loaded (things end up wrong in === modified file 'dashboard_app/templates/dashboard_app/image-report.html' --- dashboard_app/templates/dashboard_app/image-report.html 2013-06-10 15:33:53 +0000 +++ dashboard_app/templates/dashboard_app/image-report.html 2013-06-18 13:12:18 +0000 @@ -9,6 +9,12 @@ + + {% endblock %} {% block content %} @@ -22,16 +28,13 @@ - - - +
+ + +
-
Filters
+
Start build number: