whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Show invalid GH names
Date Sat, 23 Mar 2019 12:23:26 GMT
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 9295764  Show invalid GH names
9295764 is described below

commit 9295764ec5024f3d53209cfe1cef65482a684948
Author: Sebb <sebb@apache.org>
AuthorDate: Sat Mar 23 12:23:23 2019 +0000

    Show invalid GH names
---
 www/roster/views/actions/github.json.rb | 3 ++-
 www/roster/views/person/github.js.rb    | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/www/roster/views/actions/github.json.rb b/www/roster/views/actions/github.json.rb
index ce0b183..a8652e7 100644
--- a/www/roster/views/actions/github.json.rb
+++ b/www/roster/views/actions/github.json.rb
@@ -17,7 +17,8 @@ if @githubuser
 
   # Validate the names
   names.each do |name|
-    unless name =~ /^[-0-9a-zA-Z]+$/ # TODO: might need extendind?
+    # Should agree with the validation in github.js.rb
+    unless name =~ /^[-0-9a-zA-Z]+$/ # TODO: might need extending?
       _error "githubUsername must be alphanumeric (or -): '#{name}'"
       return
     end
diff --git a/www/roster/views/person/github.js.rb b/www/roster/views/person/github.js.rb
index 08e76ff..5ce431a 100644
--- a/www/roster/views/person/github.js.rb
+++ b/www/roster/views/person/github.js.rb
@@ -22,7 +22,11 @@ class PersonGitHub < Vue
 
           _ul committer.githubUsername do |gh|
             _li do
-              _a gh, href: "https://github.com/" + gh
+              _a gh, href: "https://github.com/" + gh +"/" # / catches trailing spaces
+              unless gh =~ /^[-0-9a-zA-Z]+$/ # should agree with the validation in github.json.rb
+                _ ' '
+                _span.bg_warning "Invalid: '#{gh}' expecting only alphanumeric and '-'"
+              end
             end
           end
 


Mime
View raw message