import { AddJoinUsComponent } from './dashboard/add-join-us/add-join-us.component';
import { AddMenuComponent } from './dashboard/main-menu/add-menu/add-menu.component';
import { MainListComponent } from './dashboard/main-menu/main-list/main-list.component';
import { AddLectureComponent } from './dashboard/lectures/add-lecture/add-lecture.component';
import { LecturesListComponent } from './dashboard/lectures/lectures-list/lectures-list.component';
import { AddInternalServicesComponent } from './dashboard/internal-services/add-internal-services/add-internal-services.component';
import { AddFooterComponent } from './dashboard/footer/add-footer/add-footer.component';
import { FooterListComponent } from './dashboard/footer/footer-list/footer-list.component';
import { AddNewsComponent } from './dashboard/news/add-news/add-news.component';
import { AddTabComponent } from './dashboard/tabs/add-tab/add-tab.component';
import { TabListComponent } from './dashboard/tabs/tab-list/tab-list.component';
import { AddAchievementComponent } from './dashboard/achievements/add-achievement/add-achievement.component';
import { AchievementComponent } from './dashboard/achievements/achievement-list/achievement.component';
import { AddExternalComponent } from './dashboard/external-services/add-external/add-external.component';
import { ExternalListComponent } from './dashboard/external-services/external-list/external-list.component';
import { AddHospitalComponent } from './dashboard/hospitals/add-hospital/add-hospital.component';
import { ReportListComponent } from './dashboard/report-list/report-list.component';
import { RoleReport2Component } from './dashboard/roles/role-report2/role-report2.component';
import { AddSectionComponent } from './dashboard/sections/add-section/add-section.component';
import { SectionListComponent } from './dashboard/sections/section-list/section-list.component';
import { AddDepartmentComponent } from './dashboard/department/add-department/add-department.component';
import { DepartmentListComponent } from './dashboard/department/department-list/department-list.component';
import { AddRolesComponent } from './dashboard/roles/add-roles/add-roles.component';
import { FormUserComponent } from './dashboard/users/form-user/form-user.component';
import { UsersComponent } from './dashboard/users/users.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './login/login.component';
import { RegesterComponent } from './regester/regester.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { AuthGuardService as AuthGuard } from './shared/auth-guard.service';
import { ServiceItemComponent } from './dashboard/service-item/service-item.component';
import { RolesListComponent } from './dashboard/roles/roles-list/roles-list.component';
import { DashboardComponent } from './dashboard/dashboard/dashboard.component';
import { UserPermissionComponent } from './dashboard/users/user-permission/user-permission.component';
import { UserReportComponent } from './dashboard/users/user-report/user-report.component';
import { RoleReportComponent } from './dashboard/roles/role-report/role-report.component';
import { ReportsPageComponent } from './dashboard/reports-page/reports-page.component';
import { HospitalListComponent } from './dashboard/hospitals/hospital-list/hospital-list.component';
import { EventsComponent } from './dashboard/events/events.component';
import { AddEventComponent } from './dashboard/events/add-event/add-event.component';
import { NewsListComponent } from './dashboard/news/news-list/news-list.component';
import { InternalServicesComponent } from './dashboard/internal-services/internal-services.component';
import { InternalPageComponent } from './Internal-Page/internal-page/internal-page.component';

