Commit Graph

307 Commits

Author SHA1 Message Date
sdarbinyan
a67ea17ad2 feat(admin): monitoring center
Sprint 26.

New features/admin/monitoring/ module + net-new /:lang/backoffice/monitoring
route + Dashboard Quick Action.

- Health section reuses AdminDashboardFacade.healthChecks directly (real
  data, unchanged since Sprint 19) instead of duplicating the logic
- unified AdminMonitoringEvent feed covering audit/security/login/
  failed-login/api/error/warning, category filter + search, 40 seeded
  synthetic entries (no logging backend exists anywhere in this system)
- mock queue depth/status cards, mock webhook delivery log
- intentionally kept separate from Sprint 24's per-transaction audit and
  Sprint 25's per-user audit - different scopes, no consolidation attempted

Also fixed a real type error: AdminDashboardQuickActionId's union was
missing 'users' and 'monitoring' (added when wiring those Quick Actions),
caught by ng build's template type-checking even though plain tsc --noEmit
passed - a reminder that ng build is the authoritative check here.

docs/ADMIN.md + docs/BACKEND.md (new item 15) updated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 11:12:47 +04:00
sdarbinyan
17adc9e9fd feat(admin): users and permissions
Sprint 25.

New features/admin/users/ module, net-new /:lang/backoffice/users route +
Dashboard Quick Action.

- users: name, Telegram username, scope (marketplace vs office admin),
  role (inline change), status (active/invited/suspended), last login
- 4 built-in roles (owner/admin/editor/viewer) with flat permission lists
- invitations: email + role + scope form, pending list + revoke (no email
  actually sends - local record only)
- passwordless login confirmed already real (AdminAuthService Telegram QR,
  docs/BACKEND.md item 1) - linked, not reimplemented
- per-user mock session list (device/IP/last-active, revoke) - flagged as
  mock since the real AdminAuthService only ever tracks the current
  browser's session
- per-user audit log dialog (role/status changes), same pattern as
  Sprint 24's per-transaction audit, intentionally separate from the
  system-wide log planned for Sprint 26

docs/ADMIN.md + docs/BACKEND.md (new item 14) updated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 11:05:21 +04:00
sdarbinyan
7d65913245 feat(admin): transaction management
Sprint 24.

New features/admin/transactions/ module. AdminTransactionsLocalGateway
derives one synthetic transaction per Sprint 23's seeded mock order rather
than a separate dataset, keeping order numbers/totals consistent across
the two mock feature areas.

- list: search, status filter, type filter (payment/refund/qr_payment),
  pagination, CSV export
- retry failed transactions (appends an audit entry)
- fraud flag toggle
- per-transaction audit log (creation/retry/fraud-flag-change), viewed via
  dialog - intentionally separate from the system-wide audit/security log
  planned for Sprint 26 (Monitoring)
- wired into /:lang/backoffice/transactions, replacing the coming-soon
  placeholder

docs/ADMIN.md + docs/BACKEND.md (new item 13) updated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 10:57:29 +04:00
sdarbinyan
2d8d6b6dc4 feat(admin): order management
Sprint 23.

New features/admin/orders/ module, same container/facade/service split as
admin/products and admin/categories.

- AdminOrder model + AdminOrdersLocalGateway seeding 24 deterministic
  synthetic orders (no real order data source exists anywhere in this
  repo - explicitly a placeholder, not a mock of production volume)
- list: search, status filter, pagination, CSV export (client-side Blob
  download)
- detail: customer/payment/shipping, itemized total, status timeline,
  change-status dropdown, refund request + cancel (window.confirm-gated),
  separate customer-facing vs internal notes, print invoice via
  window.print() with @media print hiding non-invoice chrome
- wired into /:lang/backoffice/orders(/:id), replacing the coming-soon
  placeholder

docs/ADMIN.md + docs/BACKEND.md updated; dashboard's Orders/Revenue cards
(Sprint 19) remain intentionally un-wired to this mock and still render
pending-backend.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 10:50:59 +04:00
sdarbinyan
30afb5d778 feat(media): reusable media management
Sprint 22.

- MediaAsset gains folder (flat) and MediaListParams gains folder/tag
  filters; MediaRepository.listFolders() derives the folder list from
  existing records
