Skip to content

Commit

Permalink
Merge branch 'PPF-237-redirect-to-public-platform' into PPF-198-docke…
Browse files Browse the repository at this point in the history
…r-setup
  • Loading branch information
LucWollants committed Dec 19, 2023
2 parents acba8dd + 8d30ecc commit 5433d04
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/app/core/route/guard/auth-guard.service.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { Injectable } from '@angular/core';
import { of as observableOf, Observable } from 'rxjs';
import { of as observableOf } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import {
ActivatedRouteSnapshot,
CanActivate,
RouterStateSnapshot,
} from '@angular/router';
import { CanActivate } from '@angular/router';
import { UserService } from '../../user/services/user.service';
import { environment } from '../../../../environments/environment';

Expand All @@ -30,11 +26,15 @@ export class AuthGuard implements CanActivate {
return true;
},
() => {
window.location.href = environment.projectaanvraagDashboardUrl;
window.location.href = environment.platformIsLive
? environment.platformUrl
: environment.projectaanvraagDashboardUrl;
}
),
catchError((error) => {

Check warning on line 34 in src/app/core/route/guard/auth-guard.service.ts

View workflow job for this annotation

GitHub Actions / lint

'error' is defined but never used
window.location.href = environment.projectaanvraagDashboardUrl;
window.location.href = environment.platformIsLive
? environment.platformUrl
: environment.projectaanvraagDashboardUrl;
return observableOf(false);
})
);
Expand Down
6 changes: 5 additions & 1 deletion src/app/core/topbar/components/topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
<button class="btn btn-outline-secondary" ngbDropdownToggle>
<span class="hidden-lg-down"> {{ user.displayName }}</span>
</button>
<div ngbDropdownMenu class="dropdown-menu dropdown-menu-right">
<div
*ngIf="!platformIsLive"
ngbDropdownMenu
class="dropdown-menu dropdown-menu-right"
>
<button ngbDropdownItem class="dropdown-item" (click)="logout()">
{{ 'TOPBAR_USER_MENU_BUTTON_LOGOUT' | translate }}
</button>
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/topbar/components/topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export class TopbarComponent implements OnInit, OnDestroy {
*/
private dynamicComponentSubscriptions: any = {};

private platformIsLive: boolean = environment.platformIsLive;

/**
* TopbarComponent constructor
* @param userService
Expand Down

0 comments on commit 5433d04

Please sign in to comment.