diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-20 17:07:21 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-07-14 12:16:13 +0200 |
commit | 53db418ee90eb366dc4488afcb02c8a6d5085097 (patch) | |
tree | de00140c7fd92bf85bdf6853197abbf093396849 /apps/oauth2/lib | |
parent | d3f66e2310ef790794aba81f12d7ab6a035736c3 (diff) | |
download | nextcloud-server-53db418ee90eb366dc4488afcb02c8a6d5085097.tar.gz nextcloud-server-53db418ee90eb366dc4488afcb02c8a6d5085097.zip |
Cleanup oauth2 admin settings
- Use more vue components
- Add link to doc
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/oauth2/lib')
-rw-r--r-- | apps/oauth2/lib/Settings/Admin.php | 25 |
1 files changed, 14 insertions, 11 deletions
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', |