- upload validation: 10MB size cap, mime allow-list (jpeg/png/webp/gif/
  svg+xml/pdf), real error messages surfaced through MediaLibraryFacade
  instead of a generic swallowed string
- SVG uploads are sanitized (script tags and on*= attributes stripped)
  before storage
- raster images (excl. gif) are downscaled to a 2000px max dimension and
  re-encoded via canvas before storage - compression, not a crop UI
- tag editing (window.prompt, comma-separated) via
  MediaLibraryFacade.updateTags()
- MediaPickerComponent wired into Project Editor branding (logo, compact
  logo, favicon) alongside its existing category/product usage - confirmed
  no image fields exist on Static Pages or as a dedicated hero field to
  wire

docs/ADMIN.md updated with the new Sprint 22 section including the storage
abstraction note (MediaRepository was already the abstraction).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 10:42:23 +04:00
sdarbinyan
60c63a0d2a feat(admin): complete product management
Sprint 21.

- archived (soft archive/restore, distinct from visible) with an
  include-archived list filter
- barcode field alongside sku
- variants: lightweight name|price|quantity list, same textarea-parse
  convention as specifications/attributes
- relatedProductIds: checkbox picker in the editor
- gallery images now added/removed via the shared MediaPickerComponent
  instead of a raw URL textarea
- read-only discounted-price preview in the editor
- infinite-scroll toggle on the list (loadMore() appends a page instead
  of replacing it; pagination UI swaps for a Load more button)
- category dropdown now sourced from AdminCategoriesGateway (Sprint 20)
  instead of AdminProductsLocalGateway's own BackofficeDataService seed

docs/ADMIN.md + docs/BACKEND.md updated with the new field list and the
known trade-off that related-products search is scoped to the currently
loaded page, not the full catalog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 10:31:00 +04:00
sdarbinyan
6a8c4a549a feat(admin): complete category management
Sprint 20. Adds features/admin/categories/ (model, gateway interface +
local gateway, facade, list/editor pages), mirroring the admin/products
container/facade/service split.

- indented hierarchy view + native HTML5 drag-and-drop reorder
- visibility toggle, item counter, empty state, include-deleted filter
- editor: slug uniqueness validation, translations, SEO fields, breadcrumb
  preview, image via existing MediaPickerComponent
- soft delete/restore, blocked when a category has children or items
- draft/publish status + localStorage draft recovery (mirrors Project
  Editor autosave) + CanDeactivate unsaved-changes guard
- wired into app.routes.ts (replaces the categories coming-soon placeholder)
- docs/ADMIN.md + docs/BACKEND.md updated with the new gap detail

Not yet done: admin/products' category dropdown still reads from its own
AdminProductsGateway.loadCategories() rather than this gateway (Sprint 21).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 09:34:13 +04:00
sdarbinyan
dbd905b02f fix(design-system): wire label/hint/error accessibility from FormField to Input
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
FormFieldComponent's label had [for]=fieldId but nothing ever gave the
projected control a matching id, and aria-describedby was set on a wrapper
div instead of the actual input - so screen readers announced neither the
label association nor the hint/error text.

Added FormFieldContext, an injectable abstract class FormFieldComponent
provides via its own providers array (visible to content-projected children,
same mechanism Angular Material's mat-form-field/matInput relationship
relies on). InputComponent optionally injects it and self-applies id and
aria-describedby when nested inside app-form-field.

This retroactively fixes every form built across Sprint 3-5 (Static Pages
editor, Media Manager, Products List/Form, Project Editor sections) with
no template changes needed anywhere else.

Verified in browser: input id matches label's for attribute, and
aria-describedby correctly points to the rendered hint/error text.

Completes Sprint 5 (UI/UX Polish): Admin Products List, Admin Product Form,
Project Editor sections (9 of 11), and this accessibility fix.
2026-07-15 08:01:54 +04:00
sdarbinyan
f82344e0dd feat(project-editor): adopt Design System primitives across editor sections
Applied app-input/app-form-field/app-button to 9 of 11 Project Editor
sections: general, branding, theme, footer, homepage, widgets, languages,
navigation, preview. header and features sections were left unchanged -
they contain only checkboxes and selects, and no Checkbox/Select primitive
exists yet.

