Skip to content

Commit c73ef0e

Browse files
committed
feat(signature-stamp): implement index behavior
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 2623a3c commit c73ef0e

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

  • src/views/Settings/PolicyWorkbench/settings/signature-stamp
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2026 LibreCode coop and LibreCode contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { t } from '@nextcloud/l10n'
7+
8+
import SignatureStampRuleEditor from './SignatureStampRuleEditor.vue'
9+
import type { PolicySettingDefinition } from '../../types'
10+
11+
export const signatureStampDefinition: PolicySettingDefinition<'signature_stamp'> = {
12+
key: 'signature_stamp',
13+
title: t('libresign', 'Signature stamp'),
14+
description: t('libresign', 'Manage the visible signature block, template and dimensions with a richer policy model.'),
15+
menuHint: t('libresign', 'Complex policy example with dimensions, render modes, template text, and background behavior.'),
16+
editor: SignatureStampRuleEditor,
17+
createEmptyValue: () => ({
18+
enabled: true,
19+
renderMode: 'GRAPHIC_AND_DESCRIPTION',
20+
template: '{{ signer_name }} - {{ signed_at }}',
21+
templateFontSize: 10,
22+
signatureFontSize: 20,
23+
signatureWidth: 180,
24+
signatureHeight: 70,
25+
backgroundMode: 'default',
26+
showSigningDate: true,
27+
}),
28+
summarizeValue: (value) => {
29+
if (!value.enabled) {
30+
return t('libresign', 'Disabled')
31+
}
32+
33+
return `${value.renderMode} - ${value.signatureWidth}x${value.signatureHeight}`
34+
},
35+
formatAllowOverride: (allowChildOverride) => allowChildOverride
36+
? t('libresign', 'Lower layers may override this rule')
37+
: t('libresign', 'Lower layers must inherit this value'),
38+
}

0 commit comments

Comments
 (0)