You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cl...@apache.org on 2017/12/31 15:20:25 UTC
[whimsy] branch master updated: Scaffolding for project/icla
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 5ec7197 Scaffolding for project/icla
5ec7197 is described below
commit 5ec719750e50d0c3a13ab0ee7c627fd339ae3943
Author: Craig L Russell <cr...@oracle.com>
AuthorDate: Sun Dec 31 07:20:15 2017 -0800
Scaffolding for project/icla
---
.../views/pages/{invite.js.rb => discuss.js.rb} | 186 ++------------------
www/project/icla/views/pages/invite.js.rb | 2 +
.../icla/views/pages/{invite.js.rb => vote.js.rb} | 188 ++-------------------
3 files changed, 28 insertions(+), 348 deletions(-)
diff --git a/www/project/icla/views/pages/invite.js.rb b/www/project/icla/views/pages/discuss.js.rb
similarity index 66%
copy from www/project/icla/views/pages/invite.js.rb
copy to www/project/icla/views/pages/discuss.js.rb
index dcaed55..d10c301 100644
--- a/www/project/icla/views/pages/invite.js.rb
+++ b/www/project/icla/views/pages/discuss.js.rb
@@ -1,4 +1,4 @@
-class Invite < Vue
+class Discuss < Vue
def initialize
@disabled = true
@alert = nil
@@ -9,8 +9,6 @@ class Invite < Vue
@pmc = ''
@votelink = ''
@noticelink = ''
- @phase = ''
- @role = ''
# initialize conditional text
@showPMCVoteLink = false;
@@ -21,34 +19,16 @@ class Invite < Vue
@showPPMCNoticeLink = false;
@noticeErrorMessage = '';
@showNoticeErrorMessage = false;
- @showDiscussFrame = false;
- @showVoteFrame = false;
- @showPhaseFrame = false;
- @showRoleFrame = false;
- @discussComment = ''
- @voteComment = ''
+
end
def render
_p %{
- This application allows PMC and PPMC members to
+ This application allows PMC and PPMC members to:
discuss contributors to achieve consensus;
- vote on contributors to become a committer or a PMC/PPMC member; or
+ vote on contributors to become a committer or a PMC or PPMC member; or
simply invite them to submit an ICLA.
}
- _p %{
- If you would like to discuss the candidate, go to the Discuss tab
- after filling the contributor and PMC/PPMC fields.
- }
- _p %{
- If you have discussed the candidate and would like to conduct a vote,
- go to the Vote tab after filling the contributor and PMC/PPMC fields.
- }
- _p %{
- If you have already achieved consensus, you can go to the Invite tab
- after filling the contributor and PMC/PPMC fields.
- }
-
# error messages
if @alert
@@ -88,19 +68,7 @@ class Invite < Vue
end
end
end
- if @showPhaseFrame
- _ul.nav.nav_tabs do
- _li class: ('active' if @phase == :discuss) do
- _a 'Discuss', onClick: self.selectDiscuss
- end
- _li class: ('active' if @phase == :vote) do
- _a 'Vote', onClick: self.selectVote
- end
- _li class: ('active' if @phase = :invite) do
- _a 'Invite', onClick: self.selectInvite
- end
- end
- end
+
if @showPMCVoteLink
_p %{
Fill the following field only if the person was voted by the PMC
@@ -135,6 +103,7 @@ class Invite < Vue
_span @voteErrorMessage
end
end
+
end
if @showPMCNoticeLink
_p %{
@@ -164,62 +133,15 @@ class Invite < Vue
_span @noticeErrorMessage
end
end
- if @showRoleFrame
- _div.form_group do
- _label do
- _input type: :radio, name: :role, value: :committer,
- onClick: -> {@role = :committer}
- _span :' Invite to become a committer'
- end
- _p
- _label do
- _input type: :radio, name: :role, value: :pmc,
- onClick: -> {@role = :pmc}
- _span ' Invite to become a committer and PMC/PPMC member'
- end
- _p
- _label do
- _input type: :radio, name: :role, value: :invite,
- onClick: -> {@role = :invite}
- _span ' Invite to submit an ICLA'
- end
- _p
- end
- end
- if @showDiscussFrame
- _span 'Comment'
- _p
- _textarea name: 'discussComment', value: @discussComment, rows: 4,
- onChange: self.setDiscussComment
- end
- if @showVoteFrame
- _span 'Comment'
- _p
- _textarea name: 'voteComment', value: @voteComment, rows: 4,
- onChange: self.setVoteComment
- end
-
#
- # Submission buttons
+ # Submission button
#
- if @phase == 'invite'
- _p do
- _button.btn.btn_primary 'Preview Invitation', disabled: @disabled,
+
+ _p do
+ _button.btn.btn_primary 'Preview Invitation', disabled: @disabled,
onClick: self.previewInvitation
- end
- end
- if @phase == 'discuss'
- _p do
- _button.btn.btn_primary 'Preview Discussion', disabled: @disabled,
- onClick: self.previewDiscussion
- end
- end
- if @phase == 'vote'
- _p do
- _button.btn.btn_primary 'Preview Vote', disabled: @disabled,
- onClick: self.previewVote
- end
end
+
#
# Hidden form: preview invite email
#
@@ -261,7 +183,7 @@ class Invite < Vue
end
end
end
- _p
+
end
@@ -286,48 +208,6 @@ class Invite < Vue
def setPMC(event)
@pmc = event.target.value
- @phase = :discuss
- @showPhaseFrame = true
- @showRoleFrame = true
- self.checkValidity()
- selectDiscuss()
- end
-
- def selectDiscuss(event)
- @phase = :discuss
- @showDiscussFrame = true;
- @showRoleFrame = true;
- @showVoteFrame = false;
- @showPMCVoteLink = false
- @showPPMCVoteLink = false
- @showPMCNoticeLink = false
- @showPPMCNoticeLink = false
- @showVoteErrorMessage = false;
- @showNoticeErrorMessage = false;
- self.checkValidity()
- @disabled = false;
- end
-
- def selectVote(event)
- @phase = :vote
- @showVoteFrame = true;
- @showRoleFrame = true;
- @showDiscussFrame = false;
- @showPMCVoteLink = false
- @showPPMCVoteLink = false
- @showPMCNoticeLink = false
- @showPPMCNoticeLink = false
- @showVoteErrorMessage = false;
- @showNoticeErrorMessage = false;
- self.checkValidity()
- @disabled = false;
- end
-
- def selectInvite(event)
- @phase = :invite
- @showDiscussFrame = false;
- @showVoteFrame = false;
- @showRoleFrame = false;
@showPMCVoteLink = Server.data.pmcs.include? @pmc
@showPPMCVoteLink = Server.data.ppmcs.include? @pmc
@showPMCNoticeLink = Server.data.pmcs.include? @pmc
@@ -355,7 +235,7 @@ class Invite < Vue
a message via lists.apache.org"
@showVoteErrorMessage = true;
end
- if not @votelink=~ /.*private\.#{@pmc_mail[@pmc]}(\.incubator)?\.apache\.org.*/
+ if not @votelink=~ /.*private\@#{Server.data.pmc_mail[@pmc]}(\.incubator)?\.apache\.org.*/
@voteErrorMessage = "Error: Please link to\
the [RESULT][VOTE] message sent to the private list."
@showVoteErrorMessage = true;
@@ -438,46 +318,6 @@ class Invite < Vue
jQuery('#invitation-preview').modal(:show) unless @alert
end
end
- def previewDiscussion()
- data = {
- iclaname: @iclaname,
- iclaemail: @iclaemail,
- pmc: @pmc,
- }
-
- @disabled = true
- @alert = nil
- post 'validate', data do |response|
- @disabled = false
- @alert = response.error
- @userEmail = response.userEmail
- @pmcEmail = response.pmcEmail
- @invitation = response.invitation
- @token = response.token
- document.getElementById(response.focus).focus() if response.focus
- jQuery('#invitation-preview').modal(:show) unless @alert
- end
- end
- def previewVote()
- data = {
- iclaname: @iclaname,
- iclaemail: @iclaemail,
- pmc: @pmc,
- }
-
- @disabled = true
- @alert = nil
- post 'validate', data do |response|
- @disabled = false
- @alert = response.error
- @userEmail = response.userEmail
- @pmcEmail = response.pmcEmail
- @invitation = response.invitation
- @token = response.token
- document.getElementById(response.focus).focus() if response.focus
- jQuery('#invitation-preview').modal(:show) unless @alert
- end
- end
# pretend to send an invitation
def mockSend()
diff --git a/www/project/icla/views/pages/invite.js.rb b/www/project/icla/views/pages/invite.js.rb
index dcaed55..dc596d5 100644
--- a/www/project/icla/views/pages/invite.js.rb
+++ b/www/project/icla/views/pages/invite.js.rb
@@ -443,6 +443,7 @@ class Invite < Vue
iclaname: @iclaname,
iclaemail: @iclaemail,
pmc: @pmc,
+ discussComment: @discussComment
}
@disabled = true
@@ -463,6 +464,7 @@ class Invite < Vue
iclaname: @iclaname,
iclaemail: @iclaemail,
pmc: @pmc,
+ voteComment: @voteComment
}
@disabled = true
diff --git a/www/project/icla/views/pages/invite.js.rb b/www/project/icla/views/pages/vote.js.rb
similarity index 65%
copy from www/project/icla/views/pages/invite.js.rb
copy to www/project/icla/views/pages/vote.js.rb
index dcaed55..e5c1715 100644
--- a/www/project/icla/views/pages/invite.js.rb
+++ b/www/project/icla/views/pages/vote.js.rb
@@ -1,4 +1,4 @@
-class Invite < Vue
+class Vote < Vue
def initialize
@disabled = true
@alert = nil
@@ -9,8 +9,6 @@ class Invite < Vue
@pmc = ''
@votelink = ''
@noticelink = ''
- @phase = ''
- @role = ''
# initialize conditional text
@showPMCVoteLink = false;
@@ -21,34 +19,14 @@ class Invite < Vue
@showPPMCNoticeLink = false;
@noticeErrorMessage = '';
@showNoticeErrorMessage = false;
- @showDiscussFrame = false;
- @showVoteFrame = false;
- @showPhaseFrame = false;
- @showRoleFrame = false;
- @discussComment = ''
- @voteComment = ''
+
end
def render
_p %{
- This application allows PMC and PPMC members to
- discuss contributors to achieve consensus;
- vote on contributors to become a committer or a PMC/PPMC member; or
- simply invite them to submit an ICLA.
- }
- _p %{
- If you would like to discuss the candidate, go to the Discuss tab
- after filling the contributor and PMC/PPMC fields.
+ This application allows PMC and PPMC members to vote to invite a
+ contributor to become a committer and/or PMC or PPMC member.
}
- _p %{
- If you have discussed the candidate and would like to conduct a vote,
- go to the Vote tab after filling the contributor and PMC/PPMC fields.
- }
- _p %{
- If you have already achieved consensus, you can go to the Invite tab
- after filling the contributor and PMC/PPMC fields.
- }
-
# error messages
if @alert
@@ -88,19 +66,7 @@ class Invite < Vue
end
end
end
- if @showPhaseFrame
- _ul.nav.nav_tabs do
- _li class: ('active' if @phase == :discuss) do
- _a 'Discuss', onClick: self.selectDiscuss
- end
- _li class: ('active' if @phase == :vote) do
- _a 'Vote', onClick: self.selectVote
- end
- _li class: ('active' if @phase = :invite) do
- _a 'Invite', onClick: self.selectInvite
- end
- end
- end
+
if @showPMCVoteLink
_p %{
Fill the following field only if the person was voted by the PMC
@@ -135,6 +101,7 @@ class Invite < Vue
_span @voteErrorMessage
end
end
+
end
if @showPMCNoticeLink
_p %{
@@ -164,62 +131,15 @@ class Invite < Vue
_span @noticeErrorMessage
end
end
- if @showRoleFrame
- _div.form_group do
- _label do
- _input type: :radio, name: :role, value: :committer,
- onClick: -> {@role = :committer}
- _span :' Invite to become a committer'
- end
- _p
- _label do
- _input type: :radio, name: :role, value: :pmc,
- onClick: -> {@role = :pmc}
- _span ' Invite to become a committer and PMC/PPMC member'
- end
- _p
- _label do
- _input type: :radio, name: :role, value: :invite,
- onClick: -> {@role = :invite}
- _span ' Invite to submit an ICLA'
- end
- _p
- end
- end
- if @showDiscussFrame
- _span 'Comment'
- _p
- _textarea name: 'discussComment', value: @discussComment, rows: 4,
- onChange: self.setDiscussComment
- end
- if @showVoteFrame
- _span 'Comment'
- _p
- _textarea name: 'voteComment', value: @voteComment, rows: 4,
- onChange: self.setVoteComment
- end
-
#
- # Submission buttons
+ # Submission button
#
- if @phase == 'invite'
- _p do
- _button.btn.btn_primary 'Preview Invitation', disabled: @disabled,
+
+ _p do
+ _button.btn.btn_primary 'Preview Invitation', disabled: @disabled,
onClick: self.previewInvitation
- end
- end
- if @phase == 'discuss'
- _p do
- _button.btn.btn_primary 'Preview Discussion', disabled: @disabled,
- onClick: self.previewDiscussion
- end
- end
- if @phase == 'vote'
- _p do
- _button.btn.btn_primary 'Preview Vote', disabled: @disabled,
- onClick: self.previewVote
- end
end
+
#
# Hidden form: preview invite email
#
@@ -261,7 +181,7 @@ class Invite < Vue
end
end
end
- _p
+
end
@@ -286,48 +206,6 @@ class Invite < Vue
def setPMC(event)
@pmc = event.target.value
- @phase = :discuss
- @showPhaseFrame = true
- @showRoleFrame = true
- self.checkValidity()
- selectDiscuss()
- end
-
- def selectDiscuss(event)
- @phase = :discuss
- @showDiscussFrame = true;
- @showRoleFrame = true;
- @showVoteFrame = false;
- @showPMCVoteLink = false
- @showPPMCVoteLink = false
- @showPMCNoticeLink = false
- @showPPMCNoticeLink = false
- @showVoteErrorMessage = false;
- @showNoticeErrorMessage = false;
- self.checkValidity()
- @disabled = false;
- end
-
- def selectVote(event)
- @phase = :vote
- @showVoteFrame = true;
- @showRoleFrame = true;
- @showDiscussFrame = false;
- @showPMCVoteLink = false
- @showPPMCVoteLink = false
- @showPMCNoticeLink = false
- @showPPMCNoticeLink = false
- @showVoteErrorMessage = false;
- @showNoticeErrorMessage = false;
- self.checkValidity()
- @disabled = false;
- end
-
- def selectInvite(event)
- @phase = :invite
- @showDiscussFrame = false;
- @showVoteFrame = false;
- @showRoleFrame = false;
@showPMCVoteLink = Server.data.pmcs.include? @pmc
@showPPMCVoteLink = Server.data.ppmcs.include? @pmc
@showPMCNoticeLink = Server.data.pmcs.include? @pmc
@@ -355,7 +233,7 @@ class Invite < Vue
a message via lists.apache.org"
@showVoteErrorMessage = true;
end
- if not @votelink=~ /.*private\.#{@pmc_mail[@pmc]}(\.incubator)?\.apache\.org.*/
+ if not @votelink=~ /.*private\@#{Server.data.pmc_mail[@pmc]}(\.incubator)?\.apache\.org.*/
@voteErrorMessage = "Error: Please link to\
the [RESULT][VOTE] message sent to the private list."
@showVoteErrorMessage = true;
@@ -438,46 +316,6 @@ class Invite < Vue
jQuery('#invitation-preview').modal(:show) unless @alert
end
end
- def previewDiscussion()
- data = {
- iclaname: @iclaname,
- iclaemail: @iclaemail,
- pmc: @pmc,
- }
-
- @disabled = true
- @alert = nil
- post 'validate', data do |response|
- @disabled = false
- @alert = response.error
- @userEmail = response.userEmail
- @pmcEmail = response.pmcEmail
- @invitation = response.invitation
- @token = response.token
- document.getElementById(response.focus).focus() if response.focus
- jQuery('#invitation-preview').modal(:show) unless @alert
- end
- end
- def previewVote()
- data = {
- iclaname: @iclaname,
- iclaemail: @iclaemail,
- pmc: @pmc,
- }
-
- @disabled = true
- @alert = nil
- post 'validate', data do |response|
- @disabled = false
- @alert = response.error
- @userEmail = response.userEmail
- @pmcEmail = response.pmcEmail
- @invitation = response.invitation
- @token = response.token
- document.getElementById(response.focus).focus() if response.focus
- jQuery('#invitation-preview').modal(:show) unless @alert
- end
- end
# pretend to send an invitation
def mockSend()
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].