Skip to content

feat: policy signature flow#7518

Open
vitormattos wants to merge 928 commits intomainfrom
feat/policy-signature-flow-phase1-groundwork
Open

feat: policy signature flow#7518
vitormattos wants to merge 928 commits intomainfrom
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
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>
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>
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>
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>
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>
…plate is empty

When all admin-level customizations are deleted, the policy's
inheritedValue has an empty footerTemplate. Previously resolveEditorProps
unconditionally overrode baseEditorProps.inheritedTemplate with that
empty string, silently discarding the system-level default injected by
PHP via loadState('libresign', 'footer_template', '').

Now resolveEditorProps only overrides inheritedTemplate when the
inherited level provides a non-empty custom footer template. Otherwise
it falls back to baseEditorProps.inheritedTemplate, preserving the real
system default so the user reset button always restores a meaningful
value instead of blank.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…rect fallback

Replace the two tests that were asserting the broken behavior
(inheritedTemplate overwritten with '' when policy has empty footerTemplate)
with correct expectations:
- empty inheritedValue footerTemplate → falls back to base (system default)
- empty inheritedValue when no inheritedValue property → keeps base
- non-empty inheritedValue footerTemplate → properly overrides base

Also add test for the non-empty case to cover the full matrix.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…is resolved

The showTemplateResetButton:false override was added as a workaround
when inheritedTemplate was always empty in the user Preferences context
(because resolveEditorProps was discarding the loadState fallback).

Now that resolveEditorProps correctly falls back to the PHP-injected
system-level footer template when no admin-level template is configured,
inheritedTemplate is always properly resolved. Remove the guard so the
editor's own showResetTemplateButton computed takes over:
- hidden when currentTemplate == inheritedTemplate (nothing to reset)
- shown when the user's template differs from the inherited default

This allows users to reset just their footer template back to the
inherited default (instance admin > group admin > system default)
without having to clear their entire preference.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…sentinel

Previously onTemplateReset and onCustomizeFooterTemplateChange used
footerTemplate:'' as a sentinel meaning 'use the inherited template'.
This sentinel relied on the value-computed hook to inject inheritedTemplate
at display time, but the emitted model value carried '' — which gets saved
to the user preference as-is.

On the next page load, if inheritedTemplate resolved to something different
(or to '' because no admin customization exists), the display and the
preference diverged, showing blank or the wrong value after reset.

Fix: make both operations save the concrete value:
- onTemplateReset now saves footerTemplate:props.inheritedTemplate so
  the preference stores the real inherited default explicitly.
- onCustomizeFooterTemplateChange (enable path) now seeds the template
  with the current display value (which already incorporates inheritedTemplate
  via the computed) so enabling customization never stores an empty template
  when an inherited default is available.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…r reset

Update the 'restores inherited template in editor after reset' test:
the emitted model value after onTemplateReset must now contain
footerTemplate:'Inherited footer template' (the concrete inherited value)
instead of footerTemplate:'' (the old empty-sentinel behavior that caused
saved preferences to diverge from the displayed template).

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…RuleEditor

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>
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.

1 participant