[Rt-commit] rt branch, 5.0-trunk, created. rt-4.4.4-886-g97b25b3a6

? sunnavy sunnavy at bestpractical.com
Fri Feb 14 15:44:36 EST 2020


The branch, 5.0-trunk has been created
        at  97b25b3a611ce044c6c0278549784ad8142dd237 (commit)

- Log -----------------------------------------------------------------
commit 9d1e277294e5d0ea3b80a212a660f594a529dd4d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 14 21:25:46 2020 +0800

    Migrate unread message box to elevator themes
    
    The UI was refactored in 4.4, now we have the new UI merged, we need to
    migrate it to elevator themes accordingly.
    
    This change is mainly to style buttons and paddings.

diff --git a/share/html/Ticket/Elements/ShowUpdateStatus b/share/html/Ticket/Elements/ShowUpdateStatus
index 9c3bc43f9..8b7a4d34e 100644
--- a/share/html/Ticket/Elements/ShowUpdateStatus
+++ b/share/html/Ticket/Elements/ShowUpdateStatus
@@ -47,16 +47,18 @@
 %# END BPS TAGGED BLOCK }}}
 <div class="unread-messages">
 <&| /Widgets/TitleBox, title => loc('New messages'), title_href => "#txn-". $txn->id &>
-<div>
-<span class="new-messages-on-ticket">
-<&|/l&>There are unread messages on this ticket.</&>
-</span>
-<span class="new-messages-buttons">
-<a class="button small-button" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id ."#txn-" . $txn->id |n %>"><&|/l&>Jump to Unread</&></a>
-<a class="button small-button" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id. "&MarkAsSeen=1" |n %>"><&|/l&>Mark as Seen</&></a>
-<a class="button small-button" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id |n %>"><&|/l&>Jump & Mark as Seen</&></a>
-</span>
-</div>
+  <div class="form-row">
+    <div class="col-md-12">
+      <span class="new-messages-on-ticket">
+        <&|/l&>There are unread messages on this ticket.</&>
+      </span>
+      <span class="new-messages-buttons">
+        <a class="button btn btn-primary btn-sm" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id ."#txn-" . $txn->id |n %>"><&|/l&>Jump to Unread</&></a>
+        <a class="button btn btn-primary btn-sm" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id. "&MarkAsSeen=1" |n %>"><&|/l&>Mark as Seen</&></a>
+        <a class="button btn btn-primary btn-sm" href="<% RT->Config->Get('WebPath') ."/$DisplayPath/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id |n %>"><&|/l&>Jump & Mark as Seen</&></a>
+      </span>
+    </div>
+  </div>
 </&>
 </div>
 <%ARGS>

commit 1422a3c7d7a3761599793d0ce34a182e7fd821e2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 14 22:05:11 2020 +0800

    Fix titlebox spacing on config pages
    
    As we updated spacing in 4.6/fix-inconsistent-ticket-display-spacing,
    it's good to keep it consistent on config pages too.

