You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/03/23 10:50:58 UTC

[whimsy] branch master updated: Also use modal form for showing errors

This is an automated email from the ASF dual-hosted git repository.

sebb 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 f8f90a6  Also use modal form for showing errors
f8f90a6 is described below

commit f8f90a603a8051d96cd6d87b1ac96cf7e42fc6b7
Author: Sebb <se...@apache.org>
AuthorDate: Sat Mar 23 10:50:55 2019 +0000

    Also use modal form for showing errors
---
 www/roster/views/person.js.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/www/roster/views/person.js.rb b/www/roster/views/person.js.rb
index c60fcef..f323119 100644
--- a/www/roster/views/person.js.rb
+++ b/www/roster/views/person.js.rb
@@ -258,13 +258,13 @@ class Person < Vue
     # SpamAssassin score
     _PersonSascore person: self, edit: @edit
 
-    # modal dialog for dry run results
+    # modal dialog for dry run results and errors
     _div.modal.fade.wide_form tabindex: -1 do
       _div.modal_dialog do
         _div.modal_content do
           _div.modal_header do
             _button.close 'x', data_dismiss: 'modal'
-            _h4 'Dry run results'
+            _h4 @response_title
           end
           _div.modal_body do
             _textarea value: @response, readonly: true
@@ -363,9 +363,17 @@ class Person < Vue
       },
 
       complete: ->(response) do
+        json = response.responseJSON
         # show results of dryrun
         if formData[0] and formData[0].name == 'dryrun'
-          @response = JSON.stringify(response.responseJSON, nil, 2)
+          @response_title = 'Dry run results'
+          @response = JSON.stringify(json, nil, 2)
+          jQuery('div.modal').modal('show')
+        end
+
+        if json.error
+          @response_title = 'Error occurred'
+          @response = JSON.stringify(json, nil, 2)
           jQuery('div.modal').modal('show')
         end