Commit graph

10518 commits

Author SHA1 Message Date
Nextcloud bot
eac9340247
fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2025-12-18 02:16:52 +00:00
Vitor Mattos
1d12d880a3
Merge pull request #6233 from LibreSign/backport/6231/stable32
[stable32] feat: signing order visual diagram
2025-12-17 08:03:51 -03:00
Vitor Mattos
a131751513 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 05:53:38 +00:00
Vitor Mattos
4beb12d49c 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 05:53:38 +00:00
Vitor Mattos
3432180e64 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 05:53:38 +00:00
Vitor Mattos
67023f372f 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 05:53:38 +00:00
Vitor Mattos
af7844a12c 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 05:53:38 +00:00
Vitor Mattos
943774f8fe 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 05:53:38 +00:00
Vitor Mattos
f5535e444b 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 05:53:38 +00:00
Vitor Mattos
91113c0770 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 05:53:38 +00:00
Vitor Mattos
55b3add0a4 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 05:53:38 +00:00
Vitor Mattos
39ac007f07 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 05:53:38 +00:00
Vitor Mattos
c3f6a1425b
Merge pull request #6230 from LibreSign/backport/6228/stable32
[stable32] fix: show only current signer's signature position
2025-12-17 02:05:03 -03:00
Nextcloud bot
c35440e68c
fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2025-12-17 02:15:33 +00:00
Vitor Mattos
def465cda7 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-17 01:44:06 +00:00
Vitor Mattos
556d0d6d73
Merge pull request #6227 from LibreSign/backport/6225/stable32
[stable32] feat: disabled identify methods handling
2025-12-16 22:40:11 -03:00
Vitor Mattos
377d98f105 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-17 01:37:43 +00:00
Vitor Mattos
a426a21bbb 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-17 01:37:43 +00:00
Vitor Mattos
32bffc83db 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-17 01:37:43 +00:00
Vitor Mattos
11bd4cbf80
Merge pull request #6224 from LibreSign/backport/6216/stable32
[stable32] feat: custom message for signers
2025-12-16 22:33:57 -03:00
Vitor Mattos
9e1d39ea74 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 22:13:59 -03:00
Vitor Mattos
2563e142a1 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 22:13:59 -03:00
Vitor Mattos
a2724a36e5 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 22:13:59 -03:00
Vitor Mattos
e2ba00975e fix: don't return deleted signers
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 22:13:59 -03:00
Vitor Mattos
53db041577 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 22:13:59 -03:00
Vitor Mattos
87332b104c 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 22:13:59 -03:00
Vitor Mattos
ad6bd221a2 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 22:13:59 -03:00
Vitor Mattos
a736f44bb0 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 22:13:59 -03:00
Vitor Mattos
f225912918 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 22:13:59 -03:00
Vitor Mattos
d0df5e446e 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 22:13:59 -03:00
Vitor Mattos
77f59e16f5 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 22:13:59 -03:00
Vitor Mattos
f52b6ca9d4 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 22:13:59 -03:00
Vitor Mattos
cf3de73cb0 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 22:13:59 -03:00
Vitor Mattos
d1d69671d3 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 22:13:59 -03:00
Vitor Mattos
be8603a850 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 22:13:59 -03:00
Vitor Mattos
32eb0101fb 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 22:13:59 -03:00
Vitor Mattos
4671b85782 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 22:13:59 -03:00
Vitor Mattos
2660918cb6
Merge pull request #6221 from LibreSign/backport/6220/stable32
[stable32] feat: signature flow toggle
2025-12-16 22:13:41 -03:00
Vitor Mattos
b7124a53e9 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-17 00:07:54 +00:00
Vitor Mattos
5c2464d9fa chore: add documentation of openapi
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 00:07:54 +00:00
Vitor Mattos
811fdbfdd8 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-17 00:07:54 +00:00
Vitor Mattos
1c0cef0c7e 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-17 00:07:54 +00:00
Vitor Mattos
4d879bfed0 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-17 00:07:54 +00:00
Vitor Mattos
59d8db9dc9
Merge pull request #6219 from LibreSign/backport/6217/stable32
[stable32] feat: improve signer edit modal
2025-12-16 19:00:05 -03:00
Vitor Mattos
a7ac807d8d 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 21:59:40 +00:00
Vitor Mattos
fddb3024ab 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 21:59:40 +00:00
Vitor Mattos
a541c46215
Merge pull request #6215 from LibreSign/backport/6213/stable32
[stable32] feat: persist signer identify tab preference
2025-12-16 12:54:44 -03:00
Vitor Mattos
01327efefa chore: remove comment
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-16 15:38:18 +00:00
Vitor Mattos
f4c0b1e717 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 15:38:18 +00:00
Vitor Mattos
7a483eeb85
Merge pull request #6212 from LibreSign/backport/6210/stable32
[stable32] feat: add Twig documentation links to template editors
2025-12-16 10:25:56 -03:00