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 2018/04/23 12:21:23 UTC

[whimsy] branch master updated: allow flagging/commenting on officer reports

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 ef9b3fd  allow flagging/commenting on officer reports
ef9b3fd is described below

commit ef9b3fd71a517ff5b2a1855884d1a380a0079ea1
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Mon Apr 23 08:20:29 2018 -0400

    allow flagging/commenting on officer reports
    
    with operation officer comments being added to the president's report
---
 www/board/agenda/views/actions/commit.json.rb    | 22 ++++++++++++++++++++++
 www/board/agenda/views/buttons/add-comment.js.rb |  2 +-
 www/board/agenda/views/models/agenda.js.rb       |  8 ++++----
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/www/board/agenda/views/actions/commit.json.rb b/www/board/agenda/views/actions/commit.json.rb
index f9d3aa2..58355b1 100644
--- a/www/board/agenda/views/actions/commit.json.rb
+++ b/www/board/agenda/views/actions/commit.json.rb
@@ -158,6 +158,28 @@ Agenda.update(agenda_file, @message) do |agenda|
     end
   end
 
+  # apply operations comments to the President's report
+  operations = Range.new(*agenda.scan(
+    /\s*Additionally, please see Attachments (\d) through (\d)\./).first)
+  operations.each do |attachment|
+    if comments.include? attachment
+      office = agenda[
+	/^Attachment #{attachment}: Report from the (.*?)  \[/, 1]
+      office.sub! /^VP of /, ''
+      office.sub! /^Apache /, ''
+
+      width = 79-13-initials.length
+      text = "[#{office}] #{comments[attachment]}"
+      text = text.reflow(13+initials.length, width)
+      text[/ *(#{' '*(initials.length+2)})/,1] = "#{initials}: "
+
+      agenda.sub!(patterns['4']) do |match|
+	match[/\n()\s{9}\]/,1] = "#{text}\n"
+	match
+      end
+    end
+  end
+
   # return updated agenda
   agenda
 end
diff --git a/www/board/agenda/views/buttons/add-comment.js.rb b/www/board/agenda/views/buttons/add-comment.js.rb
index 9dce02e..1d926fd 100644
--- a/www/board/agenda/views/buttons/add-comment.js.rb
+++ b/www/board/agenda/views/buttons/add-comment.js.rb
@@ -43,7 +43,7 @@ class AddComment < Vue
       _textarea.comment_text!  value: @comment, label: 'Comment',
         placeholder: 'comment', rows: 5, disabled: @disabled
 
-      if User.role == :director and @@item.attach =~ /^[A-Z]+$/
+      if User.role == :director and @@item.attach =~ /^([A-Z]+|[0-9]+)$/
         _input.flag! type: 'checkbox', 
           label: 'item requires discussion or follow up',
           onClick: self.flag, checked: @checked
diff --git a/www/board/agenda/views/models/agenda.js.rb b/www/board/agenda/views/models/agenda.js.rb
index 2a697ed..9370160 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -439,7 +439,7 @@ class Agenda
   def buttons
     list = []
 
-    unless @comments === undefined or Minutes.complete
+    unless (@attach !~ /^\d+$/ and @comments === undefined) or Minutes.complete
       # some reports don't have comments
       if self.pending
         list << {form: AddComment, text: 'edit comment'}
@@ -524,10 +524,10 @@ class Agenda
       'missing'
     elsif self.missing or self.rejected
       'missing'
+    elsif self.flagged
+      'commented'
     elsif @approved
-      if self.flagged
-        'commented'
-      elsif @approved.length < 5
+      if @approved.length < 5
         'ready'
       else
         'reviewed'

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.