mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4457] StorageService should be independent of AppConfigService (#4712)
* [ADF-4457] StorageService should be independent of AppConfigService * [ADF-4457] Fix e2e tests * [ADF-4457] Fix e2e tests * [ADF-4457] Improve storage service workflow * Fix linting * Fix unit tests * Fix e2e test * Add missing class to constructor * Fix e2e test * Rebase branch * Improve unit test * fix test
This commit is contained in:
committed by
Eugenio Romano
parent
90c403ae9e
commit
5c07d5b3e6
@@ -25,8 +25,9 @@ import {
|
||||
} from '@alfresco/js-api';
|
||||
import { AlfrescoApiCompatibility, AlfrescoApiConfig } from '@alfresco/js-api';
|
||||
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { Subject, Observable } from 'rxjs';
|
||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||
import { StorageService } from './storage.service';
|
||||
|
||||
/* tslint:disable:adf-file-name */
|
||||
|
||||
@@ -39,6 +40,9 @@ export class AlfrescoApiService {
|
||||
*/
|
||||
nodeUpdated = new Subject<Node>();
|
||||
|
||||
protected alfrescoApiInitializedSubject: Subject<any>;
|
||||
alfrescoApiInitialized: Observable<any>;
|
||||
|
||||
protected alfrescoApi: AlfrescoApiCompatibility;
|
||||
|
||||
lastConfig: AlfrescoApiConfig;
|
||||
@@ -95,12 +99,18 @@ export class AlfrescoApiService {
|
||||
return this.getInstance().core.groupsApi;
|
||||
}
|
||||
|
||||
constructor(protected appConfig: AppConfigService) {
|
||||
constructor(
|
||||
protected appConfig: AppConfigService,
|
||||
protected storageService: StorageService) {
|
||||
this.alfrescoApiInitializedSubject = new Subject();
|
||||
this.alfrescoApiInitialized = this.alfrescoApiInitializedSubject.asObservable();
|
||||
}
|
||||
|
||||
async load() {
|
||||
await this.appConfig.load().then(() => {
|
||||
this.storageService.prefix = this.appConfig.get<string>(AppConfigValues.STORAGE_PREFIX, '');
|
||||
this.initAlfrescoApi();
|
||||
this.alfrescoApiInitializedSubject.next();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user