Skip to content

Commit f1367fc

Browse files
authored
Merge branch 'main' into prevent-invalid-year-input
2 parents c6f7c22 + d48060e commit f1367fc

18 files changed

Lines changed: 674 additions & 494 deletions

File tree

l10n/be.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ OC.L10N.register(
2424
"Keep existing file" : "Пакінуць існуючы файл",
2525
"Add list" : "Дадаць спіс",
2626
"Active filters" : "Актыўныя фільтры",
27-
"Apply filter" : "Ужыць фільтр",
27+
"Apply filter" : "Прымяніць фільтр",
2828
"Open" : "Адкрыць",
2929
"Clear filter" : "Ачысціць фільтр",
3030
"Open details" : "Адкрыць падрабязнасці",

l10n/be.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Keep existing file" : "Пакінуць існуючы файл",
2323
"Add list" : "Дадаць спіс",
2424
"Active filters" : "Актыўныя фільтры",
25-
"Apply filter" : "Ужыць фільтр",
25+
"Apply filter" : "Прымяніць фільтр",
2626
"Open" : "Адкрыць",
2727
"Clear filter" : "Ачысціць фільтр",
2828
"Open details" : "Адкрыць падрабязнасці",

l10n/hr.js

Lines changed: 133 additions & 3 deletions
Large diffs are not rendered by default.

l10n/hr.json

Lines changed: 133 additions & 3 deletions
Large diffs are not rendered by default.

l10n/uz.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ OC.L10N.register(
5959
"seconds ago" : "seconds ago",
6060
"Archived boards" : "Arxivlangan taxtalar",
6161
"Shared with you" : "Shared with you",
62+
"Cancel edit" : "Tahrirni bekor qilish",
6263
"No reminder" : "Eslatma yo'q",
6364
"Edit board" : "Tahrirlash paneli",
6465
"Clone board" : "Klon taxtasi",

l10n/uz.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"seconds ago" : "seconds ago",
5858
"Archived boards" : "Arxivlangan taxtalar",
5959
"Shared with you" : "Shared with you",
60+
"Cancel edit" : "Tahrirni bekor qilish",
6061
"No reminder" : "Eslatma yo'q",
6162
"Edit board" : "Tahrirlash paneli",
6263
"Clone board" : "Klon taxtasi",

lib/Activity/DeckProvider.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use OCA\Deck\Db\Acl;
1111
use OCA\Deck\Service\CardService;
12+
use OCA\Deck\Service\CirclesService;
1213
use OCP\Activity\IEvent;
1314
use OCP\Activity\IProvider;
1415
use OCP\Comments\IComment;
@@ -38,7 +39,10 @@ class DeckProvider implements IProvider {
3839
/** @var CardService */
3940
private $cardService;
4041

41-
public function __construct(IURLGenerator $urlGenerator, ActivityManager $activityManager, IUserManager $userManager, ICommentsManager $commentsManager, IFactory $l10n, IConfig $config, $userId, CardService $cardService) {
42+
/** @var CirclesService */
43+
private $circlesService;
44+
45+
public function __construct(IURLGenerator $urlGenerator, ActivityManager $activityManager, IUserManager $userManager, ICommentsManager $commentsManager, IFactory $l10n, IConfig $config, $userId, CardService $cardService, CirclesService $circlesService) {
4246
$this->userId = $userId;
4347
$this->urlGenerator = $urlGenerator;
4448
$this->activityManager = $activityManager;
@@ -47,6 +51,7 @@ public function __construct(IURLGenerator $urlGenerator, ActivityManager $activi
4751
$this->l10nFactory = $l10n;
4852
$this->config = $config;
4953
$this->cardService = $cardService;
54+
$this->circlesService = $circlesService;
5055
}
5156

5257
/**
@@ -275,6 +280,17 @@ private function parseParamForAcl($subjectParams, $params) {
275280
'id' => $subjectParams['acl']['participant'],
276281
'name' => $user !== null ? $user->getDisplayName() : $subjectParams['acl']['participant']
277282
];
283+
} elseif ($subjectParams['acl']['type'] === Acl::PERMISSION_TYPE_CIRCLE) {
284+
$circle = $this->circlesService->getCircle($subjectParams['acl']['participant']);
285+
286+
// suppressing psalm because $circle is typed as Circle|null but psalm doesnt know about the OCA class
287+
// $circle->getName() will be defined when $circle is not null
288+
/** @psalm-suppress UndefinedMethod */
289+
$params['acl'] = [
290+
'type' => 'highlight',
291+
'id' => $subjectParams['acl']['participant'],
292+
'name' => $circle ? $circle->getName() : $subjectParams['acl']['participant']
293+
];
278294
} else {
279295
$params['acl'] = [
280296
'type' => 'highlight',

lib/Sharing/DeckShareProvider.php

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,39 @@ private function _getSharedWith(
751751
}
752752

753753
if ($path !== null) {
754-
$qb->leftJoin('s', 'share', 'sc', $qb->expr()->eq('s.parent', 'sc.id'))
755-
->andWhere($qb->expr()->eq('sc.share_type', $qb->createNamedParameter(IShare::TYPE_DECK_USER)))
756-
->andWhere($qb->expr()->eq('sc.share_with', $qb->createNamedParameter($userId)));
754+
$path = str_replace('/' . $userId . '/files', '', $path);
755+
$path = rtrim($path, '/');
756+
757+
$onClause = $qb->expr()->andX(
758+
$qb->expr()->eq('sc.parent', 's.id'),
759+
$qb->expr()->eq('sc.share_type', $qb->createNamedParameter(IShare::TYPE_DECK_USER)),
760+
$qb->expr()->eq('sc.share_with', $qb->createNamedParameter($userId)),
761+
);
762+
$qb->leftJoin('s', 'share', 'sc', $onClause);
757763

758764
if ($forChildren) {
759-
$qb->andWhere($qb->expr()->like('sc.file_target', $qb->createNamedParameter($this->dbConnection->escapeLikeParameter($path) . '_%')));
765+
$childPathTemplate = $this->dbConnection->escapeLikeParameter($path) . '/_%';
766+
767+
$qb->andWhere(
768+
$qb->expr()->orX(
769+
$qb->expr()->like('sc.file_target', $qb->createNamedParameter($childPathTemplate, IQueryBuilder::PARAM_STR)),
770+
$qb->expr()->andX(
771+
$qb->expr()->isNull('sc.file_target'),
772+
$qb->expr()->like('s.file_target', $qb->createNamedParameter($childPathTemplate, IQueryBuilder::PARAM_STR)),
773+
),
774+
),
775+
);
760776
} else {
761-
$qb->andWhere($qb->expr()->eq('sc.file_target', $qb->createNamedParameter($path)));
777+
$nonChildPath = $path === '' ? '/' : $path;
778+
$qb->andWhere(
779+
$qb->expr()->orX(
780+
$qb->expr()->eq('sc.file_target', $qb->createNamedParameter($nonChildPath, IQueryBuilder::PARAM_STR)),
781+
$qb->expr()->andX(
782+
$qb->expr()->isNull('sc.file_target'),
783+
$qb->expr()->eq('s.file_target', $qb->createNamedParameter($nonChildPath, IQueryBuilder::PARAM_STR)),
784+
),
785+
),
786+
);
762787
}
763788
}
764789

0 commit comments

Comments
 (0)