import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { DownloadFilePageComponent } from '@core/components/download-file-page/download-file-page.component'; import { GcWrapperManagementComponent } from '@core/components/gc-wrapper-management/gc-wrapper-management.component'; import { SSOLogoutComponent } from '@core/components/sso-logout/sso-logout.component'; import { SSORedirectComponent } from '@core/components/sso-redirect/sso-redirect.component'; import { CanAccessPortalGuard } from '@core/guards/can-access-portal.guard'; import { FeatureFlagsResolver } from '@core/resolvers/feature-flags.resolver'; import { InitialRedirectResolver } from '@core/resolvers/initial-redirect.resolver'; import { LanguageResolver } from '@core/resolvers/language-resolver'; import { LocaleResolver } from '@core/resolvers/locale.resolver'; import { StaticResourceSASResolver } from '@core/resolvers/static-resource-sas.resolver'; import { UnauthenticatedGuard } from '@features/auth/unauthenticated.guard'; import { ClientIntAuthoritiesResolver } from '@features/client-settings/resolvers/client-int-authorities.resolver'; import { ClientSettingsResolver } from '@features/client-settings/resolvers/client-settings.resolver'; import { CycleMapResolver } from '@features/cycles/resolvers/cycle-map.resolver'; import { MyDashboardsResolver } from '@features/dashboards/resolvers/dashboards.resolver'; import { ImpersonationLandingPageComponent } from '@features/impersonation/impersonation-landing-page/impersonation-landing-page.component'; import { TerminatedImpersonationPageComponent } from '@features/impersonation/terminated-impersonation-page/terminated-impersonation-page.component'; import { InKindResolver } from '@features/in-kind/resolvers/in-kind.resolver'; import { PageHelpModalResolver } from '@features/page-help-modals/page-help-modals.resolver'; import { HelpContentResolver } from '@features/platform-admin/help-content/help-content.resolver'; import { SystemTagsResolver } from '@features/system-tags/resolvers/system-tags.resolver'; @NgModule({ imports: [ RouterModule.forChild([{ path: '', data: { namespace: ['GLOBAL', 'AUTH', 'classification'] }, resolve: { redirect: InitialRedirectResolver, locale: LocaleResolver, language: LanguageResolver }, children: [{ path: '', children: [{ path: 'auth', canActivate: [ UnauthenticatedGuard ], loadChildren: () => import('@features/auth/management-auth.module').then(m => m.ManagementAuthModule) }, { path: 'sso_redirect', component: SSORedirectComponent }, { path: 'impersonation', component: ImpersonationLandingPageComponent }, { path: 'impersonation-session-ended', component: TerminatedImpersonationPageComponent }, { path: 'ssologout', component: SSOLogoutComponent }] }, { path: 'downloads', loadChildren: () => import('@features/downloads/downloads-routing.module') .then(m => m.DownloadsRoutingModule) }, { // to add to the above, add an exception to checkRedirect in the token service // Logged in path: '', canActivate: [ CanAccessPortalGuard ], resolve: { help: HelpContentResolver, featureFlags: FeatureFlagsResolver, sas: StaticResourceSASResolver, settings: ClientSettingsResolver, dashboards: MyDashboardsResolver, pageHelp: PageHelpModalResolver }, component: GcWrapperManagementComponent, children: [{ path: 'download-file', component: DownloadFilePageComponent }, { path: 'my-account', loadChildren: () => import('@features/my-account/management-account.module') .then(m => m.ManagementAccountModule), data: { namespace: ['ACCOUNT'], pageName: 'My Account' } }, { path: 'communication-preferences', loadChildren: () => import('@features/communication-preferences/communication-preferences-routing.module') .then(m => m.CommunicationPreferencesRoutingModule) }, { path: 'manage-filters', loadChildren: () => import('@features/my-filters/my-filters-routing.module') .then(m => m.MyFilterRoutingModule), data: { breadcrumbLabel: 'Manage Filters', breadcrumb: true, pageName: 'Manage Filters' } }, { path: 'terms-and-conditions', loadChildren: () => import('@features/terms-and-conditions/terms-and-conditions-routing.module') .then(m => m.TermsAndConditionsRoutingModule) }, { path: 'home', loadChildren: () => import('@features/dashboards/dashboards-routing.module') .then(m => m.DashboardsRoutingModule), data: { breadcrumbLabel: 'Home', breadcrumb: false, pageName: 'Home' } }, { path: 'application-view/:id', loadChildren: () => import('@features/application-view/application-view-routing.module') .then(m => m.ApplicationViewRoutingModule), data: { breadcrumbLabel: 'Application View', pageName: 'Application View' } }, { path: 'nomination-view/:id', loadChildren: () => import('@features/application-view/application-view-routing.module') .then(m => m.ApplicationViewRoutingModule), data: { breadcrumbLabel: 'Nomination View', isNomination: true, pageName: 'Nomination View' } }, { path: 'configure', loadChildren: () => import('@features/configuration/configuration.module') .then(m => m.ConfigurationModule), data: { breadcrumbLabel: 'Settings', breadcrumb: true, pageName: 'Settings' } }, { path: 'nonprofit', loadChildren: () => import('@features/nonprofit/nonprofit-routing.module') .then(m => m.NonprofitRoutingModule) }, { path: 'applicant-profile', loadChildren: () => import('@features/applicant/applicant-routing.module') .then(m => m.ApplicantRoutingModule) }, { path: 'reporting', loadChildren: () => import('@features/reporting/reporting-routing.module') .then(m => m.ReportingRoutingModule), data: { breadcrumbLabel: 'Reporting', pageName: 'Reporting' } }, { path: 'manage-applications', loadChildren: () => import('@features/application-manager/application-manager-routing.module') .then(m => m.ApplicationManagerRoutingModule), resolve: { clientIntAuthorities: ClientIntAuthoritiesResolver }, data: { breadcrumbLabel: 'Applications', breadcrumb: true, pageName: 'Applications' } }, { path: 'manage-nominations', loadChildren: () => import('@features/application-manager/nomination-manager-routing.module') .then(m => m.NominationManagerRoutingModule), data: { breadcrumbLabel: 'Nominations', breadcrumb: true, pageName: 'Nominations' } }, { path: 'insights', loadChildren: () => import('@features/insights/insights-routing.module') .then(m => m.InsightsRoutingModule), data: { breadcrumbLabel: 'Insights', breadcrumb: true, pageName: 'Insights', namespace: ['PROGRAM'] }, resolve: { tags: SystemTagsResolver, cycleMap: CycleMapResolver, inKind: InKindResolver, locale: LocaleResolver } }, { path: 'payment-processing', loadChildren: () => import('@features/payment-processing/payment-processing-routing.module') .then(m => m.PaymentProcessingRoutingModule), data: { breadcrumbLabel: 'Payment Processing', breadcrumb: true, pageName: 'Payment Processing' } }, { path: 'program-setup', loadChildren: () => import('@features/program-setup/program-setup-routing.module') .then(m => m.ProgramSetupRoutingModule), data: { breadcrumbLabel: 'Program Setup', breadcrumb: true, pageName: 'Program Setup', namesapce: ['PROGRAM'] }, resolve: { locale: LocaleResolver } }, { path: '**', redirectTo: 'home' }] }] }]) ] }) export class ManagementPortalRoutingModule { }