@@ -23,8 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\AppInfo;
|
||||
|
||||
use OCP\AppFramework\App;
|
||||
|
||||
/**
|
||||
* Additional autoloader registration, e.g. registering composer autoloaders
|
||||
*/
|
||||
|
||||
@@ -48,8 +48,7 @@ use OCP\IL10N;
|
||||
use OCP\IUser;
|
||||
|
||||
class ActivityManager {
|
||||
|
||||
const DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED = 'DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED';
|
||||
public const DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED = 'DECK_NOAUTHOR_COMMENT_SYSTEM_ENFORCED';
|
||||
private $manager;
|
||||
private $userId;
|
||||
private $permissionService;
|
||||
@@ -60,49 +59,49 @@ class ActivityManager {
|
||||
private $stackMapper;
|
||||
private $l10n;
|
||||
|
||||
const DECK_OBJECT_BOARD = 'deck_board';
|
||||
const DECK_OBJECT_CARD = 'deck_card';
|
||||
public const DECK_OBJECT_BOARD = 'deck_board';
|
||||
public const DECK_OBJECT_CARD = 'deck_card';
|
||||
|
||||
const SUBJECT_BOARD_CREATE = 'board_create';
|
||||
const SUBJECT_BOARD_UPDATE = 'board_update';
|
||||
const SUBJECT_BOARD_UPDATE_TITLE = 'board_update_title';
|
||||
const SUBJECT_BOARD_UPDATE_ARCHIVED = 'board_update_archived';
|
||||
const SUBJECT_BOARD_DELETE = 'board_delete';
|
||||
const SUBJECT_BOARD_RESTORE = 'board_restore';
|
||||
const SUBJECT_BOARD_SHARE = 'board_share';
|
||||
const SUBJECT_BOARD_UNSHARE = 'board_unshare';
|
||||
public const SUBJECT_BOARD_CREATE = 'board_create';
|
||||
public const SUBJECT_BOARD_UPDATE = 'board_update';
|
||||
public const SUBJECT_BOARD_UPDATE_TITLE = 'board_update_title';
|
||||
public const SUBJECT_BOARD_UPDATE_ARCHIVED = 'board_update_archived';
|
||||
public const SUBJECT_BOARD_DELETE = 'board_delete';
|
||||
public const SUBJECT_BOARD_RESTORE = 'board_restore';
|
||||
public const SUBJECT_BOARD_SHARE = 'board_share';
|
||||
public const SUBJECT_BOARD_UNSHARE = 'board_unshare';
|
||||
|
||||
const SUBJECT_STACK_CREATE = 'stack_create';
|
||||
const SUBJECT_STACK_UPDATE = 'stack_update';
|
||||
const SUBJECT_STACK_UPDATE_TITLE = 'stack_update_title';
|
||||
const SUBJECT_STACK_UPDATE_ORDER = 'stack_update_order';
|
||||
const SUBJECT_STACK_DELETE = 'stack_delete';
|
||||
public const SUBJECT_STACK_CREATE = 'stack_create';
|
||||
public const SUBJECT_STACK_UPDATE = 'stack_update';
|
||||
public const SUBJECT_STACK_UPDATE_TITLE = 'stack_update_title';
|
||||
public const SUBJECT_STACK_UPDATE_ORDER = 'stack_update_order';
|
||||
public const SUBJECT_STACK_DELETE = 'stack_delete';
|
||||
|
||||
const SUBJECT_CARD_CREATE = 'card_create';
|
||||
const SUBJECT_CARD_DELETE = 'card_delete';
|
||||
const SUBJECT_CARD_RESTORE = 'card_restore';
|
||||
const SUBJECT_CARD_UPDATE = 'card_update';
|
||||
const SUBJECT_CARD_UPDATE_TITLE = 'card_update_title';
|
||||
const SUBJECT_CARD_UPDATE_DESCRIPTION = 'card_update_description';
|
||||
const SUBJECT_CARD_UPDATE_DUEDATE = 'card_update_duedate';
|
||||
const SUBJECT_CARD_UPDATE_ARCHIVE = 'card_update_archive';
|
||||
const SUBJECT_CARD_UPDATE_UNARCHIVE = 'card_update_unarchive';
|
||||
const SUBJECT_CARD_UPDATE_STACKID = 'card_update_stackId';
|
||||
const SUBJECT_CARD_USER_ASSIGN = 'card_user_assign';
|
||||
const SUBJECT_CARD_USER_UNASSIGN = 'card_user_unassign';
|
||||
public const SUBJECT_CARD_CREATE = 'card_create';
|
||||
public const SUBJECT_CARD_DELETE = 'card_delete';
|
||||
public const SUBJECT_CARD_RESTORE = 'card_restore';
|
||||
public const SUBJECT_CARD_UPDATE = 'card_update';
|
||||
public const SUBJECT_CARD_UPDATE_TITLE = 'card_update_title';
|
||||
public const SUBJECT_CARD_UPDATE_DESCRIPTION = 'card_update_description';
|
||||
public const SUBJECT_CARD_UPDATE_DUEDATE = 'card_update_duedate';
|
||||
public const SUBJECT_CARD_UPDATE_ARCHIVE = 'card_update_archive';
|
||||
public const SUBJECT_CARD_UPDATE_UNARCHIVE = 'card_update_unarchive';
|
||||
public const SUBJECT_CARD_UPDATE_STACKID = 'card_update_stackId';
|
||||
public const SUBJECT_CARD_USER_ASSIGN = 'card_user_assign';
|
||||
public const SUBJECT_CARD_USER_UNASSIGN = 'card_user_unassign';
|
||||
|
||||
const SUBJECT_ATTACHMENT_CREATE = 'attachment_create';
|
||||
const SUBJECT_ATTACHMENT_UPDATE = 'attachment_update';
|
||||
const SUBJECT_ATTACHMENT_DELETE = 'attachment_delete';
|
||||
const SUBJECT_ATTACHMENT_RESTORE = 'attachment_restore';
|
||||
public const SUBJECT_ATTACHMENT_CREATE = 'attachment_create';
|
||||
public const SUBJECT_ATTACHMENT_UPDATE = 'attachment_update';
|
||||
public const SUBJECT_ATTACHMENT_DELETE = 'attachment_delete';
|
||||
public const SUBJECT_ATTACHMENT_RESTORE = 'attachment_restore';
|
||||
|
||||
const SUBJECT_LABEL_CREATE = 'label_create';
|
||||
const SUBJECT_LABEL_UPDATE = 'label_update';
|
||||
const SUBJECT_LABEL_DELETE = 'label_delete';
|
||||
const SUBJECT_LABEL_ASSIGN = 'label_assign';
|
||||
const SUBJECT_LABEL_UNASSING = 'label_unassign';
|
||||
public const SUBJECT_LABEL_CREATE = 'label_create';
|
||||
public const SUBJECT_LABEL_UPDATE = 'label_update';
|
||||
public const SUBJECT_LABEL_DELETE = 'label_delete';
|
||||
public const SUBJECT_LABEL_ASSIGN = 'label_assign';
|
||||
public const SUBJECT_LABEL_UNASSING = 'label_unassign';
|
||||
|
||||
const SUBJECT_CARD_COMMENT_CREATE = 'card_comment_create';
|
||||
public const SUBJECT_CARD_COMMENT_CREATE = 'card_comment_create';
|
||||
|
||||
public function __construct(
|
||||
IManager $manager,
|
||||
@@ -526,5 +525,4 @@ class ActivityManager {
|
||||
'board' => $board
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
|
||||
class ChangeSet implements \JsonSerializable {
|
||||
|
||||
private $before;
|
||||
private $after;
|
||||
private $diff = false;
|
||||
|
||||
@@ -79,7 +79,6 @@ class CommentEventHandler implements ICommentsEventHandler {
|
||||
$comment = $event->getComment();
|
||||
$card = $this->cardMapper->find($comment->getObjectId());
|
||||
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $card, ActivityManager::SUBJECT_CARD_COMMENT_CREATE, ['comment' => $comment]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
|
||||
use cogpowered\FineDiff\Diff;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCP\Activity\IEvent;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
|
||||
class DescriptionSetting extends Setting {
|
||||
|
||||
/**
|
||||
@@ -41,5 +40,4 @@ class DescriptionSetting extends Setting {
|
||||
public function getName() {
|
||||
return $this->l->t('A <strong>card description</strong> inside the Deck app has been changed');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
class Filter implements \OCP\Activity\IFilter {
|
||||
|
||||
private $l10n;
|
||||
private $urlGenerator;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
|
||||
use OCP\IL10N;
|
||||
|
||||
class Setting implements \OCP\Activity\ISetting {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
|
||||
class SettingComment extends Setting {
|
||||
|
||||
/**
|
||||
@@ -49,5 +48,4 @@ class SettingComment extends Setting {
|
||||
public function canChangeStream() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\AppInfo;
|
||||
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
use OC_Util;
|
||||
use OCA\Deck\Activity\CommentEventHandler;
|
||||
use OCA\Deck\Capabilities;
|
||||
@@ -52,10 +51,8 @@ use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\Util;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
class Application extends App {
|
||||
|
||||
public const APP_ID = 'deck';
|
||||
|
||||
public const COMMENT_ENTITY_TYPE = 'deckCard';
|
||||
@@ -69,7 +66,7 @@ class Application extends App {
|
||||
/** @var IFullTextSearchManager */
|
||||
private $fullTextSearchManager;
|
||||
|
||||
public function __construct(array $urlParams = array()) {
|
||||
public function __construct(array $urlParams = []) {
|
||||
parent::__construct('deck', $urlParams);
|
||||
|
||||
$container = $this->getContainer();
|
||||
@@ -252,5 +249,4 @@ class Application extends App {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
namespace OCA\Deck;
|
||||
|
||||
use OCP\AppFramework\Http;
|
||||
class BadRequestException extends StatusException {
|
||||
|
||||
class BadRequestException extends StatusException {
|
||||
public function __construct($message) {
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck;
|
||||
|
||||
|
||||
use OCP\Capabilities\ICapability;
|
||||
|
||||
class Capabilities implements ICapability {
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
namespace OCA\Deck\Collaboration\Resources;
|
||||
|
||||
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
@@ -34,12 +32,10 @@ use OCP\AppFramework\QueryException;
|
||||
use OCP\Collaboration\Resources\IManager;
|
||||
use OCP\Collaboration\Resources\IProvider;
|
||||
use OCP\Collaboration\Resources\IResource;
|
||||
use OCP\Collaboration\Resources\ResourceException;
|
||||
use OCP\IUser;
|
||||
|
||||
class ResourceProvider implements IProvider {
|
||||
|
||||
const RESOURCE_TYPE = 'deck';
|
||||
public const RESOURCE_TYPE = 'deck';
|
||||
|
||||
private $boardMapper;
|
||||
private $permissionService;
|
||||
@@ -83,7 +79,6 @@ class ResourceProvider implements IProvider {
|
||||
'link' => $link,
|
||||
'iconUrl' => \OC::$server->getURLGenerator()->imagePath('deck', 'deck-dark.svg')
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Collaboration\Resources;
|
||||
|
||||
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
@@ -40,8 +39,7 @@ use OCP\IURLGenerator;
|
||||
use OCP\IUser;
|
||||
|
||||
class ResourceProviderCard implements IProvider {
|
||||
|
||||
const RESOURCE_TYPE = 'deck-card';
|
||||
public const RESOURCE_TYPE = 'deck-card';
|
||||
|
||||
/** @var CardMapper */
|
||||
private $cardMapper;
|
||||
@@ -101,7 +99,6 @@ class ResourceProviderCard implements IProvider {
|
||||
'link' => $link,
|
||||
'iconUrl' => $this->urlGenerator->imagePath('core', 'actions/toggle-pictures.svg')
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,6 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class UserExport extends Command {
|
||||
|
||||
protected $boardService;
|
||||
protected $cardMapper;
|
||||
private $userManager;
|
||||
@@ -85,7 +84,6 @@ class UserExport extends Command {
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
|
||||
$userId = $input->getArgument('user-id');
|
||||
|
||||
$this->boardService->setUserId($userId);
|
||||
@@ -110,5 +108,3 @@ class UserExport extends Command {
|
||||
$output->writeln(json_encode($data, JSON_PRETTY_PRINT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,12 +25,10 @@ namespace OCA\Deck\Controller;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\FileDisplayResponse;
|
||||
use OCP\IRequest;
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
|
||||
class AttachmentApiController extends ApiController {
|
||||
|
||||
private $attachmentService;
|
||||
|
||||
public function __construct($appName, IRequest $request, AttachmentService $attachmentService) {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\IRequest;
|
||||
|
||||
@@ -39,7 +39,6 @@ use Sabre\HTTP\Util;
|
||||
* @package OCA\Deck\Controller
|
||||
*/
|
||||
class BoardApiController extends ApiController {
|
||||
|
||||
private $boardService;
|
||||
|
||||
/**
|
||||
@@ -175,5 +174,4 @@ class BoardApiController extends ApiController {
|
||||
$acl = $this->boardService->deleteAcl($aclId);
|
||||
return new DataResponse($acl, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ use OCA\Deck\Service\BoardService;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IGroupManager;
|
||||
|
||||
class BoardController extends ApiController {
|
||||
private $userId;
|
||||
@@ -158,5 +155,4 @@ class BoardController extends ApiController {
|
||||
public function clone($boardId) {
|
||||
return $this->boardService->clone($boardId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ use OCP\IRequest;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
class CardController extends Controller {
|
||||
|
||||
private $userId;
|
||||
private $cardService;
|
||||
private $assignmentService;
|
||||
@@ -166,7 +165,4 @@ class CardController extends Controller {
|
||||
public function unassignUser($cardId, $userId, $type = 0) {
|
||||
return $this->assignmentService->unassignUser($cardId, $userId, $type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,13 +23,10 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\BadRequestException;
|
||||
use OCA\Deck\Service\CommentService;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\ApiController;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
|
||||
use OCP\AppFramework\OCS\OCSException;
|
||||
use OCP\AppFramework\OCSController;
|
||||
use OCP\IRequest;
|
||||
|
||||
|
||||
@@ -23,19 +23,15 @@
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\DefaultBoardService;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\NotFoundResponse;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroup;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\IL10N;
|
||||
|
||||
class ConfigController extends Controller {
|
||||
|
||||
private $config;
|
||||
private $userId;
|
||||
private $groupManager;
|
||||
@@ -113,5 +109,4 @@ class ConfigController extends Controller {
|
||||
}, $groups);
|
||||
return array_filter($groups);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\IRequest;
|
||||
use OCA\Deck\Service\LabelService;
|
||||
use OCA\Deck\Controller\Helper\ApiHelper;
|
||||
|
||||
/**
|
||||
* Class BoardApiController
|
||||
@@ -36,7 +35,6 @@ use OCA\Deck\Controller\Helper\ApiHelper;
|
||||
* @package OCA\Deck\Controller
|
||||
*/
|
||||
class LabelApiController extends ApiController {
|
||||
|
||||
private $labelService;
|
||||
private $userId;
|
||||
|
||||
@@ -103,5 +101,4 @@ class LabelApiController extends ApiController {
|
||||
$label = $this->labelService->delete($this->request->getParam('labelId'));
|
||||
return new DataResponse($label, HTTP::STATUS_OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,9 +27,7 @@ use OCA\Deck\Service\LabelService;
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
|
||||
class LabelController extends Controller {
|
||||
|
||||
private $labelService;
|
||||
|
||||
public function __construct($appName, IRequest $request, LabelService $labelService) {
|
||||
@@ -67,5 +65,4 @@ class LabelController extends Controller {
|
||||
public function delete($labelId) {
|
||||
return $this->labelService->delete($labelId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ use OCP\AppFramework\Controller;
|
||||
use OCP\IL10N;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
private $permissionService;
|
||||
private $userId;
|
||||
private $l10n;
|
||||
@@ -67,5 +66,4 @@ class PageController extends Controller {
|
||||
|
||||
return new TemplateResponse('deck', 'main');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ use Sabre\HTTP\Util;
|
||||
* @package OCA\Deck\Controller
|
||||
*/
|
||||
class StackApiController extends ApiController {
|
||||
|
||||
private $boardService;
|
||||
private $stackService;
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ use OCP\IRequest;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
|
||||
class StackController extends Controller {
|
||||
private $userId;
|
||||
private $stackService;
|
||||
@@ -108,5 +107,4 @@ class StackController extends Controller {
|
||||
public function deleted($boardId) {
|
||||
return $this->stackService->fetchDeleted($boardId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,14 +26,7 @@ namespace OCA\Deck\Cron;
|
||||
|
||||
use OC\BackgroundJob\Job;
|
||||
use OCA\Deck\Activity\ActivityManager;
|
||||
use OCA\Deck\Activity\ChangeSet;
|
||||
use OCA\Deck\Db\AttachmentMapper;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\InvalidAttachmentType;
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
use OCA\Deck\Service\CardService;
|
||||
|
||||
class CardDescriptionActivity extends Job {
|
||||
|
||||
@@ -70,5 +63,4 @@ class CardDescriptionActivity extends Job {
|
||||
$this->cardMapper->update($card, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,7 +65,5 @@ class DeleteCron extends Job {
|
||||
}
|
||||
$this->attachmentMapper->delete($attachment);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,5 +66,4 @@ class ScheduledNotifications extends Job {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,15 +24,14 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class Acl extends RelationalEntity {
|
||||
public const PERMISSION_READ = 0;
|
||||
public const PERMISSION_EDIT = 1;
|
||||
public const PERMISSION_SHARE = 2;
|
||||
public const PERMISSION_MANAGE = 3;
|
||||
|
||||
const PERMISSION_READ = 0;
|
||||
const PERMISSION_EDIT = 1;
|
||||
const PERMISSION_SHARE = 2;
|
||||
const PERMISSION_MANAGE = 3;
|
||||
|
||||
const PERMISSION_TYPE_USER = 0;
|
||||
const PERMISSION_TYPE_GROUP = 1;
|
||||
const PERMISSION_TYPE_CIRCLE = 7;
|
||||
public const PERMISSION_TYPE_USER = 0;
|
||||
public const PERMISSION_TYPE_GROUP = 1;
|
||||
public const PERMISSION_TYPE_CIRCLE = 7;
|
||||
|
||||
protected $participant;
|
||||
protected $type;
|
||||
@@ -67,5 +66,4 @@ class Acl extends RelationalEntity {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,6 @@ namespace OCA\Deck\Db;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'deck_board_acl', Acl::class);
|
||||
}
|
||||
@@ -52,5 +51,4 @@ class AclMapper extends DeckMapper implements IPermissionMapper {
|
||||
$sql = 'SELECT * from *PREFIX*deck_board_acl WHERE type = ? AND participant = ?';
|
||||
return $this->findEntities($sql, [$type, $participant]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace OCA\Deck\Db;
|
||||
use JsonSerializable;
|
||||
|
||||
class AssignedUsers extends RelationalEntity implements JsonSerializable {
|
||||
|
||||
public $id;
|
||||
protected $participant;
|
||||
protected $cardId;
|
||||
@@ -42,5 +41,4 @@ class AssignedUsers extends RelationalEntity implements JsonSerializable {
|
||||
$this->addType('type', 'integer');
|
||||
$this->addResolvable('participant');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,9 +29,7 @@ use OCP\IDBConnection;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IUserManager;
|
||||
|
||||
|
||||
class AssignedUsersMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
private $cardMapper;
|
||||
private $userManager;
|
||||
/**
|
||||
@@ -116,5 +114,4 @@ class AssignedUsersMapper extends DeckMapper implements IPermissionMapper {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class Attachment extends RelationalEntity {
|
||||
|
||||
protected $cardId;
|
||||
protected $type;
|
||||
protected $data;
|
||||
@@ -43,5 +42,4 @@ class Attachment extends RelationalEntity {
|
||||
$this->addResolvable('createdBy');
|
||||
$this->addRelation('extendedData');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,9 +32,7 @@ use OCP\IDBConnection;
|
||||
use OCP\IUserManager;
|
||||
use PDO;
|
||||
|
||||
|
||||
class AttachmentMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
private $cardMapper;
|
||||
private $userManager;
|
||||
private $qb;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class Board extends RelationalEntity {
|
||||
|
||||
protected $title;
|
||||
protected $owner;
|
||||
protected $color;
|
||||
|
||||
@@ -24,14 +24,12 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\QueryException;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\ILogger;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IGroupManager;
|
||||
|
||||
class BoardMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
private $labelMapper;
|
||||
private $aclMapper;
|
||||
private $stackMapper;
|
||||
@@ -263,6 +261,4 @@ class BoardMapper extends DeckMapper implements IPermissionMapper {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace OCA\Deck\Db;
|
||||
use DateTime;
|
||||
|
||||
class Card extends RelationalEntity {
|
||||
|
||||
protected $title;
|
||||
protected $description;
|
||||
protected $descriptionPrev;
|
||||
@@ -49,10 +48,10 @@ class Card extends RelationalEntity {
|
||||
|
||||
private $databaseType = 'sqlite';
|
||||
|
||||
const DUEDATE_FUTURE = 0;
|
||||
const DUEDATE_NEXT = 1;
|
||||
const DUEDATE_NOW = 2;
|
||||
const DUEDATE_OVERDUE = 3;
|
||||
public const DUEDATE_FUTURE = 0;
|
||||
public const DUEDATE_NEXT = 1;
|
||||
public const DUEDATE_NOW = 2;
|
||||
public const DUEDATE_OVERDUE = 3;
|
||||
|
||||
public function __construct() {
|
||||
$this->addType('id', 'integer');
|
||||
@@ -118,5 +117,4 @@ class Card extends RelationalEntity {
|
||||
unset($json['descriptionPrev']);
|
||||
return $json;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ use OCP\IDBConnection;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Notification\IManager;
|
||||
|
||||
|
||||
class CardMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
/** @var LabelMapper */
|
||||
@@ -164,7 +163,6 @@ class CardMapper extends DeckMapper implements IPermissionMapper {
|
||||
foreach ($cards as $card) {
|
||||
$this->delete($card);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function assignLabel($card, $label) {
|
||||
@@ -207,6 +205,4 @@ class CardMapper extends DeckMapper implements IPermissionMapper {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,18 +23,13 @@
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\ICache;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IGroupManager;
|
||||
|
||||
class ChangeHelper {
|
||||
|
||||
const TYPE_BOARD = 'boardChanged';
|
||||
const TYPE_CARD = 'cardChanged';
|
||||
public const TYPE_BOARD = 'boardChanged';
|
||||
public const TYPE_CARD = 'cardChanged';
|
||||
|
||||
private $db;
|
||||
|
||||
@@ -100,5 +95,4 @@ class ChangeHelper {
|
||||
}
|
||||
return $entry;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class Circle extends RelationalObject {
|
||||
|
||||
@@ -48,5 +48,4 @@ abstract class DeckMapper extends Mapper {
|
||||
protected function execute($sql, array $params = [], $limit = null, $offset = null) {
|
||||
return parent::execute($sql, $params, $limit, $offset);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,6 @@ use OCP\IGroup;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class Group extends RelationalObject {
|
||||
|
||||
public function __construct(IGroup $group) {
|
||||
$primaryKey = IShare::TYPE_GROUP . ':' . $group->getGID();
|
||||
parent::__construct($primaryKey, $group);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
|
||||
interface IPermissionMapper {
|
||||
|
||||
/**
|
||||
@@ -43,6 +42,4 @@ interface IPermissionMapper {
|
||||
* @return int|null id of Board
|
||||
*/
|
||||
public function findBoardId($id);
|
||||
|
||||
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class Label extends RelationalEntity {
|
||||
|
||||
protected $title;
|
||||
protected $color;
|
||||
protected $boardId;
|
||||
|
||||
@@ -26,9 +26,7 @@ namespace OCA\Deck\Db;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
|
||||
class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
public function __construct(IDBConnection $db) {
|
||||
parent::__construct($db, 'deck_labels', Label::class);
|
||||
}
|
||||
@@ -70,10 +68,10 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
public function getAssignedLabelsForBoard($boardId) {
|
||||
$labels = $this->findAssignedLabelsForBoard($boardId);
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($labels as $label) {
|
||||
if (!array_key_exists($label->getCardId(), $result)) {
|
||||
$result[$label->getCardId()] = array();
|
||||
$result[$label->getCardId()] = [];
|
||||
}
|
||||
$result[$label->getCardId()][] = $label;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,7 @@ namespace OCA\Deck\Db;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
|
||||
class RelationalEntity extends Entity implements \JsonSerializable {
|
||||
|
||||
private $_relations = array();
|
||||
private $_relations = [];
|
||||
private $_resolvedProperties = [];
|
||||
|
||||
/**
|
||||
@@ -137,5 +136,4 @@ class RelationalEntity extends Entity implements \JsonSerializable {
|
||||
}
|
||||
return parent::__call($methodName, $args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class RelationalObject implements \JsonSerializable {
|
||||
|
||||
protected $primaryKey;
|
||||
protected $object;
|
||||
|
||||
@@ -58,5 +57,4 @@ class RelationalObject implements \JsonSerializable {
|
||||
throw new \Exception('jsonSerialize is not implemented on ' . get_class($this));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,12 +24,11 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class Stack extends RelationalEntity {
|
||||
|
||||
protected $title;
|
||||
protected $boardId;
|
||||
protected $deletedAt = 0;
|
||||
protected $lastModified = 0;
|
||||
protected $cards = array();
|
||||
protected $cards = [];
|
||||
protected $order;
|
||||
|
||||
public function __construct() {
|
||||
|
||||
@@ -26,9 +26,7 @@ namespace OCA\Deck\Db;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
|
||||
class StackMapper extends DeckMapper implements IPermissionMapper {
|
||||
|
||||
private $cardMapper;
|
||||
|
||||
public function __construct(IDBConnection $db, CardMapper $cardMapper) {
|
||||
|
||||
@@ -27,7 +27,6 @@ use OCP\IUser;
|
||||
use OCP\Share\IShare;
|
||||
|
||||
class User extends RelationalObject {
|
||||
|
||||
public function __construct(IUser $user) {
|
||||
$primaryKey = IShare::TYPE_USER . ':' . $user->getUID();
|
||||
parent::__construct($primaryKey, $user);
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
namespace OCA\Deck\Event;
|
||||
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
/**
|
||||
* This is a class to keep compatibility for currently used events in full text search integration
|
||||
@@ -43,13 +41,11 @@ class FTSEvent extends Event {
|
||||
$this->arguments = $arguments;
|
||||
}
|
||||
|
||||
public function getArgument($key)
|
||||
{
|
||||
public function getArgument($key) {
|
||||
if ($this->hasArgument($key)) {
|
||||
return $this->arguments[$key];
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('Argument "%s" not found.', $key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace OCA\Deck\Exceptions;
|
||||
use OCA\Deck\StatusException;
|
||||
|
||||
class ConflictException extends StatusException {
|
||||
|
||||
private $data;
|
||||
|
||||
public function __construct($message, $data = null) {
|
||||
|
||||
@@ -23,15 +23,12 @@
|
||||
|
||||
namespace OCA\Deck;
|
||||
|
||||
|
||||
class InvalidAttachmentType extends \Exception {
|
||||
|
||||
/**
|
||||
* InvalidAttachmentType constructor.
|
||||
*/
|
||||
public function __construct($type) {
|
||||
|
||||
parent::__construct('No matching IAttachmentService implementation found for type ' . $type);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -59,5 +59,4 @@ class DefaultBoardMiddleware extends Middleware {
|
||||
$this->logger->logException($e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Middleware;
|
||||
|
||||
use OCA\Deck\Controller\PageController;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCA\Deck\Exceptions\ConflictException;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
@@ -35,7 +34,6 @@ use OCP\ILogger;
|
||||
use OCP\Util;
|
||||
use OCP\IConfig;
|
||||
|
||||
|
||||
class ExceptionMiddleware extends Middleware {
|
||||
|
||||
/** @var ILogger */
|
||||
@@ -116,5 +114,4 @@ class ExceptionMiddleware extends Middleware {
|
||||
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ use OCP\Migration\IRepairStep;
|
||||
use OCP\Migration\IOutput;
|
||||
|
||||
class UnknownUsers implements IRepairStep {
|
||||
|
||||
private $userManager;
|
||||
private $groupManager;
|
||||
private $aclMapper;
|
||||
@@ -76,7 +75,6 @@ class UnknownUsers implements IRepairStep {
|
||||
$this->aclMapper->delete($acl);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,5 +323,4 @@ class Version1000Date20200306161713 extends SimpleMigrationStep {
|
||||
}
|
||||
return $schema;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
namespace OCA\Deck;
|
||||
|
||||
|
||||
class NoPermissionException extends StatusException {
|
||||
|
||||
public function __construct($message, $controller = null, $method = null) {
|
||||
parent::__construct($message);
|
||||
if ($controller && $method) {
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
namespace OCA\Deck;
|
||||
|
||||
|
||||
class NotFoundException extends StatusException {
|
||||
|
||||
public function __construct($message = '') {
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
@@ -189,5 +189,4 @@ class NotificationHelper {
|
||||
->setSubject('board-shared', [$board->getTitle(), $this->currentUser]);
|
||||
return $notification;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
@@ -28,7 +29,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Provider;
|
||||
|
||||
|
||||
use OC\FullTextSearch\Model\IndexDocument;
|
||||
use OC\FullTextSearch\Model\SearchTemplate;
|
||||
use OCA\Deck\Service\FullTextSearchService;
|
||||
@@ -46,16 +46,13 @@ use OCP\FullTextSearch\Model\ISearchTemplate;
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
|
||||
/**
|
||||
* Class DeckProvider
|
||||
*
|
||||
* @package OCA\Deck\Provider
|
||||
*/
|
||||
class DeckProvider implements IFullTextSearchProvider {
|
||||
|
||||
|
||||
const DECK_PROVIDER_ID = 'deck';
|
||||
public const DECK_PROVIDER_ID = 'deck';
|
||||
|
||||
|
||||
/** @var IL10N */
|
||||
@@ -276,6 +273,4 @@ class DeckProvider implements IFullTextSearchProvider {
|
||||
|
||||
$this->runner->setInfo($info, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
use OCA\Deck\Activity\ActivityManager;
|
||||
use OCA\Deck\BadRequestException;
|
||||
use OCA\Deck\Db\Acl;
|
||||
@@ -40,8 +39,6 @@ use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
class AssignmentService {
|
||||
|
||||
@@ -110,7 +107,6 @@ class AssignmentService {
|
||||
* @throws DoesNotExistException
|
||||
*/
|
||||
public function assignUser($cardId, $userId, int $type = AssignedUsers::TYPE_USER) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
use OCA\Deck\Activity\ActivityManager;
|
||||
use OCA\Deck\AppInfo\Application;
|
||||
use OCA\Deck\BadRequestException;
|
||||
@@ -42,7 +41,6 @@ use OCP\ICacheFactory;
|
||||
use OCP\IL10N;
|
||||
|
||||
class AttachmentService {
|
||||
|
||||
private $attachmentMapper;
|
||||
private $cardMapper;
|
||||
private $permissionService;
|
||||
@@ -116,7 +114,6 @@ class AttachmentService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function findAll($cardId, $withDeleted = false) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -144,7 +141,6 @@ class AttachmentService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function count($cardId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -167,7 +163,6 @@ class AttachmentService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function create($cardId, $type, $data) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -228,7 +223,6 @@ class AttachmentService {
|
||||
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
|
||||
*/
|
||||
public function display($cardId, $attachmentId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -261,7 +255,6 @@ class AttachmentService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function update($cardId, $attachmentId, $data) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -312,7 +305,6 @@ class AttachmentService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function delete($cardId, $attachmentId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -343,7 +335,6 @@ class AttachmentService {
|
||||
}
|
||||
|
||||
public function restore($cardId, $attachmentId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace OCA\Deck\Service;
|
||||
|
||||
use OCA\Deck\Activity\ActivityManager;
|
||||
use OCA\Deck\Activity\ChangeSet;
|
||||
use OCA\Deck\Collaboration\Resources\ResourceProvider;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\AclMapper;
|
||||
use OCA\Deck\Db\AssignedUsersMapper;
|
||||
@@ -48,9 +47,7 @@ use OCA\Deck\BadRequestException;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
|
||||
class BoardService {
|
||||
|
||||
private $boardMapper;
|
||||
private $stackMapper;
|
||||
private $labelMapper;
|
||||
@@ -154,7 +151,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function find($boardId) {
|
||||
|
||||
if (is_numeric($boardId) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -202,7 +198,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function isArchived($mapper, $id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('id must be a number');
|
||||
}
|
||||
@@ -232,7 +227,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function isDeleted($mapper, $id) {
|
||||
|
||||
if ($mapper === false || $mapper === null) {
|
||||
throw new BadRequestException('mapper must be provided');
|
||||
}
|
||||
@@ -265,7 +259,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function create($title, $userId, $color) {
|
||||
|
||||
if ($title === false || $title === null) {
|
||||
throw new BadRequestException('title must be provided');
|
||||
}
|
||||
@@ -334,7 +327,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function delete($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -364,7 +356,6 @@ class BoardService {
|
||||
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
|
||||
*/
|
||||
public function deleteUndo($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -419,7 +410,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function update($id, $title, $color, $archived) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -479,7 +469,6 @@ class BoardService {
|
||||
* @throws \OCA\Deck\NoPermissionException
|
||||
*/
|
||||
public function addAcl($boardId, $type, $participant, $edit, $share, $manage) {
|
||||
|
||||
if (is_numeric($boardId) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -529,7 +518,8 @@ class BoardService {
|
||||
try {
|
||||
$resourceProvider = \OC::$server->query(\OCA\Deck\Collaboration\Resources\ResourceProvider::class);
|
||||
$resourceProvider->invalidateAccessCache($boardId);
|
||||
} catch (\Exception $e) {}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
$this->eventDispatcher->dispatch(
|
||||
@@ -551,7 +541,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function updateAcl($id, $edit, $share, $manage) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('id must be a number');
|
||||
}
|
||||
@@ -596,7 +585,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function deleteAcl($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('id must be a number');
|
||||
}
|
||||
@@ -619,7 +607,8 @@ class BoardService {
|
||||
try {
|
||||
$resourceProvider = \OC::$server->query(\OCA\Deck\Collaboration\Resources\ResourceProvider::class);
|
||||
$resourceProvider->invalidateAccessCache($acl->getBoardId());
|
||||
} catch (\Exception $e) {}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
$delete = $this->aclMapper->delete($acl);
|
||||
|
||||
@@ -639,7 +628,6 @@ class BoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function clone($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -707,5 +695,4 @@ class BoardService {
|
||||
}
|
||||
$board->setUsers(array_values($boardUsers));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace OCA\Deck\Service;
|
||||
|
||||
use OCA\Deck\Activity\ActivityManager;
|
||||
use OCA\Deck\Activity\ChangeSet;
|
||||
use OCA\Deck\Db\AssignedUsers;
|
||||
use OCA\Deck\Db\AssignedUsersMapper;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
@@ -39,19 +38,13 @@ use OCA\Deck\Event\FTSEvent;
|
||||
use OCA\Deck\Notification\NotificationHelper;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\LabelMapper;
|
||||
use OCA\Deck\NotFoundException;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCA\Deck\BadRequestException;
|
||||
use OCP\Activity\IEvent;
|
||||
use OCP\Comments\ICommentsManager;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\IUserManager;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
class CardService {
|
||||
|
||||
private $cardMapper;
|
||||
private $stackMapper;
|
||||
private $boardMapper;
|
||||
@@ -132,7 +125,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function find($cardId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -218,7 +210,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function delete($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -257,7 +248,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function update($id, $title, $stackId, $type, $order = 0, $description = '', $owner, $duedate = null, $deletedAt = null, $archived = null) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -347,7 +337,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function rename($id, $title) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('id must be a number');
|
||||
}
|
||||
@@ -387,7 +376,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function reorder($id, $stackId, $order) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -448,7 +436,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function archive($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('id must be a number');
|
||||
}
|
||||
@@ -481,7 +468,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function unarchive($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('id must be a number');
|
||||
}
|
||||
@@ -513,7 +499,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function assignLabel($cardId, $labelId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -550,7 +535,6 @@ class CardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function removeLabel($cardId, $labelId) {
|
||||
|
||||
if (is_numeric($cardId) === false) {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
@@ -576,5 +560,4 @@ class CardService {
|
||||
'\OCA\Deck\Card::onUpdate', new FTSEvent(null, ['id' => $cardId, 'card' => $card])
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,14 +23,12 @@
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
use OCA\Deck\AppInfo\Application;
|
||||
use OCA\Deck\BadRequestException;
|
||||
use OCA\Deck\Db\Acl;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\NoPermissionException;
|
||||
use OCA\Deck\NotFoundException;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\Comments\IComment;
|
||||
use OCP\Comments\ICommentsManager;
|
||||
@@ -39,7 +37,6 @@ use OCP\Comments\NotFoundException as CommentNotFoundException;
|
||||
use OCP\ILogger;
|
||||
use OCP\IUserManager;
|
||||
use OutOfBoundsException;
|
||||
use Sabre\DAV\Exception\Forbidden;
|
||||
use function is_numeric;
|
||||
|
||||
class CommentService {
|
||||
@@ -125,7 +122,6 @@ class CommentService {
|
||||
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_READ);
|
||||
try {
|
||||
$comment = $this->commentsManager->get($commentId);
|
||||
|
||||
} catch (CommentNotFoundException $e) {
|
||||
throw new NotFoundException('No comment found.');
|
||||
}
|
||||
@@ -147,7 +143,6 @@ class CommentService {
|
||||
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_READ);
|
||||
try {
|
||||
$comment = $this->commentsManager->get($commentId);
|
||||
|
||||
} catch (CommentNotFoundException $e) {
|
||||
throw new NotFoundException('No comment found.');
|
||||
}
|
||||
@@ -187,5 +182,4 @@ class CommentService {
|
||||
}, $comment->getMentions()),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ use OCA\Deck\BadRequestException;
|
||||
use OCP\PreConditionNotMetException;
|
||||
|
||||
class DefaultBoardService {
|
||||
|
||||
private $boardMapper;
|
||||
private $boardService;
|
||||
private $stackService;
|
||||
@@ -47,7 +46,6 @@ class DefaultBoardService {
|
||||
CardService $cardService,
|
||||
IConfig $config
|
||||
) {
|
||||
|
||||
$this->boardService = $boardService;
|
||||
$this->stackService = $stackService;
|
||||
$this->cardService = $cardService;
|
||||
@@ -90,7 +88,6 @@ class DefaultBoardService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function createDefaultBoard(string $title, string $userId, string $color) {
|
||||
|
||||
if ($title === false || $title === null) {
|
||||
throw new BadRequestException('title must be provided');
|
||||
}
|
||||
|
||||
@@ -23,17 +23,13 @@
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
use OC\Security\CSP\ContentSecurityPolicyManager;
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCA\Deck\Db\AttachmentMapper;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCA\Deck\Exceptions\ConflictException;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
use OCP\AppFramework\Http\EmptyContentSecurityPolicy;
|
||||
use OCP\AppFramework\Http\FileDisplayResponse;
|
||||
use OCP\AppFramework\Http\StreamResponse;
|
||||
use OCP\Files\Cache\IScanner;
|
||||
use OCP\Files\Folder;
|
||||
use OCP\Files\IAppData;
|
||||
use OCP\Files\IRootFolder;
|
||||
use OCP\Files\NotFoundException;
|
||||
@@ -45,9 +41,7 @@ use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
use OCP\IRequest;
|
||||
|
||||
|
||||
class FileService implements IAttachmentService {
|
||||
|
||||
private $l10n;
|
||||
private $appData;
|
||||
private $request;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
@@ -28,7 +29,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
use OC\FullTextSearch\Model\DocumentAccess;
|
||||
use OC\FullTextSearch\Model\IndexDocument;
|
||||
use OCA\Deck\Db\Board;
|
||||
@@ -47,7 +47,6 @@ use OCP\FullTextSearch\Model\IDocumentAccess;
|
||||
use OCP\FullTextSearch\Model\IIndex;
|
||||
use OCP\FullTextSearch\Model\IIndexDocument;
|
||||
|
||||
|
||||
/**
|
||||
* Class FullTextSearchService
|
||||
*
|
||||
@@ -266,7 +265,6 @@ class FullTextSearchService {
|
||||
*/
|
||||
private function getStacksFromBoard(int $boardId): array {
|
||||
return $this->stackMapper->findAll($boardId, null, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +276,4 @@ class FullTextSearchService {
|
||||
private function getBoardsFromUser(string $userId): array {
|
||||
return $this->boardMapper->findAllByUser($userId, null, null, -1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
|
||||
@@ -95,5 +94,4 @@ interface IAttachmentService {
|
||||
* @param Attachment $attachment
|
||||
*/
|
||||
public function markAsDeleted(Attachment $attachment);
|
||||
|
||||
}
|
||||
@@ -30,7 +30,6 @@ use OCA\Deck\Db\LabelMapper;
|
||||
use OCA\Deck\StatusException;
|
||||
use OCA\Deck\BadRequestException;
|
||||
|
||||
|
||||
class LabelService {
|
||||
|
||||
/** @var LabelMapper */
|
||||
@@ -77,7 +76,6 @@ class LabelService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function create($title, $color, $boardId) {
|
||||
|
||||
if ($title === false || $title === null) {
|
||||
throw new BadRequestException('title must be provided');
|
||||
}
|
||||
@@ -123,7 +121,6 @@ class LabelService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function delete($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('label id must be a number');
|
||||
}
|
||||
@@ -149,7 +146,6 @@ class LabelService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function update($id, $title, $color) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('label id must be a number');
|
||||
}
|
||||
@@ -188,5 +184,4 @@ class LabelService {
|
||||
$this->changeHelper->boardChanged($label->getBoardId());
|
||||
return $this->labelMapper->update($label);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,14 +33,12 @@ use OCA\Deck\NoPermissionException;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\Entity;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\AppFramework\QueryException;
|
||||
use OCP\IConfig;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\ILogger;
|
||||
use OCP\IUserManager;
|
||||
use OCP\Share\IManager;
|
||||
|
||||
|
||||
class PermissionService {
|
||||
|
||||
/** @var BoardMapper */
|
||||
|
||||
@@ -39,9 +39,7 @@ use OCA\Deck\StatusException;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
|
||||
class StackService {
|
||||
|
||||
private $stackMapper;
|
||||
private $cardMapper;
|
||||
private $boardMapper;
|
||||
@@ -166,7 +164,6 @@ class StackService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function findAllArchived($boardId) {
|
||||
|
||||
if (is_numeric($boardId) === false) {
|
||||
throw new BadRequestException('board id must be a number');
|
||||
}
|
||||
@@ -200,7 +197,6 @@ class StackService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function create($title, $boardId, $order) {
|
||||
|
||||
if ($title === false || $title === null) {
|
||||
throw new BadRequestException('title must be provided');
|
||||
}
|
||||
@@ -245,7 +241,6 @@ class StackService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function delete($id) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('stack id must be a number');
|
||||
}
|
||||
@@ -284,7 +279,6 @@ class StackService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function update($id, $title, $boardId, $order, $deletedAt) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRequestException('stack id must be a number');
|
||||
}
|
||||
@@ -336,7 +330,6 @@ class StackService {
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function reorder($id, $order) {
|
||||
|
||||
if (is_numeric($id) === false) {
|
||||
throw new BadRquestException('id must be a number');
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
namespace OCA\Deck;
|
||||
|
||||
|
||||
class StatusException extends \Exception {
|
||||
|
||||
public function __construct($message) {
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use OCP\Util;
|
||||
|
||||
style('deck', 'globalstyles');
|
||||
script('deck', 'deck');
|
||||
|
||||
1
tests/.phpunit.result.cache
Normal file
1
tests/.phpunit.result.cache
Normal file
@@ -0,0 +1 @@
|
||||
C:37:"PHPUnit\Runner\DefaultTestResultCache":3426:{a:2:{s:7:"defects";a:5:{s:89:"Test\Authentication\Login\FinishRememberedLoginCommandTest::testProcessNotRememberedLogin";i:4;s:71:"Test\Authentication\Login\FinishRememberedLoginCommandTest::testProcess";i:3;s:102:"Test\Authentication\Login\FinishRememberedLoginCommandTest::testProcessNotRemeberedLoginWithAutologout";i:4;s:52:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareLink";i:4;s:64:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareLinkPublicUpload";i:3;}s:5:"times";a:38:{s:89:"Test\Authentication\Login\FinishRememberedLoginCommandTest::testProcessNotRememberedLogin";d:0.008;s:71:"Test\Authentication\Login\FinishRememberedLoginCommandTest::testProcess";d:0.001;s:102:"Test\Authentication\Login\FinishRememberedLoginCommandTest::testProcessNotRemeberedLoginWithAutologout";d:0.001;s:52:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareLink";d:0.19;s:56:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareUserFile";d:0.485;s:58:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareUserFolder";d:0.226;s:57:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareGroupFile";d:0.244;s:59:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareGroupFolder";d:0.222;s:64:"OCA\Files_Sharing\Tests\ApiTest::testCreateShareLinkPublicUpload";d:0.121;s:56:"OCA\Files_Sharing\Tests\ApiTest::testEnforceLinkPassword";d:0.576;s:53:"OCA\Files_Sharing\Tests\ApiTest::testSharePermissions";d:0.167;s:49:"OCA\Files_Sharing\Tests\ApiTest::testGetAllShares";d:0.129;s:55:"OCA\Files_Sharing\Tests\ApiTest::testGetAllSharesWithMe";d:0.182;s:50:"OCA\Files_Sharing\Tests\ApiTest::testPublicLinkUrl";d:0.133;s:55:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromSource";d:0.135;s:67:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromSourceWithReshares";d:0.162;s:51:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromId";d:0.13;s:55:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromFolder";d:0.165;s:63:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromFolderWithFile";d:0.125;s:63:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromFolderReshares";d:0.185;s:66:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromSubFolderReShares";d:0.183;s:65:"OCA\Files_Sharing\Tests\ApiTest::testGetShareMultipleSharedFolder";d:0.263;s:63:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromFileReReShares";d:0.203;s:58:"OCA\Files_Sharing\Tests\ApiTest::testGetShareFromUnknownId";d:0.11;s:48:"OCA\Files_Sharing\Tests\ApiTest::testUpdateShare";d:0.391;s:54:"OCA\Files_Sharing\Tests\ApiTest::testUpdateShareUpload";d:0.142;s:58:"OCA\Files_Sharing\Tests\ApiTest::testUpdateShareExpireDate";d:0.146;s:48:"OCA\Files_Sharing\Tests\ApiTest::testDeleteShare";d:0.159;s:50:"OCA\Files_Sharing\Tests\ApiTest::testDeleteReshare";d:0.177;s:63:"OCA\Files_Sharing\Tests\ApiTest::testShareFolderWithAMountPoint";d:0.236;s:59:"OCA\Files_Sharing\Tests\ApiTest::testShareStorageMountPoint";d:0.165;s:74:"OCA\Files_Sharing\Tests\ApiTest::testPublicLinkExpireDate with data set #0";d:0.088;s:74:"OCA\Files_Sharing\Tests\ApiTest::testPublicLinkExpireDate with data set #1";d:0.111;s:74:"OCA\Files_Sharing\Tests\ApiTest::testPublicLinkExpireDate with data set #2";d:0.119;s:68:"OCA\Files_Sharing\Tests\ApiTest::testCreatePublicLinkExpireDateValid";d:0.135;s:76:"OCA\Files_Sharing\Tests\ApiTest::testCreatePublicLinkExpireDateInvalidFuture";d:0.119;s:56:"OCA\Files_Sharing\Tests\ApiTest::testInvisibleSharesUser";d:0.154;s:57:"OCA\Files_Sharing\Tests\ApiTest::testInvisibleSharesGroup";d:0.165;}}}
|
||||
@@ -21,17 +21,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use OCP\AppFramework\App;
|
||||
use Test\TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* This test shows how to make a small Integration Test. Query your class
|
||||
* directly from the container, only pass in mocks if needed and run your tests
|
||||
* against the database
|
||||
*/
|
||||
class AppTest extends TestCase {
|
||||
|
||||
private $container;
|
||||
private $app;
|
||||
|
||||
@@ -50,5 +47,4 @@ class AppTest extends TestCase {
|
||||
$this->app->registerNavigationEntry();
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ use OCA\Deck\Service\CardService;
|
||||
* @coversDefaultClass OCA\Deck\Db\AssignedUsersMapper
|
||||
*/
|
||||
class AssignedUsersMapperTest extends \Test\TestCase {
|
||||
|
||||
private const TEST_USER1 = 'test-share-user1';
|
||||
private const TEST_USER3 = 'test-share-user3';
|
||||
private const TEST_USER2 = 'test-share-user2';
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
/**
|
||||
* @group DB
|
||||
*/
|
||||
class BoardDatabaseTest extends \Test\TestCase
|
||||
{
|
||||
const TEST_USER1 = "test-share-user1";
|
||||
const TEST_USER2 = "test-share-user2";
|
||||
const TEST_USER3 = "test-share-user3";
|
||||
const TEST_USER4 = "test-share-user4";
|
||||
const TEST_GROUP1 = "test-share-group1";
|
||||
class BoardDatabaseTest extends \Test\TestCase {
|
||||
public const TEST_USER1 = "test-share-user1";
|
||||
public const TEST_USER2 = "test-share-user2";
|
||||
public const TEST_USER3 = "test-share-user3";
|
||||
public const TEST_USER4 = "test-share-user4";
|
||||
public const TEST_GROUP1 = "test-share-group1";
|
||||
|
||||
/** @var \OCA\Deck\Service\BoardService */
|
||||
private $boardService;
|
||||
|
||||
@@ -32,7 +32,6 @@ use GuzzleHttp\Message\ResponseInterface;
|
||||
require __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
trait BasicStructure {
|
||||
|
||||
use Auth;
|
||||
|
||||
/** @var string */
|
||||
@@ -140,7 +139,9 @@ trait BasicStructure {
|
||||
* @return array
|
||||
*/
|
||||
public function simplifyArray($arrayOfArrays) {
|
||||
$a = array_map(function($subArray) { return $subArray[0]; }, $arrayOfArrays);
|
||||
$a = array_map(function ($subArray) {
|
||||
return $subArray[0];
|
||||
}, $arrayOfArrays);
|
||||
return $a;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,20 +3,18 @@
|
||||
use Behat\Behat\Context\Context;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
use GuzzleHttp\Client;
|
||||
use Behat\Behat\Tester\Exception\PendingException;
|
||||
use Behat\Gherkin\Node\PyStringNode;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
class FeatureContext implements Context {
|
||||
|
||||
use WebDav;
|
||||
|
||||
/** @var string */
|
||||
private $mappedUserId;
|
||||
|
||||
private $lastInsertIds = array();
|
||||
private $lastInsertIds = [];
|
||||
|
||||
/**
|
||||
* @BeforeSuite
|
||||
@@ -135,8 +133,7 @@ class FeatureContext implements Context {
|
||||
* @param PyStringNode $string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function iShouldGet(PyStringNode $string)
|
||||
{
|
||||
public function iShouldGet(PyStringNode $string) {
|
||||
if ((string) $string !== trim($this->cliOutput)) {
|
||||
throw new Exception(sprintf(
|
||||
'Expected "%s" but received "%s".',
|
||||
@@ -172,7 +169,6 @@ class FeatureContext implements Context {
|
||||
* @Given /^creates a board named "([^"]*)" with color "([^"]*)"$/
|
||||
*/
|
||||
public function createsABoardNamedWithColor($title, $color) {
|
||||
|
||||
$this->sendJSONrequest('POST', '/index.php/apps/deck/boards', [
|
||||
'title' => $title,
|
||||
'color' => $color
|
||||
@@ -190,5 +186,4 @@ class FeatureContext implements Context {
|
||||
$id = $this->lastInsertIds[$boardName];
|
||||
$this->sendJSONrequest('GET', '/index.php/apps/deck/boards/'.$id, []);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -91,7 +91,9 @@ class ActivityManagerTest extends TestCase {
|
||||
$managerClass = new \ReflectionClass(ActivityManager::class);
|
||||
$this->l10n->expects($this->any())
|
||||
->method('t')
|
||||
->will($this->returnCallback(function ($s) { return $s; }));
|
||||
->will($this->returnCallback(function ($s) {
|
||||
return $s;
|
||||
}));
|
||||
|
||||
foreach ($managerClass->getConstants() as $constant => $value) {
|
||||
if (strpos($constant, 'SUBJECT') === 0) {
|
||||
@@ -111,7 +113,6 @@ class ActivityManagerTest extends TestCase {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function testCreateEvent() {
|
||||
@@ -342,12 +343,10 @@ class ActivityManagerTest extends TestCase {
|
||||
], $this->invokePrivate($this->activityManager, 'findDetailsForAttachment', [777]));
|
||||
}
|
||||
|
||||
public function invokePrivate(&$object, $methodName, array $parameters = array())
|
||||
{
|
||||
public function invokePrivate(&$object, $methodName, array $parameters = []) {
|
||||
$reflection = new \ReflectionClass(get_class($object));
|
||||
$method = $reflection->getMethod($methodName);
|
||||
$method->setAccessible(true);
|
||||
return $method->invokeArgs($object, $parameters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,9 +25,7 @@ namespace OCA\Deck\Activity;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
|
||||
class ChangeSetTest extends TestCase {
|
||||
|
||||
public function setUp(): void {
|
||||
}
|
||||
|
||||
@@ -54,5 +52,4 @@ class ChangeSetTest extends TestCase {
|
||||
$changeSet->enableDiff();
|
||||
$this->assertTrue($changeSet->getDiff());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,27 +23,12 @@
|
||||
|
||||
namespace OCA\Deck\Activity;
|
||||
|
||||
use OCA\Deck\Db\AclMapper;
|
||||
use OCA\Deck\Db\AssignedUsers;
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCA\Deck\Db\AttachmentMapper;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Db\Label;
|
||||
use OCA\Deck\Db\Stack;
|
||||
use OCA\Deck\Db\StackMapper;
|
||||
use OCA\Deck\Notification\NotificationHelper;
|
||||
use OCA\Deck\Service\PermissionService;
|
||||
use OCP\Activity\IEvent;
|
||||
use OCP\Activity\IManager;
|
||||
use OCP\Comments\CommentsEvent;
|
||||
use OCP\Comments\IComment;
|
||||
use OCP\IL10N;
|
||||
use OCP\IUser;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit_Framework_MockObject_MockObject as MockObject;
|
||||
|
||||
class CommentEventHandlerTest extends TestCase {
|
||||
|
||||
@@ -109,12 +94,10 @@ class CommentEventHandlerTest extends TestCase {
|
||||
$this->commentEventHandler->handle($commentsEvent);
|
||||
}
|
||||
|
||||
public function invokePrivate(&$object, $methodName, array $parameters = array())
|
||||
{
|
||||
public function invokePrivate(&$object, $methodName, array $parameters = []) {
|
||||
$reflection = new \ReflectionClass(get_class($object));
|
||||
$method = $reflection->getMethod($methodName);
|
||||
$method->setAccessible(true);
|
||||
return $method->invokeArgs($object, $parameters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -238,7 +238,6 @@ class DeckProviderTest extends TestCase {
|
||||
$this->assertEquals('test string Card', $event->getParsedSubject());
|
||||
$this->assertEquals('test string {card}', $event->getRichSubject());
|
||||
$this->assertEquals('', $event->getMessage());
|
||||
|
||||
}
|
||||
|
||||
public function testParseObjectTypeCardWithDiff() {
|
||||
@@ -496,8 +495,7 @@ class DeckProviderTest extends TestCase {
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
public function invokePrivate(&$object, $methodName, array $parameters = array())
|
||||
{
|
||||
public function invokePrivate(&$object, $methodName, array $parameters = []) {
|
||||
$reflection = new \ReflectionClass(get_class($object));
|
||||
$method = $reflection->getMethod($methodName);
|
||||
$method->setAccessible(true);
|
||||
|
||||
@@ -77,5 +77,4 @@ class FilterTest extends TestCase {
|
||||
public function testAllowedApps() {
|
||||
$this->assertEquals(['deck'], $this->filter->allowedApps());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@ class SettingTest extends TestCase {
|
||||
|
||||
public function setUp(): void {
|
||||
$this->l10n = $this->createMock(IL10N::class);
|
||||
$this->l10n->expects($this->any())->method('t')->will($this->returnCallback(function ($s) { return $s; }));
|
||||
$this->l10n->expects($this->any())->method('t')->will($this->returnCallback(function ($s) {
|
||||
return $s;
|
||||
}));
|
||||
$this->setting = new Setting($this->l10n);
|
||||
}
|
||||
|
||||
@@ -66,5 +68,4 @@ class SettingTest extends TestCase {
|
||||
public function testIsDefaultEnabledMail() {
|
||||
$this->assertFalse($this->setting->isDefaultEnabledMail());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,26 +24,19 @@
|
||||
namespace OCA\Deck\Command;
|
||||
|
||||
use OCA\Deck\Db\AssignedUsersMapper;
|
||||
use OCA\Deck\Db\Attachment;
|
||||
use OCA\Deck\Db\AttachmentMapper;
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Db\Stack;
|
||||
use OCA\Deck\Db\StackMapper;
|
||||
use OCA\Deck\InvalidAttachmentType;
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
use OCA\Deck\Service\BoardService;
|
||||
use OCA\Deck\Service\IAttachmentService;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class UserExportTest extends \Test\TestCase {
|
||||
|
||||
protected $boardMapper;
|
||||
protected $boardService;
|
||||
protected $stackMapper;
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Cron;
|
||||
|
||||
use OCA\Deck\Db\Board;
|
||||
use OCA\Deck\Db\BoardMapper;
|
||||
use OCA\Deck\Db\Card;
|
||||
use OCA\Deck\Db\CardMapper;
|
||||
use OCA\Deck\Notification\NotificationHelper;
|
||||
|
||||
@@ -31,7 +31,6 @@ use Test\AppFramework\Db\MapperTestUtility;
|
||||
* @group DB
|
||||
*/
|
||||
class AclMapperTest extends MapperTestUtility {
|
||||
|
||||
private $dbConnection;
|
||||
private $aclMapper;
|
||||
private $boardMapper;
|
||||
@@ -122,5 +121,4 @@ class AclMapperTest extends MapperTestUtility {
|
||||
$this->boardMapper->delete($board);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class AclTest extends \Test\TestCase {
|
||||
|
||||
private function createAclUser() {
|
||||
$acl = new Acl();
|
||||
$acl->setId(1);
|
||||
@@ -104,6 +103,5 @@ class AclTest extends \Test\TestCase {
|
||||
$this->assertEquals(false, $acl->getPermission(Acl::PERMISSION_MANAGE));
|
||||
$this->assertEquals(false, $acl->getPermission(Acl::PERMISSION_SHARE));
|
||||
$this->assertEquals(false, $acl->getPermission(5));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ namespace OCA\Deck\Db;
|
||||
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IUserManager;
|
||||
use Test\AppFramework\Db\MapperTestUtility;
|
||||
|
||||
@@ -144,5 +143,4 @@ class AttachmentMapperTest extends MapperTestUtility {
|
||||
$this->attachmentMapper->delete($attachment);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -171,5 +171,4 @@ class BoardMapperTest extends MapperTestUtility {
|
||||
$this->boardMapper->delete($board);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,12 +23,12 @@ class BoardTest extends TestCase {
|
||||
'title' => "My Board",
|
||||
'owner' => "admin",
|
||||
'color' => "000000",
|
||||
'labels' => array(),
|
||||
'labels' => [],
|
||||
'permissions' => [],
|
||||
'stacks' => [],
|
||||
'deletedAt' => 0,
|
||||
'lastModified' => 0,
|
||||
'acl' => array(),
|
||||
'acl' => [],
|
||||
'archived' => false,
|
||||
'users' => ['user1', 'user2'],
|
||||
], $board->jsonSerialize());
|
||||
@@ -36,18 +36,18 @@ class BoardTest extends TestCase {
|
||||
|
||||
public function testSetLabels() {
|
||||
$board = $this->createBoard();
|
||||
$board->setLabels(array("foo", "bar"));
|
||||
$board->setLabels(["foo", "bar"]);
|
||||
$this->assertEquals([
|
||||
'id' => 1,
|
||||
'title' => "My Board",
|
||||
'owner' => "admin",
|
||||
'color' => "000000",
|
||||
'labels' => array("foo", "bar"),
|
||||
'labels' => ["foo", "bar"],
|
||||
'permissions' => [],
|
||||
'stacks' => [],
|
||||
'deletedAt' => 0,
|
||||
'lastModified' => 0,
|
||||
'acl' => array(),
|
||||
'acl' => [],
|
||||
'archived' => false,
|
||||
'users' => [],
|
||||
], $board->jsonSerialize());
|
||||
@@ -56,7 +56,7 @@ class BoardTest extends TestCase {
|
||||
$acl = new Acl();
|
||||
$acl->setId(1);
|
||||
$board = $this->createBoard();
|
||||
$board->setAcl(array($acl));
|
||||
$board->setAcl([$acl]);
|
||||
$result = $board->getAcl()[0];
|
||||
$this->assertEquals($acl, $result);
|
||||
}
|
||||
@@ -68,12 +68,12 @@ class BoardTest extends TestCase {
|
||||
'title' => "My Board",
|
||||
'owner' => "admin",
|
||||
'color' => "000000",
|
||||
'labels' => array(),
|
||||
'labels' => [],
|
||||
'permissions' => [],
|
||||
'stacks' => [],
|
||||
'deletedAt' => 0,
|
||||
'lastModified' => 0,
|
||||
'acl' => array(),
|
||||
'acl' => [],
|
||||
'archived' => false,
|
||||
'shared' => 1,
|
||||
'users' => [],
|
||||
|
||||
@@ -88,7 +88,7 @@ class CardTest extends TestCase {
|
||||
}
|
||||
public function testJsonSerializeLabels() {
|
||||
$card = $this->createCard();
|
||||
$card->setLabels(array());
|
||||
$card->setLabels([]);
|
||||
$this->assertEquals([
|
||||
'id' => 1,
|
||||
'title' => "My Card",
|
||||
@@ -99,7 +99,7 @@ class CardTest extends TestCase {
|
||||
'owner' => 'admin',
|
||||
'order' => 12,
|
||||
'stackId' => 1,
|
||||
'labels' => array(),
|
||||
'labels' => [],
|
||||
'duedate' => null,
|
||||
'overdue' => 0,
|
||||
'archived' => false,
|
||||
@@ -123,7 +123,7 @@ class CardTest extends TestCase {
|
||||
public function testJsonSerializeAsignedUsers() {
|
||||
$card = $this->createCard();
|
||||
$card->setAssignedUsers([ 'user1' ]);
|
||||
$card->setLabels(array());
|
||||
$card->setLabels([]);
|
||||
$this->assertEquals([
|
||||
'id' => 1,
|
||||
'title' => "My Card",
|
||||
@@ -134,7 +134,7 @@ class CardTest extends TestCase {
|
||||
'owner' => 'admin',
|
||||
'order' => 12,
|
||||
'stackId' => 1,
|
||||
'labels' => array(),
|
||||
'labels' => [],
|
||||
'duedate' => null,
|
||||
'overdue' => 0,
|
||||
'archived' => false,
|
||||
@@ -146,5 +146,4 @@ class CardTest extends TestCase {
|
||||
'lastEditor' => null,
|
||||
], $card->jsonSerialize());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace OCA\Deck\Db;
|
||||
use OCP\IGroup;
|
||||
|
||||
class GroupTest extends \Test\TestCase {
|
||||
|
||||
public function testGroupObjectSerialize() {
|
||||
/** @var IGroup $group */
|
||||
$group = $this->createMock(IGroup::class);
|
||||
|
||||
@@ -44,7 +44,6 @@ class LabelTest extends TestCase {
|
||||
'lastModified' => null,
|
||||
'color' => '000000'
|
||||
], $label->jsonSerialize());
|
||||
|
||||
}
|
||||
public function testJsonSerializeCard() {
|
||||
$label = $this->createLabel();
|
||||
@@ -57,8 +56,5 @@ class LabelTest extends TestCase {
|
||||
'lastModified' => null,
|
||||
'color' => '000000'
|
||||
], $label->jsonSerialize());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace OCA\Deck\Db;
|
||||
|
||||
class RelationalEntityTest extends \Test\TestCase {
|
||||
|
||||
public function testRelation() {
|
||||
$entity = new RelationalEntity();
|
||||
$entity->foo = null;
|
||||
@@ -48,5 +47,4 @@ class RelationalEntityTest extends \Test\TestCase {
|
||||
];
|
||||
$this->assertEquals($json, $entity->jsonSerialize());
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user