1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Add Spaces to Projects

Summary:
See PHI774. Ref T13164. There is no reason projects //don't// support Spaces, just a vague concern that it's not hugely useful and might be a bit confusing.

However, it's at least somewhat useful (to improve consistency and reduce special casing) and doesn't necessarily seem more confusing than Projects are anyway. Support is trivial from a technical point of view, so just hook it up.

Test Plan: Created new projects, shifted projects between spaces. The support is all pretty much automatic.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13164

Differential Revision: https://secure.phabricator.com/D19549
This commit is contained in:
epriestley 2018-07-30 15:32:55 -07:00
parent 81a7c9ac43
commit 13cac5c362
3 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_project.project
ADD COLUMN spacePHID VARBINARY(64) DEFAULT NULL;

View file

@ -9752,6 +9752,7 @@ phutil_register_library_map(array(
'PhabricatorFerretInterface',
'PhabricatorConduitResultInterface',
'PhabricatorColumnProxyInterface',
'PhabricatorSpacesInterface',
),
'PhabricatorProjectAddHeraldAction' => 'PhabricatorProjectHeraldAction',
'PhabricatorProjectApplication' => 'PhabricatorApplication',

View file

@ -11,7 +11,8 @@ final class PhabricatorProject extends PhabricatorProjectDAO
PhabricatorFulltextInterface,
PhabricatorFerretInterface,
PhabricatorConduitResultInterface,
PhabricatorColumnProxyInterface {
PhabricatorColumnProxyInterface,
PhabricatorSpacesInterface {
protected $name;
protected $status = PhabricatorProjectStatus::STATUS_ACTIVE;
@ -38,6 +39,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
protected $projectPathKey;
protected $properties = array();
protected $spacePHID;
private $memberPHIDs = self::ATTACHABLE;
private $watcherPHIDs = self::ATTACHABLE;
@ -82,6 +84,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
->setViewPolicy($view_policy)
->setEditPolicy($edit_policy)
->setJoinPolicy($join_policy)
->setSpacePHID($actor->getDefaultSpacePHID())
->setIsMembershipLocked(0)
->attachMemberPHIDs(array())
->attachSlugs(array())
@ -697,6 +700,14 @@ final class PhabricatorProject extends PhabricatorProjectDAO
}
/* -( PhabricatorSpacesInterface )----------------------------------------- */
public function getSpacePHID() {
return $this->spacePHID;
}
/* -( PhabricatorDestructibleInterface )----------------------------------- */