Compare commits

..

No commits in common. "a34744e1afd0ee591d0546ecc3e6e6990f13818a" and "edad40ad0bce0ffe073ec553931bb600360d2fff" have entirely different histories.

16 changed files with 141 additions and 386 deletions

View File

@ -6,7 +6,7 @@ export class ConnectHelper {
public static getCommunityFromDomain(domain: string): string{
if(properties.environment == "development") {
// domain = "aginfra.openaire.eu"; //for testing
domain = "aginfra.openaire.eu"; //for testing
}
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
if (domain.indexOf('openaire.eu') === -1) {

View File

@ -4,20 +4,20 @@
<div *ngIf="!showLoading" class="uk-grid" uk-grid>
<div class="uk-width-1-1">
<ul *ngIf="!isPortalAdministrator" class="uk-subnav uk-subnav-pill uk-flex uk-flex-middle">
<li *ngFor="let item of rootMenuItems; let i=index" [class.uk-active]="activeRootMenu==item['_id']" class="uk-visible-toggle uk-position-relative uk-padding-remove-horizontal">
<li [class.uk-active]="filterForm.get('status').value === 'resources'" class="uk-visible-toggle uk-position-relative uk-padding-remove-horizontal">
<span>
<a (click)="filterForm.get('status').setValue('resources'); activeRootMenu=item['_id']">
<span class="title">{{item.title}}</span>
<a (click)="filterForm.get('status').setValue('resources')">
<span class="title">Resourses</span>
</a>
<span class="uk-invisible-hover uk-position-center-right color">
<span class="clickable" uk-icon="more-vertical"></span>
<div #element uk-dropdown="mode: click; pos: bottom-right; offset: 10; delay-hide: 0; flip: false">
<ul class="uk-nav uk-dropdown-nav">
<li (click)="editRootMenu()">
<li>
<a>Edit</a>
</li>
<hr class="uk-nav-divider">
<li (click)="deleteRootMenu()">
<li>
<a>Delete</a>
</li>
</ul>
@ -25,67 +25,32 @@
</span>
</span>
</li>
<li (click)="newRootMenu()" class="uk-visible-toggle">
<li class="uk-visible-toggle">
<span class="clickable">
<span class="uk-icon-button small portal-icon-button">
<icon name="add"></icon>
</span>
<span class="space uk-hidden-hover">
Create new root menu
Create new menu item
</span>
</span>
</li>
</ul>
</div>
</div>
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid uk-margin-remove-top" uk-grid>
<div #searchInputComponent search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search menu item"
[selected]="selectedKeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="reset()"
[bordered]="true" colorClass="uk-text-secondary"
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1"></div>
<div>
<a (click)="newMenuItem()" class="uk-flex uk-flex-middle uk-text-uppercase">
<button class="large uk-icon-button uk-button-secondary">
<icon name="add"></icon>
</button>
<button class="uk-button uk-button-link uk-margin-small-left uk-text-secondary">
Add new menu item
</button>
</a>
</div>
</div>
<!-- Not currently working -->
<div *ngIf="!showLoading && checkboxes.length > 0" class="uk-padding
uk-padding-remove-bottom uk-padding-remove-top uk-margin-remove-top uk-margin-small-bottom uk-display-inline"
[attr.uk-tooltip]="getSelectedMenuItems().length == 0 ? 'pos:left; cls: uk-active' : null"
title="Select at least one menu item">
<input id="checkAll" type="checkbox" (click)="selectAll()" [ngModel]="getSelectedMenuItems().length == checkboxes.length"/>
<span *ngIf="getSelectedMenuItems().length > 0" class="uk-margin-left uk-text-muted"> {{getSelectedMenuItems().length}} menu items selected </span>
<a class="uk-margin-left">Actions</a>
<div uk-dropdown="mode: click">
<ul class="uk-nav uk-dropdown-nav"
[attr.uk-tooltip]="getSelectedMenuItems().length == 0 ? 'pos:left; cls: uk-active' : 'cls: uk-invisible'"
title="Select at least one page">
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedMenuItems().length == 0 ? 'uk-disabled' : ''"
(click)="toggleMenuItems(true,getSelectedMenuItems())"><i></i> Enable
</a></li>
<li *ngIf="!isPortalAdministrator"><a [class]="getSelectedMenuItems().length == 0 ? 'uk-disabled' : ''"
(click)="toggleMenuItems(false,getSelectedMenuItems())"><i></i> Disable
</a>
</li>
<li *ngIf="isPortalAdministrator"><a [class]="getSelectedMenuItems().length == 0 ? 'uk-disabled' : ''"
(click)="confirmDeleteSelectedMenuItems()"><i></i> Delete </a></li>
</ul>
</div>
</div>
</div>
<div inner>
<div *ngIf="showLoading" class="uk-position-center">
<loading></loading>
</div>
<div *ngIf="!showLoading">
<ul *ngIf='activeRootMenu' class="uk-list submenu-items">
<li *ngFor="let child of getActiveRootItem(activeRootMenu).items" class="uk-card uk-card-default uk-margin-bottom">
<ul class="uk-list submenu-items">
<!-- <li class="uk-card uk-card-default uk-margin-bottom">
<div class="uk-grid uk-grid-divider uk-padding" uk-grid>
Submenu item 1
</div>
</li> -->
<li class="uk-card uk-card-default uk-margin-bottom">
<div class="uk-grid uk-grid-divider uk-padding" uk-grid>
<div class="uk-width-4-5">
<div class="uk-grid uk-flex uk-flex-middle">
@ -93,7 +58,7 @@
<input type="checkbox" id="" class="checkBox" name="" value="">
</div>
<div class="uk-width-expand uk-margin-medium-bottom">
{{child.title}}
Name and info
</div>
<div class="uk-grid uk-width-1-1 uk-margin-left">
Additional info
@ -120,37 +85,8 @@
</div>
</div>
</div>
<modal-alert #editModal [okDisabled]="menuItemForm && (menuItemForm.invalid || !menuItemForm.dirty)">
<form *ngIf="menuItemForm" [formGroup]="menuItemForm" class="uk grid uk-child-width-1-1" uk-grid>
<div dashboard-input [formInput]="menuItemForm.get('title')" type="text" label="Name" placeholder="Write a name"></div>
<div dashboard-input [formInput]="menuItemForm.get('type')" type="select" label="Type" placeholder="Choose a type" [options]="typeOptions"></div>
<!-- Workflow for EXTERNAL -->
<div dashboard-input *ngIf="menuItemForm.get('type').value === 'external'" [formInput]="menuItemForm.get('url')" type="URL" label="URL" placeholder="Write a URL"></div>
<!-- Workflow for INTERNAL -->
<div *ngIf="menuItemForm.get('type').value === 'internal'">
<div class="uk-text-center">Select one of the pages</div>
<div dashboard-input [formInput]="menuItemForm.get('route')" type="autocomplete" label="Page" placeholder="Search all pages" [options]="allPages" [showOptionsOnEmpty]="false">
</div>
<div class="uk-text-center uk-margin-top">Or <a (click)="newPageWindow()">create a new one</a></div>
<div *ngIf="newPageWindowOpen" class="uk-card uk-card-default uk-card-body uk-margin-top">
<div>
<button (click)="newPageWindow()" class="uk-close uk-icon uk-float-right" uk-close></button>
<h6 class="uk-text-bold uk-margin-remove-top">Create New Page</h6>
</div>
<form *ngIf="menuItemForm" [formGroup]="menuItemForm" class="uk grid uk-child-width-1-1" uk-grid>
<div dashboard-input [formInput]="menuItemForm.get('title')" type="text" label="Name" placeholder="Write a name"></div>
<div dashboard-input [formInput]="menuItemForm.get('title')" type="text" label="Route" placeholder="Write a route"></div>
<div>
<div class="uk-text-bold uk-form-label uk-margin-small-bottom">Enable/disable</div>
<mat-slide-toggle
uk-tooltip="title:<div class='uk-padding-small uk-width-large'><div class='uk-text-bold '>Disable a page to hide it from community dashboard portal.</div><div class=' uk-margin-top'>If the page is disabled, a message 'Can't find that page' will appear in case the url of that page is loaded. If the disabled page belongs to the menu, the link will be removed from menu, too.</div></div>">
</mat-slide-toggle>
</div>
<div class="uk-flex uk-flex-right">
<button class="uk-button uk-button-default">Create Page</button>
</div>
</form>
</div>
</div>
<modal-alert #editModal>
<form>
</form>
</modal-alert>

View File

@ -11,8 +11,7 @@ import {properties} from "../../../../environments/environment";
import {StringUtils} from "../../utils/string-utils.class";
import {Title} from "@angular/platform-browser";
import {AlertModal} from '../../utils/modal/alert';
import {CheckMenuItem, MenuItem} from '../../sharedComponents/menu';
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
@Component({
selector: 'menuSelector',
@ -20,23 +19,8 @@ import {SearchInputComponent} from '../../sharedComponents/search-input/search-i
})
export class MenuComponent implements OnInit {
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
@ViewChild('editModal') editModal: AlertModal;
@ViewChild('deleteModal') deleteModal: AlertModal;
private selectedMenuItems: string[] = [];
public checkboxes: CheckMenuItem[] = [];
// public menuItems: MenuItem[] = [];
// public rootMenuForm: FormGroup;
public activeRootMenu: string;
public menuItemForm: FormGroup;
public rootMenuItems = [];
public menuItems = [];
public allPages = [];
public keyword = '';
@ -45,15 +29,9 @@ export class MenuComponent implements OnInit {
public properties: EnvProperties = properties;
public newPageWindowOpen: boolean = false;
public showLoading = true;
public isPortalAdministrator = null;
public filterForm: FormGroup;
public typeOptions = [
{label: 'Internal Link', value: 'internal'},
{label: 'External Link', value: 'external'}
]
public selectedKeyword: string;
private subscriptions: any[] = [];
constructor(private element: ElementRef, private route: ActivatedRoute,
@ -79,8 +57,6 @@ export class MenuComponent implements OnInit {
this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.portal;
});
this.showLoading = false;
this.getMenuItems();
this.getPages();
}
ngOnDestroy(): void {
@ -92,122 +68,16 @@ export class MenuComponent implements OnInit {
}
});
}
getMenuItems() {
this.subscriptions.push(
this._helpContentService.getMenuItems(this.portal).subscribe(
data => {
console.log(data);
this.rootMenuItems = data;
if(data && data.length > 0) {
this.activeRootMenu = data[0]['_id'];
console.log(this.activeRootMenu);
}
},
err => console.error("Server error fetching menu items: ", err)
)
);
}
getActiveRootItem(id: string): MenuItem {
return this.rootMenuItems.find(element => element['_id'] == id);
}
getPages() {
this.subscriptions.push(
this._helpContentService.getAllPages(this.properties.adminToolsAPIURL,this.portal).subscribe(
data => {
let pages = data;
this.allPages = [];
for(let i = 0; i < pages.length; i++) {
if(pages[i] && pages[i].name && pages[i].route) {
this.allPages.push({value: pages[i].route, label: pages[i].name});
}
}
},
err => console.error("Server error fetching pages: ", err)
)
);
}
public newRootMenu() {
this.menuItemForm = this._fb.group({
id: this._fb.control(""),
title: this._fb.control("",Validators.required),
type: this._fb.control(""),
route: this._fb.control(""),
url: this._fb.control(""),
isEnabled: this._fb.control(""),
});
this.menuItemsModalOpen('Create Root Menu', 'Save Changes');
}
public editRootMenu() {
this.menuItemForm = this._fb.group({
id: this._fb.control("id"),
title: this._fb.control("Resources",Validators.required),
type: this._fb.control("",Validators.required),
route: this._fb.control("noNeed"),
url: this._fb.control("noNeed"),
isEnabled: this._fb.control("enabled",Validators.required),
});
this.menuItemsModalOpen('Edit Root Menu', 'Save Changes');
}
public deleteRootMenu() {
console.log('Delete root menu');
}
public getSelectedMenuItems(): string[] {
return this.checkboxes.filter(menuItem => menuItem.checked == true).map(checkedMenuItem => checkedMenuItem.menuItem).map(res => res.id);
}
public confirmDeleteSelectedMenuItems() {
this.selectedMenuItems = this.getSelectedMenuItems();
this.confirmModalOpen();
}
private confirmModalOpen() {
this.deleteModal.cancelButton = true;
this.deleteModal.okButton = true;
this.deleteModal.alertTitle = 'Delete Confirmation';
this.deleteModal.message = 'Are you sure you want to delete the selected menu item(s)?';
this.deleteModal.okButtonText = 'Yes';
this.deleteModal.open();
}
public newMenuItem() {
this.menuItemForm = this._fb.group({
id: this._fb.control(""),
title: this._fb.control("",Validators.required),
type: this._fb.control("",Validators.required),
route: this._fb.control(""),
url: this._fb.control(""),
isEnabled: this._fb.control("",Validators.required),
});
this.menuItemsModalOpen('Create Menu Item', 'Save Changes');
}
public editMenuItem() {
this.menuItemForm = this._fb.group({
id: this._fb.control("id"),
title: this._fb.control("HardcodedName",Validators.required),
type: this._fb.control("internal",Validators.required),
route: this._fb.control("routeAlex"),
url: this._fb.control("urlAlex"),
isEnabled: this._fb.control("enabled",Validators.required),
});
this.menuItemsModalOpen('Edit Menu Item', 'Save Changes');
console.log('Edit menu item');
this.menuItemsModalOpen('Edit Menu Item', 'Save Changers');
}
public deleteMenuItem() {
console.log('Delete menu item');
}
public newPageWindow() {
this.newPageWindowOpen = !this.newPageWindowOpen;
}
private menuItemsModalOpen(title: string, yesBtn: string) {
this.editModal.cancelButton = true;
this.editModal.okButton = true;
@ -216,24 +86,4 @@ export class MenuComponent implements OnInit {
this.editModal.okButtonText = yesBtn;
this.editModal.open();
}
public toggleMenuItems(status: boolean, ids: string[]) {
}
public onSearchClose() {
this.selectedKeyword = this.filterForm.get('keyword').value;
}
public reset() {
this.selectedKeyword = null;
this.searchInputComponent.reset();
}
selectAll() {
let checked = this.getSelectedMenuItems().length != this.checkboxes.length;
for (let check of this.checkboxes) {
check.checked = checked;
}
}
}

View File

@ -36,7 +36,7 @@
</div>
<!-- Labels -->
<div class="uk-margin-small-top">
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility uk-text-truncate"
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility"
title="Compatibility">
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"

View File

@ -145,7 +145,6 @@ export class DataProviderComponent {
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.updateTitle("Content provider");
this.updateDescription("");
@ -260,13 +259,10 @@ export class DataProviderComponent {
"page_type": "dataprovider"
}
});
}else if(err.name == "TimeoutError"){
this.errorMessage = 'An error occurred please try again later';
}else {
this.errorMessage = 'No dataProvider found';
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToDataProviders);
}
this.errorMessage = 'No dataProvider found';
this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToDataProviders);
}
));
}

