All application routes are defined in AppRoutingModule and live under the /controlmedios path prefix. The root path redirects there automatically. This page documents every route, its component, its parameters, and any navigation guards or redirect logic.
Route summary
| Path | Component | Description |
|---|
/ | — | Redirects to /controlmedios |
/controlmedios | ImportarComponent | Log ingestion and parse view |
/controlmedios/panel/:cat | PanelComponent | Category dispatch panel |
/controlmedios/estadisticas | EstadisticasComponent | Full analytics dashboard |
/controlmedios/estadisticas/c/:cat | EstadisticasComponent | Analytics filtered by category |
/controlmedios/estadisticas/m/:medio | EstadisticasComponent | Analytics filtered by media outlet |
Route definitions
/ — root redirect
The root path performs a full redirect to /controlmedios using Angular’s pathMatch: 'full' strategy. No component is rendered at this path.
{ path: '', redirectTo: 'controlmedios', pathMatch: 'full' }
/controlmedios — ingestion view
Component: ImportarComponent
The entry point of the application. Operators paste the raw WhatsApp press clipping export here. ImportarComponent handles:
- Parsing the pasted log text into
NewsItem objects
- Resolving media outlet and programme siglas against
mediosYProgramas
- Running the keyword categorisation pass to populate
topic on each item
- Writing the result into
DataService.newsItems and DataService.newAgrupadas
- Displaying a summary of parsed items with links to each category panel
/controlmedios/panel/:cat — category dispatch panel
Component: PanelComponent
Route parameter:
| Parameter | Type | Description |
|---|
cat | string | The category name (URL-encoded if it contains spaces or accented characters) |
PanelComponent reads the cat parameter and looks up the matching entry in DataService.newAgrupadas to display the news items belonging to that category. Operators use this view to:
- Read and edit the
iaResume field for each item
- Mark items as destacada (featured)
- Toggle items between view and edit mode via the
copy flag
- Trigger
copyAll() to persist the current category’s items to WordPress
Redirect guard
If DataService.newAgrupadas is empty when PanelComponent initialises — for example, if the operator navigates directly to a panel URL without first completing a parse — the component redirects to /. This prevents the panel from rendering against an empty dataset.
// Inside PanelComponent constructor
this.noticias = this.DS.getAgrupadas();
if (this.noticias.length == 0) {
this.router.navigate(['/']);
}
/controlmedios/estadisticas — analytics dashboard
Component: EstadisticasComponent
Displays the full analytics dashboard over all items persisted to WordPress. Operators can:
- Set a date range using the
statsDesde and statsHasta fields in DataService
- Browse coverage counts by category and by media outlet
- Navigate to filtered views using the category and media outlet links
When this route is active with no parameters, EstadisticasComponent loads the unfiltered dataset from DataService.noticiasGuardadas.
/controlmedios/estadisticas/c/:cat — analytics filtered by category
Component: EstadisticasComponent
Route parameter:
| Parameter | Type | Description |
|---|
cat | string | Category name to filter the analytics dataset by |
The same EstadisticasComponent is reused here. When the cat parameter is present, the component filters DataService.estadisticasList to show only items whose topics field contains the given category.
Component: EstadisticasComponent
Route parameter:
| Parameter | Type | Description |
|---|
medio | string | Media outlet name to filter the analytics dataset by |
When the medio parameter is present, EstadisticasComponent filters the dataset to show only items whose media field matches the given outlet name.
AppRoutingModule configuration
The full route configuration as defined in app-routing.module.ts:
const routes: Routes = [
{ path: '', redirectTo: 'controlmedios', pathMatch: 'full' },
{
path: 'controlmedios',
children: [
{ path: '', component: ImportarComponent, pathMatch: 'full' },
{ path: 'panel/:cat', component: PanelComponent },
{ path: 'estadisticas', component: EstadisticasComponent },
{ path: 'estadisticas/c/:cat', component: EstadisticasComponent },
{ path: 'estadisticas/m/:medio', component: EstadisticasComponent },
]
}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {}
All three EstadisticasComponent routes share the same component class. The component uses activatedRoute.snapshot.url[1]?.path to check whether the second URL segment is 'm' (outlet filter) or 'c' (category filter), and applies the appropriate procesarEstadisticas() call accordingly.
When navigating programmatically to a category panel from ImportarComponent, URL-encode the category name to handle special characters such as accented vowels common in Spanish (e.g., Educación → Educaci%C3%B3n).