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] [1/1] Commit d3d2f10: Traverse flagged items once meeting has started
Date Sat, 20 Feb 2016 17:06:20 GMT
Commit d3d2f1057869f892e4ec411e4cf5e38b02094abf:
    Traverse flagged items once meeting has started
    Once meeting has started, replace committee reports with flagged items in flow:
      Additional Officer <=> Flagged Items <=> Special Orders


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

------------------------------------------------------------
www/board/agenda/spec/other_views_spec.rb                    | ++++++++ -
www/board/agenda/test/board_minutes_2015_02_18.yml           | + 
www/board/agenda/views/layout/footer.js.rb                   | +++++++++ -
------------------------------------------------------------
73 changes: 67 additions, 6 deletions.
------------------------------------------------------------


diff --git a/www/board/agenda/spec/other_views_spec.rb b/www/board/agenda/spec/other_views_spec.rb
index 3301b9c..f363b4d 100644
--- a/www/board/agenda/spec/other_views_spec.rb
+++ b/www/board/agenda/spec/other_views_spec.rb
@@ -108,6 +108,24 @@
       text: 'Mesos'
   end
 
+  it "should skip to flagged items once meeting has started" do
+    visit '/2015-02-18/Security-Team'
+    expect(page).to have_selector '.nextlink[href="flagged/Axis"]',
+      text: 'Axis'
+
+    visit '/2015-02-18/flagged/Axis'
+    expect(page).to have_selector '.backlink[href="Security-Team"]',
+      text: 'Security Team'
+
+    visit '/2015-02-18/flagged/Lenya'
+    expect(page).to have_selector '.nextlink[href="Change-Geronimo-Chair"]',
+      text: 'Change Geronimo Chair'
+
+    visit '/2015-02-18/Change-Geronimo-Chair'
+    expect(page).to have_selector '.backlink[href="flagged/Lenya"]',
+      text: 'Lenya'
+  end
+
   it "should highlight and crosslink action items" do
     visit '/2015-01-21/Action-Items'
 
@@ -132,10 +150,18 @@
   end
 
   it "should draft action items" do
-    visit '/2015-02-18/Action-Items'
-    expect(page).to have_selector 'p.alert-info', 
-      text: 'Action Items have yet to be posted'
-    expect(page).to have_selector 'button.btn-primary', text: 'post actions'
+    yaml = 'test/work/data/board_minutes_2015_02_18.yml'
+    minutes = YAML.load_file(yaml)
+    begin
+      File.write(yaml, YAML.dump(minutes.merge('started' => false)))
+
+      visit '/2015-02-18/Action-Items'
+      expect(page).to have_selector 'p.alert-info', 
+        text: 'Action Items have yet to be posted'
+      expect(page).to have_selector 'button.btn-primary', text: 'post actions'
+    ensure
+      File.write(yaml, YAML.dump(minutes))
+    end
   end
 
   it "should show flagged items" do
diff --git a/www/board/agenda/test/board_minutes_2015_02_18.yml b/www/board/agenda/test/board_minutes_2015_02_18.yml
index b7a0f4d..14469cb 100644
--- a/www/board/agenda/test/board_minutes_2015_02_18.yml
+++ b/www/board/agenda/test/board_minutes_2015_02_18.yml
@@ -1,4 +1,5 @@
 ---
+started: 1424284440.0
 Call to order: '10:34'
 Roll Call: |
   Directors Present:
diff --git a/www/board/agenda/views/layout/footer.js.rb b/www/board/agenda/views/layout/footer.js.rb
index ee7a0bc..e03a464 100644
--- a/www/board/agenda/views/layout/footer.js.rb
+++ b/www/board/agenda/views/layout/footer.js.rb
@@ -2,6 +2,11 @@
 # Layout footer consisting of a previous link, any number of buttons,
 # followed by a next link.
 #
+# Overrides previous and next links when traversal is queue, shepherd, or
+# Flagged.  Injects the flagged items into the flow once the meeting starts
+# (last additional officer <-> first flagged &&
+#  last flagged <-> first Special order)
+#
 
 class Footer < React
   def render
@@ -30,7 +35,25 @@ def render
         while link and not link.flagged
           link = link.prev
         end
-        link ||= {href: "../flagged", title: 'Flagged'}
+
+        unless link
+          if Minutes.started
+            link = Agenda.index.find {|item| item.attach == 'A'}.prev
+            prefix = ''
+          end
+
+          link ||= {href: "../flagged", title: 'Flagged'}
+        end
+      elsif 
+        Minutes.started and @@item.attach =~ /\d/ and
+        link and link.attach =~ /^[A-Z]/
+      then
+        Agenda.index.each do |item| 
+          if item.flagged
+            prefix = 'flagged/'
+            link = item 
+          end
+        end
       end
 
       if link
@@ -74,9 +97,20 @@ def render
       elsif @@options.traversal == :flagged
         prefix = 'flagged/'
         while link and not link.flagged
-          link = link.next
+          if Minutes.started and link.index
+            prefix = ''
+            break
+          else
+            link = link.next
+          end
         end
         link ||= {href: "../flagged", title: 'Flagged'}
+      elsif Minutes.started and link and link.attach == 'A'
+        while link and not link.flagged and link.attach =~ /^[A-Z]/
+          link = link.next
+        end
+
+        prefix = 'flagged/' if link and link.attach =~ /^[A-Z]/
       end
 
       if link

Mime
View raw message