whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [2/2] Commit 4cc136d: link to attic resolutions
Date Mon, 15 Feb 2016 21:56:02 GMT
Commit 4cc136dd40eca36f68e47f353ce8f082eb238ddb:
    link to attic resolutions


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/roster/views/pmc/main.js.rb                              | +++++++++ -
------------------------------------------------------------
38 changes: 36 additions, 2 deletions.
------------------------------------------------------------


diff --git a/www/roster/views/pmc/main.js.rb b/www/roster/views/pmc/main.js.rb
index b96a550..a9940c5 100644
--- a/www/roster/views/pmc/main.js.rb
+++ b/www/roster/views/pmc/main.js.rb
@@ -3,6 +3,10 @@
 #
 
 class PMC < React
+  def initialize
+    @attic = nil
+  end
+
   def render
     auth = (@@auth.id == @committee.chair or @@auth.secretary or @@auth.root)
 
@@ -14,6 +18,19 @@ def render
 
     _p @committee.description
 
+    # link to attic resolutions
+    if not @committee.established and @attic
+      for id in @attic
+        next unless @attic[id] =~ /\b#{@committee.id}\b/i
+
+        _div.alert.alert_danger do
+          _a "#{id}: #{@attic[id]}", 
+            href: "https://issues.apache.org/jira/browse/#{id}"
+        end
+      end
+    end
+
+    # usage information for authenticated users (PMC chair, etc.)
     if auth
       _div.alert.alert_success 'Double click on a row to edit.  ' +
         "Double click on \u2795 to add."
@@ -29,16 +46,33 @@ def render
 
   # capture committee on initial load
   def componentWillMount()
-    @committee = @@committee
+    self.update(@@committee)
   end
 
   # capture committee on subsequent loads
   def componentWillReceiveProps()
-    @committee = @@committee
+    self.update(@@committee)
   end
 
   # update committee from conformation form
   def update(committee)
     @committee = committee
+
+    if @attic == nil and not committee.established and defined? fetch
+      @attic = []
+
+      console.log 'issuing fetch'
+      fetch('/attic/issues.json', credentials: 'include').then {|response|
+        if response.status == 200
+          response.json().then do |json|
+            @attic = json
+          end
+        else
+          console.log "Attic JIRA #{response.status} #{response.statusText}"
+        end
+      }.catch {|error|
+        console.log "Attic JIRA #{errror}"
+      }
+    end
   end
 end

Mime
View raw message