mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
Merge remote-tracking branch 'origin/main' into w2p-93219_Consolidate-all-initialization-in-a-single-Service
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { NgbModal, NgbModalConfig } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { HostWindowResizeAction } from './shared/host-window.actions';
|
||||
import { HostWindowState } from './shared/search/host-window.reducer';
|
||||
@@ -31,6 +31,7 @@ import { models } from './core/core.module';
|
||||
import { ThemeService } from './shared/theme-support/theme.service';
|
||||
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
|
||||
import { distinctNext } from './core/shared/distinct-next';
|
||||
import { ModalBeforeDismiss } from './shared/interfaces/modal-before-dismiss.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-app',
|
||||
@@ -73,6 +74,7 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||
private router: Router,
|
||||
private cssService: CSSVariableService,
|
||||
private modalService: NgbModal,
|
||||
private modalConfig: NgbModalConfig,
|
||||
) {
|
||||
this.notificationOptions = environment.notifications;
|
||||
|
||||
@@ -89,6 +91,16 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
/** Implement behavior for interface {@link ModalBeforeDismiss} */
|
||||
this.modalConfig.beforeDismiss = async function () {
|
||||
if (typeof this?.componentInstance?.beforeDismiss === 'function') {
|
||||
return this.componentInstance.beforeDismiss();
|
||||
}
|
||||
|
||||
// fall back to default behavior
|
||||
return true;
|
||||
};
|
||||
|
||||
this.isAuthBlocking$ = this.store.pipe(
|
||||
select(isAuthenticationBlocking),
|
||||
distinctUntilChanged()
|
||||
|
Reference in New Issue
Block a user