whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject [whimsy] 02/02: Display podling namesearch status on podling roster page.
Date Thu, 08 Jun 2017 03:35:18 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 8be1f76a07a06f54873534bb398d78b6d1982740
Author: John D. Ament <johndament@apache.org>
AuthorDate: Wed Jun 7 23:34:28 2017 -0400

    Display podling namesearch status on podling roster page.
---
 lib/whimsy/asf/podlings.rb       | 13 +++++++++++++
 www/roster/models/ppmc.rb        |  3 +++
 www/roster/views/ppmc/main.js.rb |  8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/lib/whimsy/asf/podlings.rb b/lib/whimsy/asf/podlings.rb
index 93d0485..13dad8e 100644
--- a/lib/whimsy/asf/podlings.rb
+++ b/lib/whimsy/asf/podlings.rb
@@ -1,5 +1,6 @@
 require 'nokogiri'
 require 'date'
+require 'psych'
 require_relative '../asf'
 
 module ASF
@@ -207,6 +208,16 @@ module ASF
       return true if list.start_with?("incubator-#{_name}-")
     end
 
+    def podlingStatus
+      incubator_content = ASF::SVN['asf/incubator/public/trunk/content/podlings']
+      resource_yml = "#{incubator_content}/#{@resource}.yml"
+      if File.exist?(resource_yml)
+        Psych.load_file(resource_yml)
+      else
+        nil
+      end
+    end
+
     # Return the instance as a hash
     def as_hash # might be confusing to use to_h here?
       hash = {
@@ -220,6 +231,7 @@ module ASF
       hash[:champion] = champion if champion
 
       # Tidy up the reporting output
+      podlingStatus = self.podlingStatus
       r = @reporting
       if r.instance_of? Nokogiri::XML::Element
         group = r['group']
@@ -236,6 +248,7 @@ module ASF
       hash[:resource] = resource
       hash[:resourceAliases] = resourceAliases
       hash[:namesearch] = namesearch if namesearch
+      hash[:podlingStatus] = podlingStatus if podlingStatus
       hash
     end
 
diff --git a/www/roster/models/ppmc.rb b/www/roster/models/ppmc.rb
index 742b967..d69571b 100644
--- a/www/roster/models/ppmc.rb
+++ b/www/roster/models/ppmc.rb
@@ -47,6 +47,8 @@ class PPMC
       }
     end
 
+    statusInfo = ppmc.podlingStatus
+
     response = {
       id: id,
       display_name: ppmc.display_name,
@@ -60,6 +62,7 @@ class PPMC
       roster: roster,
       mail: Hash[lists.sort],
       moderators: moderators,
+      podlingStatus: statusInfo,
       namesearch: ppmc.namesearch,
     }
 
diff --git a/www/roster/views/ppmc/main.js.rb b/www/roster/views/ppmc/main.js.rb
index fc9f394..be89a58 100644
--- a/www/roster/views/ppmc/main.js.rb
+++ b/www/roster/views/ppmc/main.js.rb
@@ -97,6 +97,14 @@ class PPMC < React
       end
     end
 
+    _h2.podlingStatus! 'Podling Status'
+    _h3 'Naming'
+    _ul do
+      _li do
+        _a "Podling name search (#{@ppmc.namesearch.resolution})", href: 'https://issues.apache.org/jira/browse/'
+ @ppmc.namesearch.issue
+      end if @ppmc.namesearch
+    end
+
     # Graduation resolution
     _PPMCGraduate ppmc: @ppmc, id: @@auth.id
 

-- 
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <commits@whimsical.apache.org>.

Mime
View raw message