[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-321-ga53cbae

Shawn Moore shawn at bestpractical.com
Tue Mar 14 13:17:27 EDT 2017


The branch, 4.4-trunk has been updated
       via  a53cbae145a7b08a122a65f1f438d3b39831dc75 (commit)
       via  4b11cf37360ad5084f6428c62553ccc6858313a7 (commit)
       via  f0a7105da8bc8f00a54bcdb5bfd48d788bbb888b (commit)
      from  19c6192bc23c008696e502faea7f752cb609572b (commit)

Summary of changes:
 share/html/Helpers/PreviewScrips      |  2 +-
 share/html/Ticket/Update.html         | 10 ++++++++++
 share/static/css/base/ticket-form.css |  4 ++++
 3 files changed, 15 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit f0a7105da8bc8f00a54bcdb5bfd48d788bbb888b
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Thu Mar 2 11:57:55 2017 -0500

    While PreviewScrips is reloading, disable its checkboxes
    
    This addresses a race condition between the PreviewScrips AJAX response
    coming back and the user checking/unchecking recipients. If the user
    timed it incorrectly, then their changes would be lost because it was
    too late for the new state to make it to the server, so the response
    wouldn't include those changes, and they would be lost when the response
    handler replaced the DOM nodes with the server's response.
    
    To prevent users from trying to click on any checkboxes while the
    PreviewScrips widget is reloading we disable the checkboxes, and set the
    opacity for the panel to 0.3 (to better hint to the user that the UI is
    temporarily disabled, since disabled checkboxes can be hard to notice).
    
    Fixes: I#32290

diff --git a/share/html/Helpers/PreviewScrips b/share/html/Helpers/PreviewScrips
index ecc2a3e..5295401 100644
--- a/share/html/Helpers/PreviewScrips
+++ b/share/html/Helpers/PreviewScrips
@@ -93,7 +93,7 @@ $submitted{$_} = 1 for split /,/, $ARGS{TxnRecipients};
 %          my $action = $s->ActionObj->Action;
 %          scalar(map { $action->$_ } qw(To Cc Bcc))
 %        } @scrips ) {
-<input type="checkbox" class="checkbox" id="TxnSendMailToAll" name="TxnSendMailToAll" value="1">
+<input type="checkbox" class="checkbox" id="TxnSendMailToAll" name="TxnSendMailToAll" <% $ARGS{TxnSendMailToAll} ? 'checked="checked"' : ''  %> value="1">
 <label for="TxnSendMailToAll"><b><% loc('All recipients') %></b></label><br />
 %   }
 %     for my $scrip (@scrips) {
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 8540600..6d32edb 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -225,9 +225,11 @@ jQuery( function() {
                }
            }
        );
+       jQuery('#previewscrips div.titlebox-content').addClass('refreshing');
        jQuery('#previewscrips div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/PreviewScrips',
            jQuery('form[name=TicketUpdate]').serializeArray(),
            function() {
+               jQuery('#previewscrips div.titlebox-content').removeClass('refreshing');
                var txn_send_field = jQuery("#previewscrips input[name=TxnSendMailTo]");
                txn_send_field.change( syncCheckboxes );
                txn_send_field.click( function () { setCheckbox(this) } );
@@ -237,6 +239,7 @@ jQuery( function() {
                }
            }
        );
+       jQuery("#previewscrips input[name=TxnSendMailToAll], #previewscrips input[name=TxnSendMailTo]").attr('disabled', true);
    };
    updateScrips();
 
diff --git a/share/static/css/base/ticket-form.css b/share/static/css/base/ticket-form.css
index f70f4b5..70ddfca 100644
--- a/share/static/css/base/ticket-form.css
+++ b/share/static/css/base/ticket-form.css
@@ -91,3 +91,7 @@ iframe.richtext-editor {
     position: absolute;
     margin-left: 0.5em;
 }
+
+.refreshing {
+    opacity: 0.3;
+}

commit 4b11cf37360ad5084f6428c62553ccc6858313a7
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Mar 14 17:07:17 2017 +0000

    While Simplified Recipients is reloading, disable its checkboxes
    
    See f0a7105da8bc8f00a54bcdb5bfd48d788bbb888b for more context

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 6d32edb..8ede039 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -213,9 +213,14 @@ jQuery( function() {
            var target = ev.target;
            jQuery("input[name=TxnSendMailTo]").filter( function() { return this.value == target.value; } ).prop("checked",jQuery(target).prop('checked'));
        };
+
+       jQuery('#recipients div.titlebox-content').addClass('refreshing');
+       jQuery('#previewscrips div.titlebox-content').addClass('refreshing');
+
        jQuery('#recipients div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/ShowSimplifiedRecipients',
            jQuery('form[name=TicketUpdate]').serializeArray(),
            function() {
+               jQuery('#recipients div.titlebox-content').removeClass('refreshing');
                var txn_send_field = jQuery("#recipients input[name=TxnSendMailTo]");
                txn_send_field.change( syncCheckboxes );
                txn_send_field.click( function () { setCheckbox(this) } );
@@ -225,7 +230,7 @@ jQuery( function() {
                }
            }
        );
-       jQuery('#previewscrips div.titlebox-content').addClass('refreshing');
+
        jQuery('#previewscrips div.titlebox-content').load( '<% RT->Config->Get('WebPath')%>/Helpers/PreviewScrips',
            jQuery('form[name=TicketUpdate]').serializeArray(),
            function() {
@@ -239,6 +244,8 @@ jQuery( function() {
                }
            }
        );
+
+       jQuery("#recipients input[name=TxnSendMailToAll], #recipients input[name=TxnSendMailTo]").attr('disabled', true);
        jQuery("#previewscrips input[name=TxnSendMailToAll], #previewscrips input[name=TxnSendMailTo]").attr('disabled', true);
    };
    updateScrips();

commit a53cbae145a7b08a122a65f1f438d3b39831dc75
Merge: 19c6192 4b11cf3
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Mar 14 17:17:19 2017 +0000

    Merge branch '4.4/preview-scrip-recipients-checkbox' into 4.4-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list