Commit graph

10,426 commits

Author SHA1 Message Date
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
Vitor Mattos
4b119ed3bb
Merge pull request #6120 from LibreSign/fix/test-status-fields
test: add status and statusText fields to expected test output
2025-12-11 15:41:40 -03:00
Vitor Mattos
2ce6cd430e
test: add status and statusText fields to expected test output
The FileService now includes status and statusText fields in the signer
data structure when processing signed files outside LibreSign. This
update adjusts the test expectations to match the actual behavior.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 15:27:22 -03:00
Vitor Mattos
0416947bcf
Merge pull request #6117 from LibreSign/fix/signer-status-draft-on-add
fix: respect status 0 (DRAFT) when adding new signers
2025-12-11 15:26:31 -03:00
Vitor Mattos
6bd828e9ed
fix: respect status 0 (DRAFT) when adding new signers
When adding a new signer with status 0, the backend was ignoring it
because empty() treated 0 as falsy. Changed to isset() to properly
handle status 0.

Also updated determineInitialStatus() to allow new signers to be
added in DRAFT mode even when the file is not in DRAFT status,
allowing gradual signer addition before requesting signatures.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 15:14:34 -03:00
Vitor Mattos
23f6bd730b
Merge pull request #6114 from LibreSign/fix/email-notification-without-account
fix: check activity settings only when user account exists
2025-12-11 15:07:44 -03:00
Vitor Mattos
3277ae6d4a
fix: check activity settings only when user account exists
When identification method is email and person has no account,
notification was being blocked by activity check for non-existent user.
Now checks if user exists before verifying activity notification settings.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 15:05:56 -03:00
Vitor Mattos
ce39b110e7
Merge pull request #6111 from LibreSign/feat/add-status-text-to-signers
feat: add status text to signers
2025-12-11 14:49:36 -03:00
Vitor Mattos
80136aafd9
chore: update openapi documentation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 14:38:56 -03:00
Vitor Mattos
ff3a16f223
feat: add status and statusText to ID docs signer data
Include status and statusText fields when formatting signers in
ID documents responses. This ensures consistency across all API
endpoints that return signer information.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 14:34:45 -03:00
Vitor Mattos
8af983763d
feat: include status and statusText in signer responses
Add status and statusText fields to all signer data returned by
FileService. This includes:
- Signers from LibreSign metadata (loadLibreSignSigners)
- Signers from PDF certificate data (loadSignersFromCertData)
- Signers in file listings (associateAllAndFormat)

The status field contains the numeric code (0=Draft, 1=Pending, 2=Signed)
and statusText contains the localized label.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 14:34:36 -03:00
Vitor Mattos
8602edfb4e
feat: add status and statusText to LibresignSigner type
Update the LibresignSigner psalm type definition to include status
and statusText as required fields (not optional). These fields will
always be present in API responses for signer data.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 14:34:26 -03:00
Vitor Mattos
c5c2ee1c95
feat: add getTextOfSignerStatus method to SignRequestMapper
Add a helper method to get localized status text for signers using
the SignRequestStatus enum. This method delegates to the enum's
getLabel() method to maintain consistency across the application.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 14:34:13 -03:00
Vitor Mattos
e3ad25951a
feat: add getLabel method to SignRequestStatus enum
Add a getLabel() method to the SignRequestStatus enum to provide
localized status labels (Draft, Pending, Signed). This follows the
same pattern as DocMdpLevel enum and centralizes the translation
logic in the enum itself rather than spreading it across multiple
files.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 14:28:17 -03:00
Vitor Mattos
453b200bcf
Merge pull request #6108 from LibreSign/feat/auto-save-signer-on-add
feat: auto-save signer with status 0 when added
2025-12-11 14:11:58 -03:00
Vitor Mattos
66d95e7dcc
feat: auto-save signer with status 0 when added
Automatically saves the signer to the server with status 0 (draft)
when the user adds a new signer through the Add Signer dialog.
This eliminates the need for a separate manual save action after
adding each signer.

The PATCH request is sent to /apps/libresign/api/v1/request-signature
with status: 0 immediately after the signer is added to the local state.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 13:27:01 -03:00
Vitor Mattos
efacc43884
Merge pull request #6107 from LibreSign/dependabot/composer/vendor-bin/psalm/vimeo/psalm-6.14.2
chore(deps-dev): Bump vimeo/psalm from 6.14.1 to 6.14.2 in /vendor-bin/psalm
2025-12-11 13:24:20 -03:00
Vitor Mattos
9bcb9b6b75
Merge pull request #6106 from LibreSign/dependabot/composer/tests/integration/behat/behat-3.29.0
chore(deps): Bump behat/behat from 3.27.0 to 3.29.0 in /tests/integration
2025-12-11 13:23:56 -03:00
dependabot[bot]
31e26ebe07
chore(deps-dev): Bump vimeo/psalm in /vendor-bin/psalm
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 6.14.1 to 6.14.2.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/6.14.1...6.14.2)

