Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15374173
D13921.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
D13921.diff
View Options
diff --git a/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php b/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php
--- a/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php
+++ b/src/applications/owners/conduit/OwnersQueryConduitAPIMethod.php
@@ -110,7 +110,6 @@
'phid' => $package->getPHID(),
'name' => $package->getName(),
'description' => $package->getDescription(),
- 'primaryOwner' => $package->getPrimaryOwnerPHID(),
'owners' => $owners,
'paths' => $paths,
);
diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php
--- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php
@@ -150,14 +150,6 @@
$view = id(new PHUIPropertyListView())
->setUser($viewer);
- $primary_phid = $package->getPrimaryOwnerPHID();
- if ($primary_phid) {
- $primary_owner = $viewer->renderHandle($primary_phid);
- } else {
- $primary_owner = phutil_tag('em', array(), pht('None'));
- }
- $view->addProperty(pht('Primary Owner'), $primary_owner);
-
// TODO: needOwners() this on the Query.
$owners = $package->loadOwners();
if ($owners) {
diff --git a/src/applications/owners/controller/PhabricatorOwnersEditController.php b/src/applications/owners/controller/PhabricatorOwnersEditController.php
--- a/src/applications/owners/controller/PhabricatorOwnersEditController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersEditController.php
@@ -28,10 +28,8 @@
}
$e_name = true;
- $e_primary = true;
$v_name = $package->getName();
- $v_primary = $package->getPrimaryOwnerPHID();
// TODO: Pull these off needOwners() on the Query.
$v_owners = mpull($package->loadOwners(), 'getUserPHID');
$v_auditing = $package->getAuditingEnabled();
@@ -43,18 +41,11 @@
$xactions = array();
$v_name = $request->getStr('name');
- $v_primary = head($request->getArr('primary'));
$v_owners = $request->getArr('owners');
$v_auditing = ($request->getStr('auditing') == 'enabled');
$v_description = $request->getStr('description');
- if ($v_primary) {
- $v_owners[] = $v_primary;
- $v_owners = array_unique($v_owners);
- }
-
$type_name = PhabricatorOwnersPackageTransaction::TYPE_NAME;
- $type_primary = PhabricatorOwnersPackageTransaction::TYPE_PRIMARY;
$type_owners = PhabricatorOwnersPackageTransaction::TYPE_OWNERS;
$type_auditing = PhabricatorOwnersPackageTransaction::TYPE_AUDITING;
$type_description = PhabricatorOwnersPackageTransaction::TYPE_DESCRIPTION;
@@ -64,10 +55,6 @@
->setNewValue($v_name);
$xactions[] = id(new PhabricatorOwnersPackageTransaction())
- ->setTransactionType($type_primary)
- ->setNewValue($v_primary);
-
- $xactions[] = id(new PhabricatorOwnersPackageTransaction())
->setTransactionType($type_owners)
->setNewValue($v_owners);
@@ -102,16 +89,9 @@
$validation_exception = $ex;
$e_name = $ex->getShortMessage($type_name);
- $e_primary = $ex->getShortMessage($type_primary);
}
}
- if ($v_primary) {
- $value_primary_owner = array($v_primary);
- } else {
- $value_primary_owner = array();
- }
-
if ($is_new) {
$cancel_uri = '/owners/';
$title = pht('New Package');
@@ -133,14 +113,6 @@
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectOrUserDatasource())
- ->setLabel(pht('Primary Owner'))
- ->setName('primary')
- ->setLimit(1)
- ->setValue($value_primary_owner)
- ->setError($e_primary))
- ->appendControl(
- id(new AphrontFormTokenizerControl())
- ->setDatasource(new PhabricatorProjectOrUserDatasource())
->setLabel(pht('Owners'))
->setName('owners')
->setValue($v_owners))
diff --git a/src/applications/owners/editor/PhabricatorOwnersPackageTransactionEditor.php b/src/applications/owners/editor/PhabricatorOwnersPackageTransactionEditor.php
--- a/src/applications/owners/editor/PhabricatorOwnersPackageTransactionEditor.php
+++ b/src/applications/owners/editor/PhabricatorOwnersPackageTransactionEditor.php
@@ -15,7 +15,6 @@
$types = parent::getTransactionTypes();
$types[] = PhabricatorOwnersPackageTransaction::TYPE_NAME;
- $types[] = PhabricatorOwnersPackageTransaction::TYPE_PRIMARY;
$types[] = PhabricatorOwnersPackageTransaction::TYPE_OWNERS;
$types[] = PhabricatorOwnersPackageTransaction::TYPE_AUDITING;
$types[] = PhabricatorOwnersPackageTransaction::TYPE_DESCRIPTION;
@@ -31,8 +30,6 @@
switch ($xaction->getTransactionType()) {
case PhabricatorOwnersPackageTransaction::TYPE_NAME:
return $object->getName();
- case PhabricatorOwnersPackageTransaction::TYPE_PRIMARY:
- return $object->getPrimaryOwnerPHID();
case PhabricatorOwnersPackageTransaction::TYPE_OWNERS:
// TODO: needOwners() this on the Query.
$phids = mpull($object->loadOwners(), 'getUserPHID');
@@ -54,7 +51,6 @@
switch ($xaction->getTransactionType()) {
case PhabricatorOwnersPackageTransaction::TYPE_NAME:
- case PhabricatorOwnersPackageTransaction::TYPE_PRIMARY:
case PhabricatorOwnersPackageTransaction::TYPE_DESCRIPTION:
case PhabricatorOwnersPackageTransaction::TYPE_PATHS:
return $xaction->getNewValue();
@@ -94,9 +90,6 @@
case PhabricatorOwnersPackageTransaction::TYPE_NAME:
$object->setName($xaction->getNewValue());
return;
- case PhabricatorOwnersPackageTransaction::TYPE_PRIMARY:
- $object->setPrimaryOwnerPHID($xaction->getNewValue());
- return;
case PhabricatorOwnersPackageTransaction::TYPE_DESCRIPTION:
$object->setDescription($xaction->getNewValue());
return;
@@ -117,7 +110,6 @@
switch ($xaction->getTransactionType()) {
case PhabricatorOwnersPackageTransaction::TYPE_NAME:
- case PhabricatorOwnersPackageTransaction::TYPE_PRIMARY:
case PhabricatorOwnersPackageTransaction::TYPE_DESCRIPTION:
case PhabricatorOwnersPackageTransaction::TYPE_AUDITING:
return;
@@ -200,22 +192,6 @@
$errors[] = $error;
}
break;
- case PhabricatorOwnersPackageTransaction::TYPE_PRIMARY:
- $missing = $this->validateIsEmptyTextField(
- $object->getPrimaryOwnerPHID(),
- $xactions);
-
- if ($missing) {
- $error = new PhabricatorApplicationTransactionValidationError(
- $type,
- pht('Required'),
- pht('Packages must have a primary owner.'),
- nonempty(last($xactions), null));
-
- $error->setIsMissingFieldError(true);
- $errors[] = $error;
- }
- break;
}
return $errors;
@@ -245,7 +221,6 @@
protected function getMailTo(PhabricatorLiskDAO $object) {
return array(
- $object->getPrimaryOwnerPHID(),
$this->requireActor()->getPHID(),
);
}
diff --git a/src/applications/owners/storage/PhabricatorOwnersPackage.php b/src/applications/owners/storage/PhabricatorOwnersPackage.php
--- a/src/applications/owners/storage/PhabricatorOwnersPackage.php
+++ b/src/applications/owners/storage/PhabricatorOwnersPackage.php
@@ -17,8 +17,7 @@
public static function initializeNewPackage(PhabricatorUser $actor) {
return id(new PhabricatorOwnersPackage())
- ->setAuditingEnabled(0)
- ->setPrimaryOwnerPHID($actor->getPHID());
+ ->setAuditingEnabled(0);
}
public function getCapabilities() {
diff --git a/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php b/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
--- a/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
+++ b/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
@@ -25,14 +25,6 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case self::TYPE_PRIMARY:
- if ($old) {
- $phids[] = $old;
- }
- if ($new) {
- $phids[] = $new;
- }
- break;
case self::TYPE_OWNERS:
$add = array_diff($new, $old);
foreach ($add as $phid) {
@@ -55,6 +47,9 @@
switch ($this->getTransactionType()) {
case self::TYPE_DESCRIPTION:
return ($old === null);
+ case self::TYPE_PRIMARY:
+ // TODO: Eventually, remove these transactions entirely.
+ return true;
}
}
@@ -76,12 +71,6 @@
$old,
$new);
}
- case self::TYPE_PRIMARY:
- return pht(
- '%s changed the primary owner for this package from %s to %s.',
- $this->renderHandleLink($author_phid),
- $this->renderHandleLink($old),
- $this->renderHandleLink($new));
case self::TYPE_OWNERS:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 13, 5:25 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225256
Default Alt Text
D13921.diff (9 KB)
Attached To
Mode
D13921: Remove "Primary Owner" from Owners
Attached
Detach File
Event Timeline
Log In to Comment