diff --git a/share/static/css/elevator-light/admin.css b/share/static/css/elevator-light/admin.css
index f2876e562..6e847a83b 100644
--- a/share/static/css/elevator-light/admin.css
+++ b/share/static/css/elevator-light/admin.css
@@ -206,6 +206,11 @@ div.inline-row i {
 .configuration .tab-content .tab-content {
     padding-top: 0;
 }
-.configuration .card.titlebox {
+
+.configuration .tab-content .card.titlebox {
     margin-top: 0;
 }
+
+.configuration > .titlebox-content {
+    margin-top: 20px;
+}

commit 165ca692356e9d8fb758846c364ead7774a890cd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 14 22:47:00 2020 +0800

    Don't set all the options as default values for selectize email inputs
    
    Options are not always consistent with default values: it could contain
    more. E.g. we add all the suggested one-time-cc addresses in options on
    ticket update page.
    
    Thus we need to split items from options. See also 51a17eb01a

diff --git a/share/html/Elements/EmailInput b/share/html/Elements/EmailInput
index c312db266..3ecd7bd35 100644
--- a/share/html/Elements/EmailInput
+++ b/share/html/Elements/EmailInput
@@ -83,7 +83,10 @@
 
 % if (@options) {
     data-options="<% JSON(\@options) %>"
-    data-items="<% JSON([ map { $_->{value} } @options ]) %>"
+% }
+
+% if (@items) {
+    data-items="<% JSON(\@items) %>"
 % }
 
 />
@@ -96,21 +99,38 @@
 
 <%INIT>
 my @options;
+my @items;
 if ($AutocompleteMultiple) {
-    for my $email ( @$Options, ( split '\s*,\s*', $Default || '' ) ) {
-        next unless $email =~ /\S/;
+
+    my $get_autocomplete_option = sub {
+        my $term = shift;
+        return unless $term =~ /\S/;
         my $json = $m->scomp(
             '/Helpers/Autocomplete/Users',
-            term => $email,
+            term => $term,
             max  => 1,
             $AutocompleteReturn ? ( return => $AutocompleteReturn ) : (),
             abort => 0,
         );
         if ($json) {
             if ( my $parsed = JSON::from_json($json) ) {
-                push @options, $parsed->[0] || ();
+                return $parsed->[0] || ();
             }
         }
+        return;
+    };
+
+    for my $email ( @$Options ) {
+        if ( my $option = $get_autocomplete_option->($email) ) {
+            push @options, $option;
+        }
+    }
+
+    for my $email ( split '\s*,\s*', $Default || '' ) {
+        if ( my $option = $get_autocomplete_option->($email) ) {
+            push @options, $option;
+            push @items, $option->{value};
+        }
     }
 }
 </%INIT>

commit 2314b24b3e8a69b98055a3bb16cf798152596f77
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 14 23:41:42 2020 +0800

    Wrap Submit into a form-row on search pages
    
    We do so consistently, and specially as .titlebox doesn't have
    margin-bottom any more, we need this to get a decent spacing.

diff --git a/share/html/Search/Build.html b/share/html/Search/Build.html
index b586a61e1..1240dd8fa 100644
--- a/share/html/Search/Build.html
+++ b/share/html/Search/Build.html
@@ -83,8 +83,12 @@
     <div id="pick-criteria">
       <& Elements/PickCriteria, query => $query{'Query'}, queues => $queues, %ARGS &>
     </div>
-    <& /Elements/Submit,  Label => loc('Add these terms'), SubmitId => 'AddClause', Name => 'AddClause'&>
-    <& /Elements/Submit, Label => loc('Add these terms and Search'), SubmitId => 'DoSearch', Name => 'DoSearch'&>
+    <div class="form-row">
+      <div class="col-md-12">
+        <& /Elements/Submit,  Label => loc('Add these terms'), SubmitId => 'AddClause', Name => 'AddClause'&>
+        <& /Elements/Submit, Label => loc('Add these terms and Search'), SubmitId => 'DoSearch', Name => 'DoSearch'&>
+      </div>
+    </div>
   </div>
 
   <div id="editquery" class="col-xl-5">
@@ -108,7 +112,11 @@
 &>
 </div>
 
-<& /Elements/Submit, Label => loc('Update format and Search'), Name => 'DoSearch', id=>"formatbuttons"&>
+  <div class="form-row">
+    <div class="col-md-12">
+      <& /Elements/Submit, Label => loc('Update format and Search'), Name => 'DoSearch', id=>"formatbuttons"&>
+    </div>
+  </div>
 </form>
 
 <%INIT>
diff --git a/share/html/Search/Edit.html b/share/html/Search/Edit.html
index 563dd7cf2..308af2295 100644
--- a/share/html/Search/Edit.html
+++ b/share/html/Search/Edit.html
@@ -62,7 +62,11 @@
 <&|/Widgets/TitleBox, title => loc('Format'), &>
 <textarea class="form-control" name="Format" rows="8" cols="72"><% $Format %></textarea>
 </&>
-<& /Elements/Submit, Label => loc("Apply"), Reset => 1, Caption => loc("Apply your changes")&>
+  <div class="form-row">
+    <div class="col-md-12">
+      <& /Elements/Submit, Label => loc("Apply"), Reset => 1, Caption => loc("Apply your changes")&>
+    </div>
+  </div>
 </form>
 
 <%INIT>

commit fd251a41ce9f798f542ffc461d78b217ec706e1e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 14 23:51:59 2020 +0800

    Fix hidden one-time suggestions on ticket update page
    
    As we migrated from table to div, "td" needs to be updated accordingly.
    Otherwise, clicking "show suggestions" won't work.
    
    There is also a style tweak to show all the suggestions in a row but
    wrap if necessary.

diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
index a1710fffc..aa4be3bd1 100644
--- a/share/html/Ticket/Elements/UpdateCc
+++ b/share/html/Ticket/Elements/UpdateCc
@@ -66,7 +66,7 @@
       <a href="#" class="ToggleSuggestions" data-hide-label="<% $hide_label %>" data-show-label="<% $show_label %>">
         <i class="label">(<&|/l&>show suggestions</&>)</i>
       </a>
-      <div class="OneTimeCcs hidden">
+      <div class="OneTimeCcs d-flex flex-wrap hidden">
 %   }
 
       <i class="col-md-auto">(<&|/l&>check to add</&>)</i>
@@ -118,7 +118,7 @@
       <a href="#" class="ToggleSuggestions" data-hide-label="<% $hide_label %>" data-show-label="<% $show_label %>">
         <i class="label">(<&|/l&>show suggestions</&>)</i>
       </a>
-      <div class="OneTimeCcs hidden">
+      <div class="OneTimeCcs d-flex flex-wrap hidden">
 %   }
 
       <i class="col-md-auto">(<&|/l&>check to add</&>)</i>
@@ -152,7 +152,7 @@ jQuery(function() {
     jQuery('a.ToggleSuggestions').click(function(e) {
         e.preventDefault();
         var toggleSuggestions = jQuery(this);
-        var oneTimeCcs = toggleSuggestions.closest('td').find('.OneTimeCcs');
+        var oneTimeCcs = toggleSuggestions.closest('div').find('.OneTimeCcs');
         oneTimeCcs.toggleClass('hidden');
         var hideOrShow = oneTimeCcs.hasClass('hidden') ? toggleSuggestions.data('showLabel') : toggleSuggestions.data('hideLabel');
         toggleSuggestions.find('i').html('(' + hideOrShow + ')');

commit 2ecacd8b8dcc80fd140a7df65da5ebe34dc5b2d9
Merge: 2314b24b3 fd251a41c
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Feb 14 14:49:54 2020 -0500

    Merge branch '4.6/fix-hidden-one-time-suggestions'


commit b71407495211f0a91445bbe7b5570a93df84a868
Merge: 2ecacd8b8 165ca6923
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Feb 14 14:59:10 2020 -0500

    Merge branch '4.6/fix-selectize-default-values'


commit 7dd8c0e25dc8207c1bbbbbf475cbc600deb53180
Merge: b71407495 9d1e27729
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Feb 14 15:20:21 2020 -0500

    Merge branch '4.6/migrate-unread-message-box-theme'


commit 97b25b3a611ce044c6c0278549784ad8142dd237
Merge: 7dd8c0e25 1422a3c7d
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Feb 14 15:36:08 2020 -0500

    Merge branch '4.6/fix-config-titlebox-spacing'


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


More information about the rt-commit mailing list