mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Denys Vuika
parent
21b8cd30ce
commit
9e2969b955
@@ -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')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user