From 53db418ee90eb366dc4488afcb02c8a6d5085097 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 20 May 2022 17:07:21 +0200 Subject: Cleanup oauth2 admin settings - Use more vue components - Add link to doc Signed-off-by: Carl Schwan --- apps/oauth2/lib/Settings/Admin.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'apps/oauth2/lib') diff --git a/apps/oauth2/lib/Settings/Admin.php b/apps/oauth2/lib/Settings/Admin.php index ddf5302a1aa..aa2bd6db012 100644 --- a/apps/oauth2/lib/Settings/Admin.php +++ b/apps/oauth2/lib/Settings/Admin.php @@ -28,21 +28,23 @@ namespace OCA\OAuth2\Settings; use OCA\OAuth2\Db\ClientMapper; use OCP\AppFramework\Http\TemplateResponse; -use OCP\IInitialStateService; +use OCP\AppFramework\Services\IInitialState; use OCP\Settings\ISettings; +use OCP\IURLGenerator; class Admin implements ISettings { + private IInitialState $initialState; + private ClientMapper $clientMapper; + private IURLGenerator $urlGenerator; - /** @var IInitialStateService */ - private $initialStateService; - - /** @var ClientMapper */ - private $clientMapper; - - public function __construct(IInitialStateService $initialStateService, - ClientMapper $clientMapper) { - $this->initialStateService = $initialStateService; + public function __construct( + IInitialState $initialState, + ClientMapper $clientMapper, + IURLGenerator $urlGenerator + ) { + $this->initialState = $initialState; $this->clientMapper = $clientMapper; + $this->urlGenerator = $urlGenerator; } public function getForm(): TemplateResponse { @@ -58,7 +60,8 @@ class Admin implements ISettings { 'clientSecret' => $client->getSecret(), ]; } - $this->initialStateService->provideInitialState('oauth2', 'clients', $result); + $this->initialState->provideInitialState('clients', $result); + $this->initialState->provideInitialState('oauth2-doc-link', $this->urlGenerator->linkToDocs('admin-oauth2')); return new TemplateResponse( 'oauth2', -- cgit v1.2.3