mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-20109] Move alfresco js-API and alfrescoapi service out from the core (#9317)
* AAE-20109 Remove alfrescoapiservice from core * fix after rebase * [AAe-12502] Post-rebase fix * [AAE-12502] Add unit test fix --------- Co-authored-by: Bartosz Sekula <Bartosz.Sekula@hyland.com> Co-authored-by: MichalKinas <michal.kinas@hyland.com>
This commit is contained in:
@@ -63,7 +63,6 @@ export enum Status {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppConfigService {
|
||||
|
||||
config: any = {
|
||||
application: {
|
||||
name: 'Alfresco ADF Application'
|
||||
@@ -97,11 +96,10 @@ export class AppConfigService {
|
||||
* @returns Property value, when loaded
|
||||
*/
|
||||
select(property: string): Observable<any> {
|
||||
return this.onLoadSubject
|
||||
.pipe(
|
||||
map((config) => ObjectUtils.getValue(config, property)),
|
||||
distinctUntilChanged()
|
||||
);
|
||||
return this.onLoadSubject.pipe(
|
||||
map((config) => ObjectUtils.getValue(config, property)),
|
||||
distinctUntilChanged()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,9 +168,7 @@ export class AppConfigService {
|
||||
protected onDataLoaded() {
|
||||
this.onLoadSubject.next(this.config);
|
||||
|
||||
this.extensionService.setup$
|
||||
.pipe(take(1))
|
||||
.subscribe((config) => this.onExtensionsLoaded(config));
|
||||
this.extensionService.setup$.pipe(take(1)).subscribe((config) => this.onExtensionsLoaded(config));
|
||||
}
|
||||
|
||||
protected onExtensionsLoaded(config: ExtensionConfig) {
|
||||
@@ -227,20 +223,18 @@ export class AppConfigService {
|
||||
* @param hostIdp host address
|
||||
* @returns Discovery configuration
|
||||
*/
|
||||
loadWellKnown(hostIdp: string): Promise<OpenidConfiguration> {
|
||||
loadWellKnown(hostIdp: string): Promise<OpenidConfiguration> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http
|
||||
.get<OpenidConfiguration>(`${hostIdp}/.well-known/openid-configuration`)
|
||||
.subscribe({
|
||||
next: (res: OpenidConfiguration) => {
|
||||
resolve(res);
|
||||
},
|
||||
error: (err: any) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('hostIdp not correctly configured or unreachable');
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
this.http.get<OpenidConfiguration>(`${hostIdp}/.well-known/openid-configuration`).subscribe({
|
||||
next: (res: OpenidConfiguration) => {
|
||||
resolve(res);
|
||||
},
|
||||
error: (err: any) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('hostIdp not correctly configured or unreachable');
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -273,5 +267,4 @@ export class AppConfigService {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user