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