import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {MonitorComponent} from "./monitor.component";

@NgModule({
  imports: [
    RouterModule.forChild([
      {path: '', redirectTo: '/admin', pathMatch: 'full'},
      {
        path: ':stakeholder',
        component: MonitorComponent,
        canDeactivate: [PreviousRouteRecorder]
      },
      {
        path: ':stakeholder/develop',
        loadChildren: '../develop/develop.module#DevelopModule',
        canDeactivate: [PreviousRouteRecorder],
        data: {
          hasSidebar: false,
          isDashboard: false
        }
      },
      {
        path: ':stakeholder/methodology',
        loadChildren: '../methodology/methodology.module#MethodologyModule',
        canDeactivate: [PreviousRouteRecorder],
        data: {
          hasSidebar: false,
          isDashboard: false
        }
      },
      {
        path: ':stakeholder/search',
        loadChildren: '../search/search.module#SearchModule',
        canDeactivate: [PreviousRouteRecorder]
      },
      {
        path: ':stakeholder/:topic',
        component: MonitorComponent,
        canDeactivate: [PreviousRouteRecorder]
      },
      {
        path: ':stakeholder/:topic/:category',
        component: MonitorComponent,
        canDeactivate: [PreviousRouteRecorder]
      },
      {
        path: ':stakeholder/:topic/:category/:subCategory',
        component: MonitorComponent,
        canDeactivate: [PreviousRouteRecorder]
      }
    ])
  ]
})
export class MonitorRoutingModule {
}
