Add static configuration in configuration service
This commit is contained in:
parent
46b3e937bf
commit
8b57fae585
|
@ -25,10 +25,17 @@ export class ConfigurationService {
|
|||
}
|
||||
}
|
||||
|
||||
public initStaticPortal(portal: Portal) {
|
||||
this.promise = new Promise<void>(resolve => {
|
||||
this.portal.next(portal);
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
|
||||
public initPortal(properties: EnvProperties, pid: string) {
|
||||
if (pid == null) return;
|
||||
if (pid == null || this.portal?.getValue()?.static) return;
|
||||
let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + pid + "/full";
|
||||
this.promise = new Promise<void>((resolve => {
|
||||
this.promise = new Promise<void>(resolve => {
|
||||
this.sub = this.http.get<Portal>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url).subscribe(
|
||||
(portal: Portal) => {
|
||||
this.portal.next(portal);
|
||||
|
@ -38,8 +45,7 @@ export class ConfigurationService {
|
|||
this.portal.next(null);
|
||||
resolve();
|
||||
});
|
||||
}));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public get portalAsObservable(): Observable<Portal> {
|
||||
|
|
|
@ -10,6 +10,7 @@ export class Portal {
|
|||
twitterAccount: string;
|
||||
entities: string[] | Entity[];
|
||||
pages: string[] | Page[];
|
||||
static: boolean = false;
|
||||
|
||||
private static getmockPortalInfo():any{
|
||||
return {
|
||||
|
@ -56,7 +57,7 @@ export class Portal {
|
|||
},
|
||||
{
|
||||
"route": "/search/advanced/services",
|
||||
"isEnabled": true
|
||||
"isEnabled": false
|
||||
},
|
||||
{
|
||||
"route": "/search/advanced/organizations",
|
||||
|
@ -83,7 +84,7 @@ export class Portal {
|
|||
},
|
||||
{
|
||||
"route": "/search/find/services",
|
||||
"isEnabled": true
|
||||
"isEnabled": false
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -174,14 +175,15 @@ export class Portal {
|
|||
},
|
||||
{
|
||||
"pid": "service",
|
||||
"isEnabled": true
|
||||
"isEnabled": false
|
||||
},
|
||||
{
|
||||
"pid": "orp",
|
||||
"isEnabled": true
|
||||
}
|
||||
],
|
||||
};;
|
||||
"static": true
|
||||
};
|
||||
};
|
||||
|
||||
public static getMockCommunityInfo(pid: string, disabledEntities:string[],disabledPages:string[]): any {
|
||||
|
|
Loading…
Reference in New Issue