[Rt-commit] rt branch, 4.4/remove-user-info, repushed
Craig Kaiser
craig at bestpractical.com
Fri Dec 14 08:56:20 EST 2018
The branch 4.4/remove-user-info was deleted and repushed:
was eaa15bbba74506b2abb3fa69c62062fceeea5fb7
now d6cf3a6db74949bb1ccca6a4053dae97dd59b103
1: 9df047a66 = 1: 9df047a66 Move User related info portlet into side column
2: 2fbff4077 = 2: 2fbff4077 Create method AnonymizeUser in User.pm
3: b5bd61f46 = 3: b5bd61f46 Create modal mason component
4: d179f1292 = 4: d179f1292 Allow TSVExport filename to be set through Filename arg
5: 335bd4bc6 < -: ------- Create portlet for removing user information
8: eaa15bbba ! 5: 6b4706d73 Create portlet for removing user information
@@ -1,40 +1,55 @@
Author: Craig Kaiser <craig at bestpractical.com>
- Update styling on "Manage User Data" portlet
+ Create portlet for removing user information
+
+ Mason template that has three buttons for removing user information. The
+ buttons are 'Anonymize user', 'Replace User' and 'Remove User'.
+ Anonymize user will call the 'AnonymizeUser' method to clear identifying
+ information from the user record. 'Replace User' and 'Remove User' will
+ link to the shredder page with a pre formatted search.
+
+diff --git a/share/html/User/BasicUserData.tsv b/share/html/User/BasicUserData.tsv
+--- a/share/html/User/BasicUserData.tsv
++++ b/share/html/User/BasicUserData.tsv
+@@
+ $Type => 'User'
+ $Format => undef
+ $id
++$Filename => undef
+ </%ARGS>
+
+ <%INIT>
+@@
+ $Collection->Limit( FIELD => 'Type', VALUE => 'Comment' );
+ }
+
+-$m->comp( "/Elements/TSVExport", Collection => $Collection, Format => $Format, PreserveNewLines => $PreserveNewLines );
++$m->comp( "/Elements/TSVExport", Collection => $Collection, Format => $Format,
++ PreserveNewLines => $PreserveNewLines, Filename => $Filename,
++);
+ </%INIT>
diff --git a/share/html/User/Elements/BasicUserData b/share/html/User/Elements/BasicUserData
--- a/share/html/User/Elements/BasicUserData
+++ b/share/html/User/Elements/BasicUserData
@@
- title => loc("Manage User Data"),
+ %# END BPS TAGGED BLOCK }}}
+ <&|/Widgets/TitleBox,
+ class => 'user-related-info',
+- title => loc("User related info"),
++ title => loc("Manage User Data"),
&>
-<table>
-- <tr>
-- <th align="left">Download User Data</th>
-- <th align="left">Remove User Data</th>
-- </tr>
-- <tr>
-- <td><a href="/User/BasicUserData.tsv?Type=User&id=<% $UserObj->id %>&Filename='UserData.tsv'" class="button"><% $UserDataButton %></a></td>
-- <td>
-- <a href="#user-info-modal" rel="modal:open" class="button value" name="anonymize_user"><&|/l&>Anonymize User</&></a>
-- <span><&|/l&>Remove user information with anonymous username</&></span>
-- </td>
-- </tr>
-- <tr>
-- <td><a href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>&Filename='UserTicketData.tsv'" class="button"><% $UserTicketsButton %></a></td>
-- <td>
-- <a href="<%RT->Config->Get('WebPath')%>/Admin/Tools/Shredder/index.html?Plugin=Users&Users%3Astatus=enabled&Users%3Aname=<% $UserObj->Name %>&Users%3Areplace_relations=Nobody&Search=Search" name="replace-user" class="button value"><&|/l&>Replace User</&></a>
-- <span><&|/l&>Replace user links in the database with "Nobody" user</&></span>
-- </td>
-- </tr>
-- <tr>
-- <td><a href="/User/BasicUserData.tsv?Type=Transaction&id=<% $UserObj->id %>&Filename='UserTransactionData.tsv'" class="button"><% $UserTxnButton %></a></td>
-- <td>
-- <a href="<%RT->Config->Get('WebPath')%>/Admin/Tools/Shredder/index.html?Plugin=Users&Users%3Astatus=enabled&Users%3Aname=<% $UserObj->Name %>&Search=Search&remove_user" class="button value" name="remove-user"><&|/l&>Remove User</&></a>
-- <span> <&|/l&>Remove all references to user and links to user</&></span>
-- </td>
-- </tr>
+- <tr><td>
+- <a href="/User/BasicUserData.tsv?Type=User&id=<% $UserObj->id %>" class="button"><% $UserDataButton %></a>
+- </td></tr>
+- <tr><td>
+- <a href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>" class="button"><% $UserTicketsButton %></a>
+- </td></tr>
+- <tr><td>
+- <a href="/User/BasicUserData.tsv?Type=Transaction&id=<% $UserObj->id %>" class="button"><% $UserTxnButton %></a>
+- </td></tr>
-</table>
+<div>
+ <h4>Download User Information:</h4>
@@ -104,3 +119,4 @@
+++ b/share/static/css/base/test.css
@@
+
+
6: b44b4c1c1 = 6: 3566d5a05 Add remove user info portlet to user modify page
7: 9210941c7 ! 7: d6cf3a6db Create test for remove user information
@@ -30,7 +30,7 @@
+ my $user_id = $user->id;
+
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $user_id );
-+ $agent->follow_link_ok( { text => 'Anonymize' } );
++ $agent->follow_link_ok( { text => 'Anonymize User' } );
+
+ $agent->submit_form_ok( { form_id => 'user-info-modal', },
+ "Anonymize user" );
@@ -79,7 +79,7 @@
+ 'Customfield exists and has value for user.';
+
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $user->id );
-+ $agent->follow_link_ok( { text => 'Anonymize' } );
++ $agent->follow_link_ok( { text => 'Anonymize User' } );
+
+ $agent->submit_form_ok(
+ { form_id => 'user-info-modal',
@@ -111,7 +111,7 @@
+ ok $agent->login( 'root' => 'password' );
+
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $user->id );
-+ $agent->follow_link_ok( { text => 'Replace' } );
++ $agent->follow_link_ok( { text => 'Replace User' } );
+
+ $agent->submit_form_ok(
+ { form_id => 'shredder-search-form',
@@ -146,7 +146,7 @@
+ $agent->login( 'root' => 'password' );
+
+ $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $user->id );
-+ $agent->follow_link_ok( { text => 'Remove' } );
++ $agent->follow_link_ok( { text => 'Remove User' } );
+
+ $agent->submit_form_ok(
+ { form_id => 'shredder-search-form',
@@ -163,4 +163,3 @@
+}
+
+done_testing();
-
More information about the rt-commit
mailing list