Skip to content

Commit 32e2dd5

Browse files
committed
chore: add initial state
Signed-off-by: Crisciany Souza <[email protected]>
1 parent 87b90fb commit 32e2dd5

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

lib/Service/Certificate/RulesService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function getRule(string $fieldName): array {
5959
public function getHelperText(string $fieldName): ?string {
6060
return match ($fieldName) {
6161
'CN' => $this->l10n->t('Common Name (CN)'),
62-
'C' => $tcertificate/his->l10n->t('Two-letter ISO 3166 country code'),
62+
'C' => $this->l10n->t('Two-letter ISO 3166 country code'),
6363
'ST' => $this->l10n->t('Full name of states or provinces'),
6464
'L' => $this->l10n->t('Name of a locality or place, such as a city, county, or other geographic region'),
6565
'O' => $this->l10n->t('Name of an organization'),
@@ -68,7 +68,7 @@ public function getHelperText(string $fieldName): ?string {
6868
};
6969
}
7070

71-
public function getAllRules(): array {
71+
public function toArray(): array {
7272
$result = [];
7373
foreach ($this->rules as $field => $rule) {
7474
$result[] = [

lib/Settings/Admin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use OCA\Libresign\Service\IdentifyMethodService;
1616
use OCA\Libresign\Service\SignatureBackgroundService;
1717
use OCA\Libresign\Service\SignatureTextService;
18+
use OCA\Libresign\Service\Certificate\RulesService;
1819
use OCP\AppFramework\Http\TemplateResponse;
1920
use OCP\AppFramework\Services\IInitialState;
2021
use OCP\IAppConfig;
@@ -30,6 +31,7 @@ public function __construct(
3031
private IAppConfig $appConfig,
3132
private SignatureTextService $signatureTextService,
3233
private SignatureBackgroundService $signatureBackgroundService,
34+
private RulesService $rulesService,
3335
) {
3436
}
3537
public function getForm(): TemplateResponse {
@@ -44,6 +46,7 @@ public function getForm(): TemplateResponse {
4446
$this->initialState->provideInitialState('certificate_engine', $this->certificateEngineFactory->getEngine()->getName());
4547
$this->initialState->provideInitialState('certificate_policies_oid', $this->certificatePolicyService->getOid());
4648
$this->initialState->provideInitialState('certificate_policies_cps', $this->certificatePolicyService->getCps());
49+
$this->initialState->provideInitialState('rules_service', $this->rulesService->toArray());
4750
$this->initialState->provideInitialState('config_path', $this->appConfig->getValueString(Application::APP_ID, 'config_path'));
4851
$this->initialState->provideInitialState('default_signature_font_size', SignatureTextService::SIGNATURE_DEFAULT_FONT_SIZE);
4952
$this->initialState->provideInitialState('default_signature_height', SignatureTextService::DEFAULT_SIGNATURE_HEIGHT);

src/views/Settings/RootCertificateOpenSsl.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export default {
137137
data() {
138138
const OID = loadState('libresign', 'certificate_policies_oid')
139139
const CPS = loadState('libresign', 'certificate_policies_cps')
140+
const rulesService = loadState('libresign', 'rules_service')
140141
return {
141142
isThisEngine: loadState('libresign', 'certificate_engine') === 'openssl',
142143
modal: false,

0 commit comments

Comments
 (0)