[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:
Grzegorz Jaśkowski
2025-09-01 11:28:41 +02:00
committed by GitHub
parent dabab63f78
commit 04d488b8ea
23 changed files with 51 additions and 253 deletions
@@ -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) {