cleanup: remove tenant variant logic and enforce config-driven UI
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { ConfigService } from '../../core/config/config.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
interface UiRuntimeState {
|
||||
marketplaceName: string;
|
||||
@@ -9,18 +8,16 @@ interface UiRuntimeState {
|
||||
logoUrl: string;
|
||||
contactEmail: string;
|
||||
themeId: string;
|
||||
marketplaceVariant: string;
|
||||
}
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class UiRuntimeFacade {
|
||||
private readonly state = signal<UiRuntimeState>({
|
||||
marketplaceName: environment.brandName,
|
||||
marketplaceDisplayName: environment.brandFullName,
|
||||
logoUrl: environment.logo,
|
||||
contactEmail: environment.contactEmail,
|
||||
themeId: environment.theme,
|
||||
marketplaceVariant: this.resolveMarketplaceVariant(environment.theme)
|
||||
marketplaceName: '',
|
||||
marketplaceDisplayName: '',
|
||||
logoUrl: '',
|
||||
contactEmail: '',
|
||||
themeId: ''
|
||||
});
|
||||
|
||||
constructor(private readonly configService: ConfigService) {
|
||||
@@ -30,9 +27,8 @@ export class UiRuntimeFacade {
|
||||
marketplaceName: bootstrap.branding.brandName,
|
||||
marketplaceDisplayName: bootstrap.branding.brandName,
|
||||
logoUrl: bootstrap.branding.logoUrl,
|
||||
contactEmail: bootstrap.branding.supportEmail ?? environment.contactEmail,
|
||||
themeId: bootstrap.theme.themeId,
|
||||
marketplaceVariant: this.resolveMarketplaceVariant(bootstrap.theme.themeId)
|
||||
contactEmail: bootstrap.branding.supportEmail ?? '',
|
||||
themeId: bootstrap.theme.themeId
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -57,17 +53,4 @@ export class UiRuntimeFacade {
|
||||
themeId(): string {
|
||||
return this.state().themeId;
|
||||
}
|
||||
|
||||
marketplaceVariant(): string {
|
||||
return this.state().marketplaceVariant;
|
||||
}
|
||||
|
||||
isMarketplaceVariant(variant: string): boolean {
|
||||
return this.marketplaceVariant() === variant;
|
||||
}
|
||||
|
||||
private resolveMarketplaceVariant(themeId: string): string {
|
||||
void themeId;
|
||||
return 'default';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user