Compare commits

...

16 Commits

Author SHA1 Message Date
argirok a34744e1af apply changes in navbar & footer 2022-01-05 17:28:20 +02:00
argirok 845db0a835 truncate text for open access mandate and collected from aggregator_name labels - better display in mobile 2022-01-03 16:10:15 +02:00
Alex Martzios ce37ca54f7 Progress on getting the menu menu items - dev only 2021-12-23 16:12:51 +02:00
Alex Martzios 660c5955f7 Work on dynamic menus with actual data - dev only 2021-12-23 09:22:07 +02:00
argirok 5c215af73e Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library 2021-12-17 15:41:15 +02:00
argirok 88d70c21ac Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library 2021-12-17 15:40:08 +02:00
argirok f911dec31e landing pages: keep the loaded url as canonical if there is a timeout error - show the correct message 2021-12-17 15:39:32 +02:00
Alex Martzios 24fd2b3856 Progress on dynamic menu - dev only 2021-12-17 15:36:30 +02:00
argirok 55ec94b95f Subjects: add subjects section in home page. add 50 in the link to the search results
update login properties beta/test
Landing allow index off newly added records - zenodo
2021-12-17 14:35:18 +02:00
argirok 983961282d Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library 2021-12-17 14:31:34 +02:00
argirok 9459e944c5 in method getAllpages() add again optional parameter pid to get all pages of portaltype community and the specific pid 2021-12-17 14:06:05 +02:00
argirok e58a2b0008 Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library 2021-12-17 11:41:52 +02:00
Alex Martzios 0cddbdf857 Work in progress for new dymanic menu - dev only 2021-12-17 09:22:07 +02:00
argirok e336bfbad4 Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library 2021-11-30 12:51:57 +02:00
argirok c5f3c0b744 Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library 2021-11-25 12:05:27 +02:00
argirok fc78ac5777 update show subjects component with route links to advanced search - for 2 special subjetcs 2021-11-24 15:55:54 +02:00
16 changed files with 386 additions and 141 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 [class.uk-active]="filterForm.get('status').value === 'resources'" class="uk-visible-toggle uk-position-relative uk-padding-remove-horizontal">
<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">
<span>
<a (click)="filterForm.get('status').setValue('resources')">
<span class="title">Resourses</span>
<a (click)="filterForm.get('status').setValue('resources'); activeRootMenu=item['_id']">
<span class="title">{{item.title}}</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>
<li (click)="editRootMenu()">
<a>Edit</a>
</li>
<hr class="uk-nav-divider">
<li>
<li (click)="deleteRootMenu()">
<a>Delete</a>
</li>
</ul>
@ -25,32 +25,67 @@
</span>
</span>
</li>
<li class="uk-visible-toggle">
<li (click)="newRootMenu()" 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 menu item
Create new root menu
</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 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">
<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">
<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">
@ -58,7 +93,7 @@
<input type="checkbox" id="" class="checkBox" name="" value="">
</div>
<div class="uk-width-expand uk-margin-medium-bottom">
Name and info
{{child.title}}
</div>
<div class="uk-grid uk-width-1-1 uk-margin-left">
Additional info
@ -85,8 +120,37 @@
</div>
</div>
</div>
<modal-alert #editModal>
<form>
<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>
</form>
</modal-alert>

View File

