From e8b0bbd10746078b923945661b9e5af3b6ffbe69 Mon Sep 17 00:00:00 2001 From: alx652 Date: Tue, 18 Jun 2024 13:56:02 -0400 Subject: [PATCH 1/2] make it so beta redirects to ui --- src/app/core/app.component.ts | 1 + .../page-not-found/page-not-found.component.ts | 16 +++++++++++++++- src/environments/environment.fda.local.ts | 7 ++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/app/core/app.component.ts b/src/app/core/app.component.ts index a37a08821..bdfeba1ee 100644 --- a/src/app/core/app.component.ts +++ b/src/app/core/app.component.ts @@ -16,6 +16,7 @@ export class AppComponent { private router: Router, private googleAnalyticsService: GoogleAnalyticsService ) { + router.events.subscribe((event) => { title.setTitle('GSRS'); }); diff --git a/src/app/core/page-not-found/page-not-found.component.ts b/src/app/core/page-not-found/page-not-found.component.ts index 77facfc5e..4a7756e13 100644 --- a/src/app/core/page-not-found/page-not-found.component.ts +++ b/src/app/core/page-not-found/page-not-found.component.ts @@ -13,7 +13,21 @@ export class PageNotFoundComponent implements OnInit { ) { } ngOnInit() { - this.router.navigate(['/home']); + let url=window.location.href; + console.log("url: " + url); + const regex1 = /\/ginas\/app\/beta\//; + const regex2 = /\ginas\/app\/ui\//; + if(url.match(regex1)) { + url = url.replace(regex1, "/ginas/app/ui/"); + const parts = url.split(regex2); + if (parts.length > 2) { + const replaced = parts.slice(0, -1).join(''); + url = replaced + 'ginas/app/ui/' + parts[parts.length - 1]; + window.location.href = url; + } + } else { + this.router.navigate(['/home']); + } } } diff --git a/src/environments/environment.fda.local.ts b/src/environments/environment.fda.local.ts index 8f84aba7d..58f1d17f4 100644 --- a/src/environments/environment.fda.local.ts +++ b/src/environments/environment.fda.local.ts @@ -3,13 +3,10 @@ import { baseEnvironment } from 'src/environments'; export const environment = baseEnvironment; environment.appId = 'fda'; environment.clasicBaseHref = '/ginas/app/'; -// __alex__ should make change here. +environment.baseHref = ''; + environment.appId = 'fda'; environment.isAnalyticsPrivate = true; environment.structureEditor = 'jsdraw'; -// environment.apiBaseUrl = 'http://localhost:9000/ginas/app/'; - // environment.apiBaseUrl = 'http://localhost:8080/'; -// environment.apiBaseUrl = 'http://localhost:8081/'; - export { FdaModule as EnvironmentModule } from '../app/fda/fda.module'; From 8bd0bb6b2ef93b5f5cc1c21faa6fd23e0c9a272d Mon Sep 17 00:00:00 2001 From: alx652 Date: Tue, 18 Jun 2024 14:05:01 -0400 Subject: [PATCH 2/2] clean up console.log --- src/app/core/page-not-found/page-not-found.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/core/page-not-found/page-not-found.component.ts b/src/app/core/page-not-found/page-not-found.component.ts index 4a7756e13..bcf9bb94f 100644 --- a/src/app/core/page-not-found/page-not-found.component.ts +++ b/src/app/core/page-not-found/page-not-found.component.ts @@ -14,7 +14,6 @@ export class PageNotFoundComponent implements OnInit { ngOnInit() { let url=window.location.href; - console.log("url: " + url); const regex1 = /\/ginas\/app\/beta\//; const regex2 = /\ginas\/app\/ui\//; if(url.match(regex1)) {