mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Expose initially set values of Maniphest custom date field and point values when removing them
Summary: After removing or resetting a custom date field value or points value initially set at task creation there is no way to find and restore the previous value. As Phorge adds a transaction entry anyway, include the previous value in the transaction title. This makes it easier to revert an accidental removal of such data and is also more aligned with the behavior of other custom field types. Closes T15846 Test Plan: * Define a custom date field in Maniphest via http://phorge.localhost/config/edit/maniphest.custom-field-definitions/ and also enable http://phorge.localhost/config/edit/maniphest.points/ * Create a task with those fields set to non-custom values via a create task form which allows editing/changing these values * Edit the task and remove/reset the values of these custom fields * Look at the task and its transaction entries Reviewers: O1 Blessed Committers, avivey Reviewed By: O1 Blessed Committers, avivey Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15846 Differential Revision: https://we.phorge.it/D25678
This commit is contained in:
parent
1500a57090
commit
40720ab83d
2 changed files with 11 additions and 0 deletions
|
@ -33,6 +33,11 @@ final class ManiphestTaskPointsTransaction
|
|||
'%s set the point value for this task to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderNewValue());
|
||||
} else if ($new === null && $old !== null) {
|
||||
return pht(
|
||||
'%s removed the point value %s for this task.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderOldValue());
|
||||
} else if ($new === null) {
|
||||
return pht(
|
||||
'%s removed the point value for this task.',
|
||||
|
|
|
@ -177,6 +177,12 @@ final class PhabricatorStandardCustomFieldDate
|
|||
$xaction->renderHandleLink($author_phid),
|
||||
$this->getFieldName(),
|
||||
$new_date);
|
||||
} else if (!$new && $old) {
|
||||
return pht(
|
||||
'%s removed %s which was set to %s.',
|
||||
$xaction->renderHandleLink($author_phid),
|
||||
$this->getFieldName(),
|
||||
$old_date);
|
||||
} else if (!$new) {
|
||||
return pht(
|
||||
'%s removed %s.',
|
||||
|
|
Loading…
Reference in a new issue