Commit graph

10,556 commits

Author SHA1 Message Date
dependabot[bot]
231b42589d
chore(deps): Bump peter-evans/create-pull-request from 7.0.11 to 8.0.0
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 7.0.11 to 8.0.0.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](22a9089034...98357b18bf)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-10 16:22:56 +00:00
Vitor Mattos
20a6616c12
Merge pull request #6069 from LibreSign/feat/sequential-signing
feat: sequential signing
2025-12-10 12:40:17 -03:00
Vitor Mattos
5caf995ab8
chore: update OpenAPI schemas with signingOrder field
Auto-generated update of OpenAPI schemas to include the signingOrder
field in NewSigner and Signer types.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 12:31:01 -03:00
Vitor Mattos
af5b9bf14c
fix: preserve insertion order when signingOrder values are equal
When multiple signers have the same signingOrder value, they should
maintain their insertion order (defined by signRequestId) rather than
being sorted alphabetically by displayName.

This change ensures that when signingOrder is equal, signers are
sorted by signRequestId (which is auto-incrementing) instead of
displayName, preserving the order in which they were originally added.

Fixes Behat integration test failures where tests expected signers
to appear in insertion order.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 12:29:58 -03:00
Vitor Mattos
70e7c3533c
feat: add signingOrder to OpenAPI schema definitions
Add signingOrder field to LibresignSigner and LibresignNewSigner
schemas to support ordered signature flow in API documentation.

This fixes OpenAPI validation errors in API tests that were failing
because the signingOrder field was being returned but not defined
in the schema.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 12:19:40 -03:00
Vitor Mattos
3a44e0a8df
test: fix signature-flow endpoint URL in integration test
Update Behat test to use correct endpoint URL and parameter name:
- Changed from '/api/v1/admin/signature-flow' to '/api/v1/admin/signature-flow/config'
- Changed parameter from 'flow' to 'mode'

This aligns with the actual AdminController endpoint implementation.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 12:11:29 -03:00
Vitor Mattos
c86cb4a6ed
fix: only notify signers with ABLE_TO_SIGN status in sequential flow
In ordered_numeric signature flow, all signers were receiving
notifications regardless of their status. This caused signers
with signing_order > 1 (status DRAFT) to be notified immediately.

Changes:
- Update SignRequest status on PATCH operations, not just INSERT
- Only notify signers when status is ABLE_TO_SIGN
- Ensure signers with order > 1 remain in DRAFT status until
  previous orders are completed

