chore: remove confirmed dead code
Dead code sweep verified manually against app.routes.ts, DI registries, and
cross-repo grep for every candidate (per prior false-positive incident with
knip on pages/**). Deleted only what has zero reachable reference:
Auth (unregistered, comment-only mention):
- core/auth/guards/ed25519-auth.guard.ts - ed25519AuthGuard never imported;
only mentioned inside a doc-comment in admin-login-page.component.ts.
- core/auth/guards/permission.guard.ts - permissionGuard never imported.
- core/auth/interceptors/auth.interceptor.ts - authInterceptor not present
in app.config.ts's withInterceptors([...]) list; not imported elsewhere.
Search feature:
- features/search/services/search-analytics.service.ts - SearchAnalyticsService
never imported outside its own file.
- features/search/components/empty-results/* - app-search-empty-results
selector never used in any template; search-bar.component.html implements
its own inline @if (noResults) empty state instead.
Content management:
- features/content-management/pages/content-management-page.component.ts -
thin wrapper around StaticPagesEditorComponent with zero route pointing at
it in app.routes.ts. The rest of features/content-management/* (facade,
static-pages-editor, page-editor, etc.) remains: it is used by
project-editor and stays.
Backoffice CRUD scaffolding (re-verified the UI-COMPOSITION-REVIEW.md claim
independently): app.routes.ts backoffice section only loads
features/admin/{dashboard,products,categories,transactions,orders,customers,
moderation,users,monitoring,analytics} and features/backoffice/media. Grepped
every other backoffice/* folder for cross-references - none found.
- features/backoffice/{categories,customers,inventory,orders,products,settings}
- each contained only a placeholder .gitkeep from the original scaffold
commit (b957112); no real components were ever added, so this is not the
"duplicate implementation" the prior doc described, just unused scaffold
dirs. Removing corrects that doc's premise.
- features/backoffice/shared/backoffice-coming-soon-page.component.* - only
consumer would have been those scaffold dirs; unreferenced elsewhere.
- assets/mock/backoffice/{customers,orders}/list.json - mock data with no
corresponding fetch call; BackofficeDataProvider only exposes
loadProducts()/loadCategories(), backed by the products/categories mock
files, which are kept.
Dead shared barrels/models (no importer anywhere in src/app):
- shared/index.ts, shared/models/index.ts, shared/types/index.ts - unused
re-export barrels.
- shared/models/domain/index.ts + user-preferences.model.ts (whole domain/
subfolder) - UserPreferences interface has zero consumers.
Storefront pages (pages/public/platform-home.component.ts) - PlatformHomeComponent
has no route in app.routes.ts and is not imported anywhere; distinct from the
pages/category, pages/search, pages/info/**, pages/legal/**, pages/item-detail
components which ARE routed and were correctly left untouched.
Verification: npx tsc --noEmit -p tsconfig.app.json clean after each batch;
npm run build succeeded (pre-existing initial-bundle-budget warning only,
unrelated to this change).
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
<div class="coming-soon">
|
||||
<h1 class="coming-soon__title">{{ titleKey | translate }}</h1>
|
||||
<p class="coming-soon__description">{{ 'dashboard.comingSoonDescription' | translate }}</p>
|
||||
<a class="coming-soon__link" [routerLink]="['../dashboard']">{{ 'dashboard.backToDashboard' | translate }}</a>
|
||||
</div>
|
||||
@@ -1,32 +0,0 @@
|
||||
.coming-soon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
max-width: 640px;
|
||||
margin: 40px auto;
|
||||
padding: 24px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.coming-soon__title {
|
||||
margin: 0;
|
||||
font-size: var(--font-size-3xl, 1.5rem);
|
||||
font-weight: 800;
|
||||
color: var(--text-primary, #1e3c38);
|
||||
}
|
||||
|
||||
.coming-soon__description {
|
||||
margin: 0;
|
||||
color: var(--text-secondary, #667a77);
|
||||
}
|
||||
|
||||
.coming-soon__link {
|
||||
color: var(--primary-color, #497671);
|
||||
font-weight: var(--font-weight-semibold, 600);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.coming-soon__link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { TranslatePipe } from '../../../i18n/translate.pipe';
|
||||
|
||||
/** Landing page for backoffice sections not built yet (categories, static pages, transactions, orders, media). Route `data.titleKey` sets the section name; falls back to the generic "coming soon" title. */
|
||||
@Component({
|
||||
selector: 'app-backoffice-coming-soon-page',
|
||||
standalone: true,
|
||||
imports: [CommonModule, RouterLink, TranslatePipe],
|
||||
templateUrl: './backoffice-coming-soon-page.component.html',
|
||||
styleUrls: ['./backoffice-coming-soon-page.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class BackofficeComingSoonPageComponent {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
|
||||
readonly titleKey: string = this.route.snapshot.data['titleKey'] ?? 'dashboard.comingSoonTitle';
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { StaticPagesEditorComponent } from '../components/static-pages-editor.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-content-management-page',
|
||||
standalone: true,
|
||||
imports: [StaticPagesEditorComponent],
|
||||
template: `<app-static-pages-editor />`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ContentManagementPageComponent {}
|
||||
@@ -1,44 +0,0 @@
|
||||
<section class="search-empty-results card" [attr.aria-label]="'search.emptyResultsAria' | translate">
|
||||
<h3>{{ 'search.noResults' | translate }}</h3>
|
||||
|
||||
<button type="button" class="reset-btn" (click)="resetFilters.emit()">{{ 'catalog.clearFilters' | translate }}</button>
|
||||
|
||||
@if (popularCategories.length > 0) {
|
||||
<div class="block">
|
||||
<strong>{{ 'search.popularCategories' | translate }}</strong>
|
||||
<div class="chip-list">
|
||||
@for (category of popularCategories; track category.id) {
|
||||
<button type="button" class="chip" (click)="popularCategorySelected.emit(category.id)">{{ category.label }}</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (popularSearches.length > 0) {
|
||||
<div class="block">
|
||||
<strong>{{ 'catalog.popularSearchesTitle' | translate }}</strong>
|
||||
<div class="chip-list">
|
||||
@for (item of popularSearches; track $index) {
|
||||
<button type="button" class="chip" (click)="popularSearchSelected.emit(item)">{{ item }}</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (recommendedProducts.length > 0) {
|
||||
<div class="block">
|
||||
<strong>{{ 'search.recommendedProducts' | translate }}</strong>
|
||||
<div class="product-grid">
|
||||
@for (product of recommendedProducts; track product.itemID) {
|
||||
<app-product-card
|
||||
[item]="product"
|
||||
[title]="product.name"
|
||||
appearance="compact"
|
||||
[addToCartLabel]="'catalog.addToCart' | translate"
|
||||
(selected)="productSelected.emit(product)"
|
||||
(addToCart)="productAddToCart.emit({ product, event: $event.event })" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
@@ -1,48 +0,0 @@
|
||||
.search-empty-results {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
justify-self: start;
|
||||
min-height: 40px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
padding: 0 14px;
|
||||
cursor: pointer;
|
||||
font-weight: var(--font-weight-bold, 700);
|
||||
}
|
||||
|
||||
.block {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.chip-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.chip {
|
||||
min-height: 36px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-full, 999px);
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-secondary);
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Product } from '../../../../core/products/models/product-domain.model';
|
||||
import { ProductCardComponent } from '../../../../components/product-card/product-card.component';
|
||||
import { TranslatePipe } from '../../../../i18n/translate.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-search-empty-results',
|
||||
standalone: true,
|
||||
imports: [ProductCardComponent, TranslatePipe],
|
||||
templateUrl: './search-empty-results.component.html',
|
||||
styleUrls: ['./search-empty-results.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class SearchEmptyResultsComponent {
|
||||
@Input() popularCategories: Array<{ id: string | number; label: string }> = [];
|
||||
@Input() popularSearches: string[] = [];
|
||||
@Input() recommendedProducts: Product[] = [];
|
||||
|
||||
@Output() resetFilters = new EventEmitter<void>();
|
||||
@Output() popularCategorySelected = new EventEmitter<string | number>();
|
||||
@Output() popularSearchSelected = new EventEmitter<string>();
|
||||
@Output() productSelected = new EventEmitter<Product>();
|
||||
@Output() productAddToCart = new EventEmitter<{ product: Product; event: Event }>();
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SearchAnalyticsEvent } from '../models/search.model';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class SearchAnalyticsService {
|
||||
buildEvent(input: {
|
||||
query: string;
|
||||
tenant: string;
|
||||
language: string;
|
||||
resultCount: number;
|
||||
timestamp?: string;
|
||||
}): SearchAnalyticsEvent {
|
||||
return {
|
||||
query: input.query,
|
||||
tenant: input.tenant,
|
||||
language: input.language,
|
||||
timestamp: input.timestamp ?? new Date().toISOString(),
|
||||
resultCount: input.resultCount,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user