Commit graph

10596 commits

Author SHA1 Message Date
Vitor Mattos
45806e18d7
Merge pull request #6231 from LibreSign/feat/signing-order-visual-diagram
feat: signing order visual diagram
2025-12-17 02:53:00 -03:00
Vitor Mattos
73615a77d4
fix: use correct Nextcloud instanceid in PKI path initialization
The initializePkiConfigPath method was using a variable named
'instanceId' from getSystemValue('instanceid') which could be confused
with LibreSign's instance_id. Changed to 'systemInstanceId' for clarity
and consistency with getConfigPathByParams method.

This ensures the PKI directories are created in the correct appdata path
using Nextcloud's system instance ID, while the directory name itself
contains LibreSign's CA identifier with its own instance ID.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:36:56 -03:00
Vitor Mattos
5048bfb07e
test: update SignatureFlow tests for NONE mode
Add NONE mode to valid flow provider and remove zero from
invalid numeric values since 0 is now a valid value (NONE).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:11:27 -03:00
Vitor Mattos
e616899eeb
fix: only show preserve order toggle with multiple signers
Hide preserve signing order toggle when there's only one signer,
as signing order is not applicable in this case.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:09:35 -03:00
Vitor Mattos
1d90a1dfc0
feat: add preserve order toggle and view diagram button
Add UI controls in RequestSignatureTab:
- Preserve signing order toggle switch
- View signing order diagram button
- Modal with SigningOrderDiagram component
- Sync preserve order state with file changes

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:04:12 -03:00
Vitor Mattos
50544d6b0a
feat: add SigningOrderDiagram visual component
Add visual diagram component showing signing flow with:
- Sender stage at top
- Numbered order stages with signers
- Status indicators (signed/pending/draft)
- NcPopover with detailed signer info
- Completed stage at bottom

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:04:03 -03:00
Vitor Mattos
e999c8c7d3
fix: handle numeric signature flow values in frontend
Convert numeric flow values (0=none, 1=parallel, 2=ordered_numeric)
to string equivalents in Signer, Signers, and files store.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:03:54 -03:00
Vitor Mattos
86d486a717
fix: use NONE as default signature flow in initial states
Update default signature flow from 'parallel' to 'none' in page
controller, template loader, admin settings, and settings view.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:03:45 -03:00
Vitor Mattos
8cf477fcbc
feat: add signatureFlow parameter to PATCH endpoint
Add optional signatureFlow parameter to request-signature PATCH
endpoint. Updates OpenAPI specs and TypeScript types.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:03:37 -03:00
Vitor Mattos
a0a58a0d8b
feat: allow signature flow update on existing files
Enable users to change signature flow when updating file if admin
has not enforced a specific flow mode.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:03:29 -03:00
Vitor Mattos
dd0ac0a007
feat: add NONE mode to SignatureFlow enum
Allow admin to not enforce signing flow, letting users choose
per document. Updates enum, File entity, and migration defaults.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:03:20 -03:00
Nextcloud bot
3946204d49
fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2025-12-17 02:15:30 +00:00
Vitor Mattos
6d52807e47
Merge pull request #6228 from LibreSign/fix/show-only-current-signer-position
fix: show only current signer's signature position
2025-12-16 22:43:29 -03:00
Vitor Mattos
6de7b55668
fix: show only current signer's signature position
When viewing a document to sign, users should only see their own
signature positions, not the positions of other signers.

This improves UX and privacy by filtering to show only the signature
elements for the current signer (where signer.me === true).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 22:41:28 -03:00
Vitor Mattos
42c025b122
Merge pull request #6225 from LibreSign/feat/disabled-identify-methods-handling
feat: disabled identify methods handling
2025-12-16 22:37:05 -03:00
Vitor Mattos
4e34ff07ca
feat: prevent actions when identification methods are disabled
Add comprehensive validation for disabled identification methods:
- Check method status in canSignerActInOrder to centralize validation
- Hide menu actions (customize message, request signature, send reminder)
  for signers with disabled methods
- Add hasSignersWithDisabledMethods computed property
- Hide "Setup signature positions" and "Request signatures" buttons
  when any signer has a disabled method
- Show warning message when disabled methods are detected
- Always show signer's method in edit dialog even if disabled
- Pass disabled prop to IdentifySigner component

This ensures users cannot proceed with signature requests until all
signers have valid identification methods.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 22:35:05 -03:00
Vitor Mattos
ef393ca075
feat: detect and visually indicate disabled identification methods
Add detection of disabled identification methods in Signer component:
- Load identify_methods from state and check if method is enabled
- Add visual styling (reduced opacity, overlay) for disabled signers
- Add tooltip explaining why signer cannot be used
- Prevent click action when method is disabled
- Keep actions menu functional for delete/edit operations

