Skip to content

Commit

Permalink
move Routes to separate file.
Browse files Browse the repository at this point in the history
  • Loading branch information
carolcarpenter committed Nov 22, 2024
1 parent d46cfcc commit eb4ebfa
Show file tree
Hide file tree
Showing 64 changed files with 208 additions and 204 deletions.
23 changes: 23 additions & 0 deletions src/Spd.Presentation.Screening/ClientApp/src/app/app-routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CrrpRoutes } from './modules/crrp-portal/crrp-routes';
import { CrrpaRoutes } from './modules/crrpa-portal/crrpa-routes';
import { OrgRegistrationRoutes } from './modules/org-registration-portal/org-registration-routes';
import { PssoRoutes } from './modules/psso-portal/psso-routes';
import { PssoaRoutes } from './modules/pssoa-portal/pssoa-routes';
import { SecurityScreeningRoutes } from './modules/security-screening-portal/security-screening-routes';

export class AppRoutes {
public static readonly ORG_REGISTRATION = OrgRegistrationRoutes.MODULE_PATH;
public static readonly CRRP_APPLICATION = CrrpRoutes.MODULE_PATH;
public static readonly CRRPA_APPLICATION = CrrpaRoutes.MODULE_PATH;
public static readonly PSSO_APPLICATION = PssoRoutes.MODULE_PATH;
public static readonly PSSOA_APPLICATION = PssoaRoutes.MODULE_PATH;
public static readonly SECURITY_SCREENING_APPLICATION = SecurityScreeningRoutes.MODULE_PATH;
public static readonly LANDING = '';
public static readonly ACCESS_DENIED = 'access-denied';
public static readonly LOGIN_FAILURE = 'login-failure';
public static readonly INVITATION_DENIED = 'invitation-denied';

public static path(route: string): string {
return `/${route}`;
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AppRoutes } from './app-routes';
import { LandingComponent } from './landing.component';
import { CrrpRoutes } from './modules/crrp-portal/crrp-routing.module';
import { CrrpaRoutes } from './modules/crrpa-portal/crrpa-routing.module';
import { OrgRegistrationRoutes } from './modules/org-registration-portal/org-registration-routing.module';
import { PssoRoutes } from './modules/psso-portal/psso-routing.module';
import { PssoaRoutes } from './modules/pssoa-portal/pssoa-routing.module';
import { SecurityScreeningRoutes } from './modules/security-screening-portal/security-screening-routing.module';
import { AccessDeniedComponent } from './shared/components/access-denied.component';
import { LoginFailureComponent } from './shared/components/login-failure.component';

export class AppRoutes {
public static readonly ORG_REGISTRATION = OrgRegistrationRoutes.MODULE_PATH;
public static readonly CRRP_APPLICATION = CrrpRoutes.MODULE_PATH;
public static readonly CRRPA_APPLICATION = CrrpaRoutes.MODULE_PATH;
public static readonly PSSO_APPLICATION = PssoRoutes.MODULE_PATH;
public static readonly PSSOA_APPLICATION = PssoaRoutes.MODULE_PATH;
public static readonly SECURITY_SCREENING_APPLICATION = SecurityScreeningRoutes.MODULE_PATH;
public static readonly LANDING = '';
public static readonly ACCESS_DENIED = 'access-denied';
public static readonly LOGIN_FAILURE = 'login-failure';
public static readonly INVITATION_DENIED = 'invitation-denied';

public static path(route: string): string {
return `/${route}`;
}
}

const routes: Routes = [
{
path: AppRoutes.LANDING,
Expand All @@ -36,7 +14,7 @@ const routes: Routes = [
path: AppRoutes.ORG_REGISTRATION,
loadChildren: () =>
import('./modules/org-registration-portal/org-registration-portal.module').then(
(m) => m.OrgRegistrationPortalModule
(m) => m.OrgRegistrationPortalModule,
),
data: { title: 'Organization Registration' },
},
Expand Down Expand Up @@ -64,7 +42,7 @@ const routes: Routes = [
path: AppRoutes.SECURITY_SCREENING_APPLICATION,
loadChildren: () =>
import('./modules/security-screening-portal/security-screening-portal.module').then(
(m) => m.SecurityScreeningPortalModule
(m) => m.SecurityScreeningPortalModule,
),
data: { title: 'Security Screening' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import { Router } from '@angular/router';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { ApplicantService, OrgService, OrgUserService, UserProfileService } from 'src/app/api/services';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { DialogOopsComponent, DialogOopsOptions } from 'src/app/shared/components/dialog-oops.component';
import { IdentityProviderTypeCode } from '../code-types/code-types.models';

@Injectable()
export class ErrorInterceptor implements HttpInterceptor {
constructor(private router: Router, private dialog: MatDialog) {}
constructor(
private router: Router,
private dialog: MatDialog,
) {}

intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(request).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { Router } from '@angular/router';
import { OAuthService } from 'angular-oauth2-oidc';
import { BehaviorSubject } from 'rxjs';
import { IdentityProviderTypeCode } from 'src/app/api/models';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { AuthenticationService } from 'src/app/core/services/authentication.service';
import { CrrpRoutes } from 'src/app/modules/crrp-portal/crrp-routing.module';
import { CrrpaRoutes } from 'src/app/modules/crrpa-portal/crrpa-routing.module';
import { OrgRegistrationRoutes } from 'src/app/modules/org-registration-portal/org-registration-routing.module';
import { PssoRoutes } from 'src/app/modules/psso-portal/psso-routing.module';
import { PssoaRoutes } from 'src/app/modules/pssoa-portal/pssoa-routing.module';
import { SecurityScreeningRoutes } from 'src/app/modules/security-screening-portal/security-screening-routing.module';
import { CrrpRoutes } from 'src/app/modules/crrp-portal/crrp-routes';
import { CrrpaRoutes } from 'src/app/modules/crrpa-portal/crrpa-routes';
import { OrgRegistrationRoutes } from 'src/app/modules/org-registration-portal/org-registration-routes';
import { PssoRoutes } from 'src/app/modules/psso-portal/psso-routes';
import { PssoaRoutes } from 'src/app/modules/pssoa-portal/pssoa-routes';
import { SecurityScreeningRoutes } from 'src/app/modules/security-screening-portal/security-screening-routes';
import { AuthUserBceidService } from './auth-user-bceid.service';
import { AuthUserBcscService } from './auth-user-bcsc.service';
import { AuthUserIdirService } from './auth-user-idir.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { lastValueFrom } from 'rxjs';
import { OrgService, OrgUserService, UserProfileService } from 'src/app/api/services';
import { AppRoutes } from 'src/app/app-routing.module';
import { OrgRegistrationRoutes } from 'src/app/modules/org-registration-portal/org-registration-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { OrgRegistrationRoutes } from 'src/app/modules/org-registration-portal/org-registration-routes';
import {
OrgSelectionDialogData,
OrgSelectionModalComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { CrrpRoutes } from './modules/crrp-portal/crrp-routing.module';
import { OrgRegistrationRoutes } from './modules/org-registration-portal/org-registration-routing.module';
import { PssoRoutes } from './modules/psso-portal/psso-routing.module';
import { CrrpRoutes } from './modules/crrp-portal/crrp-routes';
import { OrgRegistrationRoutes } from './modules/org-registration-portal/org-registration-routes';
import { PssoRoutes } from './modules/psso-portal/psso-routes';

@Component({
selector: 'app-landing',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { PortalTypeCode } from 'src/app/core/code-types/portal-type.model';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { ScreeningStatusResponse } from 'src/app/shared/components/screening-statuses-common.component';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-application-statuses',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { PortalTypeCode } from 'src/app/core/code-types/portal-type.model';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Router } from '@angular/router';
import { Observable, tap } from 'rxjs';
import { ApplicationStatisticsResponse, ContactAuthorizationTypeCode, OrgUserResponse } from 'src/app/api/models';
import { ApplicationService, OrgUserService } from 'src/app/api/services';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { ApplicationPortalStatisticsTypeCode } from 'src/app/core/code-types/application-portal-statistics-type.model';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-crrp-home',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-crrp-payment-error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { switchMap } from 'rxjs/operators';
import { PaymentLinkCreateRequest, PaymentLinkResponse, PaymentMethodCode, PaymentResponse } from 'src/app/api/models';
import { PaymentService } from 'src/app/api/services';
import { StrictHttpResponse } from 'src/app/api/strict-http-response';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { UtilService } from 'src/app/core/services/util.service';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-crrp-payment-fail',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ApplicationPaymentResponse } from 'src/app/api/models';
import { PaymentService } from 'src/app/api/services';
import { StrictHttpResponse } from 'src/app/api/strict-http-response';
import { UtilService } from 'src/app/core/services/util.service';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-crrp-payment-manual',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { ActivatedRoute, Router } from '@angular/router';
import { PaymentResponse } from 'src/app/api/models';
import { PaymentService } from 'src/app/api/services';
import { StrictHttpResponse } from 'src/app/api/strict-http-response';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { UtilService } from 'src/app/core/services/util.service';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-crrp-payment-success',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import moment from 'moment';
import { ClearanceAccessListResponse, ClearanceAccessResponse } from 'src/app/api/models';
import { ApplicationService } from 'src/app/api/services';
import { StrictHttpResponse } from 'src/app/api/strict-http-response';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { PortalTypeCode } from 'src/app/core/code-types/portal-type.model';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
Expand All @@ -20,7 +20,7 @@ import {
ScreeningRequestAddCommonModalComponent,
ScreeningRequestAddDialogData,
} from 'src/app/shared/components/screening-request-add-common-modal.component';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

export interface ExpiredClearanceResponse extends ClearanceAccessResponse {
daysRemainingText: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
ValidationErr,
} from 'src/app/api/models';
import { ApplicationService } from 'src/app/api/services';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthProcessService } from 'src/app/core/services/auth-process.service';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { UtilService } from 'src/app/core/services/util.service';
import { DialogComponent, DialogOptions } from 'src/app/shared/components/dialog.component';
import { FileUploadComponent } from 'src/app/shared/components/file-upload.component';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-generic-uploads',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { PortalTypeCode } from 'src/app/core/code-types/portal-type.model';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { PortalTypeCode } from 'src/app/core/code-types/portal-type.model';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import {
VolunteerOrganizationTypeCode,
} from 'src/app/api/models';
import { OrgService } from 'src/app/api/services';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { FormControlValidators } from 'src/app/core/validators/form-control.validators';
import { FormGroupValidators } from 'src/app/core/validators/form-group.validators';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';

@Component({
selector: 'app-organization-profile',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import {
} from 'src/app/api/models';
import { ApplicationService, PaymentService } from 'src/app/api/services';
import { StrictHttpResponse } from 'src/app/api/strict-http-response';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { ConfigService } from 'src/app/core/services/config.service';
import { UtilService } from 'src/app/core/services/util.service';
import { ScreeningStatusFilterMap } from 'src/app/shared/components/screening-status-filter-common.component';
import { CrrpRoutes } from '../crrp-routing.module';
import { CrrpRoutes } from '../crrp-routes';
import { PaymentFilter } from './payment-filter.component';

export interface PaymentResponse extends ApplicationPaymentResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import moment from 'moment';
import { OrgReportListResponse, OrgReportResponse } from 'src/app/api/models';
import { OrgReportService } from 'src/app/api/services';
import { StrictHttpResponse } from 'src/app/api/strict-http-response';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { UtilService } from 'src/app/core/services/util.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Router } from '@angular/router';
import { HotToastService } from '@ngxpert/hot-toast';
import { ContactAuthorizationTypeCode, OrgUserListResponse, OrgUserResponse } from 'src/app/api/models';
import { OrgUserService } from 'src/app/api/services';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { ContactAuthorizationTypes, SelectOptions } from 'src/app/core/code-types/model-desc.models';
import { SPD_CONSTANTS } from 'src/app/core/constants/constants';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppRoutes } from 'src/app/app-routing.module';
import { AppRoutes } from 'src/app/app-routes';
import { AuthProcessService } from 'src/app/core/services/auth-process.service';
import { AuthUserBceidService } from 'src/app/core/services/auth-user-bceid.service';
import { CrrpRoutes } from './crrp-routing.module';
import { CrrpRoutes } from './crrp-routes';

@Component({
selector: 'app-crrp-first-time-terms-and-conds',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export class CrrpRoutes {
public static HOME = 'home';
public static CRIMINAL_RECORD_CHECKS = 'criminal-record-checks';
public static APPLICATION_STATUSES = 'application-statuses';
public static EXPIRING_CHECKS = 'expiring-checks';
public static GENERIC_UPLOADS = 'generic-uploads';
public static IDENTITY_VERIFICATION = 'identity-verification';
public static MANUAL_SUBMISSIONS = 'manual-submissions';
public static ORGANIZATION_PROFILE = 'organization-profile';
public static TERMS_AND_CONDITIONS = 'terms-and-conditions';
public static PAYMENTS = 'payments';
public static PAYMENT_SUCCESS = 'payment-success';
public static PAYMENT_FAIL = 'payment-fail';
public static PAYMENT_MANUAL = 'payment-manual';
public static PAYMENT_ERROR = 'payment-error';
public static INVITATION = 'invitation';
public static INVITATION_LINK_ORG = 'invitation-link-bceid';
public static INVITATION_ACCEPT = 'invitation-accept';
public static REPORTS = 'reports';
public static USERS = 'users';
public static ORG_TERMS_AND_CONDITIONS = 'org-terms-and-conditions';

public static MODULE_PATH = 'crrp';

public static path(route: string | null = null): string {
return route ? `/${CrrpRoutes.MODULE_PATH}/${route}` : `/${CrrpRoutes.MODULE_PATH}`;
}
}
Loading

0 comments on commit eb4ebfa

Please sign in to comment.