Skip to content

Commit

Permalink
Merge pull request #5438 from nextcloud/backport/5354/stable27
Browse files Browse the repository at this point in the history
[stable27] fix: allow null label colors in trello json importer
  • Loading branch information
juliusknorr authored Jan 9, 2024
2 parents 26a03c3 + b7d624c commit 0ef2041
Show file tree
Hide file tree
Showing 55 changed files with 194 additions and 179 deletions.
8 changes: 4 additions & 4 deletions lib/Activity/ActivityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\Comments\IComment;
use OCP\IUser;
use OCP\Server;
use OCP\L10N\IFactory;
use OCP\Server;
use Psr\Log\LoggerInterface;

class ActivityManager {
Expand Down Expand Up @@ -332,8 +332,8 @@ private function createEvent($objectType, $entity, $subject, $additionalParams =
case self::SUBJECT_BOARD_UPDATE_ARCHIVED:
case self::SUBJECT_BOARD_DELETE:
case self::SUBJECT_BOARD_RESTORE:
// Not defined as there is no activity for
// case self::SUBJECT_BOARD_UPDATE_COLOR
// Not defined as there is no activity for
// case self::SUBJECT_BOARD_UPDATE_COLOR
break;
case self::SUBJECT_CARD_COMMENT_CREATE:
$eventType = 'deck_comment';
Expand Down Expand Up @@ -374,7 +374,7 @@ private function createEvent($objectType, $entity, $subject, $additionalParams =
$additionalParams['before'] = $additionalParams['before']->format('c');
}

break;
break;
case self::SUBJECT_ATTACHMENT_CREATE:
case self::SUBJECT_ATTACHMENT_UPDATE:
case self::SUBJECT_ATTACHMENT_DELETE:
Expand Down
2 changes: 1 addition & 1 deletion lib/Activity/CommentEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OCA\Deck\Activity;

use \OCP\Comments\ICommentsEventHandler;
use OCA\Deck\Db\CardMapper;
use OCA\Deck\Db\ChangeHelper;
use OCA\Deck\Notification\NotificationHelper;
use OCP\Comments\CommentsEvent;
use OCP\Comments\IComment;
use \OCP\Comments\ICommentsEventHandler;

class CommentEventHandler implements ICommentsEventHandler {

Expand Down
2 changes: 1 addition & 1 deletion lib/Activity/DeckProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
namespace OCA\Deck\Activity;

use OCA\Deck\Db\Acl;
use OCA\Deck\Service\CardService;
use OCP\Activity\IEvent;
use OCP\Activity\IProvider;
use OCP\Comments\IComment;
Expand All @@ -35,7 +36,6 @@
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCA\Deck\Service\CardService;

class DeckProvider implements IProvider {

Expand Down
4 changes: 2 additions & 2 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
use OCA\Deck\Event\SessionClosedEvent;
use OCA\Deck\Event\SessionCreatedEvent;
use OCA\Deck\Listeners\BeforeTemplateRenderedListener;
use OCA\Deck\Listeners\ParticipantCleanupListener;
use OCA\Deck\Listeners\FullTextSearchEventListener;
use OCA\Deck\Listeners\LiveUpdateListener;
use OCA\Deck\Listeners\ParticipantCleanupListener;
use OCA\Deck\Listeners\ResourceAdditionalScriptsListener;
use OCA\Deck\Listeners\ResourceListener;
use OCA\Deck\Listeners\LiveUpdateListener;
use OCA\Deck\Middleware\DefaultBoardMiddleware;
use OCA\Deck\Middleware\ExceptionMiddleware;
use OCA\Deck\Notification\Notifier;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/AttachmentApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
*/
namespace OCA\Deck\Controller;

use OCA\Deck\Service\AttachmentService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCA\Deck\Service\AttachmentService;

class AttachmentApiController extends ApiController {
private $attachmentService;
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/BoardApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
namespace OCA\Deck\Controller;

use OCA\Deck\Db\Board;
use OCA\Deck\Service\BoardService;
use OCA\Deck\StatusException;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;

use OCA\Deck\Service\BoardService;
use OCP\IRequest;
use Sabre\HTTP\Util;

/**
Expand Down
28 changes: 14 additions & 14 deletions lib/Controller/CardApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
*
*/

namespace OCA\Deck\Controller;

use OCA\Deck\Service\AssignmentService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCA\Deck\Service\CardService;

/**
* Class BoardApiController
*
* @package OCA\Deck\Controller
*/
namespace OCA\Deck\Controller;

use OCA\Deck\Service\AssignmentService;
use OCA\Deck\Service\CardService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;

/**
* Class BoardApiController
*
* @package OCA\Deck\Controller
*/
class CardApiController extends ApiController {
private $cardService;
private $userId;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/CardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

use OCA\Deck\Service\AssignmentService;
use OCA\Deck\Service\CardService;
use OCP\IRequest;
use OCP\AppFramework\Controller;
use OCP\IRequest;

class CardController extends Controller {
private $userId;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
$AppName,
IRequest $request,
ConfigService $configService
) {
) {
parent::__construct($AppName, $request);

$this->configService = $configService;
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/LabelApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

namespace OCA\Deck\Controller;

use OCA\Deck\Service\LabelService;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCA\Deck\Service\LabelService;

/**
* Class BoardApiController
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/LabelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
namespace OCA\Deck\Controller;

use OCA\Deck\Service\LabelService;
use OCP\IRequest;
use OCP\AppFramework\Controller;
use OCP\IRequest;

class LabelController extends Controller {
private $labelService;
Expand Down
14 changes: 7 additions & 7 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@

namespace OCA\Deck\Controller;

use \OCP\AppFramework\Http\RedirectResponse;
use OCA\Deck\AppInfo\Application;
use OCA\Deck\Db\Acl;
use OCA\Deck\Db\CardMapper;
use OCA\Deck\Service\CardService;
use OCA\Deck\Service\ConfigService;
use OCA\Deck\Service\PermissionService;
use OCA\Files\Event\LoadSidebar;
use OCA\Text\Event\LoadEditor;
use OCA\Viewer\Event\LoadViewer;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as CollaborationResourcesEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IInitialStateService;
use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Controller;
use OCA\Deck\Db\CardMapper;
use OCP\IURLGenerator;
use \OCP\AppFramework\Http\RedirectResponse;
use OCA\Deck\Db\Acl;
use OCA\Deck\Service\CardService;

class PageController extends Controller {
private PermissionService $permissionService;
Expand All @@ -64,7 +64,7 @@ public function __construct(
IURLGenerator $urlGenerator,
CardService $cardService,
IConfig $config
) {
) {
parent::__construct($AppName, $request);

$this->permissionService = $permissionService;
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

namespace OCA\Deck\Controller;

use OCA\Deck\Service\SessionService;
use OCA\Deck\Service\PermissionService;
use OCA\Deck\Db\Acl;
use OCA\Deck\Db\BoardMapper;
use OCA\Deck\Service\PermissionService;
use OCA\Deck\Service\SessionService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;
use OCA\Deck\Db\Acl;

class SessionController extends OCSController {
private SessionService $sessionService;
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/StackApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

namespace OCA\Deck\Controller;

use OCA\Deck\Service\BoardService;
use OCA\Deck\Service\StackService;
use OCA\Deck\StatusException;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCA\Deck\Service\StackService;
use OCA\Deck\Service\BoardService;
use Sabre\HTTP\Util;

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/StackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

use OCA\Deck\Service\StackService;

use OCP\IRequest;

use OCP\AppFramework\Controller;

use OCP\IRequest;

class StackController extends Controller {
private $userId;
private $stackService;
Expand Down
4 changes: 2 additions & 2 deletions lib/Cron/CardDescriptionActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

namespace OCA\Deck\Cron;

use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\Job;
use OCA\Deck\Activity\ActivityManager;
use OCA\Deck\Db\CardMapper;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\Job;

class CardDescriptionActivity extends Job {

Expand Down
4 changes: 2 additions & 2 deletions lib/Cron/DeleteCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

namespace OCA\Deck\Cron;

use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCA\Deck\Db\AttachmentMapper;
use OCA\Deck\Db\BoardMapper;
use OCA\Deck\Db\CardMapper;
use OCA\Deck\InvalidAttachmentType;
use OCA\Deck\Service\AttachmentService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJob;
use OCP\BackgroundJob\TimedJob;

class DeleteCron extends TimedJob {

Expand Down
4 changes: 2 additions & 2 deletions lib/Cron/ScheduledNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OCA\Deck\Cron;

use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\Job;
use OCA\Deck\Db\Card;
use OCA\Deck\Db\CardMapper;
use OCA\Deck\Notification\NotificationHelper;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\Job;
use OCP\ILogger;

class ScheduledNotifications extends Job {
Expand Down
4 changes: 2 additions & 2 deletions lib/Cron/SessionsCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class SessionsCleanup extends TimedJob {


public function __construct(ITimeFactory $time,
SessionService $sessionService,
ILogger $logger) {
SessionService $sessionService,
ILogger $logger) {
parent::__construct($time);
$this->sessionService = $sessionService;
$this->logger = $logger;
Expand Down
10 changes: 5 additions & 5 deletions lib/Db/BoardMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IUserManager;
use OCP\IGroupManager;
use OCP\IUserManager;
use Psr\Log\LoggerInterface;

/** @template-extends QBMapper<Board> */
Expand Down Expand Up @@ -159,7 +159,7 @@ public function findBoardIds(string $userId): array {
}

public function findAllForUser(string $userId, ?int $since = null, bool $includeArchived = true, ?int $before = null,
?string $term = null): array {
?string $term = null): array {
$useCache = ($since === -1 && $includeArchived === true && $before === null && $term === null);
if (!isset($this->userBoardCache[$userId]) || !$useCache) {
$groups = $this->groupManager->getUserGroupIds(
Expand Down Expand Up @@ -198,7 +198,7 @@ public function findAllForUser(string $userId, ?int $since = null, bool $include
* Find all boards for a given user
*/
public function findAllByUser(string $userId, ?int $limit = null, ?int $offset = null, ?int $since = null,
bool $includeArchived = true, ?int $before = null, ?string $term = null): array {
bool $includeArchived = true, ?int $before = null, ?string $term = null): array {
// FIXME this used to be a UNION to get boards owned by $userId and the user shares in one single query
// Is it possible with the query builder?
$qb = $this->db->getQueryBuilder();
Expand Down Expand Up @@ -305,7 +305,7 @@ public function findAllByOwner(string $userId, ?int $limit = null, ?int $offset
* Find all boards for a given user
*/
public function findAllByGroups(string $userId, array $groups, ?int $limit = null, ?int $offset = null, ?int $since = null,
bool $includeArchived = true, ?int $before = null, ?string $term = null): array {
bool $includeArchived = true, ?int $before = null, ?string $term = null): array {
if (count($groups) <= 0) {
return [];
}
Expand Down Expand Up @@ -359,7 +359,7 @@ public function findAllByGroups(string $userId, array $groups, ?int $limit = nul
}

public function findAllByCircles(string $userId, ?int $limit = null, ?int $offset = null, ?int $since = null,
bool $includeArchived = true, ?int $before = null, ?string $term = null) {
bool $includeArchived = true, ?int $before = null, ?string $term = null) {
$circles = $this->circlesService->getUserCircles($userId);
if (count($circles) === 0) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ChangeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

namespace OCA\Deck\Db;

use OCP\ICacheFactory;
use OCP\ICache;
use OCP\ICacheFactory;
use OCP\IDBConnection;
use OCP\IRequest;

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/StackMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\Cache\CappedMemoryCache;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\ICache;
use OCP\ICacheFactory;
use OCP\IDBConnection;

/** @template-extends DeckMapper<Stack> */
class StackMapper extends DeckMapper implements IPermissionMapper {
Expand Down
Loading

0 comments on commit 0ef2041

Please sign in to comment.