[Connect | Trunk]: Remove comments from community
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@59532 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
4b871c3865
commit
642bd9d52d
|
@ -35,14 +35,9 @@ import {properties} from "../../environments/environment";
|
|||
|
||||
export class CommunityComponent {
|
||||
public url: string = null;
|
||||
|
||||
// public publicationTotal = null;
|
||||
// public researchDataTotal = null;
|
||||
// public softwareTotal = null;
|
||||
// public orpTotal = null;
|
||||
|
||||
public projectTotal = null;
|
||||
public contentProviderTotal = null;
|
||||
public organizationTotal = null;
|
||||
|
||||
public projectsCalculated: boolean = false;
|
||||
public contentProvidersCalculated: boolean = false;
|
||||
|
@ -51,12 +46,6 @@ export class CommunityComponent {
|
|||
properties: EnvProperties;
|
||||
|
||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||
|
||||
// public publicationResults = null;
|
||||
// public researchDataResults = null;
|
||||
// public softwareResults = null;
|
||||
// public orpResults = null;
|
||||
|
||||
// Request results of each tab only the one time (first time tab is clicked)
|
||||
private reloadPublications: boolean = true;
|
||||
private reloadDatasets: boolean = true;
|
||||
|
@ -78,7 +67,6 @@ export class CommunityComponent {
|
|||
public showLoading: boolean = true;
|
||||
masterZenodoCommunity = null;
|
||||
zenodoCommunityIdS = [];
|
||||
showAllSubjects = false;
|
||||
showAllDescription = false;
|
||||
public thresholdDescription: number = 500;
|
||||
public descriptionDiff: number = 100;
|
||||
|
@ -179,20 +167,12 @@ export class CommunityComponent {
|
|||
this.subs.push(this._piwikService.trackView(this.properties, community.title, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe());
|
||||
}
|
||||
if (this.community.zenodoCommunity) {
|
||||
console.log(this.community.zenodoCommunity);
|
||||
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe(
|
||||
result => {
|
||||
this.masterZenodoCommunity = result;
|
||||
|
||||
},
|
||||
error => {
|
||||
// var emptyCommunity:ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
||||
// emptyCommunity.id = this.masterZenodoCommunityId;
|
||||
// emptyCommunity.title = this.masterZenodoCommunityId;
|
||||
// this.masterZenodoCommunity = emptyCommunity;
|
||||
//console.log("Master Zenodo community'" + this.community.zenodoCommunity + "' couldn't be loaded");
|
||||
this.handleError("Error getting Master Zenodo community with id: " + this.community.zenodoCommunityId, error);
|
||||
|
||||
this.handleError("Error getting Master Zenodo community with id: " + this.community.zenodoCommunity, error);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
@ -201,9 +181,8 @@ export class CommunityComponent {
|
|||
this.zenodoCommunityIdS = result;
|
||||
},
|
||||
error => {
|
||||
//console.error("list of zenodo communities couldn't be loaded");
|
||||
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
|
||||
} //this.handleError('System error retrieving community profile', error)
|
||||
}
|
||||
));
|
||||
|
||||
//console.log(community);
|
||||
|
@ -217,7 +196,6 @@ export class CommunityComponent {
|
|||
this.subs.push(this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId).subscribe(
|
||||
projectTotal => {
|
||||
this.projectTotal = projectTotal;
|
||||
//console.log(projectTotal);
|
||||
},
|
||||
error => {
|
||||
this.handleError("Error getting number of projects for community with id: " + this.communityId, error);
|
||||
|
@ -239,15 +217,6 @@ export class CommunityComponent {
|
|||
this.contentProvidersCalculated = true;
|
||||
}
|
||||
));
|
||||
|
||||
// this._searchEntriesService.countTotal(this.properties.communityAPI+this.communityId+'/organizations').subscribe(
|
||||
// organizationTotal => {
|
||||
// this.organizationTotal = organizationTotal;
|
||||
// console.log(organizationTotal);
|
||||
// });
|
||||
|
||||
|
||||
/**/
|
||||
this.subs.push(this.config.communityInformationState.subscribe(
|
||||
res => {
|
||||
this.communityInfo = res;
|
||||
|
@ -327,40 +296,7 @@ export class CommunityComponent {
|
|||
|
||||
fetch.getNumForCommunity(resultType, this.communityId, this.properties);
|
||||
}
|
||||
|
||||
|
||||
// public countResearchResults(resultType: string) {
|
||||
// this._searchResearchResultsService.countTotalResults(resultType, this.properties, "&fq=communityid=" + this.communityId).subscribe(
|
||||
// researchResultsTotal => {
|
||||
// this.setTotal(resultType, researchResultsTotal);
|
||||
// if (resultType == "publication") {
|
||||
// //this.searchResearchResults(resultType, this.publicationTotal, this.publicationResults);
|
||||
// }
|
||||
// },
|
||||
// error => {
|
||||
// this.handleError("Error getting number of " + this.getEntityName(resultType, true, true) + " for community with id: " + this.communityId, error);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// public searchResearchResults(resultType: string, resultsTotal: number, results: Array<any>) {
|
||||
// this.setActiveTab(resultType);
|
||||
//
|
||||
// if (resultsTotal > 0 && results == null) {
|
||||
// this.showLoading = true;
|
||||
//
|
||||
// this._searchResearchResultsService.search(resultType, "", "&fq=communityid=" + this.communityId, 1, 5, "resultdateofacceptance,descending", [], this.properties).subscribe(
|
||||
// researchResults => {
|
||||
// this.setResults(resultType, researchResults[1]);
|
||||
// this.showLoading = false;
|
||||
// },
|
||||
// error => {
|
||||
// this.handleError("Error getting " + this.getEntityName(resultType, true, true) + " for community with id: " + this.communityId, error);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
public ngOnDestroy() {
|
||||
for (let sub of this.subs) {
|
||||
sub.unsubscribe();
|
||||
|
@ -436,32 +372,6 @@ export class CommunityComponent {
|
|||
}
|
||||
}
|
||||
|
||||
// private setResults(entityType: string, results: Array<any>) {
|
||||
// if (entityType == "publication") {
|
||||
// this.publicationResults = results;
|
||||
// } else if (entityType == "dataset") {
|
||||
// this.researchDataResults = results;
|
||||
// } else if (entityType == "software") {
|
||||
// this.softwareResults = results;
|
||||
// } else if (entityType == "other") {
|
||||
// this.orpResults = results;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private setTotal(entityType: string, total: number) {
|
||||
// if (entityType == "publication") {
|
||||
// this.publicationTotal = total;
|
||||
// console.log(this.publicationTotal);
|
||||
// } else if (entityType == "dataset") {
|
||||
// this.researchDataTotal = total;
|
||||
// } else if (entityType == "software") {
|
||||
// this.softwareTotal = total;
|
||||
// } else if (entityType == "other") {
|
||||
// this.orpTotal = total;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
public getParamsForSearchLink(type: string = "") {
|
||||
if(type) {
|
||||
return this.routerHelper.createQueryParams(['type', 'qf', 'sortBy'], [type, 'false', 'resultdateofacceptance,descending']);
|
||||
|
@ -530,31 +440,6 @@ export class CommunityComponent {
|
|||
let url = (simple)?this.selectedEntitySimpleUrl:this.selectedEntityAdvancedUrl;
|
||||
let parameterNames = [];
|
||||
let parameterValues = [];
|
||||
if (this.selectedEntity == "result") {
|
||||
/* if (this.resultTypes) {
|
||||
let values = [];
|
||||
if (this.resultTypes.publication) {
|
||||
values.push("publications");
|
||||
}
|
||||
if (this.resultTypes.dataset) {
|
||||
values.push("datasets");
|
||||
}
|
||||
if (this.resultTypes.software) {
|
||||
values.push("software");
|
||||
}
|
||||
if (this.resultTypes.other) {
|
||||
values.push("other");
|
||||
}
|
||||
if (values.length > 0) {
|
||||
parameterNames.push("type");
|
||||
parameterValues.push(values.join(","));
|
||||
}
|
||||
if (this.resultsQuickFilter) {
|
||||
parameterNames.push("qf");
|
||||
parameterValues.push("" + this.resultsQuickFilter.selected);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if(this.keyword.length > 0) {
|
||||
parameterNames.push("q");
|
||||
parameterValues.push(this.keyword);
|
||||
|
@ -569,41 +454,19 @@ export class CommunityComponent {
|
|||
}
|
||||
|
||||
public checkStatistics(type: string) {
|
||||
// if(this.isEntityEnabled(type)
|
||||
// && this.statistics && this.statistics.statisticsDisplay && this.statistics.statisticsDisplay.isActive
|
||||
// && this.statistics.statisticsSum && this.statistics.statisticsSum[type].total>0
|
||||
// &&
|
||||
// ( this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor']
|
||||
// || 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']
|
||||
// || ( this.statistics.allowedEntitiesMode['showInMonitor'] && this.statistics.statisticsSum
|
||||
// && this.statistics.allowedChartsMode['showInMonitor'] && this.statistics.statisticsSum[type]
|
||||
// && this.statistics.allowedChartsMode['showInMonitor'][type] && this.statistics.statisticsSum[type].total > 0
|
||||
// && this.statistics.allowedChartsMode['showInMonitor'][type].length > 0))) {
|
||||
// return true;
|
||||
// } else {
|
||||
// return false;
|
||||
// }
|
||||
if(this.isEntityEnabled(type)
|
||||
return !!(this.isEntityEnabled(type)
|
||||
&& this.statistics && this.statistics.statisticsDisplay && this.statistics.statisticsDisplay.isActive
|
||||
&& this.statistics.statisticsSum && this.statistics.statisticsSum[type] && this.statistics.statisticsSum[type].total>0
|
||||
&& this.statistics.statisticsSum && this.statistics.statisticsSum[type] && this.statistics.statisticsSum[type].total > 0
|
||||
&&
|
||||
( this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor']
|
||||
(this.statistics.statisticsDisplay.entities[type].numbers.map['total']['showInMonitor']
|
||||
|| 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']
|
||||
|| ( this.statistics.allowedEntitiesMode['showInMonitor']
|
||||
|| (this.statistics.allowedEntitiesMode['showInMonitor']
|
||||
&& this.statistics.allowedChartsMode['showInMonitor'][type]
|
||||
&& this.statistics.allowedChartsMode['showInMonitor'][type].length > 0))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
&& this.statistics.allowedChartsMode['showInMonitor'][type].length > 0)));
|
||||
}
|
||||
|
||||
public initializeAnalyticsActiveTab() {
|
||||
|
@ -622,11 +485,7 @@ export class CommunityComponent {
|
|||
|
||||
public showAnalyticsTab() {
|
||||
this.initializeAnalyticsActiveTab();
|
||||
if(!this.analyticsActiveTab) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return this.analyticsActiveTab;
|
||||
}
|
||||
|
||||
public onSelectActiveTab(activeTabId) {
|
||||
|
|
|
@ -43,10 +43,10 @@ export class ShareInZenodoComponent {
|
|||
masterZenodoCommunityId = null;
|
||||
masterZenodoCommunity = null;
|
||||
|
||||
CommunityIds = null;
|
||||
communityIds = null;
|
||||
communities = [];
|
||||
|
||||
zenodocommunitiesloadedCount = 0;
|
||||
zenodoCommunitiesLoadedCount = 0;
|
||||
zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
|
||||
errorCodes: ErrorCodes = new ErrorCodes();
|
||||
depositLink = "https://zenodo.org/deposit/new?c=";
|
||||
|
@ -120,13 +120,13 @@ export class ShareInZenodoComponent {
|
|||
|
||||
this.subs.push(this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe(
|
||||
result => {
|
||||
this.CommunityIds = result;
|
||||
this.zenodoSearchUtils.totalResults = this.CommunityIds.length;
|
||||
if (this.CommunityIds.length == 0) {
|
||||
this.communityIds = result;
|
||||
this.zenodoSearchUtils.totalResults = this.communityIds.length;
|
||||
if (this.communityIds.length == 0) {
|
||||
this.zenodoSearchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
for (let i = 0; i < this.CommunityIds.length; i++) {
|
||||
this.getZenodoCommunityById(this.CommunityIds[i]["zenodoid"], this.CommunityIds[i]["id"]);
|
||||
for (let i = 0; i < this.communityIds.length; i++) {
|
||||
this.getZenodoCommunityById(this.communityIds[i]["zenodoid"], this.communityIds[i]["id"]);
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -185,8 +185,8 @@ export class ShareInZenodoComponent {
|
|||
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + zenodoid, openaireId).subscribe(
|
||||
result => {
|
||||
this.communities.push(result);
|
||||
this.zenodocommunitiesloadedCount++;
|
||||
if (this.zenodocommunitiesloadedCount >= this.CommunityIds.length) {
|
||||
this.zenodoCommunitiesLoadedCount++;
|
||||
if (this.zenodoCommunitiesLoadedCount >= this.communityIds.length) {
|
||||
this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
||||
}
|
||||
|
||||
|
@ -198,8 +198,8 @@ export class ShareInZenodoComponent {
|
|||
// emptyCommunity.openaireId = openaireId;
|
||||
// emptyCommunity.title = zenodoid;
|
||||
// this.communities.push(emptyCommunity);
|
||||
this.zenodocommunitiesloadedCount++;
|
||||
if (this.zenodocommunitiesloadedCount >= this.CommunityIds.length) {
|
||||
this.zenodoCommunitiesLoadedCount++;
|
||||
if (this.zenodoCommunitiesLoadedCount >= this.communityIds.length) {
|
||||
this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
||||
}
|
||||
//console.error("Zenodo community'"+zenodoid+"' couldn't be loaded");
|
||||
|
|
Loading…
Reference in New Issue