make route reuse work better
This commit is contained in:
parent
7f82a1c862
commit
dca9d88f97
@ -33,6 +33,11 @@ const routes = [
|
|||||||
path: 'main/dossiers',
|
path: 'main/dossiers',
|
||||||
component: BaseScreenComponent,
|
component: BaseScreenComponent,
|
||||||
loadChildren: () => import('./modules/dossier/dossiers.module').then(m => m.DossiersModule),
|
loadChildren: () => import('./modules/dossier/dossiers.module').then(m => m.DossiersModule),
|
||||||
|
canActivate: [CompositeRouteGuard],
|
||||||
|
data: {
|
||||||
|
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
||||||
|
requiredRoles: ['RED_USER', 'RED_MANAGER'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'main/downloads',
|
path: 'main/downloads',
|
||||||
|
|||||||
@ -15,14 +15,14 @@ import { UserListingScreenComponent } from './screens/user-listing/user-listing-
|
|||||||
import { LicenseInformationScreenComponent } from './screens/license-information/license-information-screen.component';
|
import { LicenseInformationScreenComponent } from './screens/license-information/license-information-screen.component';
|
||||||
import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component';
|
import { DigitalSignatureScreenComponent } from './screens/digital-signature/digital-signature-screen.component';
|
||||||
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
|
import { AuditScreenComponent } from './screens/audit/audit-screen.component';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { ReportsScreenComponent } from './screens/reports/reports-screen.component';
|
import { ReportsScreenComponent } from './screens/reports/reports-screen.component';
|
||||||
import { DossierAttributesListingScreenComponent } from './screens/dossier-attributes-listing/dossier-attributes-listing-screen.component';
|
import { DossierAttributesListingScreenComponent } from './screens/dossier-attributes-listing/dossier-attributes-listing-screen.component';
|
||||||
import { TrashScreenComponent } from './screens/trash/trash-screen.component';
|
import { TrashScreenComponent } from './screens/trash/trash-screen.component';
|
||||||
import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component';
|
import { GeneralConfigScreenComponent } from './screens/general-config/general-config-screen.component';
|
||||||
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
|
import { BaseAdminScreenComponent } from './base-admin-screen/base-admin-screen.component';
|
||||||
|
|
||||||
const routes = [
|
const routes: Routes = [
|
||||||
{ path: '', redirectTo: 'dossier-templates', pathMatch: 'full' },
|
{ path: '', redirectTo: 'dossier-templates', pathMatch: 'full' },
|
||||||
{
|
{
|
||||||
path: 'dossier-templates',
|
path: 'dossier-templates',
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { CompositeRouteGuard } from '@iqser/common-ui';
|
import { CompositeRouteGuard } from '@iqser/common-ui';
|
||||||
import { AuthGuard } from '../auth/auth.guard';
|
|
||||||
import { RedRoleGuard } from '../auth/red-role.guard';
|
|
||||||
import { AppStateGuard } from '@state/app-state.guard';
|
|
||||||
import { SearchScreenComponent } from './screens/search-screen/search-screen.component';
|
import { SearchScreenComponent } from './screens/search-screen/search-screen.component';
|
||||||
import { FilePreviewScreenComponent } from './screens/file-preview-screen/file-preview-screen.component';
|
import { FilePreviewScreenComponent } from './screens/file-preview-screen/file-preview-screen.component';
|
||||||
|
|
||||||
@ -11,37 +8,22 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: 'search',
|
path: 'search',
|
||||||
component: SearchScreenComponent,
|
component: SearchScreenComponent,
|
||||||
canActivate: [CompositeRouteGuard],
|
|
||||||
data: {
|
|
||||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':dossierId',
|
path: ':dossierId',
|
||||||
canActivate: [CompositeRouteGuard],
|
canActivate: [CompositeRouteGuard],
|
||||||
data: {
|
|
||||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
|
||||||
reuse: true,
|
|
||||||
},
|
|
||||||
loadChildren: () => import('./screens/dossier-overview/dossier-overview.module').then(m => m.DossierOverviewModule),
|
loadChildren: () => import('./screens/dossier-overview/dossier-overview.module').then(m => m.DossierOverviewModule),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':dossierId/file/:fileId',
|
path: ':dossierId/file/:fileId',
|
||||||
component: FilePreviewScreenComponent,
|
component: FilePreviewScreenComponent,
|
||||||
canActivate: [CompositeRouteGuard],
|
|
||||||
data: {
|
data: {
|
||||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
|
||||||
reuse: true,
|
reuse: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
canActivate: [CompositeRouteGuard],
|
|
||||||
data: {
|
|
||||||
routeGuards: [AuthGuard, RedRoleGuard, AppStateGuard],
|
|
||||||
reuse: true,
|
|
||||||
},
|
|
||||||
loadChildren: () => import('./screens/dossiers-listing/dossiers-listing.module').then(m => m.DossiersListingModule),
|
loadChildren: () => import('./screens/dossiers-listing/dossiers-listing.module').then(m => m.DossiersListingModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -22,6 +22,9 @@ const routes = [
|
|||||||
path: '',
|
path: '',
|
||||||
component: DossierOverviewScreenComponent,
|
component: DossierOverviewScreenComponent,
|
||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
|
data: {
|
||||||
|
reuse: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { IqserIconsModule } from '@iqser/common-ui';
|
import { IqserIconsModule } from '@iqser/common-ui';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { DossiersListingScreenComponent } from './screen/dossiers-listing-screen.component';
|
import { DossiersListingScreenComponent } from './screen/dossiers-listing-screen.component';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { DossiersListingActionsComponent } from './components/dossiers-listing-actions/dossiers-listing-actions.component';
|
import { DossiersListingActionsComponent } from './components/dossiers-listing-actions/dossiers-listing-actions.component';
|
||||||
import { SharedModule } from '@shared/shared.module';
|
import { SharedModule } from '@shared/shared.module';
|
||||||
import { DossiersListingDetailsComponent } from './components/dossiers-listing-details/dossiers-listing-details.component';
|
import { DossiersListingDetailsComponent } from './components/dossiers-listing-details/dossiers-listing-details.component';
|
||||||
@ -13,11 +13,12 @@ import { TableItemComponent } from './components/table-item/table-item.component
|
|||||||
import { SharedDossiersModule } from '../../shared/shared-dossiers.module';
|
import { SharedDossiersModule } from '../../shared/shared-dossiers.module';
|
||||||
import { DossierWorkloadColumnComponent } from './components/dossier-workload-column/dossier-workload-column.component';
|
import { DossierWorkloadColumnComponent } from './components/dossier-workload-column/dossier-workload-column.component';
|
||||||
|
|
||||||
const routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: DossiersListingScreenComponent,
|
component: DossiersListingScreenComponent,
|
||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
|
data: { reuse: true },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user