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>
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { ProductCardConfig, CategoryCardConfig } from '../../shared/models/ui';
|
||||
import { BackofficeDataService } from '../../core/backoffice/backoffice-data.service';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class BackofficeFacade {
|
||||
readonly products = signal<ProductCardConfig[]>([]);
|
||||
readonly categories = signal<CategoryCardConfig[]>([]);
|
||||
readonly loading = signal(false);
|
||||
|
||||
constructor(private readonly backofficeDataService: BackofficeDataService) {}
|
||||
|
||||
load(): void {
|
||||
this.loading.set(true);
|
||||
|
||||
this.backofficeDataService.loadProducts().subscribe({
|
||||
next: (products) => {
|
||||
this.products.set(products ?? []);
|
||||
this.loadCategories();
|
||||
},
|
||||
error: () => {
|
||||
this.products.set([]);
|
||||
this.loadCategories();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private loadCategories(): void {
|
||||
this.backofficeDataService.loadCategories().subscribe({
|
||||
next: (categories) => {
|
||||
this.categories.set(categories ?? []);
|
||||
this.loading.set(false);
|
||||
},
|
||||
error: () => {
|
||||
this.categories.set([]);
|
||||
this.loading.set(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import { Injectable, computed, signal } from '@angular/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { BootstrapConfig } from '../../shared/models/config';
|
||||
import { ConfigService } from '../../core/config/config.service';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class BuilderConfigFacade {
|
||||
private readonly bootstrapState = signal<BootstrapConfig | null>(null);
|
||||
|
||||
readonly bootstrap = this.bootstrapState.asReadonly();
|
||||
readonly branding = computed(() => this.bootstrapState()?.branding ?? null);
|
||||
readonly featureFlags = computed(() => this.bootstrapState()?.featureFlags ?? null);
|
||||
|
||||
constructor(private readonly configService: ConfigService) {}
|
||||
|
||||
load(): void {
|
||||
this.configService.loadBootstrap().pipe(take(1)).subscribe({
|
||||
next: (config) => this.bootstrapState.set(JSON.parse(JSON.stringify(config)) as BootstrapConfig),
|
||||
error: () => this.bootstrapState.set(null)
|
||||
});
|
||||
}
|
||||
|
||||
updateBrandName(nextBrandName: string): void {
|
||||
const current = this.bootstrapState();
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.bootstrapState.set({
|
||||
...current,
|
||||
branding: {
|
||||
...current.branding,
|
||||
brandName: nextBrandName
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setFeatureFlag(flag: string, enabled: boolean): void {
|
||||
const current = this.bootstrapState();
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.bootstrapState.set({
|
||||
...current,
|
||||
featureFlags: {
|
||||
...current.featureFlags,
|
||||
[flag]: enabled
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user