[Rt-commit] rt branch, 4.6/configindatabase-themed, repushed

Michel Rodriguez michel at bestpractical.com
Fri Nov 8 08:32:46 EST 2019


The branch 4.6/configindatabase-themed was deleted and repushed:
       was cfcc500f7f1c952174a8e1b435465516ff2f6413
       now 1d87ddbb831682eb8c390a121dcb71bd64994648

 1: c9a5e3f654 =  1: c9a5e3f654 Allow specifying size for Integer and String widgets
 2: e48aa8f6cc =  2: e48aa8f6cc Allow String widget to have a value of "0"
 3: 12f9dcbca0 =  3: 12f9dcbca0 Add RadioStyle option to Boolean widget
 4: f2cd149e74 =  4: f2cd149e74 Make booleans with RadioStyle use true/false logic
 5: 46185f9e0a =  5: 46185f9e0a DatabaseSetting schema updates
 6: 44d5d96568 =  6: 44d5d96568 Add ORM classes for DatabaseSettings
 7: 04e7c94870 =  7: 04e7c94870 Port database config loading and refreshing from extension
 8: 55a4dac8c0 =  8: 55a4dac8c0 Add Code and MultilineString widgets
 9: d967bbbc93 =  9: d967bbbc93 Port EditConfig page from extension
