From d082e3f805b1e9114427e27644a9d2eeddeb1f5b Mon Sep 17 00:00:00 2001 From: "alexandru.puiu" Date: Mon, 26 Aug 2019 18:00:19 +0300 Subject: [PATCH 1/2] Solving timeline small bugs. Signed-off-by: alexandru.puiu --- lib/Activity/ActivityManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 641c34a7a..65bec4aee 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -2,6 +2,8 @@ /** * @copyright Copyright (c) 2018 Julius Härtl * + * @copyright Copyright (c) 2019 Alexandru Puiu + * * @author Julius Härtl * * @license GNU AGPL version 3 or any later version @@ -177,7 +179,7 @@ class ActivityManager { $subject = $ownActivity ? $this->l10n->t('You have deleted card {card} in stack {stack} on board {board}') : $this->l10n->t('{user} has deleted card {card} in stack {stack} on board {board}'); break; case self::SUBJECT_CARD_UPDATE_TITLE: - $subject = $ownActivity ? $this->l10n->t('You have renamed the card {before} to {card}') : $this->l10n->t('{user} has renamed the card {before} to {card}'); + $subject = $ownActivity ? $this->l10n->t('You have renamed the card {before} to {after}') : $this->l10n->t('{user} has renamed the card {before} to {after}'); break; case self::SUBJECT_CARD_UPDATE_DESCRIPTION: if (!isset($subjectParams['before'])) { @@ -384,6 +386,7 @@ class ActivityManager { } if ($subject === self::SUBJECT_CARD_UPDATE_STACKID) { $subjectParams['stackBefore'] = $this->stackMapper->find($additionalParams['before']); + $subjectParams['stack'] = $this->stackMapper->find($additionalParams['after']); } $subjectParams['author'] = $this->userId; From d6b0155e9dab162115152ca60aa7b030bfa6dfa8 Mon Sep 17 00:00:00 2001 From: "alexandru.puiu" Date: Tue, 27 Aug 2019 10:43:14 +0300 Subject: [PATCH 2/2] Probably a better method to solve the update card title issue. Signed-off-by: alexandru.puiu --- lib/Activity/ActivityManager.php | 2 +- lib/Activity/DeckProvider.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 65bec4aee..00f1be644 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -179,7 +179,7 @@ class ActivityManager { $subject = $ownActivity ? $this->l10n->t('You have deleted card {card} in stack {stack} on board {board}') : $this->l10n->t('{user} has deleted card {card} in stack {stack} on board {board}'); break; case self::SUBJECT_CARD_UPDATE_TITLE: - $subject = $ownActivity ? $this->l10n->t('You have renamed the card {before} to {after}') : $this->l10n->t('{user} has renamed the card {before} to {after}'); + $subject = $ownActivity ? $this->l10n->t('You have renamed the card {before} to {card}') : $this->l10n->t('{user} has renamed the card {before} to {card}'); break; case self::SUBJECT_CARD_UPDATE_DESCRIPTION: if (!isset($subjectParams['before'])) { diff --git a/lib/Activity/DeckProvider.php b/lib/Activity/DeckProvider.php index 1efefdd27..85ec53bb0 100644 --- a/lib/Activity/DeckProvider.php +++ b/lib/Activity/DeckProvider.php @@ -2,6 +2,8 @@ /** * @copyright Copyright (c) 2018 Julius Härtl * + * @copyright Copyright (c) 2019 Alexandru Puiu + * * @author Julius Härtl * * @license GNU AGPL version 3 or any later version @@ -342,6 +344,13 @@ class DeckProvider implements IProvider { 'name' => $subjectParams['after'] ]; } + if (array_key_exists('card', $subjectParams) && $event->getSubject() === ActivityManager::SUBJECT_CARD_UPDATE_TITLE) { + $params['card'] = [ + 'type' => 'highlight', + 'id' => $subjectParams['after'], + 'name' => $subjectParams['after'] + ]; + } return $params; }