mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-01 01:18:22 +01:00
163f2c4262
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
45 lines
952 B
PHP
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');
|
|
}
|
|
|
|
}
|