openaire-library/connect/community/communityInfo.ts

34 lines
1.0 KiB
TypeScript

import {StringUtils} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment";
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;
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"];