1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

In "Move task to..." workflow, separate visible and hidden columns in the dropdown

Summary:
Ref T13368. Currently, both visible and hidden columns are shown in the "Move tasks to..." dropdown on workflows from workboards.

When the dropdown contains hidden columns, move them to a separate section to make it clear that they're not likely targets.

Test Plan:
  - Used "Move tasks to project..." targeting a board with no hidden columns. Saw a single ungrouped dropdown.
  - Used "Move tasks to project..." targeting a board with hidden columns. Saw a dropdown grouped into "Visible" and "Hidden" columns.

Maniphest Tasks: T13368

Differential Revision: https://secure.phabricator.com/D20700
This commit is contained in:
epriestley 2019-08-07 09:04:36 -07:00
parent 6deac35659
commit 0561043a1f

View file

@ -219,12 +219,40 @@ final class PhabricatorProjectColumnBulkMoveController
->setValue($dst_project->getDisplayName()));
}
$column_options = array(
'visible' => array(),
'hidden' => array(),
);
$any_hidden = false;
foreach ($dst_columns as $column) {
if (!$column->isHidden()) {
$group = 'visible';
} else {
$group = 'hidden';
}
$phid = $column->getPHID();
$display_name = $column->getDisplayName();
$column_options[$group][$phid] = $display_name;
}
if ($column_options['hidden']) {
$column_options = array(
pht('Visible Columns') => $column_options['visible'],
pht('Hidden Columns') => $column_options['hidden'],
);
} else {
$column_options = $column_options['visible'];
}
$form->appendControl(
id(new AphrontFormSelectControl())
->setName('dstColumnPHID')
->setLabel(pht('Move to Column'))
->setValue($dst_column_phid)
->setOptions(mpull($dst_columns, 'getDisplayName', 'getPHID')));
id(new AphrontFormSelectControl())
->setName('dstColumnPHID')
->setLabel(pht('Move to Column'))
->setValue($dst_column_phid)
->setOptions($column_options));
$submit = pht('Move Tasks');