change command to user:applications

This commit is contained in:
aynsix
2020-02-27 18:29:56 +03:00
parent 45ab79f506
commit c1c69670b2
2 changed files with 10 additions and 5 deletions

View File

@@ -31,7 +31,7 @@ use Alchemy\Phrasea\Command\Compile\Configuration;
use Alchemy\Phrasea\Command\RecordAdd; use Alchemy\Phrasea\Command\RecordAdd;
use Alchemy\Phrasea\Command\RescanTechnicalDatas; use Alchemy\Phrasea\Command\RescanTechnicalDatas;
use Alchemy\Phrasea\CLI; use Alchemy\Phrasea\CLI;
use Alchemy\Phrasea\Command\Application\ApplicationAppCommand; use Alchemy\Phrasea\Command\User\UserApplicationsCommand;
use Alchemy\Phrasea\Command\Plugin\AddPlugin; use Alchemy\Phrasea\Command\Plugin\AddPlugin;
use Alchemy\Phrasea\Command\Plugin\RemovePlugin; use Alchemy\Phrasea\Command\Plugin\RemovePlugin;
use Alchemy\Phrasea\Command\CheckConfig; use Alchemy\Phrasea\Command\CheckConfig;
@@ -113,7 +113,7 @@ $cli->command(new \module_console_fieldsDelete('fields:delete'));
$cli->command(new \module_console_fieldsRename('fields:rename')); $cli->command(new \module_console_fieldsRename('fields:rename'));
$cli->command(new \module_console_fieldsMerge('fields:merge')); $cli->command(new \module_console_fieldsMerge('fields:merge'));
$cli->command(new ApplicationAppCommand('application:app')); $cli->command(new UserApplicationsCommand('user:applications'));
$cli->command(new CreateCollection('collection:create')); $cli->command(new CreateCollection('collection:create'));
$cli->command(new ListCollectionCommand('collection:list')); $cli->command(new ListCollectionCommand('collection:list'));

View File

@@ -9,7 +9,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Alchemy\Phrasea\Command\Application; namespace Alchemy\Phrasea\Command\User;
use Alchemy\Phrasea\Command\Command; use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\Core\LazyLocator; use Alchemy\Phrasea\Core\LazyLocator;
@@ -24,7 +24,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
class ApplicationAppCommand extends Command class UserApplicationsCommand extends Command
{ {
/** /**
@@ -32,7 +32,7 @@ class ApplicationAppCommand extends Command
*/ */
public function __construct($name = null) public function __construct($name = null)
{ {
parent::__construct('application:app'); parent::__construct('user:applications');
$this->setDescription('List, Create, Edit, Delete application in Phraseanet <comment>(experimental)</>') $this->setDescription('List, Create, Edit, Delete application in Phraseanet <comment>(experimental)</>')
->addOption('user_id', 'u', InputOption::VALUE_REQUIRED, 'The id of user.') ->addOption('user_id', 'u', InputOption::VALUE_REQUIRED, 'The id of user.')
@@ -129,6 +129,11 @@ class ApplicationAppCommand extends Command
} }
} }
if ($webhookUrl) {
$applicationManipulator->setWebhookUrl($application, $webhookUrl);
$applicationManipulator->update($application);
}
$this->showApllicationInformation($apiOauthRepository, $account, $application, $jsonformat, $output); $this->showApllicationInformation($apiOauthRepository, $account, $application, $jsonformat, $output);
} catch (\Exception $e) { } catch (\Exception $e) {
$output->writeln('<error>Create an application for user failed : '.$e->getMessage().'</error>'); $output->writeln('<error>Create an application for user failed : '.$e->getMessage().'</error>');