mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-15 01:01:09 +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...'),
|
'placeholder' => pht('Type a user name...'),
|
||||||
'limit' => 1,
|
'limit' => 1,
|
||||||
),
|
),
|
||||||
|
'cc' => array(
|
||||||
|
'src' => '/typeahead/common/mailable/',
|
||||||
|
'placeholder' => pht('Type a user name...'),
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'input' => 'batch-form-actions',
|
'input' => 'batch-form-actions',
|
||||||
'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(),
|
'priorityMap' => ManiphestTaskPriority::getTaskPriorityMap(),
|
||||||
|
@ -142,11 +146,15 @@ final class ManiphestBatchEditController extends ManiphestController {
|
||||||
'priority' => ManiphestTransactionType::TYPE_PRIORITY,
|
'priority' => ManiphestTransactionType::TYPE_PRIORITY,
|
||||||
'add_project' => ManiphestTransactionType::TYPE_PROJECTS,
|
'add_project' => ManiphestTransactionType::TYPE_PROJECTS,
|
||||||
'remove_project' => ManiphestTransactionType::TYPE_PROJECTS,
|
'remove_project' => ManiphestTransactionType::TYPE_PROJECTS,
|
||||||
|
'add_ccs' => ManiphestTransactionType::TYPE_CCS,
|
||||||
|
'remove_ccs' => ManiphestTransactionType::TYPE_CCS,
|
||||||
);
|
);
|
||||||
|
|
||||||
$edge_edit_types = array(
|
$edge_edit_types = array(
|
||||||
'add_project' => true,
|
'add_project' => true,
|
||||||
'remove_project' => true,
|
'remove_project' => true,
|
||||||
|
'add_ccs' => true,
|
||||||
|
'remove_ccs' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
$xactions = array();
|
$xactions = array();
|
||||||
|
@ -182,6 +190,9 @@ final class ManiphestBatchEditController extends ManiphestController {
|
||||||
case ManiphestTransactionType::TYPE_PROJECTS:
|
case ManiphestTransactionType::TYPE_PROJECTS:
|
||||||
$current = $task->getProjectPHIDs();
|
$current = $task->getProjectPHIDs();
|
||||||
break;
|
break;
|
||||||
|
case ManiphestTransactionType::TYPE_CCS:
|
||||||
|
$current = $task->getCCPHIDs();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,6 +221,11 @@ final class ManiphestBatchEditController extends ManiphestController {
|
||||||
continue 2;
|
continue 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ManiphestTransactionType::TYPE_CCS:
|
||||||
|
if (empty($value)) {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the edit doesn't change anything, go to the next action. This
|
// If the edit doesn't change anything, go to the next action. This
|
||||||
|
@ -233,7 +249,12 @@ final class ManiphestBatchEditController extends ManiphestController {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ManiphestTransactionType::TYPE_PROJECTS:
|
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);
|
$current = array_fill_keys($current, true);
|
||||||
$value = array_fill_keys($value, true);
|
$value = array_fill_keys($value, true);
|
||||||
|
|
|
@ -26,11 +26,14 @@ JX.behavior('maniphest-batch-editor', function(config) {
|
||||||
'priority': 'Change Priority',
|
'priority': 'Change Priority',
|
||||||
'status': 'Open / Close',
|
'status': 'Open / Close',
|
||||||
'add_comment': 'Comment',
|
'add_comment': 'Comment',
|
||||||
'assign': 'Assign'
|
'assign': 'Assign',
|
||||||
|
'add_ccs' : 'Add CCs',
|
||||||
|
'remove_ccs' : 'Remove CCs'
|
||||||
});
|
});
|
||||||
|
|
||||||
var proj_tokenizer = build_tokenizer(config.sources.project);
|
var proj_tokenizer = build_tokenizer(config.sources.project);
|
||||||
var owner_tokenizer = build_tokenizer(config.sources.owner);
|
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 priority_select = JX.Prefab.renderSelect(config.priorityMap);
|
||||||
var status_select = JX.Prefab.renderSelect(config.statusMap);
|
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());
|
return JX.keys(proj_tokenizer.object.getTokens());
|
||||||
};
|
};
|
||||||
break;
|
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':
|
case 'assign':
|
||||||
JX.DOM.setContent(cell, owner_tokenizer.template);
|
JX.DOM.setContent(cell, owner_tokenizer.template);
|
||||||
vfunc = function() {
|
vfunc = function() {
|
||||||
|
|
Loading…
Reference in a new issue