---
updated-dependencies:
- dependency-name: vimeo/psalm
  dependency-version: 6.14.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-11 16:15:33 +00:00
dependabot[bot]
6546a901e6
chore(deps): Bump behat/behat in /tests/integration
Bumps [behat/behat](https://github.com/Behat/Behat) from 3.27.0 to 3.29.0.
- [Release notes](https://github.com/Behat/Behat/releases)
- [Changelog](https://github.com/Behat/Behat/blob/3.x/CHANGELOG.md)
- [Commits](https://github.com/Behat/Behat/compare/v3.27.0...v3.29.0)

---
updated-dependencies:
- dependency-name: behat/behat
  dependency-version: 3.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-11 16:13:27 +00:00
Vitor Mattos
24cc223fcc
Merge pull request #6103 from LibreSign/fix/respect-draft-status-in-sign-requests
fix: respect draft status in sign requests
2025-12-11 12:58:18 -03:00
Vitor Mattos
25bce290e4
feat: respect draft status when creating sign requests
When file status is draft, new sign requests should also start as
draft regardless of signing order. This prevents automatic
notifications and keeps requests in draft mode until file is ready.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 12:48:41 -03:00
Vitor Mattos
45554e7ecf
feat: add status field to signer data in file info
Include signer status in the signers array returned by file info
endpoint to allow frontend to display draft/pending status.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 12:48:32 -03:00
Vitor Mattos
1d9729216f
Merge pull request #6100 from LibreSign/refactor/organize-enums-in-dedicated-folder
refactor: organize enums in dedicated folder
2025-12-11 11:54:55 -03:00
Vitor Mattos
3a55587934
refactor: move SignatureFlow enum to dedicated Enum directory
Move SignatureFlow from lib/Service/ to lib/Enum/ to centralize all
enum definitions in the same location following project structure
conventions.

Updated namespace from OCA\Libresign\Service to OCA\Libresign\Enum
and adjusted all imports and references across:
- AdminController (updated FQN references for from() and comparison)
- PageController (updated FQN reference)
- TemplateLoader (updated FQN reference)
- Settings/Admin (updated import statement)
- SequentialSigningService (added explicit import)

This completes the consolidation of enum types, making the codebase
more organized and easier to maintain.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 11:45:53 -03:00
Vitor Mattos
552521e546
refactor: move SignRequestStatus enum to dedicated Enum directory
Move SignRequestStatus from lib/Db/ to lib/Enum/ to follow project
convention of keeping all enums in a dedicated folder alongside
CRLStatus, CRLReason, CertificateType, and DocMdpLevel.

Updated namespace from OCA\Libresign\Db to OCA\Libresign\Enum and
adjusted all imports and references across:
- SignRequest entity (added import)
- ValidateHelper (updated FQN references)
- RequestSignatureService (updated FQN references)
- SequentialSigningService (updated import)
- SignFileService (updated FQN reference)

This improves code organization by consolidating all enum types in
one location.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 11:42:11 -03:00
Vitor Mattos
e5d703c51a
Merge pull request #6094 from LibreSign/fix/return-right-fields-when-save-a-new-file
fix: add status and created_at fields to file upload response
2025-12-11 11:28:00 -03:00
Vitor Mattos
3c223a06c2
feat: introduce FileStatus enum for type-safe status handling
Add FileStatus backed enum to provide compile-time type safety for file
status values. This replaces the previous int-based approach with a
proper enum that:

- Eliminates the need for default fallback in match expressions
- Provides IDE autocomplete for all valid status values
- Throws ValueError for invalid status codes instead of silently
  returning unknown status
- Accepts both int and FileStatus for backward compatibility

Updated getTextOfStatus() to use FileStatus enum with automatic
conversion from int via FileStatus::from(). Removed null return type
as status column is NOT NULL in database, ensuring statusText is
always a string.

This improves code maintainability and prevents invalid status values
from being used throughout the codebase.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 11:08:20 -03:00
Vitor Mattos
6a4f3d231d
Merge pull request #6095 from LibreSign/fix/optional-parameter-before-required
fix: correct parameter order in getUserConfigByKey method
2025-12-11 11:05:50 -03:00
Vitor Mattos
d3fde80329
fix: correct parameter order in getUserConfigByKey method
Optional parameter declared before required parameter causes implicit
required treatment. Changed method signature to put required parameter
$key before optional parameter $user, and updated all call sites.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 09:54:11 -03:00
Vitor Mattos
4a57a99dc6
docs: regenerate OpenAPI documentation
Update OpenAPI spec and TypeScript types to reflect changes in
LibresignNextcloudFile response type with status, statusText, and
created_at fields.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-11 09:47:55 -03:00