[Rt-commit] rt branch, 4.6/configindatabase-themed, repushed
Michel Rodriguez
michel at bestpractical.com
Wed Nov 6 09:58:49 EST 2019
The branch 4.6/configindatabase-themed was deleted and repushed:
was 2ed7c8633e12f2200ba40de9e7b081778bcc0175
now cfcc500f7f1c952174a8e1b435465516ff2f6413
--: ------- > 1: c9a5e3f654 Allow specifying size for Integer and String widgets
--: ------- > 2: e48aa8f6cc Allow String widget to have a value of "0"
1: 8e91b3d5e2 ! 3: 12f9dcbca0 Add RadioStyle option to Boolean widget
@@ -22,4 +22,20 @@
<input type="hidden" name="<% $Name %>" value="0" />\
<div class="custom-control custom-checkbox">
<input type="checkbox" id="<% $Name %>" name="<% $Name %>" class="custom-control-input" value="1" <% $CurrentValue? ' checked="checked"': '' |n %>>
+@@
+ <label class="custom-control-label" for="<% $Name %>-no"><&|/l&>No</&></label>
+ </div>
+ </div>
+-
++% if ($Default) {
+ <div class="col-md-auto">
+ <div class="custom-control custom-radio">
+ <input type="radio" id="<% $Name %>-empty" name="<% $Name %>" class="custom-control-input" value="__empty_value__" <% !defined $CurrentValue? ' checked="checked"': '' |n %>>
+ <label class="custom-control-label" for="<% $Name %>-empty"><% $DefaultLabel %></label>
+ </div>
+ </div>
++% }
+ </div>
+ % }
+ </%METHOD>
--: ------- > 4: f2cd149e74 Make booleans with RadioStyle use true/false logic
2: 53c43bf1e8 ! 5: 46185f9e0a DatabaseSetting schema updates
@@ -176,7 +176,7 @@
--- a/etc/upgrade/4.5.0/schema.Pg
+++ b/etc/upgrade/4.5.0/schema.Pg
@@
- ALTER TABLE Scrips DROP COLUMN HotList;
+ ALTER TABLE Classes DROP COLUMN HotList;
+CREATE SEQUENCE databasesettings_id_seq;
+CREATE TABLE DatabaseSettings (
+ id integer DEFAULT nextval('databasesettings_id_seq'),
@@ -219,7 +219,7 @@
--- a/etc/upgrade/4.5.0/schema.mysql
+++ b/etc/upgrade/4.5.0/schema.mysql
@@
- ALTER TABLE Scrips DROP COLUMN HotList;
+ ALTER TABLE Classes DROP COLUMN HotList;
+CREATE TABLE DatabaseSettings (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ Name varchar(255) NOT NULL,
3: b6ff513921 = 6: 44d5d96568 Add ORM classes for DatabaseSettings
4: ff47365a01 = 7: 04e7c94870 Port database config loading and refreshing from extension
5: a740b7b262 = 8: 55a4dac8c0 Add Code and MultilineString widgets
6: 42667e9e1b ! 9: d967bbbc93 Port EditConfig page from extension
@@ -294,31 +294,3 @@
+</form>
+
-diff --git a/share/static/css/elevator-light/forms.css b/share/static/css/elevator-light/forms.css
---- a/share/static/css/elevator-light/forms.css
-+++ b/share/static/css/elevator-light/forms.css
-@@
- ul li .dropdown-item:active span {
- color: #fff;
- }
-+
-+/* remove unnecessary left padding for radio options */
-+#EditConfig div.widget .label {
-+ width: auto;
-+ float: none;
-+}
-+
-+#EditConfig textarea:disabled,
-+#EditConfig input:disabled {
-+ background-color: #EEE;
-+}
-+
-+.widget.code textarea,
-+textarea.code {
-+ font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
-+}
-+
-+#EditConfig ul.plugins {
-+ margin: 0;
-+}
-
7: d54a91b4d9 = 10: 9f34fb6d5c Annotate Immutable options
8: 904c41ee3f ! 11: a85c0c08b3 Add widget metadata for config options
@@ -168,9 +168,13 @@
Type => 'HASH',
PostLoadCheck => sub {
@@
-
+ }
+ },
+ },
+-
ServiceAgreements => {
Type => 'HASH',
+ },
+ AllowUserAutocompleteForUnprivileged => {
+ Widget => '/Widgets/Form/Boolean',
+ },
@@ -520,8 +524,8 @@
+ DefaultSearchResultOrder => {
+ Widget => '/Widgets/Form/Select',
+ WidgetArguments => { Values => [qw(ASC DESC)] },
-+>>>>>>> f25747d25... Add widget metadata for config options
- },
++ },
);
my %OPTIONS = ();
+ my @LOADED_CONFIGS = ();
9: 8f5a024fdf = 12: 6d61a93a18 Hide deprecated options
10: eee0dfdcc2 = 13: 1e69c96f2c List Database as source of configuration on Sys Config page
--: ------- > 14: 0bf9dcf301 Port EditConfig page from extension
11: cedebbe0eb = 15: b8b29e09ca Render config with EditLink as readonly
14: 9e5ea242fc ! 16: d5c0a25803 Switch from Storable::dclone to Clone::clone to handle code/regex
@@ -9,11 +9,19 @@
use File::Spec ();
use Symbol::Global::Name;
use List::MoreUtils 'uniq';
--use Storable ();
+-use Storable;
+use Clone ();
- use Pod::Simple::HTML;
# Store log messages generated before RT::Logger is available
+ our @PreInitLoggerMessages;
+@@
+
+ return $self->Get(@_) unless $obfuscate;
+
+- require Clone;
+ my $res = Clone::clone( $self->Get( @_ ) );
+ $res = $obfuscate->( $self, $res, $user );
+ return $self->_ReturnValue( $res, $META{$name}->{'Type'} || 'SCALAR' );
@@
if (!exists $original_setting_from_files{$name}) {
$original_setting_from_files{$name} = [
15: 471d210558 = 17: 4e878f2e6a Fix index of "Disabled" for mysql
--: ------- > 18: 190dd27679 Fixes the Callback argument, it is an argument of the widget, not the option.
--: ------- > 19: a4848b8676 Updates config edit widgets (bootstrap+defaults)
12: 303ce88925 ! 20: d58b2f1e88 Restructures configuration in database pages.
@@ -1,11 +1,13 @@
Author: michel <michel at bestpractical.com>
- Adds tabs to the Configuration in DB feature
+ Restructures configuration in database pages.
- The tab/section structure is set in Config.pm, subsections
- are defined by parsing RT_Config.pm.
+ Options are grouped in tabs/sections/sub-sections.
- The whole page now uses bootstrap with 4.6 styles.
+ 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
@@ -52,11 +54,9 @@
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@
- use File::Spec ();
use Symbol::Global::Name;
use List::MoreUtils 'uniq';
--use Storable;
-+use Storable ();
+ use Clone ();
+use Pod::Simple::HTML;
# Store log messages generated before RT::Logger is available
@@ -90,7 +90,6 @@
}
},
},
--
+ UserAutocreateDefaultsOnLogin => {
+ Type => 'HASH',
+ },
@@ -99,25 +98,6 @@
+ },
ServiceAgreements => {
Type => 'HASH',
-+ },
- AllowUserAutocompleteForUnprivileged => {
- Widget => '/Widgets/Form/Boolean',
- },
-@@
- ValidateUserEmailAddresses => {
- Widget => '/Widgets/Form/Boolean',
- },
-+ VERPPrefix => {
-+ Widget => '/Widgets/Form/String',
-+ Hints => 'rt-',
-+ },
-+ VERPDomain => {
-+ Widget => '/Widgets/Form/String',
-+ Hints => '',
-+#RT->Config->Get( 'Organization'),
-+ },
- WebFallbackToRTLogin => {
- Widget => '/Widgets/Form/Boolean',
},
@@
WebImagesURL => {
@@ -147,10 +127,6 @@
DefaultSearchResultOrder => {
Widget => '/Widgets/Form/Select',
WidgetArguments => { Values => [qw(ASC DESC)] },
-->>>>>>> f25747d25... Add widget metadata for config options
- },
- );
- my %OPTIONS = ();
@@
}
}
@@ -455,7 +431,6 @@
+
+my $current_value = $is_code ? $val : $raw_value;
+my $args = $meta->{'WidgetArguments'} || {};
-+
+if ($widget eq '/Widgets/Form/Boolean') {
+ %$args = (
+ Default => 0,
@@ -507,12 +482,12 @@
+ Default => 1,
+ DefaultValue => '',
+ DefaultLabel => '(no value)',
-+ RT->Config->FinalizeWidgetArguments( $args ),
+ Name => $name,
+ LabelLink => $doc_url,
+ CurrentValue => $current_value,
+ Description => $name,
+ Hints => $meta->{WidgetArguments}->{Hints} || '',
++ RT->Config->FinalizeWidgetArguments( $args ),
+ &>
+<textarea class="hidden" name="<% $name %>-Current"><% $current_value %></textarea>
+% }
@@ -693,7 +668,7 @@
+%#
+%# END BPS TAGGED BLOCK }}}
+
-+% my $nav_type = 'tab'; # 'tab' or 'pill'
++% my $nav_type = 'pill'; # 'tab' or 'pill'
+% my $tab_id= RT->Config->name_to_id( $tab->{Name} );
+<div class="row">
+ <div class="col-3">
@@ -908,235 +883,3 @@
+%#</&>
+</div><!-- content-all -->
-diff --git a/share/html/Prefs/Other.html b/share/html/Prefs/Other.html
---- a/share/html/Prefs/Other.html
-+++ b/share/html/Prefs/Other.html
-@@
- % my $meta = RT->Config->Meta( $option );
- <& $meta->{'Widget'},
- Default => 1,
-- %{ $m->comp('/Widgets/FinalizeWidgetArguments', WidgetArguments =>
-- $meta->{'WidgetArguments'} ) },
-+ Description => $option,
-+ RT->Config->FinalizeWidgetArguments( $meta->{'WidgetArguments'} ),
- Name => $option,
- DefaultValue => scalar RT->Config->Get( $option ),
- CurrentValue => $preferences->{ $option },
-
-diff --git a/share/html/Widgets/BulkEdit b/share/html/Widgets/BulkEdit
---- a/share/html/Widgets/BulkEdit
-+++ b/share/html/Widgets/BulkEdit
-@@
- % for my $type ( @$Types ) {
- <& $Meta->{$type}{'Widget'},
- Default => $Default,
-- %{ $m->comp('/Widgets/FinalizeWidgetArguments', WidgetArguments =>
-- $Meta->{$type}{'WidgetArguments'} ) },
-+ RT->Config->FinalizeWidgetArguments( $Meta->{$type}{'WidgetArguments'} ),
- Name => $type,
- exists $CurrentValue->{$type} ? ( CurrentValue => $CurrentValue->{$type} )
- : (),
-
-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
-@@
- see docs/extending/using_forms_widgets.pod
- </%DOC>
- <div id="form-box-<% lc $Name %>" class="widget form-row">
-- <div class="col-md-3 label">
-- <% $Description // '' %>
-- </div>
-- <div class="col-md-9 value">
-+ <span class="col-md-3 label">
-+% if( $LabelLink ) {
-+ <a href="<% $LabelLink %>"><% $Description %></a>
-+% } else {
-+ <% $Description %>
-+% }
-+ </span>
-+ <span class="col-md-9 value">
- <& SELF:InputOnly, %ARGS &>
- <span class="hints"><% $Hints %></span>
-- </div>
-+ </span>
- </div>
- <%ARGS>
- $Name => undef,
- $Description => undef,
- $Hints => ''
-+$LabelLink => ''
- </%ARGS>
-
- <%METHOD InputOnly>
-@@
- <label class="custom-control-label" for="<% $Name %>-no"><&|/l&>No</&></label>
- </div>
- </div>
--
- <div class="col-md-auto">
- <div class="custom-control custom-radio">
- <input type="radio" id="<% $Name %>-empty" name="<% $Name %>" class="custom-control-input" value="__empty_value__" <% !defined $CurrentValue? ' checked="checked"': '' |n %>>
-
-diff --git a/share/html/Widgets/Form/Integer b/share/html/Widgets/Form/Integer
---- a/share/html/Widgets/Form/Integer
-+++ b/share/html/Widgets/Form/Integer
-@@
- see docs/extending/using_forms_widgets.pod
- </%DOC>
- <div id="form-box-<% lc $Name %>" class="widget form-row">
-- <div class="col-md-3 label">
-- <% $Description // '' %>
-- </div>
-- <div class="col-md-9 value">
-+ <span class="col-md-3 label">
-+% if( $LabelLink ) {
-+ <a href="<% $LabelLink %>"><% $Description %></a>
-+% } else {
-+ <% $Description %>
-+% }
-+ </span>
-+ <span class="col-md-9 value">
- <& SELF:InputOnly, %ARGS &>
- % if ( $Default ) {
- <span class="comment"><% $DefaultLabel %></span>
- % }
- <span class="hints"><% $Hints %></span>
-- </div>
-+ </span>
- </div>
- <%INIT>
- $_ = '' foreach grep !defined, $CurrentValue, $DefaultValue;
-@@
- $Default => 0,
- $DefaultValue => 0,
- $DefaultLabel => undef
-+$LabelLink => ''
- </%ARGS>
-
- <%METHOD InputOnly>
--<input type="text" name="<% $Name %>" value="<% $CurrentValue %>" class="form-control" />\
-+<input type="text" name="<% $Name %>" size="<% $Size %>" value="<% $CurrentValue %>" class="form-control" />\
- <%ARGS>
- $Name
- $CurrentValue => '',
-+$Size => 20
- </%ARGS>
- <%INIT>
- $CurrentValue = '' unless defined $CurrentValue;
-
-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
-@@
- <%DOC>
- see docs/extending/using_forms_widgets.pod
- </%DOC>
--<div id="form-box-<% lc $Name %>" class="widget <% $Class %>">
--<span class="description label"><% $Description %></span>
--<span class="value"><& SELF:InputOnly, %ARGS &></span>
-+<div id="form-box-<% lc $Name %>" class="widget form-row <% $Class %>">
-+ <span class="col-md-3 label">
-+% if( $LabelLink ) {
-+ <a href="<% $LabelLink %>"><% $Description %></a>
-+% } else {
-+ <% $Description %>
-+% }
-+ </span>
-+<span class="col-md-9 value"><& SELF:InputOnly, %ARGS &>
- % if ( $Default ) {
- <span class="comment"><% $DefaultLabel %></span>
- % }
- <span class="hints"><% $Hints %></span>
-+</span>
- </div>
- <%ARGS>
- $Name
--
-+$LabelLink => ''
- $Class => ''
- $Description => undef,
- $Hints => ''
-
-diff --git a/share/html/Widgets/Form/Select b/share/html/Widgets/Form/Select
---- a/share/html/Widgets/Form/Select
-+++ b/share/html/Widgets/Form/Select
-@@
- see docs/extending/using_forms_widgets.pod
- </%DOC>
- <div id="form-box-<% lc $Name %>" class="widget form-row">
-- <div class="col-md-3 label">
-- <% $Description // '' %>
-- </div>
-- <div class="col-md-9 value">
-+ <span class="col-md-3 label">
-+% if( $LabelLink ) {
-+ <a href="<% $LabelLink %>"><% $Description %></a>
-+% } else {
-+ <% $Description %>
-+% }
-+ </span>
-+ <span class="col-md-9 value">
- <& SELF:InputOnly, %ARGS &>
- <span class="hints"><% $Hints %></span>
-- </div>
-+ </span>
- </div>
- <%ARGS>
- $Name
- $Description => undef,
- $Hints => ''
-+$LabelLink => ''
- </%ARGS>
-
- <%METHOD InputOnly>
-
-diff --git a/share/html/Widgets/Form/String b/share/html/Widgets/Form/String
---- a/share/html/Widgets/Form/String
-+++ b/share/html/Widgets/Form/String
-@@
- see docs/extending/using_forms_widgets.pod
- </%DOC>
- <div id="form-box-<% lc $Name %>" class="widget form-row">
-- <div class="col-md-3 label">
-+ <span class="col-md-3 label">
-+% if( $LabelLink ) {
-+ <a href="<% $LabelLink %>"><% $Description %></a>
-+% } else {
- <% $Description // '' %>
-- </div>
-- <div class="col-md-9 value">
-+% }
-+ </span>
-+ <span class="col-md-9 value">
- <& SELF:InputOnly, %ARGS &>
- % if ( $Default ) {
- <span class="comment"><% $DefaultLabel %></span>
- % }
- <span class="hints"><% $Hints %></span>
-- </div>
-+ </span>
- </div>
- <%ARGS>
- $Name
-@@
-
- $Default => 0,
- $DefaultValue => '',
--$DefaultLabel => loc( 'Default: [_1]', $DefaultValue ),
-+$DefaultLabel => loc( 'Default: [_1]', $DefaultValue // '' ),
-+$LabelLink => '',
- </%ARGS>
-
- <%METHOD InputOnly>
--<input type="<% $Type %>" name="<% $Name %>" value="<% $CurrentValue || '' %>" class="form-control" />\
-+<input type="<% $Type %>" name="<% $Name %>" size="<% $Size %>" value="<% $CurrentValue // '' %>" class="form-control" />\
- <%ARGS>
- $Name
- $CurrentValue => '',
- $Type => 'text'
-+$Size => 20
- </%ARGS>
- </%METHOD>
-
-
13: 9cdc2ce750 < --: ------- Uses bootstrap pill for section left column menu
16: 5df044e26b < --: ------- Moved widget arguments to the right spot
17: 2ed7c8633e < --: ------- Call FinalizeWidgetArguments after all other argument processing
--: ------- > 21: cfcc500f7f Use the new FinalizeWidgetArguments method in Config.pm.
More information about the rt-commit
mailing list