Compare commits
No commits in common. "a34744e1afd0ee591d0546ecc3e6e6990f13818a" and "edad40ad0bce0ffe073ec553931bb600360d2fff" have entirely different histories.
a34744e1af
...
edad40ad0b
|
@ -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) {
|
||||
|
|
|
@ -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>
|
|
@ -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 {
|
||||
|
@ -93,121 +69,15 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
|
|
@ -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)+'"';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,7 +139,6 @@ 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;
|
||||
|
@ -338,12 +337,9 @@ 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.showLoading = false;
|
||||
}
|
||||
));
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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.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.showLoading = false;
|
||||
}
|
||||
));
|
||||
|
|
|
@ -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,9 +422,8 @@ 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") {
|
||||
|
@ -433,9 +431,8 @@ export class ResultLandingComponent {
|
|||
} 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);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -82,8 +82,3 @@ export class SideMenuItem {
|
|||
items: RootMenuItem[] = [];
|
||||
ukIcon: string = '';
|
||||
}
|
||||
|
||||
export interface CheckMenuItem {
|
||||
menuItem: MenuItem;
|
||||
checked: boolean;
|
||||
}
|
||||
|
|
|
@ -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*="uk-section"]" cls-inactive="uk-navbar-transparent" style="">
|
||||
|
|
|
@ -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>{{' '}}
|
||||
|
|
Loading…
Reference in New Issue