Page MenuHomePhabricator

D15872.id38230.diff
No OneTemporary

D15872.id38230.diff

diff --git a/src/applications/diffusion/editor/DiffusionURIEditEngine.php b/src/applications/diffusion/editor/DiffusionURIEditEngine.php
--- a/src/applications/diffusion/editor/DiffusionURIEditEngine.php
+++ b/src/applications/diffusion/editor/DiffusionURIEditEngine.php
@@ -83,9 +83,25 @@
protected function buildCustomEditFields($object) {
$viewer = $this->getViewer();
+ $uri_instructions = null;
if ($object->isBuiltin()) {
$is_builtin = true;
$uri_value = (string)$object->getDisplayURI();
+
+ switch ($object->getBuiltinProtocol()) {
+ case PhabricatorRepositoryURI::BUILTIN_PROTOCOL_SSH:
+ $uri_instructions = pht(
+ " - Configure [[ %s | %s ]] to change the SSH username.\n".
+ " - Configure [[ %s | %s ]] to change the SSH host.\n".
+ " - Configure [[ %s | %s ]] to change the SSH port.",
+ '/config/edit/diffusion.ssh-user/',
+ 'diffusion.ssh-user',
+ '/config/edit/diffusion.ssh-host/',
+ 'diffusion.ssh-host',
+ '/config/edit/diffusion.ssh-port/',
+ 'diffusion.ssh-port');
+ break;
+ }
} else {
$is_builtin = false;
$uri_value = $object->getURI();
@@ -118,7 +134,8 @@
->setConduitTypeDescription(pht('New repository URI.'))
->setIsRequired(!$is_builtin)
->setIsLocked($is_builtin)
- ->setValue($uri_value),
+ ->setValue($uri_value)
+ ->setControlInstructions($uri_instructions),
id(new PhabricatorSelectEditField())
->setKey('io')
->setLabel(pht('I/O Type'))
diff --git a/src/applications/diffusion/management/DiffusionRepositoryDocumentationManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryDocumentationManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryDocumentationManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryDocumentationManagementPanel.php
@@ -14,7 +14,7 @@
}
public function getManagementPanelIcon() {
- return 'fa-book bluegrey';
+ return 'fa-book';
}
public function buildManagementPanelContent() {
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
@@ -113,8 +113,28 @@
->setTag('a')
->setText(pht('Documentation')));
+ $messages = array();
+ if ($repository->isHosted()) {
+ $messages[] = array(
+ id(new PHUIIconView())->setIcon('fa-folder'),
+ ' ',
+ pht('Phabricator is hosting this repository.'),
+ );
+ } else {
+ $messages[] = array(
+ id(new PHUIIconView())->setIcon('fa-download'),
+ ' ',
+ pht('This repository is hosted remotely. Phabricator is observing it.'),
+ );
+ }
+
+ $info_view = id(new PHUIInfoView())
+ ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
+ ->setErrors($messages);
+
return id(new PHUIObjectBoxView())
->setHeader($header)
+ ->setInfoView($info_view)
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($table);
}
diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php
--- a/src/applications/transactions/editfield/PhabricatorEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorEditField.php
@@ -16,6 +16,7 @@
private $isRequired;
private $previewPanel;
private $controlID;
+ private $controlInstructions;
private $description;
private $conduitDescription;
@@ -272,6 +273,15 @@
return $this->previewPanel;
}
+ public function setControlInstructions($control_instructions) {
+ $this->controlInstructions = $control_instructions;
+ return $this;
+ }
+
+ public function getControlInstructions() {
+ return $this->controlInstructions;
+ }
+
protected function newControl() {
throw new PhutilMethodNotImplementedException();
}
@@ -358,6 +368,11 @@
}
}
+ $instructions = $this->getControlInstructions();
+ if (strlen($instructions)) {
+ $form->appendRemarkupInstructions($instructions);
+ }
+
$form->appendControl($control);
}
return $this;

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 9:01 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7678044
Default Alt Text
D15872.id38230.diff (4 KB)

Event Timeline