Compare commits
5 Commits
v1.6.0
...
stable-0.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8334a410cd | ||
|
|
88aec57200 | ||
|
|
7bf903f586 | ||
|
|
9550c2eb2f | ||
|
|
12fb5f0a1f |
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,6 +1,23 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 0.7.0 - 2019-08-20
|
||||
|
||||
## Added
|
||||
- Make deck compatible to Nextcloud 17
|
||||
- Allow to set the description when creating cards though the REST API
|
||||
|
||||
## 0.6.6 - 2019-08-01
|
||||
|
||||
### Fixed
|
||||
- Bump security related dependencies
|
||||
|
||||
## 0.6.5 - 2019-07-28
|
||||
|
||||
### Fixed
|
||||
- Fix attachment upload/delete failures
|
||||
- Bump dependencies
|
||||
|
||||
## 0.6.4 - 2019-06-30
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -88,13 +88,8 @@ class UserExport extends Command {
|
||||
|
||||
$userId = $input->getArgument('user-id');
|
||||
|
||||
$groups = $this->groupManager->getUserGroupIds(
|
||||
$this->userManager->get($userId)
|
||||
);
|
||||
$boards = $this->boardService->findAll([
|
||||
'user' => $userId,
|
||||
'groups' => $groups
|
||||
]);
|
||||
$this->boardService->setUserId($userId);
|
||||
$boards = $this->boardService->findAll();
|
||||
|
||||
$data = [];
|
||||
foreach ($boards as $board) {
|
||||
|
||||
@@ -27,6 +27,8 @@ use OC\BackgroundJob\Job;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Notification\NotificationHelper;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\ILogger;
|
||||
|
||||
class ScheduledNotifications extends Job {
|
||||
|
||||
@@ -34,13 +36,17 @@ class ScheduledNotifications extends Job {
|
||||
protected $cardMapper;
|
||||
/** @var NotificationHelper */
|
||||
protected $notificationHelper;
|
||||
/** @var ILogger */
|
||||
protected $logger;
|
||||
|
||||
public function __construct(
|
||||
CardMapper $cardMapper,
|
||||
NotificationHelper $notificationHelper
|
||||
NotificationHelper $notificationHelper,
|
||||
ILogger $logger
|
||||
) {
|
||||
$this->cardMapper = $cardMapper;
|
||||
$this->notificationHelper = $notificationHelper;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,8 +58,13 @@ class ScheduledNotifications extends Job {
|
||||
$cards = $this->cardMapper->findOverdue();
|
||||
/** @var Card $card */
|
||||
foreach ($cards as $card) {
|
||||
$this->notificationHelper->sendCardDuedate($card);
|
||||
try {
|
||||
$this->notificationHelper->sendCardDuedate($card);
|
||||
} catch (DoesNotExistException $e) {
|
||||
// Skip if any error occurs
|
||||
$this->logger->debug('Could not create overdue notification for card with id ' . $card->getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ class NotificationHelper {
|
||||
$this->currentUser = $userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $card
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException
|
||||
*/
|
||||
public function sendCardDuedate($card) {
|
||||
// check if notification has already been sent
|
||||
// ideally notifications should not be deleted once seen by the user so we can
|
||||
|
||||
@@ -98,6 +98,15 @@ class BoardService {
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a different user than the current one, e.g. when no user is available in occ
|
||||
*
|
||||
* @param string $userId
|
||||
*/
|
||||
public function setUserId(string $userId): void {
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -89,28 +89,12 @@ class UserExportTest extends \Test\TestCase {
|
||||
$input->expects($this->once())->method('getArgument')->with('user-id')->willReturn('admin');
|
||||
$output = $this->createMock(OutputInterface::class);
|
||||
|
||||
$user = $this->createMock(IUser::class);
|
||||
$this->userManager->expects($this->once())
|
||||
->method('get')
|
||||
->with('admin')
|
||||
->willReturn($user);
|
||||
|
||||
$groups = [];
|
||||
$this->groupManager->expects($this->once())
|
||||
->method('getUserGroupIds')
|
||||
->with($user)
|
||||
->willReturn($groups);
|
||||
|
||||
$boards = [
|
||||
$this->getBoard(1),
|
||||
$this->getBoard(2),
|
||||
];
|
||||
$this->boardService->expects($this->once())
|
||||
->method('findAll')
|
||||
->with([
|
||||
'user' => 'admin',
|
||||
'groups' => $groups
|
||||
])
|
||||
->willReturn($boards);
|
||||
$this->boardMapper->expects($this->exactly(count($boards)))
|
||||
->method('find')
|
||||
|
||||
@@ -28,6 +28,7 @@ use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Notification\NotificationHelper;
|
||||
use OCP\ILogger;
|
||||
|
||||
class ScheduledNoificationsTest extends \Test\TestCase {
|
||||
|
||||
@@ -35,6 +36,8 @@ class ScheduledNoificationsTest extends \Test\TestCase {
|
||||
protected $cardMapper;
|
||||
/** @var NotificationHelper|\PHPUnit\Framework\MockObject\MockObject */
|
||||
protected $notificationHelper;
|
||||
/** @var ILogger|\PHPUnit\Framework\MockObject\MockObject */
|
||||
protected $logger;
|
||||
/** @var ScheduledNotifications */
|
||||
protected $scheduledNotifications;
|
||||
|
||||
@@ -42,7 +45,8 @@ class ScheduledNoificationsTest extends \Test\TestCase {
|
||||
parent::setUp();
|
||||
$this->cardMapper = $this->createMock(CardMapper::class);
|
||||
$this->notificationHelper = $this->createMock(NotificationHelper::class);
|
||||
$this->scheduledNotifications = new ScheduledNotifications($this->cardMapper, $this->notificationHelper);
|
||||
$this->logger = $this->createMock(ILogger::class);
|
||||
$this->scheduledNotifications = new ScheduledNotifications($this->cardMapper, $this->notificationHelper, $this->logger);
|
||||
}
|
||||
|
||||
public function testDeleteCron() {
|
||||
|
||||
Reference in New Issue
Block a user