whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [whimsy] branch master updated: Add mock user to project/icla
Date Sun, 28 Jan 2018 01:06:05 GMT
This is an automated email from the ASF dual-hosted git repository.

clr 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 c6be23c  Add mock user to project/icla
c6be23c is described below

commit c6be23c069a591f3d08cbce5c7826b46981958c1
Author: Craig L Russell <craig.russell@oracle.com>
AuthorDate: Sat Jan 27 17:05:57 2018 -0800

    Add mock user to project/icla
---
 www/project/icla/main.rb                   | 18 ++++++++++++++++--
 www/project/icla/views/app.html.rb         |  2 +-
 www/project/icla/views/pages/discuss.js.rb | 11 ++++++-----
 www/project/icla/views/pages/invite.js.rb  |  9 +++++----
 www/project/icla/views/pages/vote.js.rb    |  9 ++++-----
 5 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/www/project/icla/main.rb b/www/project/icla/main.rb
index aa45d08..219d697 100755
--- a/www/project/icla/main.rb
+++ b/www/project/icla/main.rb
@@ -53,6 +53,16 @@ helpers do
       end
     end
   end
+  def getMember(userId)
+    user = ASF::Person.find(userId)
+    mockId = params['mock']
+    if ASF::Person.find(mockId) != nil
+      # if mock is set, set member to mock value
+      return mockId
+    else
+     return userId
+    end
+  end
 end
 
 @phase = ''
@@ -79,10 +89,12 @@ end
 get '/invite' do
   @view = 'invite'
 
-  # get a complete list of PMC and PPMC names and mail lists
-  projects = projectsForUser(env.user)
 
   # server data sent to client
+  @user = env.user
+  @member = getMember(@user)
+  # get a complete list of PMC and PPMC names and mail lists
+  projects = projectsForUser(@member)
   @pmcs = projects['pmcs']
   @ppmcs = projects['ppmcs']
   @pmc_mail = projects['pmcmail']
@@ -100,6 +112,7 @@ get '/discuss' do
   # server data sent to client
   @debug = params['debug']
   @user = env.user
+  @member = getMember(@user)
   @token = params['token']
   loadProgress(@token) if @token
 
@@ -120,6 +133,7 @@ get '/vote' do
 # server data sent to client
   @debug = params['debug']
   @user = env.user
+  @member = getMember(@user)
   @token = params['token']
   loadProgress(@token) if @token
 
diff --git a/www/project/icla/views/app.html.rb b/www/project/icla/views/app.html.rb
index 01bb6ce..8f966ea 100755
--- a/www/project/icla/views/app.html.rb
+++ b/www/project/icla/views/app.html.rb
@@ -374,7 +374,7 @@ _html lang: 'en', _width: '80' do
 
     _.render '#main' do
       _Main data: {pmcs: @pmcs, ppmcs: @ppmcs, pmc_mail: @pmc_mail,
-        token: @token, progress: @progress, user: @user,
+        token: @token, progress: @progress, user: @user, member: @member,
         debug: @debug},
         view: @view
     end
diff --git a/www/project/icla/views/pages/discuss.js.rb b/www/project/icla/views/pages/discuss.js.rb
index 85a7625..7286158 100644
--- a/www/project/icla/views/pages/discuss.js.rb
+++ b/www/project/icla/views/pages/discuss.js.rb
@@ -2,12 +2,13 @@ class Discuss < Vue
   def initialize
     @disabled = true
     @alert = nil
+    console.log('date now: ' + Date.new().toLocaleString())
 
     # initialize form fields
-    @user = Server.data.user
+    @member = Server.data.member
     console.log('discuss')
     console.log('token: ' + Server.data.token)
-    console.log('user: ' + @user)
+    console.log('member: ' + @member)
     @progress = Server.data.progress
     console.log('progress: ' + @progress.inspect)
     @phase = @progress[:phase]
