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 2017/09/07 11:29:08 UTC

[whimsy] branch roster_on_vue updated (010b89a -> a22be0a)

This is an automated email from the ASF dual-hosted git repository.

rubys pushed a change to branch roster_on_vue
in repository https://gitbox.apache.org/repos/asf/whimsy.git.


    from 010b89a  disable warnings
     new a7934fd  remove dead code
     new b2a2a54  cleanup
     new d3fa933  switch to computed values
     new 647c4c4  try out vue events
     new a22be0a  more React lifecycle methods => Vue

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 www/roster/views/committerSearch.js.rb | 10 ++--------
 www/roster/views/confirm.js.rb         |  2 +-
 www/roster/views/group.js.rb           | 10 +++++-----
 www/roster/views/pmc/add.js.rb         |  3 ++-
 www/roster/views/pmc/committers.js.rb  | 10 +++++-----
 www/roster/views/pmc/main.js.rb        |  4 ++--
 www/roster/views/pmc/mod.js.rb         |  3 ++-
 www/roster/views/pmc/pmc.js.rb         | 19 +++++--------------
 www/roster/views/ppmc/graduate.js.rb   |  4 ++--
 www/roster/views/ppmc/mentors.js.rb    |  2 +-
 10 files changed, 27 insertions(+), 40 deletions(-)

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

[whimsy] 05/05: more React lifecycle methods => Vue

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch roster_on_vue
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit a22be0a1ad0b9dccb5f42072f966c7582f34e4a6
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Sep 7 07:28:54 2017 -0400

    more React lifecycle methods => Vue
---
 www/roster/views/confirm.js.rb       |  2 +-
 www/roster/views/group.js.rb         | 10 +++++-----
 www/roster/views/ppmc/graduate.js.rb |  4 ++--
 www/roster/views/ppmc/mentors.js.rb  |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/www/roster/views/confirm.js.rb b/www/roster/views/confirm.js.rb
index 57baa8c..f2c0d13 100644
--- a/www/roster/views/confirm.js.rb
+++ b/www/roster/views/confirm.js.rb
@@ -35,7 +35,7 @@ class Confirm < Vue
     end
   end
 
-  def componentDidMount()
+  def mounted()
     jQuery('#confirm').on('show.bs.modal') do |event|
       button = event.relatedTarget
       @ids = button.parentNode.dataset.ids
diff --git a/www/roster/views/group.js.rb b/www/roster/views/group.js.rb
index f0aff78..40a6bb9 100644
--- a/www/roster/views/group.js.rb
+++ b/www/roster/views/group.js.rb
@@ -130,14 +130,14 @@ class GroupMember < Vue
     end
   end
 
-  # update props on initial load
-  def componentWillMount()
-    self.componentWillReceiveProps()
+  # update id on initial load
+  def mounted()
+    @id = @@id
   end
 
   # automatically close row when id changes
-  def componentWillReceiveProps(newprops)
-    @state = :closed if newprops.id != self.props.id
+  def beforeUpdate()
+    @state = :closed if @id != @@id and @state != :closed
   end
 
   # toggle display of buttons
diff --git a/www/roster/views/ppmc/graduate.js.rb b/www/roster/views/ppmc/graduate.js.rb
index 6b64ffd..395d1aa 100644
--- a/www/roster/views/ppmc/graduate.js.rb
+++ b/www/roster/views/ppmc/graduate.js.rb
@@ -57,7 +57,7 @@ class PPMCGraduate < Vue
     textarea.css('height', Math.max(50, textarea[0].scrollHeight)+'px')
   end
 
-  def componentDidMount()
+  def mounted()
     textarea = jQuery('#graduate textarea')
 
     jQuery('#graduate').on('show.bs.modal') do |event|
@@ -81,7 +81,7 @@ class PPMCGraduate < Vue
     end
   end
 
-  def componentDidUpdate()
+  def updated()
     self.resize(jQuery('#graduate textarea'))
   end
 end
diff --git a/www/roster/views/ppmc/mentors.js.rb b/www/roster/views/ppmc/mentors.js.rb
index 31d0fa7..6164100 100644
--- a/www/roster/views/ppmc/mentors.js.rb
+++ b/www/roster/views/ppmc/mentors.js.rb
@@ -65,7 +65,7 @@ class PPMCMentors < Vue
   end
 
   # fetch IPMC list
