[ADF-2569] fix reload app.config.json (#3124)

* fix reload app.config.json

* improve style mobile
fix test

* test karma setup update

* fix core providers test

* remove unused providers

* use mock api in service test

* skip test in the wrong place

* remove comma

* remove fdescribe
This commit is contained in:
Eugenio Romano
2018-03-28 11:01:04 +01:00
committed by Denys Vuika
parent 21b8cd30ce
commit 9e2969b955
93 changed files with 228 additions and 436 deletions

View File

@@ -28,7 +28,7 @@ import { StorageService } from './storage.service';
@Injectable()
export class AlfrescoApiService {
private alfrescoApi: AlfrescoApi;
protected alfrescoApi: AlfrescoApi;
getInstance(): AlfrescoApi {
return this.alfrescoApi;
@@ -74,13 +74,21 @@ export class AlfrescoApiService {
return this.getInstance().core.classesApi;
}
constructor(private appConfig: AppConfigService,
private storage: StorageService) {
this.reset();
constructor(protected appConfig: AppConfigService,
protected storage: StorageService) {
}
reset() {
async load() {
await this.appConfig.load().then(() => {
this.initAlfrescoApi();
});
}
async reset() {
this.initAlfrescoApi();
}
protected initAlfrescoApi() {
this.alfrescoApi = <AlfrescoApi> new alfrescoApi({
provider: this.storage.getItem('AUTH_TYPE'),
ticketEcm: this.storage.getItem('ticket-ECM'),
@@ -89,7 +97,7 @@ export class AlfrescoApiService {
hostBpm: this.appConfig.get<string>('bpmHost'),
contextRoot: 'alfresco',
disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true',
oauth2 : this.appConfig.get<any>('oauth2')
oauth2: this.appConfig.get<any>('oauth2')
});
}
}