-
-
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
1ddddbb
commit cc37e31
Showing
3 changed files
with
113 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 { | ||
public function __construct( | ||
private IL10N $l10n, | ||
private CertificateEngineHandler $certificateEngineHandler, | ||
) { | ||
} | ||
|
||
public function handle(Event $event): void { | ||
if (!($event instanceof FetchIntrosEvent)) { | ||
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.'), | ||
], | ||
], | ||
], | ||
], | ||
]); | ||
} | ||
} |
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