mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 13:03:52 +03:00
Merge pull request #646 from acelaya-forks/feature/search-on-domains
Feature/search on domains
This commit is contained in:
commit
6e1d07b0cc
3 changed files with 13 additions and 7 deletions
|
@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
|
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
|
||||||
|
|
||||||
## [Unreleased]
|
## 2.0.4 - 2020-02-02
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
||||||
* [#620](https://github.com/shlinkio/shlink/issues/620) Ensured "controlled" errors (like validation errors and such) won't be logged with error level, preventing logs to be polluted.
|
* [#620](https://github.com/shlinkio/shlink/issues/620) Ensured "controlled" errors (like validation errors and such) won't be logged with error level, preventing logs to be polluted.
|
||||||
* [#637](https://github.com/shlinkio/shlink/issues/637) Fixed several work flows in which short URLs with domain are handled form the API.
|
* [#637](https://github.com/shlinkio/shlink/issues/637) Fixed several work flows in which short URLs with domain are handled form the API.
|
||||||
* [#644](https://github.com/shlinkio/shlink/issues/644) Fixed visits to short URL on non-default domain being linked to the URL on default domain with the same short code.
|
* [#644](https://github.com/shlinkio/shlink/issues/644) Fixed visits to short URL on non-default domain being linked to the URL on default domain with the same short code.
|
||||||
|
* [#643](https://github.com/shlinkio/shlink/issues/643) Fixed searching on short URL lists not taking into consideration the domain name.
|
||||||
|
|
||||||
|
|
||||||
## 2.0.3 - 2020-01-27
|
## 2.0.3 - 2020-01-27
|
||||||
|
|
|
@ -110,12 +110,14 @@ class ShortUrlRepository extends EntityRepository implements ShortUrlRepositoryI
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply search conditions
|
// Apply search conditions
|
||||||
$qb->andWhere($qb->expr()->orX(
|
$qb->leftJoin('s.domain', 'd')
|
||||||
$qb->expr()->like('s.longUrl', ':searchPattern'),
|
->andWhere($qb->expr()->orX(
|
||||||
$qb->expr()->like('s.shortCode', ':searchPattern'),
|
$qb->expr()->like('s.longUrl', ':searchPattern'),
|
||||||
$qb->expr()->like('t.name', ':searchPattern'),
|
$qb->expr()->like('s.shortCode', ':searchPattern'),
|
||||||
));
|
$qb->expr()->like('t.name', ':searchPattern'),
|
||||||
$qb->setParameter('searchPattern', '%' . $searchTerm . '%');
|
$qb->expr()->like('d.authority', ':searchPattern'),
|
||||||
|
))
|
||||||
|
->setParameter('searchPattern', '%' . $searchTerm . '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter by tags if provided
|
// Filter by tags if provided
|
||||||
|
|
|
@ -169,6 +169,9 @@ class ListShortUrlsTest extends ApiTestCase
|
||||||
self::SHORT_URL_META,
|
self::SHORT_URL_META,
|
||||||
self::SHORT_URL_CUSTOM_DOMAIN,
|
self::SHORT_URL_CUSTOM_DOMAIN,
|
||||||
]];
|
]];
|
||||||
|
yield [['searchTerm' => 'example.com'], [
|
||||||
|
self::SHORT_URL_CUSTOM_DOMAIN,
|
||||||
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildPagination(int $itemsCount): array
|
private function buildPagination(int $itemsCount): array
|
||||||
|
|
Loading…
Add table
Reference in a new issue