[Rt-commit] rt branch, 4.6/lifecycle-ui, updated. rt-4.4.1-265-g7474b1fdd

Craig Kaiser craig at bestpractical.com
Fri Sep 27 12:11:09 EDT 2019


The branch, 4.6/lifecycle-ui has been updated
       via  7474b1fdd65dfd08e6216e0830e8e7ef8b1395c7 (commit)
       via  c63cefecbd327703155cecddd1873c9e5a8d872e (commit)
       via  4ad471a90f06919cd8b6f102221d34af8ce9194f (commit)
       via  f0498c3eb795a5185a29d5edb4a1d023acf93348 (commit)
       via  adb33922497732e2852f9b4ce937e654135e4333 (commit)
       via  be0de9946fb4b00cacf25f029096bb93c4eb223a (commit)
      from  74012a28cd1c7e87177f7176b0dcf1c3b4595791 (commit)

Summary of changes:
 lib/RT/Interface/Web/MenuBuilder.pm          |  7 ++++++
 lib/RT/Lifecycle.pm                          | 35 +++++++++++++++++-----------
 share/html/Admin/Lifecycles/Mappings.html    |  4 ++++
 share/static/css/base/lifecycleui-editor.css | 18 +++++---------
 4 files changed, 39 insertions(+), 25 deletions(-)

- Log -----------------------------------------------------------------
commit be0de9946fb4b00cacf25f029096bb93c4eb223a
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Sep 27 09:34:09 2019 -0400

    Reload lifecycle cache if we are not able to load a lifecycle
    
    The cache could be old and missing recent lifecycles, this will result in
    not being able to load existing lifecycles.

diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index 784b38453..03b2f211a 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -144,18 +144,25 @@ sub Load {
         @_,
     );
 
