[Rt-commit] rt branch, 5.0/lifecycle-ui-mappings-case-variant-statuses, created. rt-5.0.0-119-g4049d6366d
Craig Kaiser
craig at bestpractical.com
Tue Nov 17 11:02:33 EST 2020
The branch, 5.0/lifecycle-ui-mappings-case-variant-statuses has been created
at 4049d6366d1bb498897f1f2ddf98620be6425f84 (commit)
- Log -----------------------------------------------------------------
commit bf398c5da92bb1371c01f9f99a1eefbde3c84c25
Author: craig kaiser <craig at bestpractical.com>
Date: Tue Nov 17 09:54:46 2020 -0500
Fix lifecycle_mappings test
diff --git a/t/web/lifecycle_mappings.t b/t/web/lifecycle_mappings.t
index e4f5d101de..3be42f3f0f 100644
--- a/t/web/lifecycle_mappings.t
+++ b/t/web/lifecycle_mappings.t
@@ -111,7 +111,7 @@ diag "Confirm the web UI correctly displays mappings";
my @inputs = $form->inputs;
foreach my $input (@inputs) {
my ( $default_from, $default_status, $default_to ) = $input->name =~ /^map-(default)--(.*)--(sales)$/;
- my ( $sales_from, $sales_status, $sales_to ) = $input->name =~ /^map-(default)--(.*)--(sales)$/;
+ my ( $sales_from, $sales_status, $sales_to ) = $input->name =~ /^map-(sales)--(.*)--(default)$/;
if ($default_from) {
is( $input->value,
commit 212e93fb73950c27f135a9115ded52ad5dade6d2
Author: craig kaiser <craig at bestpractical.com>
Date: Tue Nov 17 10:05:33 2020 -0500
Add lifecycle_mappings test for case variant statuses
diff --git a/t/lifecycles/utils.pl b/t/lifecycles/utils.pl
index f832828a51..314dc0a37c 100644
--- a/t/lifecycles/utils.pl
+++ b/t/lifecycles/utils.pl
@@ -69,7 +69,7 @@ Set(\%Lifecycles,
"sales" => {
type => 'ticket',
initial => ['initial'],
- active => ['active'],
+ active => ['active', 'case-Variant'],
inactive => ['inactive'],
},
"sales-engineering" => {
diff --git a/t/web/lifecycle_mappings.t b/t/web/lifecycle_mappings.t
index 3be42f3f0f..fb53bf285d 100644
--- a/t/web/lifecycle_mappings.t
+++ b/t/web/lifecycle_mappings.t
@@ -67,17 +67,18 @@ diag "Test updating mappings";
$form = $m->form_name('ModifyMappings');
$m->submit_form(
fields => {
- "map-default--new--sales" => "active",
- "map-default--open--sales" => "active",
- "map-default--resolved--sales" => "inactive",
- "map-sales--initial--default" => "new",
- "map-sales--active--default" => "open",
- "map-sales--inactive--default" => "resolved",
- "map-default--deleted--sales" => "inactive",
- "map-default--rejected--sales" => "inactive",
- "map-default--stalled--sales" => "active",
- "Name" => "default",
- "Type" => "ticket",
+ "map-default--new--sales" => "active",
+ "map-default--open--sales" => "active",
+ "map-default--resolved--sales" => "inactive",
+ "map-sales--initial--default" => "new",
+ "map-sales--active--default" => "open",
+ "map-sales--inactive--default" => "resolved",
+ "map-sales--case-variant--default" => "open",
+ "map-default--deleted--sales" => "inactive",
+ "map-default--rejected--sales" => "inactive",
+ "map-default--stalled--sales" => "active",
+ "Name" => "default",
+ "Type" => "ticket",
},
button => 'Update'
);
@@ -94,18 +95,19 @@ diag "Confirm the web UI correctly displays mappings";
my $form = $m->form_name('ModifyMappings');
my $from = {
- deleted => "inactive",
- new => "active",
- open => "active",
- rejected => "inactive",
- resolved => "inactive",
- stalled => "active",
+ deleted => "inactive",
+ new => "active",
+ open => "active",
+ rejected => "inactive",
+ resolved => "inactive",
+ stalled => "active",
};
my $to = {
- active => "open",
- inactive => "resolved",
- initial => "new",
+ active => "open",
+ inactive => "resolved",
+ initial => "new",
+ "case-variant" => "open"
};
my @inputs = $form->inputs;
@@ -118,12 +120,16 @@ diag "Confirm the web UI correctly displays mappings";
$from->{$default_status},
"Mapping set correctly for default -> sales for status: $default_status"
);
+ delete $from->{$default_status};
}
elsif ($sales_from) {
is( $input->value, $to->{$sales_status},
"Mapping set correctly for sales -> default for status: $sales_status" );
+ delete $to->{$sales_status};
}
}
+ is_deeply( $from, {}, "All expected default mappings found." );
+ is_deeply( $to, {}, "All expected sales mappings found." );
}
diag "Test updating sales-engineering mappings";
commit 4049d6366d1bb498897f1f2ddf98620be6425f84
Author: craig kaiser <craig at bestpractical.com>
Date: Tue Nov 17 10:50:09 2020 -0500
Show statuses as lc on Mappings.html page
Since our MoveMap method returns lower case statuses we need to have the
select options also be lower case in order to detect the correct default
value. Without this we will see statuses that have capital letters in it
not have a default mapping value.
diff --git a/share/html/Admin/Lifecycles/Mappings.html b/share/html/Admin/Lifecycles/Mappings.html
index d487fedc3a..465827ca4e 100644
--- a/share/html/Admin/Lifecycles/Mappings.html
+++ b/share/html/Admin/Lifecycles/Mappings.html
@@ -62,7 +62,7 @@
% for my $Other (@lifecycles) {
% my $FromMapping = $Other->MoveMap($LifecycleObj);
% my $ToMapping = $LifecycleObj->MoveMap($Other);
-% my @OtherStatuses = $Other->Valid;
+% my @OtherStatuses = map { lc $_ } $Other->Valid;
<&| /Widgets/TitleBox, title => $Other->Name &>
<div class="form-row">
@@ -112,7 +112,7 @@ $LifecycleObj->Load(Name => $Name, Type => $Type);
Abort( loc("Invalid lifecycle") ) unless $LifecycleObj->Name && $LifecycleObj->{data}{type} eq $Type;
-my @MyStatuses = $LifecycleObj->Valid;
+my @MyStatuses = map { lc $_ } $LifecycleObj->Valid;
$title = loc("Lifecycle [_1] Mappings", $LifecycleObj->Name);
-----------------------------------------------------------------------
More information about the rt-commit
mailing list