This provides clear visual feedback when a signer's identification
method has been disabled by the administrator.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 22:34:50 -03:00
Vitor Mattos
433a52a9f3
feat: add disabled mode to IdentifySigner component
Add support for displaying signers with disabled identification methods
in read-only mode. When disabled prop is true, the component shows:
- Warning message explaining the method is disabled
- Signer information in read-only mode
- No editable fields or action buttons

This allows users to view signer details even when the identification
method has been disabled by the administrator.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 22:34:39 -03:00
Vitor Mattos
9a9ca2bba7
Merge pull request #6216 from LibreSign/feat/custom-message-for-signers
feat: custom message for signers
2025-12-16 21:48:53 -03:00
Vitor Mattos
587d80d7b5
test: make CA ID regex more flexible in integration tests
Change regex pattern from [a-z0-9]{10} (exactly 10 chars) to [a-z0-9]+
(one or more chars) to accept variable-length instance identifiers.
This makes tests more resilient to changes in instance ID generation
while maintaining validation of the CA ID format.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 21:17:07 -03:00
Vitor Mattos
1643505535
Revert "fix: use Nextcloud's instanceid instead of generating random ID"
This reverts commit 8f71e6c0cb.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 21:17:07 -03:00
Vitor Mattos
f68ceae6cc
Merge pull request #6220 from LibreSign/feat/signature-flow-toggle
feat: signature flow toggle
2025-12-16 21:07:32 -03:00
Vitor Mattos
f885008e36
test: fix sequential signing test for new API signature
Update test to include required 'enabled' parameter in
signature flow configuration endpoint.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 20:57:49 -03:00
Vitor Mattos
0c5461f16c
chore: add documentation of openapi
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 20:52:16 -03:00
Vitor Mattos
624d959fb4
feat: add UI toggle for signature flow enforcement
Add switch control to enable/disable forced signature flow.
When enabled, shows parallel/sequential options. When disabled,
document creators can choose their preferred signing order.
Includes separate loading states for toggle and flow selection.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 20:34:51 -03:00
Vitor Mattos
c4422563de
fix: return null when signature flow is not configured
Return null instead of default value to allow frontend
to detect when admin has not enforced a signature flow.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 20:34:51 -03:00
Vitor Mattos
0cb6576388
feat: add toggle to enable/disable signature flow enforcement
Update setSignatureFlowConfig to accept enabled parameter.
When disabled, the signature_flow config key is deleted,
allowing document creators to choose their preferred order.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 20:34:51 -03:00
Vitor Mattos
8f71e6c0cb
fix: use Nextcloud's instanceid instead of generating random ID
- Changed CaIdentifierService to use system's instanceid from config.php
- Removed custom instance_id generation logic using ISecureRandom
- Updated unit tests to mock IConfig and verify correct instanceid usage
- This fixes race condition in certificate generation during integration tests

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 20:07:33 -03:00
Vitor Mattos
0bd1d33b76
fix: don't return deleted signers
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:25:13 -03:00
Vitor Mattos
263a8cf562
fix: allow notifications when Activity setting is not registered
When Activity app doesn't know about LibreSign's notification settings
(common in test environments or fresh installations), we should allow
notifications by default instead of blocking them.

This fix checks if the Activity manager has the setting registered before
enforcing the admin setting. If the setting is not found, notifications
are allowed, respecting LibreSign's isDefaultEnabledMail() and
isDefaultEnabledNotification() which return true.

Fixes email and notification delivery in integration tests.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:14:33 -03:00
Vitor Mattos
d077a3174a
test: add custom message notification scenarios
Add integration tests for custom signer messages:
- Account method with and without custom description
- Email method with default and custom description via reminder
- Verifies description appears in email body before default message
- Uses Activity email notification settings in background setup

Tests cover the complete flow from request creation to email delivery.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:14:33 -03:00
Vitor Mattos
8af85a6ca0
test: add acceptsEmailNotifications scenarios
Add integration tests verifying acceptsEmailNotifications field in
account search endpoint:
- Returns true when both global and user settings enable notifications
- Returns false when user explicitly disables notifications
- Returns false when admin disables globally (even if user enables)

