2014-03-26 22:40:47 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorProjectColumnTransaction
|
|
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
|
|
|
|
const TYPE_NAME = 'project:col:name';
|
|
|
|
const TYPE_STATUS = 'project:col:status';
|
Allow columns to have a point limit
Summary:
Fixes T5885. This implements optional soft point limits for workboard columns, per traditional Kanban.
- Allow columns to have a point limit set.
- When a column has a point limit, show it in the header.
- If a column has too many points in it, show the column and point count in red.
@chad, this could probably use some design tweaks. In particular:
- I changed the color of "hidden" columns to avoid confusion with "overfull" columns. We might be able to find a better color.
- UI hints for overfull columns might need adjustment.
(After T4427, we'll let you sum some custom field instead of total number of tasks, which is why this is called "points" rather than "number of tasks".)
Test Plan:
{F190914}
Note that:
- "Pre-planning" has a limit, so it shows "4/12".
- "Planning" has a limit and is overfull, so it shows "5 / 4".
- Other columns do not have limits.
- "Post-planning" is a hidden column. This might be too muted now.
Transactions:
{F190915}
Error messages / edit screen:
{F190916}
Reviewers: btrahan, chad
Reviewed By: btrahan
Subscribers: chad, epriestley
Maniphest Tasks: T5885
Differential Revision: https://secure.phabricator.com/D10276
2014-08-15 20:16:08 +02:00
|
|
|
const TYPE_LIMIT = 'project:col:limit';
|
2014-03-26 22:40:47 +01:00
|
|
|
|
|
|
|
public function getApplicationName() {
|
|
|
|
return 'project';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getApplicationTransactionType() {
|
2014-07-24 00:05:46 +02:00
|
|
|
return PhabricatorProjectColumnPHIDType::TYPECONST;
|
2014-03-26 22:40:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitle() {
|
|
|
|
$old = $this->getOldValue();
|
|
|
|
$new = $this->getNewValue();
|
|
|
|
$author_handle = $this->renderHandleLink($this->getAuthorPHID());
|
|
|
|
|
|
|
|
switch ($this->getTransactionType()) {
|
2015-05-13 22:50:28 +02:00
|
|
|
case self::TYPE_NAME:
|
2014-06-25 21:30:43 +02:00
|
|
|
if ($old === null) {
|
2014-03-26 22:40:47 +01:00
|
|
|
return pht(
|
|
|
|
'%s created this column.',
|
|
|
|
$author_handle);
|
|
|
|
} else {
|
2014-06-25 21:30:43 +02:00
|
|
|
if (!strlen($old)) {
|
|
|
|
return pht(
|
|
|
|
'%s named this column "%s".',
|
|
|
|
$author_handle,
|
|
|
|
$new);
|
|
|
|
} else if (strlen($new)) {
|
|
|
|
return pht(
|
|
|
|
'%s renamed this column from "%s" to "%s".',
|
|
|
|
$author_handle,
|
|
|
|
$old,
|
|
|
|
$new);
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s removed the custom name of this column.',
|
|
|
|
$author_handle);
|
|
|
|
}
|
2014-03-26 22:40:47 +01:00
|
|
|
}
|
2015-05-13 22:50:28 +02:00
|
|
|
case self::TYPE_LIMIT:
|
Allow columns to have a point limit
Summary:
Fixes T5885. This implements optional soft point limits for workboard columns, per traditional Kanban.
- Allow columns to have a point limit set.
- When a column has a point limit, show it in the header.
- If a column has too many points in it, show the column and point count in red.
@chad, this could probably use some design tweaks. In particular:
- I changed the color of "hidden" columns to avoid confusion with "overfull" columns. We might be able to find a better color.
- UI hints for overfull columns might need adjustment.
(After T4427, we'll let you sum some custom field instead of total number of tasks, which is why this is called "points" rather than "number of tasks".)
Test Plan:
{F190914}
Note that:
- "Pre-planning" has a limit, so it shows "4/12".
- "Planning" has a limit and is overfull, so it shows "5 / 4".
- Other columns do not have limits.
- "Post-planning" is a hidden column. This might be too muted now.
Transactions:
{F190915}
Error messages / edit screen:
{F190916}
Reviewers: btrahan, chad
Reviewed By: btrahan
Subscribers: chad, epriestley
Maniphest Tasks: T5885
Differential Revision: https://secure.phabricator.com/D10276
2014-08-15 20:16:08 +02:00
|
|
|
if (!$old) {
|
|
|
|
return pht(
|
|
|
|
'%s set the point limit for this column to %s.',
|
|
|
|
$author_handle,
|
|
|
|
$new);
|
|
|
|
} else if (!$new) {
|
|
|
|
return pht(
|
|
|
|
'%s removed the point limit for this column.',
|
|
|
|
$author_handle);
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s changed point limit for this column from %s to %s.',
|
|
|
|
$author_handle,
|
|
|
|
$old,
|
|
|
|
$new);
|
|
|
|
}
|
|
|
|
|
2015-05-13 22:50:28 +02:00
|
|
|
case self::TYPE_STATUS:
|
2014-03-26 22:40:47 +01:00
|
|
|
switch ($new) {
|
|
|
|
case PhabricatorProjectColumn::STATUS_ACTIVE:
|
|
|
|
return pht(
|
2014-06-25 21:30:20 +02:00
|
|
|
'%s marked this column visible.',
|
2014-03-26 22:40:47 +01:00
|
|
|
$author_handle);
|
2014-06-25 21:30:20 +02:00
|
|
|
case PhabricatorProjectColumn::STATUS_HIDDEN:
|
2014-03-26 22:40:47 +01:00
|
|
|
return pht(
|
2014-06-25 21:30:20 +02:00
|
|
|
'%s marked this column hidden.',
|
2014-03-26 22:40:47 +01:00
|
|
|
$author_handle);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent::getTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|