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 the ability to add multiple entries more clear
Date Tue, 06 Jun 2017 00:12:07 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 b442d0c  make the ability to add multiple entries more clear
b442d0c is described below

commit b442d0cc834be2f897fabf961f1bc50e582b76dc
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Mon Jun 5 20:11:53 2017 -0400

    make the ability to add multiple entries more clear
---
 www/roster/views/committerSearch.js.rb |  8 ++++++-
 www/roster/views/pmc/main.js.rb        |  1 +
 www/roster/views/ppmc/committers.js.rb | 43 +++++++++++++++++++++++++++-------
 www/roster/views/ppmc/members.js.rb    |  2 +-
 www/roster/views/ppmc/mentors.js.rb    |  2 +-
 5 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/www/roster/views/committerSearch.js.rb b/www/roster/views/committerSearch.js.rb
index 0233734..03ebe8f 100644
--- a/www/roster/views/committerSearch.js.rb
+++ b/www/roster/views/committerSearch.js.rb
@@ -100,7 +100,13 @@ class CommitterSearch < React
 
               if @@add
                 _tr.alert_success do
-                  _td "Click on \u2795 to add", colspan: 3
+                  _td colspan: 4 do
+                    _span "Click on \u2795 to add."
+                    if @@multiple
+                      _span "  Multiple people can be added with " +
+                       "a single confirmation."
+                    end
+                  end
                 end
               end
             end
diff --git a/www/roster/views/pmc/main.js.rb b/www/roster/views/pmc/main.js.rb
index 3f86be1..81020a2 100644
--- a/www/roster/views/pmc/main.js.rb
+++ b/www/roster/views/pmc/main.js.rb
@@ -53,6 +53,7 @@ class PMC < React
         _span 'Double click on a row to edit.'
         unless @committee.roster.keys().empty?
           _span "  Click on \u2795 to add."
+          _span "  Multiple people can be added with a single confirmation."
         end
       end
     end
diff --git a/www/roster/views/ppmc/committers.js.rb b/www/roster/views/ppmc/committers.js.rb
index 3c3bb94..edcba61 100644
--- a/www/roster/views/ppmc/committers.js.rb
+++ b/www/roster/views/ppmc/committers.js.rb
@@ -4,6 +4,8 @@
 
 class PPMCCommitters < React
   def render
+    pending = [] 
+
     if @@ppmc.committers.all? {|id| @@ppmc.owners.include? id}
       _p 'All committers are members of the PPMC'
     else
@@ -21,8 +23,30 @@ class PPMCCommitters < React
           @committers.each do |person|
             next if @@ppmc.owners.include? person.id
             _PPMCCommitter auth: @@auth, person: person, ppmc: @@ppmc
+            pending << person.id if person.status == :pending
           end
 
+	  if pending.length > 1
+	    _tr do
+	      _td colspan: 2
+	      _td data_ids: pending.join(',') do
+
+		# produce a list of ids to be added
+		if pending.length == 2
+		  list = "#{pending[0]} and #{pending[1]}"
+		else
+		  list = pending[0..-2].join(', ') + ", and " +  pending[-1]
+		end
+
+		_button.btn.btn_success 'Add all as committers',
+		  data_action: 'add ppmc committer',
+		  data_target: '#confirm', data_toggle: 'modal',
+		  data_confirmation: "Add #{list} as committers for " +
+		    "#{@@ppmc.display_name} PPMC?"
+	      end
+	    end
+	  end
+
           if @@auth
             _tr onClick: self.select do
               _td((@state == :open ? '' : "\u2795"), colspan: 3)
@@ -33,7 +57,8 @@ class PPMCCommitters < React
 
       if @state == :open
         _div.search_box do
-          _CommitterSearch add: self.add
+          _CommitterSearch add: self.add, multiple: true,
+            exclude: @committers.map {|person| person.id unless person.issue}
         end
       end
     end
@@ -66,7 +91,7 @@ class PPMCCommitters < React
 
   # add a person to the displayed list of committers
   def add(person)
-    person.date = 'pending'
+    person.status = 'pending'
     @committers << person
     @state = :closed
   end
@@ -94,17 +119,17 @@ class PPMCCommitter < React
 
       if @state == :open
         _td data_ids: @@person.id do 
-          if @@person.date == 'pending'
-            _button.btn.btn_primary 'Add as a committer only',
-              data_action: 'add committer', 
-              data_target: '#confirm', data_toggle: 'modal',
-              data_confirmation: "Grant #{@@person.name} committer access?"
-
+          if @@person.status == 'pending'
             _button.btn.btn_success 'Add as a committer and to the PPMC',
               data_action: 'add ppmc committer', 
               data_target: '#confirm', data_toggle: 'modal',
               data_confirmation: "Add #{@@person.name} to the " +
                  "#{@@ppmc.display_name} PPMC and grant committer access?"
+
+            _button.btn.btn_primary 'Add as a committer only',
+              data_action: 'add committer', 
+              data_target: '#confirm', data_toggle: 'modal',
+              data_confirmation: "Grant #{@@person.name} committer access?"
           else
             _button.btn.btn_warning 'Remove as Committer',
               data_action: 'remove committer', 
@@ -134,7 +159,7 @@ class PPMCCommitter < React
   # automatically open pending entries
   def componentWillReceiveProps(newprops)
     @state = :closed if newprops.person.id != self.props.person.id
-    @state = :open if @@person.date == 'pending'
+    @state = :open if @@person.status == 'pending'
   end
 
   # toggle display of buttons
diff --git a/www/roster/views/ppmc/members.js.rb b/www/roster/views/ppmc/members.js.rb
index 56ebaf3..fe15cd3 100644
--- a/www/roster/views/ppmc/members.js.rb
+++ b/www/roster/views/ppmc/members.js.rb
@@ -58,7 +58,7 @@ class PPMCMembers < React
 
     if @state == :open
       _div.search_box do
-        _CommitterSearch add: self.add, 
+        _CommitterSearch add: self.add, multiple: true,
           exclude: @roster.map {|person| person.id unless person.issue}
       end
     end
diff --git a/www/roster/views/ppmc/mentors.js.rb b/www/roster/views/ppmc/mentors.js.rb
index 8c4756c..ed0dc62 100644
--- a/www/roster/views/ppmc/mentors.js.rb
+++ b/www/roster/views/ppmc/mentors.js.rb
@@ -58,7 +58,7 @@ class PPMCMentors < React
 
     if @state == :open
       _div.search_box do
-        _CommitterSearch add: self.add, include: @ipmc,
+        _CommitterSearch add: self.add, include: @ipmc, multiple: true,
           exclude: @roster.map {|person| person.id unless person.issue}
       end
     end

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

Mime
View raw message