[Rt-commit] rt branch, 4.6/search-selection-next, repushed
Blaine Motsinger
blaine at bestpractical.com
Wed Apr 22 20:12:19 EDT 2020
The branch 4.6/search-selection-next was deleted and repushed:
was 86c1e43c83e3d442fa2502ef0cbd8a26935faa01
now bc8e0b9c73c6b14e3fbae4831b386cf8fe4c708f
1: 7f00869a70 = 1: 7f00869a70 Add RT-Extension-DashboardSelectionUI to core
2: 5b7c0b3f30 ! 2: 7d84706d04 Update DashboardSelectionUI to elevator-light
@@ -2,18 +2,29 @@
Update DashboardSelectionUI to elevator-light
- General design updates were also made from the original import to
- make it look better with our elevator-light theme.
+ Other than general design changes, this commit also fixes the reset
+ to defaults for the pages by using the reset logic from
+ Prefs/MyRT.html. Additionally, it changes the post to use id as a
+ query param instead of form variable, so the url is correctly
+ including id after post.
diff --git a/share/html/Admin/Global/MyRT.html b/share/html/Admin/Global/MyRT.html
--- a/share/html/Admin/Global/MyRT.html
+++ b/share/html/Admin/Global/MyRT.html
@@
+ <& /Elements/Tabs &>
+ <& /Elements/ListActions, actions => \@results &>
+
+-<form method="post" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT' data-is_global=True>
++<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT' data-is_global=True>
+ <& /Widgets/SearchSelection,
+ pane_name => \%pane_name,
+ sections => \@sections,
selected => \%selected,
filters => \@filters,
&>
- <input type="submit" class="button" name="UpdateSearches" value="<% loc('Save') %>" />
-+ <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value="<% loc('Save') %>" />
++ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
</form>
<%INIT>
@@ -21,25 +32,73 @@
diff --git a/share/html/Admin/Users/MyRT.html b/share/html/Admin/Users/MyRT.html
--- a/share/html/Admin/Users/MyRT.html
+++ b/share/html/Admin/Users/MyRT.html
+@@
+ <& /Elements/Tabs &>
+ <& /Elements/ListActions, actions => \@actions &>
+
+-<form method="post" action="<% RT->Config->Get('WebPath') %> /Helpers/UpdateDashboard" data-dashboard_id = "MyRT" data-user_id = '<% $id %>'>
++<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %> /Helpers/UpdateDashboard" data-dashboard_id = "MyRT" data-user_id = '<% $id %>'>
+ <& /Widgets/SearchSelection,
+ pane_name => \%pane_name,
+ sections => \@sections,
@@
filters => \@filters,
&>
<input type="hidden" name="id" value="<% $id %>"/>
-<input type"submit" class="button" name="UpdateSearches" value= "<% loc('Save') %>" >
-+<input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value= "<% loc('Save') %>" >
- <div class="form-row">
- <div class="col-md-12">
- <input type="submit" class="button form-control btn btn-primary" value="<%loc('Reset to default')%>">
+-<div class="form-row">
+- <div class="col-md-12">
+- <input type="submit" class="button form-control btn btn-primary" value="<%loc('Reset to default')%>">
+- </div>
+-</div>
++<& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
++</form>
++<form method="post" action="MyRT.html?id=<% $id %>">
++ <input type="hidden" name="Reset" value="1" />
++ <& /Elements/Submit, Label => loc('Reset to default') &>
+ </form>
+
+ <%init>
+@@
+ my $user = RT::User->new($session{'CurrentUser'});
+ my $title = loc("RT at a glance for the user [_1]", $UserObj->Name);
+
++if ($ARGS{Reset}) {
++ for my $pref_name ('HomepageSettings', 'SummaryRows') {
++ next unless $UserObj->Preferences($pref_name);
++ my ($ok, $msg) = $UserObj->DeletePreferences($pref_name);
++ push @actions, $msg unless $ok;
++ }
++ push @actions, loc('Preferences saved for user [_1].', $UserObj->Name) unless @actions;
++}
++
+ my $portlets = $UserObj->Preferences('HomepageSettings');
+ unless ($portlets) {
+- my ($defaults) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
+- $portlets = $defaults ? $defaults->Content : {};
++ my ($defaults) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
++ $portlets = $defaults ? $defaults->Content : {};
+ }
+
+ my @sections;
diff --git a/share/html/Dashboards/Queries.html b/share/html/Dashboards/Queries.html
--- a/share/html/Dashboards/Queries.html
+++ b/share/html/Dashboards/Queries.html
@@
+ <& /Elements/Tabs &>
+ <& /Elements/ListActions, actions => \@results &>
+
+-<form method="post" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='<%$Dashboard->Id%>'>
++<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='<%$Dashboard->Id%>'>
+ <& /Widgets/SearchSelection,
+ pane_name => \%pane_name,
+ sections => \@sections,
selected => \%selected,
filters => \@filters,
&>
- <input type="submit" class="button" name="UpdateSearches" value="<% loc('Save') %>" />
-+ <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value="<% loc('Save') %>" />
++ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
</form>
<%INIT>
my @results;
@@ -48,14 +107,26 @@
--- a/share/html/Prefs/MyRT.html
+++ b/share/html/Prefs/MyRT.html
@@
+ <& /Elements/Tabs &>
+ <& /Elements/ListActions, actions => \@results &>
+
+-<form method="post" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT'>
++<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT'>
+ <& /Widgets/SearchSelection,
+ pane_name => \%pane_name,
+ sections => \@sections,
selected => \%selected,
filters => \@filters,
&>
- <input type="submit" class="button" name="UpdateSearches" value="<% loc('Save') %>" />
-+ <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value="<% loc('Save') %>" />
- </form>
-
- <&|/Widgets/TitleBox, title => loc('Options'), bodyclass => "" &>
++ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
+ </form>
+
+-<&|/Widgets/TitleBox, title => loc('Options'), bodyclass => "" &>
++<&|/Widgets/TitleBox, title => loc('Options'), bodyclass => "", class => "mx-auto max-width-lg" &>
+ <form method="post" action="MyRT.html">
+ <div class="form-row">
+ <div class="col-md-auto label">
@@
<input class="form-control" type="text" name="SummaryRows" value="<% $ARGS{SummaryRows} %>" />
</div>
@@ -65,8 +136,9 @@
</div>
</div>
</form>
-@@
- <&|/Widgets/TitleBox, title => loc("Reset RT at a glance") &>
+ </&>
+-<&|/Widgets/TitleBox, title => loc("Reset RT at a glance") &>
++<&|/Widgets/TitleBox, title => loc("Reset RT at a glance"), class => "mx-auto max-width-lg" &>
<form method="post" action="MyRT.html">
<input type="hidden" name="Reset" value="1" />
-<input type="submit" class="button form-control btn btn-primary"" value="<% loc('Reset to default') %>">
@@ -100,7 +172,7 @@
- <h2><&|/l&>Saved Searches</&></h2>
+ <div class="form-row">
-+ <div class="col-md-4">
++ <div class="col-md-6">
+ <div class="source">
<div class="filters">
- <input type="search" name="search" placeholder="<&|/l&>Search…</&>" autocomplete="off">
@@ -132,7 +204,7 @@
-</div>
+ </div>
+
-+ <div class="col-md-4 ml-2">
++ <div class="col-md-6">
+ <div class="destinations">
+% for my $pane (sort keys %pane_name) {
+ <div class="destination" data-pane="<% $pane %>">
3: d9c7f0fc3f = 3: 9f80057936 Switch remove icon to fontawesome
4: 66ecc87af0 < -: ------- Fix reset to defaults
5: 4052faded4 = 4: 12cb85b573 Force redirect back to the current page on submit
6: 6d328c2977 = 5: 14aa1e1654 Update tests for MyRT Helper changes
7: 86c1e43c83 ! 6: 9c500d8d21 Refactor DashboardSelectionUI
@@ -157,8 +157,8 @@
<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@results &>
--<form method="post" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT' data-is_global=True>
-+<form method="post" name="UpdateSearches">
+-<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT' data-is_global=True>
++<form method="post" name="UpdateSearches" class="mx-auto max-width-lg">
<& /Widgets/SearchSelection,
pane_name => \%pane_name,
sections => \@sections,
@@ -167,7 +167,7 @@
&>
+ <input type="hidden" name="dashboard_id" value="MyRT">
+ <input type="hidden" name="is_global" value="1">
- <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value="<% loc('Save') %>" />
+ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
</form>
<%INIT>
@@ -211,8 +211,8 @@
<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@actions &>
--<form method="post" action="<% RT->Config->Get('WebPath') %> /Helpers/UpdateDashboard" data-dashboard_id = "MyRT" data-user_id = '<% $id %>'>
-+<form method="post" action="MyRT.html?id=<% $id %>" name="UpdateSearches">
+-<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %> /Helpers/UpdateDashboard" data-dashboard_id = "MyRT" data-user_id = '<% $id %>'>
++<form method="post" action="MyRT.html?id=<% $id %>" name="UpdateSearches" class="mx-auto max-width-lg">
<& /Widgets/SearchSelection,
pane_name => \%pane_name,
sections => \@sections,
@@ -222,9 +222,13 @@
-<input type="hidden" name="id" value="<% $id %>"/>
+<input type="hidden" name="dashboard_id" value="MyRT">
+<input type="hidden" name="user_id" value=<% $id %>>
- <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value= "<% loc('Save') %>" >
+ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
</form>
- <form method="post" action="MyRT.html?id=<% $id %>">
+-<form method="post" action="MyRT.html?id=<% $id %>">
++<form method="post" action="MyRT.html?id=<% $id %>" class="mx-auto max-width-lg">
+ <input type="hidden" name="Reset" value="1" />
+ <& /Elements/Submit, Label => loc('Reset to default') &>
+ </form>
@@
push @objs, RT::SavedSearch->new ($session{'CurrentUser'})->ObjectsForLoading
if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
@@ -262,8 +266,8 @@
<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@results &>
--<form method="post" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='<%$Dashboard->Id%>'>
-+<form method="post" name="UpdateSearches">
+-<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='<%$Dashboard->Id%>'>
++<form method="post" name="UpdateSearches" class="mx-auto max-width-lg">
<& /Widgets/SearchSelection,
pane_name => \%pane_name,
sections => \@sections,
@@ -271,7 +275,7 @@
filters => \@filters,
&>
+ <input type="hidden" name="dashboard_id" value="<% $id %>">
- <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value="<% loc('Save') %>" />
+ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
</form>
<%INIT>
@@
@@ -454,8 +458,8 @@
<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@results &>
--<form method="post" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT'>
-+<form method="post" name="UpdateSearches">
+-<form method="post" class="mx-auto max-width-lg" action="<% RT->Config->Get('WebPath') %>/Helpers/UpdateDashboard" data-dashboard_id='MyRT'>
++<form method="post" name="UpdateSearches" class="mx-auto max-width-lg">
<& /Widgets/SearchSelection,
pane_name => \%pane_name,
sections => \@sections,
@@ -463,7 +467,7 @@
filters => \@filters,
&>
+ <input type="hidden" name="dashboard_id" value="MyRT">
- <input type="submit" class="button form-control btn btn-primary" name="UpdateSearches" value="<% loc('Save') %>" />
+ <& /Elements/Submit, Name => "UpdateSearches", Label => loc('Save') &>
</form>
@@
@@ -552,3 +556,4 @@
});
});
});
+
-: ------- > 7: bc8e0b9c73 Update tests for refactor to post
More information about the rt-commit
mailing list