You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2018/10/10 11:34:30 UTC

[ignite-teamcity-bot] branch master updated: add PR title to the PR number for autocomplete TC branch - Fixes #32.

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new b39e66e  add PR title to the PR number for autocomplete TC branch - Fixes #32.
b39e66e is described below

commit b39e66ebf34aa2dffc19e036c8189079da3882bb
Author: Dmitrii Ryabov <So...@gmail.com>
AuthorDate: Wed Oct 10 14:34:23 2018 +0300

    add PR title to the PR number for autocomplete TC branch - Fixes #32.
    
    Signed-off-by: Dmitriy Pavlov <dp...@apache.org>
---
 .../src/main/webapp/js/common-1.6.js               | 23 ++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js b/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
index b1a925c..613e411 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
@@ -214,13 +214,15 @@ function tcHelperLogout() {
 /**
  * Change autocomplete filter to show results only when they starts from written text.
  */
-$.ui.autocomplete.filter = function (array, term) {
-    var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(term), "i");
+function setAutocompleteFilter() {
+    $.ui.autocomplete.filter = function (array, term) {
+        var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(term), "i");
 
-    return $.grep(array, function (value) {
-        return matcher.test(value.label || value.value || value);
-    });
-};
+        return $.grep(array, function (value) {
+            return matcher.test(value.label || value.value || value);
+        });
+    };
+}
 
 var callbackRegistry = {};
 
@@ -278,6 +280,8 @@ function setupAutocompleteList(srvIds) {
     for (let srvId of srvIds)
         gitUrls.set(srvId, "");
 
+    setAutocompleteFilter();
+
     startFillAutocompleteListsProcess();
 }
 
@@ -347,8 +351,11 @@ function _fillBranchAutocompleteList(result) {
 
         branchesForTc[entry[0]] = [{label:"master", value:"refs/heads/master"}];
 
-        for (let pr of result.data)
-            branchesForTc[entry[0]].push({label: pr.number, value: "pull/" + pr.number + "/head"});
+        for (let pr of result.data) {
+            branchesForTc[entry[0]].push({label: pr.number + " " + pr.title, value: "pull/" + pr.number + "/head"});
+            branchesForTc[entry[0]].push({label: "pull/" + pr.number + "/head " + pr.title,
+                value: "pull/" + pr.number + "/head"});
+        }
 
         $(".branchForTc" + entry[0]).autocomplete({source: branchesForTc[entry[0]]});
     }