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:
@@ -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 }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user