import { Routes } from '@angular/router' ; import { AppLayoutComponent } from './components/layout/app-layout/app-layout.component' ; import { FilesComponent } from './components/files/files.component' ; import { LibrariesComponent } from './components/libraries/libraries.component' ; import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component' ; import { SearchResultsComponent } from './components/search/search-results/search-results.component' ; import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component' ; import { LoginComponent } from './components/login/login.component' ; import { AppSharedRuleGuard , GenericErrorComponent , ExtensionsDataLoaderGuard } from '@alfresco/aca-shared' ; import { AuthGuardEcm , BlankPageComponent } from '@alfresco/adf-core' ; import { FavoritesComponent } from './components/favorites/favorites.component' ; import { RecentFilesComponent } from './components/recent-files/recent-files.component' ; import { SharedFilesComponent } from './components/shared-files/shared-files.component' ; import { DetailsComponent } from './components/details/details.component' ; export const APP_ROUTES = [ { path : 'blank' , component : BlankPageComponent } , { path : 'login' , component : LoginComponent , data : { title : 'APP.SIGN_IN' } } , { path : 'preview/s/:id' , loadChildren : ( ) => import ( './components/shared-link-view/shared-link-view.module' ) . then ( ( m ) => m . AppSharedLinkViewModule ) } , { path : 'view' , component : AppLayoutComponent , children : [ { path : ':nodeId' , outlet : 'viewer' , children : [ { path : '' , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : '' , component : AppLayoutComponent , canActivate : [ AuthGuardEcm , ExtensionsDataLoaderGuard ] , children : [ { path : '' , redirectTo : `/personal-files` , pathMatch : 'full' } , { path : 'personal-files' , children : [ { path : '' , component : FilesComponent , data : { sortingPreferenceKey : 'personal-files' , title : 'APP.BROWSE.PERSONAL.TITLE' , defaultNodeId : '-my-' } } , { path : 'details/:nodeId' , children : [ { path : '' , component : DetailsComponent , data : { navigateSource : 'personal-files' } } , { path : ':activeTab' , component : DetailsComponent , data : { navigateSource : 'personal-files' } } ] } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'personal-files' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'personal-files' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'personal-files' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'personal-files/:folderId' , children : [ { path : '' , component : FilesComponent , data : { title : 'APP.BROWSE.PERSONAL.TITLE' , sortingPreferenceKey : 'personal-files' } } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'personal-files' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'personal-files' } } , { path : ':folderId/preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'personal-files' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'personal-files' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'libraries' , children : [ { path : '' , component : LibrariesComponent , data : { title : 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE' , sortingPreferenceKey : 'libraries' } } ] } , { path : 'libraries/:folderId' , children : [ { path : '' , component : FilesComponent , data : { title : 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE' , sortingPreferenceKey : 'libraries-files' } } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'libraries' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'libraries' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'libraries' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'favorite' , children : [ { path : '' , pathMatch : 'full' , redirectTo : 'libraries' } , { path : 'libraries' , component : FavoriteLibrariesComponent , data : { title : 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE' , sortingPreferenceKey : 'favorite-libraries' } } ] } , { path : 'favorite/libraries/:folderId' , children : [ { path : '' , component : FilesComponent , data : { title : 'APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.TITLE' , sortingPreferenceKey : 'libraries-files' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'libraries' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'libraries' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'favorites' , data : { sortingPreferenceKey : 'favorites' } , children : [ { path : '' , component : FavoritesComponent , data : { title : 'APP.BROWSE.FAVORITES.TITLE' , sortingPreferenceKey : 'favorites' } } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'favorites' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'favorites' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'favorites' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'recent-files' , data : { sortingPreferenceKey : 'recent-files' } , children : [ { path : '' , component : RecentFilesComponent , data : { title : 'APP.BROWSE.RECENT.TITLE' } } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'recent-files' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'recent-files' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'recent-files' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'shared' , children : [ { path : '' , data : { title : 'APP.BROWSE.SHARED.TITLE' , sortingPreferenceKey : 'shared-files' } , component : SharedFilesComponent } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'shared' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'shared' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'shared' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] , canActivateChild : [ AppSharedRuleGuard ] , canActivate : [ AppSharedRuleGuard ] } , { path : 'trashcan' , loadChildren : ( ) => import ( './components/trashcan/trashcan.module' ) . then ( ( m ) => m . AppTrashcanModule ) } , { path : 'search' , children : [ { path : '' , component : SearchResultsComponent , data : { title : 'APP.BROWSE.SEARCH.TITLE' } } , { path : 'preview/:nodeId' , loadChildren : ( ) => import ( './components/preview/preview.module' ) . then ( ( m ) => m . PreviewModule ) , data : { navigateSource : 'search' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'search' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } , { path : 'view/:nodeId/:versionId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'search' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : 'search-libraries' , children : [ { path : '' , component : SearchLibrariesResultsComponent , data : { title : 'APP.BROWSE.SEARCH.TITLE' } } , { path : 'view/:nodeId' , outlet : 'viewer' , children : [ { path : '' , data : { navigateSource : 'search' } , loadChildren : ( ) => import ( './components/viewer/viewer.module' ) . then ( ( m ) => m . AppViewerModule ) } ] } ] } , { path : '**' , component : GenericErrorComponent } ] , canActivateChild : [ AuthGuardEcm ] } ] ;