-    if (defined $args{Name} and exists $LIFECYCLES_CACHE{ $args{Name} }) {
-        $self->{'name'} = $args{Name};
-        $self->{'data'} = $LIFECYCLES_CACHE{ $args{Name} };
-        $self->{'type'} = $args{Type};
-
-        my $found_type = $self->{'data'}{'type'};
-        warn "Found type of $found_type ne $args{Type}" if $found_type ne $args{Type};
-    } elsif (not $args{Name} and exists $LIFECYCLES_TYPES{ $args{Type} }) {
-        $self->{'data'} = $LIFECYCLES_TYPES{ $args{Type} };
-        $self->{'type'} = $args{Type};
-    } else {
-        return undef;
+    my $load_class = sub {
+        if (defined $args{Name} and exists $LIFECYCLES_CACHE{ $args{Name} }) {
+            $self->{'name'} = $args{Name};
+            $self->{'data'} = $LIFECYCLES_CACHE{ $args{Name} };
+            $self->{'type'} = $args{Type};
+
+            my $found_type = $self->{'data'}{'type'};
+            warn "Found type of $found_type ne $args{Type}" if $found_type ne $args{Type};
+        } elsif (not $args{Name} and exists $LIFECYCLES_TYPES{ $args{Type} }) {
+            $self->{'data'} = $LIFECYCLES_TYPES{ $args{Type} };
+            $self->{'type'} = $args{Type};
+        } else {
+            return undef;
+        }
+    };
+    # If we could not load the class, try re-filling the cache in case we missed something
+    unless ( &$load_class ) {
+        $self->FillCache();
+        &$load_class();
     }
 
     my $class = "RT::Lifecycle::".ucfirst($args{Type});

commit adb33922497732e2852f9b4ce937e654135e4333
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Sep 27 09:44:40 2019 -0400

    Show 'select' and 'create' page menu options for lifecycle pages

diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index e3baabedd..9556e3f1d 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -1156,6 +1156,13 @@ sub _BuildAdminMenu {
                 RT::Interface::Web::EscapeURI(\$Name_uri);
                 RT::Interface::Web::EscapeURI(\$Type_uri);
 
+                my $lifecycles = $page->child( lifecycles =>
+                    title => loc('Lifecycles'),
+                    path  => '/Admin/Lifecycles/',
+                );
+                $lifecycles->child( select => title => loc('Select'), path => '/Admin/Lifecycles/');
+                $lifecycles->child( create => title => loc('Create'), path => '/Admin/Lifecycles/Create.html');
+
                 $page->child( basics => title => loc('Modify'),  path => "/Admin/Lifecycles/Modify.html?Type=" . $Type_uri . "&Name=" . $Name_uri );
                 $page->child( mappings => title => loc('Mappings'),  path => "/Admin/Lifecycles/Mappings.html?Type=" . $Type_uri . "&Name=" . $Name_uri );
             }

commit f0498c3eb795a5185a29d5edb4a1d023acf93348
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Sep 27 10:24:59 2019 -0400

    Make sure default value for lifecycle type is 'ticket'

diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index 03b2f211a..63b19207b 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -143,6 +143,7 @@ sub Load {
         Name => '',
         @_,
     );
+    $args{'Type'} = $args{'Type'} // 'ticket';
 
     my $load_class = sub {
         if (defined $args{Name} and exists $LIFECYCLES_CACHE{ $args{Name} }) {
@@ -151,18 +152,19 @@ sub Load {
             $self->{'type'} = $args{Type};
 
             my $found_type = $self->{'data'}{'type'};
-            warn "Found type of $found_type ne $args{Type}" if $found_type ne $args{Type};
+            warn "Found type of $found_type ne ".$args{'Type'} if $found_type ne $args{Type};
         } elsif (not $args{Name} and exists $LIFECYCLES_TYPES{ $args{Type} }) {
             $self->{'data'} = $LIFECYCLES_TYPES{ $args{Type} };
             $self->{'type'} = $args{Type};
         } else {
             return undef;
         }
+        return 1;
     };
-    # If we could not load the class, try re-filling the cache in case we missed something
-    unless ( &$load_class ) {
+    # If we could not load the class, try re-filling the cache in case it is stale
+    unless ( &$load_class() ) {
         $self->FillCache();
-        &$load_class();
+        return unless &$load_class();
     }
 
     my $class = "RT::Lifecycle::".ucfirst($args{Type});

commit 4ad471a90f06919cd8b6f102221d34af8ce9194f
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Sep 27 10:47:04 2019 -0400

    Add message when no lifecycle mappings available

diff --git a/share/html/Admin/Lifecycles/Mappings.html b/share/html/Admin/Lifecycles/Mappings.html
index 891936d79..c587293cd 100644
--- a/share/html/Admin/Lifecycles/Mappings.html
+++ b/share/html/Admin/Lifecycles/Mappings.html
@@ -83,6 +83,10 @@
     </&>
 % }
 
+% unless ( scalar @lifecycles ) {
+    <p><&|/l&>Mapping only available when more than one lifecycle exists</&></p>
+% }
+
 <& /Elements/Submit, Name => 'Update', Label => loc('Save Changes') &>
 
 </form>

commit c63cefecbd327703155cecddd1873c9e5a8d872e
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Sep 27 11:55:34 2019 -0400

    Remove checkered background from lifecycle editor graph

diff --git a/share/static/css/base/lifecycleui-editor.css b/share/static/css/base/lifecycleui-editor.css
index 7e83c6852..bd168915d 100644
--- a/share/static/css/base/lifecycleui-editor.css
+++ b/share/static/css/base/lifecycleui-editor.css
@@ -4,12 +4,6 @@
     width: 809px;
     height: 500px;
 
-    /* checkerboard pattern */
-    background: #F9F9F9 url('data:image/svg+xml,\
-        <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"         fill-opacity=".05" >\
-            <rect x="200" width="200" height="200" />\
-            <rect y="200" width="200" height="200" />\
-    </svg>');
     background-size: 25px 25px;
 }
 

commit 7474b1fdd65dfd08e6216e0830e8e7ef8b1395c7
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Sep 27 12:10:39 2019 -0400

    Center lifecycle editor

diff --git a/share/static/css/base/lifecycleui-editor.css b/share/static/css/base/lifecycleui-editor.css
index bd168915d..732a82043 100644
--- a/share/static/css/base/lifecycleui-editor.css
+++ b/share/static/css/base/lifecycleui-editor.css
@@ -1,19 +1,19 @@
+.lifecycle-ui {
+    margin-left: 10%;
+}
+
 .lifecycle-ui.editing svg {
-    display: inline-block;
     float: left;
-    width: 809px;
+    width: 60%;
     height: 500px;
-
-    background-size: 25px 25px;
 }
 
 .lifecycle-ui.editing .overlay-buttons {
-    left: 700px;
+    left: 50%;
 }
 
 .lifecycle-ui .inspector {
     display: inline-block;
-    width: 250px;
     min-height: 500px;
     border: 1px solid black;
 }

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


More information about the rt-commit mailing list