You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2019/10/14 14:34:14 UTC

[whimsy] branch master updated: fix podlingnamesearch

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

rubys 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 3e075f3  fix podlingnamesearch
3e075f3 is described below

commit 3e075f331268153ffe63ba5e8a932a397b0fa59e
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Mon Oct 14 10:33:04 2019 -0400

    fix podlingnamesearch
---
 www/board/agenda/views/elements/pns.rb     | 45 ++++++++++++------------------
 www/board/agenda/views/layout/header.js.rb |  2 +-
 2 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/www/board/agenda/views/elements/pns.rb b/www/board/agenda/views/elements/pns.rb
index 81278c4..c85ee61 100644
--- a/www/board/agenda/views/elements/pns.rb
+++ b/www/board/agenda/views/elements/pns.rb
@@ -3,19 +3,29 @@
 #
 
 class PodlingNameSearch < Vue
-  props [:item]
-
   def render
+    results = nil
+    name = @@item.title[/Establish (.*)/, 1]
+
+    # if full title contains a name in parenthesis, check for that name too
+    altname = @@item.fulltitle[/\((.*?)\)/, 1]
+
+    if name and Server.podlingnamesearch
+      Server.podlingnamesearch.each_pair do |podling, jira|
+        results = jira if name == podling or altname == podling
+      end
+    end
+
     _span.pns title: 'podling name search' do
       if Server.podlingnamesearch
-        if not @results
+        if not results
           _abbr "\u2718", title: 'No PODLINGNAMESEARCH found'
-        elsif @results.resolution == 'Fixed'
+        elsif results.resolution == 'Fixed'
           _a "\u2714", href: 'https://issues.apache.org/jira/browse/' +
-            @results.issue
+            results.issue
         else
           _a "\uFE56", href: 'https://issues.apache.org/jira/browse/' +
-            @results.issue
+            results.issue
         end
       end
     end
@@ -23,30 +33,11 @@ class PodlingNameSearch < Vue
 
   # initial mount: fetch podlingnamesearch data unless already downloaded
   def mounted()
-    if Server.podlingnamesearch
-      self.check($props)
-    else
+    if not Server.podlingnamesearch
       retrieve 'podlingnamesearch', :json do |results|
         Server.podlingnamesearch = results
-        self.check($props)
+        Vue.forceUpdate()
       end
     end
   end
-
-  # lookup name in the establish resolution against the podlingnamesearches
-  def check(props)
-    @results = nil
-    name = props.item.title[/Establish (.*)/, 1]
-
-    # if full title contains a name in parenthesis, check for that name too
-    altname = props.item.fulltitle[/\((.*?)\)/, 1]
-
-    if name and Server.podlingnamesearch
-      Server.podlingnamesearch.each_pair do |podling, jira|
-        @results = jira if name == podling or altname == podling
-      end
-    end
-
-    Vue.forceUpdate()
-  end
 end
diff --git a/www/board/agenda/views/layout/header.js.rb b/www/board/agenda/views/layout/header.js.rb
index 2448e76..6c1e3b3 100644
--- a/www/board/agenda/views/layout/header.js.rb
+++ b/www/board/agenda/views/layout/header.js.rb
@@ -16,7 +16,7 @@ class Header < Vue
     _header.navbar.navbar_fixed_top class: @@item.color do
       _div.navbar_brand @@item.title
 
-      if @@item.attach =~ /^7/ and @@item.title =~ /^Establish .* Project/
+      if @@item.attach =~ /^7/ and @@item.fulltitle =~ /^Establish .* Project/
         _PodlingNameSearch item: @@item
       end