2022-06-27 14:02:16 +02:00
|
|
|
import {ChangeDetectorRef, Component, ElementRef, Inject, Input, Renderer2, ViewChild} from '@angular/core';
|
2019-04-24 14:02:11 +02:00
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
2021-10-21 12:18:28 +02:00
|
|
|
import {DOCUMENT, Location} from '@angular/common';
|
2019-04-24 14:02:11 +02:00
|
|
|
import {Meta, Title} from '@angular/platform-browser';
|
|
|
|
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
|
|
|
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
|
|
|
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
|
|
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
2018-11-26 14:07:58 +01:00
|
|
|
import {SearchZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
|
|
|
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
2019-09-13 09:47:29 +02:00
|
|
|
import {Session, User} from '../openaireLibrary/login/utils/helper.class';
|
2019-04-11 11:39:46 +02:00
|
|
|
import {StatisticsForDashboardComponent} from '../statistics/statistics.component';
|
2019-04-24 14:02:11 +02:00
|
|
|
import {StringUtils} from '../openaireLibrary/utils/string-utils.class';
|
2019-06-05 15:39:02 +02:00
|
|
|
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service";
|
|
|
|
import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service";
|
|
|
|
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
|
2019-07-31 12:42:45 +02:00
|
|
|
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
|
2019-08-02 16:56:03 +02:00
|
|
|
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
|
2019-09-13 09:47:29 +02:00
|
|
|
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
|
2020-05-07 12:29:52 +02:00
|
|
|
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
2020-05-31 13:34:51 +02:00
|
|
|
import {FetchResearchResults} from "../openaireLibrary/utils/fetchEntitiesClasses/fetchResearchResults.class";
|
|
|
|
import {ErrorCodes} from "../openaireLibrary/utils/properties/errorCodes";
|
2020-07-15 17:53:19 +02:00
|
|
|
import {Subscription} from "rxjs";
|
2020-07-17 01:25:23 +02:00
|
|
|
import {properties} from "../../environments/environment";
|
2021-05-17 12:10:27 +02:00
|
|
|
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
|
2021-05-25 00:18:32 +02:00
|
|
|
import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
|
2022-06-30 17:25:22 +02:00
|
|
|
import {OpenaireEntities} from '../openaireLibrary/utils/properties/searchFields';
|
2019-04-24 14:02:11 +02:00
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
@Component({
|
2019-04-24 14:02:11 +02:00
|
|
|
selector: 'community',
|
|
|
|
templateUrl: 'community.component.html',
|
2023-03-16 15:38:37 +01:00
|
|
|
styles: [
|
|
|
|
`
|
|
|
|
#mytabs .uk-tab::before {
|
|
|
|
border-bottom: none;
|
|
|
|
}
|
|
|
|
#mytabs::before {
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
border-bottom: 1px solid #eaeaea;
|
|
|
|
}
|
2022-06-30 17:25:22 +02:00
|
|
|
`
|
|
|
|
]
|
2018-01-26 16:00:07 +01:00
|
|
|
})
|
2018-03-12 17:34:48 +01:00
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
export class CommunityComponent {
|
2019-08-02 16:56:03 +02:00
|
|
|
public url: string = null;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2018-02-28 17:44:33 +01:00
|
|
|
public projectTotal = null;
|
|
|
|
public contentProviderTotal = null;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-04-24 18:38:35 +02:00
|
|
|
public projectsCalculated: boolean = false;
|
|
|
|
public contentProvidersCalculated: boolean = false;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
params: any = {};
|
2021-02-19 18:52:12 +01:00
|
|
|
properties: EnvProperties = properties;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
public errorCodes: ErrorCodes = new ErrorCodes();
|
|
|
|
// Request results of each tab only the one time (first time tab is clicked)
|
|
|
|
private reloadPublications: boolean = true;
|
|
|
|
private reloadDatasets: boolean = true;
|
|
|
|
private reloadSoftware: boolean = true;
|
|
|
|
private reloadOrps: boolean = true;
|
2021-03-10 11:47:07 +01:00
|
|
|
private reloadFeaturedDatasets: boolean = true;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
// Variables for publications, research data, projects, content providers, related content providers tabs
|
|
|
|
public fetchPublications: FetchResearchResults;
|
|
|
|
public fetchDatasets: FetchResearchResults;
|
|
|
|
public fetchSoftware: FetchResearchResults;
|
|
|
|
public fetchOrps: FetchResearchResults;
|
2021-03-10 11:47:07 +01:00
|
|
|
public fetchFeaturedDatasets: FetchResearchResults;
|
2020-05-31 13:34:51 +02:00
|
|
|
public searchNumber: number = 5;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2018-03-22 16:38:42 +01:00
|
|
|
@Input() communityId = null;
|
2018-02-28 14:10:11 +01:00
|
|
|
public community = null;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2018-04-18 12:31:33 +02:00
|
|
|
public communityInfo = null;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2018-10-16 17:00:13 +02:00
|
|
|
public showLoading: boolean = true;
|
2018-11-26 14:07:58 +01:00
|
|
|
masterZenodoCommunity = null;
|
|
|
|
zenodoCommunityIdS = [];
|
2019-07-12 15:51:26 +02:00
|
|
|
showAllDescription = false;
|
2020-05-08 15:02:11 +02:00
|
|
|
public thresholdDescription: number = 500;
|
|
|
|
public descriptionDiff: number = 100;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2023-03-16 15:38:37 +01:00
|
|
|
page = 1;
|
|
|
|
size = 5;
|
2022-07-06 09:12:05 +02:00
|
|
|
|
2020-05-06 18:08:49 +02:00
|
|
|
subscribers: number = 0;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-07-15 17:53:19 +02:00
|
|
|
subs: Subscription[] = [];
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2023-03-16 15:38:37 +01:00
|
|
|
displayedAllSubjects = [];
|
|
|
|
displayedSubjects = [];
|
|
|
|
displayedSdg = [];
|
|
|
|
displayedFos = [];
|
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
@ViewChild(StatisticsForDashboardComponent) statistics: StatisticsForDashboardComponent = null;
|
2020-04-24 18:38:35 +02:00
|
|
|
public activeTab = "summary";
|
2019-06-20 15:34:07 +02:00
|
|
|
public show: string = 'overview';
|
2021-02-19 18:52:12 +01:00
|
|
|
public analyticsActiveTab: string = "";
|
2020-05-12 12:51:46 +02:00
|
|
|
public analyticsChecked: boolean = false;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-04-03 18:02:40 +02:00
|
|
|
searchLinkToResults: string = null;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-07-31 12:42:45 +02:00
|
|
|
searchLinkToProjects: string = null;
|
|
|
|
searchLinkToDataProviders: string = null;
|
2020-04-03 18:02:40 +02:00
|
|
|
searchLinkToAdvancedResults: string = null;
|
2019-07-31 12:42:45 +02:00
|
|
|
shareInZenodoPage: string = null;
|
2019-11-08 13:08:15 +01:00
|
|
|
public routerHelper: RouterHelper = new RouterHelper();
|
2019-09-13 09:47:29 +02:00
|
|
|
private user: User;
|
2022-06-30 17:25:22 +02:00
|
|
|
selectedEntity = 'result';
|
2020-05-07 12:29:52 +02:00
|
|
|
selectedEntitySimpleUrl;
|
|
|
|
selectedEntityAdvancedUrl;
|
2023-03-16 15:38:37 +01:00
|
|
|
resultTypes: Filter = {
|
2022-06-27 14:02:16 +02:00
|
|
|
values: [],
|
|
|
|
filterId: "type",
|
|
|
|
countSelectedValues: 0,
|
|
|
|
filterType: 'checkbox',
|
|
|
|
originalFilterId: "",
|
|
|
|
valueIsExact: true,
|
|
|
|
title: "Type",
|
|
|
|
filterOperator: "or"
|
|
|
|
};
|
2023-03-16 15:38:37 +01:00
|
|
|
showPublications: boolean = false;
|
2022-06-30 17:25:22 +02:00
|
|
|
showDatasets: boolean = false;
|
|
|
|
showSoftware: boolean = false;
|
|
|
|
showOrp: boolean = false;
|
|
|
|
showProjects: boolean = false;
|
|
|
|
showDataProviders: boolean = false;
|
2021-02-19 18:52:12 +01:00
|
|
|
keyword: string = "";
|
2020-05-07 12:29:52 +02:00
|
|
|
customFilter;
|
2021-02-19 18:52:12 +01:00
|
|
|
placeholderText = "Search by title, author, abstract, DOI, orcid... ";
|
2021-05-25 00:18:32 +02:00
|
|
|
resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
|
|
|
|
filter: null,
|
|
|
|
selected: true,
|
|
|
|
filterId: "resultbestaccessright",
|
|
|
|
value: "Open Access"
|
|
|
|
};
|
2023-03-16 15:38:37 +01:00
|
|
|
disableSelect: boolean = true;
|
|
|
|
openaireEntities= OpenaireEntities;
|
|
|
|
piwikSiteId;
|
2021-05-25 00:18:32 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
constructor(
|
2019-02-18 16:15:53 +01:00
|
|
|
private element: ElementRef,
|
2019-04-24 14:02:11 +02:00
|
|
|
private route: ActivatedRoute,
|
|
|
|
private _router: Router,
|
|
|
|
private location: Location,
|
|
|
|
private _meta: Meta,
|
|
|
|
private _title: Title,
|
|
|
|
private _piwikService: PiwikService,
|
|
|
|
private config: ConfigurationService,
|
|
|
|
private _communityService: CommunityService,
|
2019-11-08 13:08:15 +01:00
|
|
|
private _searchCommunityDataprovidersService: SearchCommunityDataprovidersService,
|
2019-06-05 15:39:02 +02:00
|
|
|
private _searchCommunityProjectsService: SearchCommunityProjectsService,
|
|
|
|
private _searchResearchResultsService: SearchResearchResultsService,
|
2019-04-24 14:02:11 +02:00
|
|
|
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
|
2020-10-08 17:26:02 +02:00
|
|
|
private _zenodoCommunitieService: ZenodoCommunitiesService,
|
2019-09-13 09:47:29 +02:00
|
|
|
private seoService: SEOService,
|
2021-10-21 12:18:28 +02:00
|
|
|
private userManagementService: UserManagementService,
|
2023-03-16 15:38:37 +01:00
|
|
|
private _renderer2: Renderer2,
|
|
|
|
private cdr: ChangeDetectorRef,
|
|
|
|
@Inject(DOCUMENT) private _document: Document) {
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
var description = "OpenAIRE - Connect, Community Dashboard, research community";
|
|
|
|
var title = "OpenAIRE - Connect";
|
|
|
|
this._meta.updateTag({content: description}, "name='description'");
|
|
|
|
this._meta.updateTag({content: description}, "property='og:description'");
|
|
|
|
this._meta.updateTag({content: title}, "property='og:title'");
|
|
|
|
this._title.setTitle(title);
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
|
2021-03-10 11:47:07 +01:00
|
|
|
this.fetchFeaturedDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
public ngOnInit() {
|
2020-07-17 01:25:23 +02:00
|
|
|
this.searchLinkToResults = this.properties.searchLinkToResults;
|
|
|
|
this.searchLinkToProjects = this.properties.searchLinkToProjects;
|
|
|
|
this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders;
|
|
|
|
this.searchLinkToAdvancedResults = this.properties.searchLinkToAdvancedResults;
|
|
|
|
this.shareInZenodoPage = this.properties.shareInZenodoPage;
|
2021-02-19 18:52:12 +01:00
|
|
|
this.url = properties.domain + properties.baseLink + this._router.url;
|
2020-07-17 01:25:23 +02:00
|
|
|
this.seoService.createLinkForCanonicalURL(this.url, false);
|
|
|
|
this._meta.updateTag({content: this.url}, "property='og:url'");
|
|
|
|
this.subs.push(this.userManagementService.getUserInfo().subscribe(user => {
|
|
|
|
this.user = user;
|
|
|
|
}));
|
2021-02-19 18:52:12 +01:00
|
|
|
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
|
|
|
|
this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
|
|
|
|
community => {
|
2021-05-18 09:29:16 +02:00
|
|
|
this.community = community;
|
2021-05-17 12:10:27 +02:00
|
|
|
if(community && !ConnectHelper.isPrivate(community, this.user)) {
|
2023-03-16 15:38:37 +01:00
|
|
|
this.displayedSubjects = community.subjects;
|
|
|
|
this.displayedSdg = community.sdg;
|
|
|
|
this.displayedFos = community.fos;
|
|
|
|
this.displayedSubjects.forEach(element => {
|
|
|
|
this.displayedAllSubjects.push({value: element, type: 'resultsubject'});
|
|
|
|
});
|
|
|
|
this.displayedSdg.forEach(element => {
|
|
|
|
this.displayedAllSubjects.push({value: element, type: 'sdg'});
|
|
|
|
});
|
|
|
|
this.displayedFos.forEach(element => {
|
|
|
|
this.displayedAllSubjects.push({value: element, type: 'fos'});
|
|
|
|
});
|
2021-02-19 18:52:12 +01:00
|
|
|
if (community.description != null && (community.description.length - this.thresholdDescription <= this.descriptionDiff)) {
|
2020-07-17 01:25:23 +02:00
|
|
|
this.thresholdDescription = community.description.length;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-07-17 01:25:23 +02:00
|
|
|
if (this.properties.environment == "development") {
|
|
|
|
this.params = {communityId: community.communityId};
|
|
|
|
}
|
|
|
|
this._meta.updateTag({content: community.description}, "name='description'");
|
|
|
|
this._meta.updateTag({content: community.description}, "property='og:description'");
|
|
|
|
this._meta.updateTag({content: community.title}, "property='og:title'");
|
|
|
|
this._title.setTitle(community.title);
|
|
|
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
2023-03-16 15:38:37 +01:00
|
|
|
this.subs.push(this.config.communityInformationState.subscribe(portal => {
|
|
|
|
if(portal && portal.piwik) {
|
|
|
|
this.piwikSiteId = portal.piwik;
|
|
|
|
this.subs.push(this._piwikService.trackView(this.properties, community.title, this.piwikSiteId).subscribe());
|
|
|
|
}
|
|
|
|
}));
|
2020-07-17 01:25:23 +02:00
|
|
|
}
|
|
|
|
if (this.community.zenodoCommunity) {
|
2020-10-08 17:26:02 +02:00
|
|
|
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe(
|
2020-07-17 01:25:23 +02:00
|
|
|
result => {
|
|
|
|
this.masterZenodoCommunity = result;
|
|
|
|
},
|
|
|
|
error => {
|
2020-10-09 10:21:52 +02:00
|
|
|
this.handleError("Error getting Master Zenodo community with id: " + this.community.zenodoCommunity, error);
|
2019-04-24 14:02:11 +02:00
|
|
|
}
|
2020-07-17 01:25:23 +02:00
|
|
|
));
|
|
|
|
}
|
|
|
|
this.subs.push(this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe(
|
|
|
|
result => {
|
|
|
|
this.zenodoCommunityIdS = result;
|
2019-11-08 13:08:15 +01:00
|
|
|
},
|
|
|
|
error => {
|
2020-07-17 01:25:23 +02:00
|
|
|
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
|
2020-10-09 10:21:52 +02:00
|
|
|
}
|
2020-07-15 17:53:19 +02:00
|
|
|
));
|
2020-07-17 01:25:23 +02:00
|
|
|
}
|
2021-02-19 18:52:12 +01:00
|
|
|
}));
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
this.countResearchResults("publication");
|
|
|
|
this.countResearchResults("dataset");
|
|
|
|
this.countResearchResults("software");
|
|
|
|
this.countResearchResults("other");
|
2021-03-10 11:47:07 +01:00
|
|
|
if(this.communityId == "enermaps"){
|
|
|
|
this.countResearchResults("dataset", "enermaps::selection" );
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
this.subs.push(this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId).subscribe(
|
|
|
|
projectTotal => {
|
|
|
|
this.projectTotal = projectTotal;
|
|
|
|
},
|
|
|
|
error => {
|
|
|
|
this.handleError("Error getting number of projects for community with id: " + this.communityId, error);
|
|
|
|
},
|
|
|
|
() => {
|
|
|
|
this.projectsCalculated = true;
|
|
|
|
}
|
|
|
|
));
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
this.subs.push(this._searchCommunityDataprovidersService.countTotalDataproviders(this.properties, this.communityId).subscribe(
|
|
|
|
contentProviderTotal => {
|
|
|
|
this.contentProviderTotal = contentProviderTotal;
|
|
|
|
//console.log(contentProviderTotal);
|
|
|
|
},
|
|
|
|
error => {
|
|
|
|
this.handleError("Error getting number of content providers for community with id: " + this.communityId, error);
|
|
|
|
},
|
|
|
|
() => {
|
|
|
|
this.contentProvidersCalculated = true;
|
|
|
|
}
|
|
|
|
));
|
|
|
|
this.subs.push(this.config.communityInformationState.subscribe(
|
|
|
|
res => {
|
|
|
|
this.communityInfo = res;
|
2021-11-08 16:41:25 +01:00
|
|
|
|
|
|
|
// loading twitter widget script conditionally
|
|
|
|
if (properties.environment == "development") {
|
|
|
|
if (this.communityInfo && this.communityInfo.twitterAccount) {
|
|
|
|
let script = this._renderer2.createElement('script');
|
|
|
|
script.charset = "utf-8";
|
|
|
|
script.src = "https://platform.twitter.com/widgets.js";
|
|
|
|
this._renderer2.appendChild(this._document.body, script);
|
|
|
|
}
|
|
|
|
}
|
2021-02-19 18:52:12 +01:00
|
|
|
},
|
|
|
|
error => {
|
|
|
|
//console.log(error)
|
|
|
|
this.handleError("Error getting community with id: " + this.communityId, error);
|
|
|
|
}
|
|
|
|
));
|
2023-03-16 15:38:37 +01:00
|
|
|
this.subs.push(this.config.communityInformationState.subscribe(data => {
|
|
|
|
if (data) {
|
|
|
|
var showEntity = {};
|
|
|
|
for (var i = 0; i < data['entities'].length; i++) {
|
|
|
|
showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
|
|
|
|
}
|
|
|
|
this.showPublications = !!showEntity["publication"];
|
|
|
|
this.showDatasets = !!showEntity["dataset"];
|
|
|
|
this.showSoftware = !!showEntity["software"];
|
|
|
|
this.showOrp = !!showEntity["orp"];
|
|
|
|
this.showProjects = !!showEntity["project"];
|
|
|
|
this.showDataProviders = !!showEntity["datasource"];
|
|
|
|
if (this.showPublications) {
|
|
|
|
this.resultTypes.values.push({
|
|
|
|
name: this.openaireEntities.PUBLICATIONS,
|
|
|
|
id: "publications",
|
|
|
|
selected: false,
|
|
|
|
number: 0
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (this.showDatasets) {
|
|
|
|
this.resultTypes.values.push({
|
|
|
|
name: this.openaireEntities.DATASETS,
|
|
|
|
id: "datasets",
|
|
|
|
selected: false,
|
|
|
|
number: 0
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (this.showSoftware) {
|
|
|
|
this.resultTypes.values.push({
|
|
|
|
name: this.openaireEntities.SOFTWARE,
|
|
|
|
id: "software",
|
|
|
|
selected: false,
|
|
|
|
number: 0
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (this.showOrp) {
|
|
|
|
this.resultTypes.values.push({name: this.openaireEntities.OTHER, id: "other", selected: false, number: 0});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}));
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
private searchPublications(page: number, size: number) {
|
|
|
|
this.setActiveTab("publication");
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
if (this.reloadPublications &&
|
|
|
|
(this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
(this.fetchPublications.searchUtils.status == this.errorCodes.DONE && this.fetchPublications.searchUtils.totalResults > 0)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
this.fetchPublications.getResultsForCommunity("publication", this.communityId, page, size, this.properties);
|
|
|
|
}
|
|
|
|
this.reloadPublications = false;
|
2018-10-16 14:52:51 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
private searchDatasets(page: number, size: number) {
|
|
|
|
this.setActiveTab("dataset");
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
if (this.reloadDatasets &&
|
|
|
|
(this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
(this.fetchDatasets.searchUtils.status == this.errorCodes.DONE && this.fetchDatasets.searchUtils.totalResults > 0)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
this.fetchDatasets.getResultsForCommunity("dataset", this.communityId, page, size, this.properties);
|
|
|
|
}
|
|
|
|
this.reloadDatasets = false;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
private searchSoftware(page: number, size: number) {
|
|
|
|
this.setActiveTab("software");
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
if (this.reloadSoftware &&
|
|
|
|
(this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
(this.fetchSoftware.searchUtils.status == this.errorCodes.DONE && this.fetchSoftware.searchUtils.totalResults > 0)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
this.fetchSoftware.getResultsForCommunity("software", this.communityId, page, size, this.properties);
|
|
|
|
}
|
|
|
|
this.reloadSoftware = false;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
private searchOrps(page: number, size: number) {
|
|
|
|
this.setActiveTab("other");
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
if (this.reloadOrps &&
|
|
|
|
(this.fetchOrps.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
(this.fetchOrps.searchUtils.status == this.errorCodes.DONE && this.fetchOrps.searchUtils.totalResults > 0)
|
|
|
|
)
|
|
|
|
) {
|
|
|
|
this.fetchOrps.getResultsForCommunity("other", this.communityId, page, size, this.properties);
|
2018-10-16 14:52:51 +02:00
|
|
|
}
|
2020-05-31 13:34:51 +02:00
|
|
|
this.reloadOrps = false;
|
|
|
|
}
|
2021-03-10 11:47:07 +01:00
|
|
|
private searchFeaturedDatasets(page: number, size: number) {
|
|
|
|
this.setActiveTab("enermaps");
|
|
|
|
if (this.reloadFeaturedDatasets &&
|
|
|
|
(this.fetchFeaturedDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
|
|
|
(this.fetchFeaturedDatasets.searchUtils.status == this.errorCodes.DONE && this.fetchFeaturedDatasets.searchUtils.totalResults > 0)
|
|
|
|
)
|
|
|
|
) {
|
2021-04-02 11:18:44 +02:00
|
|
|
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, page, size, this.properties, "enermaps::selection");
|
2023-03-16 15:38:37 +01:00
|
|
|
// console.log(this.fetchFeaturedDatasets);
|
2021-03-10 11:47:07 +01:00
|
|
|
}
|
|
|
|
this.reloadFeaturedDatasets = false;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-03-10 11:47:07 +01:00
|
|
|
private countResearchResults(resultType: string, contextId = null) {
|
2020-05-31 13:34:51 +02:00
|
|
|
let fetch: FetchResearchResults;
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
if (resultType == "publication") {
|
|
|
|
fetch = this.fetchPublications;
|
2021-03-10 11:47:07 +01:00
|
|
|
} else if (resultType == "dataset" && !contextId) {
|
2020-05-31 13:34:51 +02:00
|
|
|
fetch = this.fetchDatasets;
|
|
|
|
} else if (resultType == "software") {
|
|
|
|
fetch = this.fetchSoftware;
|
|
|
|
} else if (resultType == "other") {
|
|
|
|
fetch = this.fetchOrps;
|
2021-03-10 11:47:07 +01:00
|
|
|
} else if (resultType == "dataset" && contextId) {
|
|
|
|
fetch = this.fetchFeaturedDatasets;
|
2021-04-02 11:18:44 +02:00
|
|
|
this.fetchFeaturedDatasets.getAllResultsForCommunity("dataset", this.communityId, 0, 0, this.properties, contextId);
|
|
|
|
return;
|
2020-05-31 13:34:51 +02:00
|
|
|
}
|
2021-03-10 11:47:07 +01:00
|
|
|
fetch.getNumForCommunity(resultType, this.communityId, this.properties, contextId);
|
2018-10-16 14:52:51 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2018-01-26 16:00:07 +01:00
|
|
|
public ngOnDestroy() {
|
2020-07-15 17:53:19 +02:00
|
|
|
for (let sub of this.subs) {
|
|
|
|
sub.unsubscribe();
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|
2020-11-12 16:59:26 +01:00
|
|
|
this.fetchPublications.clearSubscriptions();
|
|
|
|
this.fetchDatasets.clearSubscriptions();
|
|
|
|
this.fetchOrps.clearSubscriptions();
|
|
|
|
this.fetchSoftware.clearSubscriptions();
|
2021-03-10 11:47:07 +01:00
|
|
|
this.fetchFeaturedDatasets.clearSubscriptions();
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-11 11:39:46 +02:00
|
|
|
isEntityEnabled(entity: string) {
|
2019-04-24 14:02:11 +02:00
|
|
|
return this.communityInfo.entities.some(x => x['pid'] == entity && x['isEnabled'] === true);
|
2018-04-18 12:31:33 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-11 11:39:46 +02:00
|
|
|
isRouteEnabled(route: string) {
|
2019-04-24 14:02:11 +02:00
|
|
|
return this.communityInfo.pages.some(x => x['route'] == route && x['isEnabled'] === true);
|
2018-11-26 14:07:58 +01:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
showInvite() {
|
2019-12-23 16:45:47 +01:00
|
|
|
return this.isManager();
|
2019-04-12 13:05:28 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
isManager() {
|
2019-11-08 13:08:15 +01:00
|
|
|
if (!this.user) {
|
2019-09-13 09:47:29 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
var email = this.user.email;
|
2019-04-24 14:02:11 +02:00
|
|
|
var index = -1;
|
|
|
|
if (email && this.community != null && this.community.managers != null) {
|
|
|
|
index = this.community.managers.indexOf(email);
|
2018-11-29 12:40:38 +01:00
|
|
|
}
|
2019-09-13 09:47:29 +02:00
|
|
|
return Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user) || index != -1;
|
2018-11-29 12:40:38 +01:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-02-19 13:17:53 +01:00
|
|
|
private handleError(message: string, error) {
|
2019-04-24 14:02:11 +02:00
|
|
|
console.error("Community (component): " + message, error);
|
2019-02-19 13:17:53 +01:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
getSearchPlaceHolder() {
|
2019-04-11 11:39:46 +02:00
|
|
|
var entities = [];
|
2019-04-24 14:02:11 +02:00
|
|
|
if (this.isEntityEnabled("publication")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
entities.push("publications");
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
if (this.isEntityEnabled("dataset")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
entities.push("research data");
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
if (this.isEntityEnabled("software")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
entities.push("software");
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
if (this.isEntityEnabled("orp")) {
|
2019-04-11 11:39:46 +02:00
|
|
|
entities.push("other research products");
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
return "Search" + ((entities.length > 0) ? (" for " + entities.join(', ') + "...") : "");
|
2019-04-11 16:32:07 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
countOtherGraphs() {
|
|
|
|
var count = 0;
|
|
|
|
if (this.statistics && this.statistics.allowedEntities) {
|
|
|
|
for (var entity of this.statistics.allowedEntities) {
|
|
|
|
if (this.statistics.statisticsSum[entity].total > 0 && this.statistics.allowedCharts[entity].length > 0 && this.activeTab != entity) {
|
|
|
|
count += this.statistics.allowedCharts[entity].length;
|
|
|
|
}
|
2019-04-11 16:32:07 +02:00
|
|
|
}
|
|
|
|
}
|
2019-04-24 14:02:11 +02:00
|
|
|
return count;
|
2019-04-11 11:39:46 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-04-24 14:02:11 +02:00
|
|
|
createParams(param) {
|
2019-04-15 16:08:37 +02:00
|
|
|
return StringUtils.quote(StringUtils.URIEncode(param));
|
2019-04-24 14:02:11 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-09-16 11:35:50 +02:00
|
|
|
private setActiveTab(entityType: string) {
|
2019-11-08 13:08:15 +01:00
|
|
|
if (entityType == "other") {
|
2019-09-16 11:35:50 +02:00
|
|
|
this.activeTab = "orp";
|
|
|
|
} else {
|
|
|
|
this.activeTab = entityType;
|
|
|
|
}
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
public getParamsForSearchLink(type: string = "") {
|
2021-02-19 18:52:12 +01:00
|
|
|
if (type) {
|
2020-05-31 13:34:51 +02:00
|
|
|
return this.routerHelper.createQueryParams(['type', 'qf', 'sortBy'], [type, 'false', 'resultdateofacceptance,descending']);
|
|
|
|
} else {
|
|
|
|
return {};
|
2019-09-16 11:35:50 +02:00
|
|
|
}
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2019-11-08 13:08:15 +01:00
|
|
|
private getEntityName(entityType: string, plural: boolean, full: boolean): string {
|
|
|
|
if (entityType == "publication") {
|
2019-09-16 11:35:50 +02:00
|
|
|
return "publication" + (plural ? "s" : "");
|
2019-11-08 13:08:15 +01:00
|
|
|
} else if (entityType == "dataset") {
|
2019-09-16 11:35:50 +02:00
|
|
|
return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
|
2019-11-08 13:08:15 +01:00
|
|
|
} else if (entityType == "software") {
|
2019-09-16 11:35:50 +02:00
|
|
|
return "software";
|
2019-11-08 13:08:15 +01:00
|
|
|
} else if (entityType == "other") {
|
2019-09-16 11:35:50 +02:00
|
|
|
return (full ? ("other research product" + (plural ? "s" : "")) : "other");
|
|
|
|
}
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2022-06-30 17:25:22 +02:00
|
|
|
public buildProjectsTooltip(): string {
|
|
|
|
let tooltipContent: string = "<div>";
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
if (this.projectTotal != null && this.projectTotal > 0 && this.isEntityEnabled('project') && this.isRouteEnabled(this.searchLinkToProjects)) {
|
2020-04-24 18:38:35 +02:00
|
|
|
tooltipContent += "<span class='uk-text-bold'>Projects</span>";
|
|
|
|
}
|
2022-06-30 17:25:22 +02:00
|
|
|
|
|
|
|
tooltipContent += " have been selected as relevant for your community by the gateway curators.";
|
|
|
|
tooltipContent += "</div>";
|
|
|
|
|
|
|
|
return tooltipContent;
|
|
|
|
}
|
|
|
|
|
2023-03-16 15:38:37 +01:00
|
|
|
public buildContentProvidersTooltip(): string {
|
2022-06-30 17:25:22 +02:00
|
|
|
let tooltipContent: string = "<div>";
|
2023-03-16 15:38:37 +01:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
if (this.contentProviderTotal != null && this.contentProviderTotal > 0 && this.isEntityEnabled('datasource') && this.isRouteEnabled(this.searchLinkToDataProviders)) {
|
2020-04-24 18:38:35 +02:00
|
|
|
tooltipContent += "<span class='uk-text-bold'>Content Providers</span>";
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-04-24 18:38:35 +02:00
|
|
|
tooltipContent += " have been selected as relevant for your community by the gateway curators.";
|
|
|
|
tooltipContent += "</div>";
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-04-24 18:38:35 +02:00
|
|
|
return tooltipContent;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-04-24 18:38:35 +02:00
|
|
|
public buildZenodoCommunitiesTooltip(): string {
|
2022-06-30 17:25:22 +02:00
|
|
|
let tooltipContent: string = "<div>";
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-04-24 18:38:35 +02:00
|
|
|
tooltipContent += "<span class='uk-text-bold'>Zenodo</span> is a catch-all repository for OpenAIRE.";
|
|
|
|
tooltipContent += "<div class='uk-margin-small-top'>A <span class='uk-text-bold'>Zenodo Community</span> is created and curated by Zenodo users.</div>";
|
|
|
|
tooltipContent += "</div>";
|
2023-03-16 15:38:37 +01:00
|
|
|
|
2020-04-24 18:38:35 +02:00
|
|
|
return tooltipContent;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
entityChanged($event) {
|
2020-05-07 12:29:52 +02:00
|
|
|
this.selectedEntity = $event.entity;
|
|
|
|
this.selectedEntitySimpleUrl = $event.simpleUrl;
|
|
|
|
this.selectedEntityAdvancedUrl = $event.advancedUrl;
|
2021-02-19 18:52:12 +01:00
|
|
|
if (this.selectedEntity == 'result') {
|
|
|
|
this.placeholderText = "Search by title, author, abstract, DOI, orcid... ";
|
|
|
|
} else if (this.selectedEntity == 'project') {
|
2020-05-07 13:14:15 +02:00
|
|
|
this.placeholderText = "Search by project title, grant id, funder...";
|
2021-02-19 18:52:12 +01:00
|
|
|
} else if (this.selectedEntity == 'dataprovider') {
|
2020-05-07 13:14:15 +02:00
|
|
|
this.placeholderText = "Search by name...";
|
2021-02-19 18:52:12 +01:00
|
|
|
} else {
|
2020-05-07 13:14:15 +02:00
|
|
|
this.placeholderText = "Search community content";
|
|
|
|
}
|
2020-05-07 12:29:52 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
goTo(simple: boolean) {
|
|
|
|
let url = (simple) ? this.selectedEntitySimpleUrl : this.selectedEntityAdvancedUrl;
|
2020-05-07 12:29:52 +02:00
|
|
|
let parameterNames = [];
|
|
|
|
let parameterValues = [];
|
2021-05-25 00:18:32 +02:00
|
|
|
|
|
|
|
if (this.selectedEntity == "result" && this.resultsQuickFilter && this.resultsQuickFilter.selected) {
|
|
|
|
parameterNames.push(this.resultsQuickFilter.filterId);
|
|
|
|
parameterValues.push('"'+ encodeURIComponent(this.resultsQuickFilter.value)+'"');
|
|
|
|
}
|
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
if (this.keyword.length > 0) {
|
2020-11-02 18:26:18 +01:00
|
|
|
parameterNames.push("fv0");
|
2020-05-07 12:29:52 +02:00
|
|
|
parameterValues.push(this.keyword);
|
2020-11-02 18:26:18 +01:00
|
|
|
parameterNames.push("f0");
|
|
|
|
parameterValues.push("q");
|
2020-05-07 12:29:52 +02:00
|
|
|
}
|
|
|
|
this._router.navigate([url], {queryParams: this.routerHelper.createQueryParams(parameterNames, parameterValues)});
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2021-02-19 18:52:12 +01:00
|
|
|
public countSubscribersEvent($event) {
|
2020-05-06 18:08:49 +02:00
|
|
|
this.subscribers = $event.value;
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-11 19:11:12 +02:00
|
|
|
public checkStatistics(type: string) {
|
2020-10-09 10:21:52 +02:00
|
|
|
return !!(this.isEntityEnabled(type)
|
2020-05-11 19:11:12 +02:00
|
|
|
&& this.statistics && this.statistics.statisticsDisplay && this.statistics.statisticsDisplay.isActive
|
2020-10-09 10:21:52 +02:00
|
|
|
&& this.statistics.statisticsSum && this.statistics.statisticsSum[type] && this.statistics.statisticsSum[type].total > 0
|
2020-05-11 19:11:12 +02:00
|
|
|
&&
|
2020-10-09 10:21:52 +02:00
|
|
|
(this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor']
|
2020-05-11 19:11:12 +02:00
|
|
|
|| this.statistics.statisticsDisplay.entities[type].numbers.map['project']['showInMonitor']
|
|
|
|
|| this.statistics.statisticsDisplay.entities[type].numbers.map['open']['showInMonitor']
|
|
|
|
|| this.statistics.statisticsDisplay.entities[type].numbers.map['closed']['showInMonitor']
|
|
|
|
|| this.statistics.statisticsDisplay.entities[type].numbers.map['embargo']['showInMonitor']
|
|
|
|
|| this.statistics.statisticsDisplay.entities[type].numbers.map['restricted']['showInMonitor']
|
2020-10-09 10:21:52 +02:00
|
|
|
|| (this.statistics.allowedEntitiesMode['showInMonitor']
|
2020-05-11 19:11:12 +02:00
|
|
|
&& this.statistics.allowedChartsMode['showInMonitor'][type]
|
2020-10-09 10:21:52 +02:00
|
|
|
&& this.statistics.allowedChartsMode['showInMonitor'][type].length > 0)));
|
2020-05-11 19:11:12 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-11 19:11:12 +02:00
|
|
|
public initializeAnalyticsActiveTab() {
|
2021-02-19 18:52:12 +01:00
|
|
|
if (!this.analyticsChecked) {
|
|
|
|
if (this.checkStatistics("publication")) {
|
2020-05-11 19:11:12 +02:00
|
|
|
this.analyticsActiveTab = "publication";
|
2021-02-19 18:52:12 +01:00
|
|
|
} else if (this.checkStatistics("dataset")) {
|
2020-05-11 19:11:12 +02:00
|
|
|
this.analyticsActiveTab = "dataset";
|
2021-02-19 18:52:12 +01:00
|
|
|
} else if (this.checkStatistics("software")) {
|
2020-05-11 19:11:12 +02:00
|
|
|
this.analyticsActiveTab = "software";
|
2021-02-19 18:52:12 +01:00
|
|
|
} else if (this.checkStatistics("orp")) {
|
2020-05-11 19:11:12 +02:00
|
|
|
this.analyticsActiveTab = "orp";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-11 19:11:12 +02:00
|
|
|
public showAnalyticsTab() {
|
|
|
|
this.initializeAnalyticsActiveTab();
|
2020-10-09 10:21:52 +02:00
|
|
|
return this.analyticsActiveTab;
|
2020-05-11 19:11:12 +02:00
|
|
|
}
|
2021-09-07 12:13:06 +02:00
|
|
|
|
2020-05-31 13:34:51 +02:00
|
|
|
public onSelectActiveTab(activeTabId) {
|
2021-02-19 18:52:12 +01:00
|
|
|
if (this.activeTab != "activaTabId") { // tab really changed
|
2020-05-31 13:34:51 +02:00
|
|
|
if (activeTabId == 'summary') {
|
|
|
|
this.activeTab = 'summary';
|
|
|
|
} else if (activeTabId == 'publications') {
|
|
|
|
this.show = 'overview';
|
|
|
|
this.searchPublications(1, this.searchNumber);
|
|
|
|
} else if (activeTabId == 'datasets') {
|
|
|
|
this.show = 'overview';
|
|
|
|
this.searchDatasets(1, this.searchNumber);
|
|
|
|
} else if (activeTabId == 'software') {
|
|
|
|
this.show = 'overview';
|
|
|
|
this.searchSoftware(1, this.searchNumber);
|
|
|
|
} else if (activeTabId == 'other') {
|
2021-02-19 18:52:12 +01:00
|
|
|
this.show = 'overview';
|
2020-05-31 13:34:51 +02:00
|
|
|
this.searchOrps(1, this.searchNumber);
|
|
|
|
} else if (activeTabId == 'analytics') {
|
|
|
|
this.show = 'analysis';
|
|
|
|
this.activeTab = 'analytics';
|
|
|
|
this.analyticsChecked = true;
|
2021-03-08 16:40:49 +01:00
|
|
|
} else if (activeTabId == 'mapping') {
|
|
|
|
this.show = 'mapping';
|
|
|
|
this.activeTab = 'mapping';
|
2021-03-10 11:47:07 +01:00
|
|
|
} else if (activeTabId == 'enermaps') {
|
|
|
|
this.show = 'enermaps';
|
2023-03-16 15:38:37 +01:00
|
|
|
this.activeTab = 'enermaps';
|
2021-09-07 12:13:06 +02:00
|
|
|
this.searchFeaturedDatasets(1, this.fetchFeaturedDatasets.searchUtils.totalResults);
|
2022-06-30 17:25:22 +02:00
|
|
|
} else if (activeTabId == 'twitter') {
|
2023-03-16 15:38:37 +01:00
|
|
|
this.show = 'twitter';
|
|
|
|
this.activeTab = 'twitter';
|
|
|
|
}
|
2020-05-31 13:34:51 +02:00
|
|
|
}
|
|
|
|
}
|
2021-05-18 09:29:16 +02:00
|
|
|
isPrivate(){
|
|
|
|
return ConnectHelper.isPrivate(this.community, this.user);
|
2022-06-27 14:02:16 +02:00
|
|
|
}
|
|
|
|
|
2023-03-16 15:38:37 +01:00
|
|
|
disableSelectChange(event: boolean) {
|
2022-06-27 14:02:16 +02:00
|
|
|
this.disableSelect = event;
|
|
|
|
this.cdr.detectChanges();
|
2022-07-06 09:12:05 +02:00
|
|
|
}
|
|
|
|
|
2023-03-16 15:38:37 +01:00
|
|
|
public updatePage(event) {
|
2022-07-06 09:12:05 +02:00
|
|
|
this.page = event.value;
|
2021-05-18 09:29:16 +02:00
|
|
|
}
|
2018-01-26 16:00:07 +01:00
|
|
|
}
|