1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Give typeahead browse dialogs sensible titles

Summary: Ref T4100. Let datasources specify a more meaningful title than the class name.

Test Plan: Browsed some sources.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: chad, epriestley

Maniphest Tasks: T4100

Differential Revision: https://secure.phabricator.com/D12469
This commit is contained in:
epriestley 2015-04-19 07:32:09 -07:00
parent b85f8b91de
commit e5e5974d9f
35 changed files with 140 additions and 3 deletions

View file

@ -9,6 +9,10 @@ final class AlmanacInterfaceDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Interfaces');
}
public function getPlaceholderText() {
return pht('Type an interface name...');
}

View file

@ -3,6 +3,10 @@
final class AlmanacServiceDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Services');
}
public function getPlaceholderText() {
return pht('Type a service name...');
}

View file

@ -8,6 +8,10 @@ final class DiffusionArcanistProjectDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Arcanist Projects');
}
public function getPlaceholderText() {
return pht('Type an arcanist project name...');
}

View file

@ -3,6 +3,10 @@
final class DiffusionAuditorDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Auditors');
}
public function getPlaceholderText() {
return pht('Type a user, project or package name...');
}

View file

@ -3,6 +3,10 @@
final class DiffusionRepositoryDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Repositories');
}
public function getPlaceholderText() {
return pht('Type a repository name...');
}

View file

@ -9,6 +9,10 @@ final class DiffusionSymbolDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Symbols');
}
public function getPlaceholderText() {
return pht('Type a symbol name...');
}

View file

@ -8,6 +8,10 @@ final class HarbormasterBuildDependencyDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Dependencies');
}
public function getPlaceholderText() {
return pht('Type another build step name...');
}

View file

@ -3,6 +3,10 @@
final class HarbormasterBuildPlanDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Build Plans');
}
public function getPlaceholderText() {
return pht('Type a build plan name...');
}

View file

@ -7,6 +7,10 @@ final class LegalpadDocumentDatasource extends PhabricatorTypeaheadDatasource {
return false;
}
public function getBrowseTitle() {
return pht('Browse Documents');
}
public function getPlaceholderText() {
return pht('Type a document name...');
}

View file

@ -6,6 +6,10 @@ final class PhabricatorMacroDatasource extends PhabricatorTypeaheadDatasource {
return pht('Type a macro name...');
}
public function getBrowseTitle() {
return pht('Browse Macros');
}
public function getDatasourceApplicationClass() {
return 'PhabricatorMacroApplication';
}

View file

@ -3,6 +3,10 @@
final class PhabricatorMailingListDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Mailing Lists');
}
public function getPlaceholderText() {
return pht('Type a mailing list name...');
}

View file

@ -3,6 +3,10 @@
final class ManiphestTaskPriorityDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Priorities');
}
public function getPlaceholderText() {
return pht('Type a task priority name...');
}

View file

@ -3,6 +3,10 @@
final class ManiphestTaskStatusDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Statuses');
}
public function getPlaceholderText() {
return pht('Type a task status name...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorApplicationDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Applications');
}
public function getPlaceholderText() {
return pht('Type an application name...');
}

View file

@ -8,6 +8,10 @@ final class PhabricatorMetaMTAApplicationEmailDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Email Addresses');
}
public function getPlaceholderText() {
return pht('Type an application email address...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorMetaMTAMailableDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Subscribers');
}
public function getPlaceholderText() {
return pht('Type a user, project, or mailing list name...');
}

View file

@ -8,6 +8,10 @@ final class PhabricatorOwnersPackageDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Packages');
}
public function getPlaceholderText() {
return pht('Type a package name...');
}

View file

@ -15,6 +15,10 @@ final class PhabricatorPeopleDatasource
return $this;
}
public function getBrowseTitle() {
return pht('Browse Users');
}
public function getPlaceholderText() {
return pht('Type a username...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorViewerDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Viewer');
}
public function getPlaceholderText() {
return pht('Type viewer()...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Projects');
}
public function getPlaceholderText() {
return pht('Type a project name...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectLogicalAndDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Projects');
}
public function getPlaceholderText() {
return pht('Type a project name...');
}

View file

@ -3,8 +3,12 @@
final class PhabricatorProjectLogicalDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Projects');
}
public function getPlaceholderText() {
return pht('Type a project name or selector...');
return pht('Type a project name or function...');
}
public function getDatasourceApplicationClass() {

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectLogicalOrNotDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Projects');
}
public function getPlaceholderText() {
return pht('Type any(<project>) or not(<project>)...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectLogicalUserDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse User Projects');
}
public function getPlaceholderText() {
return pht('Type projects(<user>)...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectLogicalViewerDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Viewer Projects');
}
public function getPlaceholderText() {
return pht('Type viewerprojects()...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectMembersDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Members');
}
public function getPlaceholderText() {
return pht('Type members(<project>)...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectNoProjectsDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse Not In Any Projects');
}
public function getPlaceholderText() {
return pht('Type "not in any projects"...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorProjectOrUserDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Users and Projects');
}
public function getPlaceholderText() {
return pht('Type a user or project name...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorSearchDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Results');
}
public function getPlaceholderText() {
return pht('Type an object name...');
}

View file

@ -225,7 +225,7 @@ final class PhabricatorTypeaheadModularDatasourceController
return $this->newDialog()
->setWidth(AphrontDialogView::WIDTH_FORM)
->setRenderDialogAsDiv(true)
->setTitle(get_class($source)) // TODO: Provide nice names.
->setTitle($source->getBrowseTitle())
->appendChild($browser)
->addCancelButton('/', pht('Close'));
}

View file

@ -88,6 +88,11 @@ abstract class PhabricatorTypeaheadDatasource extends Phobject {
}
abstract public function getPlaceholderText();
public function getBrowseTitle() {
return get_class($this);
}
abstract public function getDatasourceApplicationClass();
abstract public function loadResults();

View file

@ -10,6 +10,10 @@ final class PhabricatorTypeaheadMonogramDatasource
return false;
}
public function getBrowseTitle() {
return pht('Browse Objects');
}
public function getPlaceholderText() {
return pht('Type an object name...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorTypeaheadNoOwnerDatasource
extends PhabricatorTypeaheadDatasource {
public function getBrowseTitle() {
return pht('Browse No Owner');
}
public function getPlaceholderText() {
return pht('Type "none"...');
}

View file

@ -3,6 +3,10 @@
final class PhabricatorTypeaheadOwnerDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Owners');
}
public function getPlaceholderText() {
return pht('Type a user name or "none"...');
}

View file

@ -3,8 +3,12 @@
final class PhabricatorTypeaheadUserParameterizedDatasource
extends PhabricatorTypeaheadCompositeDatasource {
public function getBrowseTitle() {
return pht('Browse Users');
}
public function getPlaceholderText() {
return pht('Type a username or selector...');
return pht('Type a username or function...');
}
public function getComponentDatasources() {