frontend: allow using leave-redirect-url param also in embedded mode
This commit is contained in:
parent
e611c24231
commit
51a379af33
@ -108,15 +108,14 @@ export class DisconnectedComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Handles the back button click event and navigates accordingly
|
* Handles the back button click event and navigates accordingly
|
||||||
* If in embedded mode, it closes the WebComponentManagerService
|
* If in embedded mode, it closes the WebComponentManagerService
|
||||||
* If in standalone mode, it navigates to the redirect URL or to the admin console
|
* If the redirect URL is set, it navigates to that URL
|
||||||
|
* If in standalone mode without a redirect URL, it navigates to the admin console
|
||||||
*/
|
*/
|
||||||
async goBack() {
|
async goBack() {
|
||||||
if (this.appDataService.isEmbeddedMode()) {
|
if (this.appDataService.isEmbeddedMode()) {
|
||||||
this.wcManagerService.close();
|
this.wcManagerService.close();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Standalone mode handling
|
|
||||||
const redirectTo = this.navService.getLeaveRedirectURL();
|
const redirectTo = this.navService.getLeaveRedirectURL();
|
||||||
if (redirectTo) {
|
if (redirectTo) {
|
||||||
// Navigate to the specified redirect URL
|
// Navigate to the specified redirect URL
|
||||||
@ -124,7 +123,9 @@ export class DisconnectedComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.appDataService.isStandaloneMode()) {
|
||||||
// Navigate to the admin console
|
// Navigate to the admin console
|
||||||
await this.navService.navigateTo('/overview', undefined, true);
|
await this.navService.navigateTo('/overview', undefined, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -119,15 +119,14 @@ export class ErrorComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Handles the back button click event and navigates accordingly
|
* Handles the back button click event and navigates accordingly
|
||||||
* If in embedded mode, it closes the WebComponentManagerService
|
* If in embedded mode, it closes the WebComponentManagerService
|
||||||
* If in standalone mode, it navigates to the redirect URL or to the admin console
|
* If the redirect URL is set, it navigates to that URL
|
||||||
|
* If in standalone mode without a redirect URL, it navigates to the admin console
|
||||||
*/
|
*/
|
||||||
async goBack() {
|
async goBack() {
|
||||||
if (this.appDataService.isEmbeddedMode()) {
|
if (this.appDataService.isEmbeddedMode()) {
|
||||||
this.wcManagerService.close();
|
this.wcManagerService.close();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Standalone mode handling
|
|
||||||
const redirectTo = this.navService.getLeaveRedirectURL();
|
const redirectTo = this.navService.getLeaveRedirectURL();
|
||||||
if (redirectTo) {
|
if (redirectTo) {
|
||||||
// Navigate to the specified redirect URL
|
// Navigate to the specified redirect URL
|
||||||
@ -135,7 +134,9 @@ export class ErrorComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.appDataService.isStandaloneMode()) {
|
||||||
// Navigate to the admin console
|
// Navigate to the admin console
|
||||||
await this.navService.navigateTo('/overview', undefined, true);
|
await this.navService.navigateTo('/overview', undefined, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -195,15 +195,14 @@ export class VideoRoomComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Handles the back button click event and navigates accordingly
|
* Handles the back button click event and navigates accordingly
|
||||||
* If in embedded mode, it closes the WebComponentManagerService
|
* If in embedded mode, it closes the WebComponentManagerService
|
||||||
* If in standalone mode, it navigates to the redirect URL or to the rooms page
|
* If the redirect URL is set, it navigates to that URL
|
||||||
|
* If in standalone mode without a redirect URL, it navigates to the rooms page
|
||||||
*/
|
*/
|
||||||
async goBack() {
|
async goBack() {
|
||||||
if (this.appDataService.isEmbeddedMode()) {
|
if (this.appDataService.isEmbeddedMode()) {
|
||||||
this.wcManagerService.close();
|
this.wcManagerService.close();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Standalone mode handling
|
|
||||||
const redirectTo = this.navigationService.getLeaveRedirectURL();
|
const redirectTo = this.navigationService.getLeaveRedirectURL();
|
||||||
if (redirectTo) {
|
if (redirectTo) {
|
||||||
// Navigate to the specified redirect URL
|
// Navigate to the specified redirect URL
|
||||||
@ -211,9 +210,11 @@ export class VideoRoomComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.appDataService.isStandaloneMode()) {
|
||||||
// Navigate to rooms page
|
// Navigate to rooms page
|
||||||
await this.navigationService.navigateTo('/rooms');
|
await this.navigationService.navigateTo('/rooms');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async submitAccessRoom() {
|
async submitAccessRoom() {
|
||||||
const { valid, value } = this.participantForm;
|
const { valid, value } = this.participantForm;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { Location } from '@angular/common';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Params, Router, UrlTree } from '@angular/router';
|
import { Params, Router, UrlTree } from '@angular/router';
|
||||||
import { ErrorReason } from '@lib/models';
|
import { ErrorReason } from '@lib/models';
|
||||||
import { SessionStorageService } from '@lib/services';
|
import { AppDataService, SessionStorageService } from '@lib/services';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -13,7 +13,8 @@ export class NavigationService {
|
|||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
private sessionStorageService: SessionStorageService
|
private sessionStorageService: SessionStorageService,
|
||||||
|
private appDataService: AppDataService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
setLeaveRedirectUrl(leaveRedirectUrl: string): void {
|
setLeaveRedirectUrl(leaveRedirectUrl: string): void {
|
||||||
@ -57,7 +58,13 @@ export class NavigationService {
|
|||||||
const isExternalURL = /^https?:\/\//.test(url);
|
const isExternalURL = /^https?:\/\//.test(url);
|
||||||
if (isExternalURL) {
|
if (isExternalURL) {
|
||||||
console.log('Redirecting to external URL:', url);
|
console.log('Redirecting to external URL:', url);
|
||||||
|
|
||||||
|
if (this.appDataService.isEmbeddedMode()) {
|
||||||
|
// Change the top window location if in embedded mode
|
||||||
|
window.top!.location.href = url;
|
||||||
|
} else {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Redirecting to internal route:', url);
|
console.log('Redirecting to internal route:', url);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user