This ensures notifications are sent only to signers who can
actually sign at that moment.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:59:16 -03:00
Vitor Mattos
9688265954
feat: add manual signing order input with auto-save
Add NcActionInput for manual signing order entry with dual-mode
behavior: updateSigningOrder for visual reordering during typing,
confirmSigningOrder for normalization and persistence on submit/blur.
Implement debounced auto-save (1000ms) after drag-and-drop or manual
order changes. Listen to signing-order-changed event from Signers
component using Vue $emit pattern.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:50:05 -03:00
Vitor Mattos
b15f95c32c
feat: implement drag-and-drop reordering for signers
Integrate vuedraggable to enable drag-and-drop reordering when in
ordered_numeric mode. Track originalOrders during drag operations,
recalculate signingOrder using shared mixin logic, emit
signing-order-changed event to trigger auto-save. Include CSS
animations and visual feedback for drag states.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:50:01 -03:00
Vitor Mattos
c9dba8d5e0
feat: add visual indicators for signing order in Signer component
Display counter-number badge with highlighted style when in
ordered_numeric mode. Show DragVertical icon handle when drag-and-drop
is enabled. Add closeActions method to programmatically close action
menu after input submission.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:49:58 -03:00
Vitor Mattos
8e3411b884
feat: auto-assign signingOrder and adjust on signer deletion
Auto-assign incrementing signingOrder to new signers in ordered_numeric
mode. When deleting a signer, decrement signingOrder of subsequent
signers to close gaps and maintain sequential ordering.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:49:54 -03:00
Vitor Mattos
37571fa0e9
feat: create signingOrderMixin for shared ordering logic
Add signingOrderMixin.js with recalculateSigningOrders and
normalizeSigningOrders methods to centralize signing order
calculations and normalization logic used by both drag-and-drop
and manual input components.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:49:48 -03:00
Vitor Mattos
83a982fb96
feat: add signingOrder field to API responses and sort signers
Include signingOrder field in signer data returned by FileService.
Sort signers by signingOrder (ascending) and displayName as secondary
sort to maintain consistent ordering in the UI.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:49:39 -03:00
Vitor Mattos
f23e9d6d3e
feat: provide signature_flow initial state to frontend
Add signature_flow to initial state in PageController and
TemplateLoader to enable frontend components to access the
current signature flow mode (parallel or ordered_numeric).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:49:22 -03:00
Vitor Mattos
1ca80e9adf
feat: add vuedraggable for drag-and-drop reordering
Install vuedraggable v2.24.3 to enable drag-and-drop
functionality for signing order management in sequential
signature flows.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 11:49:16 -03:00
Nextcloud bot
a49dfb9313
fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2025-12-10 02:16:46 +00:00
Vitor Mattos
5c6fc226c1
chore: update OpenAPI specs for signature flow endpoint
Regenerate OpenAPI documentation files to include the new
signature flow configuration endpoint.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
0367e5329c
feat: add signature flow configuration UI
Create SignatureFlow.vue component for admin settings to configure
signing order mode. Administrators can choose between:
- Simultaneous (Parallel): all signers receive at the same time
- Sequential: signers organized by order number

The component follows the same pattern as other admin settings
(DocMDP) with radio buttons, loading states, and error handling.

