fix(builder): un-hide and relabel static-page content editor, warn on publish/remove-language

- KNOWN-ISSUES item 11: the WYSIWYG page content editor was buried inside
  a collapsed Advanced <details>, labeled 'Raw HTML (advanced)'. Moved it
  to the top of the Content tab, unwrapped, relabeled 'Page Content' /
  'Содержимое страницы' / 'Эջի բովանդակություն' with a plain-language
  description. Advanced tab keeps genuinely technical fields (id, slug,
  route, custom template).
- Publish (save-bar) and Remove language (languages-section) had no
  confirmation despite being destructive/high-impact — added
  window.confirm guards using the existing builder.confirm* i18n pattern
  (matches resetDraft/resetSection/dirty-guard precedent), all 3 locales.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
sdarbinyan
2026-07-25 20:43:43 +04:00
parent 38253f7e83
commit 72846b44b1
8 changed files with 50 additions and 27 deletions

View File

@@ -49,6 +49,25 @@
</app-form-field>
}
<div class="page-editor__content-block">
<h3 class="page-editor__content-heading">{{ 'contentManagement.pageContentLabel' | translate }}</h3>
<p class="page-editor__explain">{{ 'contentManagement.pageContentDesc' | translate }}</p>
@for (locale of locales(); track locale) {
<label class="full page-editor__html-block">
@if (locales().length > 1) {
<span>{{ ('contentManagement.pageContentLabel' | translate) + ' — ' + locale }}</span>
}
<app-marketplace-html-editor
[html]="page().translations[locale]?.html || ''"
(htmlChange)="updateTranslation.emit({ locale, field: 'html', value: $event })"
/>
@if (hasInvalidHtml()) {
<p class="page-editor__error">{{ 'staticPages.invalidHtml' | translate }}</p>
}
</label>
}
</div>
<div class="page-editor__media-grid">
<div class="media-block">
<span class="media-block__label">{{ 'staticPages.heroImageLabel' | translate }}</span>
@@ -193,22 +212,6 @@
<app-form-field [label]="'builder.seoKeywords' | translate">
<app-input [ngModel]="page().seo?.keywords || ''" (ngModelChange)="updateSeo.emit({ keywords: $event })" />
</app-form-field>
<details class="page-editor__html-disclosure">
<summary>{{ 'contentManagement.groupAdvancedHtml' | translate }}</summary>
@for (locale of locales(); track locale) {
<label class="full page-editor__html-block">
<span>{{ 'builder.htmlPreview' | translate }} {{ locale }}</span>
<app-marketplace-html-editor
[html]="page().translations[locale]?.html || ''"
(htmlChange)="updateTranslation.emit({ locale, field: 'html', value: $event })"
/>
@if (hasInvalidHtml()) {
<p class="page-editor__error">{{ 'staticPages.invalidHtml' | translate }}</p>
}
</label>
}
</details>
</div>
}
</div>

View File

@@ -109,16 +109,16 @@
gap: 8px;
}
.page-editor__html-disclosure {
border: 1px solid var(--border-subtle, #e7ece9);
border-radius: 10px;
padding: 10px 14px;
.page-editor__content-block {
display: grid;
gap: 8px;
}
summary {
cursor: pointer;
font-weight: var(--font-weight-bold, 700);
color: var(--text-primary, #1e3c38);
}
.page-editor__content-heading {
margin: 0;
font-size: var(--font-size-base, 0.875rem);
font-weight: var(--font-weight-bold, 700);
color: var(--text-primary, #1e3c38);
}
.page-editor__html-block {

View File

@@ -37,7 +37,9 @@ export class ProjectEditorSaveBarComponent {
}
publish(): void {
this.facade.publish();
if (confirm(this.translate.t('builder.confirmPublish'))) {
this.facade.publish();
}
}
resetDraft(): void {

View File

@@ -59,7 +59,9 @@ export class ProjectEditorLanguagesSectionComponent {
}
removeLocale(code: string): void {
this.facade.removeLocale(code);
if (confirm(this.translate.t('builder.confirmRemoveLanguage'))) {
this.facade.removeLocale(code);
}
}
setDefault(code: string): void {