mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Merge pull request #2524 from acelaya-forks/list-urls-deprecations
Remove deprecated options from short-url:list command
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -88,7 +88,7 @@ jobs:
|
|||||||
- name: Publish coverage
|
- name: Publish coverage
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./build/clover.xml
|
files: ./build/clover.xml
|
||||||
|
|
||||||
delete-artifacts:
|
delete-artifacts:
|
||||||
needs:
|
needs:
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||||||
* [#2514](https://github.com/shlinkio/shlink/issues/2514) Remove support to generate QR codes. This functionality is now handled by Shlink Web Client and Shlink Dashboard.
|
* [#2514](https://github.com/shlinkio/shlink/issues/2514) Remove support to generate QR codes. This functionality is now handled by Shlink Web Client and Shlink Dashboard.
|
||||||
* [#2517](https://github.com/shlinkio/shlink/issues/2517) Remove `REDIRECT_APPEND_EXTRA_PATH` env var. Use `REDIRECT_EXTRA_PATH_MODE=append` instead.
|
* [#2517](https://github.com/shlinkio/shlink/issues/2517) Remove `REDIRECT_APPEND_EXTRA_PATH` env var. Use `REDIRECT_EXTRA_PATH_MODE=append` instead.
|
||||||
* [#2519](https://github.com/shlinkio/shlink/issues/2519) Disabling API keys by their plain-text key is no longer supported. When calling `api-key:disable`, the first argument is now always assumed to be the name.
|
* [#2519](https://github.com/shlinkio/shlink/issues/2519) Disabling API keys by their plain-text key is no longer supported. When calling `api-key:disable`, the first argument is now always assumed to be the name.
|
||||||
|
* [#2520](https://github.com/shlinkio/shlink/issues/2520) Remove deprecated `--including-all-tags` and `--show-api-key-name` deprecated options from `short-url:list` command. Use `--tags-all` and `--show-api-key` instead.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* *Nothing*
|
* *Nothing*
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use Mezzio;
|
|||||||
use Mezzio\ProblemDetails;
|
use Mezzio\ProblemDetails;
|
||||||
use Shlinkio\Shlink\Core\Config\EnvVars;
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
||||||
|
|
||||||
return (new ConfigAggregator\ConfigAggregator(
|
return new ConfigAggregator\ConfigAggregator(
|
||||||
providers: [
|
providers: [
|
||||||
Mezzio\ConfigProvider::class,
|
Mezzio\ConfigProvider::class,
|
||||||
Mezzio\Router\ConfigProvider::class,
|
Mezzio\Router\ConfigProvider::class,
|
||||||
@@ -39,4 +39,4 @@ return (new ConfigAggregator\ConfigAggregator(
|
|||||||
Core\Config\PostProcessor\MultiSegmentSlugProcessor::class,
|
Core\Config\PostProcessor\MultiSegmentSlugProcessor::class,
|
||||||
Core\Config\PostProcessor\ShortUrlMethodsProcessor::class,
|
Core\Config\PostProcessor\ShortUrlMethodsProcessor::class,
|
||||||
],
|
],
|
||||||
))->getMergedConfig();
|
)->getMergedConfig();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class DeleteKeyCommand extends Command
|
|||||||
|
|
||||||
if ($apiKeyName === null) {
|
if ($apiKeyName === null) {
|
||||||
$apiKeys = $this->apiKeyService->listKeys();
|
$apiKeys = $this->apiKeyService->listKeys();
|
||||||
$name = (new SymfonyStyle($input, $output))->choice(
|
$name = new SymfonyStyle($input, $output)->choice(
|
||||||
'What API key do you want to delete?',
|
'What API key do you want to delete?',
|
||||||
map($apiKeys, static fn (ApiKey $apiKey) => $apiKey->name),
|
map($apiKeys, static fn (ApiKey $apiKey) => $apiKey->name),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ class ListShortUrlsCommand extends Command
|
|||||||
InputOption::VALUE_REQUIRED,
|
InputOption::VALUE_REQUIRED,
|
||||||
'Used to filter results by domain. Use DEFAULT keyword to filter by default domain',
|
'Used to filter results by domain. Use DEFAULT keyword to filter by default domain',
|
||||||
)
|
)
|
||||||
->addOption('including-all-tags', 'i', InputOption::VALUE_NONE, '[DEPRECATED] Use --tags-all instead')
|
|
||||||
->addOption(
|
->addOption(
|
||||||
'tags-all',
|
'tags-all',
|
||||||
mode: InputOption::VALUE_NONE,
|
mode: InputOption::VALUE_NONE,
|
||||||
@@ -133,7 +132,6 @@ class ListShortUrlsCommand extends Command
|
|||||||
InputOption::VALUE_NONE,
|
InputOption::VALUE_NONE,
|
||||||
'Whether to display the API key name from which the URL was generated or not.',
|
'Whether to display the API key name from which the URL was generated or not.',
|
||||||
)
|
)
|
||||||
->addOption('show-api-key-name', 'm', InputOption::VALUE_NONE, '[DEPRECATED] Use show-api-key')
|
|
||||||
->addOption(
|
->addOption(
|
||||||
'all',
|
'all',
|
||||||
'a',
|
'a',
|
||||||
@@ -148,9 +146,7 @@ class ListShortUrlsCommand extends Command
|
|||||||
$io = new SymfonyStyle($input, $output);
|
$io = new SymfonyStyle($input, $output);
|
||||||
|
|
||||||
$page = (int) $input->getOption('page');
|
$page = (int) $input->getOption('page');
|
||||||
$tagsMode = $input->getOption('tags-all') === true || $input->getOption('including-all-tags') === true
|
$tagsMode = $input->getOption('tags-all') === true ? TagsMode::ALL->value : TagsMode::ANY->value;
|
||||||
? TagsMode::ALL->value
|
|
||||||
: TagsMode::ANY->value;
|
|
||||||
$excludeTagsMode = $input->getOption('exclude-tags-all') === true ? TagsMode::ALL->value : TagsMode::ANY->value;
|
$excludeTagsMode = $input->getOption('exclude-tags-all') === true ? TagsMode::ALL->value : TagsMode::ANY->value;
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@@ -249,7 +245,7 @@ class ListShortUrlsCommand extends Command
|
|||||||
$columnsMap['Domain'] = static fn (array $_, ShortUrl $shortUrl): string =>
|
$columnsMap['Domain'] = static fn (array $_, ShortUrl $shortUrl): string =>
|
||||||
$shortUrl->getDomain()->authority ?? Domain::DEFAULT_AUTHORITY;
|
$shortUrl->getDomain()->authority ?? Domain::DEFAULT_AUTHORITY;
|
||||||
}
|
}
|
||||||
if ($input->getOption('show-api-key') || $input->getOption('show-api-key-name')) {
|
if ($input->getOption('show-api-key')) {
|
||||||
$columnsMap['API Key Name'] = static fn (array $_, ShortUrl $shortUrl): string|null =>
|
$columnsMap['API Key Name'] = static fn (array $_, ShortUrl $shortUrl): string|null =>
|
||||||
$shortUrl->authorApiKey?->name;
|
$shortUrl->authorApiKey?->name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ class ListShortUrlsCommandTest extends TestCase
|
|||||||
{
|
{
|
||||||
yield [[], 1, null, [], TagsMode::ANY->value];
|
yield [[], 1, null, [], TagsMode::ANY->value];
|
||||||
yield [['--page' => $page = 3], $page, null, [], TagsMode::ANY->value];
|
yield [['--page' => $page = 3], $page, null, [], TagsMode::ANY->value];
|
||||||
yield [['--including-all-tags' => true], 1, null, [], TagsMode::ALL->value];
|
yield [['--tags-all' => true], 1, null, [], TagsMode::ALL->value];
|
||||||
yield [['--search-term' => $searchTerm = 'search this'], 1, $searchTerm, [], TagsMode::ANY->value];
|
yield [['--search-term' => $searchTerm = 'search this'], 1, $searchTerm, [], TagsMode::ANY->value];
|
||||||
yield [
|
yield [
|
||||||
['--page' => $page = 3, '--search-term' => $searchTerm = 'search this', '--tag' => $tags = ['foo', 'bar']],
|
['--page' => $page = 3, '--search-term' => $searchTerm = 'search this', '--tag' => $tags = ['foo', 'bar']],
|
||||||
|
|||||||
Reference in New Issue
Block a user