-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vitor Mattos <vitor@php.rio>
- Loading branch information
1 parent
62fe828
commit 894188a
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024-2024 LibreCode coop and contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Libresign\Listener; | ||
|
||
use OCA\Files\Event\LoadSidebar; | ||
use OCA\Intros\Events\FetchIntrosEvent; | ||
use OCA\Libresign\AppInfo\Application; | ||
use OCA\Libresign\Handler\CertificateEngine\Handler as CertificateEngineHandler; | ||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
use OCP\IL10N; | ||
|
||
/** | ||
* @template-implements IEventListener<Event|LoadSidebar> | ||
*/ | ||
class FetchIntrosListener implements IEventListener { | ||
Check failure on line 22 in lib/Listener/FetchIntrosListener.php GitHub Actions / static-psalm-analysisUndefinedDocblockClass
Check failure on line 22 in lib/Listener/FetchIntrosListener.php GitHub Actions / static-psalm-analysisInvalidTemplateParam
|
||
public function __construct( | ||
private IL10N $l10n, | ||
private CertificateEngineHandler $certificateEngineHandler, | ||
) { | ||
} | ||
|
||
public function handle(Event $event): void { | ||
Check failure on line 29 in lib/Listener/FetchIntrosListener.php GitHub Actions / static-psalm-analysisMoreSpecificImplementedParamType
|
||
if (!($event instanceof FetchIntrosEvent)) { | ||
Check failure on line 30 in lib/Listener/FetchIntrosListener.php GitHub Actions / static-psalm-analysisUndefinedClass
|
||
return; | ||
} | ||
if (!$this->certificateEngineHandler->getEngine()->isSetupOk()) { | ||
return; | ||
} | ||
$event->setData([ | ||
Application::APP_ID => [ | ||
'name' => $this->l10n->t('LibreSign'), | ||
'steps' => [ | ||
[ | ||
'title' => $this->l10n->t('Welcome!'), | ||
'paragraphs' => [ | ||
$this->l10n->t('The LibreSign app allows you to sign documents using your digital certificate or the certificate generated by LibreSign.'), | ||
], | ||
'choices' => [ | ||
[ | ||
'success' => false, | ||
'label' => $this->l10n->t('Skip this tutorial'), | ||
] | ||
], | ||
'element' => '', | ||
], | ||
[ | ||
'paragraphs' => [ | ||
$this->l10n->t('Choose the file to request signatures.'), | ||
], | ||
'element' => 'div#container-request', | ||
], | ||
[ | ||
'paragraphs' => [ | ||
$this->l10n->t('List the files that are associated to you.'), | ||
], | ||
'element' => 'li#timeline', | ||
], | ||
[ | ||
'paragraphs' => [ | ||
$this->l10n->t('Validate signature'), | ||
], | ||
'element' => 'li#validation', | ||
], | ||
[ | ||
'title' => $this->l10n->t('Settings'), | ||
'paragraphs' => [ | ||
$this->l10n->t('Your personal settings.'), | ||
$this->l10n->t('Here you can manage your digital certificate or your visible signature.'), | ||
], | ||
'element' => 'div#app-settings', | ||
'open' => 'div#app-settings__header > .settings-button', | ||
'position' => 'top', | ||
], | ||
[ | ||
'title' => 'See you!', | ||
'paragraphs' => [ | ||
$this->l10n->t('Help maintain the development of this app by contributing via GitHub Sponsors.'), | ||
], | ||
], | ||
], | ||
], | ||
]); | ||
} | ||
} |