[Library|Trunk]
communities: add const prodReadyCommunities communities search results: in production show link to beta or prod based on the list of prodReadyCommunities git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59028 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
1a2d78e3ee
commit
2979275c17
|
@ -14,3 +14,4 @@ export class CommunityInfo {
|
|||
isSubscribed: boolean;
|
||||
isManager: boolean;
|
||||
}
|
||||
export const prodReadyCommunities = ["dh-ch", "ee", "fam", "mes", "ni", "covid-19", "dariah", "epos", "egi"];
|
||||
|
|
|
@ -2,7 +2,7 @@ import {Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@an
|
|||
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {CommunityInfo} from "../../connect/community/communityInfo";
|
||||
import {CommunityInfo, prodReadyCommunities} from "../../connect/community/communityInfo";
|
||||
import {Router} from "@angular/router";
|
||||
import {LocalStorageService} from "../../services/localStorage.service";
|
||||
import {Stakeholder, StakeholderInfo} from "../../monitor/entities/stakeholder";
|
||||
|
@ -46,9 +46,8 @@ export class PortalSearchResultComponent implements OnInit, OnChanges{
|
|||
console.log(changes);
|
||||
}
|
||||
|
||||
getProductionPrefix(): string {
|
||||
// return (this.properties.environment == "beta") ? "beta." : "";
|
||||
return "beta.";
|
||||
getProductionPrefix(id:string): string {
|
||||
return (this.properties.environment == "production" && prodReadyCommunities.indexOf(id)!=-1) ? "" : "beta.";
|
||||
}
|
||||
|
||||
isProduction(): boolean {
|
||||
|
@ -80,7 +79,7 @@ export class PortalSearchResultComponent implements OnInit, OnChanges{
|
|||
public getCommunityPageUrl(communityInfo: CommunityInfo): string {
|
||||
let url = '';
|
||||
if (this.isProduction()) {
|
||||
url = 'https://' + this.getProductionPrefix() + communityInfo.communityId + '.openaire.eu';
|
||||
url = 'https://' + this.getProductionPrefix(communityInfo.communityId ) + communityInfo.communityId + '.openaire.eu';
|
||||
} else {
|
||||
url = this.router.createUrlTree(['/'], {
|
||||
queryParams: {'communityId': communityInfo.communityId}
|
||||
|
|
Loading…
Reference in New Issue