Skip to content

Conversation

@vitormattos
Copy link
Member

No description provided.

vitormattos and others added 11 commits December 2, 2025 12:43
Signed-off-by: Vitor Mattos <vitor@php.rio>
Introduces new IdDocs system to manage identification documents
for digital signatures, replacing the AccountFile system.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Creates libresign_id_docs table and migrates data from
libresign_account_file to the new structure.

Addresses: #2884, #5260

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Adds REST API endpoints for ID documents management:
- POST /api/v1/id-docs - Add identification documents
- DELETE /api/v1/id-docs - Delete document
- GET /api/v1/id-docs - List documents
- GET /api/v1/id-docs/approval/list - List documents pending approval

Updates PageController route from /account/files to /id-docs

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Updates all service layer code to use IdDocsMapper:
- AccountService: replace AccountFileMapper with IdDocsMapper
- SignFileService: update validation to use IdDocs
- ValidateHelper: migrate document validation logic
- FolderService: add IUser object handling
- Remove AccountFile dependencies from AccountController

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Updates File entity and related controllers to work with IdDocs
instead of AccountFile references.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Removes deprecated AccountFile entity, mapper and service
after migration to IdDocs system.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Rename AccountValidation to IdDocsValidation component
- Update router paths from /docs/accounts to /docs/id-docs
- Update route names: DocsAccountValidation -> DocsIdDocsValidation
- Update action handlers to use IdDocsApprove route
- Update LeftSidebar navigation links

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add IdDocsServiceTest with comprehensive test coverage
- Update ValidateHelperTest, AccountServiceTest and SignFileServiceTest
- Remove AccountFileServiceTest
- Fix test mocks to work with IdDocsMapper

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Create IdDocsControllerTest with tests for new endpoints
- Update AccountControllerTest removing deprecated tests
- Ensure all API endpoints are properly tested

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Updates OpenAPI spec and TypeScript types to reflect:
- New IdDocs endpoints
- Removed AccountFile endpoints
- Fixed complex filter parameter warnings

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the refactor/attach-document branch from 6ab87a6 to 4915cb8 Compare December 2, 2025 16:58
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add missing psalm-import-type for LibresignPagination and LibresignFile
- Add #[Override] attributes to migration methods
- Fix timestamp conversion using getTimestamp() method
- Fix signRequestId type from string to int
- Fix filter parameter type from string to array<string, mixed>
- Fix typo: singRequestId -> signRequestId

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Change pattern name from 'identifier' to 'userId' to match tests
- Initialize folderName as empty array instead of null
- Maintain support for both IUser objects and string identifiers

Fixes test failures in FolderServiceTest::testGetFolderName

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Auto-formatted import order by IDE/linter.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
When signing as unauthenticated user, $user is null and $user?->getUID()
returns null. The getIdentificationDocumentsStatus() method expects a
string parameter, so we need to use null coalescing operator to provide
empty string as fallback.

Fixes integration test failures:
- request.feature:420
- request.feature:479
- signed.feature:169

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add NcActions with validate and delete buttons
- Hide validate button when document is already signed (status === 4)
- Add deleteDocument method to remove ID documents
- Use proper Nextcloud components and icons

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add beforeRouteLeave navigation guard to ensure sidebar closes
when navigating away from ID document approval screen.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Use UUIDUtil::getUUID() instead of OCP\Util (consistent with codebase)
- Change setMandatory parameter from true to 1 (expects int not bool)
- Add IdDocsService and SignFileService to psalm baseline for UUIDUtil

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add :force-menu="true" to keep actions menu always visible
- Add View button with EyeIcon to navigate to validation page
- Add Validate button (hidden when status is 4/signed)
- Add Delete button with DeleteIcon
- Remove redundant View PDF button (merged with View)
- Use router.push for in-app navigation

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add :inline="2" to show first 2 buttons inline
- Add :force-name="true" to display button labels
- Keep standard NcActions dropdown behavior for remaining actions

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace CheckIcon with PencilIcon to better represent the action
of signing the ID document for approval

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add NcAvatar as first column showing document owner
- Display owner name in second column
- Reorder columns: Avatar, Owner, Type, Status, Actions
- Add blank header cell for avatar column

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add 'Approved by' column showing who validated/signed the document
- Display avatar and name of the signer who completed sign_date
- Show '-' when document hasn't been signed yet

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Change condition from doc.status to doc.file?.status
- Check for status !== 3 (signed) instead of !== 4
- Fixes Sign button appearing on already signed documents

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add getUserConfigIdDocsFilters() method to load user filter preferences
- Move admin permission check into getUserConfigCrlFilters() and getUserConfigCrlSort()
- Simplify getConfig() by removing redundant conditionals
- Each getUserConfig*() method now handles its own validation and default values

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add Owner and Status filters with NcActions toolbar
- Implement filter persistence using userConfigStore
- Apply CRL table structure with frozen columns and sticky headers
- Filters saved automatically with 500ms debounce
- Load saved filters from user config on mount

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add IL10N injection to IdDocsMapper for proper translation support
- Change status text from generic 'available for signature' to context-specific messages
  - Status 1 (STATUS_ABLE_TO_SIGN): 'waiting for approval'
  - Status 3 (STATUS_SIGNED): 'approved'
- Helps users better understand their document state in the approval workflow

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Modified /api/v1/file/list endpoint to return identification document settings
- Settings are extracted from first file (global per user, not per file)
- Enables file list flow to have settings available without additional requests
- Complements direct URL flow for comprehensive coverage

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add null coalescing operator to handle potential null return from getTextOfStatus()
- Fixes Psalm InvalidNullableReturnType and NullableReturnStatement errors

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Change from array[] to array<string, mixed> for more accurate type
- Fixes Psalm InvalidReturnType and InvalidReturnStatement errors

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Import useIdentificationDocumentStore in files.js
- Process settings from /api/v1/file/list response
- Update identificationDocumentStore when file list is loaded
- Enables proactive identification document detection for file list flow

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Change title from 'Your profile documents' to 'Identification Documents'
- Makes component suitable for use in both profile page and sign flow

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Show Documents component directly instead of in modal
- Remove uploadDocuments modal code (no longer needed)
- Provides more direct and intuitive user experience

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the refactor/attach-document branch from a843e05 to 3ee0f46 Compare December 3, 2025 01:16
@vitormattos vitormattos marked this pull request as ready for review December 3, 2025 01:24
@vitormattos vitormattos merged commit 4c6fa9a into main Dec 3, 2025
66 checks passed
@vitormattos vitormattos deleted the refactor/attach-document branch December 3, 2025 01:25
@github-project-automation github-project-automation bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 3, 2025
@vitormattos
Copy link
Member Author

/backport to stable32

@vitormattos
Copy link
Member Author

/backport to stable31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

2 participants