2019-12-18 16:14:21 +01:00
|
|
|
import {Page} from './page';
|
|
|
|
import {Entity} from './entity';
|
|
|
|
|
2020-11-25 18:12:31 +01:00
|
|
|
export class Portal {
|
2019-12-18 16:14:21 +01:00
|
|
|
_id: string;
|
|
|
|
pid: string;
|
|
|
|
name: string;
|
2020-09-24 13:18:24 +02:00
|
|
|
type: string;
|
2020-10-30 15:01:44 +01:00
|
|
|
piwik:number;
|
2021-10-21 11:39:27 +02:00
|
|
|
twitterAccount: string;
|
2019-12-18 16:14:21 +01:00
|
|
|
entities: string[] | Entity[];
|
|
|
|
pages: string[] | Page[];
|
2023-07-13 12:44:19 +02:00
|
|
|
static: boolean = false;
|
2020-11-25 18:12:31 +01:00
|
|
|
|
|
|
|
private static getmockPortalInfo():any{
|
|
|
|
return {
|
|
|
|
"pid": "",
|
|
|
|
"name": "",
|
|
|
|
"type": "",
|
|
|
|
"pages": [
|
|
|
|
//deposit
|
|
|
|
{
|
|
|
|
"route": "/participate/deposit/search",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/participate/deposit/learn-how",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
//home
|
|
|
|
{
|
|
|
|
"route": "/",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
//claims
|
|
|
|
{
|
|
|
|
"route": "/participate/claim",
|
|
|
|
"isEnabled": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/myclaims",
|
|
|
|
"isEnabled": true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/claims",
|
|
|
|
"isEnabled": true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/participate/direct-claim",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
// /advanced search
|
|
|
|
{
|
|
|
|
"route": "/search/advanced/dataproviders",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
2022-05-13 14:57:31 +02:00
|
|
|
{
|
|
|
|
"route": "/search/advanced/services",
|
2023-07-13 13:18:17 +02:00
|
|
|
"isEnabled": true
|
2022-05-13 14:57:31 +02:00
|
|
|
},
|
2020-11-25 18:12:31 +01:00
|
|
|
{
|
|
|
|
"route": "/search/advanced/organizations",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/advanced/projects",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/advanced/research-outcomes",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
//search all
|
|
|
|
|
|
|
|
{
|
|
|
|
"route": "/search/find",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
//simple search
|
|
|
|
{
|
|
|
|
"route": "/search/find/dataproviders",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
2022-05-13 14:57:31 +02:00
|
|
|
{
|
|
|
|
"route": "/search/find/services",
|
2023-07-13 13:18:17 +02:00
|
|
|
"isEnabled": true
|
2022-05-13 14:57:31 +02:00
|
|
|
},
|
2020-11-25 18:12:31 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
"route": "/search/find/organizations",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"route": "/search/find/projects",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"route": "/search/find/research-outcomes",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
//landing
|
|
|
|
{
|
|
|
|
"route": "/search/dataprovider",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
"route": "/search/organization",
|
|
|
|
"isEnabled": true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/other",
|
|
|
|
"isEnabled": true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/project",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/project-report",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/publication",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/dataset",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/content-providers",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/software",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/search/organization",
|
|
|
|
"isEnabled": true
|
2021-01-04 12:19:39 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"route": "/develop",
|
|
|
|
"isEnabled": true
|
2020-11-25 18:12:31 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"entities": [
|
|
|
|
{
|
|
|
|
"pid": "publication",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pid": "dataset",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pid": "software",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pid": "project",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pid": "organization",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pid": "datasource",
|
|
|
|
"isEnabled": true
|
|
|
|
},
|
2022-05-13 14:57:31 +02:00
|
|
|
{
|
|
|
|
"pid": "service",
|
2023-07-13 13:18:17 +02:00
|
|
|
"isEnabled": true
|
2022-05-13 14:57:31 +02:00
|
|
|
},
|
2020-11-25 18:12:31 +01:00
|
|
|
{
|
|
|
|
"pid": "orp",
|
|
|
|
"isEnabled": true
|
|
|
|
}
|
|
|
|
],
|
2023-07-13 12:44:19 +02:00
|
|
|
"static": true
|
|
|
|
};
|
2020-11-25 18:12:31 +01:00
|
|
|
};
|
|
|
|
|
2023-07-24 18:56:51 +02:00
|
|
|
public static getMockCommunityInfo(pid: string, name:string, disabledEntities:string[],disabledPages:string[]): any {
|
2020-11-25 18:12:31 +01:00
|
|
|
let communityInfo = Object.assign({}, Portal.getmockPortalInfo());
|
2022-10-03 19:25:37 +02:00
|
|
|
communityInfo.pid = pid;
|
2023-07-24 18:56:51 +02:00
|
|
|
communityInfo.name = name;
|
2020-11-25 18:12:31 +01:00
|
|
|
for(let disabledPage of disabledPages) {
|
|
|
|
for (var i = 0; i < communityInfo.pages.length; i++) {
|
|
|
|
if (communityInfo.pages[i].route == disabledPage) {
|
|
|
|
communityInfo.pages.splice(i, 1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for(let disableEntity of disabledEntities){
|
|
|
|
for (var i = 0; i < communityInfo.entities.length; i++) {
|
|
|
|
if (communityInfo.entities[i].pid == disableEntity) {
|
|
|
|
communityInfo.entities.splice(i, 1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return communityInfo;
|
|
|
|
}
|
2019-12-18 16:14:21 +01:00
|
|
|
}
|
|
|
|
|
2020-09-24 13:18:24 +02:00
|
|
|
export interface CheckPortal {
|
2021-01-26 17:21:55 +01:00
|
|
|
portal: Portal;
|
2019-12-18 16:14:21 +01:00
|
|
|
checked: boolean;
|
|
|
|
}
|
2020-11-25 18:12:31 +01:00
|
|
|
|