mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-9768] remove deprecated methods from auth related components (#11031)
* [ACS-9768] remove deprecated methods from auth related components * [ACS-9768] remove deprecated method, adjust unit tests * [ACS-9768] fix sonar cloud issues * [ACS-9768] fix auth mocks * [ACS-9768] fix sonar cloud alerts * [ACS-9768] update method name in docs
This commit is contained in:
@@ -38,11 +38,14 @@ export class DiscoveryApiService {
|
||||
*/
|
||||
ecmProductInfo$ = new Subject<RepositoryInfo>();
|
||||
|
||||
constructor(private authenticationService: AuthenticationService, private alfrescoApiService: AlfrescoApiService) {
|
||||
constructor(
|
||||
private readonly authenticationService: AuthenticationService,
|
||||
private readonly alfrescoApiService: AlfrescoApiService
|
||||
) {
|
||||
this.authenticationService.onLogin.subscribe(() => {
|
||||
this.alfrescoApiService.alfrescoApiInitialized
|
||||
.pipe(
|
||||
filter(() => this.authenticationService.isEcmLoggedIn()),
|
||||
filter(() => this.authenticationService.isLoggedIn()),
|
||||
take(1),
|
||||
switchMap(() => this.getEcmProductInfo())
|
||||
)
|
||||
|
||||
@@ -36,7 +36,6 @@ class AlfrescoApiMock {
|
||||
isOauthConfiguration = () => true;
|
||||
isLoggedIn = () => true;
|
||||
isEcmConfiguration = () => true;
|
||||
isEcmLoggedIn = () => true;
|
||||
}
|
||||
|
||||
export class ContentApiMock {
|
||||
|
||||
@@ -50,7 +50,7 @@ describe('NodeDownloadDirective', () => {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => Promise.resolve()
|
||||
},
|
||||
isEcmLoggedIn: jasmine.createSpy('isEcmLoggedIn'),
|
||||
isLoggedIn: jasmine.createSpy('isLoggedIn'),
|
||||
reply: jasmine.createSpy('reply')
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ describe('SearchControlComponent', () => {
|
||||
searchService = TestBed.inject(SearchService);
|
||||
authService = TestBed.inject(AuthenticationService);
|
||||
userPreferencesService = TestBed.inject(UserPreferencesService);
|
||||
spyOn(authService, 'isEcmLoggedIn').and.returnValue(true);
|
||||
spyOn(authService, 'isLoggedIn').and.returnValue(true);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
||||
|
||||
@@ -109,13 +109,16 @@ export class SearchControlComponent {
|
||||
noSearchResultTemplate: TemplateRef<any> = null;
|
||||
searchTerm: string = '';
|
||||
|
||||
constructor(public authService: AuthenticationService, private thumbnailService: ThumbnailService) {}
|
||||
constructor(
|
||||
public authService: AuthenticationService,
|
||||
private readonly thumbnailService: ThumbnailService
|
||||
) {}
|
||||
|
||||
isNoSearchTemplatePresent(): boolean {
|
||||
return !!this.emptySearchTemplate;
|
||||
}
|
||||
isLoggedIn(): boolean {
|
||||
return this.authService.isEcmLoggedIn();
|
||||
return this.authService.isLoggedIn();
|
||||
}
|
||||
|
||||
inputChange(value: string) {
|
||||
|
||||
Reference in New Issue
Block a user