Commit graph

10,556 commits

Author SHA1 Message Date
Vitor Mattos
0e3ed551e6
docs: add signatureFlow parameter to OpenAPI specification
Update API documentation for request-signature endpoint.

- Add signatureFlow parameter to request body schema
- Type: string, nullable
- Description documents accepted values and fallback behavior

This ensures API consumers have accurate documentation for the
signature flow parameter.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 17:02:39 -03:00
Vitor Mattos
8a4e018c6a
feat: include signatureFlow in API responses
Expose signature flow configuration in file list and detail endpoints.

FileService changes:
- Add signatureFlow to fileData object in formatFile()

SignRequestMapper changes:
- Include f.signature_flow in SELECT query
- Convert numeric value to enum string in formatListRow()
- Remove signature_flow from response (cleanup after conversion)

This enables frontend to display and use per-file signature flow
configuration.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 17:02:18 -03:00
Vitor Mattos
3ac6e064f6
refactor: pass file entity to SequentialSigningService in SignFileService
Update releaseNextOrder call to provide file entity context.

- Call setFile() before releaseNextOrder()
- Enables SequentialSigningService to read file-level signature flow

This ensures signature flow logic uses the correct per-file
configuration during document signing workflow.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 17:01:47 -03:00
Vitor Mattos
7918cd51c5
feat: implement signature flow handling in RequestSignatureService
Add signature flow parameter processing and file configuration logic.

- Parse signatureFlow from request data and convert to enum
- Fall back to global config if parameter invalid or missing
- Set file entity signature flow via setSignatureFlowEnum()
- Initialize SequentialSigningService with file entity context
- Add IAppConfig dependency for global fallback

This completes the backend logic for per-file signature flow
configuration with graceful fallback to system defaults.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 17:01:13 -03:00
Vitor Mattos
c16ba73bc8
feat: add signatureFlow parameter to request-signature endpoint
Add optional signatureFlow parameter to POST /request-signature API.

- Accepts 'parallel' or 'ordered_numeric' values
- Falls back to global configuration if not provided
- Documented in PHPDoc and OpenAPI annotations

This enables clients to specify signature flow mode per document
when creating signature requests.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 17:00:53 -03:00
Vitor Mattos
ad71acbbcd
refactor: use file-level signature flow in SequentialSigningService
Replace global config dependency with file-level signature flow.

- Add setFile() method to inject File entity
- Replace getSignatureFlow() to read from file instead of IAppConfig
- Remove IAppConfig dependency (no longer needed)
- Add validation: throws LogicException if getSignatureFlow() called without file

This enables per-file signature flow configuration while maintaining
backward compatibility through database default values.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:59:14 -03:00
Vitor Mattos
ff7b64b526
feat: add signature flow support to File entity
Add signatureFlow property and enum conversion helper methods to File entity.

- New protected property: signatureFlow (SMALLINT, default 1)
- getSignatureFlowEnum(): Returns SignatureFlow enum from integer
- setSignatureFlowEnum(): Sets integer from SignatureFlow enum

These methods provide type-safe access to signature flow configuration
stored in the database.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:58:51 -03:00
Vitor Mattos
0f89027464
feat: add signature_flow column to libresign_file table
Add signature_flow column to store signature flow mode at file level.

- Column type: SMALLINT NOT NULL DEFAULT 1
- 1 = parallel (default)
- 2 = ordered_numeric

This enables per-file configuration of signature flow, overriding the
global application setting when specified.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:58:18 -03:00
Vitor Mattos
abf6bb70b1
feat: add numeric conversion methods to SignatureFlow enum
Add toNumeric() and fromNumeric() methods to enable conversion between
SignatureFlow enum values and their integer database representations.

- PARALLEL = 1
- ORDERED_NUMERIC = 2

