2026-07-10 13:52:01 +04:00
|
|
|
<section class="editor-section-card">
|
2026-07-17 16:18:22 +04:00
|
|
|
@if (fieldError('staticPages'); as msg) {
|
|
|
|
|
<p class="editor-error">{{ msg }}</p>
|
|
|
|
|
}
|
2026-07-10 13:52:01 +04:00
|
|
|
|
2026-07-18 11:02:26 +04:00
|
|
|
@if (editingPage(); as page) {
|
|
|
|
|
<app-page-editor
|
|
|
|
|
[page]="page"
|
|
|
|
|
[locales]="locales()"
|
|
|
|
|
[defaultLocale]="defaultLocale()"
|
|
|
|
|
[hasDuplicateSlug]="hasDuplicateSlug(page)"
|
|
|
|
|
[hasDuplicateRoute]="hasDuplicateRoute(page)"
|
|
|
|
|
[hasEmptyTitle]="hasEmptyTitle(page)"
|
|
|
|
|
[hasInvalidHtml]="hasInvalidHtml(page)"
|
|
|
|
|
[hasInvalidSeo]="hasInvalidSeo(page)"
|
|
|
|
|
(close)="closeEditor()"
|
|
|
|
|
(updatePage)="updatePage(page.id, $event)"
|
|
|
|
|
(updateTranslation)="updateTranslation(page.id, $event.locale, $event.field, $event.value)"
|
|
|
|
|
(updateSeo)="updateSeo(page.id, $event)"
|
|
|
|
|
(updateGallery)="updateGallery(page.id, $event)"
|
|
|
|
|
(openMediaPicker)="openMediaPicker(page.id, $event)"
|
|
|
|
|
(clearMedia)="clearMedia(page.id, $event)"
|
|
|
|
|
(duplicatePage)="duplicatePage(page.id)"
|
|
|
|
|
(deletePage)="deletePage(page.id)"
|
|
|
|
|
/>
|
|
|
|
|
} @else {
|
|
|
|
|
<div class="editor-actions">
|
|
|
|
|
<h2>{{ 'builder.staticPages' | translate }}</h2>
|
|
|
|
|
<app-button variant="primary" (click)="createPage()">{{ 'builder.createPage' | translate }}</app-button>
|
|
|
|
|
</div>
|
feat(static-pages): CRUD completion + search/filter/bulk actions
Milestone 2 of the Static Pages Module sprint.
- StaticPagesEditorComponent: duplicate page, confirm-before-delete/bulk-
delete (matches the resetDraft confirm pattern), route/enabled/customTemplate/
media(hero/thumbnail/gallery) fields wired into the card, per-page publish/
unpublish action, status + duplicate-route/invalid-html/invalid-seo badges.
- Search (id/slug/route/title across all locales), filter by status
(draft/published) and by locale (hides pages missing a translation for the
selected locale) - all local computed() filters, no new service.
- Bulk selection (per-row + select-all-visible checkboxes) with bulk delete/
enable/disable/publish/unpublish, one updateBootstrap() call each.
- Correctness note: introduced `allPages` (unfiltered) vs `pages` (filtered
view) computeds. Every mutation (create/duplicate/delete/move/bulk) reads
from allPages(), never the filtered pages() - reading from the filtered
view would have silently deleted whatever an active search/filter hid on
the next persist(). Documented inline on persist() as a guardrail for
future edits.
- Fixed a template compile error found by the build gate: Angular templates
don't support inline arrow functions in binding expressions
((ngModelChange)="...map(v => v.trim())..." failed to parse) - moved the
gallery CSV-parsing into a component method (updateGallery).
- SEO robots field added to the page card (validated against a known-token
set from M1).
- i18n: staticPages.* extended (search/filter/bulk/route/enabled/status/
media/robots/disabled labels) across the interface + en/ru/hy.
Gate: tsc --noEmit, npm test (57/57), arch:check, build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 09:55:21 +04:00
|
|
|
|
2026-07-18 11:02:26 +04:00
|
|
|
<app-content-dashboard [health]="contentHealth()" (createPage)="createPage()" (goToPage)="openEditor($event)" />
|
|
|
|
|
|
|
|
|
|
<div class="editor-grid three static-pages-toolbar">
|
|
|
|
|
<app-form-field [label]="'staticPages.searchPlaceholder' | translate">
|
|
|
|
|
<app-input [ngModel]="searchQuery()" (ngModelChange)="updateSearchQuery($event)" [placeholder]="'staticPages.searchPlaceholder' | translate" />
|
|
|
|
|
</app-form-field>
|
|
|
|
|
<app-form-field [label]="'staticPages.statusLabel' | translate">
|
|
|
|
|
<app-select [options]="statusFilterOptions()" [ngModel]="statusFilter()" (ngModelChange)="updateStatusFilter($event)" />
|
|
|
|
|
</app-form-field>
|
|
|
|
|
<app-form-field [label]="'builder.languagesTab' | translate">
|
|
|
|
|
<app-select [options]="localeFilterOptions()" [ngModel]="localeFilter()" (ngModelChange)="updateLocaleFilter($event)" />
|
|
|
|
|
</app-form-field>
|
feat(static-pages): CRUD completion + search/filter/bulk actions
Milestone 2 of the Static Pages Module sprint.
- StaticPagesEditorComponent: duplicate page, confirm-before-delete/bulk-
delete (matches the resetDraft confirm pattern), route/enabled/customTemplate/
media(hero/thumbnail/gallery) fields wired into the card, per-page publish/
unpublish action, status + duplicate-route/invalid-html/invalid-seo badges.
- Search (id/slug/route/title across all locales), filter by status
(draft/published) and by locale (hides pages missing a translation for the
selected locale) - all local computed() filters, no new service.
- Bulk selection (per-row + select-all-visible checkboxes) with bulk delete/
enable/disable/publish/unpublish, one updateBootstrap() call each.
- Correctness note: introduced `allPages` (unfiltered) vs `pages` (filtered
view) computeds. Every mutation (create/duplicate/delete/move/bulk) reads
from allPages(), never the filtered pages() - reading from the filtered
view would have silently deleted whatever an active search/filter hid on
the next persist(). Documented inline on persist() as a guardrail for
future edits.
- Fixed a template compile error found by the build gate: Angular templates
don't support inline arrow functions in binding expressions
((ngModelChange)="...map(v => v.trim())..." failed to parse) - moved the
gallery CSV-parsing into a component method (updateGallery).
- SEO robots field added to the page card (validated against a known-token
set from M1).
- i18n: staticPages.* extended (search/filter/bulk/route/enabled/status/
media/robots/disabled labels) across the interface + en/ru/hy.
Gate: tsc --noEmit, npm test (57/57), arch:check, build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 09:55:21 +04:00
|
|
|
</div>
|
|
|
|
|
|
2026-07-18 11:02:26 +04:00
|
|
|
@if (pages().length > 0) {
|
|
|
|
|
<div class="editor-actions static-pages-bulk-bar">
|
|
|
|
|
<label class="toggle-row">
|
|
|
|
|
<app-toggle [ngModel]="allVisibleSelected()" (ngModelChange)="toggleSelectAllVisible($event)" [ariaLabel]="'staticPages.selectAll' | translate" />
|
|
|
|
|
<span>{{ 'staticPages.selectAll' | translate }}</span>
|
|
|
|
|
</label>
|
|
|
|
|
@if (selectedCount() > 0) {
|
|
|
|
|
<span>{{ selectedCount() }} {{ 'staticPages.selectedCount' | translate }}</span>
|
|
|
|
|
<app-button variant="secondary" size="sm" (click)="bulkSetEnabled(true)">{{ 'staticPages.bulkEnable' | translate }}</app-button>
|
|
|
|
|
<app-button variant="secondary" size="sm" (click)="bulkSetEnabled(false)">{{ 'staticPages.bulkDisable' | translate }}</app-button>
|
|
|
|
|
<app-button variant="secondary" size="sm" (click)="bulkSetStatus('published')">{{ 'staticPages.bulkPublishAction' | translate }}</app-button>
|
|
|
|
|
<app-button variant="secondary" size="sm" (click)="bulkSetStatus('draft')">{{ 'staticPages.bulkUnpublish' | translate }}</app-button>
|
|
|
|
|
<app-button variant="danger" size="sm" (click)="bulkDelete()">{{ 'staticPages.bulkDelete' | translate }}</app-button>
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2026-07-10 13:52:01 +04:00
|
|
|
|
2026-07-18 11:02:26 +04:00
|
|
|
@if (pages().length === 0) {
|
|
|
|
|
<app-empty-state [title]="'contentManagement.emptyStateGuideTitle' | translate" [description]="'contentManagement.emptyStateGuideBody' | translate">
|
|
|
|
|
<span slot="actions">
|
|
|
|
|
<app-button variant="primary" (click)="createPage()">{{ 'builder.createPage' | translate }}</app-button>
|
|
|
|
|
</span>
|
|
|
|
|
</app-empty-state>
|
|
|
|
|
}
|
2026-07-10 13:52:01 +04:00
|
|
|
|
2026-07-18 11:02:26 +04:00
|
|
|
<div class="page-card-grid">
|
|
|
|
|
@for (page of pages(); track page.id) {
|
|
|
|
|
<div class="page-card-grid__item">
|
|
|
|
|
<label class="page-card-grid__select">
|
|
|
|
|
<app-toggle [ngModel]="isSelected(page.id)" (ngModelChange)="toggleSelect(page.id, $event)" [ariaLabel]="page.id" size="sm" />
|
|
|
|
|
</label>
|
|
|
|
|
<app-page-card
|
|
|
|
|
[page]="page"
|
|
|
|
|
[legalLabelKey]="legalLabelKey(page)"
|
|
|
|
|
[seoStatus]="seoStatus(page)"
|
|
|
|
|
[hasIssue]="hasAnyIssue(page)"
|
|
|
|
|
[updatedAtLabel]="updatedAtLabel(page)"
|
|
|
|
|
(open)="openEditor(page.id)"
|
|
|
|
|
(duplicate)="duplicatePage(page.id)"
|
|
|
|
|
(preview)="togglePreview(page.id)"
|
|
|
|
|
(remove)="deletePage(page.id)"
|
|
|
|
|
/>
|
2026-07-17 10:11:31 +04:00
|
|
|
@if (previewOpenPageId() === page.id) {
|
|
|
|
|
<app-static-page-preview [html]="previewHtml(page)" [title]="previewTitle(page)" />
|
|
|
|
|
}
|
feat(content-management): adopt Design System primitives in Static Pages editor
Replace raw button/input elements with app-button, app-input, app-card,
app-form-field, app-badge, app-empty-state across the static pages CMS editor.
Checkboxes left native (no checkbox primitive built yet).
Also fix pre-existing bug in ContentPageService.normalizePages: iterating
Object.values(config) lost the record key, so legacy-shaped bootstrap entries
without explicit id/slug fields (e.g. mock bootstrap.json's about-us,
privacy-policy, terms-of-service) crashed normalizeSlug(undefined). Now
falls back to the record key for id/slug/title.
Verified in browser at /edit/static-pages: renders correctly, primitives
styled per tenant CSS vars, no console errors after fix.
2026-07-15 04:01:13 +04:00
|
|
|
</div>
|
2026-07-18 11:02:26 +04:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-17 10:05:50 +04:00
|
|
|
<app-media-picker [open]="mediaPickerOpen" (selected)="onImagePicked($event)" (closed)="mediaPickerOpen = false" />
|
2026-07-10 13:52:01 +04:00
|
|
|
</section>
|