From c26aaa6df3792bdae56355710c5a7522d6502d14 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Feb 2024 14:41:15 +0100 Subject: [PATCH 1/3] fix(notifications): Fix notification action label length with utf8 languages Signed-off-by: Joas Schilling --- lib/Notification/Notifier.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 79bc1f65ad5..e310cfffabe 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -795,10 +795,10 @@ protected function parseChatMessage(INotification $notification, Room $room, Par } if ($notification->getObjectType() === 'reminder') { - $notification = $this->addActionButton($notification, $l->t('View message')); + $notification = $this->addActionButton($notification, 'message_view', $l->t('View message')); $action = $notification->createAction(); - $action->setLabel($l->t('Dismiss reminder')) + $action->setLabel('reminder_dismiss') ->setParsedLabel($l->t('Dismiss reminder')) ->setLink( $this->urlGenerator->linkToOCSRouteAbsolute( @@ -814,7 +814,7 @@ protected function parseChatMessage(INotification $notification, Room $room, Par $notification->addParsedAction($action); } else { - $notification = $this->addActionButton($notification, $l->t('View chat'), false); + $notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'), false); } if ($richSubjectParameters['user'] === null) { @@ -897,9 +897,9 @@ protected function parseInvitation(INotification $notification, Room $room, IL10 if ($room->getType() === Room::TYPE_ONE_TO_ONE || $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER) { $subject = $l->t('{user} invited you to a private conversation'); if ($this->participantService->hasActiveSessionsInCall($room)) { - $notification = $this->addActionButton($notification, $l->t('Join call')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Join call')); } else { - $notification = $this->addActionButton($notification, $l->t('View chat'), false); + $notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'), false); } $notification @@ -923,9 +923,9 @@ protected function parseInvitation(INotification $notification, Room $room, IL10 } elseif (\in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { $subject = $l->t('{user} invited you to a group conversation: {call}'); if ($this->participantService->hasActiveSessionsInCall($room)) { - $notification = $this->addActionButton($notification, $l->t('Join call')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Join call')); } else { - $notification = $this->addActionButton($notification, $l->t('View chat'), false); + $notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'), false); } $notification @@ -973,10 +973,10 @@ protected function parseCall(INotification $notification, Room $room, IL10N $l): $userDisplayName = $this->userManager->getDisplayName($calleeId); if ($userDisplayName !== null) { if ($this->notificationManager->isPreparingPushNotification() || $this->participantService->hasActiveSessionsInCall($room)) { - $notification = $this->addActionButton($notification, $l->t('Answer call')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Answer call')); $subject = $l->t('{user} would like to talk with you'); } else { - $notification = $this->addActionButton($notification, $l->t('Call back')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Call back')); $subject = $l->t('You missed a call from {user}'); } @@ -1003,10 +1003,10 @@ protected function parseCall(INotification $notification, Room $room, IL10N $l): } } elseif (\in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { if ($this->notificationManager->isPreparingPushNotification() || $this->participantService->hasActiveSessionsInCall($room)) { - $notification = $this->addActionButton($notification, $l->t('Join call')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Join call')); $subject = $l->t('A group call has started in {call}'); } else { - $notification = $this->addActionButton($notification, $l->t('View chat'), false); + $notification = $this->addActionButton($notification, 'chat_view', $l->t('View chat'), false); $subject = $l->t('You missed a group call in {call}'); } @@ -1061,9 +1061,9 @@ protected function parsePasswordRequest(INotification $notification, Room $room, $callIsActive = $this->notificationManager->isPreparingPushNotification() || $this->participantService->hasActiveSessionsInCall($room); if ($callIsActive) { - $notification = $this->addActionButton($notification, $l->t('Answer call')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Answer call')); } else { - $notification = $this->addActionButton($notification, $l->t('Call back')); + $notification = $this->addActionButton($notification, 'call_view', $l->t('Call back')); } if ($share->getShareType() === IShare::TYPE_EMAIL) { @@ -1100,9 +1100,9 @@ protected function parsePasswordRequest(INotification $notification, Room $room, return $notification; } - protected function addActionButton(INotification $notification, string $label, bool $primary = true): INotification { + protected function addActionButton(INotification $notification, string $labelKey, string $label, bool $primary = true): INotification { $action = $notification->createAction(); - $action->setLabel($label) + $action->setLabel($labelKey) ->setParsedLabel($label) ->setLink($notification->getLink(), IAction::TYPE_WEB) ->setPrimary($primary); From 10c2959adb0c2cc3dd538a1bfc68081e8a101d30 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 22 Feb 2024 15:06:25 +0100 Subject: [PATCH 2/3] fix(CI): Rename psalm to match the required actions Signed-off-by: Joas Schilling --- .github/workflows/psalm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 645c1b53a17..8e7ffd0246b 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -15,7 +15,7 @@ jobs: static-analysis: runs-on: ubuntu-latest - name: Nextcloud + name: static-psalm-analysis steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 From 88dd21a216882a23b9a44bd00923adefe3f4d72e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 Feb 2024 12:20:26 +0100 Subject: [PATCH 3/3] fix(CI): Wait longer for MySQL Signed-off-by: Joas Schilling --- .github/workflows/integration-mysql.yml | 2 +- .github/workflows/phpunit-mysql.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-mysql.yml b/.github/workflows/integration-mysql.yml index 624cc98a2bd..fbc76a4615a 100644 --- a/.github/workflows/integration-mysql.yml +++ b/.github/workflows/integration-mysql.yml @@ -67,7 +67,7 @@ jobs: - 4444:3306/tcp env: MYSQL_ROOT_PASSWORD: rootpassword - options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5 + options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10 steps: - name: Set app env diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index c914acf9d5d..61b218c8dd3 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -60,7 +60,7 @@ jobs: - 4444:3306/tcp env: MYSQL_ROOT_PASSWORD: rootpassword - options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5 + options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10 steps: - name: Set app env