This allows storing signature flow as integers in the database while
maintaining type-safe enum usage in the code.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:57:57 -03:00
Vitor Mattos
c05b15a8e1
Merge pull request #6166 from LibreSign/fix/migration-signer-order-default
fix: set default value for signer_order column in migration
2025-12-12 16:55:52 -03:00
Vitor Mattos
6f83a9c04d
fix: set default value for signer_order column in migration
Set default value of 0 for signer_order column to prevent NULL values
that would cause issues with sequential signing feature.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:30:59 -03:00
Vitor Mattos
b2044c630a
Merge pull request #6163 from LibreSign/refactor/move-status-validation-to-sequential-service
refactor: move status validation to sequential service
2025-12-12 15:17:05 -03:00
Vitor Mattos
ede3fe8b9b
fix: cs
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 15:07:42 -03:00
Vitor Mattos
48915dca4b
refactor: delegate status validation to SequentialSigningService
Remove internal validation methods from RequestSignatureService and
delegate to SequentialSigningService for better separation of concerns.

Changes:
- Remove hasPendingLowerOrderSigners() private method
- Remove isStatusUpgrade() private method
- Replace inline ordering validation with call to
  validateStatusByOrder()
- Simplify determineInitialStatus() by delegating validation logic

This reduces complexity in RequestSignatureService and makes the code
more maintainable by following single responsibility principle. All
sequential signing logic is now centralized in the specialized service.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 15:03:52 -03:00
Vitor Mattos
e557674ef0
refactor: add status validation methods to SequentialSigningService
Move status-related validation logic to SequentialSigningService where
it belongs, improving code cohesion and testability.

Changes:
- Add hasPendingLowerOrderSigners() method to check for incomplete
  lower-order signers
- Add isStatusUpgrade() method to validate status transitions
- Add validateStatusByOrder() method to encapsulate ordering
  validation logic for status transitions

These methods are now public and easily testable, centralizing all
sequential signing validation logic in a single specialized service.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 15:03:32 -03:00
Vitor Mattos
9c6cebf5f5
Merge pull request #6160 from LibreSign/fix/individual-signer-status-control
fix: add ordering validation for signature request actions
2025-12-12 14:49:08 -03:00
Vitor Mattos
c9f2fa9feb
fix: add ordering validation for signature request actions
In ordered numeric signing flow, the frontend now validates that
all lower-order signers have signed before showing 'Request signature'
or 'Send reminder' buttons for higher-order signers.

Changes:
- Extract duplicate ordering validation logic into shared method
  canSignerActInOrder
- Apply ordering validation to both canRequestSignature and
  canSendReminder computed properties
- Move canSignerActInOrder to methods section (takes parameter)

This prevents users from requesting signatures or sending reminders
to signers out of turn when sequential signing is enabled.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 14:46:24 -03:00
Vitor Mattos
4535979d7d
Merge pull request #6157 from LibreSign/fix/edit-signer-modal-title
fix: update modal title to reflect edit vs add signer action
2025-12-12 13:40:03 -03:00
Vitor Mattos
562cb296d1
fix: update modal title to reflect edit vs add signer action
The modal dialog was displaying 'Add new signer' title when clicking
an existing signer to edit, which was confusing. Added a computed
property 'modalTitle' that dynamically returns 'Edit signer' when
editing an existing signer or 'Add new signer' when adding a new one.

The logic checks if signerToEdit object has properties to determine
the correct context.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 13:38:03 -03:00
Vitor Mattos
3eff421a84
Merge pull request #6154 from LibreSign/fix/remove-sidebar-tab-box-shadow
fix: remove blue line from sidebar tab
2025-12-12 13:27:51 -03:00
Vitor Mattos
87d02c9c71
fix: remove blue line from sidebar tab
Remove box-shadow from .app-sidebar__tab to eliminate the blue line
that appeared above tab content when clicking on sidebar tabs.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 13:24:44 -03:00
Nextcloud bot
504db48812
fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2025-12-12 02:16:18 +00:00
Vitor Mattos
4212de89e4
Merge pull request #6151 from LibreSign/fix/visible-elements-signer-prop
fix: correct Signer component prop in VisibleElements
2025-12-11 20:12:04 -03:00
Vitor Mattos
0a129e4aaf
fix: correct Signer component prop in VisibleElements
The Signer component expects signerIndex prop but VisibleElements
was passing current-signer instead. This caused Vue warnings about
missing required prop and errors when trying to access signer data.

