From 6514598f6635406ca69136ad548e65b0cf2d7089 Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Thu, 9 May 2024 18:40:08 +0200 Subject: [PATCH] Dashboard Text Panel: improve feed when changing Description Summary: When creating a Dashboard Text Panel, from example from here: http://phorge.localhost/dashboard/panel/edit/?panelType=text After you change its Description, Before this change, this was the feed (but you must have Developer Mode): foo.bar edited this object (transaction type "text.text"). After this change, this is the feed: foo.bar edited the the panel text. (Show Details) So, not only we show a nice title, but we also allow to see details. | Before | After | |------------|------------| | {F2182938} | {F2182943} | Credits: - LegalpadDocumentTextTransaction for the getTitle() method - ManiphestTaskDescriptionTransaction for the details Closes T15817 Test Plan: - Create a Text Panel from /dashboard/panel/edit/?panelType=text - Change description - See the new feed - Click on "Show Details". Also that works. You see A/B changes. Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15817 Differential Revision: https://we.phorge.it/D25625 --- ...catorDashboardTextPanelTextTransaction.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/applications/dashboard/xaction/panel/PhabricatorDashboardTextPanelTextTransaction.php b/src/applications/dashboard/xaction/panel/PhabricatorDashboardTextPanelTextTransaction.php index 1822810c05..b61961c0f7 100644 --- a/src/applications/dashboard/xaction/panel/PhabricatorDashboardTextPanelTextTransaction.php +++ b/src/applications/dashboard/xaction/panel/PhabricatorDashboardTextPanelTextTransaction.php @@ -9,6 +9,25 @@ final class PhabricatorDashboardTextPanelTextTransaction return 'text'; } + public function getTitle() { + return pht( + '%s updated the panel text.', + $this->renderAuthor()); + } + + public function hasChangeDetailView() { + return true; + } + + public function newChangeDetailView() { + $viewer = $this->getViewer(); + + return id(new PhabricatorApplicationTransactionTextDiffDetailView()) + ->setViewer($viewer) + ->setOldText($this->getOldValue()) + ->setNewText($this->getNewValue()); + } + public function newRemarkupChanges() { $changes = array();