Page MenuHomePhabricator

D19826.diff
No OneTemporary

D19826.diff

diff --git a/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php b/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
@@ -68,13 +68,17 @@
$view = id(new PHUITwoColumnView())
->setHeader($header)
- ->setNavigation($nav)
- ->setFixed(true)
->setMainColumn($content);
+ $curtain = $panel->buildManagementPanelCurtain();
+ if ($curtain) {
+ $view->setCurtain($curtain);
+ }
+
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
+ ->setNavigation($nav)
->appendChild($view);
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryActionsManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryActionsManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryActionsManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryActionsManagementPanel.php
@@ -14,7 +14,20 @@
}
public function getManagementPanelIcon() {
- return 'fa-flash';
+ $repository = $this->getRepository();
+
+ $has_any =
+ $repository->getDetail('herald-disabled') ||
+ $repository->getDetail('disable-autoclose');
+
+ // NOTE: Any value here really means something is disabled, so try to
+ // hint that a little bit with the icon.
+
+ if ($has_any) {
+ return 'fa-flash';
+ } else {
+ return 'fa-flash grey';
+ }
}
protected function getEditEngineFieldKeys() {
@@ -24,6 +37,30 @@
);
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $actions_uri = $this->getEditPageURI();
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Actions'))
+ ->setHref($actions_uri)
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -43,22 +80,7 @@
$autoclose = phutil_tag('em', array(), $autoclose);
$view->addProperty(pht('Autoclose'), $autoclose);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $actions_uri = $this->getEditPageURI();
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($actions_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- return $this->newBox(pht('Actions'), $view, array($button));
+ return $this->newBox(pht('Actions'), $view);
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryAutomationManagementPanel.php
@@ -27,18 +27,60 @@
public function getManagementPanelIcon() {
$repository = $this->getRepository();
+ if (!$repository->canPerformAutomation()) {
+ return 'fa-truck grey';
+ }
+
$blueprint_phids = $repository->getAutomationBlueprintPHIDs();
+ if (!$blueprint_phids) {
+ return 'fa-truck grey';
+ }
$is_authorized = DrydockAuthorizationQuery::isFullyAuthorized(
$repository->getPHID(),
$blueprint_phids);
if (!$is_authorized) {
- return 'fa-exclamation-triangle';
+ return 'fa-exclamation-triangle yellow';
}
return 'fa-truck';
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $can_test = $can_edit && $repository->canPerformAutomation();
+
+ $automation_uri = $this->getEditPageURI();
+ $test_uri = $repository->getPathURI('edit/testautomation/');
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Automation'))
+ ->setHref($automation_uri)
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-gamepad')
+ ->setName(pht('Test Configuration'))
+ ->setWorkflow(true)
+ ->setDisabled(!$can_test)
+ ->setHref($test_uri));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -58,33 +100,7 @@
$view->addProperty(pht('Automation'), $blueprint_view);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $can_test = $can_edit && $repository->canPerformAutomation();
-
- $automation_uri = $this->getEditPageURI();
- $test_uri = $repository->getPathURI('edit/testautomation/');
-
- $edit = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($automation_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- $test = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-gamepad')
- ->setText(pht('Test Config'))
- ->setWorkflow(true)
- ->setDisabled(!$can_test)
- ->setHref($test_uri);
-
- return $this->newBox(pht('Automation'), $view, array($edit, $test));
+ return $this->newBox(pht('Automation'), $view);
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
@@ -27,9 +27,10 @@
);
}
- private function buildActionMenu() {
+ public function buildManagementPanelCurtain() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
+
$action_list = id(new PhabricatorActionListView())
->setViewer($viewer);
@@ -44,27 +45,34 @@
$encoding_uri = $this->getEditPageURI('encoding');
$dangerous_uri = $repository->getPathURI('edit/dangerous/');
$enormous_uri = $repository->getPathURI('edit/enormous/');
+ $update_uri = $repository->getPathURI('edit/update/');
if ($repository->isTracked()) {
+ $activate_icon = 'fa-ban';
$activate_label = pht('Deactivate Repository');
} else {
+ $activate_icon = 'fa-check';
$activate_label = pht('Activate Repository');
}
$should_dangerous = $repository->shouldAllowDangerousChanges();
if ($should_dangerous) {
+ $dangerous_icon = 'fa-shield';
$dangerous_name = pht('Prevent Dangerous Changes');
$can_dangerous = $can_edit;
} else {
+ $dangerous_icon = 'fa-exclamation-triangle';
$dangerous_name = pht('Allow Dangerous Changes');
$can_dangerous = ($can_edit && $repository->canAllowDangerousChanges());
}
$should_enormous = $repository->shouldAllowEnormousChanges();
if ($should_enormous) {
+ $enormous_icon = 'fa-shield';
$enormous_name = pht('Prevent Enormous Changes');
$can_enormous = $can_edit;
} else {
+ $enormous_icon = 'fa-exclamation-triangle';
$enormous_name = pht('Allow Enormous Changes');
$can_enormous = ($can_edit && $repository->canAllowEnormousChanges());
}
@@ -73,12 +81,14 @@
id(new PhabricatorActionView())
->setName(pht('Edit Basic Information'))
->setHref($edit_uri)
+ ->setIcon('fa-pencil')
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit));
$action_list->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit Text Encoding'))
+ ->setIcon('fa-text-width')
->setHref($encoding_uri)
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit));
@@ -87,6 +97,7 @@
id(new PhabricatorActionView())
->setName($dangerous_name)
->setHref($dangerous_uri)
+ ->setIcon($dangerous_icon)
->setDisabled(!$can_dangerous)
->setWorkflow(true));
@@ -94,16 +105,26 @@
id(new PhabricatorActionView())
->setName($enormous_name)
->setHref($enormous_uri)
+ ->setIcon($enormous_icon)
->setDisabled(!$can_enormous)
->setWorkflow(true));
$action_list->addAction(
id(new PhabricatorActionView())
- ->setHref($activate_uri)
->setName($activate_label)
+ ->setHref($activate_uri)
+ ->setIcon($activate_icon)
->setDisabled(!$can_edit)
->setWorkflow(true));
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Update Now'))
+ ->setHref($update_uri)
+ ->setIcon('fa-refresh')
+ ->setWorkflow(true)
+ ->setDisabled(!$can_edit));
+
$action_list->addAction(
id(new PhabricatorActionView())
->setType(PhabricatorActionView::TYPE_DIVIDER));
@@ -112,25 +133,18 @@
id(new PhabricatorActionView())
->setName(pht('Delete Repository'))
->setHref($delete_uri)
+ ->setIcon('fa-times')
->setColor(PhabricatorActionView::RED)
->setDisabled(true)
->setWorkflow(true));
- return $action_list;
+ return $this->newCurtainView()
+ ->setActionList($action_list);
}
public function buildManagementPanelContent() {
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setText(pht('Actions'))
- ->setHref('#')
- ->setIcon('fa-bars')
- ->addClass('phui-mobile-menu')
- ->setDropdownMenu($this->buildActionMenu());
-
$basics = $this->buildBasics();
- $basics = $this->newBox(pht('Properties'), $basics, array($button));
+ $basics = $this->newBox(pht('Properties'), $basics);
$repository = $this->getRepository();
$is_new = $repository->isNewlyInitialized();
@@ -254,7 +268,6 @@
private function buildStatus() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
- $update_uri = $repository->getPathURI('edit/update/');
$view = id(new PHUIPropertyListView())
->setViewer($viewer);
@@ -274,20 +287,7 @@
$view->addTextContent($raw_error);
}
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-refresh')
- ->setText(pht('Update Now'))
- ->setWorkflow(true)
- ->setDisabled(!$can_edit)
- ->setHref($update_uri);
-
- return $this->newBox(pht('Status'), $view, array($button));
+ return $this->newBox(pht('Status'), $view);
}
private function buildRepositoryUpdateInterval(
diff --git a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
@@ -19,7 +19,18 @@
}
public function getManagementPanelIcon() {
- return 'fa-code-fork';
+ $repository = $this->getRepository();
+
+ $has_any =
+ $repository->getDetail('default-branch') ||
+ $repository->getDetail('branch-filter') ||
+ $repository->getDetail('close-commits-filter');
+
+ if ($has_any) {
+ return 'fa-code-fork';
+ } else {
+ return 'fa-code-fork grey';
+ }
}
protected function getEditEngineFieldKeys() {
@@ -30,6 +41,30 @@
);
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $branches_uri = $this->getEditPageURI();
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Branches'))
+ ->setHref($branches_uri)
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -61,22 +96,7 @@
$view->addProperty(pht('Autoclose Only'), $autoclose_only);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $branches_uri = $this->getEditPageURI();
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($branches_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- $content[] = $this->newBox(pht('Branches'), $view, array($button));
+ $content[] = $this->newBox(pht('Branches'), $view);
// Branch Autoclose Table
if (!$repository->isImporting()) {
diff --git a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php
@@ -41,6 +41,7 @@
abstract public function getManagementPanelLabel();
abstract public function getManagementPanelOrder();
abstract public function buildManagementPanelContent();
+ public function buildManagementPanelCurtain() { return null; }
public function getManagementPanelIcon() {
return 'fa-pencil';
@@ -63,22 +64,6 @@
->execute();
}
- final protected function newBox($header_text, $body, $button = array()) {
- $header = id(new PHUIHeaderView())
- ->setHeader($header_text);
-
- foreach ($button as $link) {
- $header->addActionLink($link);
- }
-
- $view = id(new PHUIObjectBoxView())
- ->setHeader($header)
- ->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
- ->appendChild($body);
-
- return $view;
- }
-
final protected function newTimeline() {
return $this->controller->newTimeline($this->getRepository());
}
@@ -124,4 +109,36 @@
return $this->getPanelURI();
}
+ final protected function newActionList() {
+ $viewer = $this->getViewer();
+ $action_id = celerity_generate_unique_node_id();
+
+ return id(new PhabricatorActionListView())
+ ->setViewer($viewer)
+ ->setID($action_id);
+ }
+
+ final protected function newCurtainView() {
+ $viewer = $this->getViewer();
+
+ return id(new PHUICurtainView())
+ ->setViewer($viewer);
+ }
+
+ final protected function newBox($header_text, $body) {
+ $viewer = $this->getViewer();
+
+ $header = id(new PHUIHeaderView())
+ ->setViewer($viewer)
+ ->setHeader($header_text);
+
+ $view = id(new PHUIObjectBoxView())
+ ->setViewer($viewer)
+ ->setHeader($header)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
+ ->appendChild($body);
+
+ return $view;
+ }
+
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryPoliciesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryPoliciesManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryPoliciesManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryPoliciesManagementPanel.php
@@ -14,7 +14,35 @@
}
public function getManagementPanelIcon() {
- return 'fa-lock';
+ $viewer = $this->getViewer();
+ $repository = $this->getRepository();
+
+ $can_view = PhabricatorPolicyCapability::CAN_VIEW;
+ $can_edit = PhabricatorPolicyCapability::CAN_EDIT;
+ $can_push = DiffusionPushCapability::CAPABILITY;
+
+ $actual_values = array(
+ 'spacePHID' => $repository->getSpacePHID(),
+ 'view' => $repository->getPolicy($can_view),
+ 'edit' => $repository->getPolicy($can_edit),
+ 'push' => $repository->getPolicy($can_push),
+ );
+
+ $default = PhabricatorRepository::initializeNewRepository(
+ $viewer);
+
+ $default_values = array(
+ 'spacePHID' => $default->getSpacePHID(),
+ 'view' => $default->getPolicy($can_view),
+ 'edit' => $default->getPolicy($can_edit),
+ 'push' => $default->getPolicy($can_push),
+ );
+
+ if ($actual_values === $default_values) {
+ return 'fa-lock grey';
+ } else {
+ return 'fa-lock';
+ }
}
protected function getEditEngineFieldKeys() {
@@ -26,6 +54,31 @@
);
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $edit_uri = $this->getEditPageURI();
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setName(pht('Edit Policies'))
+ ->setHref($edit_uri)
+ ->setIcon('fa-pencil')
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
+ }
+
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -58,22 +111,7 @@
: phutil_tag('em', array(), pht('Not a Hosted Repository'));
$view->addProperty(pht('Pushable By'), $pushable);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $edit_uri = $this->getEditPageURI();
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($edit_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- return $this->newBox(pht('Policies'), $view, array($button));
+ return $this->newBox(pht('Policies'), $view);
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryStagingManagementPanel.php
@@ -18,9 +18,16 @@
return $repository->isGit();
}
-
public function getManagementPanelIcon() {
- return 'fa-upload';
+ $repository = $this->getRepository();
+
+ $staging_uri = $repository->getStagingURI();
+
+ if ($staging_uri) {
+ return 'fa-upload';
+ } else {
+ return 'fa-upload grey';
+ }
}
protected function getEditEngineFieldKeys() {
@@ -29,6 +36,30 @@
);
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $staging_uri = $this->getEditPageURI();
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Staging'))
+ ->setHref($staging_uri)
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -43,22 +74,7 @@
$view->addProperty(pht('Staging Area URI'), $staging_uri);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $staging_uri = $this->getEditPageURI();
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($staging_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- return $this->newBox(pht('Staging Area'), $view, array($button));
+ return $this->newBox(pht('Staging Area'), $view);
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryStorageManagementPanel.php
@@ -14,7 +14,32 @@
}
public function getManagementPanelIcon() {
- return 'fa-database';
+ $repository = $this->getRepository();
+
+ if ($repository->getAlmanacServicePHID()) {
+ return 'fa-sitemap';
+ } else if ($repository->isHosted()) {
+ return 'fa-database';
+ } else {
+ return 'fa-download';
+ }
+ }
+
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $doc_href = PhabricatorEnv::getDoclink('Cluster: Repositories');
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-book')
+ ->setHref($doc_href)
+ ->setName(pht('Cluster Documentation')));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
}
public function buildManagementPanelContent() {
@@ -47,15 +72,7 @@
$view->addProperty(pht('Storage Path'), $storage_path);
$view->addProperty(pht('Storage Cluster'), $storage_service);
- $doc_href = PhabricatorEnv::getDoclink('Cluster: Repositories');
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-book')
- ->setHref($doc_href)
- ->setText(pht('Help'));
-
- return $this->newBox(pht('Storage'), $view, array($button));
+ return $this->newBox(pht('Storage'), $view);
}
private function buildClusterStatusPanel() {
diff --git a/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositorySubversionManagementPanel.php
@@ -19,7 +19,15 @@
}
public function getManagementPanelIcon() {
- return 'fa-folder';
+ $repository = $this->getRepository();
+
+ $has_any = (bool)$repository->getDetail('svn-subpath');
+
+ if ($has_any) {
+ return 'fa-folder';
+ } else {
+ return 'fa-folder grey';
+ }
}
protected function getEditEngineFieldKeys() {
@@ -28,6 +36,30 @@
);
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $subversion_uri = $this->getEditPageURI();
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-pencil')
+ ->setName(pht('Edit Properties'))
+ ->setHref($subversion_uri)
+ ->setDisabled(!$can_edit)
+ ->setWorkflow(!$can_edit));
+
+ return $this->newCurtainView($action_list)
+ ->setActionList($action_list);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -40,22 +72,7 @@
phutil_tag('em', array(), pht('Import Entire Repository')));
$view->addProperty(pht('Import Only'), $default_branch);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $subversion_uri = $this->getEditPageURI();
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($subversion_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- return $this->newBox(pht('Subversion'), $view, array($button));
+ return $this->newBox(pht('Subversion'), $view);
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php
@@ -14,7 +14,17 @@
}
public function getManagementPanelIcon() {
- return 'fa-bullseye';
+ $repository = $this->getRepository();
+
+ $has_any =
+ $repository->getSymbolLanguages() ||
+ $repository->getSymbolSources();
+
+ if ($has_any) {
+ return 'fa-link';
+ } else {
+ return 'fa-link grey';
+ }
}
protected function getEditEngineFieldKeys() {
@@ -24,6 +34,30 @@
);
}
+ 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);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -47,22 +81,7 @@
}
$view->addProperty(pht('Uses Symbols From'), $sources);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $symbols_uri = $this->getEditPageURI();
-
- $button = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-pencil')
- ->setText(pht('Edit'))
- ->setHref($symbols_uri)
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit);
-
- return $this->newBox(pht('Symbols'), $view, array($button));
+ return $this->newBox(pht('Symbols'), $view);
}
}
diff --git a/src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php
@@ -17,6 +17,36 @@
return 400;
}
+ public function buildManagementPanelCurtain() {
+ $repository = $this->getRepository();
+ $viewer = $this->getViewer();
+ $action_list = $this->newActionList();
+
+ $can_edit = PhabricatorPolicyFilter::hasCapability(
+ $viewer,
+ $repository,
+ PhabricatorPolicyCapability::CAN_EDIT);
+
+ $doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: URIs');
+ $add_href = $repository->getPathURI('uri/edit/');
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-plus')
+ ->setHref($add_href)
+ ->setDisabled(!$can_edit)
+ ->setName(pht('Add New URI')));
+
+ $action_list->addAction(
+ id(new PhabricatorActionView())
+ ->setIcon('fa-book')
+ ->setHref($doc_href)
+ ->setName(pht('URI Documentation')));
+
+ return $this->newCurtainView()
+ ->setActionList($action_list);
+ }
+
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
@@ -122,30 +152,9 @@
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->setErrors($messages);
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $repository,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $doc_href = PhabricatorEnv::getDoclink('Diffusion User Guide: URIs');
- $add_href = $repository->getPathURI('uri/edit/');
-
- $add = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-plus')
- ->setHref($add_href)
- ->setDisabled(!$can_edit)
- ->setText(pht('New URI'));
-
- $help = id(new PHUIButtonView())
- ->setTag('a')
- ->setIcon('fa-book')
- ->setHref($doc_href)
- ->setText(pht('Help'));
-
- $box = $this->newBox(pht('Repository URIs'), $table, array($add, $help));
+ $box = $this->newBox(pht('Repository URIs'), $table);
- return array($box, $info_view);
+ return array($info_view, $box);
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 22, 10:31 AM (3 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7030520
Default Alt Text
D19826.diff (29 KB)

Event Timeline