You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2018/10/25 20:58:45 UTC

[whimsy] branch master updated: Whimsy-207 Search by github user name

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

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 2796a3a  Whimsy-207 Search by github user name
2796a3a is described below

commit 2796a3ae561239d779224345fa8ff0d0575a84d8
Author: Sebb <se...@apache.org>
AuthorDate: Thu Oct 25 21:58:34 2018 +0100

    Whimsy-207 Search by github user name
---
 www/roster/main.rb                     | 3 ++-
 www/roster/views/committerSearch.js.rb | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/www/roster/main.rb b/www/roster/main.rb
index f533761..8e7e587 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -80,9 +80,10 @@ get '/committer/index.json' do
     mail = Hash[ASF::Mail.list.group_by(&:last).
       map {|person, list| [person, list.map(&:first)]}]
 
+    ASF::Person.preload(['id','name','mail','githubUsername'])
     # build a list of people, their public-names, and email addresses
     index = ASF::Person.list.sort_by(&:id).map {|person|
-      result = {id: person.id, name: person.public_name, mail: mail[person]}
+      result = {id: person.id, name: person.public_name, mail: mail[person], githubUsername: person.attrs['githubUsername'] || []}
       result[:member] = true if person.asf_member?
       result
     }.to_json
diff --git a/www/roster/views/committerSearch.js.rb b/www/roster/views/committerSearch.js.rb
index ca90731..8f0e58c 100644
--- a/www/roster/views/committerSearch.js.rb
+++ b/www/roster/views/committerSearch.js.rb
@@ -42,7 +42,8 @@ class CommitterSearch < Vue
         search.all? {|part|
           person.id.include? part or
           person.name.downcase().include? part or
-          person.mail.any? {|mail| mail.include? part}
+          person.mail.any? {|mail| mail.include? part} or
+          person.githubUsername.any? {|ghun| ghun.downcase().include? part}
         }
       then
         unless @@exclude and @@exclude.include? person.id
@@ -88,6 +89,7 @@ class CommitterSearch < Vue
                 _th 'id'
                 _th 'public name'
                 _th 'email'
+                _th 'githubUsername'
               end
             end
 
@@ -104,6 +106,8 @@ class CommitterSearch < Vue
                   end
 
                   _td person.mail.first
+
+                  _td person.githubUsername.join(', ')
                 end
               end