mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-14 16:51:08 +01:00
Include "Add CCs" and "Remove CCs" to batch editor
Summary: Ref T2756 ... didn't update celerity map, I'm on windows :) Test Plan: Add CCs, Remove CCs, make sure everything else works. Reviewers: epriestley CC: aran, Korvin Maniphest Tasks: T2756 Differential Revision: https://secure.phabricator.com/D5589
This commit is contained in:
parent
f2828481aa
commit
52e9e5b2aa
2 changed files with 33 additions and 2 deletions
|
@ -67,6 +67,10 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
'placeholder' => pht('Type a user name...'),
|
||||
'limit' => 1,
|
||||
),
|
||||
'cc' => array(
|
||||
'src' => '/typeahead/common/mailable/',
|
||||
'placeholder' => pht('Type a user name...'),
|
||||
)
|
||||
),
|
||||
'input' => 'batch-form-actions',
|
||||
'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(),
|
||||
|
@ -142,11 +146,15 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
'priority' => ManiphestTransactionType::TYPE_PRIORITY,
|
||||
'add_project' => ManiphestTransactionType::TYPE_PROJECTS,
|
||||
'remove_project' => ManiphestTransactionType::TYPE_PROJECTS,
|
||||
'add_ccs' => ManiphestTransactionType::TYPE_CCS,
|
||||
'remove_ccs' => ManiphestTransactionType::TYPE_CCS,
|
||||
);
|
||||
|
||||
$edge_edit_types = array(
|
||||
'add_project' => true,
|
||||
'remove_project' => true,
|
||||
'add_ccs' => true,
|
||||
'remove_ccs' => true,
|
||||
);
|
||||
|
||||
$xactions = array();
|
||||
|
@ -182,6 +190,9 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
case ManiphestTransactionType::TYPE_PROJECTS:
|
||||
$current = $task->getProjectPHIDs();
|
||||
break;
|
||||
case ManiphestTransactionType::TYPE_CCS:
|
||||
$current = $task->getCCPHIDs();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,6 +221,11 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
continue 2;
|
||||
}
|
||||
break;
|
||||
case ManiphestTransactionType::TYPE_CCS:
|
||||
if (empty($value)) {
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// If the edit doesn't change anything, go to the next action. This
|
||||
|
@ -233,7 +249,12 @@ final class ManiphestBatchEditController extends ManiphestController {
|
|||
}
|
||||
break;
|
||||
case ManiphestTransactionType::TYPE_PROJECTS:
|
||||
$is_remove = ($action['action'] == 'remove_project');
|
||||
case ManiphestTransactionType::TYPE_CCS:
|
||||
$remove_actions = array(
|
||||
'remove_project' => true,
|
||||
'remove_ccs' => true,
|
||||
);
|
||||
$is_remove = isset($remove_actions[$action['action']]);
|
||||
|
||||
$current = array_fill_keys($current, true);
|
||||
$value = array_fill_keys($value, true);
|
||||
|
|
|
@ -26,11 +26,14 @@ JX.behavior('maniphest-batch-editor', function(config) {
|
|||
'priority': 'Change Priority',
|
||||
'status': 'Open / Close',
|
||||
'add_comment': 'Comment',
|
||||
'assign': 'Assign'
|
||||
'assign': 'Assign',
|
||||
'add_ccs' : 'Add CCs',
|
||||
'remove_ccs' : 'Remove CCs'
|
||||
});
|
||||
|
||||
var proj_tokenizer = build_tokenizer(config.sources.project);
|
||||
var owner_tokenizer = build_tokenizer(config.sources.owner);
|
||||
var cc_tokenizer = build_tokenizer(config.sources.cc);
|
||||
|
||||
var priority_select = JX.Prefab.renderSelect(config.priorityMap);
|
||||
var status_select = JX.Prefab.renderSelect(config.statusMap);
|
||||
|
@ -48,6 +51,13 @@ JX.behavior('maniphest-batch-editor', function(config) {
|
|||
return JX.keys(proj_tokenizer.object.getTokens());
|
||||
};
|
||||
break;
|
||||
case 'add_ccs':
|
||||
case 'remove_ccs':
|
||||
JX.DOM.setContent(cell, cc_tokenizer.template);
|
||||
vfunc = function() {
|
||||
return JX.keys(cc_tokenizer.object.getTokens());
|
||||
};
|
||||
break;
|
||||
case 'assign':
|
||||
JX.DOM.setContent(cell, owner_tokenizer.template);
|
||||
vfunc = function() {
|
||||
|
|
Loading…
Reference in a new issue