-  def componentDidMount()
+  def mounted()
     return unless @@auth and @@auth.ipmc
     Polyfill.require(%w(Promise fetch)) do
       fetch('committee/incubator.json', credentials: 'include').then {|response|

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

[whimsy] 04/05: try out vue events

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch roster_on_vue
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 647c4c42ecfebe8414857f0eb33ffb23b7240ded
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Sep 7 07:10:20 2017 -0400

    try out vue events
---
 www/roster/views/pmc/add.js.rb  | 3 ++-
 www/roster/views/pmc/main.js.rb | 4 ++--
 www/roster/views/pmc/mod.js.rb  | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/www/roster/views/pmc/add.js.rb b/www/roster/views/pmc/add.js.rb
index cb27e71..0b77efa 100644
--- a/www/roster/views/pmc/add.js.rb
+++ b/www/roster/views/pmc/add.js.rb
@@ -106,11 +106,12 @@ class PMCAdd < Vue
         content_type = response.headers.get('content-type') || ''
         if response.status == 200 and content_type.include? 'json'
           response.json().then do |json|
-            @@update.call(json)
+            Vue.emit :update, json
           end
         else
           alert "#{response.status} #{response.statusText}"
         end
+
         jQuery('#pmcadd').modal(:hide)
         @disabled = false
       }.catch {|error|
diff --git a/www/roster/views/pmc/main.js.rb b/www/roster/views/pmc/main.js.rb
index c632e94..20976d5 100644
--- a/www/roster/views/pmc/main.js.rb
+++ b/www/roster/views/pmc/main.js.rb
@@ -186,8 +186,8 @@ class PMC < Vue
     # hidden forms
     if auth
       _Confirm action: :committee, project: @committee.id, update: self.update
-      _PMCAdd committee: @@committee, update: self.update
-      _PMCMod committee: @@committee, update: self.update
+      _PMCAdd committee: @@committee, onUpdate: self.update
+      _PMCMod committee: @@committee, onUpdate: self.update
     end
   end
 
diff --git a/www/roster/views/pmc/mod.js.rb b/www/roster/views/pmc/mod.js.rb
index fb5d8e7..e6152df 100644
--- a/www/roster/views/pmc/mod.js.rb
+++ b/www/roster/views/pmc/mod.js.rb
@@ -112,11 +112,12 @@ class PMCMod < Vue
         content_type = response.headers.get('content-type') || ''
         if response.status == 200 and content_type.include? 'json'
           response.json().then do |json|
-            @@update.call(json)
+            Vue.emit :update, json
           end
         else
           alert "#{response.status} #{response.statusText}"
         end
+
         jQuery('#pmcmod').modal(:hide)
         @disabled = false
       }.catch {|error|

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

[whimsy] 02/05: cleanup

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch roster_on_vue
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit b2a2a54ab1301ca017033f4ed22b01d4953478d6
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Sep 6 11:58:11 2017 -0400

    cleanup
---
 www/roster/views/committerSearch.js.rb | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/www/roster/views/committerSearch.js.rb b/www/roster/views/committerSearch.js.rb
index 5a12822..ef79755 100644
--- a/www/roster/views/committerSearch.js.rb
+++ b/www/roster/views/committerSearch.js.rb
@@ -109,10 +109,8 @@ class CommitterSearch < Vue
               end
 
               if @@add
-                _tr.alert_success do
-                  _td colspan: 4 do
-                    _span "Click on \u2795 to add."
-                  end
+                _tr do
+                  _td "Click on \u2795 to add.", colspan: 4
                 end
               end
             end

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

[whimsy] 03/05: switch to computed values

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch roster_on_vue
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit d3fa933b2a351d4af9e7ced2bee6f2dfc83193dd
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Thu Sep 7 07:09:27 2017 -0400

    switch to computed values
---
 www/roster/views/pmc/committers.js.rb | 10 +++++-----
 www/roster/views/pmc/pmc.js.rb        | 19 +++++--------------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/www/roster/views/pmc/committers.js.rb b/www/roster/views/pmc/committers.js.rb
index 61b1548..90d4c35 100644
--- a/www/roster/views/pmc/committers.js.rb
+++ b/www/roster/views/pmc/committers.js.rb
@@ -25,7 +25,7 @@ class PMCCommitters < Vue
         end
 
         _tbody do
-          @committers.each do |person|
+          committers.each do |person|
             next if @@committee.members.include? person.id
             next if @@committee.ldap.include? person.id
             _PMCCommitter auth: @@auth, person: person, committee: @@committee
@@ -36,16 +36,16 @@ class PMCCommitters < Vue
   end
 
   # compute list of committers
-  def created()
-    committers = []
+  def committers
+    result = []
     
     @@committee.committers.each do |id|
       person = @@committee.roster[id]
       person.id = id
-      committers << person
+      result << person
     end
 
-    @committers = committers.sort_by {|person| person.name}
+    result.sort_by {|person| person.name}
   end
 end
 
diff --git a/www/roster/views/pmc/pmc.js.rb b/www/roster/views/pmc/pmc.js.rb
index 19da852..240fb2e 100644
--- a/www/roster/views/pmc/pmc.js.rb
+++ b/www/roster/views/pmc/pmc.js.rb
@@ -20,34 +20,25 @@ class PMCMembers < Vue
       end
 
       _tbody do
-        @roster.each do |person|
+        roster.each do |person|
           _PMCMember auth: @@auth, person: person, committee: @@committee
         end
       end
     end
   end
 
-  def created()
-    self.computeRoster()
-  end
-
-  def beforeUpdate()
-    self.computeRoster()
-  end
-
-  # compute roster
-  def computeRoster()
-    roster = []
+  def roster
+    result = []
     
     for id in @@committee.roster
       if @@committee.members.include?(id) or @@committee.ldap.include?(id)
         person = @@committee.roster[id]
         person.id = id
-        roster << person
+        result << person
       end
     end
 
-    @roster = roster.sort_by {|person| person.name}
+    result.sort_by {|person| person.name}
   end
 end
 

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

[whimsy] 01/05: remove dead code

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch roster_on_vue
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit a7934fd4ac4f31841b486dd4ed1e8022daf2ac53
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Sep 6 11:24:34 2017 -0400

    remove dead code
---
 www/roster/views/committerSearch.js.rb | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/www/roster/views/committerSearch.js.rb b/www/roster/views/committerSearch.js.rb
index 9a71cb3..5a12822 100644
--- a/www/roster/views/committerSearch.js.rb
+++ b/www/roster/views/committerSearch.js.rb
@@ -112,10 +112,6 @@ class CommitterSearch < Vue
                 _tr.alert_success do
                   _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

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