[ADF-5237] Unexclude C362240 and C362241 (#6137)

* [ADF-5237] Unexclude C362240 and C362241

* Fix initialization bug
This commit is contained in:
davidcanonieto
2020-09-22 10:52:41 +02:00
committed by GitHub
parent e98b40c37d
commit 3b02233481
3 changed files with 18 additions and 38 deletions

View File

@@ -16,11 +16,9 @@
*/
import { Injectable } from '@angular/core';
import { AlfrescoApiService } from './alfresco-api.service';
import { filter } from 'rxjs/operators';
import { DiscoveryApiService } from './discovery-api.service';
import { VersionModel, EcmProductVersionModel } from '../models/product-version.model';
import { AuthenticationService } from './authentication.service';
import { filter } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
@@ -28,23 +26,10 @@ import { AuthenticationService } from './authentication.service';
export class VersionCompatibilityService {
private acsVersion: VersionModel;
constructor(
private alfrescoApiService: AlfrescoApiService,
private authService: AuthenticationService,
private discoveryApiService: DiscoveryApiService
) {
this.alfrescoApiService.alfrescoApiInitialized
.pipe(filter(status => status))
.subscribe(this.initCompatibilityVersion.bind(this));
}
private initCompatibilityVersion() {
if (this.authService.isEcmLoggedIn()) {
this.discoveryApiService.getEcmProductInfo().toPromise().then(
(acsInfo: EcmProductVersionModel) => {
this.acsVersion = acsInfo.version;
});
}
constructor(private discoveryApiService: DiscoveryApiService) {
this.discoveryApiService.ecmProductInfo$
.pipe(filter(acsInfo => !!acsInfo))
.subscribe((acsInfo: EcmProductVersionModel) => this.acsVersion = acsInfo.version);
}
getAcsVersion(): VersionModel {