@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Ponder: strike code of resolved questions in query results

Summary:
After this change, search results with resolved
questions are striked, just like any Closed Maniphest
Tasks is already striked, etc.

https://we.phorge.it/T15166

There is still the same thing to be done at Remarkup.

Ref T15166

Test Plan: - go in the page /ponder/query/all/ and see that closed questions are now striked

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15166

Differential Revision: https://we.phorge.it/D25086

+48
+2
src/__phutil_library_map__.php
··· 5843 5843 'PonderQuestionSearchEngine' => 'applications/ponder/query/PonderQuestionSearchEngine.php', 5844 5844 'PonderQuestionStatus' => 'applications/ponder/constants/PonderQuestionStatus.php', 5845 5845 'PonderQuestionStatusController' => 'applications/ponder/controller/PonderQuestionStatusController.php', 5846 + 'PonderQuestionStatusTestCase' => 'applications/ponder/storage/__tests__/PonderQuestionStatusTestCase.php', 5846 5847 'PonderQuestionStatusTransaction' => 'applications/ponder/xaction/PonderQuestionStatusTransaction.php', 5847 5848 'PonderQuestionTitleTransaction' => 'applications/ponder/xaction/PonderQuestionTitleTransaction.php', 5848 5849 'PonderQuestionTransaction' => 'applications/ponder/storage/PonderQuestionTransaction.php', ··· 12757 12758 'PonderQuestionSearchEngine' => 'PhabricatorApplicationSearchEngine', 12758 12759 'PonderQuestionStatus' => 'PonderConstants', 12759 12760 'PonderQuestionStatusController' => 'PonderController', 12761 + 'PonderQuestionStatusTestCase' => 'PhutilTestCase', 12760 12762 'PonderQuestionStatusTransaction' => 'PonderQuestionTransactionType', 12761 12763 'PonderQuestionTitleTransaction' => 'PonderQuestionTransactionType', 12762 12764 'PonderQuestionTransaction' => 'PhabricatorModularTransaction',
+10
src/applications/ponder/constants/PonderQuestionStatus.php
··· 86 86 ); 87 87 } 88 88 89 + /** 90 + * Check whenever a Ponder question status is Closed 91 + * 92 + * @param $status string 93 + * @return bool 94 + */ 95 + public static function isQuestionStatusClosed($status) { 96 + return in_array($status, self::getQuestionStatusClosedMap(), true); 97 + } 98 + 89 99 }
+3
src/applications/ponder/query/PonderQuestionSearchEngine.php
··· 157 157 'Asked by %s', 158 158 $handles[$question->getAuthorPHID()]->renderLink())); 159 159 160 + // Render Closed Questions as striked in query results 161 + $item->setDisabled($question->isStatusClosed()); 162 + 160 163 $item->addAttribute( 161 164 pht( 162 165 '%s Answer(s)',
+8
src/applications/ponder/storage/PonderQuestion.php
··· 137 137 return self::MARKUP_FIELD_CONTENT; 138 138 } 139 139 140 + /** 141 + * Check whenever this Question has whatever closed status 142 + * 143 + * @return bool 144 + */ 145 + public function isStatusClosed() { 146 + return PonderQuestionStatus::isQuestionStatusClosed($this->status); 147 + } 140 148 141 149 /* -( PhabricatorApplicationTransactionInterface )------------------------- */ 142 150
+25
src/applications/ponder/storage/__tests__/PonderQuestionStatusTestCase.php
··· 1 + <?php 2 + 3 + final class PonderQuestionStatusTestCase extends PhutilTestCase { 4 + 5 + public function testClosedStatuses() { 6 + 7 + $statuses = PonderQuestionStatus::getQuestionStatusClosedMap(); 8 + foreach ($statuses as $status) { 9 + $question = new PonderQuestion(); 10 + $question->setStatus($status); 11 + $this->assertEqual(true, $question->isStatusClosed()); 12 + } 13 + 14 + } 15 + 16 + public function testOpenedStatuses() { 17 + $statuses = PonderQuestionStatus::getQuestionStatusOpenMap(); 18 + foreach ($statuses as $status) { 19 + $question = new PonderQuestion(); 20 + $question->setStatus($status); 21 + $this->assertEqual(false, $question->isStatusClosed()); 22 + } 23 + } 24 + 25 + }