From 788d670037a77b35148551ebecf1314146e5a4b7 Mon Sep 17 00:00:00 2001 From: thuva4 Date: Wed, 28 Feb 2018 21:56:23 +0530 Subject: Add enter to search Add directive to filter the list by enter JIRA: RELENG-351 Change-Id: I1abc92cdf2cb103e1ba9b685437b65035c88dd5d Signed-off-by: thuva4 --- testapi/opnfv_testapi/ui/app.js | 15 +++++++++++++++ .../ui/components/deploy-results/deployResults.html | 4 +++- testapi/opnfv_testapi/ui/components/pods/pods.html | 2 +- .../ui/components/projects/projects.html | 2 +- .../ui/components/results/results.html | 21 +++------------------ 5 files changed, 23 insertions(+), 21 deletions(-) (limited to 'testapi/opnfv_testapi') diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js index ae50166..def88d2 100644 --- a/testapi/opnfv_testapi/ui/app.js +++ b/testapi/opnfv_testapi/ui/app.js @@ -42,6 +42,21 @@ }; }]); + angular + .module('testapiApp') + .directive('ngEnter', function () { + return function (scope, element, attrs) { + element.bind("keydown keypress", function (event) { + if(event.which === 13) { + scope.$apply(function (){ + scope.$eval(attrs.ngEnter); + }); + event.preventDefault(); + } + }); + }; + }); + configureRoutes.$inject = ['$stateProvider', '$urlRouterProvider']; /** diff --git a/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html b/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html index 6fbaaea..380416f 100644 --- a/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html +++ b/testapi/opnfv_testapi/ui/components/deploy-results/deployResults.html @@ -15,7 +15,7 @@
Search:   + ng-enter="ctrl.filterList()" ng-Model="ctrl.filterText" placeholder="Search String"> @@ -24,6 +24,7 @@ Start Date:  

@@ -38,6 +39,7 @@ End Date:  

diff --git a/testapi/opnfv_testapi/ui/components/pods/pods.html b/testapi/opnfv_testapi/ui/components/pods/pods.html index 7873977..8e66a9c 100644 --- a/testapi/opnfv_testapi/ui/components/pods/pods.html +++ b/testapi/opnfv_testapi/ui/components/pods/pods.html @@ -22,7 +22,7 @@

Search:   - +
diff --git a/testapi/opnfv_testapi/ui/components/projects/projects.html b/testapi/opnfv_testapi/ui/components/projects/projects.html index b6b73d4..84902f8 100644 --- a/testapi/opnfv_testapi/ui/components/projects/projects.html +++ b/testapi/opnfv_testapi/ui/components/projects/projects.html @@ -18,7 +18,7 @@
Search:   - +
diff --git a/testapi/opnfv_testapi/ui/components/results/results.html b/testapi/opnfv_testapi/ui/components/results/results.html index 2756bb0..e1413d5 100644 --- a/testapi/opnfv_testapi/ui/components/results/results.html +++ b/testapi/opnfv_testapi/ui/components/results/results.html @@ -1,22 +1,5 @@

{{ctrl.pageHeader}}

{{ctrl.pageParagraph}}

-
-

Upload Results

-
- -
-
- -
-
- -
-
-{{ctrl.uploadState}} -
-
@@ -31,7 +14,7 @@
Search:   - @@ -41,6 +24,7 @@ Start Date:  

@@ -55,6 +39,7 @@ End Date:  

-- cgit 1.2.3-korg