Tests cover Activity app integration and admin/user setting precedence.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:14:33 -03:00
Vitor Mattos
01dceea32b
feat: add customize message action in sidebar
Add 'Customize message' action button in signature request sidebar for
signed requests. The button:
- Appears with Bell icon alongside other actions
- Opens signer identification modal for message editing
- Validates signer state, method, and email notification preferences
- Is hidden when signer already signed, for current user, or when
  account method user doesn't accept email notifications

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:14:33 -03:00
Vitor Mattos
d2245ac28c
feat: add custom message UI in signer identification
Add switch-based UI to enable custom messages for signers during
identification. The custom message field:
- Appears conditionally based on method and email notification settings
- Is hidden for account method when user doesn't accept email
- Supports up to 500 characters with 3-row textarea
- Resets when toggled off or signer changes to non-accepting account
- Is saved as part of signer data

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:14:32 -03:00
Vitor Mattos
f71697efb5
docs: regenerate OpenAPI specification
Update OpenAPI schemas to include acceptsEmailNotifications in
LibresignIdentifyAccount and description/displayName/notify in
LibresignNewSigner types.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
75766e27fd
feat: add email notification preferences to account search
Include acceptsEmailNotifications field in search results for account
method signers. This field indicates whether a user accepts email
notifications based on both Activity admin settings and user
preferences. Returns false when user has no email, Activity app is
unavailable, or notifications are disabled at admin or user level.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
68eada5682
docs: update API response definitions
Add description, displayName, notify, and acceptsEmailNotifications
fields to OpenAPI response type definitions for LibresignNewSigner
and LibresignIdentifyAccount.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
960af717bc
feat: add custom description to gateway notifications
Support custom signer descriptions in SMS, Signal, Telegram, WhatsApp,
and XMPP notifications. The description is prepended to the notification
message when provided, allowing personalized instructions through all
supported notification channels.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
a4d5a5f854
fix: check Activity admin setting in notification listener
Add explicit check for Activity admin (global) setting before checking
user preference for in-app notifications. This ensures consistency
across all notification channels and prevents users from enabling
notifications when disabled globally by the admin.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
31b097bdda
fix: check Activity admin setting before user preference
Add explicit check for Activity admin (global) setting before checking
user preference in email notifications. This ensures that when an admin
disables email notifications globally, users cannot override it with
their personal settings. The admin setting acts as a gate that must be
enabled for user preferences to take effect.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
5f9cf28d75
feat: add custom description to email notifications
Add optional description parameter to notifyUnsignedUser and
notifySignDataUpdated methods. When provided, the custom message is
prepended to the email body, allowing personalized instructions for
signers.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
66327f1d99
feat: store description in notification metadata
Include signer description in notification metadata when incrementing
notification counter. This allows tracking custom messages sent to
signers for each notification attempt.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 19:12:58 -03:00
Vitor Mattos
db13f2cda4
Merge pull request #6217 from LibreSign/feat/improve-signer-edit-modal
feat: improve signer edit modal
2025-12-16 18:59:03 -03:00
Vitor Mattos
af1c39d193
feat: hide search field when editing existing signer
When editing a signer, hide the search field since the signer is
already defined. Only show the search field when adding a new signer.
This simplifies the UI and prevents confusion.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 18:54:54 -03:00
Vitor Mattos
129a4b2623
feat: show only relevant tab when editing signer
When editing an existing signer, display only the tab corresponding
to the identification method used by that signer (account, email, etc).
When adding a new signer, show all available tabs as before.

This prevents confusion and improves UX by focusing on the relevant
method for each context.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 18:54:04 -03:00
Vitor Mattos
ceddbb77b0
Merge pull request #6213 from LibreSign/feat/persist-signer-identify-tab-preference
feat: persist signer identify tab preference
2025-12-16 12:37:40 -03:00
Vitor Mattos
f664bd983a
chore: remove comment
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 10:48:59 -03:00
Vitor Mattos
b0304dbe60
feat: persist signer identify method tab preference
Save user's selected tab (Account/Email) in the 'Add new signer' modal
to userconfig store. The preference is now persisted across modal
closures and page reloads, improving user experience by remembering
the last selected identification method.

Changes:
- Add activeTab state to RequestSignatureTab component
- Load saved tab preference from userconfig store on mount
- Save tab changes to backend with debounce (500ms)
- Add signer_identify_tab to AccountService config output
- Use snake_case naming convention for consistency with backend

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 10:47:34 -03:00
Vitor Mattos
4f46ee6d44
Merge pull request #6210 from LibreSign/feat/add-twig-documentation-links
feat: add Twig documentation links to template editors
2025-12-16 10:12:18 -03:00
Vitor Mattos
8b6a0da085
feat: add Twig documentation links to template editors
Add clickable links to Twig documentation (https://twig.symfony.com/)
in both Signature Stamp and Footer Template editor sections using
the v-linkify directive from @nextcloud/vue.

This improves user experience by providing direct access to Twig
syntax documentation when configuring custom templates.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 09:52:33 -03:00