Skip to content

Commit 4d7e7bd

Browse files
committed
[NAE-1678] User impersonation
- update according to PR comments
1 parent 537f78f commit 4d7e7bd

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

projects/nae-example-app/src/app/doc/impersonation-demo/impersonation-demo.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, OnInit} from '@angular/core';
2-
import {ImpersonationService, ImpersonationUserSelectService} from 'netgrif-components-core';
2+
import {ImpersonationService, ImpersonationUserSelectService, LoggerService} from '@netgrif/components-core';
33

44
@Component({
55
selector: 'nae-app-impersonation-demo',
@@ -11,9 +11,10 @@ export class ImpersonationDemoComponent {
1111
constructor(
1212
private _impersonationSelect: ImpersonationUserSelectService,
1313
private _impersonation: ImpersonationService,
14+
private _log: LoggerService,
1415
) {
1516
this._impersonation.impersonating$.subscribe((isImpersonating: boolean) => {
16-
console.log("Is impersonating " + isImpersonating);
17+
this._log.debug("Is impersonating " + isImpersonating);
1718
});
1819
}
1920

projects/netgrif-components-core/src/lib/impersonation/services/impersonation.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class ImpersonationService extends AbstractResourceService implements OnD
2727
protected _snackbar: SnackBarService,
2828
protected _filter: FilterRepository,
2929
protected _log: LoggerService,
30-
private _translate: TranslateService) {
30+
protected _translate: TranslateService) {
3131
super('impersonation', provider, _configService);
3232
this._sub = this._userService.user$.subscribe(user => this._resolveUserChange(user));
3333
}

projects/netgrif-components/src/lib/navigation/quick-panel/components/impersonate-quick-panel/impersonate-quick-panel.component.spec.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ import {
66
ConfigurationService,
77
MaterialModule,
88
MockAuthenticationMethodService,
9-
SnackBarService,
9+
SnackBarService, TestConfigurationService,
1010
TranslateLibModule
11-
} from 'netgrif-components-core';
12-
import {
13-
NaeExampleAppConfigurationService
14-
} from '../../../../../../../nae-example-app/src/app/nae-example-app-configuration.service';
11+
} from '@netgrif/components-core';
1512
import {CommonModule} from '@angular/common';
1613
import {RouterTestingModule} from '@angular/router/testing';
1714
import {HttpClientTestingModule} from '@angular/common/http/testing';
@@ -35,7 +32,7 @@ describe('ImpersonateQuickPanelComponent', () => {
3532
providers: [
3633
SnackBarService,
3734
{provide: AuthenticationMethodService, useClass: MockAuthenticationMethodService},
38-
{provide: ConfigurationService, useClass: NaeExampleAppConfigurationService},
35+
{provide: ConfigurationService, useClass: TestConfigurationService},
3936
]
4037
})
4138
.compileComponents();

projects/netgrif-components/src/lib/navigation/quick-panel/components/impersonate-quick-panel/impersonate-quick-panel.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {ImpersonationService, ImpersonationUserSelectService, UserService} from 'netgrif-components-core';
2+
import {ImpersonationService, ImpersonationUserSelectService, UserService} from '@netgrif/components-core';
33

44
@Component({
55
selector: 'nc-impersonate-quick-panel',

projects/netgrif-components/src/lib/side-menu/content-components/user-impersonate/user-impersonate.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// SimpleFilter,
1212
// SnackBarService,
1313
// TranslateLibModule
14-
// } from 'netgrif-components-core';
14+
// } from '@netgrif/components-core';
1515
// import {
1616
// NaeExampleAppConfigurationService
1717
// } from '../../../../../../nae-example-app/src/app/nae-example-app-configuration.service';

0 commit comments

Comments
 (0)