Skip to content

Commit

Permalink
Merge pull request #515 from ncats/awb045_betaredirects
Browse files Browse the repository at this point in the history
Make it so beta redirects to ui
  • Loading branch information
NikoAnderson authored Jun 18, 2024
2 parents 25de2a3 + 8bd0bb6 commit 7fda946
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/app/core/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class AppComponent {
private router: Router,
private googleAnalyticsService: GoogleAnalyticsService
) {

router.events.subscribe((event) => {
title.setTitle('GSRS');
});
Expand Down
15 changes: 14 additions & 1 deletion src/app/core/page-not-found/page-not-found.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@ export class PageNotFoundComponent implements OnInit {
) { }

ngOnInit() {
this.router.navigate(['/home']);
let url=window.location.href;
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']);
}
}

}
7 changes: 2 additions & 5 deletions src/environments/environment.fda.local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 7fda946

Please sign in to comment.