mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5237] Unexclude C362240 and C362241 (#6137)
* [ADF-5237] Unexclude C362240 and C362241 * Fix initialization bug
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user