Integrated into Settings.vue admin panel.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
ee69b44746
feat: add signature flow admin endpoint
Add setSignatureFlowConfig() method to AdminController to allow
administrators to configure the signature flow mode (parallel or
ordered_numeric). The endpoint validates the mode using the
SignatureFlow enum and deletes the config key when parallel mode
is selected (as it's the default).

Endpoint: POST /api/v1/admin/signature-flow/config
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
fae11f133c
test: fix mock callbacks for testUpdateDatabaseWhenSign and testDispatchEventWhenSign
Add __call callbacks to SignRequest mocks in both tests to properly return
fileId and signingOrder values. Without these callbacks, the mocks were
returning null when these magic methods were called, causing
SequentialSigningService::releaseNextOrder() to fail with a TypeError.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
6502530576
feat: reorder signers after deletion in sequential mode
- Add reorderAfterDeletion method to SequentialSigningService
- Automatically activate next order when a signer is deleted
- Prevents gaps in signing sequence that would block workflow
- Call reorderAfterDeletion in unassociateToUser after deletion
- Ensures sequential flow continues even when signers are removed

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
3e2a04dbf7
test: fix mock callbacks to include getFileId and getSigningOrder
- Add getFileId and getSigningOrder to __call callback mocks
- Return 1 for both methods in tests
- Fixes TypeError when releaseNextOrder is called with null fileId
- All 12 affected tests now pass

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
74e2adecbf
chore: reorder method and change visibility
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
b14cc50915
test: fix unit tests to include SequentialSigningService mock
- Add SequentialSigningService mock in RequestSignatureServiceTest
- Add SequentialSigningService mock in SignFileServiceTest
- Update constructor calls in both test files to include new dependency

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
11e8839193
fix: cs
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
69feb74e2b
refactor: change status from string to integer type
- Change SignRequestStatus enum from string-backed to int-backed (0, 1, 2)
- Update database migration to use SMALLINT instead of VARCHAR(20)
- Update SignRequest entity to use int type for status property
- Reduces storage overhead and improves performance
- Integer values: 0=draft, 1=able_to_sign, 2=signed

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
7adb0f2342
chore: update OpenAPI specs and TypeScript types
- Update openapi.json with new signature-flow endpoint
- Regenerate TypeScript types from OpenAPI specs
- Auto-generated by openapi-extractor

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
8d83fa7382
test: add Behat integration tests for sequential signing
- Test parallel signing: all signers can sign immediately
- Test sequential signing: order enforced, status transitions validated
- Verify status 422 when signer attempts to sign out of order
- Verify status changes from DRAFT to ABLE_TO_SIGN after previous signer completes

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
9ee88c9d28
chore: remove debug logging and update dependencies
- Remove debug logging from SignRequestMapper
- Remove error logging from RequestSignatureController
- Clean up temporary debugging code

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
33d84469cc
feat: add admin endpoint for signature flow configuration
- POST /api/v1/admin/signature-flow endpoint
- Parameter: flow (parallel or ordered_numeric)
- Saves configuration to app config
- Returns success response with saved flow

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
928f578571
feat: add validation for sequential signing status
- Validate signer cannot sign if status is DRAFT
- Validate signer cannot sign again if already SIGNED
- Use getStatusEnum() for enum comparisons
- Proper error messages for blocked signers

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
59903b8f15
feat: update SignFileService to support sequential signing
- Mark SignRequest as SIGNED using setStatusEnum()
- Update next signer status after successful signature
- Integrate with SequentialSigningService for flow management

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
51cf5234a1
feat: integrate sequential signing in RequestSignatureService
- Inject SequentialSigningService dependency
- Reset order counter before processing signers
- Determine signing order for each user
- Set initial status based on order (ABLE_TO_SIGN for first, DRAFT for others)
- Type casting for signingOrder from JSON input

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
42e3853079
feat: add SequentialSigningService for signing order management
- Manages signing order determination and counter
- Validates signature flow (parallel vs sequential)
- Updates next signer status after signature completion
- Integrates with IAppConfig for flow configuration

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
55d0d9b68f
feat: update SignRequest entity for sequential signing
- Add signingOrder property (int, default 1)
- Add status property (string, default 'draft')
- Add getStatusEnum() and setStatusEnum() for enum handling
- Magic methods for string-based status access (Entity compatibility)
- Proper field type registration in constructor

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
b946adee80
feat: add database migration for sequential signing
- Add signing_order column (INT, DEFAULT 1) to libresign_sign_request
- Add status column (VARCHAR 20, DEFAULT 'draft') to libresign_sign_request
- Migration supports both PostgreSQL and MySQL/MariaDB

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
ba74b551e2
feat: add enums for SignRequestStatus and SignatureFlow
- SignRequestStatus: Enum with DRAFT, ABLE_TO_SIGN, SIGNED states
- SignatureFlow: Enum with PARALLEL and ORDERED_NUMERIC modes
- String-backed enums for database compatibility

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
c646f673a6
Merge pull request #6059 from LibreSign/dependabot/composer/vendor-bin/rector/rector/rector-2.2.14
chore(deps-dev): Bump rector/rector from 2.2.11 to 2.2.14 in /vendor-bin/rector
2025-12-09 20:39:08 -03:00
Vitor Mattos
c886ea1ef1
Merge pull request #6066 from LibreSign/feat/improve-signature-request-workflow
feat: improve signature request workflow
2025-12-09 20:10:35 -03:00
Vitor Mattos
2989975f39
feat: enhance RequestSignatureTab with improved UX
Improve signature request workflow in sidebar:
- Add separate 'Save' and 'Send' buttons with clear actions
- Show 'Edit visible signatures' when elements available
- Hide edit button when document is partially/fully signed
- Add visual icons: Pencil (edit), Send (send), Draw (sign), FileDocument (open)
- Simplify save/request methods using store
- Add status-based button visibility logic using SIGN_STATUS enum
- Improve button naming: 'Request' → 'Send' for clarity

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 16:40:41 -03:00
Vitor Mattos
ae188d5596
refactor: improve VisibleElements component logic
Refactor VisibleElements to use centralized store methods:
- Replace inline axios calls with store methods
- Add buildVisibleElements helper to construct elements array
- Separate save (status 0) and request (status 1) actions
- Show 'Save' for drafts, 'Send' for requests
- Add Send icon to request button
- Remove confirmation dialog for save action
- Keep confirmation dialog for send action with proper error handling

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 16:40:23 -03:00
Vitor Mattos
a46b874853
feat: add store methods for signature requests with visible elements
Centralize logic for saving and requesting signatures in the filesStore.
This allows reusable methods across different components:
- saveWithVisibleElements: saves draft (status 0)
- requestSignaturesWithVisibleElements: sends request (status 1)

Both methods handle visible elements positioning data.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 16:39:52 -03:00
Vitor Mattos
92e313b1bf
Merge pull request #6063 from LibreSign/feat/improve-signature-template-editor
Feat/improve signature template editor
2025-12-09 15:55:57 -03:00
Vitor Mattos
522c711c15
feat: replace textarea with CodeEditor in SignatureStamp
Replace NcTextArea with CodeEditor component for better Twig
syntax highlighting and code editing experience.

- Remove inline variables list in favor of dialog
- Add 'Available variables' button with help icon
- Use CodeEditor with Twig syntax highlighting
- Apply debounced save on input (500ms)
- Maintain dynamic height with min-height: 80px

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 15:50:46 -03:00
Vitor Mattos
936ceb6340
feat: improve CodeEditor dynamic height
- Add viewportMargin: Infinity to render all content
- Reduce min-height from 200px to 80px for better UX
- Allow editor to grow dynamically with content

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 15:50:29 -03:00
Vitor Mattos
f330824161
Merge pull request #6060 from LibreSign/feat/improve-java-encoding-check
feat: improve java encoding check
2025-12-09 13:47:25 -03:00
Vitor Mattos
6955ae2e9a
feat: render configuration tips with NcRichText
Use NcRichText component to properly render formatted tips in the
configuration check table, replacing plain text rendering.

This change:
- Imports and uses NcRichText component from @nextcloud/vue
- Enables Markdown rendering for tip content with autolink support
- Adds CSS styling for proper text wrapping and width constraints
- Ensures secure rendering through NcRichText's built-in sanitization

The tips now display with proper formatting including bold text, lists,
code blocks, and clickable links, improving readability and user experience.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 13:23:14 -03:00
Vitor Mattos
fedfdee4ca
feat: enhance Java encoding check with detailed diagnostics
Improve the non-UTF-8 encoding detection in ConfigureCheckService to provide
comprehensive diagnostic information when Java reports incorrect encoding.

The enhanced check now:
- Shows the specific encoding detected by Java
- Displays current PHP environment variables (LC_CTYPE, LC_ALL, LANG)
- Provides step-by-step resolution instructions
- Links to issue #4872 with detailed troubleshooting

This helps administrators quickly identify and resolve locale inheritance
issues between PHP and Java that cause character encoding problems in
PDF signatures.

Ref: https://github.com/LibreSign/libresign/issues/4872
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 13:22:56 -03:00
dependabot[bot]
182e895f43
chore(deps-dev): Bump rector/rector in /vendor-bin/rector
Bumps [rector/rector](https://github.com/rectorphp/rector) from 2.2.11 to 2.2.14.
- [Release notes](https://github.com/rectorphp/rector/releases)
- [Commits](https://github.com/rectorphp/rector/compare/2.2.11...2.2.14)

---
updated-dependencies:
- dependency-name: rector/rector
  dependency-version: 2.2.14
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-09 16:13:31 +00:00
Vitor Mattos
abd1a97d19
Merge pull request #6054 from LibreSign/feat/disable-identify-methods-none-engine
feat: disable identify methods none engine
2025-12-09 13:03:10 -03:00