@ -11,7 +11,8 @@ 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',
@ -19,8 +20,23 @@ import {AlertModal} from '../../utils/modal/alert';
})
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 = '';
@ -29,9 +45,15 @@ 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,
@ -57,6 +79,8 @@ export class MenuComponent implements OnInit {
this.isPortalAdministrator = Session.isPortalAdministrator(user) && !this.portal;
});
this.showLoading = false;
this.getMenuItems();
this.getPages();
}
ngOnDestroy(): void {
@ -68,16 +92,122 @@ 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() {
console.log('Edit menu item');
this.menuItemsModalOpen('Edit Menu Item', 'Save Changers');
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');
}
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;
@ -86,4 +216,24 @@ 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"
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility uk-text-truncate"
title="Compatibility">
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"

View File

@ -145,6 +145,7 @@ 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("");
@ -259,10 +260,13 @@ 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,7 +16,11 @@ 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" [href]="properties.domain + properties.searchLinkToAdvancedResults +'?f0=resultsubject&fv0='+getSubjectParameter(subject) ">{{subject}}</a>
<a class="uk-link-reset" *ngIf="specialSubjects.indexOf(subject) != -1"
[routerLink]=" properties.searchLinkToAdvancedResults"
[queryParams]="getSubjectParameter(subject)" >
{{subject}}
</a>
</span>
</ng-container>
</div>
@ -46,29 +50,28 @@ export class ShowSubjectsComponent {
@Input() classifiedSubjects: Map<string, string[]>;
properties = properties;
specialSubjects = [];
// private showClassifiedSbj: boolean = false;
constructor() {
if(properties.environment == 'development'){
if(properties.dashboard == "explore") {
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"
];
}
}
@ -80,6 +83,6 @@ export class ShowSubjectsComponent {
return Array.from(map.keys());
}
getSubjectParameter(param){
return '"' +encodeURIComponent(param)+'"';
return {'f0':'resultsubject','fv0':'"' +(param)+'"', size:50};
}
}

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,14 +139,15 @@ 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 {
@ -160,13 +161,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 => {
@ -174,7 +175,7 @@ export class OrganizationComponent {
}));
}
}
private getDivContents() {
if(this.communityId) {
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, this.communityId, this._router.url).subscribe(contents => {
@ -209,11 +210,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);
// }
@ -227,7 +228,7 @@ export class OrganizationComponent {
}
this.reloadDataproviders = false;
}
// private searchPublications() {
// this.fetchPublications.getResultsForEntity("publication", "organization", this.organizationId, 1, size, this.properties);
// }
@ -241,7 +242,7 @@ export class OrganizationComponent {
}
this.reloadPublications = false;
}
// private searchDatasets() {
// this.fetchDatasets.getResultsForEntity("dataset", "organization", this.organizationId, 1, this.searchNumber, this.properties);
// }
@ -283,13 +284,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(
@ -337,14 +338,17 @@ 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");
@ -352,7 +356,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);
@ -362,7 +366,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());
@ -371,26 +375,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(
@ -404,7 +408,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++) {
@ -417,7 +421,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);
@ -447,7 +451,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++) {
@ -460,7 +464,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);
@ -477,7 +481,7 @@ export class OrganizationComponent {
},
err => {
this.handleError("Error downloading file: " + filename, err);
this.closeLoading();
this.confirmOpenCsvError();
this.innerReportSubscriptions.forEach(subscription => subscription.unsubscribe());
@ -496,18 +500,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) {
@ -517,11 +521,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();
@ -530,19 +534,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;
@ -555,11 +559,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;
@ -568,15 +572,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;
@ -584,26 +588,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;
@ -614,7 +618,7 @@ export class OrganizationComponent {
closeDownloadReportModal() {
this.downloadReportModal.cancel();
}
openDownloadFunderReportModal() {
this.funder = this.fetchProjects.funders[0];
this.downloadFunderReportModal.cancelButton = false;
@ -634,7 +638,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') {
@ -657,7 +661,7 @@ export class OrganizationComponent {
}
}
}
public get total(): number {
let total = this.fetchPublications.searchUtils.totalResults;
total += this.fetchDatasets.searchUtils.totalResults;
@ -665,7 +669,7 @@ export class OrganizationComponent {
total += this.fetchOrps.searchUtils.totalResults;
return total;
}
// public get numberOfTabs(): number {
// if (this.tabsAreInitialized) {
// return this._numberOfTabs;
@ -724,7 +728,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" : "");
@ -740,7 +744,7 @@ export class OrganizationComponent {
return entityType + (plural ? "s" : "");
}
}
public scroll() {
HelperFunctions.scroll();
}

View File

@ -106,19 +106,17 @@
<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"
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>
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>{{" "}}
<span
*ngIf="projectInfo.openAccessMandatePublications != undefined && projectInfo.openAccessMandatePublications && (projectInfo.openAccessMandateDatasets == undefined || !projectInfo.openAccessMandateDatasets)"
class="uk-label custom-label label-open" title="Open Access mandate for Publications">
class="uk-label custom-label label-open uk-text-truncate" 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" title="Open Access mandate for Research Data">
class="uk-label custom-label label-open uk-text-truncate" title="Open Access mandate for Research Data">
Open Access mandate for Research Data
</span>{{" "}}
<span *ngIf="projectInfo.funding && projectInfo.funding.funderName"

View File

@ -152,6 +152,7 @@ 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 => {
@ -351,9 +352,12 @@ 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;
}
));
@ -380,9 +384,12 @@ 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,6 +143,7 @@ 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'];
@ -422,17 +423,19 @@ 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}});
}
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";
}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);
}
this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToSearchPage);
}
));
}
@ -660,7 +663,8 @@ 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 " title="Open Access mandate for Publications">Open Access mandate for Publications</span>
class="uk-label custom-label label-open uk-text-truncate" 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 " title="Open Access mandate for Research Data">Open Access mandate for Research Data</span>
class="uk-label custom-label label-open uk-text-truncate" 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 " 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 uk-text-truncate" 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,6 +14,7 @@ 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 {
@ -252,8 +253,8 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
// End of replacing part of getPages (now getAllPages)
getAllPages(helpContentUrl:string) {//,pid:string,with_positions:boolean=null) {
//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) {
// let parameters: string = "";
// if(pid || with_positions == true || with_positions == false) {
// parameters = "?";
@ -264,7 +265,7 @@ export class HelpContentService {
// parameters += "&with_positions="+with_positions;
// }
// }
return this.http.get<Array<Page>>(helpContentUrl + 'page')
return this.http.get<Array<Page>>(helpContentUrl + 'page?' + (pid?"pid="+pid:""))
//.map(res => <Array<Page>> res.json())
.pipe(catchError(this.handleError));
}
@ -314,6 +315,11 @@ 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= "uk-section-primary";
sectionClass= "";
subs: Subscription[] = [];
public divContents = null;

View File

@ -82,3 +82,8 @@ 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=""
<div id="stickyNavbar" [class]="'uk-navbar-container uk-sticky uk-navbar-transparent '+portal+'-menu'" uk-sticky="show-on-up: true"
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"
class="uk-label custom-label label-open uk-text-truncate"
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 " title="Open Access mandate for Research Data">
class="uk-label custom-label label-open uk-text-truncate " 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 "
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>{{' '}}