2016-04-27 10:32:43 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
final class DiffusionRepositorySymbolsManagementPanel
|
|
|
|
|
extends DiffusionRepositoryManagementPanel {
|
|
|
|
|
|
|
|
|
|
const PANELKEY = 'symbols';
|
|
|
|
|
|
|
|
|
|
public function getManagementPanelLabel() {
|
|
|
|
|
return pht('Symbols');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getManagementPanelOrder() {
|
|
|
|
|
return 900;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-21 11:35:08 -08:00
|
|
|
public function getManagementPanelGroupKey() {
|
|
|
|
|
return DiffusionRepositoryManagementIntegrationsPanelGroup::PANELGROUPKEY;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-03 06:54:50 -07:00
|
|
|
public function getManagementPanelIcon() {
|
Convert the "Repository Management" UI to a full-width, Phortune-style UI
Summary:
Ref T13216. I want to add some new management options to repositories (e.g., filesize limit, clone timeouts). Before adding new stuff here, update the UI to a full-width, Phortune-style UI.
This partially reverts D18523. About a year ago, several UIs got converted to fixed-width (repository management, config, settings, instance management in SAAS). I didn't think these were good changes and have never really gotten used to them. The rationale wasn't clear to me and these changes just felt like "be more like GitHub". I think usability is significantly worse, e.g. actions are now hidden inside button menus instead of immediately visible.
Phortune also got converted less dramatically to a full-width-with-menu UI, which I like much better. Adjust repository management to use that UI style instead of the fixed-width style.
Test Plan:
{F6020884}
Viewed every panel, including the Subversion panel.
Reviewers: amckinley
Reviewed By: amckinley
Maniphest Tasks: T13216
Differential Revision: https://secure.phabricator.com/D19826
2018-11-21 11:07:20 -08:00
|
|
|
$repository = $this->getRepository();
|
|
|
|
|
|
|
|
|
|
$has_any =
|
|
|
|
|
$repository->getSymbolLanguages() ||
|
|
|
|
|
$repository->getSymbolSources();
|
|
|
|
|
|
|
|
|
|
if ($has_any) {
|
|
|
|
|
return 'fa-link';
|
|
|
|
|
} else {
|
|
|
|
|
return 'fa-link grey';
|
|
|
|
|
}
|
2016-05-03 06:54:50 -07:00
|
|
|
}
|
|
|
|
|
|
2016-05-02 05:35:05 -07:00
|
|
|
protected function getEditEngineFieldKeys() {
|
|
|
|
|
return array(
|
|
|
|
|
'symbolLanguages',
|
|
|
|
|
'symbolRepositoryPHIDs',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
Convert the "Repository Management" UI to a full-width, Phortune-style UI
Summary:
Ref T13216. I want to add some new management options to repositories (e.g., filesize limit, clone timeouts). Before adding new stuff here, update the UI to a full-width, Phortune-style UI.
This partially reverts D18523. About a year ago, several UIs got converted to fixed-width (repository management, config, settings, instance management in SAAS). I didn't think these were good changes and have never really gotten used to them. The rationale wasn't clear to me and these changes just felt like "be more like GitHub". I think usability is significantly worse, e.g. actions are now hidden inside button menus instead of immediately visible.
Phortune also got converted less dramatically to a full-width-with-menu UI, which I like much better. Adjust repository management to use that UI style instead of the fixed-width style.
Test Plan:
{F6020884}
Viewed every panel, including the Subversion panel.
Reviewers: amckinley
Reviewed By: amckinley
Maniphest Tasks: T13216
Differential Revision: https://secure.phabricator.com/D19826
2018-11-21 11:07:20 -08:00
|
|
|
public function buildManagementPanelCurtain() {
|
|
|
|
|
$repository = $this->getRepository();
|
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
|
$action_list = $this->newActionList();
|
|
|
|
|
|
|
|
|
|
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
|
|
|
|
$viewer,
|
|
|
|
|
$repository,
|
|
|
|
|
PhabricatorPolicyCapability::CAN_EDIT);
|
|
|
|
|
|
|
|
|
|
$symbols_uri = $this->getEditPageURI();
|
|
|
|
|
|
|
|
|
|
$action_list->addAction(
|
|
|
|
|
id(new PhabricatorActionView())
|
|
|
|
|
->setIcon('fa-pencil')
|
|
|
|
|
->setName(pht('Edit Symbols'))
|
|
|
|
|
->setHref($symbols_uri)
|
|
|
|
|
->setDisabled(!$can_edit)
|
|
|
|
|
->setWorkflow(!$can_edit));
|
|
|
|
|
|
|
|
|
|
return $this->newCurtainView()
|
|
|
|
|
->setActionList($action_list);
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-27 10:32:43 -07:00
|
|
|
public function buildManagementPanelContent() {
|
|
|
|
|
$repository = $this->getRepository();
|
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
|
|
|
|
|
|
$view = id(new PHUIPropertyListView())
|
2017-05-23 11:27:21 -07:00
|
|
|
->setViewer($viewer);
|
2016-04-27 10:32:43 -07:00
|
|
|
|
|
|
|
|
$languages = $repository->getSymbolLanguages();
|
|
|
|
|
if ($languages) {
|
|
|
|
|
$languages = implode(', ', $languages);
|
|
|
|
|
} else {
|
|
|
|
|
$languages = phutil_tag('em', array(), pht('Any'));
|
|
|
|
|
}
|
|
|
|
|
$view->addProperty(pht('Languages'), $languages);
|
|
|
|
|
|
|
|
|
|
$sources = $repository->getSymbolSources();
|
|
|
|
|
if ($sources) {
|
|
|
|
|
$sources = $viewer->renderHandleList($sources);
|
|
|
|
|
} else {
|
|
|
|
|
$sources = phutil_tag('em', array(), pht('This Repository Only'));
|
|
|
|
|
}
|
|
|
|
|
$view->addProperty(pht('Uses Symbols From'), $sources);
|
|
|
|
|
|
Convert the "Repository Management" UI to a full-width, Phortune-style UI
Summary:
Ref T13216. I want to add some new management options to repositories (e.g., filesize limit, clone timeouts). Before adding new stuff here, update the UI to a full-width, Phortune-style UI.
This partially reverts D18523. About a year ago, several UIs got converted to fixed-width (repository management, config, settings, instance management in SAAS). I didn't think these were good changes and have never really gotten used to them. The rationale wasn't clear to me and these changes just felt like "be more like GitHub". I think usability is significantly worse, e.g. actions are now hidden inside button menus instead of immediately visible.
Phortune also got converted less dramatically to a full-width-with-menu UI, which I like much better. Adjust repository management to use that UI style instead of the fixed-width style.
Test Plan:
{F6020884}
Viewed every panel, including the Subversion panel.
Reviewers: amckinley
Reviewed By: amckinley
Maniphest Tasks: T13216
Differential Revision: https://secure.phabricator.com/D19826
2018-11-21 11:07:20 -08:00
|
|
|
return $this->newBox(pht('Symbols'), $view);
|
2016-04-27 10:32:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|