openaire-library/connect/community/communityInfo.ts

38 lines
1.2 KiB
TypeScript
Raw Normal View History

import {StringUtils} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment";
import {SelectionCriteria} from "../../utils/entities/contentProvider";
export class CommunityInfo {
title: string;
shortTitle:string;
communityId: string;
queryId: string;
type: string;
/** @warning Use pipe in HTML or StringUtils.getLogoUrl in components */
logoUrl: string;
description: string;
managers: string[];
date:Date;
subjects: string[];
status:string;
zenodoCommunity:string;
isUpload: boolean;
isSubscribed: boolean;
isManager: boolean;
fos: string[] = [];
sdg: string[] = []
selectionCriteria: SelectionCriteria;
public static checkIsUpload(response: CommunityInfo | CommunityInfo[]): any | any[] {
if (Array.isArray(response)) {
response.forEach(value => {
value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl);
});
} else {
response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl);
}
return response;
}
}
// export const prodReadyCommunities = ["dh-ch", "ee", "fam", "mes", "ni", "covid-19", "dariah", "epos", "egi"];