feat: policy signature flow#7518
Draft
vitormattos wants to merge 1500 commits into
Draft
Conversation
955dec8 to
2b5c509
Compare
e0949a0 to
e843d15
Compare
a34a632 to
6aa5f3b
Compare
vitormattos
added a commit
that referenced
this pull request
Apr 28, 2026
FIXES: - Register all 6 signature_text individual policy keys in SignatureTextPolicy - Each key now has proper normalizers and defaults matching backend - Fix mock object type errors by converting willReturnMap to willReturnCallback - Mock callbacks now always return string (never null) to match type hints - Update mock expectations from once()/exactly(2) to atLeastOnce() for deleteKey() - Align test expectations with actual migration call counts DETAILS: * SignatureTextPolicy: Now exposes 6 individual keys via keys() and get() * Each key (template, template_font_size, signature_width, etc.) has proper specs * Render mode key includes allowed values: 'default', 'graphic', 'text' * Migration tests: Fixed mock return types to prevent TypeError * All getValueString() calls now guaranteed to return string via callback * Adjusted deleteKey() and setValueString() expectations to handle migration flow Test Results Expected: - 0 Unknown policy key errors (all 6 now registered) - 0 Mock type errors (callbacks always return string) - 0 Mock expectation violations (atLeastOnce accounts for cleanup calls)
vitormattos
added a commit
that referenced
this pull request
Apr 28, 2026
…olicy - Fix useSignatureTextPolicy.ts accessing .effectiveValue instead of non-existent .value - Simplify useSignatureTextPolicy return type annotation using ComputedRef - Fix model.ts serializeSignatureTextPolicyConfig to return JSON string - Fix model.ts normalizeSignatureTextPolicyConfig to handle JSON string inputs - Fix SignatureTextRuleEditor.vue Emits type to use EffectivePolicyValue - Remove trailing newline from SignatureTextPolicy.php Fixes: TypeScript type checking and PHP-CS formatting failures in PR #7518 Tests: npm run ts:check passes, php-cs formatting validated
vitormattos
added a commit
that referenced
this pull request
Apr 28, 2026
FIXES: - Register all 6 signature_text individual policy keys in SignatureTextPolicy - Each key now has proper normalizers and defaults matching backend - Fix mock object type errors by converting willReturnMap to willReturnCallback - Mock callbacks now always return string (never null) to match type hints - Update mock expectations from once()/exactly(2) to atLeastOnce() for deleteKey() - Align test expectations with actual migration call counts DETAILS: * SignatureTextPolicy: Now exposes 6 individual keys via keys() and get() * Each key (template, template_font_size, signature_width, etc.) has proper specs * Render mode key includes allowed values: 'default', 'graphic', 'text' * Migration tests: Fixed mock return types to prevent TypeError * All getValueString() calls now guaranteed to return string via callback * Adjusted deleteKey() and setValueString() expectations to handle migration flow Test Results Expected: - 0 Unknown policy key errors (all 6 now registered) - 0 Mock type errors (callbacks always return string) - 0 Mock expectation violations (atLeastOnce accounts for cleanup calls) Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
vitormattos
added a commit
that referenced
this pull request
Apr 28, 2026
…olicy - Fix useSignatureTextPolicy.ts accessing .effectiveValue instead of non-existent .value - Simplify useSignatureTextPolicy return type annotation using ComputedRef - Fix model.ts serializeSignatureTextPolicyConfig to return JSON string - Fix model.ts normalizeSignatureTextPolicyConfig to handle JSON string inputs - Fix SignatureTextRuleEditor.vue Emits type to use EffectivePolicyValue - Remove trailing newline from SignatureTextPolicy.php Fixes: TypeScript type checking and PHP-CS formatting failures in PR #7518 Tests: npm run ts:check passes, php-cs formatting validated Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1c39cdb to
892fbd0
Compare
c6cc732 to
0e665a6
Compare
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ement spec Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…management spec Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…t spec Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…le management spec Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…nal policies Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…nt spec Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…management spec Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…y response field The DocMdpPolicy normalizer was not casting numeric strings to int before validation, causing HTTP 400 when the value was sent as a string (e.g. from API requests or Behat table params where all values are strings). Add is_numeric guard in the normalizer so string integers like "2" are cast to int before the strict in_array check against [0, 1, 2, 3]. Also fix the integration test: the group policy write endpoint returns a PolicyLayer (field: value) not a ResolvedPolicy (field: effectiveValue). Update the assertion to check (jq).ocs.data.policy.value instead. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…al worker config key - Add readLegacyFloat() helper that falls back to getValueFloat() when getValueString() throws AppConfigTypeConflictException (type 16 float). - Replace four readLegacyString() calls in migrateSignatureTextSettingsType() with readLegacyFloat() so template_font_size, signature_width, signature_height and signature_font_size are read from typed storage. Production values (9.9, 351, 101) were silently replaced by defaults (9.8, 350.0, 100.0) before this fix. - Simplify $hasLegacyValues guards: float fields use !== null (no trim()). - Remove redundant (float) casts on consolidatedValue; values are already float. - Fix migrateWorkerConfig() to write to WorkerConfigPolicy::SYSTEM_APP_CONFIG_KEY instead of the legacy 'policy.worker_config.system' key. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…nature dimensions - testMigratesLegacyWorkerSettingsToCanonicalWorkerConfigKey: verifies that legacy worker_type=external + parallel_workers=18 are consolidated into the canonical worker_config JSON key. - testMigratesLegacyConsolidatedWorkerKeyToCanonicalKey: verifies that policy.worker_config.system is moved to worker_config and old key deleted. - testPreservesSignatureTextFloatDimensionsAlreadyTypedAsFloat: reproduces the production scenario where dimension keys are stored as type 16 float. getValueString throws AppConfigTypeConflictException; getValueFloat returns 9.9, 351.0, 101.0, 20.0. Asserts consolidated JSON preserves those values. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Replace deleteAppConfig import with setAppConfig. - Set identification_documents policy to disabled before test run. - Explicitly set signature_engine to PhpNative to avoid OpenSSL dependency. - Disable account identify method; keep email-only flow. - Use .first() on ambiguous locators (option, Signer name textbox). - Replace optional email-textbox branch with parallel waitFor + expect so the test fails fast if neither button nor textbox appears. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Import setCertificateEngine and call it explicitly with openssl. - Add useFooterPolicyGuard() to ensure footer policy is active. - Disable identification_documents policy before test run. - Match Sign CTA with /Sign the document.|Sign document/ regex and .first() to handle both label variants and avoid strict-mode errors. - Wrap final openSignButton click in isVisible guard; fall through to 'Sign document' button when the first CTA is no longer present. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.