diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -10,7 +10,7 @@ 'conpherence.pkg.css' => '0e3cf785', 'conpherence.pkg.js' => '020aebcf', 'core.pkg.css' => 'f538846d', - 'core.pkg.js' => '6a2c22c2', + 'core.pkg.js' => '66c49ca1', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '609e63d4', 'differential.pkg.js' => 'c60bec1b', @@ -257,7 +257,7 @@ 'rsrc/externals/javelin/lib/URI.js' => '2e255291', 'rsrc/externals/javelin/lib/Vector.js' => 'e9c80beb', 'rsrc/externals/javelin/lib/WebSocket.js' => 'fdc13e4e', - 'rsrc/externals/javelin/lib/Workflow.js' => 'd7ba6915', + 'rsrc/externals/javelin/lib/Workflow.js' => 'cc1553f3', 'rsrc/externals/javelin/lib/__tests__/Cookie.js' => 'ca686f71', 'rsrc/externals/javelin/lib/__tests__/DOM.js' => '4566e249', 'rsrc/externals/javelin/lib/__tests__/JSON.js' => '710377ae', @@ -265,7 +265,7 @@ 'rsrc/externals/javelin/lib/__tests__/behavior.js' => '8426ebeb', 'rsrc/externals/javelin/lib/behavior.js' => '1b6acc2a', 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '89a1ae3a', - 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => 'd96e47a4', + 'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '0507519c', 'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'a241536a', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '22ee68a5', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '23387297', @@ -423,7 +423,7 @@ 'rsrc/js/application/projects/WorkboardCard.js' => '0392a5d8', 'rsrc/js/application/projects/WorkboardCardTemplate.js' => '84f82dad', 'rsrc/js/application/projects/WorkboardColumn.js' => 'c3d24e63', - 'rsrc/js/application/projects/WorkboardController.js' => 'b9d0c2f3', + 'rsrc/js/application/projects/WorkboardController.js' => '7474d31f', 'rsrc/js/application/projects/WorkboardDropEffect.js' => '8e0aa661', 'rsrc/js/application/projects/WorkboardHeader.js' => '111bfd2d', 'rsrc/js/application/projects/WorkboardHeaderTemplate.js' => 'ebe83a6b', @@ -453,7 +453,7 @@ 'rsrc/js/core/DragAndDropFileUpload.js' => '4370900d', 'rsrc/js/core/DraggableList.js' => '0169e425', 'rsrc/js/core/Favicon.js' => '7930776a', - 'rsrc/js/core/FileUpload.js' => 'ab85e184', + 'rsrc/js/core/FileUpload.js' => '331676ea', 'rsrc/js/core/Hovercard.js' => '6199f752', 'rsrc/js/core/HovercardList.js' => 'de4b4919', 'rsrc/js/core/KeyboardShortcut.js' => '1a844c06', @@ -731,7 +731,7 @@ 'javelin-sound' => 'd4cc2d2a', 'javelin-stratcom' => '0889b835', 'javelin-tokenizer' => '89a1ae3a', - 'javelin-typeahead' => 'd96e47a4', + 'javelin-typeahead' => '0507519c', 'javelin-typeahead-composite-source' => '22ee68a5', 'javelin-typeahead-normalizer' => 'a241536a', 'javelin-typeahead-ondemand-source' => '23387297', @@ -751,12 +751,12 @@ 'javelin-workboard-card' => '0392a5d8', 'javelin-workboard-card-template' => '84f82dad', 'javelin-workboard-column' => 'c3d24e63', - 'javelin-workboard-controller' => 'b9d0c2f3', + 'javelin-workboard-controller' => '7474d31f', 'javelin-workboard-drop-effect' => '8e0aa661', 'javelin-workboard-header' => '111bfd2d', 'javelin-workboard-header-template' => 'ebe83a6b', 'javelin-workboard-order-template' => '03e8891f', - 'javelin-workflow' => 'd7ba6915', + 'javelin-workflow' => 'cc1553f3', 'maniphest-report-css' => '3d53188b', 'maniphest-task-edit-css' => '272daa84', 'maniphest-task-summary-css' => '61d1667e', @@ -787,7 +787,7 @@ 'phabricator-fatal-config-template-css' => 'e689dbbd', 'phabricator-favicon' => '7930776a', 'phabricator-feed-css' => 'd8b6e3f8', - 'phabricator-file-upload' => 'ab85e184', + 'phabricator-file-upload' => '331676ea', 'phabricator-flag-css' => '2b77be8d', 'phabricator-keyboard-shortcut' => '1a844c06', 'phabricator-keyboard-shortcut-manager' => '81debc48', @@ -965,6 +965,12 @@ 'javelin-dom', 'javelin-workflow', ), + '0507519c' => array( + 'javelin-install', + 'javelin-dom', + 'javelin-vector', + 'javelin-util', + ), '05d290ef' => array( 'javelin-install', 'javelin-util', @@ -1207,6 +1213,11 @@ 'javelin-stratcom', 'javelin-dom', ), + '331676ea' => array( + 'javelin-install', + 'javelin-dom', + 'phabricator-notification', + ), 34450586 => array( 'javelin-color', 'javelin-install', @@ -1589,6 +1600,16 @@ 'javelin-behavior', 'javelin-dom', ), + '7474d31f' => array( + 'javelin-install', + 'javelin-dom', + 'javelin-util', + 'javelin-vector', + 'javelin-stratcom', + 'javelin-workflow', + 'phabricator-drag-and-drop-file-upload', + 'javelin-workboard-board', + ), '78bc5d94' => array( 'javelin-behavior', 'javelin-uri', @@ -1856,11 +1877,6 @@ 'javelin-json', 'phuix-form-control-view', ), - 'ab85e184' => array( - 'javelin-install', - 'javelin-dom', - 'phabricator-notification', - ), 'ac10c917' => array( 'javelin-behavior', 'javelin-dom', @@ -1983,16 +1999,6 @@ 'javelin-uri', 'phabricator-notification', ), - 'b9d0c2f3' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-util', - 'javelin-vector', - 'javelin-stratcom', - 'javelin-workflow', - 'phabricator-drag-and-drop-file-upload', - 'javelin-workboard-board', - ), 'bf159129' => array( 'phui-inline-comment-view-css', ), @@ -2034,6 +2040,17 @@ 'javelin-workflow', 'javelin-json', ), + 'cc1553f3' => array( + 'javelin-stratcom', + 'javelin-request', + 'javelin-dom', + 'javelin-vector', + 'javelin-install', + 'javelin-util', + 'javelin-mask', + 'javelin-uri', + 'javelin-routable', + ), 'cc2c5de5' => array( 'javelin-install', 'phuix-button-view', @@ -2063,17 +2080,6 @@ 'd4cc2d2a' => array( 'javelin-install', ), - 'd7ba6915' => array( - 'javelin-stratcom', - 'javelin-request', - 'javelin-dom', - 'javelin-vector', - 'javelin-install', - 'javelin-util', - 'javelin-mask', - 'javelin-uri', - 'javelin-routable', - ), 'd7d3ba75' => array( 'javelin-dom', 'javelin-util', @@ -2094,12 +2100,6 @@ 'javelin-util', 'phabricator-shaped-request', ), - 'd96e47a4' => array( - 'javelin-install', - 'javelin-dom', - 'javelin-vector', - 'javelin-util', - ), 'da15d3dc' => array( 'phui-oi-list-view-css', ), diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -5843,6 +5843,7 @@ 'PonderQuestionSearchEngine' => 'applications/ponder/query/PonderQuestionSearchEngine.php', 'PonderQuestionStatus' => 'applications/ponder/constants/PonderQuestionStatus.php', 'PonderQuestionStatusController' => 'applications/ponder/controller/PonderQuestionStatusController.php', + 'PonderQuestionStatusTestCase' => 'applications/ponder/storage/__tests__/PonderQuestionStatusTestCase.php', 'PonderQuestionStatusTransaction' => 'applications/ponder/xaction/PonderQuestionStatusTransaction.php', 'PonderQuestionTitleTransaction' => 'applications/ponder/xaction/PonderQuestionTitleTransaction.php', 'PonderQuestionTransaction' => 'applications/ponder/storage/PonderQuestionTransaction.php', @@ -12757,6 +12758,7 @@ 'PonderQuestionSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PonderQuestionStatus' => 'PonderConstants', 'PonderQuestionStatusController' => 'PonderController', + 'PonderQuestionStatusTestCase' => 'PhutilTestCase', 'PonderQuestionStatusTransaction' => 'PonderQuestionTransactionType', 'PonderQuestionTitleTransaction' => 'PonderQuestionTransactionType', 'PonderQuestionTransaction' => 'PhabricatorModularTransaction', diff --git a/src/applications/ponder/constants/PonderQuestionStatus.php b/src/applications/ponder/constants/PonderQuestionStatus.php --- a/src/applications/ponder/constants/PonderQuestionStatus.php +++ b/src/applications/ponder/constants/PonderQuestionStatus.php @@ -86,4 +86,14 @@ ); } + /** + * Check whenever a Ponder question status is Closed + * + * @param $status string + * @return bool + */ + public static function isQuestionStatusClosed($status) { + return in_array($status, self::getQuestionStatusClosedMap(), true); + } + } diff --git a/src/applications/ponder/query/PonderQuestionSearchEngine.php b/src/applications/ponder/query/PonderQuestionSearchEngine.php --- a/src/applications/ponder/query/PonderQuestionSearchEngine.php +++ b/src/applications/ponder/query/PonderQuestionSearchEngine.php @@ -157,6 +157,9 @@ 'Asked by %s', $handles[$question->getAuthorPHID()]->renderLink())); + // Render Closed Questions as striked in query results + $item->setDisabled($question->isStatusClosed()); + $item->addAttribute( pht( '%s Answer(s)', diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php --- a/src/applications/ponder/storage/PonderQuestion.php +++ b/src/applications/ponder/storage/PonderQuestion.php @@ -137,6 +137,14 @@ return self::MARKUP_FIELD_CONTENT; } + /** + * Check whenever this Question has whatever closed status + * + * @return bool + */ + public function isStatusClosed() { + return PonderQuestionStatus::isQuestionStatusClosed($this->status); + } /* -( PhabricatorApplicationTransactionInterface )------------------------- */ diff --git a/src/applications/ponder/storage/__tests__/PonderQuestionStatusTestCase.php b/src/applications/ponder/storage/__tests__/PonderQuestionStatusTestCase.php new file mode 100644 --- /dev/null +++ b/src/applications/ponder/storage/__tests__/PonderQuestionStatusTestCase.php @@ -0,0 +1,25 @@ +setStatus($status); + $this->assertEqual(true, $question->isStatusClosed()); + } + + } + + public function testOpenedStatuses() { + $statuses = PonderQuestionStatus::getQuestionStatusOpenMap(); + foreach ($statuses as $status) { + $question = new PonderQuestion(); + $question->setStatus($status); + $this->assertEqual(false, $question->isStatusClosed()); + } + } + +}