whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch mail_ldap_notification updated: Prototype debugger function
Date Tue, 04 Jun 2019 22:46:11 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/mail_ldap_notification by this push:
     new 7c3eaac  Prototype debugger function
7c3eaac is described below

commit 7c3eaac4dd3d01cd09d0c97b643327c2ab18bcab
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Tue Jun 4 18:46:02 2019 -0400

    Prototype debugger function
---
 www/roster/main.rb                |  2 ++
 www/roster/models/debugger.rb     | 11 ++++++++
 www/roster/views/debugger.html.rb |  4 +--
 www/roster/views/debugger.js.rb   | 59 +++++++++++++++++++++++++++++++++++++--
 4 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/www/roster/main.rb b/www/roster/main.rb
index b2f593c..b55c7de 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -338,5 +338,7 @@ get '/debugger' do
   unless @committer.asf_member?
     halt 401, "Not authorized\n"
   end
+  @debugger = Debugger.serialize(@committer, env)
+  pass unless @debugger
   _html :debugger
 end
diff --git a/www/roster/models/debugger.rb b/www/roster/models/debugger.rb
new file mode 100644
index 0000000..b5022d8
--- /dev/null
+++ b/www/roster/models/debugger.rb
@@ -0,0 +1,11 @@
+#
+# Debugging tool model for holding any test data
+#
+class Debugger
+  def self.serialize(committer, env)
+    response = {env: env}
+    pmc = ASF::Committee.find('whimsy')
+    response[:pmc] = true if pmc.roster.has_key? committer.id
+    return response
+  end
+end
diff --git a/www/roster/views/debugger.html.rb b/www/roster/views/debugger.html.rb
index 02647b3..6575719 100644
--- a/www/roster/views/debugger.html.rb
+++ b/www/roster/views/debugger.html.rb
@@ -12,14 +12,14 @@ _html do
         test: '/test.cgi'
       }
     ) do
+      _h3 "Before debugger"
       _div_.main!
+      _h3 "After debugger!"
     end
 
     _script src: "app.js?#{appmtime}"
     _.render '#main' do
-      _h3 "Debugger below:"
       _Debugger committer: @committer, auth: @auth
-      _h3 "Debugger ends"
     end
   end
 end
diff --git a/www/roster/views/debugger.js.rb b/www/roster/views/debugger.js.rb
index 0ff6ed5..8f07c4d 100644
--- a/www/roster/views/debugger.js.rb
+++ b/www/roster/views/debugger.js.rb
@@ -14,12 +14,65 @@ class Debugger < Vue
         _ "#{@auth}"
       end
     end
-
-    _h2 "Welcome #{@committer.id}@apache.org"
-    _p 'TODO: add actions to allow debugging utility methods'
+    _h2 "Welcome #{@committer.id}@apache.org"      
+    # Test bar: allow testing of a string input
+    _div.row key: 'databar' do
+      _div.col_sm_6 do
+        _input.form_control type: 'value', placeholder: 'value to use',
+        value: @value
+      end
+      _div.col_sm_6 do
+        _button.btn.btn_default 'LDAP Lookup', data_target: '#debugldap'
+      end
+    end
   end
   
   def created
   end
 
 end
+
+class DebugLDAP < Vue
+  options add_tag: "debugldap", add_action: 'actions/debugger'
+
+  def initialize
+    @search = []
+  end
+
+  def render
+    def render
+      _div.modal.fade id: $options.add_tag, tabindex: -1 do
+        _div.modal_dialog do
+          _div.modal_content do
+            _div.modal_header.bg_info do
+              _button.close 'x', data_dismiss: 'modal'
+              _h4.modal_title 'Do a debug LDAP Lookup'
+            end
+            _div.modal_body do
+              _div.container_fluid do
+                _div.form_group do
+                  _label.control_label.col_sm_3 'Search LDAP for', for:  'search-text'
+                  _div.col_sm_9 do
+                    _div.input_group do
+                      _input.form_control autofocus: true, value: @search, 
+                        onInput: self.change
+                      _span.input_group_addon do
+                        _span.glyphicon.glyphicon_user aria_label: "LDAP search query"
+                      end
+                    end
+                  end
+                end
+              end
+            end
+            _div.modal_footer do
+              _button.btn.btn_default 'Cancel', data_dismiss: 'modal'
+              _button.btn.btn_primary "Search LDAP", 
+                data_action: 'search ldap',
+                onClick: self.post, disabled: (@search.empty?)
+            end
+          end
+        end
+      end
+    end
+  end
+end
\ No newline at end of file


Mime
View raw message