View File

@ -16,11 +16,7 @@ import {properties} from "../../../../environments/environment";
<ng-container *ngFor="let subject of classifiedSubjects.get(key)">
<span class="uk-display-inline-block label-classified">
<span *ngIf="specialSubjects.indexOf(subject) == -1 ">{{subject}}</span>
<a class="uk-link-reset" *ngIf="specialSubjects.indexOf(subject) != -1"
[routerLink]=" properties.searchLinkToAdvancedResults"
[queryParams]="getSubjectParameter(subject)" >
{{subject}}
</a>
<a class="uk-link-reset" *ngIf="specialSubjects.indexOf(subject) != -1" [href]="properties.domain + properties.searchLinkToAdvancedResults +'?f0=resultsubject&fv0='+getSubjectParameter(subject) ">{{subject}}</a>
</span>
</ng-container>
</div>
@ -50,28 +46,29 @@ export class ShowSubjectsComponent {
@Input() classifiedSubjects: Map<string, string[]>;
properties = properties;
specialSubjects = [];
// private showClassifiedSbj: boolean = false;
constructor() {
if(properties.dashboard == "explore") {
if(properties.environment == 'development'){
this.specialSubjects = [
// "Physics::Optics",
// "Astrophysics::Cosmology and Extragalactic Astrophysics",
// "Computer Science::Information Theory",
// "Physics::Accelerator Physics",
// "Condensed Matter::Superconductivity",
"Physics::Optics",
"Astrophysics::Cosmology and Extragalactic Astrophysics",
"Computer Science::Information Theory",
"Physics::Accelerator Physics",
"Condensed Matter::Superconductivity",
"Physics::Atomic Physics",
// "Computer Science::Robotics",
// "Computer Science::Computer Science and Game Theory",
// "Computer Science::Neural and Evolutionary Computation",
"Computer Science::Robotics",
"Computer Science::Computer Science and Game Theory",
"Computer Science::Neural and Evolutionary Computation",
"Mathematics::Combinatorics",
// "Mathematics::Probability",
// "Computer Science::Operating Systems",
// "lcsh:Medicine",
// "lcsh:Science",
// "lcsh:Biology (General)",
// "lcsh:Chemistry",
// "lcsh:Engineering (General). Civil engineering (General)",
// "lcsh:Technology"
"Mathematics::Probability",
"Computer Science::Operating Systems",
"lcsh:Medicine",
"lcsh:Science",
"lcsh:Biology (General)",
"lcsh:Chemistry",
"lcsh:Engineering (General). Civil engineering (General)",
"lcsh:Technology"
];
}
}
@ -83,6 +80,6 @@ export class ShowSubjectsComponent {
return Array.from(map.keys());
}
getSubjectParameter(param){
return {'f0':'resultsubject','fv0':'"' +(param)+'"', size:50};
return '"' +encodeURIComponent(param)+'"';
}
}

View File

@ -32,20 +32,20 @@ import {properties} from "../../../../environments/environment";
export class OrganizationComponent {
@Input() piwikSiteId = null;
@Input() communityId = null;
public organizationInfo: OrganizationInfo;
public organizationId: string;
// Message variables
public warningMessage = "";
public errorMessage = "";
public showLoading: boolean = true;
// CSV variables
public downloadURLAPI: string;
public csvProjectParamsHead: string;
public csvParamsTail: string;
// Variables for publications, research data, projects, dataproviders tabs
public fetchProjects: FetchProjects;
public fetchPublications: FetchResearchResults;
@ -67,18 +67,18 @@ export class OrganizationComponent {
@ViewChild('downloadReportModal') downloadReportModal;
@ViewChild('downloadFunderReportModal') downloadFunderReportModal;
@ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when CSV: Project Publications for a funder is requested
@ViewChild('AlertModalApplyAll') alertApplyAll;
// Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError;
public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes();
public pageContents = null;
public divContents = null;
// Helper variables to specify funder in downloadPublicationsFile function
public contentTypes: [string, string][] = [
['results', 'all research outcomes'],
@ -97,11 +97,11 @@ export class OrganizationComponent {
public indexUpdateDate: Date;
public showFeedback: boolean = false;
public feedbackFields: string [] = ['Name', 'Country', 'Other'];
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
@ViewChild('projectsModal') projectsModal;
public deleteByInferenceOpened: boolean = false;
constructor(private element: ElementRef,
private _organizationService: OrganizationService,
@ -125,7 +125,7 @@ export class OrganizationComponent {
this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService);
this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService);
}
ngOnInit() {
this.properties = properties;
@ -139,15 +139,14 @@ export class OrganizationComponent {
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
this.subscriptions.push(this.route.queryParams.subscribe(params => {
this.organizationInfo = null;
this.updateTitle("Organization");
this.updateDescription("");
this.organizationId = params['organizationId'];
if (this.organizationId && StringUtils.isOpenAIREID(this.organizationId)) {
this.getOrganizationInfo();
} else {
@ -161,13 +160,13 @@ export class OrganizationComponent {
}
this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))';
}));
this.downloadURLAPI = this.properties.csvAPIURL;
//this.csvAffiliatedPublications = this.downloadURLAPI + "?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \"" + this.organizationId + "\"))";
this.csvProjectParamsHead = 'format=csv&type=projects&fq=((funder exact "';
//this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact ';
}
private getPageContents() {
if(this.communityId) {
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
@ -175,7 +174,7 @@ export class OrganizationComponent {
}));
}
}
private getDivContents() {
if(this.communityId) {
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
@ -210,11 +209,11 @@ export class OrganizationComponent {
this.fetchSoftware.getNumForEntity('software', 'organization', this.organizationId, this.properties);
this.fetchOrps.getNumForEntity('other', 'organization', this.organizationId, this.properties);
}
private getTotalDataproviders() {
this.fetchDataproviders.getNumForEntity('organization', this.organizationId, this.properties);
}
// private searchContentProviders() {
// this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, this.searchNumber, this.properties);
// }
@ -228,7 +227,7 @@ export class OrganizationComponent {
}
this.reloadDataproviders = false;
}
// private searchPublications() {
// this.fetchPublications.getResultsForEntity("publication", "organization", this.organizationId, 1, size, this.properties);
// }
@ -242,7 +241,7 @@ export class OrganizationComponent {
}
this.reloadPublications = false;
}
// private searchDatasets() {
// this.fetchDatasets.getResultsForEntity("dataset", "organization", this.organizationId, 1, this.searchNumber, this.properties);
// }
@ -284,13 +283,13 @@ export class OrganizationComponent {
}
this.reloadOrps = false;
}
private getOrganizationInfo() {
this.warningMessage = '';
this.errorMessage = ""
this.showLoading = true;
this.organizationInfo = null;
this.subscriptions.push(this._organizationService.getOrganizationInfo(this.organizationId, this.properties).subscribe(
@ -338,17 +337,14 @@ export class OrganizationComponent {
"page_type": "organization"
}
});
}else if(err.name == "TimeoutError"){
this.errorMessage = 'An error occurred please try again later';
}else {
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToOrganizations);
this.errorMessage = 'No organization found';
}
this.seoService.createLinkForCanonicalURL(this.properties.domain+ this.properties.baseLink + this.properties.searchLinkToOrganizations);
this.errorMessage = 'No organization found';
this.showLoading = false;
}
));
}
public downloadFile(url: string, filename: string) {
this.openLoading();
this.setMessageLoading("Downloading CSV file");
@ -356,7 +352,7 @@ export class OrganizationComponent {
this.subscriptions.push(this._reportsService.downloadCSVFile(url).subscribe(
data => {
this.closeLoading();
var url = window.URL.createObjectURL(data);
var a = window.document.createElement('a');
window.document.body.appendChild(a);
@ -366,7 +362,7 @@ export class OrganizationComponent {
a.click();
window.URL.revokeObjectURL(url);
a.remove(); // remove the element
//window.open(window.URL.createObjectURL(data));
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subscriptions.push(this._piwikService.trackDownload(this.properties, "DownloadCSV" + filename, this.piwikSiteId).subscribe());
@ -375,26 +371,26 @@ export class OrganizationComponent {
err => {
//console.log("Error downloading the file.");
this.handleError("Error downloading file: " + filename + ".csv", err);
this.closeLoading();
this.confirmOpenCsvError();
}/*,
() => console.log('Completed file download.')*/
));
}
private downloadFileByFunder() {
this.openLoading();
this.setMessageLoading("Downloading CSV file");
let response: string[] = [];
let totalResponse: string = "";
let projects = [];
let counter: number = this.funderCount;
let title: boolean = false;
let title_index: number = 0;
let filename: string = 'funder-project-' + this.funderContentType + '-report';
this.subscriptions.push(this._searchProjectsService.getProjectsForOrganizations(this.organizationId, ' and (funder exact "' + this.encodeURI(this.funderId) + '" ) ', 1, this.funderCount, [], this.properties).subscribe(
@ -408,7 +404,7 @@ export class OrganizationComponent {
counter--;
response[index] = "";
//console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]);
if (counter == 0) {
//for(let i=count-1; i>=0; i--) {
for (let i = 0; i < projects.length; i++) {
@ -421,7 +417,7 @@ export class OrganizationComponent {
}
}
this.closeLoading();
var csvurl = window.URL.createObjectURL(new Blob([totalResponse], {type: 'text/csv'}));
var a = window.document.createElement('a');
window.document.body.appendChild(a);
@ -451,7 +447,7 @@ export class OrganizationComponent {
counter--;
response[index] = data;
//console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]);
if (counter == 0) {
//for(let i=count-1; i>=0; i--) {
for (let i = 0; i < projects.length; i++) {
@ -464,7 +460,7 @@ export class OrganizationComponent {
}
}
this.closeLoading();
var csvurl = window.URL.createObjectURL(new Blob([totalResponse], {type: 'text/csv'}));
var a = window.document.createElement('a');
window.document.body.appendChild(a);
@ -481,7 +477,7 @@ export class OrganizationComponent {
},
err => {
this.handleError("Error downloading file: " + filename, err);
this.closeLoading();
this.confirmOpenCsvError();
this.innerReportSubscriptions.forEach(subscription => subscription.unsubscribe());
@ -500,18 +496,18 @@ export class OrganizationComponent {
},
err => {
this.handleError("Error getting projects for organization with id: " + this.organizationId, err);
this.closeLoading();
this.confirmOpenCsvError();
}
));
}
private updateDescription(description: string) {
this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
}
private updateTitle(title: string) {
var _prefix = "";
// if(!this.communityId) {
@ -521,11 +517,11 @@ export class OrganizationComponent {
this._title.setTitle(title);
this._meta.updateTag({content: title}, "property='og:title'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
private openLoading() {
this.closeDownloadReportModal();
this.closeDownloadFunderReportModal();
@ -534,19 +530,19 @@ export class OrganizationComponent {
this.loading.open();
}
}
private closeLoading() {
if (this.loading) {
this.loading.close();
}
}
private setMessageLoading(message: string) {
if (this.loading) {
this.loading.message = message;
}
}
public confirmOpenApplyAll(contentType: string) {
this.alertApplyAll.cancelButton = true;
this.alertApplyAll.okButton = true;
@ -559,11 +555,11 @@ export class OrganizationComponent {
this.funderCount = this.funder.number;
this.funderContentType = contentType;
}
public confirmCloseApplyAll() {
this.downloadFileByFunder();
}
public confirmOpenCsvError() {
this.alertCsvError.cancelButton = false;
this.alertCsvError.okButton = true;
@ -572,15 +568,15 @@ export class OrganizationComponent {
this.alertCsvError.okButtonText = "OK";
this.alertCsvError.open();
}
encodeURI(input: string): string {
return StringUtils.URIEncode(input);
}
private handleError(message: string, error) {
console.error("Organizaton Landing Page: " + message, error);
}
openDeletedByInference() {
this.deleteByInferenceOpened = true;
this.alertModalDeletedByInference.cancelButton = false;
@ -588,26 +584,26 @@ export class OrganizationComponent {
this.alertModalDeletedByInference.alertTitle = "Other versions of";
this.alertModalDeletedByInference.open();
}
public getTypeParam(type: string): string {
if (type == 'results') {
type = 'publications&type=datasets&type=software&type=other';
}
return 'type=' + type;
}
getCSVAffiliated(contentType: string): string {
return this.downloadURLAPI + '?format=csv&' + this.getTypeParam(contentType) + '&fq=(relorganizationid exact "' + this.organizationId + '")';
}
getFunderProjects(): string {
return this.downloadURLAPI + '?' + this.csvProjectParamsHead + encodeURI(this.funder.id) + this.csvParamsTail;
}
open(value: any) {
console.log(value);
}
openDownloadReportModal() {
this.downloadReportModal.cancelButton = false;
this.downloadReportModal.okButton = false;
@ -618,7 +614,7 @@ export class OrganizationComponent {
closeDownloadReportModal() {
this.downloadReportModal.cancel();
}
openDownloadFunderReportModal() {
this.funder = this.fetchProjects.funders[0];
this.downloadFunderReportModal.cancelButton = false;
@ -638,7 +634,7 @@ export class OrganizationComponent {
return this.routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', this.organizationId]);
}
}
public onSelectActiveTab(activeTabId) {
if (this.activeTab != activeTabId) { // tab really changed
if (activeTabId == 'projects') {
@ -661,7 +657,7 @@ export class OrganizationComponent {
}
}
}
public get total(): number {
let total = this.fetchPublications.searchUtils.totalResults;
total += this.fetchDatasets.searchUtils.totalResults;
@ -669,7 +665,7 @@ export class OrganizationComponent {
total += this.fetchOrps.searchUtils.totalResults;
return total;
}
// public get numberOfTabs(): number {
// if (this.tabsAreInitialized) {
// return this._numberOfTabs;
@ -728,7 +724,7 @@ export class OrganizationComponent {
// this.tabsAreInitialized = true;
// return this._numberOfTabs;
// }
private getEntityName(entityType: string, plural: boolean, full: boolean): string {
if (entityType == "publication") {
return "publication" + (plural ? "s" : "");
@ -744,7 +740,7 @@ export class OrganizationComponent {
return entityType + (plural ? "s" : "");
}
}
public scroll() {
HelperFunctions.scroll();
}

View File

@ -106,17 +106,19 @@
<div class="uk-margin-top uk-margin-bottom">
<span
*ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets"
class="uk-label custom-label label-open uk-text-truncate"
title="Open Access mandate for Publications and Research Data">Open Access mandate for Publications and Research Data
class="uk-label custom-label label-open"
title="Open Access mandate for Publications and Research Data">
<span class="uk-visible@m">Open Access mandate for Publications and Research Data</span>
<span class="uk-hidden@m">Open Access mandate for ...</span>
</span>{{" "}}
<span
*ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)"
class="uk-label custom-label label-open uk-text-truncate" title="Open Access mandate for Publications">
class="uk-label custom-label label-open" title="Open Access mandate for Publications">
Open Access mandate for Publications
</span>{{" "}}
<span
*ngIf="projectInfo.openAccessMandateDatasets != undefined && projectInfo.openAccessMandateDatasets && (projectInfo.openAccessMandatePublications == undefined || !projectInfo.openAccessMandatePublications)"
class="uk-label custom-label label-open uk-text-truncate" title="Open Access mandate for Research Data">
class="uk-label custom-label label-open" title="Open Access mandate for Research Data">
Open Access mandate for Research Data
</span>{{" "}}
<span *ngIf="projectInfo.funding && projectInfo.funding.funderName"

View File

@ -152,7 +152,6 @@ export class ProjectComponent {
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
this.subscriptions.push(this.route.queryParams.subscribe(params => {
@ -352,12 +351,9 @@ export class ProjectComponent {
this.handleError("Error getting project for id: " + this.projectId, err);
if(err.status == 404) {
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "project"}});
}else if(err.name == "TimeoutError"){
this.errorMessage = 'An error occurred please try again later';
}else {
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found';
}
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found';
this.showLoading = false;
}
));
@ -384,12 +380,9 @@ export class ProjectComponent {
this.handleError("Error getting project for grant id: " + grantId + " and funder: " + funder, err);
if(err.status == 404) {
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "project"}});
}else if(err.name == "TimeoutError"){
this.errorMessage = 'An error occurred please try again later';
}else {
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found';
}
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found';
this.showLoading = false;
}
));

View File

@ -143,7 +143,6 @@ export class ResultLandingComponent {
//this.getDivContents();
this.getPageContents();
this.updateUrl(this.properties.domain +this.properties.baseLink + this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
this.subscriptions.push(this.route.queryParams.subscribe(data => {
if (data['articleId']) {
this.id = data['articleId'];
@ -423,19 +422,17 @@ export class ResultLandingComponent {
this.handleError("Error getting " + this.type + " for " + (this.id ? ("id: " + this.id) : ("pid: " + this.identifier.id + " ("+this.identifier.class+")")), err);
if (err.status == 404) {
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": this.type}});
}else if(err.name == "TimeoutError"){
this.errorMessage = 'An error occurred please try again later';
}else{
if (this.type == "publication" || this.type == "software") {
this.errorMessage = 'No ' + this.type + ' found';
} else if (this.type == "dataset") {
this.errorMessage += "No research data found";
} else if (this.type == "orp") {
this.errorMessage += "No research product found";
}
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToSearchPage);
}
if (this.type == "publication" || this.type == "software") {
this.errorMessage = 'No ' + this.type + ' found';
} else if (this.type == "dataset") {
this.errorMessage += "No research data found";
} else if (this.type == "orp") {
this.errorMessage += "No research product found";
}
this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToSearchPage);
}
));
}
@ -663,8 +660,7 @@ export class ResultLandingComponent {
if(!(this.properties.environment == "production" || this.properties.environment == "development") ) {
return true;
}else {
let allow = !!(
// !resultLandingInfo.underCurationMessage &&
let allow = !!(!resultLandingInfo.underCurationMessage &&
((resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0)
|| resultLandingInfo.journal
|| (resultLandingInfo.classifiedSubjects && resultLandingInfo.classifiedSubjects.size > 0)

View File

@ -35,11 +35,11 @@
<span *ngIf="result.title && result.title.accessMode" [class]="'uk-label custom-label label-'+ result.title.accessMode " title="Access Mode">{{result.title.accessMode}}</span>
<span *ngIf="result['funderShortname']" class="uk-label custom-label label-funder " title="Funder">{{result['funderShortname']}}</span>
<span *ngIf="result.openAccessMandatePublications != undefined && result.openAccessMandatePublications && (result.openAccessMandateDatasets == undefined || !result.openAccessMandateDatasets)"
class="uk-label custom-label label-open uk-text-truncate" title="Open Access mandate for Publications">Open Access mandate for Publications</span>
class="uk-label custom-label label-open " title="Open Access mandate for Publications">Open Access mandate for Publications</span>
<span *ngIf="result.openAccessMandateDatasets != undefined && result.openAccessMandateDatasets && (result.openAccessMandatePublications == undefined || !result.openAccessMandatePublications)"
class="uk-label custom-label label-open uk-text-truncate" title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>
class="uk-label custom-label label-open " title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>
<span *ngIf="result.openAccessMandatePublications != undefined && result.openAccessMandatePublications && result.openAccessMandateDatasets != undefined && result.openAccessMandateDatasets"
class="uk-label custom-label label-open uk-text-truncate" title="Open Access mandate for Publications and Research Data">Open Access mandate for Publications and Research Data</span>
class="uk-label custom-label label-open " title="Open Access mandate for Publications and Research Data">Open Access mandate for Publications and Research Data</span>
<div *ngIf="result.publisher != undefined && result.publisher != ''"><span class="uk-text-bold">Publisher:</span> {{result.publisher}}</div>
<span *ngIf="result['type'] != undefined && result['type'] != ''" class="uk-label custom-label label-blue label-dataprovider" title="Type"> {{result['type']}}</span>
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''" class="uk-label custom-label label-compatibility" title="Compatibility">{{result.compatibility}}</span>

View File

@ -14,7 +14,6 @@ import {StatisticsDisplay, StatisticsSummary} from '../connect/statistics/statis
import {CustomOptions} from './servicesUtils/customOptions.class';
import {catchError, map} from "rxjs/operators";
import {properties} from "../../../environments/environment";
import { MenuItem } from '../sharedComponents/menu';
@Injectable()
export class HelpContentService {
@ -253,8 +252,8 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
// End of replacing part of getPages (now getAllPages)
//TODO double check with konstantina - there is no param that we are asking the community pages. without pid we get all portalTypes
getAllPages(helpContentUrl:string, pid:string = null) {//with_positions:boolean=null) {
getAllPages(helpContentUrl:string) {//,pid:string,with_positions:boolean=null) {
// let parameters: string = "";
// if(pid || with_positions == true || with_positions == false) {
// parameters = "?";
@ -265,7 +264,7 @@ export class HelpContentService {
// parameters += "&with_positions="+with_positions;
// }
// }
return this.http.get<Array<Page>>(helpContentUrl + 'page?' + (pid?"pid="+pid:""))
return this.http.get<Array<Page>>(helpContentUrl + 'page')
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
@ -315,11 +314,6 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
getMenuItems(portalPid: string) {
return this.http.get<Array<MenuItem>>(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/root/full")
.pipe(catchError(this.handleError));
}
// unused
getCommunities( helpContentUrl:string) {
return this.http.get<Array<Portal>>(helpContentUrl + properties.adminToolsPortalType)

View File

@ -31,7 +31,7 @@ showPage ={};
@Input() darkBackground:boolean=true;
@Input() centered:boolean=false;
@Input() shortView: boolean = false;
sectionClass= "";
sectionClass= "uk-section-primary";
subs: Subscription[] = [];
public divContents = null;

View File

@ -82,8 +82,3 @@ export class SideMenuItem {
items: RootMenuItem[] = [];
ukIcon: string = '';
}
export interface CheckMenuItem {
menuItem: MenuItem;
checked: boolean;
}

View File

@ -45,7 +45,7 @@
<div>
<div class="uk-panel" id="module-0">
<ul class="uk-nav uk-nav-default">
<!-- <li *ngIf="(['explore','connect','monitor','provide','develop']).indexOf(portal)!=-1"
<li *ngIf="(['explore','connect','monitor','provide','develop']).indexOf(portal)!=-1"
class="uk-nav-header uk-parent">
Dashboards
<ul class="uk-nav-sub">
@ -64,7 +64,7 @@
<li *ngIf="portal!='develop'"><a href="https://develop.openaire.eu" target="_blank"
class="uk-heading-bullet develop-heading-bullet">DEVELOP</a></li>
</ul>
</li>-->
</li>
<ng-container *ngIf="!onlyTop">
<ng-container *ngFor="let menu of menuItems">
<li class="uk-nav-header uk-parent " *ngIf="showHomeMenuItem && currentRoute.route !== '/'">
@ -124,7 +124,7 @@
</div>
</div>
</div>
<!--<div *ngIf="(['explore','connect','monitor','provide','develop']).indexOf(portal)!=-1"
<div *ngIf="(['explore','connect','monitor','provide','develop']).indexOf(portal)!=-1"
class="tm-toolbar custom-{{portal}}-toolbar uk-visible@m">
<div class="uk-container uk-flex uk-flex-middle uk-container-expand">
<div class="uk-margin-auto-left">
@ -160,12 +160,12 @@
</div>
</div>
</div>
</div>-->
</div>
<div *ngIf="specialAnnouncementContent" class="uk-visible@m" [innerHTML]="specialAnnouncementContent">
</div>
<div class="tm-header uk-visible@m tm-header-transparent" uk-header="">
<div id="stickyNavbar" [class]="'uk-navbar-container uk-sticky uk-navbar-transparent '+portal+'-menu'" uk-sticky="show-on-up: true"
<div id="stickyNavbar" [class]="'uk-navbar-container uk-sticky uk-navbar-transparent '+portal+'-menu'" uk-sticky=""
media="768" cls-active="uk-active uk-navbar-sticky"
[attr.animation]="(header.stickyAnimation != false ?'uk-animation-slide-top':null)"
top=".tm-header + [class*=&quot;uk-section&quot;]" cls-inactive="uk-navbar-transparent" style="">

View File

@ -124,18 +124,18 @@
{{result.accessMode}}
</span>{{' '}}
<span *ngIf="result.openAccessMandatePublications && (!result.openAccessMandateDatasets)"
class="uk-label custom-label label-open uk-text-truncate"
class="uk-label custom-label label-open"
title="Open Access mandate for Publications">
Open Access mandate for Publications
</span>{{' '}}
<span
*ngIf="result.openAccessMandateDatasets != undefined && result.openAccessMandateDatasets && (result.openAccessMandatePublications == undefined || !result.openAccessMandatePublications)"
class="uk-label custom-label label-open uk-text-truncate " title="Open Access mandate for Research Data">
class="uk-label custom-label label-open " title="Open Access mandate for Research Data">
Open Access mandate for Research Data
</span>{{' '}}
<span
*ngIf="result.openAccessMandatePublications != undefined && result.openAccessMandatePublications && result.openAccessMandateDatasets != undefined && result.openAccessMandateDatasets"
class="uk-label custom-label label-open uk-text-truncate"
class="uk-label custom-label label-open "
title="Open Access mandate for Publications and Research Data">
Open Access mandate for Publications and Research Data
</span>{{' '}}