From bf30c072300c379f2604e5e576c2ac6f06169be8 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 8 May 2017 14:00:26 -0700 Subject: [PATCH] Clean up Slowvote transactions a little Summary: Ref T12685. Moves to `xaction` folder and sets description changes in transaction stories. Test Plan: Make a poll, edit the description. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12685 Differential Revision: https://secure.phabricator.com/D17849 --- src/__phutil_library_map__.php | 12 ++++++------ .../PhabricatorSlowvoteCloseTransaction.php | 0 ...PhabricatorSlowvoteDescriptionTransaction.php | 16 +++++++++++----- .../PhabricatorSlowvoteQuestionTransaction.php | 0 .../PhabricatorSlowvoteResponsesTransaction.php | 0 .../PhabricatorSlowvoteShuffleTransaction.php | 0 .../PhabricatorSlowvoteTransactionType.php | 0 7 files changed, 17 insertions(+), 11 deletions(-) rename src/applications/slowvote/{xactions => xaction}/PhabricatorSlowvoteCloseTransaction.php (100%) rename src/applications/slowvote/{xactions => xaction}/PhabricatorSlowvoteDescriptionTransaction.php (76%) rename src/applications/slowvote/{xactions => xaction}/PhabricatorSlowvoteQuestionTransaction.php (100%) rename src/applications/slowvote/{xactions => xaction}/PhabricatorSlowvoteResponsesTransaction.php (100%) rename src/applications/slowvote/{xactions => xaction}/PhabricatorSlowvoteShuffleTransaction.php (100%) rename src/applications/slowvote/{xactions => xaction}/PhabricatorSlowvoteTransactionType.php (100%) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 8389ee567e..cb265bf3d3 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3912,12 +3912,12 @@ phutil_register_library_map(array( 'PhabricatorSlowvoteApplication' => 'applications/slowvote/application/PhabricatorSlowvoteApplication.php', 'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php', 'PhabricatorSlowvoteCloseController' => 'applications/slowvote/controller/PhabricatorSlowvoteCloseController.php', - 'PhabricatorSlowvoteCloseTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteCloseTransaction.php', + 'PhabricatorSlowvoteCloseTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteCloseTransaction.php', 'PhabricatorSlowvoteCommentController' => 'applications/slowvote/controller/PhabricatorSlowvoteCommentController.php', 'PhabricatorSlowvoteController' => 'applications/slowvote/controller/PhabricatorSlowvoteController.php', 'PhabricatorSlowvoteDAO' => 'applications/slowvote/storage/PhabricatorSlowvoteDAO.php', 'PhabricatorSlowvoteDefaultViewCapability' => 'applications/slowvote/capability/PhabricatorSlowvoteDefaultViewCapability.php', - 'PhabricatorSlowvoteDescriptionTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteDescriptionTransaction.php', + 'PhabricatorSlowvoteDescriptionTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteDescriptionTransaction.php', 'PhabricatorSlowvoteEditController' => 'applications/slowvote/controller/PhabricatorSlowvoteEditController.php', 'PhabricatorSlowvoteEditor' => 'applications/slowvote/editor/PhabricatorSlowvoteEditor.php', 'PhabricatorSlowvoteListController' => 'applications/slowvote/controller/PhabricatorSlowvoteListController.php', @@ -3927,16 +3927,16 @@ phutil_register_library_map(array( 'PhabricatorSlowvotePollController' => 'applications/slowvote/controller/PhabricatorSlowvotePollController.php', 'PhabricatorSlowvotePollPHIDType' => 'applications/slowvote/phid/PhabricatorSlowvotePollPHIDType.php', 'PhabricatorSlowvoteQuery' => 'applications/slowvote/query/PhabricatorSlowvoteQuery.php', - 'PhabricatorSlowvoteQuestionTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteQuestionTransaction.php', + 'PhabricatorSlowvoteQuestionTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteQuestionTransaction.php', 'PhabricatorSlowvoteReplyHandler' => 'applications/slowvote/mail/PhabricatorSlowvoteReplyHandler.php', - 'PhabricatorSlowvoteResponsesTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteResponsesTransaction.php', + 'PhabricatorSlowvoteResponsesTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php', 'PhabricatorSlowvoteSchemaSpec' => 'applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php', 'PhabricatorSlowvoteSearchEngine' => 'applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php', - 'PhabricatorSlowvoteShuffleTransaction' => 'applications/slowvote/xactions/PhabricatorSlowvoteShuffleTransaction.php', + 'PhabricatorSlowvoteShuffleTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php', 'PhabricatorSlowvoteTransaction' => 'applications/slowvote/storage/PhabricatorSlowvoteTransaction.php', 'PhabricatorSlowvoteTransactionComment' => 'applications/slowvote/storage/PhabricatorSlowvoteTransactionComment.php', 'PhabricatorSlowvoteTransactionQuery' => 'applications/slowvote/query/PhabricatorSlowvoteTransactionQuery.php', - 'PhabricatorSlowvoteTransactionType' => 'applications/slowvote/xactions/PhabricatorSlowvoteTransactionType.php', + 'PhabricatorSlowvoteTransactionType' => 'applications/slowvote/xaction/PhabricatorSlowvoteTransactionType.php', 'PhabricatorSlowvoteVoteController' => 'applications/slowvote/controller/PhabricatorSlowvoteVoteController.php', 'PhabricatorSlug' => 'infrastructure/util/PhabricatorSlug.php', 'PhabricatorSlugTestCase' => 'infrastructure/util/__tests__/PhabricatorSlugTestCase.php', diff --git a/src/applications/slowvote/xactions/PhabricatorSlowvoteCloseTransaction.php b/src/applications/slowvote/xaction/PhabricatorSlowvoteCloseTransaction.php similarity index 100% rename from src/applications/slowvote/xactions/PhabricatorSlowvoteCloseTransaction.php rename to src/applications/slowvote/xaction/PhabricatorSlowvoteCloseTransaction.php diff --git a/src/applications/slowvote/xactions/PhabricatorSlowvoteDescriptionTransaction.php b/src/applications/slowvote/xaction/PhabricatorSlowvoteDescriptionTransaction.php similarity index 76% rename from src/applications/slowvote/xactions/PhabricatorSlowvoteDescriptionTransaction.php rename to src/applications/slowvote/xaction/PhabricatorSlowvoteDescriptionTransaction.php index 8a46f7dc5e..3a06dd4a88 100644 --- a/src/applications/slowvote/xactions/PhabricatorSlowvoteDescriptionTransaction.php +++ b/src/applications/slowvote/xaction/PhabricatorSlowvoteDescriptionTransaction.php @@ -36,15 +36,21 @@ final class PhabricatorSlowvoteDescriptionTransaction } } - public function hasChangeDetails() { + public function hasChangeDetailView() { return true; } + public function getMailDiffSectionHeader() { + return pht('CHANGES TO POLL DESCRIPTION'); + } + public function newChangeDetailView() { - return $this->renderTextCorpusChangeDetails( - $this->getViewer(), - $this->getOldValue(), - $this->getNewValue()); + $viewer = $this->getViewer(); + + return id(new PhabricatorApplicationTransactionTextDiffDetailView()) + ->setViewer($viewer) + ->setOldText($this->getOldValue()) + ->setNewText($this->getNewValue()); } public function newRemarkupChanges() { diff --git a/src/applications/slowvote/xactions/PhabricatorSlowvoteQuestionTransaction.php b/src/applications/slowvote/xaction/PhabricatorSlowvoteQuestionTransaction.php similarity index 100% rename from src/applications/slowvote/xactions/PhabricatorSlowvoteQuestionTransaction.php rename to src/applications/slowvote/xaction/PhabricatorSlowvoteQuestionTransaction.php diff --git a/src/applications/slowvote/xactions/PhabricatorSlowvoteResponsesTransaction.php b/src/applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php similarity index 100% rename from src/applications/slowvote/xactions/PhabricatorSlowvoteResponsesTransaction.php rename to src/applications/slowvote/xaction/PhabricatorSlowvoteResponsesTransaction.php diff --git a/src/applications/slowvote/xactions/PhabricatorSlowvoteShuffleTransaction.php b/src/applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php similarity index 100% rename from src/applications/slowvote/xactions/PhabricatorSlowvoteShuffleTransaction.php rename to src/applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php diff --git a/src/applications/slowvote/xactions/PhabricatorSlowvoteTransactionType.php b/src/applications/slowvote/xaction/PhabricatorSlowvoteTransactionType.php similarity index 100% rename from src/applications/slowvote/xactions/PhabricatorSlowvoteTransactionType.php rename to src/applications/slowvote/xaction/PhabricatorSlowvoteTransactionType.php