This commit significantly expands the application's routing, navigation, and administrative capabilities. It introduces several new functional modules and refines the core layout for a more professional, dashboard-oriented experience. - **Routing & Navigation**: - Added routes for `wallboard`, `call-center`, `call-center/calls`, and `chat-questions`. - Updated `SidebarComponent` to include all new navigation items. - Enhanced `LayoutComponent` with dynamic navigation based on user roles (admin vs. user). - **New Administrative Pages**: - `WallboardPage`: Implements a real-time KPI dashboard with call activity trends and outcome distributions. - `CallCenterPage`: Provides a symbolic interface for managing call center connectivity and synchronization. - `CallCenterCallsPage`: Implements a call history retrieval interface with filtering capabilities. - `ChatQuestionsPage`: Adds a module for reviewing user questions from web and mobile channels. - **Core Infrastructure & Refinement**: - Updated `AppConfig` to include an `APP_INITIALIZER` for validating user identity via `AuthService` on startup. - Refined `HomeComponent` layout to a "Claude-style" continuous chat column. - Implemented global themed scrollbars and integrated the 'Lahze' font family. - Added `proxy.conf.json` and updated `angular.json` to support local backend development. - **Documentation**: - Added comprehensive API handoff guides for frontend-backend connection and MVP API catalog.
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZonelessChangeDetection, APP_INITIALIZER } from '@angular/core';
|
|
import { provideRouter } from '@angular/router';
|
|
import { provideAnimations } from '@angular/platform-browser/animations';
|
|
import { provideHttpClient } from '@angular/common/http';
|
|
import { TOAST_CONFIG, DefaultGlobalConfig } from 'ngx-toastr';
|
|
|
|
import { routes } from './app.routes';
|
|
import { AuthService } from './services/auth/auth.service';
|
|
|
|
/**
|
|
* On every page load the HttpOnly `rag_session` cookie is validated with `GET /me`
|
|
* before the first route activates; a 401 drops the authenticated state so the
|
|
* guard sends the user to the login page.
|
|
*/
|
|
function initializeAuth(auth: AuthService): () => Promise<boolean> {
|
|
return () => auth.ensureIdentity().catch(() => false);
|
|
}
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideBrowserGlobalErrorListeners(),
|
|
provideZonelessChangeDetection(),
|
|
provideRouter(routes),
|
|
provideAnimations(),
|
|
provideHttpClient(),
|
|
{
|
|
provide: APP_INITIALIZER,
|
|
useFactory: initializeAuth,
|
|
deps: [AuthService],
|
|
multi: true,
|
|
},
|
|
{
|
|
provide: TOAST_CONFIG,
|
|
useValue: {
|
|
default: DefaultGlobalConfig,
|
|
config: {}
|
|
}
|
|
}
|
|
]
|
|
};
|