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/09/19 11:29:12 UTC

[whimsy] branch master updated: add support for subprojects being split out to TLP

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 1e4cfbf  add support for subprojects being split out to TLP
1e4cfbf is described below

commit 1e4cfbfff84b43310174dc05f2ba71aa2a06c12b
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Sep 19 06:28:38 2019 -0500

    add support for subprojects being split out to TLP
---
 www/board/agenda/public/stylesheets/app.css      |  6 +++
 www/board/agenda/templates/establish.erb         | 13 ++++++
 www/board/agenda/views/actions/post-data.json.rb | 10 ++++
 www/board/agenda/views/buttons/post.js.rb        | 59 +++++++++++++++++++++---
 4 files changed, 82 insertions(+), 6 deletions(-)

diff --git a/www/board/agenda/public/stylesheets/app.css b/www/board/agenda/public/stylesheets/app.css
index b6305fb..1221552 100644
--- a/www/board/agenda/public/stylesheets/app.css
+++ b/www/board/agenda/public/stylesheets/app.css
@@ -238,6 +238,10 @@ footer .btn {
   vertical-align: middle
 }
 
+.modal {
+  overflow-y: initial !important;
+}
+
 .modal-header {
   border-top-left-radius: 6px;
   border-top-right-radius: 6px
@@ -245,6 +249,8 @@ footer .btn {
 
 .modal-body {
   background-color: white;
+  max-height: 80vh;
+  overflow-y: auto;
 }
 
 .modal-content {
diff --git a/www/board/agenda/templates/establish.erb b/www/board/agenda/templates/establish.erb
index a4536d0..3976d21 100644
--- a/www/board/agenda/templates/establish.erb
+++ b/www/board/agenda/templates/establish.erb
@@ -30,4 +30,17 @@ NOW, THEREFORE, BE IT FURTHER RESOLVED, that <%= @chair.public_name %> be
 appointed to the office of Vice President, Apache <%= @pmcname %>, to serve in
 accordance with and subject to the direction of the Board of Directors and the
 Bylaws of the Foundation until death, resignation, retirement, removal or
+<% if not @parent %>
 disqualification, or until a successor is appointed.
+<% else %>
+<% parent = ASF::Committee.find(@parent).display_name %>
+disqualification, or until a successor is appointed; and be it further
+
+RESOLVED, that the Apache <%= @pmcname %> Project be and hereby is tasked with
+the migration and rationalization of the Apache <%= parent %> <%= @pmcname %>
+sub-project; and be it further
+
+RESOLVED, that all responsibilities pertaining to the Apache <%= parent %>
+<%= @pmcname %> sub-project encumbered upon the Apache <%= parent %> Project
+are hereafter discharged.
+<% end %>
diff --git a/www/board/agenda/views/actions/post-data.json.rb b/www/board/agenda/views/actions/post-data.json.rb
index 1ba30f7..d529aac 100644
--- a/www/board/agenda/views/actions/post-data.json.rb
+++ b/www/board/agenda/views/actions/post-data.json.rb
@@ -1,6 +1,7 @@
 #
 # Helpers for building agenda items to be posted:
 #  committee-list: list all of the committees
+#  committer-list: list all of the committers on a given committee
 #  committee-members: list chair and members of a committee
 #  change-chair: produce a draft change chair resolution
 #
@@ -45,6 +46,15 @@ when 'committee-list'
       
   committees[:chair] + committees[:member] + committees[:rest]
 
+when 'committer-list'
+  committee = ASF::Committee[@pmc]
+  return unless committee
+  roster = committee.committers
+
+  roster = roster.map {|person| {name: person.public_name, id: person.id}}
+
+  {members: roster.sort_by {|person| person[:name]}}
+
 when 'committee-members'
   committee = ASF::Committee[@pmc]
   return unless committee
diff --git a/www/board/agenda/views/buttons/post.js.rb b/www/board/agenda/views/buttons/post.js.rb
index ab4b46d..fd365d6 100644
--- a/www/board/agenda/views/buttons/post.js.rb
+++ b/www/board/agenda/views/buttons/post.js.rb
@@ -10,6 +10,9 @@ class Post < Vue
     @disabled = false
     @alerted = false
     @edited = false
+    @pmcs = []
+    @roster = []
+    @parent = nil
   end
 
   # default attributes for the button associated with this form
@@ -36,7 +39,7 @@ class Post < Vue
   
           _li do
             _button.btn.btn_primary 'Establish Project', onClick: selectItem
-            _ '- direct to TLP project'
+            _ '- direct to TLP project and subproject to TLP'
           end
   
           _li do
@@ -116,6 +119,16 @@ class Post < Vue
             disabled: !pmcname
         end
 
+        _div.form_group do
+          _label 'Parent PMC name (if applicable)', for: 'parent-pmc'
+          _select.form_control.parent_pmc!(
+            onChange: ->(event) {parent_pmc_change(event.target.value)}
+          ) do
+            _option '-- none --', value: '', selected: true
+            @pmcs.each {|pmc| _option pmc unless pmc == 'incubator'}
+          end
+        end
+
         if @chair
           _div.form_group do
             _label "Chair: #{@chair.name}"
@@ -152,8 +165,22 @@ class Post < Vue
                 person.id.include? part or
                 person.name.downcase().include? part
               }
+                and
+              not @pmc.include? person
             then
-              _div.form_check do
+              _div.form_check key: person.id do
+                _input.form_check_input type: 'checkbox',
+                  id: "person_#{person.id}",
+                  onClick: -> {establish_pmc(person)}
+                _label.form_check_label person.name, 
+                  for: "person_#{person.id}"
+              end
+            end
+          end
+        elsif @search.length == 0 and @roster and not @roster.empty?
+          @roster.each do |person|
+            unless @pmc.include? person
+              _div.form_check key: person.id do
                 _input.form_check_input type: 'checkbox',
                   id: "person_#{person.id}",
                   onClick: -> {establish_pmc(person)}
@@ -332,6 +359,7 @@ class Post < Vue
   # match form title, input label, and commit message with button text
   def retitle()
     @report = nil
+    parent_pmc_change(nil)
 
     case @button
     when 'post report'
@@ -594,11 +622,19 @@ class Post < Vue
     @chair = nil
     @pmc = []
 
+    # get a list of committers
     unless Server.committers
       retrieve 'committers', :json do |committers|
         Server.committers = committers || []
       end
     end
+
+    # get a list of PMCs
+    if @pmcs.empty?
+      post 'post-data', request: 'committee-list' do |response|
+        @pmcs = response
+      end
+    end
   end
 
   def establish_pmc(person)
@@ -611,13 +647,14 @@ class Post < Vue
     @disabled = true
 
     people = []
-    Array(document.querySelectorAll(':checked')).each do |checkbox|
+    Array(document.querySelectorAll('input:checked')).each do |checkbox|
       people << checkbox.value
     end
 
     options = {
       request: 'establish', 
       pmcname: @pmcname,
+      parent: @parent,
       description: @pmcdesc,
       chair: @chair.id,
       people: people.join(',')
@@ -638,9 +675,10 @@ class Post < Vue
 
   def initialize_terminate_project()
     # get a list of PMCs
-    @pmcs = []
-    post 'post-data', request: 'committee-list' do |response|
-      @pmcs = response
+    if @pmcs.empty?
+      post 'post-data', request: 'committee-list' do |response|
+        @pmcs = response
+      end
     end
 
     @termreason = nil
@@ -726,6 +764,15 @@ class Post < Vue
     end
   end
 
+  def parent_pmc_change(pmc)
+    @roster = []
+    @parent = pmc
+    return unless pmc
+    post 'post-data', request: 'committer-list', pmc: pmc do |response|
+      @roster = response.members if response
+    end
+  end
+
   def draft_chair_change_resolution()
     @disabled = true
     options = {