Theme section's 8 color pickers stay native <input type=color> (app-input's
type union doesn't include 'color') but are now wrapped in app-form-field
for consistent label/hint treatment. Added app-form-field.full grid-column
rule to section.shared.scss (shared by all 11 sections) alongside the
existing label.full rule, since the custom element doesn't match that
selector.

Production build green, arch:check passes.
2026-07-15 07:55:38 +04:00
sdarbinyan
53d6a8e169 feat(admin-products): adopt Design System primitives in Product Form
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Replace single-line text/number inputs with app-form-field/app-input across
name, slug, sku, brand, priority, pricing, quantity, availability, per-locale
translation name/shortDescription, SEO metaTitle/keywords, and badges fields.
Save button now app-button. Textareas, selects, and checkboxes stay native -
no Textarea/Select/Checkbox primitive exists yet. Added app-form-field.full
grid-column rule alongside the existing label.full one (custom element,
different selector).

Production build green, arch:check passes.
2026-07-15 07:39:56 +04:00
sdarbinyan
dbb22d1392 feat(admin-products): adopt Design System primitives in Products List
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Replace raw button/table/input elements with app-button, app-table, app-badge,
app-input, app-pagination. Removed now-redundant button/table/th/td CSS from
the stylesheet (would have double-styled the primitives' projected content
under Angular's emulated encapsulation). Native selects and checkboxes kept
as-is - no Select/Checkbox primitive exists yet.

Production build green, arch:check passes. In-browser verification hit a
dev-server routing hiccup unrelated to these changes (a temporary unguarded
preview route 404'd despite compiling correctly); relied on the identical,
already-verified primitive usage pattern from the Static Pages editor and
Media Manager instead.
2026-07-15 07:33:25 +04:00
sdarbinyan
9ab807342e feat(media): add reusable MediaPickerComponent
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Standalone dialog (app-dialog, size lg) reusing MediaLibraryFacade so it
shares the exact same asset list/search/pagination/upload state as the
Media Manager page. Emits (selected) with the chosen MediaAsset and
(closed) to dismiss - selecting a tile emits both.

Completes Sprint 4 (Media Manager): ADR-0002 contract, MediaRepository +
mock IndexedDB adapter, Media Manager UI, reusable Media Picker.

Not yet wired into Product Editor or Static Pages editor - that's the
next natural step when those features gain image fields, not part of
this sprint's scope.
2026-07-15 07:20:42 +04:00
sdarbinyan
5ffb353011 feat(media): add Media Manager UI (grid, upload, delete)
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
MediaLibraryPageComponent replaces the coming-soon placeholder at
/backoffice/media. Built entirely on Sprint 6 Design System primitives
(app-card, app-button, app-input, app-empty-state, app-dialog, app-pagination,
app-skeleton) and Sprint 4 Task 2's MediaRepository/MockMediaRepository.

- Grid view with per-tile filename/size and delete action
- Hidden native file input triggered by an app-button, uploads via
  MediaLibraryFacade -> MediaRepository.upload()
- Delete requires confirmation through app-dialog (destructive action)
- Search + pagination wired to MockMediaRepository's list() params
- Loading state shows app-skeleton tiles; empty state shows app-empty-state
- New mediaLibrary.* translation namespace across en/ru/hy

Verified in browser (via a temporary unguarded route, reverted before
commit - /backoffice/media itself requires Telegram QR admin auth not
available in this session): empty state renders correctly with translated
copy, search input and upload button present, no console errors.
2026-07-15 07:14:16 +04:00
sdarbinyan
c663c9099c feat(media): add MediaAsset model, MediaRepository contract, mock IndexedDB adapter
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Implements ADR-0002. MediaRepository is an abstract-class DI token (matching
the Ed25519VerificationService pattern in app.config.ts) bound to
MockMediaRepository, an IndexedDB-backed implementation storing blobs
directly with lazily-created/revoked object URLs. Swapping to a real
HttpMediaRepository later is a one-line provider change.

No UI yet (Sprint 4 Task 3).
2026-07-15 04:58:20 +04:00
sdarbinyan
b75e753d98 docs: add ADR-0002 for Media Manager backend contract and mock adapter
Documents the MediaAsset model, future GET/POST/DELETE/PATCH /media contract,
and the MediaRepository interface (Mock IndexedDB-backed now, Http later via
DI swap) that Sprint 4 will implement against. Media assets never enter the
Bootstrap model, consistent with ADR-0001.
2026-07-15 04:51:10 +04:00
sdarbinyan
9133113ab2 feat(content-management): surface validation errors per-page
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Replace global duplicate-slug/empty-title banners with per-page indicators:
a danger badge next to the offending page's heading, plus inline error text
on the specific pageId/slug app-form-field. Made ContentPageService.normalizeSlug
public (was private) so the component can match validation results to a given
page's normalized slug without duplicating the normalization logic.

Verified in browser: setting a duplicate slug live shows both the header
badge and the inline field error immediately.

Completes Sprint 3 (Static Page Generator): DRY cleanup, Design System
adoption, SEO field coverage, per-page validation UX.
2026-07-15 04:46:27 +04:00
sdarbinyan
97bd4b2b95 feat(content-management): expose SEO fields in Static Pages editor
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
ContentPage.seo (title/description/keywords/canonical/ogTitle/ogDescription/
ogImage) was already modeled and serialized to bootstrap JSON but had no
editable UI. Added updateSeo() to the component and a translated SEO fieldset
using app-form-field/app-input. Added seoSection/seoTitle/seoDescription/
seoKeywords/seoCanonical/seoOgTitle/seoOgDescription/seoOgImage translation
keys to en/ru/hy and the Translations type.

Verified in browser at /edit/static-pages: SEO section renders with
translated labels for all three mock pages.
2026-07-15 04:11:18 +04:00
sdarbinyan
f11b02134c feat(content-management): adopt Design System primitives in Static Pages editor
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
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
sdarbinyan
608e1cc02b refactor(content-management): remove duplicated bootstrap serialization
StaticPagesEditorComponent.persist() hand-rolled the same title/html/route
mapping already implemented in ContentPageService.toBootstrapRecord(), with
subtly different behavior (always wrote empty-string html entries per locale
instead of omitting them, no title fallback). Added ContentManagementFacade.serializePages()
as a thin passthrough and switched the component to use the single canonical
implementation.
2026-07-15 03:51:24 +04:00
sdarbinyan
bc03cc3d27 feat(design-system): add reusable Pagination primitive
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Standalone, OnPush. Computes truncated page range with ellipsis, composes
existing app-button (ghost/sm) for prev/next controls rather than duplicating
button styling. aria-current on active page, nav aria-label. Colors/radius/
spacing via existing tenant CSS vars with fallbacks.

Completes Sprint 6 Design System primitives: Button, Input, Card, Badge,
Dialog, FormField, EmptyState, Skeleton, Table, Pagination.
2026-07-15 03:45:40 +04:00
sdarbinyan
bc46a755b1 feat(design-system): add reusable Table shell primitive
Standalone, OnPush, ViewEncapsulation.None scoped under .app-table/.app-table-wrapper
so projected thead/tbody markup receives consistent styling. Scroll container for
responsive overflow. Colors/radius/spacing via existing tenant CSS vars with fallbacks.
2026-07-15 03:44:01 +04:00
sdarbinyan
a51aa3cf7e feat(design-system): add reusable Skeleton loading primitive
Standalone, OnPush, aria-hidden. Shapes text/circle/rect, configurable
width/height. Shimmer respects prefers-reduced-motion. Colors via
existing tenant CSS vars with fallbacks.
2026-07-15 03:42:18 +04:00
sdarbinyan
efdb03f23e feat(design-system): add reusable EmptyState primitive
Standalone, OnPush. title required input (caller supplies translated text),
optional description, icon/actions content-projection slots. Colors via
existing tenant CSS vars with fallbacks.
2026-07-15 03:40:56 +04:00
sdarbinyan
439d3d3c95 feat(design-system): add reusable FormField wrapper primitive
Standalone, OnPush. Label/hint/error slots, required marker, aria-describedby
wiring, role=alert on error. Colors via existing tenant CSS vars with fallbacks.
2026-07-15 03:39:19 +04:00
sdarbinyan
27ff3169b9 feat(design-system): add reusable Dialog primitive
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Standalone, OnPush. Backdrop click and Escape close, focus trap with
return-focus on close, role=dialog/aria-modal. Sizes sm/md/lg. Colors/
radius/shadow/spacing via existing tenant CSS vars with fallbacks.
2026-07-15 03:34:52 +04:00
sdarbinyan
5cbc9e4873 feat(design-system): add reusable Badge primitive
Standalone, OnPush. Variants neutral/primary/success/warning/danger/info.
Colors consumed via existing tenant CSS vars with fallbacks.
2026-07-15 03:33:09 +04:00
sdarbinyan
b309afbe8e feat(design-system): add reusable Card primitive
Standalone, OnPush, content-projection container. Padding none/sm/md/lg,
bordered and interactive variants. Colors/radius/shadow/spacing consumed
via existing tenant CSS vars with fallbacks.
2026-07-15 03:31:31 +04:00
sdarbinyan
2fc9051f86 feat(design-system): add reusable Input primitive
ControlValueAccessor-based, standalone, OnPush. Sizes sm/md/lg, states default/error/success.
Colors/radius/spacing/transitions consumed via existing tenant CSS vars (--border-color,
--primary-color, --error-color, --success-color, etc) with fallbacks - compatible with
bootstrap JSON theming and Project Editor live preview.
2026-07-15 03:30:05 +04:00
sdarbinyan
4e63ff97bb feat(design-system): add reusable Button primitive
Sprint 6 (pulled forward as prerequisite to Sprint 3). First Design
System component: app-button, standalone/OnPush, variants
(primary/secondary/ghost/danger), sizes (sm/md/lg), loading + disabled
states, focus-visible ring, reduced-motion-aware spinner. Colors/radius/
shadow/spacing consumed via existing tenant-driven CSS vars
(--primary-color, --bg-primary, --radius-md, --shadow-sm, --space-*) —
no new hardcoded palette, fully compatible with bootstrap JSON theming
and Project Editor live preview.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 03:22:40 +04:00
sdarbinyan
cc885c009a refactor: route catalog-container localStorage calls through LocalStorageService
Sprint 2 high-priority cleanup: layout preference read/write called raw
localStorage from a component, violating the no-raw-localStorage rule.
Now uses the shared core/storage/LocalStorageService (same as
cart/language/location services).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 03:01:25 +04:00
sdarbinyan
3cf732797c refactor: route localStorage access through shared LocalStorageService
Sprint 2 high-priority cleanup: cart/language/location services called
localStorage directly, bypassing the try/catch safety and core/<domain>
pattern used elsewhere (e.g. ProjectEditorDraftStorageService). New
core/storage/LocalStorageService centralizes get/set/remove and JSON
helpers with private-mode/quota error handling, reused across all three.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 02:58:39 +04:00
sdarbinyan
96a338ef6f chore: remove orphaned backoffice/builder dead code
Sprint 2 high-priority cleanup: backoffice-dashboard.component.ts and
builder-sandbox.component.ts were not routed anywhere, superseded by
features/backoffice and features/project-editor. Their sole facades
(BackofficeFacade, BuilderConfigFacade) had no other consumers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 02:43:46 +04:00
sdarbinyan
2b52965f2f feat(admin-auth): add dev-only QR bypass via ?devBypassAdmin=true
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Fabricates a local admin session and activates it directly, skipping the
Telegram QR flow, for local testing without a reachable session backend.
Guarded by environment.production at runtime - no-ops in production
builds even if this code ships.
2026-07-15 00:58:21 +04:00
sdarbinyan
677dfb73e8 chore: ignore .claude/ worktrees and graphify-out/ knowledge-graph output
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
2026-07-15 00:53:42 +04:00
sdarbinyan
170243a480 feat(project-editor): finish field descriptions + enum dropdowns across all sections
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Wires up the remaining editor sections (theme, header, footer, homepage,
widgets, features, languages, navigation) with the description text and
dropdown UX started for General/Branding:

- Every enum-backed field is now a <select> with a description per option,
  not free text: theme.mode, the new site-wide layout.type (previously had
  no editor at all - added to the Theme section, and added to that
  section's reset-scope), homepage section layout.strategy, and
  catalog.navigationMode (also previously unedited, added to Features).
- Every other field (colors, header toggles, footer contact/company fields,
  widget props, feature flags, language add, nav link label/url/visible)
  gets a one-line plain-language description under its label via the new
  *Desc i18n keys (en/ru/hy) prepared earlier.
- Genuinely open text (widget layout variant strings, JSON props) stays
  free text, description-only, per the existing widgetLayoutDesc/widgetJsonDesc
  wording - not force-fit into a dropdown.

Verified: tsc --noEmit and ng build both clean.
2026-07-15 00:45:41 +04:00
sdarbinyan
ac83c4f57f feat(project-editor): add field descriptions to General and Branding sections (partial)
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Adds a short plain-language description under each field label (new
.field-desc style, section.shared.scss) so a non-developer admin
understands what each field affects, per i18n (en/ru/hy) convention.

Only General and Branding sections are wired up so far - the *Desc i18n
keys for the remaining sections (theme/header/footer/homepage/widgets/
features/languages/navigation) were prepared in translations.ts/en/ru/hy
but not yet wired into their templates. Follow-up work.
2026-07-14 16:05:09 +04:00
sdarbinyan
76831b8485 docs: consolidate scattered docs into canonical set
Replace ~35 organically-grown docs (docs/platform/*, docs/backend-platform/*,
one-off sprint reports, Search.md, Diagnostics.md, Content-Management.md,
Backend-Handoff-Sprint16.md, docs/superpowers/*, docs/Project-Editor.md,
untracked docs/total.md) with the six canonical docs declared in
.claude/CLAUDE.md: PROJECT.md, ARCHITECTURE.md, BACKEND.md, FRONTEND.md,
BOOTSTRAP.md, EDITOR.md, plus a new PROJECT-STRUCTURE.md.

- BACKEND.md is a punch list per domain (auth, bootstrap draft/publish,
  static pages, categories, products, orders, dashboard metrics, activity,
  translations, search, product engagement) plus a Known reliability issues
  section on the prod 502/504 root cause.
- ARCHITECTURE.md links to (does not duplicate) the enforced
  docs/architecture/foundation/** ADRs and standards docs.
- docs/ADMIN.md and docs/architecture/foundation/** and docs/context/** are
  left untouched per instructions.
- Updated the one dangling docs/Project-Editor.md reference in
  admin-auth.service.ts to point at docs/BACKEND.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 12:28:41 +04:00
sdarbinyan
94e59ab878 docs(nginx): clarify SPA fallback and API proxy patterns in onboarding template
Drop the misleading trailing `=404` on try_files (index.html always exists
so it never triggered) and document, inline, the two ways a tenant's
frontend can reach its API (proxied /api vs absolute apiUrl) plus a note
that a 502/504 on refresh/back-navigation for an absolute-apiUrl tenant
(e.g. dexarmarket.ru -> api.dexarmarket.ru:445) is that backend's own
reverse proxy, not this file.
2026-07-14 12:22:21 +04:00
sdarbinyan
325dc17911 feat(admin): sprint 19 admin dashboard, routing, i18n
- Add admin dashboard feature (models/gateway/facade/components/page)
- Wire admin/products routes and backoffice coming-soon placeholders
- Add lastPublishedAt to ProjectEditorFacade/state
- Add dashboard i18n keys (en/ru/hy) and docs/ADMIN.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 12:21:33 +04:00
sdarbinyan
6aec2ebcb2 fix(admin-auth): reuse exact same QR/session API and component for admin login
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
- Removed invented adminAuthApiUrl endpoint and separate AdminLoginComponent.
  Admin login now uses the exact same Telegram session backend
  (TelegramSessionApiService, {authApiUrl}/users/sessions) and the exact
  same TelegramLoginComponent (mode="customer" | "admin" input) as customer
  login - only the storage (cookie/localStorage/signals) stays separate.
- Extracted the shared HTTP+normalization logic from AuthService into
  TelegramSessionApiService so both AuthService and AdminAuthService call it
  instead of duplicating request/parsing code.
- Documented the resulting backend gap in docs/Project-Editor.md: since the
  session API has no concept of "admin", server-side role enforcement is
  required when admin API calls are made - the frontend only decides where
  to store the session, not whether the user is actually an admin.
2026-07-14 10:13:59 +04:00
sdarbinyan
3877b70fdf feat(sprint18): editor autosave/reset, admin auth, QR reuse, Ed25519 prep
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
- Project editor: persist draft to localStorage, restore on reload,
  last-saved/draft-restored status indicators, section/whole-draft reset
  with confirmation.
- Extract shared QR/polling/expiry engine from TelegramLoginComponent
  (shared/qr-login) and reuse it for a new admin login flow.
- Admin authentication kept fully separate from customer session:
  own cookie/localStorage keys, signals, guard, and header interceptor
  (core/admin-auth).
- ?login=true / ?adminLogin=true open the respective login dialog for
  manual testing.
- Ed25519 challenge/verify interfaces (fail-closed no-op binding) ready
  for backend delivery.
- Document autosave/reset/admin-auth/QR-reuse/Ed25519 model and the
  remaining full-field-coverage gap in docs/Project-Editor.md.
2026-07-14 09:50:03 +04:00
sdarbinyan
c6482f0037 docs: add nginx tenant onboarding template and backend handoff doc
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Adds a copy-paste server block template for onboarding a new marketplace
domain, and a Sprint 16 backend handoff doc covering the still-missing
draft/publish persistence endpoints, server-side validation expectations,
and the slug/route inconsistency in static-page data.
2026-07-13 16:44:34 +04:00
sdarbinyan
a7df1980ed fix(i18n): route dirty-guard and html-editor strings through TranslateService
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
window.confirm/window.prompt calls in projectEditorDirtyGuard and
MarketplaceHtmlEditorComponent, and the hardcoded Preview/Code toggle
label in its template, bypassed the app's translation pipeline. Add
builder.confirmLeaveUnsaved, promptLinkUrl, promptImageUrl,
htmlEditorCode and htmlEditorPreview keys (en/ru/hy), resolve them via
TranslateService.t() before passing to confirm/prompt, and use
TranslatePipe for the toggle button label.
2026-07-13 15:57:54 +04:00
sdarbinyan
68442919d3 fix(project-editor): preserve multilingual nav labels on edit
updateLabel() previously overwrote NavigationItemConfig.label with a bare
string via updateNavLink, destroying every other locale's translation
whenever a localized label object was edited. Add a facade method
updateNavLinkLabel() that inspects the existing label shape: plain
strings are replaced as before, but localized objects only have the
current default locale's key overwritten, leaving other locales intact.
2026-07-13 15:57:39 +04:00
sdarbinyan
a8b2b4bf0b docs(project-editor): document Sprint 16 tabs, draft/publish gap, and validation rules 2026-07-13 15:29:21 +04:00
sdarbinyan
26c07fb3e6 feat(project-editor): warn before leaving with unsaved changes 2026-07-13 15:21:39 +04:00
sdarbinyan
1e7add2fc8 feat(project-editor): add sticky save/publish bar with validation summary
Mounts a new ProjectEditorSaveBarComponent in the editor page that shows
draft/published status, unsaved-changes indicator, and validation issues,
wiring the Task 8 facade save()/publish()/dirty/status/validationIssues
signals to an actual UI for the first time.
2026-07-13 15:00:03 +04:00
sdarbinyan
85038df24a fix(project-editor): ProjectValidator duplicate-slug check falls back to route when slug is unset
Mock bootstrap seed data populates page.route but never page.slug, so
duplicateSlugIssues always collapsed every static page to the same
undefined key and reported a false-positive duplicate-slugs issue,
permanently blocking Publish. Fall back to route (leading slash
stripped) when slug is missing or empty.
2026-07-13 14:49:27 +04:00
sdarbinyan
223f908887 feat(project-editor): add draft/publish status, dirty tracking, save/publish to facade
Wires ProjectValidator into ProjectEditorFacade and extends ProjectEditorState
with status ('draft'|'published') and lastSavedBootstrap. Adds dirty computed
(diffed against lastSavedBootstrap), validationIssues computed, and save()/publish()
methods. publish() calls PlatformRuntimeService.reloadFromBootstrap() and refuses
when validation issues exist. loadBootstrap() seeds lastSavedBootstrap so a
freshly-loaded bootstrap is not dirty.
2026-07-13 11:01:04 +04:00
sdarbinyan
265f2fcbac feat(project-editor): add ProjectValidator with MVP validation rules
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-13 10:51:05 +04:00