[Rt-commit] rt branch, 4.6/lifecycle-ui-dev, repushed
Craig Kaiser
craig at bestpractical.com
Fri Apr 3 12:07:42 EDT 2020
The branch 4.6/lifecycle-ui-dev was deleted and repushed:
was 60ef8d38844aa96159cca2a2e46809b8f58fdec8
now f0a1afe194821884f0561469de8af26dd7a605b9
1: bcbef5b8a9 ! 1: a5082683f2 Core lifecycle-UI
@@ -657,151 +657,6 @@
+$Update => undef
+</%ARGS>
-diff --git a/share/html/Admin/Lifecycles/Mappings.html.orig b/share/html/Admin/Lifecycles/Mappings.html.orig
-new file mode 100644
---- /dev/null
-+++ b/share/html/Admin/Lifecycles/Mappings.html.orig
-@@
-+%# BEGIN BPS TAGGED BLOCK {{{
-+%#
-+%# COPYRIGHT:
-+%#
-+%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
-+%# <sales at bestpractical.com>
-+%#
-+%# (Except where explicitly superseded by other copyright notices)
-+%#
-+%#
-+%# LICENSE:
-+%#
-+%# This work is made available to you under the terms of Version 2 of
-+%# the GNU General Public License. A copy of that license should have
-+%# been provided with this software, but in any event can be snarfed
-+%# from www.gnu.org.
-+%#
-+%# This work is distributed in the hope that it will be useful, but
-+%# WITHOUT ANY WARRANTY; without even the implied warranty of
-+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+%# General Public License for more details.
-+%#
-+%# You should have received a copy of the GNU General Public License
-+%# along with this program; if not, write to the Free Software
-+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+%# 02110-1301 or visit their web page on the internet at
-+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-+%#
-+%#
-+%# CONTRIBUTION SUBMISSION POLICY:
-+%#
-+%# (The following paragraph is not intended to limit the rights granted
-+%# to you to modify and distribute this software under the terms of
-+%# the GNU General Public License and is only of importance to you if
-+%# you choose to contribute your changes and enhancements to the
-+%# community by submitting them to Best Practical Solutions, LLC.)
-+%#
-+%# By intentionally submitting any modifications, corrections or
-+%# derivatives to this work, or any other work intended for use with
-+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-+%# you are the copyright holder for those contributions and you grant
-+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-+%# royalty-free, perpetual, license to use, copy, create derivative
-+%# works based on those contributions, and sublicense and distribute
-+%# those contributions and any derivatives thereof.
-+%#
-+%# END BPS TAGGED BLOCK }}}
-+<& /Admin/Elements/Header, Title => $title &>
-+<& /Elements/Tabs &>
-+<& /Elements/ListActions, actions => \@results &>
-+
-+<form action="<%RT->Config->Get('WebPath')%>/Admin/Lifecycles/Mappings.html" name="ModifyMappings" method="post" enctype="multipart/form-data">
-+<input type="hidden" class="hidden" name="Name" value="<% $LifecycleObj->Name %>" />
-+<input type="hidden" class="hidden" name="Type" value="<% $LifecycleObj->Type %>" />
-+
-+% for my $Other (@lifecycles) {
-+% my $FromMapping = $Other->MoveMap($LifecycleObj);
-+% my $ToMapping = $LifecycleObj->MoveMap($Other);
-+% my @OtherStatuses = $Other->Valid;
-+
-+ <&| /Widgets/TitleBox, title => $Other->Name &>
-+
-+<h3><&|/l, $Other->Name, $LifecycleObj->Name &>Changing from [_1] to [_2]:</&></h3>
-+<table>
-+% for my $OtherStatus (@OtherStatuses) {
-+ <tr>
-+ <td><% $OtherStatus %>:</td>
-+ <td><& /Elements/SelectStatus, Statuses => \@MyStatuses, Default => $FromMapping->{$OtherStatus}, Name => 'map-' . $Other->Name . '-' . $OtherStatus . '--' . $LifecycleObj->Name&></td>
-+ </tr>
-+% }
-+</table>
-+
-+<h3><&|/l, $LifecycleObj->Name, $Other->Name &>Changing from [_1] to [_2]:</&></h3>
-+<table>
-+% for my $MyStatus (@MyStatuses) {
-+ <tr>
-+ <td><% $MyStatus %>:</td>
-+ <td><& /Elements/SelectStatus, Statuses => \@OtherStatuses, Default => $ToMapping->{$MyStatus}, Name => 'map-' . $LifecycleObj->Name . '-' . $MyStatus . '--' . $Other->Name &></td>
-+ </tr>
-+% }
-+</table>
-+
-+ </&>
-+% }
-+
-+% unless ( scalar @lifecycles ) {
-+ <p><&|/l&>Mapping only available when more than one lifecycle exists</&></p>
-+% }
-+
-+<& /Elements/Submit, Name => 'Update', Label => loc('Save Changes') &>
-+
-+</form>
-+<%INIT>
-+my ($title, @results);
-+my $LifecycleObj = RT::Lifecycle->new();
-+$LifecycleObj->Load(Name => $Name, Type => $Type);
-+
-+Abort("Invalid lifecycle") unless $LifecycleObj->Name
-+ && $LifecycleObj->{data}{type} eq $Type;
-+
-+my @MyStatuses = $LifecycleObj->Valid;
-+
-+$title = loc("Lifecycle [_1] Mappings", $LifecycleObj->Name);
-+
-+# This code does automatic redirection if any updates happen.
-+MaybeRedirectForResults(
-+ Actions => \@results,
-+ Arguments => { Name => $LifecycleObj->Name, Type => $LifecycleObj->Type },
-+);
-+
-+my @lifecycle_names = grep { $_ ne 'approvals' } RT::Lifecycle->ListAll($Type);
-+
-+if ($Update) {
-+ my %maps;
-+ my $lifecycle_re = join '|', map { quotemeta($_) } @lifecycle_names;
-+ for my $key (keys %ARGS) {
-+ my ($from_lifecycle, $from_status, $to_lifecycle) = $key =~ /^map-($lifecycle_re)-(.*)--($lifecycle_re)$/ or next;
-+ if (my $to_status = $ARGS{$key}) {
-+ $maps{"$from_lifecycle -> $to_lifecycle"}{$from_status} = $to_status;
-+ }
-+ }
-+
-+ my ($ok, $msg) = RT::Lifecycle->UpdateMaps(
-+ CurrentUser => $session{CurrentUser},
-+ Maps => \%maps,
-+ );
-+ push @results, $msg;
-+}
-+
-+my @lifecycles = map { RT::Lifecycle->Load(Name => $_, Type => $Type) }
-+ sort { loc($a) cmp loc($b) }
-+ grep { $_ ne $Name }
-+ @lifecycle_names;
-+</%INIT>
-+<%ARGS>
-+$Name => undef
-+$Type => undef
-+$Update => undef
-+</%ARGS>
-
diff --git a/share/html/Admin/Lifecycles/Modify.html b/share/html/Admin/Lifecycles/Modify.html
new file mode 100644
--- /dev/null
@@ -1459,6 +1314,7 @@
+
+ if (confirm("Enabling auto layout will remove all node positions") == true) {
+ self.ToggleSimulation();
++ self.ExportAsConfiguration();
+ return true;
+ } else {
+ return false;
2: d9e6ba9c0a = 2: 3d3407f15b Use RT::Configuration to store lifecycle config instead of RT::Attribute
3: 5d6ddbc25f ! 3: 5cfe321c2e Migrate lifecycle UI pages to elevator theme
@@ -98,8 +98,8 @@
-<h3><&|/l, $Other->Name, $LifecycleObj->Name &>Changing from [_1] to [_2]:</&></h3>
-<table>
-+ <div class="col-md-3">
-+ <h3><&|/l, $Other->Name, $LifecycleObj->Name &>Changing from [_1] to [_2]:</&></h3>
++ <div class="col-md-4">
++ <h6><&|/l, $Other->Name, $LifecycleObj->Name &>Changing from [_1] to [_2]:</&></h6>
% for my $OtherStatus (@OtherStatuses) {
- <tr>
- <td><% $OtherStatus %>:</td>
@@ -117,8 +117,8 @@
-<h3><&|/l, $LifecycleObj->Name, $Other->Name &>Changing from [_1] to [_2]:</&></h3>
-<table>
-+ <div class="col-md-3">
-+ <h3><&|/l, $LifecycleObj->Name, $Other->Name &>Changing from [_1] to [_2]:</&></h3>
++ <div class="col-md-4">
++ <h6><&|/l, $LifecycleObj->Name, $Other->Name &>Changing from [_1] to [_2]:</&></h6>
% for my $MyStatus (@MyStatuses) {
- <tr>
- <td><% $MyStatus %>:</td>
4: d7ee8a9f38 = 4: 039d940e5b Ensure lifecycle cache is updated across threads when flagged
5: 6adda0c9fe = 5: b7f3082c55 Add lifecycle UI Advanced page
6: f116a2e8f2 ! 6: 329429b291 Add lifecycle UI Actions page
@@ -99,10 +99,10 @@
+% foreach my $action ( @{$actions} ) {
+ <tr>
+ <td class="collection-as-table">
-+ <& /Elements/SelectStatus, Statuses => \@statuses, Default => $action->{'to'}, Name => "Action-To-$i" &>
++ <& /Elements/SelectStatus, Statuses => \@statuses, Default => $action->{'from'}, Name => "Action-From-$i" &>
+ </td>
+ <td class="collection-as-table">
-+ <& /Elements/SelectStatus, Statuses => \@statuses, Default => $action->{'from'}, Name => "Action-From-$i" &>
++ <& /Elements/SelectStatus, Statuses => \@statuses, Default => $action->{'to'}, Name => "Action-To-$i" &>
+ </td>
+ <td class="collection-as-table">
+ <input type="text" value="<% $action->{'label'} %>" class="form-control" Name="Action-Label-<%$i%>" />
7: 6ba6d1da67 = 7: 55f7f354af Add lifecycle UI Rights page
8: c535bab623 = 8: 75b9137c21 Add lifecycle Rights/Actions/Advanced pages to menu
9: 41006367dd < --: ------- Increase column size on lifecycle mappings page
10: 53c5b5ce25 = 9: dc969b67b8 Allow for lifecycle to be set to disabled
11: bb3031fd8a = 10: 77bef8879c Add 'remove' checkbox for lifecycle rights and actions page"
12: 0b6c1d31df = 11: d299b1b5c8 Only check if status needs to be removed from maps if we are updating one lifecycle
13: 2bb62d28d2 = 12: 5764b1f157 Make changes to lifecycle Configuration in context of current user
14: 28c87d49db = 13: 685963c955 Ensure lifecycle cache is flagged for updating on rights and actions change
15: d187f2a058 = 14: e443775cc5 Refresh config from database and check if Lifecycle cache needs refreshing in RT::Interface::Email
16: b31ccb2327 = 15: b3a6fbcf28 Use standard update lifecycle method on index page
17: b165a8fa16 = 16: 7829e9fbde Allow for spaces in actions key
18: efe12dae61 = 17: beb2f7d124 Set sensible default value for "on_create" if not provided
19: dcd51d89aa = 18: 6129296a27 Do not re-load displayed config value if lifecycle fails validation
20: 1130d608ba = 19: 99af997d52 Remove unused code
21: 57b55a3874 = 20: a72cfcda2f Convert node name checks and transitions to lowercase
22: f9c936dd07 = 21: e84c25d919 Ensure we flag the lifecycle cache needs updating on lifecycle save
23: b5680abbe2 = 22: 0e218eaf58 Skip warning if unecessary default key is not provided
24: 60ef8d3884 ! 23: f0a1afe194 Validate the lifecycle submitted on the Modify page before saving
@@ -15,6 +15,35 @@
my @statuses;
$lifecycle->{canonical_case} = {};
+@@
+
+ push @warnings, "Invalid right name ($lifecycle->{rights}{$schema}) in ".$self->Name." lifecycle; right names must be <= 25 characters"
+ if length($lifecycle->{rights}{$schema}) > 25;
+-
+- $lifecycle->{rights}{lc($from) . " -> " .lc($to)}
+- = $lifecycle->{rights}{$schema};
+ }
+
+ my %seen;
+@@
+ @actions = @{ $lifecycle->{'actions'} };
+ }
+
+- $lifecycle->{'actions'} = [];
+ while ( my ($transition, $info) = splice @actions, 0, 2 ) {
+ my ($from, $to) = split /\s*->\s*/, $transition, 2;
+ unless ($from and $to) {
+@@
+ unless $from eq '*' or $lifecycle->{canonical_case}{lc $from};
+ push @warnings, "Nonexistant status @{[lc $to]} in action in ".$self->Name." lifecycle"
+ unless $to eq '*' or $lifecycle->{canonical_case}{lc $to};
+- push @{ $lifecycle->{'actions'} },
+- { %$info,
+- from => ($lifecycle->{canonical_case}{lc $from} || lc $from),
+- to => ($lifecycle->{canonical_case}{lc $to} || lc $to), };
+ }
+
+ # Lower-case the transition maps
diff --git a/share/html/Admin/Lifecycles/Modify.html b/share/html/Admin/Lifecycles/Modify.html
--- a/share/html/Admin/Lifecycles/Modify.html
More information about the rt-commit
mailing list