whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: retain doc if pubkey not found
Date Sun, 02 Oct 2016 23:29:03 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  b117062   retain doc if pubkey not found
b117062 is described below

commit b117062ef1752572569d8556efeead540acddae1
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Oct 2 19:28:33 2016 -0400

    retain doc if pubkey not found
---
 www/secmail/helpers.rb                   | 33 ++++++++++++++++++++------------
 www/secmail/public/tasklist.js           | 15 +++++++++++----
 www/secmail/views/actions/pubkey.json.rb |  3 +++
 www/secmail/views/parts.js.rb            |  8 ++++++++
 4 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/www/secmail/helpers.rb b/www/secmail/helpers.rb
index 417c7c8..c6b215f 100644
--- a/www/secmail/helpers.rb
+++ b/www/secmail/helpers.rb
@@ -22,25 +22,34 @@ class Wunderbar::JsonBuilder
   #
 
   def _extract_project
-		if @project and not @project.empty?
-			@pmc = ASF::Committee[@project]
+    if @project and not @project.empty?
+      @pmc = ASF::Committee[@project]
 
-			if not @pmc
-				@podling = ASF::Podling.find(@project)
+      if not @pmc
+        @podling = ASF::Podling.find(@project)
 
-				if @podling and not %w(graduated retired).include? @podling.status
-					@pmc = ASF::Committee['incubator']
+        if @podling and not %w(graduated retired).include? @podling.status
+          @pmc = ASF::Committee['incubator']
 
           unless @podling.private_mail_list
             _info "#{@project} mailing lists have not yet been set up"
             @podling = nil 
           end
-				end
-			end
+        end
+      end
+
+      if not @pmc
+        _warn "#{@project} is not an active PMC or podling"
+      end
+    end
+  end
 
-			if not @pmc
-				_warn "#{@project} is not an active PMC or podling"
-			end
-		end
+  # update the status of a message
+  def _status(status_text)
+    message = Mailbox.find(@message)
+    message.headers[:secmail] ||= {}
+    message.headers[:secmail][:status] = status_text
+    message.write_headers
+    _headers message.headers
   end
 end
diff --git a/www/secmail/public/tasklist.js b/www/secmail/public/tasklist.js
index f420db5..de8a8f2 100644
--- a/www/secmail/public/tasklist.js
+++ b/www/secmail/public/tasklist.js
@@ -1,5 +1,7 @@
 var tasks = $('h3');
 var spinner = $('<img src="../spinner.gif"/>');
+var disposition = null;
+var headers = null;
 
 // Load fetch shim, if needed (e.g., by Safari)
 if (typeof fetch === 'undefined') {
@@ -63,10 +65,14 @@ function nexttask(proceed) {
           pre.text(json.exception);
           task.append(pre);
         }
-      });
 
-      // conditionally proceed to the next task
-      nexttask(response.ok || confirm(response.statusText + "; continue?"));
+        if (json.disposition) disposition = json.disposition;
+        if (json.headers) headers = json.headers;
+
+        // conditionally proceed to the next task
+        nexttask(response.ok || 
+          confirm(response.statusText + "; continue?"));
+      });
     }).catch(function(error) {
       nexttask(confirm(error.message + "; continue?"));
     });
@@ -86,9 +92,10 @@ function nexttask(proceed) {
       $('button#cancel').remove();
       $('button#proceed').html('return to<br>mail index').
         prop('disabled', false);
-      message = {status: 'complete'};
+      message = {status: disposition || 'complete'};
     }
 
+    if (headers) message.headers = headers;
     window.parent.frames[0].postMessage(message, '*')
   }
 };
diff --git a/www/secmail/views/actions/pubkey.json.rb b/www/secmail/views/actions/pubkey.json.rb
index f445cd3..153f6a1 100644
--- a/www/secmail/views/actions/pubkey.json.rb
+++ b/www/secmail/views/actions/pubkey.json.rb
@@ -26,5 +26,8 @@ task "email #{message.from}" do
   # deliver mail
   complete do
     mail.deliver!
+
+    _status 'email requesting upload of public key sent.'
+    _disposition :keep
   end
 end
diff --git a/www/secmail/views/parts.js.rb b/www/secmail/views/parts.js.rb
index 1cdf7cd..b679241 100644
--- a/www/secmail/views/parts.js.rb
+++ b/www/secmail/views/parts.js.rb
@@ -57,6 +57,10 @@ class Parts < React
       end
     end
 
+    if @headers and @headers.secmail and @headers.secmail.status
+      _div.alert.alert_info @headers.secmail.status
+    end
+
     # context menu that displays when you 'right click' an attachment
     _ul.contextMenu do
       _li "\u2704 burst", onMouseDown: self.burst
@@ -432,6 +436,10 @@ class Parts < React
   def status_update(event)
     if event.data.status == 'complete'
       self.delete_attachment(event)
+    elsif event.data.status == 'keep'
+      @selected = nil
+      @form = :categorize
+      self.extractHeaders event.data.headers if event.data.headers
     end
   end
 

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

Mime
View raw message