mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
79700: Feedback 2021-06-15 applied
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
import { map, take } from 'rxjs/operators';
|
||||
import { Component, Inject, OnInit, Optional, Input } from '@angular/core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Component, Inject, OnInit, Input } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
combineLatest as combineLatestObservable,
|
||||
Observable,
|
||||
of
|
||||
} from 'rxjs';
|
||||
import { combineLatest as combineLatestObservable, Observable, of } from 'rxjs';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
|
||||
@@ -23,11 +18,7 @@ import { HostWindowService } from '../shared/host-window.service';
|
||||
import { ThemeConfig } from '../../config/theme.model';
|
||||
import { Angulartics2DSpace } from '../statistics/angulartics/dspace-provider';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { LocaleService } from '../core/locale/locale.service';
|
||||
import { KlaroService } from '../shared/cookies/klaro.service';
|
||||
import { slideSidebarPadding } from '../shared/animations/slide';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { IdleModalComponent } from '../shared/idle-modal/idle-modal.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-root',
|
||||
@@ -54,11 +45,6 @@ export class RootComponent implements OnInit {
|
||||
*/
|
||||
@Input() shouldShowRouteLoader: boolean;
|
||||
|
||||
/**
|
||||
* Whether or not the idle modal is is currently open
|
||||
*/
|
||||
idleModalOpen: boolean;
|
||||
|
||||
constructor(
|
||||
@Inject(NativeWindowService) private _window: NativeWindowRef,
|
||||
private translate: TranslateService,
|
||||
@@ -70,10 +56,7 @@ export class RootComponent implements OnInit {
|
||||
private router: Router,
|
||||
private cssService: CSSVariableService,
|
||||
private menuService: MenuService,
|
||||
private windowService: HostWindowService,
|
||||
private localeService: LocaleService,
|
||||
@Optional() private cookiesService: KlaroService,
|
||||
private modalService: NgbModal
|
||||
private windowService: HostWindowService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -88,20 +71,5 @@ export class RootComponent implements OnInit {
|
||||
.pipe(
|
||||
map(([collapsed, mobile]) => collapsed || mobile)
|
||||
);
|
||||
|
||||
observableCombineLatest([this.authService.isUserIdle(), this.authService.isAuthenticated()])
|
||||
.subscribe(([userIdle, authenticated]) => {
|
||||
if (userIdle && authenticated) {
|
||||
if (!this.idleModalOpen) {
|
||||
const modalRef = this.modalService.open(IdleModalComponent);
|
||||
this.idleModalOpen = true;
|
||||
modalRef.componentInstance.response.pipe(take(1)).subscribe((closed: boolean) => {
|
||||
if (closed) {
|
||||
this.idleModalOpen = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user