Add clickable links to Twig documentation (https://twig.symfony.com/)
in both Signature Stamp and Footer Template editor sections using
the v-linkify directive from @nextcloud/vue.
This improves user experience by providing direct access to Twig
syntax documentation when configuring custom templates.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Replace sad face icon with alert icon
- Add LibreSign logo header
- Use NcEmptyContent component
- Add card container with shadow
- Improve mobile responsiveness
- Clean up CSS and remove redundant styles
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add reset() method to AppConfigOverwrite that clears overWrite and deleted arrays and returns self
- Integrate reset() directly into getMockAppConfig() to ensure clean state on every call
- All tests now automatically get clean AppConfig state without explicit reset calls
- Prevents state pollution across test suites by resetting at the source
- Simplifies test code by removing need for separate reset wrapper method
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The CA ID (libresign-ca-id:...) in OrganizationalUnit should only be
filtered out when the certificate is not generated (isSetupOk() returns
false). When the certificate is successfully generated, the CA ID must
be preserved in the API response.
This ensures:
- Generated certificates: CA ID is visible (expected behavior)
- Failed/not generated: CA ID is filtered to prevent stale data in form
Integration tests validated:
- features/account/signature.feature:2 (OpenSSL)
- features/account/signature.feature:23 (CFSSL)
- features/admin/certificate_openssl.feature:2
- features/admin/certificate_openssl.feature:35
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Prevent test state pollution by ensuring config_path is deleted
in setUp(). This fixes failures in OpenSslHandlerTest where the
temporary config path from AEngineHandlerTest was persisting
through the shared appConfig mock, causing tests that expect
properly formatted PKI directory names to fail.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Filter configPath from API response when certificate is not generated to prevent
form pre-population with outdated generation numbers that cause validation errors.
Filter CA ID (libresign-ca-id:*) from OrganizationalUnit field to prevent users
from submitting stale generation values that conflict with certificate validation.
Refactor toArray() method by extracting logic into dedicated methods:
- getConfigPathForApi(): Returns empty string for non-generated certificates
- removeCaIdFromOrganizationalUnit(): Filters CA IDs from OU arrays
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Delete PDFs from root fixtures directory.
Files now organized in tests/php/fixtures/pdfs/ with catalog.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Create catalog system for managing real-world signed PDFs:
- PdfFixtureCatalog class with YAML-based metadata
- Filter by DocMDP level, TSA, signature tool, count
- Provides expected validation results for tests
- Includes PdfFixture wrapper for easy access
- Store real PDFs in tests/php/fixtures/pdfs/ directory
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Delete trait after migrating all methods to PdfGenerator.
The trait pattern was unnecessary for stateless utility methods.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Consolidate PDF fixture generation into a single static class:
- Migrate all methods from PdfFixtureTrait to PdfGenerator
- Convert trait methods to public static methods
- Maintain all existing functionality
- Includes 20+ methods for ISO 32000-1 edge case testing
This improves code organization and eliminates trait usage.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add isDocMdpNoChangesAllowed() method to files store
- Update canAddSigner() to check DocMDP level 1 with existing signers
- Only blocks after first signer is added (not before)
- Encapsulates logic in reusable method
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add docmdp_level to SELECT and GROUP BY in SignRequestMapper
- Format docmdpLevel as integer in API response
- Add docmdpLevel to FileService::loadLibreSignData()
- Ensures frontend receives per-file DocMDP configuration
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Update validateDocMdpAllowsSignatures() to check file's docmdpLevel first
- Falls back to PDF extraction for legacy files (level 0)
- Throws consistent error message for DocMDP level 1
- Prevents adding signatures to certified documents with no changes allowed
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add DocMdpConfigService dependency to RequestSignatureService
- Create setDocMdpLevelFromGlobalConfig() method
- Save admin DocMDP configuration to file entity on creation
- Allows per-file DocMDP configuration instead of only global
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Removed IAppConfig mock from test setup to match updated
service constructor signature.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
IAppConfig was injected but never used in any method.
Removed dependency to clean up constructor.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Updated tests to inject FileStatusService and SignRequestStatusService
mocks. Added specific tests validating parallel and ordered flow
behavior with correct parameter ordering for determineInitialStatus.
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>