const routes: Routes = [
  {path: '', redirectTo: '/login', pathMatch: 'full'},
  {path: 'login', component: LoginComponent},
  {path: 'signup', component: RegesterComponent},
  {path: 'InternalPage', component: InternalPageComponent, canActivate: [AuthGuard]},
  {path: 'profile/:idProfile', component: RegesterComponent, canActivate: [AuthGuard]},
  {path: 'dashboard/:id', component: DashboardComponent, canActivate: [AuthGuard]},
  {path: 'service/:userID/:serviceID', component: ServiceItemComponent, canActivate: [AuthGuard], children: [
    {path: 'users/:userPageId', component: UsersComponent, canActivate: [AuthGuard]},
    {path: 'roles/:rolesPageId', component: RolesListComponent, canActivate: [AuthGuard]},
    {path: 'departments/:departsPageId', component: DepartmentListComponent, canActivate: [AuthGuard]},
    {path: 'sections/:sectionPageId', component: SectionListComponent, canActivate: [AuthGuard]},
    {path: 'reports', component: ReportsPageComponent, canActivate: [AuthGuard]},
    {path: 'addu/:type_add', component: FormUserComponent, canActivate: [AuthGuard]},
    {path: 'addJoinUs', component: AddJoinUsComponent, canActivate:[AuthGuard]},
    {path: 'joinUs/:typeJoinMode/:editJoinId', component: AddJoinUsComponent, canActivate:[AuthGuard]},
    {path: 'join/:typemode/:userEditId', component: FormUserComponent, canActivate: [AuthGuard]},
    {path: 'user/:typemode/:userEditId', component: FormUserComponent, canActivate: [AuthGuard]},
    {path: 'addRole', component: AddRolesComponent, canActivate: [AuthGuard]},
    {path: 'editRole/:typeRoleMode/:roleEditId', component: AddRolesComponent, canActivate: [AuthGuard]},
    {path: 'addAdminstration', component: AddDepartmentComponent, canActivate: [AuthGuard]},
    {path: 'editAdminstration/:typeAdminMode/:editAdminId', component: AddDepartmentComponent, canActivate: [AuthGuard]},
    {path: 'addSection', component: AddSectionComponent, canActivate: [AuthGuard]},
    {path: 'editSection/:typeSectionMode/:editSectionId', component: AddSectionComponent, canActivate: [AuthGuard]},
    {path: 'hospitalsList/:typePageId', component: HospitalListComponent, canActivate: [AuthGuard]},
    {path: 'mangementList/:typePageId', component: HospitalListComponent, canActivate: [AuthGuard]},
    {path: 'add/:typeAdd' , component: AddHospitalComponent, canActivate: [AuthGuard]},
    {path: 'Hospital/:typeHospitalMode/:editTypePageId', component: AddHospitalComponent, canActivate: [AuthGuard]},
    {path: 'Management/:typeHospitalMode/:editTypePageId', component: AddHospitalComponent, canActivate: [AuthGuard]},
    {path: 'eventsList/:eventPageId', component: EventsComponent, canActivate: [AuthGuard]},
    {path: 'addEvent', component: AddEventComponent, canActivate: [AuthGuard]},
    {path: 'Event/:typeEventMode/:editEventId', component: AddEventComponent, canActivate:[AuthGuard]},
    {path: 'externalsList/:externalPageId', component: ExternalListComponent, canActivate: [AuthGuard]},
    {path: 'addExternal', component: AddExternalComponent, canActivate: [AuthGuard]},
    {path: 'externalService/:typeExternalMode/:editExternalId', component: AddExternalComponent, canActivate: [AuthGuard]},
    {path: 'achievementsList/:achievementPageId', component: AchievementComponent, canActivate: [AuthGuard]},
    {path: 'addAchievement', component: AddAchievementComponent, canActivate: [AuthGuard]},
    {path: 'achievement/:typeAchieventMode/:editAchievementId', component: AddAchievementComponent, canActivate: [AuthGuard]},
    {path: 'joinUs/:userPageId', component: UsersComponent, canActivate: [AuthGuard]},
    {path: 'tabs/:tabPageId', component: TabListComponent, canActivate: [AuthGuard]},
    {path: 'addTab', component: AddTabComponent, canActivate: [AuthGuard]},
    {path: 'tab/:typeTabMode/:editTabId', component: AddTabComponent, canActivate: [AuthGuard]},
    {path: 'newsList/:newsPageId', component: NewsListComponent, canActivate: [AuthGuard]},
    {path: 'addNews', component: AddNewsComponent, canActivate: [AuthGuard]},
    {path: 'new/:typeNewMode/:editNewId', component: AddNewsComponent, canActivate: [AuthGuard]},
    {path: 'footerList/:footerPageId', component: FooterListComponent, canActivate: [AuthGuard]},
    {path: 'addFooter', component: AddFooterComponent, canActivate: [AuthGuard]},
    {path: 'footer/:typeFooterMode/:editFooterId', component: AddFooterComponent, canActivate: [AuthGuard]},
    {path: 'internalServicesList/:internalPageId', component: InternalServicesComponent, canActivate: [AuthGuard]},
    {path: 'addInternalServices', component: AddInternalServicesComponent, canActivate: [AuthGuard]},
    {path: 'InternalServices/:typeInternalMode/:editInternalId', component: AddInternalServicesComponent, canActivate: [AuthGuard]},
    {path: 'lecturesList/:lecturePageId', component: LecturesListComponent, canActivate:[AuthGuard]},
    {path: 'addLecture', component: AddLectureComponent, canActivate: [AuthGuard]},
    {path: 'Lecture/:typeLectureMode/:editLectureId', component: AddLectureComponent, canActivate: [AuthGuard]},
    {path: 'mainMenuList/:menuPageId', component: MainListComponent, canActivate:[AuthGuard]},
    {path: 'addMenu', component: AddMenuComponent, canActivate: [AuthGuard]},
    {path: 'menu/:typeMenuMode/:editMenuId', component: AddMenuComponent, canActivate: [AuthGuard]},
    {path: 'userPermission/:userPermissionId', component: UserPermissionComponent, canActivate: [AuthGuard]},
    {path: 'userreport/:reportUserId', component: UserReportComponent, canActivate: [AuthGuard]},
    {path: 'roleReport/:roleReportId', component: RoleReportComponent, canActivate: [AuthGuard]},
    {path: 'userInRoleReport/:userRoleReportId', component: RoleReport2Component, canActivate: [AuthGuard]},
    {path: 'reportList/:reportName', component: ReportListComponent},
  ]},
  {path: 'page-not-found', component: PageNotFoundComponent},
  {path: '**', redirectTo: '/page-not-found', pathMatch: 'full'}
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})

export class AppRoutingModule { }
