[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.0alpha1-400-g6ed7af015a
? sunnavy
sunnavy at bestpractical.com
Thu May 7 17:01:57 EDT 2020
The branch, 5.0-trunk has been updated
via 6ed7af015a68390634d9eacfca6dc7c186527806 (commit)
via edbac9ccd753e862de2a0b5b0e3a2eefa1dc860f (commit)
via f938286cc3405bf7be5fe8bc65870e0ddd9bdc9f (commit)
from ac2b4eb06d657db1282a6ca554486a1053f619b8 (commit)
Summary of changes:
docs/UPGRADING-5.0 | 7 +++++++
etc/RT_Config.pm.in | 12 ++++++++++++
lib/RT/Config.pm | 3 +++
lib/RT/Interface/Web.pm | 1 +
t/web/login.t | 16 ++++++++++++++++
t/web/mobile.t | 1 +
6 files changed, 40 insertions(+)
- Log -----------------------------------------------------------------
commit f938286cc3405bf7be5fe8bc65870e0ddd9bdc9f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Thu May 7 14:15:01 2020 -0400
Default mobile devices to the full RT UI
Previously RT detected mobile devices and presented a
mobile-optimized interface. RT is now responsive, so default
mobile devices to the full UI. The new configuration option
can be used to restore the previous behavior.
diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
index ebe2958dd5..c9ff9d5ac6 100644
--- a/docs/UPGRADING-5.0
+++ b/docs/UPGRADING-5.0
@@ -122,6 +122,13 @@ All other dashboard menu functionality should be the same including editing
your own menu, the global settings, and setting a user's menu from the user
admin page for that user.
+=item *
+
+Accessing RT from a mobile device no longer defaults to the mobile-optimized
+interface. RT 5.0 is fully responsive so the full UI can be used on mobile
+devices. Set the configuration option C<$ShowMobileSite> to true to restore
+the previous behavior.
+
=back
=cut
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 6834f32939..75ca73e6e6 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1629,6 +1629,18 @@ be overridden by users in their preferences.
Set($WebDefaultStylesheet, "elevator-light");
+=item C<$ShowMobileSite>
+
+Starting with RT 5.0, RT's web interface is fully responsive and
+will render correctly on most mobile devices. However, RT also has
+a mobile-optimized mode that shows a limited feature set
+focused on ticket updates. To default to this site when RT is accessed
+from a mobile device, enable this option (set to 1).
+
+=cut
+
+Set($ShowMobileSite, 0);
+
=item C<$DefaultQueue>
Use this to select the default queue name that will be used for
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 853e05b971..4960737156 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1856,6 +1856,9 @@ our %META;
LogToSyslogConf => {
Immutable => 1,
},
+ ShowMobileSite => {
+ Widget => '/Widgets/Form/Boolean',
+ }
);
my %OPTIONS = ();
my @LOADED_CONFIGS = ();
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index f21eaf42be..74103b03f5 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1167,6 +1167,7 @@ sub SendStaticFile {
sub MobileClient {
my $self = shift;
+ return undef unless RT->Config->Get('ShowMobileSite');
if ((RequestENV('HTTP_USER_AGENT') || '') =~ /(?:hiptop|Blazer|Novarra|Vagabond|SonyEricsson|Symbian|NetFront|UP.Browser|UP.Link|Windows CE|MIDP|J2ME|DoCoMo|J-PHONE|PalmOS|PalmSource|iPhone|iPod|AvantGo|Nokia|Android|WebOS|S60|Mobile)/io && !$HTML::Mason::Commands::session{'NotMobile'}) {
return 1;
commit edbac9ccd753e862de2a0b5b0e3a2eefa1dc860f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Thu May 7 14:36:37 2020 -0400
Update tests for mobile defaulting off
diff --git a/t/web/login.t b/t/web/login.t
index 862782a0cc..222f40e1ba 100644
--- a/t/web/login.t
+++ b/t/web/login.t
@@ -93,6 +93,22 @@ diag "mobile login with not mobile client";
$m->content_lacks( 'Logout', 'really logout' );
}
+diag "mobile normal login, mobile off";
+{
+
+ # default browser in android 2.3.6
+ $m->agent(
+"Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus One Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
+ );
+
+ $m->get($baseurl);
+ is( $m->uri, $baseurl, "right url" );
+ $m->content_lacks( "/m/index.html?NotMobile=1", 'normal UI login' );
+}
+
+RT::Test->stop_server;
+RT->Config->Set(ShowMobileSite => 1);
+( $baseurl, $m ) = RT::Test->started_ok;
diag "mobile normal login";
{
diff --git a/t/web/mobile.t b/t/web/mobile.t
index 831bf6652a..908096399c 100644
--- a/t/web/mobile.t
+++ b/t/web/mobile.t
@@ -2,6 +2,7 @@ use strict;
use warnings;
use RT::Test tests => 170;
+RT->Config->Set(ShowMobileSite => 1);
my ( $url, $m ) = RT::Test->started_ok;
my $root = RT::Test->load_or_create_user( Name => 'root' );
commit 6ed7af015a68390634d9eacfca6dc7c186527806
Merge: ac2b4eb06d edbac9ccd7
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri May 8 04:51:50 2020 +0800
Merge branch '5.0/mobile-config-option' into 5.0-trunk
-----------------------------------------------------------------------
More information about the rt-commit
mailing list