Skip to content

Commit

Permalink
fix: Proper rich object formats
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr committed Jan 2, 2025
1 parent bdaf28e commit 59fa3cd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/Activity/DeckProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function parse($language, IEvent $event, ?IEvent $previousEvent = null):
}
$board = [
'type' => 'highlight',
'id' => $event->getObjectId(),
'id' => (string)$event->getObjectId(),
'name' => $event->getObjectName(),
'link' => $this->deckUrl('/board/' . $event->getObjectId()),
];
Expand All @@ -126,7 +126,7 @@ public function parse($language, IEvent $event, ?IEvent $previousEvent = null):
}
$card = [
'type' => 'highlight',
'id' => $event->getObjectId(),
'id' => (string)$event->getObjectId(),
'name' => $event->getObjectName(),
];

Expand Down Expand Up @@ -213,7 +213,7 @@ private function parseParamForBoard($paramName, $subjectParams, $params) {
if (array_key_exists($paramName, $subjectParams)) {
$params[$paramName] = [
'type' => 'highlight',
'id' => $subjectParams[$paramName]['id'],
'id' => (string)$subjectParams[$paramName]['id'],
'name' => $subjectParams[$paramName]['title'],
'link' => $this->deckUrl('/board/' . $subjectParams[$paramName]['id'] . '/'),
];
Expand All @@ -224,7 +224,7 @@ private function parseParamForStack($paramName, $subjectParams, $params) {
if (array_key_exists($paramName, $subjectParams)) {
$params[$paramName] = [
'type' => 'highlight',
'id' => $subjectParams[$paramName]['id'],
'id' => (string)$subjectParams[$paramName]['id'],
'name' => $subjectParams[$paramName]['title'],
];
}
Expand All @@ -235,7 +235,7 @@ private function parseParamForAttachment($paramName, $subjectParams, $params) {
if (array_key_exists($paramName, $subjectParams)) {
$params[$paramName] = [
'type' => 'highlight',
'id' => $subjectParams[$paramName]['id'],
'id' => (string)$subjectParams[$paramName]['id'],
'name' => $subjectParams[$paramName]['data'],
'link' => $this->urlGenerator->linkToRoute('deck.attachment.display', ['cardId' => $subjectParams['card']['id'], 'attachmentId' => $subjectParams['attachment']['id']]),
];
Expand All @@ -259,7 +259,7 @@ private function parseParamForLabel($subjectParams, $params) {
if (array_key_exists('label', $subjectParams)) {
$params['label'] = [
'type' => 'highlight',
'id' => $subjectParams['label']['id'],
'id' => (string)$subjectParams['label']['id'],
'name' => $subjectParams['label']['title']
];
}
Expand All @@ -278,7 +278,7 @@ private function parseParamForAcl($subjectParams, $params) {
} else {
$params['acl'] = [
'type' => 'highlight',
'id' => $subjectParams['acl']['participant'],
'id' => (string)$subjectParams['acl']['participant'],
'name' => $subjectParams['acl']['participant']
];
}
Expand All @@ -294,7 +294,7 @@ private function parseParamForComment($subjectParams, $params, IEvent $event) {
$event->setParsedMessage($comment->getMessage());
$params['comment'] = [
'type' => 'highlight',
'id' => $subjectParams['comment'],
'id' => (string)$subjectParams['comment'],
'name' => $comment->getMessage()
];
} catch (NotFoundException $e) {
Expand Down Expand Up @@ -343,22 +343,22 @@ private function parseParamForChanges($subjectParams, $params, $event) {
if (array_key_exists('before', $subjectParams)) {
$params['before'] = [
'type' => 'highlight',
'id' => $subjectParams['before'],
'name' => $subjectParams['before']
'id' => (string)$subjectParams['before'],
'name' => $subjectParams['before'] ?? ''
];
}
if (array_key_exists('after', $subjectParams)) {
$params['after'] = [
'type' => 'highlight',
'id' => $subjectParams['after'],
'name' => $subjectParams['after']
'id' => (string)$subjectParams['after'],
'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']
'id' => (string)$subjectParams['after'],
'name' => $subjectParams['after'] ?? ''
];
}
return $params;
Expand Down

0 comments on commit 59fa3cd

Please sign in to comment.