mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[AAE-6150] User info disappears in every click (#7328)
* [AAE-6150] userinfo remove debounce for every reload * [ci:force] force e2e
This commit is contained in:
parent
6c4650785c
commit
08b9cd144f
@ -27,7 +27,7 @@ import { IdentityUserService } from '../../services/identity-user.service';
|
|||||||
import { BpmUserModel } from '../../models/bpm-user.model';
|
import { BpmUserModel } from '../../models/bpm-user.model';
|
||||||
import { EcmUserModel } from '../../models/ecm-user.model';
|
import { EcmUserModel } from '../../models/ecm-user.model';
|
||||||
import { UserInfoComponent } from './user-info.component';
|
import { UserInfoComponent } from './user-info.component';
|
||||||
import { of, timer } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { setupTestBed } from '../../testing/setup-test-bed';
|
import { setupTestBed } from '../../testing/setup-test-bed';
|
||||||
import { CoreTestingModule } from '../../testing/core.testing.module';
|
import { CoreTestingModule } from '../../testing/core.testing.module';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@ -88,7 +88,7 @@ describe('User info component', () => {
|
|||||||
|
|
||||||
async function whenFixtureReady() {
|
async function whenFixtureReady() {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
await timer(500).toPromise();
|
await fixture.whenStable();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import { EcmUserService } from '../../services/ecm-user.service';
|
|||||||
import { IdentityUserService } from '../../services/identity-user.service';
|
import { IdentityUserService } from '../../services/identity-user.service';
|
||||||
import { of, Observable, Subject } from 'rxjs';
|
import { of, Observable, Subject } from 'rxjs';
|
||||||
import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||||
import { debounceTime, startWith, takeUntil } from 'rxjs/operators';
|
import { filter, takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-userinfo',
|
selector: 'adf-userinfo',
|
||||||
@ -75,15 +75,15 @@ export class UserInfoComponent implements OnInit, OnDestroy {
|
|||||||
private bpmUserService: BpmUserService,
|
private bpmUserService: BpmUserService,
|
||||||
private identityUserService: IdentityUserService,
|
private identityUserService: IdentityUserService,
|
||||||
private authService: AuthenticationService) {
|
private authService: AuthenticationService) {
|
||||||
|
this.authService.onLogin
|
||||||
|
.pipe(
|
||||||
|
filter(() => this.authService.isKerberosEnabled()),
|
||||||
|
takeUntil(this.destroy$)
|
||||||
|
).subscribe(() => this.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.authService.onLogin
|
this.getUserInfo();
|
||||||
.pipe(
|
|
||||||
startWith(this.authService.isLoggedIn()),
|
|
||||||
debounceTime(500),
|
|
||||||
takeUntil(this.destroy$)
|
|
||||||
).subscribe(() => this.getUserInfo());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
@ -94,7 +94,7 @@ export class DropdownCloudWidgetComponent extends WidgetComponent implements OnI
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof opt1 === 'object' && typeof opt2 === 'object') {
|
if (typeof opt1 === 'object' && typeof opt2 === 'object') {
|
||||||
return opt1.id === opt2.id && opt1.name === opt2.name;
|
return opt1.id === opt2.id || opt1.name === opt2.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return opt1 === opt2;
|
return opt1 === opt2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user