Changed :current-signer to :signer-index and removed obsolete
:signer prop since the component now fetches signer data from
the store using the signerIndex.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 20:10:46 -03:00
Vitor Mattos
4c740d9c6c
Merge pull request #6148 from LibreSign/refactor/centralize-file-status-translations
refactor: centralize file status translations in FileStatus enum
2025-12-11 20:09:05 -03:00
Vitor Mattos
e425b186d9
refactor: centralize file status translations in FileStatus enum
- Add getLabel() method to FileStatus enum similar to DocMdpLevel and SignRequestStatus
- Simplify FileMapper::getTextOfStatus() to delegate to enum's getLabel()
- Improves maintainability by centralizing translations in a single place

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 19:59:15 -03:00
Vitor Mattos
c0b87930b4
Merge pull request #6145 from LibreSign/feat/status-chip-improvements
feat: status chip improvements
2025-12-11 19:53:40 -03:00
Vitor Mattos
1d8f1d5a1f
feat: pass signers prop to FileEntryStatus in grid view
- Add signers prop binding for grid view consistency
- Enables language-independent status detection

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 19:52:29 -03:00
Vitor Mattos
e55950f0ec
feat: pass signers prop to FileEntryStatus
- Add signers prop binding to enable language-independent status detection
- Defaults to empty array if signers data is not available

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 19:52:29 -03:00
Vitor Mattos
affa4f987d
feat: update status filter icon colors to match chips
- Use softer, more visible colors for status icons
- draft: #9E9E9E (medium gray)
- available/partial: #D4A843 (soft gold)
- signed: #4CAF50 (medium green)

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 19:49:11 -03:00
Vitor Mattos
a6d748e91e
feat: adjust status column alignment and width
- Center status column content
- Set column width to 2.5x row height
- Add mobile responsive width (0.8x row height for ≤768px)

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 19:49:05 -03:00
Vitor Mattos
62d792d890
feat: replace status dot with responsive chip component
- Replace simple status dot with custom chip component
- Desktop: shows chip with text that breaks into multiple lines
- Mobile (≤768px): shows only colored icon
- Supports multiple status colors: error (red), draft (gray), available/partial (yellow), signed (green)

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 19:48:49 -03:00
Vitor Mattos
09cf331ff3
Merge pull request #6142 from LibreSign/fix/close-sidebar-on-file-delete
fix: close sidebar when deleting the selected file
2025-12-11 18:46:57 -03:00
Vitor Mattos
dbfd75e7ff
fix: close sidebar when deleting the selected file
- Changed condition from checking 'uuid' to 'nodeId' in delete method
- Added logic to close sidebar when the deleted file is the currently selected one
- Simplified deleteMultiple method to rely on delete method's cleanup

This fixes the issue where the sidebar remained open after deleting
the only/selected file, both when the file was just uploaded or when
the page was already loaded.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 18:44:34 -03:00
Vitor Mattos
778067f5f1
Merge pull request #6139 from LibreSign/fix/filter-draft-sign-requests-in-list
fix: prevent signers from seeing files with DRAFT sign_request status
2025-12-11 18:31:44 -03:00
Vitor Mattos
adc396d52e
test: update sequential signing test to validate DRAFT filter
Split the sequential signing test into two separate scenarios to better
validate the DRAFT status filtering behavior:

1. First scenario: Tests that signer1 can see and sign the document
   (simpler flow without multiple user switches)

2. Second scenario: Tests that signer2 does NOT see the document when
   their sign_request is in DRAFT status

