[Rt-commit] rt branch, 4.4/fix-select-status-in-asset-bulk, created. rt-4.4.3-201-gc42cdcc2f

? sunnavy sunnavy at bestpractical.com
Tue Feb 26 05:47:09 EST 2019


The branch, 4.4/fix-select-status-in-asset-bulk has been created
        at  c42cdcc2ffb1eb68110852aa9b35522027209251 (commit)

- Log -----------------------------------------------------------------
commit b367e508aecc5962424f3ffe81d19fbc137b9e5a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Feb 26 18:26:25 2019 +0800

    Show all valid statuses on Asset bulk update page
    
    CatalogObj argument is to show inital statuses only, which is not
    appropriate here. Note that { $catalog_obj->id => 1 } also works here,
    filling $catalog_obj is just to make it a bit more consistent with
    ticket bulk page.

diff --git a/share/html/Asset/Search/Bulk.html b/share/html/Asset/Search/Bulk.html
index 2322d7a13..e387c4545 100644
--- a/share/html/Asset/Search/Bulk.html
+++ b/share/html/Asset/Search/Bulk.html
@@ -95,7 +95,7 @@
   </tr>
   <tr class="asset-status">
     <td class="label"><label for="UpdateStatus"><&|/l&>Status</&></label></td>
-    <td><& /Asset/Elements/SelectStatus, Name => 'UpdateStatus', DefaultValue => 1, CatalogObj => $catalog_obj &></td>
+    <td><& /Asset/Elements/SelectStatus, Name => 'UpdateStatus', DefaultValue => 1, Catalogs => { $catalog_obj->id => $catalog_obj } &></td>
   </tr>
 </table>
 %   my $cfs = $catalog_obj->AssetCustomFields;

commit c42cdcc2ffb1eb68110852aa9b35522027209251
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Feb 26 18:44:09 2019 +0800

    Test status options on asset bulk update page

diff --git a/t/assets/web.t b/t/assets/web.t
index 67a842915..479c02e79 100644
--- a/t/assets/web.t
+++ b/t/assets/web.t
@@ -107,6 +107,22 @@ diag "Create with CFs in other groups";
     $m->content_unlike(qr/Purchased.*?must match .*?Year/, "Lacks validation error for Purchased");
 }
 
+diag "Bulk update";
+{
+    $m->follow_link_ok( { id => 'assets-search' }, "Asset search page" );
+    $m->submit_form_ok( { form_id => 'AssetSearch' }, "Search assets" );
+    $m->follow_link_ok( { text => 'Bulk Update' }, "Asset bulk update page" );
+
+    my $form = $m->form_id('BulkUpdate');
+    my $status_input = $form->find_input('UpdateStatus');
+    is_deeply(
+        [ sort $status_input->possible_values ],
+        [ '', 'allocated', 'deleted', 'in-use', 'new', 'recycled', 'stolen' ],
+        'Status options'
+    );
+    # TODO: test more bulk update actions
+}
+
 # XXX TODO: test other modify pages
 
 done_testing;

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


More information about the rt-commit mailing list