You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drat.apache.org by GitBox <gi...@apache.org> on 2018/08/31 16:33:45 UTC

[GitHub] chrismattmann closed pull request #170: Adding search bar for projects table

chrismattmann closed pull request #170: Adding search bar for projects table
URL: https://github.com/apache/drat/pull/170
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue b/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue
index 3a94afbc..037c3b5c 100644
--- a/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue
+++ b/webapps/proteus-new/src/main/webapp/resources/src/components/projectstable.vue
@@ -15,15 +15,26 @@ the License.
 <template lang="html">
 
 <v-card id="tablecard">
+  
   <v-toolbar dark color="primary">
      <v-toolbar-title class="white--text">Projects</v-toolbar-title>
   </v-toolbar>
   <section class="projectstable">
-    <!-- <h1>Projects</h1> -->
-    
+    <v-text-field
+      id="projectsearch"
+      v-model="projectsearch"
+      append-icon="search"
+      solo
+      label="Search"
+      single-line
+      hide-details>
+    </v-text-field>
     <v-data-table id="ttx"
       :headers="headers"
       :items="docs"
+      :search="projectsearch"
+      :filter="filterProjects"
+      :custom-filter="customfilterprojects"
       :rows-per-page-items="rowsPerPageItemsforProjects"
       class="elevation-1"
     >
@@ -229,6 +240,7 @@ import store from './../store/store';
     },
     data() {
       return {
+        projectsearch:'',
         search:'',
         timerClearVar:'',
         license:{
@@ -274,6 +286,27 @@ import store from './../store/store';
       
     },
     methods: {
+      customfilterprojects(items,search,filter){
+        if(search!=undefined){
+          search = search.toString().toLowerCase()
+          return items.filter(row=>filter(row,search))
+        }else{
+          return items;
+        }
+        
+      },
+      filterProjects(inputObject,search){
+        if(inputObject.repo.toLowerCase().includes(search)){
+          return true;
+        }
+        if(inputObject.name.toLowerCase().includes(search)){
+          return true;
+        }
+        if(inputObject.description.toLowerCase().includes(search)){
+          return true;
+        }
+        return false;
+      },
       moreClicked :function(index){
         this.$log.info("as");
         this.dialog =true;     
@@ -437,4 +470,7 @@ import store from './../store/store';
     margin-bottom: 80px;
     z-index: 950;
   }
+  #projectsearch{
+    
+  }
 </style>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services