1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 17:58:47 +02:00
phorge-phorge/src/applications/maniphest/relationship/ManiphestTaskHasSubtaskRelationship.php
epriestley 163f2c4262 Refine available filters and defaults for relationship selection
Summary:
Ref T4788. Fixes T10703.

In the longer term I want to put this on top of ApplicationSearch, but that's somewhat complex and we're at a fairly good point to pause this feature for feedback.

Inch toward that instead: provide more appropriate filters and defaults without rebuilding the underlying engine. Specifically:

  - No "assigned" for commits (barely makes sense).
  - No "assigned" for mocks (does not make sense).
  - Default to "open" for parent tasks, subtasks, close as duplicate, and merge into.

Also, add a key to the `search_document` table to improve the performance of the "all open stuff of type X" query. "All Open Tasks" is about 100x faster on my machine with this key.

Test Plan:
  - Clicked all object relationships, saw more sensible filters and defaults.
  - Saw "open" query about 100x faster locally (300ms to 3ms).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4788, T10703

Differential Revision: https://secure.phabricator.com/D16202
2016-06-30 11:51:36 -07:00

45 lines
952 B
PHP

<?php
final class ManiphestTaskHasSubtaskRelationship
extends ManiphestTaskRelationship {
const RELATIONSHIPKEY = 'task.has-subtask';
public function getEdgeConstant() {
return ManiphestTaskDependsOnTaskEdgeType::EDGECONST;
}
protected function getActionName() {
return pht('Edit Subtasks');
}
protected function getActionIcon() {
return 'fa-chevron-circle-down';
}
public function canRelateObjects($src, $dst) {
return ($dst instanceof ManiphestTask);
}
public function shouldAppearInActionMenu() {
return false;
}
public function getDialogTitleText() {
return pht('Edit Subtasks');
}
public function getDialogHeaderText() {
return pht('Current Subtasks');
}
public function getDialogButtonText() {
return pht('Save Subtasks');
}
protected function newRelationshipSource() {
return id(new ManiphestTaskRelationshipSource())
->setSelectedFilter('open');
}
}