10: 9f34fb6d5c = 10: 9f34fb6d5c Annotate Immutable options
11: a85c0c08b3 = 11: a85c0c08b3 Add widget metadata for config options
12: 6d61a93a18 = 12: 6d61a93a18 Hide deprecated options
13: 1e69c96f2c = 13: 1e69c96f2c List Database as source of configuration on Sys Config page
14: 0bf9dcf301 = 14: 0bf9dcf301 Port EditConfig page from extension
15: b8b29e09ca = 15: b8b29e09ca Render config with EditLink as readonly
16: d5c0a25803 = 16: d5c0a25803 Switch from Storable::dclone to Clone::clone to handle code/regex
17: 4e878f2e6a = 17: 4e878f2e6a Fix index of "Disabled" for mysql
18: 190dd27679 = 18: 190dd27679 Fixes the Callback argument, it is an argument of the widget, not the option.
19: a4848b8676 = 19: a4848b8676 Updates config edit widgets (bootstrap+defaults)
20: d58b2f1e88 ! 20: ba37d6b910 Add tabs to the Configuration in DB feature
    @@ -1,54 +1,11 @@
     Author: michel <michel at bestpractical.com>
     
    -    Restructures configuration in database pages.
    +    Add tabs to the Configuration in DB feature
         
    -    Options are grouped in tabs/sections/sub-sections.
    +    The tab/section structure is set in Config.pm, subsections
    +    are defined by parsing RT_Config.pm.
         
    -    The structure is based on a data structure in Config.pm ($SectionMap),
    -    which defines the sections that go in each tab. Sub sections and options
    -    are extracted from RT_Config.pm and assigned to the section based on the
    -    pod.
    -
    -diff --git a/etc/RT_SiteConfig.pm b/etc/RT_SiteConfig.pm
    -deleted file mode 100644
    ---- a/etc/RT_SiteConfig.pm
    -+++ /dev/null
    -@@
    --use utf8;
    --
    --# Any configuration directives you include  here will override
    --# RT's default configuration file, RT_Config.pm
    --#
    --# To include a directive here, just copy the equivalent statement
    --# from RT_Config.pm and change the value. We've included a single
    --# sample value below.
    --#
    --# If this file includes non-ASCII characters, it must be encoded in
    --# UTF-8.
    --#
    --# This file is actually a perl module, so you can include valid
    --# perl code, as well.
    --#
    --# The converse is also true, if this file isn't valid perl, you're
    --# going to run into trouble. To check your SiteConfig file, use
    --# this command:
    --#
    --#   perl -c /path/to/your/etc/RT_SiteConfig.pm
    --#
    --# You must restart your webserver after making changes to this file.
    --#
    --
    --# You may also split settings into separate files under the etc/RT_SiteConfig.d/
    --# directory.  All files ending in ".pm" will be parsed, in alphabetical order,
    --# after this file is loaded.
    --
    --Set( $rtname, 'example.com');
    --
    --# You must install Plugins on your own, this is only an example
    --# of the correct syntax to use when activating them:
    --#     Plugin( "RT::Authen::ExternalAuth" );
    --
    --1;
    +    The whole page now uses bootstrap with 4.6 styles.
     
     diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
     --- a/lib/RT/Config.pm
    @@ -62,72 +19,6 @@
      # Store log messages generated before RT::Logger is available
      our @PreInitLoggerMessages;
     @@
    -             }
    -         },
    -     },
    -+    CanonicalizeEmailAddressMatch => {
    -+        Section         => 'Mail',                                     #loc
    -+        Type            => 'SCALAR',
    -+        Overridable     => 1,
    -+        Widget          => '/Widgets/Form/String',
    -+    },
    -+    CanonicalizeEmailAddressReplace => {
    -+        Section         => 'Mail',                                     #loc
    -+        Type            => 'SCALAR',
    -+        Overridable     => 1,
    -+        Widget          => '/Widgets/Form/String',
    -+    },
    -+    EmailSubjectTagRegex => {
    -+        Section         => 'Mail',                                     #loc
    -+        Type            => 'SCALAR',
    -+        Overridable     => 1,
    -+        Widget          => '/Widgets/Form/String',
    -+    },
    -     # User overridable mail options
    -     EmailFrequency => {
    -         Section         => 'Mail',                                     #loc
    -@@
    -             }
    -         },
    -     },
    -+    UserAutocreateDefaultsOnLogin => {
    -+        Type => 'HASH',
    -+    },
    -+    AutoCreateNonExternalUsers => {
    -+        Widget => '/Widgets/Form/Boolean',
    -+    },
    -     ServiceAgreements => {
    -         Type => 'HASH',
    -     },
    -@@
    -     WebImagesURL => {
    -         Widget => '/Widgets/Form/String',
    -     },
    --
    -+    AssetQueues => {
    -+        Type => 'ARRAY',
    -+        Hints  => '',
    -+    },
    -+    AssetBasicCustomFieldsOnCreate => {
    -+        Type => 'ARRAY',
    -+        Hints  => '[ "foo", "bar"]',
    -+    },
    -+    DefaultCatalog => {
    -+        Widget => '/Widgets/Form/String',
    -+        Hints  => 'General assets',
    -+    },
    -     AssetSearchFormat => {
    -         Widget => '/Widgets/Form/MultilineString',
    -     },
    -@@
    -         Widget => '/Widgets/Form/Select',
    -         WidgetArguments => { Values => [qw(debug info notice warning error critical alert emergency)] },
    -     },
    --
    -     DefaultSearchResultOrder => {
    -         Widget => '/Widgets/Form/Select',
    -         WidgetArguments => { Values => [qw(ASC DESC)] },
    -@@
          }
      }
      
    @@ -142,38 +33,38 @@
     +# the result of the parsing of RT_Config.pm will be added to this
     +# sections will have content: a list of subsections with a Name and a Content
     +our $SectionMap= [
    -+    { Name    => 'System',
    ++    { Name    => 'System', # loc
     +      Content => [
    -+          { Name => 'Base configuration' },
    -+          { Name => 'Database connection' },
    -+          { Name => 'Logging' },
    -+          { Name => 'Incoming mail gateway' },
    -+          { Name => 'Outgoing mail' },
    -+          { Name => 'Application logic' },
    -+          { Name => 'Extra security' },
    -+          { Name => 'Internationalization' },
    -+          { Name => 'Date and time handling' },
    -+          { Name => 'Initialdata Formats' },
    -+          { Name => 'Development options' },
    ++          { Name => 'Base configuration' }, # loc
    ++          { Name => 'Database connection' }, # loc
    ++          { Name => 'Logging' }, # loc
    ++          { Name => 'Incoming mail gateway' }, # loc
    ++          { Name => 'Outgoing mail' }, # loc
    ++          { Name => 'Application logic' }, # loc
    ++          { Name => 'Extra security' }, # loc
    ++          { Name => 'Internationalization' }, # loc
    ++          { Name => 'Date and time handling' }, # loc
    ++          { Name => 'Initialdata Formats' }, # loc
    ++          { Name => 'Development options' }, # loc
     +      ],
     +    },
    -+    { Name => 'Web UI',
    ++    { Name => 'Web UI', # loc
     +      Content => [
    -+          { Name => 'Web interface' },
    ++          { Name => 'Web interface' }, # loc
     +      ],
     +    },
    -+    { Name => 'Features',
    ++    { Name => 'Features', # loc
     +      Content => [
    -+          { Name => 'Assets' },
    -+          { Name => 'Cryptography' },
    -+          { Name => 'External storage' },
    -+          { Name => 'SLA' },
    -+          { Name => 'Administrative interface' },
    ++          { Name => 'Assets' }, # loc
    ++          { Name => 'Cryptography' }, # loc
    ++          { Name => 'External storage' }, # loc
    ++          { Name => 'SLA' }, # loc
    ++          { Name => 'Administrative interface' }, # loc
     +      ],
     +    },
    -+    { Name => 'User Auth',
    ++    { Name => 'User Auth', # loc
     +      Content => [
    -+          { Name => 'Authorization and user configuration' },
    ++          { Name => 'Authorization and user configuration' }, # loc
     +      ],
     +    },
     +];
    @@ -306,28 +197,6 @@
     +    return $active;
     +}
     +
    -+# localizes widget arguments for configuration editing
    -+sub FinalizeWidgetArguments {
    -+    my $self= shift;
    -+    my $WidgetArguments = shift;
    -+
    -+    return () if ! $WidgetArguments;
    -+    my %args = %$WidgetArguments;
    -+
    -+    %args = (%args, %{ $args{Callback}->() }) if $args{Callback};
    -+    $args{'Description'} = loc( $args{'Description'} ) if $args{'Description'};
    -+    $args{'Hints'} = loc( $args{'Hints'} ) if $args{'Hints'};
    -+    if ( $args{'ValuesLabel'} ) {
    -+        my %labels;
    -+        $labels{$_} = loc( $args{'ValuesLabel'}->{$_} )
    -+            for keys %{$args{'ValuesLabel'}};
    -+        $args{'ValuesLabel'} = \%labels;
    -+    }
    -+    return %args;
    -+}
    -+
    -+sub loc { HTML::Mason::Commands::loc( @_ ); }
    -+
      =head2 Configs
      
      Returns list of config files found in local etc, plugins' etc
    @@ -487,7 +356,8 @@
     +    CurrentValue => $current_value,
     +    Description  => $name,
     +    Hints        => $meta->{WidgetArguments}->{Hints} || '',
    -+    RT->Config->FinalizeWidgetArguments( $args ),
    ++    %{ $m->comp('/Widgets/FinalizeWidgetArguments', WidgetArguments =>
    ++            $meta->{'WidgetArguments'} ) },
     +  &>
     +<textarea class="hidden" name="<% $name %>-Current"><% $current_value %></textarea>
     +% }
    @@ -496,35 +366,61 @@
     +$option
     +</%ARGS>
     
    -diff --git a/share/html/Widgets/FinalizeWidgetArguments b/share/html/Admin/Tools/Config/Elements/Section
    -similarity index 79%
    -rename from share/html/Widgets/FinalizeWidgetArguments
    -rename to share/html/Admin/Tools/Config/Elements/Section
    ---- a/share/html/Widgets/FinalizeWidgetArguments
    +diff --git a/share/html/Admin/Tools/Config/Elements/Section b/share/html/Admin/Tools/Config/Elements/Section
    +new file mode 100644
    +--- /dev/null
     +++ b/share/html/Admin/Tools/Config/Elements/Section
     @@
    - %# those contributions and any derivatives thereof.
    - %#
    - %# END BPS TAGGED BLOCK }}}
    --<%init>
    --    my %args = %$WidgetArguments;
    - 
    --    %args = (%args, %{ $args{Callback}->() }) if $args{Callback};
    --    $args{'Description'} = loc( $args{'Description'} ) if $args{'Description'};
    --    $args{'Hints'} = loc( $args{'Hints'} ) if $args{'Hints'};
    --    if ( $args{'ValuesLabel'} ) {
    --        my %labels;
    --        $labels{$_} = loc( $args{'ValuesLabel'}->{$_} )
    --            for keys %{$args{'ValuesLabel'}};
    --        $args{'ValuesLabel'} = \%labels;
    --    }
    --    return \%args;
    --</%init>
    ++%# BEGIN BPS TAGGED BLOCK {{{
    ++%#
    ++%# COPYRIGHT:
    ++%#
    ++%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
    ++%#                                          <sales at bestpractical.com>
    ++%#
    ++%# (Except where explicitly superseded by other copyright notices)
    ++%#
    ++%#
    ++%# LICENSE:
    ++%#
    ++%# This work is made available to you under the terms of Version 2 of
    ++%# the GNU General Public License. A copy of that license should have
    ++%# been provided with this software, but in any event can be snarfed
    ++%# from www.gnu.org.
    ++%#
    ++%# This work is distributed in the hope that it will be useful, but
    ++%# WITHOUT ANY WARRANTY; without even the implied warranty of
    ++%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    ++%# General Public License for more details.
    ++%#
    ++%# You should have received a copy of the GNU General Public License
    ++%# along with this program; if not, write to the Free Software
    ++%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    ++%# 02110-1301 or visit their web page on the internet at
    ++%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
    ++%#
    ++%#
    ++%# CONTRIBUTION SUBMISSION POLICY:
    ++%#
    ++%# (The following paragraph is not intended to limit the rights granted
    ++%# to you to modify and distribute this software under the terms of
    ++%# the GNU General Public License and is only of importance to you if
    ++%# you choose to contribute your changes and enhancements to the
    ++%# community by submitting them to Best Practical Solutions, LLC.)
    ++%#
    ++%# By intentionally submitting any modifications, corrections or
    ++%# derivatives to this work, or any other work intended for use with
    ++%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
    ++%# you are the copyright holder for those contributions and you grant
    ++%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
    ++%# royalty-free, perpetual, license to use, copy, create derivative
    ++%# works based on those contributions, and sublicense and distribute
    ++%# those contributions and any derivatives thereof.
    ++%#
    ++%# END BPS TAGGED BLOCK }}}
    ++
     +% my $section_id= RT->Config->name_to_id( $section->{Name} );
    - 
    --<%args>
    --$WidgetArguments => {}
    --</%args>
    ++
     +% foreach my $subsection ( @{$section->{Content}} ) {
     +%     $current_context->{subsection}= RT->Config->name_to_id( $subsection->{Name});
     +  <& /Admin/Tools/Config/Elements/SubSection, subsection => $subsection, active_context => $active_context, current_context => $current_context &>
    @@ -605,7 +501,11 @@
     +<input type="hidden" name="tab" value="<% $current_context->{tab} %>" />
     +<input type="hidden" name="section" value="<% $current_context->{section} %>" />
     +<input type="hidden" name="subsection" value="<% $current_context->{subsection} %>" />
    -+<& /Elements/Submit, Label => loc('Save Changes') &>
    ++<div class="form-row">
    ++  <span class="col-md-12">
    ++    <& /Elements/Submit, Label => loc('Save Changes') &>
    ++  </span>
    ++</div>
     +</&>
     +</form>
     +% }
    @@ -860,7 +760,6 @@
     -    Hints        => '',
     -  &>
     -<textarea class="hidden" name="<% $key %>-Current"><% $current_value %></textarea>
    -+% #<&|/Widgets/TitleBox, title => loc("RT Configuration") &>
     +<div class="tab-content" id="content-all" >
     +% foreach my $tab ( @$options) {
     +%     my $tab_id= RT->Config->name_to_id( $tab->{Name} );
    @@ -880,6 +779,44 @@
     -<& /Elements/Submit, Label => loc('Save Changes') &>
     -</form>
     -
    -+%#</&>
     +</div><!-- content-all -->
     
    +diff --git a/share/html/Widgets/FinalizeWidgetArguments b/share/html/Widgets/FinalizeWidgetArguments
    +--- a/share/html/Widgets/FinalizeWidgetArguments
    ++++ b/share/html/Widgets/FinalizeWidgetArguments
    +@@
    + %#
    + %# END BPS TAGGED BLOCK }}}
    + <%init>
    +-    my %args = %$WidgetArguments;
    ++    my %args = $WidgetArguments ? %$WidgetArguments : ();
    + 
    +     %args = (%args, %{ $args{Callback}->() }) if $args{Callback};
    +     $args{'Description'} = loc( $args{'Description'} ) if $args{'Description'};
    +
    +diff --git a/share/html/Widgets/Form/Boolean b/share/html/Widgets/Form/Boolean
    +--- a/share/html/Widgets/Form/Boolean
    ++++ b/share/html/Widgets/Form/Boolean
    +@@
    +     <% $Description %>
    + % }
    +   </span>
    +-  <span class="col-md-9 value">
    ++  <span class="col-md-9">
    +     <& SELF:InputOnly, %ARGS &>
    +     <span class="hints"><% $Hints %></span>
    +   </span>
    +
    +diff --git a/share/html/Widgets/Form/MultilineString b/share/html/Widgets/Form/MultilineString
    +--- a/share/html/Widgets/Form/MultilineString
    ++++ b/share/html/Widgets/Form/MultilineString
    +@@
    + </%ARGS>
    + 
    + <%METHOD InputOnly>
    +-<textarea name="<% $Name %>" cols="<% $Cols %>" rows="<% $Rows %>"><% $CurrentValue %></textarea>
    ++<textarea name="<% $Name %>" class="form-control" cols="<% $Cols %>" rows="<% $Rows %>"><% $CurrentValue %></textarea>
    + <%ARGS>
    + $Name
    + $Cols => 80
    +
21: cfcc500f7f < --:  ------- Use the new FinalizeWidgetArguments method in Config.pm.
--:  ------- > 21: 1d87ddbb83 Add missing config options to %META



More information about the rt-commit mailing list