Page MenuHomePhabricator

D11259.id.diff
No OneTemporary

D11259.id.diff

diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -383,6 +383,17 @@
return new Aphront404Response();
}
+ // re-load projects for accuracy as they are not re-loaded via
+ // the editor
+ $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
+ $task->getPHID(),
+ PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);
+ $task->attachProjectPHIDs($project_phids);
+ $remove_from_board = false;
+ if (!in_array($column->getProjectPHID(), $project_phids)) {
+ $remove_from_board = true;
+ }
+
$positions = id(new PhabricatorProjectColumnPositionQuery())
->setViewer($user)
->withColumns(array($column))
@@ -397,7 +408,7 @@
if ($order == PhabricatorProjectColumn::ORDER_NATURAL) {
// TODO: This is a little bit awkward, because PHP and JS use
// slightly different sort order parameters to achieve the same
- // effect. It would be unify this a bit at some point.
+ // effect. It would be good to unify this a bit at some point.
$sort_map = array();
foreach ($positions as $position) {
$sort_map[$position->getObjectPHID()] = array(
@@ -414,6 +425,7 @@
$data = array(
'sortMap' => $sort_map,
+ 'removeFromBoard' => $remove_from_board,
);
break;
case 'task':
diff --git a/webroot/rsrc/js/application/projects/behavior-project-boards.js b/webroot/rsrc/js/application/projects/behavior-project-boards.js
--- a/webroot/rsrc/js/application/projects/behavior-project-boards.js
+++ b/webroot/rsrc/js/application/projects/behavior-project-boards.js
@@ -204,6 +204,7 @@
var new_data = JX.Stratcom.getData(new_card);
var items = finditems(column);
var edited = false;
+ var remove_index = null;
for (var ii = 0; ii < items.length; ii++) {
var item = items[ii];
@@ -212,6 +213,9 @@
var phid = data.objectPHID;
if (phid == new_data.objectPHID) {
+ if (r.data.removeFromBoard) {
+ remove_index = ii;
+ }
items[ii] = new_card;
data = new_data;
edited = true;
@@ -226,6 +230,10 @@
new_data.sort = r.data.sortMap[new_data.objectPHID] || new_data.sort;
}
+ if (remove_index !== null) {
+ items.splice(remove_index, 1);
+ }
+
items.sort(colsort);
JX.DOM.setContent(column, items);

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 2, 1:48 PM (3 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7723450
Default Alt Text
D11259.id.diff (2 KB)

Event Timeline