Maniphest Tasks + Project Boards - some polish
Summary: Fixes T4550 by changing supportsFeed to shouldPublishFeedStory, so things can be more granular like that are with mail. Attempts to fix things generally too, filtering out xactions that have no business in feed, etc. Also return an updated Task HTML representation on drag and drop moves, etc. This is important so if the priority changes you can see it reflected in the UI. Test Plan: dragged tasks around. observed no feed stories on subpriority drags. observed feed stories and updated color bars on stories that changed priority Reviewers: epriestley, chad Reviewed By: epriestley CC: Korvin, epriestley, aran Maniphest Tasks: T4550 Differential Revision: https://secure.phabricator.com/D8399
This commit is contained in:
@@ -400,7 +400,9 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
|
|||||||
return PhabricatorEnv::getEnvConfig('metamta.conpherence.subject-prefix');
|
return PhabricatorEnv::getEnvConfig('metamta.conpherence.subject-prefix');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -785,7 +785,9 @@ final class DifferentialTransactionEditor
|
|||||||
return parent::requireCapabilities($object, $xaction);
|
return parent::requireCapabilities($object, $xaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ final class PhabricatorFileEditor
|
|||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,9 @@ final class LegalpadDocumentEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,9 @@ final class PhabricatorMacroEditor
|
|||||||
return PhabricatorEnv::getEnvConfig('metamta.macro.subject-prefix');
|
return PhabricatorEnv::getEnvConfig('metamta.macro.subject-prefix');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,19 +251,8 @@ final class ManiphestTransactionEditor
|
|||||||
PhabricatorLiskDAO $object,
|
PhabricatorLiskDAO $object,
|
||||||
array $xactions) {
|
array $xactions) {
|
||||||
|
|
||||||
$should_mail = true;
|
$xactions = mfilter($xactions, 'shouldHide', true);
|
||||||
if (count($xactions) == 1) {
|
return $xactions;
|
||||||
$xaction = head($xactions);
|
|
||||||
switch ($xaction->getTransactionType()) {
|
|
||||||
case ManiphestTransaction::TYPE_SUBPRIORITY:
|
|
||||||
$should_mail = false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$should_mail = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $should_mail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getMailSubjectPrefix() {
|
protected function getMailSubjectPrefix() {
|
||||||
@@ -318,8 +307,10 @@ final class ManiphestTransactionEditor
|
|||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
return true;
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
|
return $this->shouldSendMail($object, $xactions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsSearch() {
|
protected function supportsSearch() {
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ final class ManiphestTransaction
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return parent::shouldHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActionStrength() {
|
public function getActionStrength() {
|
||||||
|
|||||||
@@ -157,7 +157,9 @@ final class PhabricatorPasteEditor
|
|||||||
->addHeader('Thread-Topic', "P{$id}");
|
->addHeader('Thread-Topic', "P{$id}");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -402,7 +402,9 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
|||||||
return PhabricatorEnv::getEnvConfig('metamta.pholio.subject-prefix');
|
return PhabricatorEnv::getEnvConfig('metamta.pholio.subject-prefix');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
abstract class PonderEditor
|
abstract class PonderEditor
|
||||||
extends PhabricatorApplicationTransactionEditor {
|
extends PhabricatorApplicationTransactionEditor {
|
||||||
|
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,22 @@ final class PhabricatorProjectMoveController
|
|||||||
|
|
||||||
$editor->applyTransactions($object, $xactions);
|
$editor->applyTransactions($object, $xactions);
|
||||||
|
|
||||||
return id(new AphrontAjaxResponse())->setContent(array());
|
$owner = null;
|
||||||
}
|
if ($object->getOwnerPHID()) {
|
||||||
|
$owner = id(new PhabricatorHandleQuery())
|
||||||
|
->setViewer($viewer)
|
||||||
|
->withPHIDs(array($object->getOwnerPHID()))
|
||||||
|
->executeOne();
|
||||||
|
}
|
||||||
|
$card = id(new ProjectBoardTaskCard())
|
||||||
|
->setViewer($viewer)
|
||||||
|
->setTask($object)
|
||||||
|
->setOwner($owner)
|
||||||
|
->setCanEdit(true)
|
||||||
|
->getItem();
|
||||||
|
|
||||||
|
return id(new AphrontAjaxResponse())->setContent(
|
||||||
|
array('task' => $card));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||||||
->queueDocumentForIndexing($object->getPHID());
|
->queueDocumentForIndexing($object->getPHID());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->supportsFeed()) {
|
if ($this->shouldPublishFeedStory($object, $xactions)) {
|
||||||
$mailed = array();
|
$mailed = array();
|
||||||
if ($mail) {
|
if ($mail) {
|
||||||
$mailed = $mail->buildRecipientList();
|
$mailed = $mail->buildRecipientList();
|
||||||
@@ -1664,7 +1664,9 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||||||
/**
|
/**
|
||||||
* @task feed
|
* @task feed
|
||||||
*/
|
*/
|
||||||
protected function supportsFeed() {
|
protected function shouldPublishFeedStory(
|
||||||
|
PhabricatorLiskDAO $object,
|
||||||
|
array $xactions) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1729,6 +1731,7 @@ abstract class PhabricatorApplicationTransactionEditor
|
|||||||
array $xactions,
|
array $xactions,
|
||||||
array $mailed_phids) {
|
array $mailed_phids) {
|
||||||
|
|
||||||
|
$xactions = mfilter($xactions, 'shouldHideForFeed', true);
|
||||||
$related_phids = $this->getFeedRelatedPHIDs($object, $xactions);
|
$related_phids = $this->getFeedRelatedPHIDs($object, $xactions);
|
||||||
$subscribed_phids = $this->getFeedNotifyPHIDs($object, $xactions);
|
$subscribed_phids = $this->getFeedNotifyPHIDs($object, $xactions);
|
||||||
|
|
||||||
|
|||||||
@@ -354,6 +354,10 @@ abstract class PhabricatorApplicationTransaction
|
|||||||
return $this->shouldHide();
|
return $this->shouldHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function shouldHideForFeed() {
|
||||||
|
return $this->shouldHide();
|
||||||
|
}
|
||||||
|
|
||||||
public function getTitleForMail() {
|
public function getTitleForMail() {
|
||||||
return id(clone $this)->setRenderingTarget('text')->getTitle();
|
return id(clone $this)->setRenderingTarget('text')->getTitle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ JX.behavior('project-boards', function(config) {
|
|||||||
JX.DOM.alterClass(node, 'project-column-empty', !this.findItems().length);
|
JX.DOM.alterClass(node, 'project-column-empty', !this.findItems().length);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onresponse(response) {
|
function onresponse(response, item, list) {
|
||||||
|
list.unlock();
|
||||||
|
JX.DOM.alterClass(item, 'drag-sending', false);
|
||||||
|
JX.DOM.replace(item, JX.$H(response.task));
|
||||||
}
|
}
|
||||||
|
|
||||||
function ondrop(list, item, after, from) {
|
function ondrop(list, item, after, from) {
|
||||||
@@ -37,10 +39,7 @@ JX.behavior('project-boards', function(config) {
|
|||||||
|
|
||||||
var workflow = new JX.Workflow(config.moveURI, data)
|
var workflow = new JX.Workflow(config.moveURI, data)
|
||||||
.setHandler(function(response) {
|
.setHandler(function(response) {
|
||||||
onresponse(response);
|
onresponse(response, item, list);
|
||||||
list.unlock();
|
|
||||||
|
|
||||||
JX.DOM.alterClass(item, 'drag-sending', false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
workflow.start();
|
workflow.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user