Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14315592
D15392.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D15392.id.diff
View Options
diff --git a/resources/sql/autopatches/20160303.drydock.3.edge.sql b/resources/sql/autopatches/20160303.drydock.3.edge.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160303.drydock.3.edge.sql
@@ -0,0 +1,16 @@
+CREATE TABLE {$NAMESPACE}_drydock.edge (
+ src VARBINARY(64) NOT NULL,
+ type INT UNSIGNED NOT NULL,
+ dst VARBINARY(64) NOT NULL,
+ dateCreated INT UNSIGNED NOT NULL,
+ seq INT UNSIGNED NOT NULL,
+ dataID INT UNSIGNED,
+ PRIMARY KEY (src, type, dst),
+ KEY `src` (src, type, dateCreated, seq),
+ UNIQUE KEY `key_dst` (dst, type, src)
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
+
+CREATE TABLE {$NAMESPACE}_drydock.edgedata (
+ id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ data LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -966,6 +966,7 @@
'DrydockResourceViewController' => 'applications/drydock/controller/DrydockResourceViewController.php',
'DrydockSFTPFilesystemInterface' => 'applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php',
'DrydockSSHCommandInterface' => 'applications/drydock/interface/command/DrydockSSHCommandInterface.php',
+ 'DrydockSchemaSpec' => 'applications/drydock/storage/DrydockSchemaSpec.php',
'DrydockSlotLock' => 'applications/drydock/storage/DrydockSlotLock.php',
'DrydockSlotLockException' => 'applications/drydock/exception/DrydockSlotLockException.php',
'DrydockSlotLockFailureLogType' => 'applications/drydock/logtype/DrydockSlotLockFailureLogType.php',
@@ -4975,6 +4976,7 @@
'PhabricatorPolicyInterface',
'PhabricatorCustomFieldInterface',
'PhabricatorNgramsInterface',
+ 'PhabricatorProjectInterface',
),
'DrydockBlueprintController' => 'DrydockController',
'DrydockBlueprintCoreCustomField' => array(
@@ -5094,6 +5096,7 @@
'DrydockResourceViewController' => 'DrydockResourceController',
'DrydockSFTPFilesystemInterface' => 'DrydockFilesystemInterface',
'DrydockSSHCommandInterface' => 'DrydockCommandInterface',
+ 'DrydockSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'DrydockSlotLock' => 'DrydockDAO',
'DrydockSlotLockException' => 'Exception',
'DrydockSlotLockFailureLogType' => 'DrydockLogType',
diff --git a/src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockAlmanacServiceHostBlueprintImplementation.php
@@ -15,6 +15,10 @@
return pht('Almanac Hosts');
}
+ public function getBlueprintIcon() {
+ return 'fa-server';
+ }
+
public function getDescription() {
return pht(
'Allows Drydock to lease existing hosts defined in an Almanac service '.
diff --git a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
@@ -15,6 +15,10 @@
abstract public function getBlueprintName();
abstract public function getDescription();
+ public function getBlueprintIcon() {
+ return 'fa-map-o';
+ }
+
public function getFieldSpecifications() {
$fields = array();
diff --git a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
@@ -13,6 +13,10 @@
return pht('Working Copy');
}
+ public function getBlueprintIcon() {
+ return 'fa-folder-open';
+ }
+
public function getDescription() {
return pht('Allows Drydock to check out working copies of repositories.');
}
diff --git a/src/applications/drydock/controller/DrydockBlueprintEditController.php b/src/applications/drydock/controller/DrydockBlueprintEditController.php
--- a/src/applications/drydock/controller/DrydockBlueprintEditController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintEditController.php
@@ -52,9 +52,15 @@
foreach ($implementations as $implementation_name => $implementation) {
$disabled = !$implementation->isEnabled();
+ $impl_icon = $implementation->getBlueprintIcon();
+ $impl_name = $implementation->getBlueprintName();
+
+ $impl_icon = id(new PHUIIconView())
+ ->setIcon($impl_icon, 'lightgreytext');
+
$control->addButton(
$implementation_name,
- $implementation->getBlueprintName(),
+ array($impl_icon, ' ', $impl_name),
array(
pht('Provides: %s', $implementation->getType()),
phutil_tag('br'),
diff --git a/src/applications/drydock/controller/DrydockBlueprintViewController.php b/src/applications/drydock/controller/DrydockBlueprintViewController.php
--- a/src/applications/drydock/controller/DrydockBlueprintViewController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintViewController.php
@@ -127,8 +127,12 @@
private function buildPropertyListView(
DrydockBlueprint $blueprint,
PhabricatorActionListView $actions) {
+ $viewer = $this->getViewer();
+
+ $view = id(new PHUIPropertyListView())
+ ->setUser($viewer)
+ ->setObject($blueprint);
- $view = new PHUIPropertyListView();
$view->setActionList($actions);
$view->addProperty(
diff --git a/src/applications/drydock/query/DrydockBlueprintSearchEngine.php b/src/applications/drydock/query/DrydockBlueprintSearchEngine.php
--- a/src/applications/drydock/query/DrydockBlueprintSearchEngine.php
+++ b/src/applications/drydock/query/DrydockBlueprintSearchEngine.php
@@ -77,15 +77,29 @@
assert_instances_of($blueprints, 'DrydockBlueprint');
$viewer = $this->requireViewer();
+
+ if ($blueprints) {
+ $edge_query = id(new PhabricatorEdgeQuery())
+ ->withSourcePHIDs(mpull($blueprints, 'getPHID'))
+ ->withEdgeTypes(
+ array(
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
+ ));
+
+ $edge_query->execute();
+ }
+
$view = new PHUIObjectItemListView();
foreach ($blueprints as $blueprint) {
+ $impl = $blueprint->getImplementation();
+
$item = id(new PHUIObjectItemView())
->setHeader($blueprint->getBlueprintName())
- ->setHref($this->getApplicationURI('/blueprint/'.$blueprint->getID()))
+ ->setHref($blueprint->getURI())
->setObjectName(pht('Blueprint %d', $blueprint->getID()));
- if (!$blueprint->getImplementation()->isEnabled()) {
+ if (!$impl->isEnabled()) {
$item->setDisabled(true);
$item->addIcon('fa-chain-broken grey', pht('Implementation'));
}
@@ -95,7 +109,24 @@
$item->addIcon('fa-ban grey', pht('Disabled'));
}
- $item->addAttribute($blueprint->getImplementation()->getBlueprintName());
+ $impl_icon = $impl->getBlueprintIcon();
+ $impl_name = $impl->getBlueprintName();
+
+ $impl_icon = id(new PHUIIconView())
+ ->setIcon($impl_icon, 'lightgreytext');
+
+ $item->addAttribute(array($impl_icon, ' ', $impl_name));
+
+ $phid = $blueprint->getPHID();
+ $project_phids = $edge_query->getDestinationPHIDs(array($phid));
+ if ($project_phids) {
+ $project_handles = $viewer->loadHandles($project_phids);
+ $item->addAttribute(
+ id(new PHUIHandleTagListView())
+ ->setLimit(4)
+ ->setSlim(true)
+ ->setHandles($project_handles));
+ }
$view->addItem($item);
}
diff --git a/src/applications/drydock/storage/DrydockBlueprint.php b/src/applications/drydock/storage/DrydockBlueprint.php
--- a/src/applications/drydock/storage/DrydockBlueprint.php
+++ b/src/applications/drydock/storage/DrydockBlueprint.php
@@ -9,7 +9,8 @@
PhabricatorApplicationTransactionInterface,
PhabricatorPolicyInterface,
PhabricatorCustomFieldInterface,
- PhabricatorNgramsInterface {
+ PhabricatorNgramsInterface,
+ PhabricatorProjectInterface {
protected $className;
protected $blueprintName;
@@ -119,6 +120,11 @@
return $log->save();
}
+ public function getURI() {
+ $id = $this->getID();
+ return "/drydock/blueprint/{$id}/";
+ }
+
/* -( Allocating Resources )----------------------------------------------- */
diff --git a/src/applications/drydock/storage/DrydockSchemaSpec.php b/src/applications/drydock/storage/DrydockSchemaSpec.php
new file mode 100644
--- /dev/null
+++ b/src/applications/drydock/storage/DrydockSchemaSpec.php
@@ -0,0 +1,9 @@
+<?php
+
+final class DrydockSchemaSpec extends PhabricatorConfigSchemaSpec {
+
+ public function buildSchemata() {
+ $this->buildEdgeSchemata(new DrydockBlueprint());
+ }
+
+}
diff --git a/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php b/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php
--- a/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php
+++ b/src/applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php
@@ -84,7 +84,6 @@
$viewer = $this->requireViewer();
-
if ($plans) {
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(mpull($plans, 'getPHID'))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 6:21 AM (19 h, 9 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6902325
Default Alt Text
D15392.id.diff (9 KB)
Attached To
Mode
D15392: Allow Drydock blueprints to be tagged and searched, and give types some little icons
Attached
Detach File
Event Timeline
Log In to Comment