This avoids multiple user context switches in the same scenario which
was causing authentication issues in the Behat tests, and better isolates
the behavior we want to validate.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 17:58:07 -03:00
Vitor Mattos
ca7339e078
fix: prevent signers from seeing files with DRAFT sign_request status
Filter out sign_requests with status DRAFT (0) in the file list endpoint
when the user is not the file owner. This ensures that signers do not
see documents where their sign_request is in DRAFT status, unless they
are the requester (owner) of the document.

The filter is applied in the getFilesAssociatedFilesWithMeQueryBuilder
method by adding conditions to exclude:
- Files with status DRAFT (0)
- Sign requests with status DRAFT (0)

Only when the user is not the file owner (not matching f.user_id).

This change affects only the /api/v1/file/list endpoint and does not
impact other file access methods or signature flows.

Ref: Security improvement to prevent premature document visibility
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 17:04:58 -03:00
Vitor Mattos
dd252f3c6f
Merge pull request #6131 from LibreSign/fix/remove-validation-at-serialziation-function
fix: remove validation at serialization function
2025-12-11 16:26:23 -03:00
Vitor Mattos
04c79e4018
Merge pull request #6128 from LibreSign/fix/prevent-error-when-folder-doesnt-exists
fix: prevent error when folder doesn't exists
2025-12-11 16:25:48 -03:00
Vitor Mattos
309794bb13
Merge pull request #6134 from LibreSign/refactor/replace-bullet-with-ncchip
refactor: Replace Bullet component with NcChip and fix signer reactivity
2025-12-11 16:21:40 -03:00
Vitor Mattos
3f061158fc
refactor: Replace Bullet component with NcChip and fix signer reactivity
- Replace custom Bullet component with NcChip from @nextcloud/vue
- Remove unused Bullet component
- Fix reactivity issue by passing signerIndex instead of currentSigner
- Signer component now fetches data from store reactively using computed property
- This ensures changes in store are properly reflected in the UI

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:20:12 -03:00
Vitor Mattos
5a7326150b
Merge pull request #6127 from LibreSign/fix/migration-ou-type-error
fix: ensure organizationalUnit is converted before engine initialization
2025-12-11 16:19:03 -03:00
Vitor Mattos
69e77a2156
Merge pull request #6126 from LibreSign/fix/request-signature-button
fix: request signature button
2025-12-11 16:10:31 -03:00
Vitor Mattos
0aa8cde9b4
feat: improve signer status visualization with chips
- Replace indicator circle with NcChip component
- Add status-based chip types (success, warning, secondary)
- Add Material Design Icons for different statuses
- Improve layout with flexbox for better alignment
- Remove timestamp display in favor of status text

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:06:48 -03:00
Vitor Mattos
c803e93882
feat: add status fields to file data when creating signature request
- Include status, statusText, and created_at in file data
- Improve state management for newly created signature requests

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:06:40 -03:00
Vitor Mattos
3e7e29ad4f
Merge pull request #6123 from LibreSign/fix/request-signature-button
fix: request signature button
2025-12-11 16:03:56 -03:00
Vitor Mattos
7513bb2869
refactor: extract signer action conditions to computed properties
- Add canEditSigningOrder, canDelete, canRequestSignature, canSendReminder
- Improve code readability and maintainability
- Ensure consistent reactive behavior across all conditions

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:02:40 -03:00
Vitor Mattos
a25ccf5279
refactor: update VisibleElements to use updateSignatureRequest method
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:02:36 -03:00
Vitor Mattos
c8484973bf
feat: add conditional buttons for draft and pending signers
- Show 'Request signature' button for draft status (status === 0)
- Show 'Send reminder' button for pending status (status === 1)
- Implement requestSignatureForSigner method to update signer status
- Use signRequestId instead of identify for signer identification

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:02:32 -03:00
Vitor Mattos
075adea637
refactor: rename requestSignaturesWithVisibleElements to updateSignatureRequest
- Add status parameter with default value 1
- Make method more flexible for different status transitions

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 16:02:17 -03:00