feat(project-editor): live inline validation and publish gating

Milestone 3 of the Configuration Engine sprint.

- Facade fieldError(key) accessor over issuesByField for inline field errors.
- Bind [error] on schema-backed fields: theme palette colours, general
  name/domain, branding logo (translated via each section).
- project-editor-nav: per-section blocking-issue count badge (issuesBySection).
- save-bar: Publish now disabled on hasBlockingIssues() (errors only, so new
  warnings no longer block); issue list tags warning vs error severity.

Editor verified rendering at /ru/edit/theme with the new nav + save bar;
validation logic covered by the 25 unit tests.

Gate: tsc --noEmit, npm test (25/25), arch:check, build all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
sdarbinyan
2026-07-17 02:07:14 +04:00
parent 7b8382131d
commit a7bab6be52
13 changed files with 77 additions and 15 deletions

View File

@@ -119,6 +119,12 @@ export class ProjectEditorFacade {
this.draftStorage.save(next);
}
/** i18n message key of the first issue mapped to a field, or null. Reactive: reads `issuesByField`. */
fieldError(fieldKey: string): string | null {
const issues = this.issuesByField().get(fieldKey);
return issues && issues.length > 0 ? issues[0].message : null;
}
dismissDraftRestoredNotice(): void {
this.state.update(current => ({ ...current, draftRestored: false }));
}