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>
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>
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>
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>
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>
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>
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>
- 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>
- 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>
- 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>
- 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>
- 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>
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>
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>
- 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>
- 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>
- 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>
- 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>
- 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>
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>
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>
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>
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>
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>