Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Proper rich object formats #6641

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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