mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
Remove "Former" project members
Summary: This is a needlessly confusing/complex feature that I originally wrote sort of speculativley. I think we can better serve what little need may exist here with project feeds. I'm probably going to get rid of or deemphasize "role" too and just add "Join Project" and "Leave Project" buttons. Test Plan: Viewed project list, project profile. Edited project profile and affiliation. Reviewers: btrahan, jungejason, zeeg Reviewed By: btrahan CC: aran, btrahan Maniphest Tasks: T681 Differential Revision: 1228
This commit is contained in:
parent
81acf588e2
commit
93d5d29541
8 changed files with 4 additions and 32 deletions
1
resources/sql/patches/086.formeraffil.sql
Normal file
1
resources/sql/patches/086.formeraffil.sql
Normal file
|
@ -0,0 +1 @@
|
|||
ALTER TABLE phabricator_project.project_affiliation DROP status;
|
|
@ -48,7 +48,6 @@ class PhabricatorProjectAffiliationEditController
|
|||
|
||||
if ($request->isFormPost()) {
|
||||
$affiliation->setRole($request->getStr('role'));
|
||||
$affiliation->setStatus($request->getStr('status'));
|
||||
|
||||
if (!strlen($affiliation->getRole())) {
|
||||
if ($affiliation->getID()) {
|
||||
|
@ -67,11 +66,6 @@ class PhabricatorProjectAffiliationEditController
|
|||
->setURI('/project/view/'.$project->getID().'/');
|
||||
}
|
||||
|
||||
$status_options = array(
|
||||
'' => 'Current',
|
||||
'former' => 'Former',
|
||||
);
|
||||
|
||||
$form = new AphrontFormView();
|
||||
$form
|
||||
->setUser($user)
|
||||
|
@ -81,12 +75,6 @@ class PhabricatorProjectAffiliationEditController
|
|||
->setLabel('Role')
|
||||
->setName('role')
|
||||
->setValue($affiliation->getRole()))
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
->setLabel('Status')
|
||||
->setName('status')
|
||||
->setOptions($status_options)
|
||||
->setValue($affiliation->getStatus()))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->addCancelButton('/project/view/'.$project->getID().'/')
|
||||
|
|
|
@ -12,7 +12,6 @@ phutil_require_module('phabricator', 'applications/project/controller/base');
|
|||
phutil_require_module('phabricator', 'applications/project/storage/affiliation');
|
||||
phutil_require_module('phabricator', 'applications/project/storage/project');
|
||||
phutil_require_module('phabricator', 'view/form/base');
|
||||
phutil_require_module('phabricator', 'view/form/control/select');
|
||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||
phutil_require_module('phabricator', 'view/form/control/text');
|
||||
phutil_require_module('phabricator', 'view/layout/panel');
|
||||
|
|
|
@ -132,13 +132,7 @@ class PhabricatorProjectProfileController
|
|||
foreach ($affiliations as $affiliation) {
|
||||
$user = $handles[$affiliation->getUserPHID()]->renderLink();
|
||||
$role = phutil_escape_html($affiliation->getRole());
|
||||
|
||||
$status = null;
|
||||
if ($affiliation->getStatus() == 'former') {
|
||||
$role = '<em>Former '.$role.'</em>';
|
||||
}
|
||||
|
||||
$affiliated[] = '<li>'.$user.' — '.$role.$status.'</li>';
|
||||
$affiliated[] = '<li>'.$user.' — '.$role.'</li>';
|
||||
}
|
||||
|
||||
if ($affiliated) {
|
||||
|
|
|
@ -113,7 +113,6 @@ class PhabricatorProjectProfileEditController
|
|||
}
|
||||
$state[$user_phid] = array(
|
||||
'phid' => $user_phid,
|
||||
'status' => $resource['status'],
|
||||
'role' => $resource['role'],
|
||||
'owner' => $resource['owner'],
|
||||
);
|
||||
|
@ -141,7 +140,6 @@ class PhabricatorProjectProfileEditController
|
|||
}
|
||||
|
||||
$affil->setRole((string)$new['role']);
|
||||
$affil->setStatus((string)$new['status']);
|
||||
$affil->setIsOwner((int)$new['owner']);
|
||||
|
||||
$save_affiliations[] = $affil;
|
||||
|
@ -180,7 +178,6 @@ class PhabricatorProjectProfileEditController
|
|||
$state[] = array(
|
||||
'phid' => $user_phid,
|
||||
'name' => $handles[$user_phid]->getFullName(),
|
||||
'status' => $affil->getStatus(),
|
||||
'role' => $affil->getRole(),
|
||||
'owner' => $affil->getIsOwner(),
|
||||
);
|
||||
|
|
|
@ -67,7 +67,7 @@ final class PhabricatorProjectQuery {
|
|||
|
||||
$data = queryfx_all(
|
||||
$conn_r,
|
||||
'SELECT * FROM %T p %Q %Q',
|
||||
'SELECT p.* FROM %T p %Q %Q',
|
||||
$table->getTableName(),
|
||||
$joins,
|
||||
$limit);
|
||||
|
|
|
@ -21,7 +21,6 @@ class PhabricatorProjectAffiliation extends PhabricatorProjectDAO {
|
|||
protected $projectPHID;
|
||||
protected $userPHID;
|
||||
protected $role;
|
||||
protected $status = '';
|
||||
protected $isOwner = 0;
|
||||
|
||||
public static function loadAllForProjectPHIDs($phids) {
|
||||
|
@ -31,7 +30,7 @@ class PhabricatorProjectAffiliation extends PhabricatorProjectDAO {
|
|||
$default = array_fill_keys($phids, array());
|
||||
|
||||
$affiliations = id(new PhabricatorProjectAffiliation())->loadAllWhere(
|
||||
'projectPHID IN (%Ls) ORDER BY IF(status = "former", 1, 0), dateCreated',
|
||||
'projectPHID IN (%Ls) ORDER BY dateCreated',
|
||||
$phids);
|
||||
|
||||
return mgroup($affiliations, 'getProjectPHID') + $default;
|
||||
|
|
|
@ -40,10 +40,6 @@ JX.behavior('projects-resource-editor', function(config) {
|
|||
tokenizer.addToken(data.phid, data.name);
|
||||
}
|
||||
|
||||
var status = JX.Prefab.renderSelect(
|
||||
{'' : 'Current', 'former' : 'Former'},
|
||||
data.status || '');
|
||||
|
||||
var role = JX.$N('input', {type: 'text', value : data.role || ''});
|
||||
|
||||
var ownership = JX.Prefab.renderSelect(
|
||||
|
@ -54,7 +50,6 @@ JX.behavior('projects-resource-editor', function(config) {
|
|||
var tokens = tokenizer.getTokens();
|
||||
return {
|
||||
phid : JX.keys(tokens)[0] || null,
|
||||
status : status.value,
|
||||
role : role.value,
|
||||
owner : ownership.value
|
||||
};
|
||||
|
@ -64,7 +59,6 @@ JX.behavior('projects-resource-editor', function(config) {
|
|||
r.push([null, JX.$N('label', {}, 'User:')]);
|
||||
r.push(['user-tokenizer', template]);
|
||||
r.push(['role-label', JX.$N('label', {}, 'Role:')]);
|
||||
r.push([null, status]);
|
||||
r.push(['role', role]);
|
||||
r.push([null, ownership]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue