Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15462298
D11259.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11259.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11259: Workboards - on edit, remove a task if no longer associated with workboard
Attached
Detach File
Event Timeline
Log In to Comment