@@ -49,7 +50,7 @@ class Discuss < Vue
       # Form fields
       #
       _div.form_group do
-        _label "Comment from " + @user, for: 'discussBody'
+        _label "Comment from " + @member, for: 'discussBody'
         _textarea.form_control rows: 4,
         required: true, placeholder: 'new comment',
         id: 'discussBody', value: @discussBody,
@@ -106,7 +107,7 @@ class Discuss < Vue
             # headers
             _div do
               _b 'From: '
-              _span @userEmail
+              _span @memberEmail
             end
             _div do
               _b 'To: '
@@ -176,7 +177,7 @@ class Discuss < Vue
     post 'validate', data do |response|
       @disabled = false
       @alert = response.error
-      @userEmail = response.userEmail
+      @memberEmail = response.memberEmail
       @pmcEmail = response.pmcEmail
       @invitation = response.invitation
       @token = response.token
diff --git a/www/project/icla/views/pages/invite.js.rb b/www/project/icla/views/pages/invite.js.rb
index b5d55d8..056bdfa 100644
--- a/www/project/icla/views/pages/invite.js.rb
+++ b/www/project/icla/views/pages/invite.js.rb
@@ -17,6 +17,7 @@ class Invite < Vue
     @previewMessage = 'Preview'
     @pmcOrPpmc = ''
     @phasePrefix = ''
+    @member = Server.data.member
 
 # initialize conditional text
     @showPMCVoteLink = false;
@@ -242,7 +243,7 @@ class Invite < Vue
             # headers
             _div do
               _b 'From: '
-              _span @userEmail
+              _span @memberEmail
             end
             _div do
               _b 'To: '
@@ -466,7 +467,7 @@ class Invite < Vue
     post 'validate', data do |response|
       @disabled = false
       @alert = response.error
-      @userEmail = response.userEmail
+      @memberEmail = response.memberEmail
       @pmcEmail = response.pmcEmail
       @invitation = response.invitation
       @token = response.token
@@ -487,7 +488,7 @@ class Invite < Vue
     post 'validate', data do |response|
       @disabled = false
       @alert = response.error
-      @userEmail = response.userEmail
+      @memberEmail = response.memberEmail
       @pmcEmail = response.pmcEmail
       @invitation = response.invitation
       @token = response.token
@@ -508,7 +509,7 @@ class Invite < Vue
     post 'validate', data do |response|
       @disabled = false
       @alert = response.error
-      @userEmail = response.userEmail
+      @memberEmail = response.memberEmail
       @pmcEmail = response.pmcEmail
       @invitation = response.invitation
       @token = response.token
diff --git a/www/project/icla/views/pages/vote.js.rb b/www/project/icla/views/pages/vote.js.rb
index 3964127..23295c2 100644
--- a/www/project/icla/views/pages/vote.js.rb
+++ b/www/project/icla/views/pages/vote.js.rb
@@ -4,11 +4,10 @@ class Vote < Vue
     @alert = nil
 
     # initialize form fields
-    @user = Server.data.user
+    @member = Server.data.member
     console.log('vote')
-    #    console.log('time now: ' + Time.now.to_s)
     console.log('token: ' + Server.data.token)
-    console.log('user: ' + @user)
+    console.log('member: ' + @member)
     @progress = Server.data.progress
     console.log('progress: ' + @progress.inspect)
     @phase = @progress[:phase]
@@ -143,7 +142,7 @@ class Vote < Vue
             # headers
             _div do
               _b 'From: '
-              _span @userEmail
+              _span @memberEmail
             end
             _div do
               _b 'To: '
@@ -218,7 +217,7 @@ class Vote < Vue
     post 'validate', data do |response|
       @disabled = false
       @alert = response.error
-      @userEmail = response.userEmail
+      @memberEmail = response.memberEmail
       @pmcEmail = response.pmcEmail
       @invitation = response.invitation
       @token = response.token

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

Mime
View raw message