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/27 14:55:25 UTC
[whimsy] 02/02: post action items refresh issues
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
commit 6188e2659236d41642878c72e05df914ae899bbc
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Wed Sep 27 10:54:11 2017 -0400
post action items refresh issues
---
www/board/agenda/views/buttons/post-actions.js.rb | 4 ++--
www/board/agenda/views/pages/action-items.js.rb | 12 ++++--------
www/board/agenda/views/pages/select-actions.rb | 13 +++++++++----
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/www/board/agenda/views/buttons/post-actions.js.rb b/www/board/agenda/views/buttons/post-actions.js.rb
index 375337f..acf72dd 100644
--- a/www/board/agenda/views/buttons/post-actions.js.rb
+++ b/www/board/agenda/views/buttons/post-actions.js.rb
@@ -8,14 +8,14 @@ class PostActions < Vue
def render
_button.btn.btn_primary 'post actions', onClick: self.click,
- disabled: @disabled || SelectActions.list.empty?
+ disabled: @disabled || SelectActions.data.list.emtpy?
end
def click(event)
data = {
agenda: Agenda.file,
message: 'Post Action Items',
- actions: SelectActions.list
+ actions: SelectActions.data.list
}
@disabled = true
diff --git a/www/board/agenda/views/pages/action-items.js.rb b/www/board/agenda/views/pages/action-items.js.rb
index a14d96c..d3fe82a 100644
--- a/www/board/agenda/views/pages/action-items.js.rb
+++ b/www/board/agenda/views/pages/action-items.js.rb
@@ -186,24 +186,20 @@ class ActionItems < Vue
def updateStatus(event)
parent = event.target.parentNode
- # construct action from data attributes
- action = {}
+ # update state from data attributes
for i in 0...parent.attributes.length
attr = parent.attributes[i]
- action[attr.name[5..-1]] = attr.value if attr.name.start_with? 'data-'
+ $data[attr.name[5..-1]] = attr.value if attr.name.start_with? 'data-'
end
# unindent action
- action.status.gsub!(/\n {14}/, "\n")
+ @status.gsub!(/\n {14}/, "\n")
# set baseline to current value
- action.baseline = action.status
+ @baseline = @status
# show dialog
jQuery('#updateStatusForm').modal(:show)
-
- # update state
- self.setState(action)
end
# when save button is pushed, post update and dismiss modal when complete
diff --git a/www/board/agenda/views/pages/select-actions.rb b/www/board/agenda/views/pages/select-actions.rb
index 432fc3a..19078e4 100644
--- a/www/board/agenda/views/pages/select-actions.rb
+++ b/www/board/agenda/views/pages/select-actions.rb
@@ -9,10 +9,15 @@ class SelectActions < Vue
end
def initialize
- SelectActions.list = []
+ @list = []
@names = []
end
+ def created()
+ console.log 'created'
+ SelectActions.data = $data
+ end
+
def render
_h3 'Post Action Items'
@@ -21,7 +26,7 @@ class SelectActions < Vue
'Click on the "post actions" button when done.'
_pre.report do
- SelectActions.list.each do |action|
+ @list.each do |action|
_CandidateAction action: action, names: @names
end
end
@@ -30,7 +35,7 @@ class SelectActions < Vue
def mounted()
retrieve 'potential-actions', :json do |response|
if response
- SelectActions.list = response.actions
+ @list = response.actions
@names = response.names
end
end
@@ -40,7 +45,7 @@ end
class CandidateAction < Vue
def render
_input type: 'checkbox', checked: !@@action.complete,
- onChange:-> {@@action.complete = !@@action.complete; Vue.forceUpdate()}
+ onChange:-> {@@action.complete = !@@action.complete}
_span " "
_span @@action.owner
_span ": "
--
To stop receiving notification emails like this one, please contact
"commits@whimsical.apache.org" <co...@whimsical.apache.org>.