whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: make filers and minutes computed properties
Date Sun, 08 Oct 2017 18:16:49 GMT
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 f945237  make filers and minutes computed properties
f945237 is described below

commit f945237c81923925130dbbd7e2275ee0e29eeccc
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Oct 8 14:16:34 2017 -0400

    make filers and minutes computed properties
---
 www/board/agenda/views/models/agenda.js.rb |  2 +-
 www/board/agenda/views/pages/report.js.rb  | 32 ++++++++++++++++++------------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/www/board/agenda/views/models/agenda.js.rb b/www/board/agenda/views/models/agenda.js.rb
index d774e15..df61522 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -5,7 +5,7 @@
 #
 
 class Agenda
-  @@index = []
+  Vue.util.defineReactive @@index, []
   @@etag = nil
   @@digest = nil
 
diff --git a/www/board/agenda/views/pages/report.js.rb b/www/board/agenda/views/pages/report.js.rb
index 4959a93..f31b62d 100644
--- a/www/board/agenda/views/pages/report.js.rb
+++ b/www/board/agenda/views/pages/report.js.rb
@@ -24,7 +24,7 @@ class Report < Vue
 
         _pre.report do
           if @@item.text
-            _Text raw: @@item.text, filters: @filters
+            _Text raw: @@item.text, filters: filters
           elsif @@item.missing
             _p {_em 'Missing'} 
           else
@@ -38,9 +38,9 @@ class Report < Vue
           end
         end
 
-        if @@item.minutes
+        if minutes
           _pre.comment do
-            _Text raw: @@item.minutes, filters: [hotlink]
+            _Text raw: minutes, filters: [hotlink]
           end
         end
       end
@@ -56,17 +56,21 @@ class Report < Vue
     end
   end
 
-  def created()
-    # determine what text filters to run
-    @filters = [self.linebreak, self.todo, hotlink, self.privates, self.jira]
-    @filters = [self.localtime, hotlink] if @@item.title == 'Call to order'
-    @filters << self.names if @@item.people
-    @filters << self.president_attachments if @@item.title == 'President'
+  # determine what text filters to run
+  def filters
+    list = [self.linebreak, self.todo, hotlink, self.privates, self.jira]
+    list = [self.localtime, hotlink] if @@item.title == 'Call to order'
+    list << self.names if @@item.people
+    list << self.president_attachments if @@item.title == 'President'
 
-    # special processing for Minutes from previous meetings
-    if @@item.attach =~ /^3[A-Z]$/
-      @filters = [self.linkMinutes]
+    list = [self.linkMinutes] if @@item.attach =~ /^3[A-Z]$/
+
+    list
+  end
 
+  # special processing for Minutes from previous meetings
+  def minutes
+    if @@item.attach =~ /^3[A-Z]$/
       # if draft is available, fetch minutes for display
       date = @@item.text[/board_minutes_(\d+_\d+_\d+)\.txt/, 1]
 
@@ -74,12 +78,14 @@ class Report < Vue
         date and not defined? @@item.minutes and defined? XMLHttpRequest and
         Server.drafts.include? "board_minutes_#{date}.txt"
       then
-        @@item.minutes = ''
+        Vue.set @@item, 'minutes', ''
         retrieve "minutes/#{date}", :text do |minutes|
           @@item.minutes = minutes
         end
       end
     end
+
+    @@item.minutes
   end
 
   #

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

Mime
View raw message