[Rt-commit] rt branch, 4.6/log-view-db-config-change-history, repushed
Aaron Trevena
ast at bestpractical.com
Mon Mar 16 12:50:16 EDT 2020
The branch 4.6/log-view-db-config-change-history was deleted and repushed:
was e8aa052571775de3552356a39537070e5b617586
now 446c704e2df0d9d80cf7de8b3c8bfa7af61fecab
1: 4bd810170 ! 1: 9082be19f Schema updates for tracking db configuration changes in transactions
@@ -82,7 +82,7 @@
) ENGINE=InnoDB CHARACTER SET utf8mb4;
-CREATE UNIQUE INDEX Configurations1 ON Configurations (Name);
-+CREATE INDEX Configurations1 ON Configurations (Name(128), Disabled);
++CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
CREATE INDEX Configurations2 ON Configurations (Disabled);
@@ -96,7 +96,6 @@
+
+DROP INDEX Configurations1;
+CREATE INDEX Configurations1 ON Configurations (LOWER(Name), Disabled);
-\ No newline at end of file
diff --git a/etc/upgrade/4.5.3/schema.Pg b/etc/upgrade/4.5.3/schema.Pg
new file mode 100644
@@ -108,7 +107,6 @@
+
+DROP INDEX IF EXISTS Configurations1;
+CREATE INDEX Configurations1 ON Configurations (LOWER(Name), Disabled);
-\ No newline at end of file
diff --git a/etc/upgrade/4.5.3/schema.SQLite b/etc/upgrade/4.5.3/schema.SQLite
new file mode 100644
@@ -120,7 +118,6 @@
+
+DROP INDEX IF EXISTS Configurations1;
+CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
-\ No newline at end of file
diff --git a/etc/upgrade/4.5.3/schema.mysql b/etc/upgrade/4.5.3/schema.mysql
new file mode 100644
@@ -132,7 +129,6 @@
+
+DROP INDEX IF EXISTS Configurations1;
+CREATE INDEX Configurations1 ON Configurations (Name, Disabled);
-\ No newline at end of file
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
--- a/lib/RT/Transaction.pm
2: dd73ca770 < -: ------- Log DB config changes as transactions
-: ------- > 2: 29ebb5fd0 Log DB config changes as transactions
-: ------- > 3: 04b624e6e remove unused stringify function in configuration edit page
3: 985d54402 ! 4: 934901c88 Page to view DB config transaction history
@@ -22,18 +22,6 @@
# due to historical reasons of always having been in /Elements/Tabs
-diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
---- a/lib/RT/Record.pm
-+++ b/lib/RT/Record.pm
-@@
- return $self->Id unless @classes;
-
- my $object = $self;
-+ return $self->Id if (ref($object) eq 'RT::Configuration');
- # Save a ->Load call by not calling ->FooObj->Id, just ->Foo
- my $final = shift @classes;
- foreach my $class (reverse @classes) {
-
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -49,16 +37,19 @@
+ if ( $self->OldReference ) {
+ my $oldobj = RT::Configuration->new($self->CurrentUser);
+ $oldobj->Load($self->OldReference);
-+ $old_value = $oldobj->Content;
++ $old_value = ($oldobj->ContentType =~ /(json|perl)/) ?
++ sprintf('<pre>%s</pre>', $oldobj->Content) : $oldobj->Content;
+ }
+
+ # pull in new value from reference if exists
+ if ( $self->NewReference ) {
+ my $newobj = RT::Configuration->new($self->CurrentUser);
+ $newobj->Load($self->NewReference);
-+ $new_value = $newobj->Content;
++ $new_value = ($newobj->ContentType =~ /(json|perl)/) ?
++ sprintf('<pre>%s</pre>', $newobj->Content) : $newobj->Content;
++
+ }
-+ my $description .= $self->loc('[_1] changed from "[_2]" to "[_3]"', $self->Field, $old_value || '', $new_value || '');
++ my $description = $self->loc('[_1] changed from "[_2]" to "[_3]"', $self->Field, $old_value // '', $new_value // '');
+ return $description;
+ },
+ DeleteConfig => sub {
@@ -69,22 +60,6 @@
);
-@@
-
- =cut
-
-+# Note this will cause errors in /Transaction/Display.html for some non-ticket objects
-+# such as RT::Configuration, pass DisplayPath => '#' to not link to /Transaction/Display.html
-
- sub CustomFieldLookupType {
-- "RT::Queue-RT::Ticket-RT::Transaction";
-+ "RT::Queue-RT::Ticket-RT::Transaction"
- }
-
--
- =head2 SquelchMailTo
-
- Similar to Ticket class SquelchMailTo method - returns a list of
diff --git a/share/html/Admin/Tools/ConfigHistory.html b/share/html/Admin/Tools/ConfigHistory.html
new file mode 100644
@@ -150,9 +125,9 @@
+</%INIT>
+<& /Admin/Elements/Header, Title => $title &>
+ <& /Elements/Tabs &>
-+ <div class="configuration">
++ <div class="configuration history">
+ <& /Admin/Elements/ConfigHelp &>
-+ <&|/Widgets/TitleBox, title => loc('History'), class => 'fullwidth' &>
++ <&|/Widgets/TitleBox, title => loc('History') &>
+% my $i = 1;
+% while (my $tx = $Transactions->Next()) {
+ <& /Elements/ShowTransaction,
@@ -160,7 +135,7 @@
+ ShowHeaders => 1,
+ ShowDisplayModes => 0,
+ ShowActions => 1,
-+ DisplayPath => '#',
++ DisplayPath => 'ConfigHistory.html',
+ HasTxnCFs => 0,
+ RowNum => $i
+ &>
@@ -170,3 +145,12 @@
+ </div>
+
+diff --git a/share/html/Admin/Tools/EditConfig.html b/share/html/Admin/Tools/EditConfig.html
+--- a/share/html/Admin/Tools/EditConfig.html
++++ b/share/html/Admin/Tools/EditConfig.html
+@@
+ </div><!-- content-all -->
+ </div><!-- titlebox-content -->
+ </div><!-- configuration -->
++
+
4: e8aa05257 = 5: 446c704e2 Tests for DB config transactions and history
More information about the rt-commit
mailing list