feat: policy signature flow#7518
Draft
vitormattos wants to merge 1162 commits intomainfrom
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
… update friendly_name expectation Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… error Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ment, test fixes - Add navigation lock to prevent IntersectionObserver from overriding manually-clicked chip selection during smooth scroll - Blur chip button on mouse click to remove lingering focus ring - Blur focused chip when activeCategory changes (scroll-driven updates) - Guard getBoundingClientRect calls against environments lacking implementation (happy-dom tests) - Ensure all 10 tests pass without unhandled errors Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…orkbench Create new organized structure for PolicyWorkbench refactoring: - Catalog/ directory with components/, composables/ subdirectories - Copy Catalog.vue (from RealPolicyWorkbench.vue) as root orchestrator - Copy PolicyRuleCard.vue and PolicyRuleEditorPanel.vue to components/ - Copy useRealPolicyWorkbench.ts to composables/ - Add README.md documenting refactoring plan and phases This is Phase 1 (base structure) of planned multi-phase refactoring to: - Extract usable composables (useNavigation, useCatalogState) - Break monolithic 4095-line component into modular pieces (~200-400 lines each) - Improve maintainability and testability Original files remain in place during transition period. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ench Extract two new composables to separate concerns: - useCatalogState.ts: Search filter, layout mode (cards/compact), collapse states - settingsFilter, catalogLayout, isCatalogCollapsed, categoryCollapsedState - toggleCatalogLayout(), toggleCatalogCollapsed(), toggleCategoryCollapsed() - Manages persistence via userConfigStore - useNavigation.ts: Scroll tracking, active category, IntersectionObserver - activeCategory, showBackToTop, category chip navigation - scrollToCategory(), attachScrollListener(), reconnectSectionObserver() - Navigation lock to prevent conflicts during smooth scroll - Blur management for focus ring cleanup These will be consumed by Catalog.vue component orchestrator, reducing monolithic component from 4095 to ~300 lines. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…omputeds 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>
- Fix NcTextField @update:modelValue binding to accept string | number - Add optional groupCount and userCount to SettingSummary type - Make hasActiveOverrides and formatOverrideSummary functions accept optional parameters - Fix import path in PolicyRuleEditorPanel to use @ alias - Fix getBoundingClientRect type guard in useNavigation Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Fix catalog user-config persistence calls to use update(key, value) - Make catalog collapse toggle sync section states and persistence - Expand collapsed category on chip navigation before scrolling - Relax user config response matcher to any successful PUT - Update policy settings visibility scenario for current create-rule guard behavior Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Render matching sections expanded while search filter is active - Keep persisted collapsed state untouched during search-driven expansion - Avoid chip navigation state writes while filtering - Add Playwright regression coverage for non-persistent search expansion Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Use crypto randomBytes for test namespace generation to satisfy CodeQL js/insecure-randomness findings on PR 7518. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update policy workbench back-to-top navigation to scroll to the catalog toolbar/search input instead of absolute page top, and focus the search field for faster keyboard follow-up. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Refactor useNavigation scroll helpers to reduce duplication and add unit tests for back-to-top behavior in window and scroll-container modes, including focus behavior for the search input. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update category activation to prioritize sections that have at least one fully visible card inside the effective viewport (accounting for the sticky chip bar offset). Keep geometry fallback for edge cases and add unit tests for the new selection heuristic. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Bind catalog toolbar and chip scroller refs as reactive refs instead of string refs, so navigation receives real DOM elements and back-to-top can target the search toolbar. Also add a Playwright regression test validating back-to-top returns to the search toolbar (not absolute page top). Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Sync active category on each scroll frame (in addition to observer updates) so chip state does not get stuck while the content scrolls. Add Playwright coverage asserting active chip follows the section with visible cards while scrolling. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Normalize catalog state before opening specific setting cards (expanded sections + card view + search), and reuse this flow across footer and signing-order e2e scenarios. Also harden system-default persistence expectations for environments where user-target rule creation is not exposed in the UI. 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>
2caf7c9 to
fbf3170
Compare
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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.