diff --git a/lib/Search/CardCommentProvider.php b/lib/Search/CardCommentProvider.php index 57257956c..802cc22c1 100644 --- a/lib/Search/CardCommentProvider.php +++ b/lib/Search/CardCommentProvider.php @@ -62,7 +62,7 @@ class CardCommentProvider implements IProvider { if (count($results) < $query->getLimit()) { return SearchResult::complete( $this->l10n->t('Card comments'), - $results, + $results ); } diff --git a/lib/Search/DeckProvider.php b/lib/Search/DeckProvider.php index 010fd3eaa..5015ab070 100644 --- a/lib/Search/DeckProvider.php +++ b/lib/Search/DeckProvider.php @@ -78,7 +78,7 @@ class DeckProvider implements IProvider { if (count($cardResults) < $query->getLimit()) { return SearchResult::complete( 'Deck', - $results, + $results ); } diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php index dce57822f..d3398f204 100644 --- a/lib/Service/SearchService.php +++ b/lib/Service/SearchService.php @@ -32,6 +32,9 @@ use OCA\Deck\Db\CardMapper; use OCA\Deck\Search\CommentSearchResultEntry; use OCA\Deck\Search\FilterStringParser; use OCP\Comments\ICommentsManager; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\IUserManager; class SearchService { @@ -45,19 +48,31 @@ class SearchService { private $commentsManager; /** @var FilterStringParser */ private $filterStringParser; + /** @var IUserManager */ + private $userManager; + /** @var IL10N */ + private $l10n; + /** @var IURLGenerator */ + private $urlGenerator; public function __construct( BoardService $boardService, CardMapper $cardMapper, CardService $cardService, ICommentsManager $commentsManager, - FilterStringParser $filterStringParser + FilterStringParser $filterStringParser, + IUserManager $userManager, + IL10N $l10n, + IURLGenerator $urlGenerator ) { $this->boardService = $boardService; $this->cardMapper = $cardMapper; $this->cardService = $cardService; $this->commentsManager = $commentsManager; $this->filterStringParser = $filterStringParser; + $this->userManager = $userManager; + $this->l10n = $l10n; + $this->urlGenerator = $urlGenerator; } public function searchCards(string $term, int $limit = null, ?int $cursor = null): array { @@ -89,7 +104,7 @@ class SearchService { $matchedComments = $this->cardMapper->searchComments($boardIds, $this->filterStringParser->parse($term), $limit, $cursor); $self = $this; - return array_filter(array_map(function ($cardRow) use ($self) { + return array_map(function ($cardRow) use ($self) { $comment = $this->commentsManager->get($cardRow['comment_id']); unset($cardRow['comment_id']); $card = Card::fromRow($cardRow); @@ -97,6 +112,6 @@ class SearchService { $user = $this->userManager->get($comment->getActorId()); $displayName = $user ? $user->getDisplayName() : ''; return new CommentSearchResultEntry($comment->getId(), $comment->getMessage(), $displayName, $card, $this->urlGenerator, $this->l10n); - }, $matchedComments)); + }, $matchedComments); } } diff --git a/src/components/board/Board.vue b/src/components/board/Board.vue index 7a3d49efb..d47ea1a38 100644 --- a/src/components/board/Board.vue +++ b/src/components/board/Board.vue @@ -65,6 +65,7 @@

+ @@ -75,10 +76,12 @@ import { mapState, mapGetters } from 'vuex' import Controls from '../Controls' import Stack from './Stack' import { EmptyContent } from '@nextcloud/vue' +import GlobalSearchResults from '../search/GlobalSearchResults' export default { name: 'Board', components: { + GlobalSearchResults, Controls, Container, Draggable, @@ -178,13 +181,17 @@ export default { width: 100%; height: 100%; max-height: calc(100vh - 50px); + display: flex; + flex-direction: column; } .board { padding-left: $board-spacing; position: relative; - height: calc(100% - 44px); - overflow-x: scroll; + max-height: calc(100% - 44px); + overflow: hidden; + overflow-x: auto; + flex-grow: 1; } /** diff --git a/src/components/cards/CardItem.vue b/src/components/cards/CardItem.vue index c88e25841..3a0675792 100644 --- a/src/components/cards/CardItem.vue +++ b/src/components/cards/CardItem.vue @@ -26,12 +26,16 @@