Skip to content

feat: policy signature flow#7518

Draft
vitormattos wants to merge 1500 commits into
mainfrom
feat/policy-signature-flow-phase1-groundwork
Draft

feat: policy signature flow#7518
vitormattos wants to merge 1500 commits into
mainfrom
feat/policy-signature-flow-phase1-groundwork

Conversation

@vitormattos
Copy link
Copy Markdown
Member

No description provided.

@vitormattos vitormattos added this to the Next Major (34) milestone Apr 14, 2026
@vitormattos vitormattos self-assigned this Apr 14, 2026
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Apr 14, 2026
@vitormattos vitormattos marked this pull request as draft April 14, 2026 17:54
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch 2 times, most recently from 955dec8 to 2b5c509 Compare April 14, 2026 20:24
@vitormattos vitormattos marked this pull request as ready for review April 14, 2026 20:34
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch 3 times, most recently from e0949a0 to e843d15 Compare April 23, 2026 14:49
@vitormattos vitormattos marked this pull request as draft April 23, 2026 14:50
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch 5 times, most recently from a34a632 to 6aa5f3b Compare April 28, 2026 13:46
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>
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch 3 times, most recently from 1c39cdb to 892fbd0 Compare April 28, 2026 17:08
@vitormattos vitormattos marked this pull request as ready for review April 28, 2026 20:48
@vitormattos vitormattos marked this pull request as draft April 28, 2026 20:52
@vitormattos vitormattos force-pushed the feat/policy-signature-flow-phase1-groundwork branch 3 times, most recently from c6cc732 to 0e665a6 Compare May 4, 2026 14:31
Comment thread playwright/support/nc-provisioning.ts Fixed
Comment thread playwright/support/nc-provisioning.ts Fixed
Comment thread playwright/support/nc-provisioning.ts Fixed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 0. Needs triage

Development

Successfully merging this pull request may close these issues.

2 participants