[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.2-243-g40b81a588

Jim Brandt jbrandt at bestpractical.com
Thu Jun 21 13:38:55 EDT 2018


The branch, 4.4-trunk has been updated
       via  40b81a5883417fc504d337a996b31ad139c1d1fa (commit)
       via  ecacb5a432bcb5338eaf200b9c3604d170e99ed1 (commit)
       via  252d570e1e8c6bb82955333f2f47bcc1664a5aa1 (commit)
      from  e5da64681a680b044f0ad91e04af0d07878f4210 (commit)

Summary of changes:
 share/html/Admin/CustomFields/Modify.html | 4 ++++
 t/web/cf_select_one.t                     | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 252d570e1e8c6bb82955333f2f47bcc1664a5aa1
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Wed Aug 30 10:09:27 2017 -0400

    Improve message for adding/deleting a new custom field value
    
    When user is creating a custom field and adding values as options,
    or deleting existing values, previous message after adding a value,
    "Object created", and after deleting a value, "Object deleted", was
    unclear. Message updated to make it clear user added or deleted a
    specific custom field value.
    
    Fixes: I#32695

diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index fc3d93987..34f9fb0f3 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -341,6 +341,8 @@ if ( $ARGS{'Update'} && $id ne 'new' ) {
     foreach my $key ( keys %ARGS ) {
         next unless $key =~ /^Delete-$paramtag-(\d+)$/;
         my ($val, $msg) = $CustomFieldObj->DeleteValue( $1 );
+        my $cf_delete = $ARGS{ $paramtag . "-$1-Name" };
+        $msg = loc("Custom field value [_1] deleted", $cf_delete) if $val;
         push (@results, $msg);
     }
 
@@ -369,6 +371,8 @@ if ( $ARGS{'Update'} && $id ne 'new' ) {
                 $ARGS{$paramtag."-new-$_"} =~ s/\s+$//;
                 $_ => $ARGS{ $paramtag ."-new-$_" } } grep { defined $ARGS{ $paramtag ."-new-$_" } } qw/ Name Description SortOrder Category/
         );
+        my $cf_add = $ARGS{ $paramtag.'-new-Name' };
+        $msg = loc("Custom field value [_1] added", $cf_add) if $id;
         push (@results, $msg);
         $added_cfv = 1 if $id;
 

commit ecacb5a432bcb5338eaf200b9c3604d170e99ed1
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Thu Mar 15 13:56:27 2018 -0400

    Update tests for adding/deleting a new custom field value

diff --git a/t/web/cf_select_one.t b/t/web/cf_select_one.t
index 7fa13a22b..60d0e2a23 100644
--- a/t/web/cf_select_one.t
+++ b/t/web/cf_select_one.t
@@ -28,7 +28,7 @@ diag "Create a CF";
 
 diag "add 'qwe', 'ASD', '0' and ' foo ' as values to the CF";
 {
-    foreach my $value(qw(qwe ASD 0), 'foo ') {
+    foreach my $value(qw(qwe ASD 0), 'foo') {
         $m->submit_form(
             form_name => "ModifyCustomField",
             fields => {
@@ -36,7 +36,7 @@ diag "add 'qwe', 'ASD', '0' and ' foo ' as values to the CF";
             },
             button => 'Update',
         );
-        $m->content_contains('Object created', 'added a value to the CF' ); # or diag $m->content;
+        $m->content_contains("Custom field value $value added", 'added a value to the CF' ); # or diag $m->content;
         my $v = $value;
         $v =~ s/^\s+$//;
         $v =~ s/\s+$//;

commit 40b81a5883417fc504d337a996b31ad139c1d1fa
Merge: e5da64681 ecacb5a43
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Jun 21 13:38:37 2018 -0400

    Merge branch '4.4/improve-create-custom-field-message' into 4.4-trunk


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


More information about the rt-commit mailing list