Merge branch 'master' of code-repo.d4science.org:MaDgIK/openaire-library
This commit is contained in:
commit
5c215af73e
|
@ -13,11 +13,11 @@
|
||||||
<span class="clickable" uk-icon="more-vertical"></span>
|
<span class="clickable" uk-icon="more-vertical"></span>
|
||||||
<div #element uk-dropdown="mode: click; pos: bottom-right; offset: 10; delay-hide: 0; flip: false">
|
<div #element uk-dropdown="mode: click; pos: bottom-right; offset: 10; delay-hide: 0; flip: false">
|
||||||
<ul class="uk-nav uk-dropdown-nav">
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
<li>
|
<li (click)="editRootMenu()">
|
||||||
<a>Edit</a>
|
<a>Edit</a>
|
||||||
</li>
|
</li>
|
||||||
<hr class="uk-nav-divider">
|
<hr class="uk-nav-divider">
|
||||||
<li>
|
<li (click)="deleteRootMenu()">
|
||||||
<a>Delete</a>
|
<a>Delete</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="uk-visible-toggle">
|
<li (click)="newRootMenu()" class="uk-visible-toggle">
|
||||||
<span class="clickable">
|
<span class="clickable">
|
||||||
<span class="uk-icon-button small portal-icon-button">
|
<span class="uk-icon-button small portal-icon-button">
|
||||||
<icon name="add"></icon>
|
<icon name="add"></icon>
|
||||||
|
@ -120,11 +120,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<modal-alert #editModal [okDisabled]="menuItemForm && (menuItemForm.invalid || menuItemForm.dirty)">
|
<modal-alert #editModal [okDisabled]="menuItemForm && (menuItemForm.invalid || !menuItemForm.dirty)">
|
||||||
<form *ngIf="menuItemForm" [formGroup]="menuItemForm" class="uk grid uk-child-width-1-1" uk-grid>
|
<form *ngIf="menuItemForm" [formGroup]="menuItemForm" class="uk grid uk-child-width-1-1" uk-grid>
|
||||||
<div dashboard-input [formInput]="menuItemForm.get('name')" type="text" label="Name" placeholder="Write a name"></div>
|
<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>
|
<div dashboard-input [formInput]="menuItemForm.get('type')" type="select" label="Type" placeholder="Choose a type" [options]="typeOptions"></div>
|
||||||
<div dashboard-input [formInput]="menuItemForm.get('route')" type="text" label="Route" placeholder="Write a route"></div>
|
<!-- Workflow for EXTERNAL -->
|
||||||
<div dashboard-input [formInput]="menuItemForm.get('url')" type="text" label="URL" placeholder="Write a URL"></div>
|
<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>create a new one</a></div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</modal-alert>
|
</modal-alert>
|
|
@ -13,6 +13,7 @@ import {Title} from "@angular/platform-browser";
|
||||||
import {AlertModal} from '../../utils/modal/alert';
|
import {AlertModal} from '../../utils/modal/alert';
|
||||||
import {CheckMenuItem, MenuItem} from '../../sharedComponents/menu';
|
import {CheckMenuItem, MenuItem} from '../../sharedComponents/menu';
|
||||||
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
|
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
|
||||||
|
import {Option} from '../../sharedComponents/input/input.component';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -32,6 +33,7 @@ export class MenuComponent implements OnInit {
|
||||||
|
|
||||||
// public rootMenuForm: FormGroup;
|
// public rootMenuForm: FormGroup;
|
||||||
public menuItemForm: FormGroup;
|
public menuItemForm: FormGroup;
|
||||||
|
public allPages = [];
|
||||||
|
|
||||||
public keyword = '';
|
public keyword = '';
|
||||||
|
|
||||||
|
@ -85,15 +87,33 @@ export class MenuComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// public newRootMenu() {
|
public newRootMenu() {
|
||||||
// this.rootMenuForm = this._fb.group({
|
this.menuItemForm = this._fb.group({
|
||||||
// id: this._fb.control(null),
|
id: this._fb.control(""),
|
||||||
// title: this._fb.control("",Validators.required),
|
title: this._fb.control("",Validators.required),
|
||||||
// route: this._fb.control(""),
|
type: this._fb.control("",Validators.required),
|
||||||
// isEnabled: this._fb.control("",Validators.required),
|
route: this._fb.control(""),
|
||||||
// });
|
url: this._fb.control(""),
|
||||||
// this.menuItemsModalOpen('Create Root Menu', 'Save Changes');
|
isEnabled: this._fb.control("",Validators.required),
|
||||||
// }
|
});
|
||||||
|
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[] {
|
public getSelectedMenuItems(): string[] {
|
||||||
return this.checkboxes.filter(menuItem => menuItem.checked == true).map(checkedMenuItem => checkedMenuItem.menuItem).map(res => res.id);
|
return this.checkboxes.filter(menuItem => menuItem.checked == true).map(checkedMenuItem => checkedMenuItem.menuItem).map(res => res.id);
|
||||||
|
@ -155,7 +175,7 @@ export class MenuComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
public onSearchClose() {
|
public onSearchClose() {
|
||||||
this.selectedKeyword = this.filterForm.value;
|
this.selectedKeyword = this.filterForm.get('keyword').value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public reset() {
|
public reset() {
|
||||||
|
|
|
@ -145,6 +145,7 @@ export class DataProviderComponent {
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
this.getPageContents();
|
this.getPageContents();
|
||||||
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
|
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.subscriptions.push(this.route.queryParams.subscribe(data => {
|
||||||
this.updateTitle("Content provider");
|
this.updateTitle("Content provider");
|
||||||
this.updateDescription("");
|
this.updateDescription("");
|
||||||
|
@ -259,11 +260,14 @@ export class DataProviderComponent {
|
||||||
"page_type": "dataprovider"
|
"page_type": "dataprovider"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}else if(err.name == "TimeoutError"){
|
||||||
|
this.errorMessage = 'An error occurred please try again later';
|
||||||
|
}else {
|
||||||
this.errorMessage = 'No dataProvider found';
|
this.errorMessage = 'No dataProvider found';
|
||||||
this.showLoading = false;
|
|
||||||
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToDataProviders);
|
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToDataProviders);
|
||||||
}
|
}
|
||||||
|
this.showLoading = false;
|
||||||
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,7 @@ export class OrganizationComponent {
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
this.getPageContents();
|
this.getPageContents();
|
||||||
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
|
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.subscriptions.push(this.route.queryParams.subscribe(params => {
|
||||||
this.organizationInfo = null;
|
this.organizationInfo = null;
|
||||||
|
@ -337,9 +338,12 @@ export class OrganizationComponent {
|
||||||
"page_type": "organization"
|
"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.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToOrganizations);
|
||||||
this.errorMessage = 'No organization found';
|
this.errorMessage = 'No organization found';
|
||||||
|
}
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
|
@ -152,6 +152,7 @@ export class ProjectComponent {
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
this.getPageContents();
|
this.getPageContents();
|
||||||
this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url);
|
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.subscriptions.push(this.route.queryParams.subscribe(params => {
|
||||||
|
@ -351,9 +352,12 @@ export class ProjectComponent {
|
||||||
this.handleError("Error getting project for id: " + this.projectId, err);
|
this.handleError("Error getting project for id: " + this.projectId, err);
|
||||||
if(err.status == 404) {
|
if(err.status == 404) {
|
||||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "project"}});
|
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.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
|
||||||
this.errorMessage = 'No project found';
|
this.errorMessage = 'No project found';
|
||||||
|
}
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
@ -380,9 +384,12 @@ export class ProjectComponent {
|
||||||
this.handleError("Error getting project for grant id: " + grantId + " and funder: " + funder, err);
|
this.handleError("Error getting project for grant id: " + grantId + " and funder: " + funder, err);
|
||||||
if(err.status == 404) {
|
if(err.status == 404) {
|
||||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "project"}});
|
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.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
|
||||||
this.errorMessage = 'No project found';
|
this.errorMessage = 'No project found';
|
||||||
|
}
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
|
@ -143,6 +143,7 @@ export class ResultLandingComponent {
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
this.getPageContents();
|
this.getPageContents();
|
||||||
this.updateUrl(this.properties.domain +this.properties.baseLink + this._router.url);
|
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.subscriptions.push(this.route.queryParams.subscribe(data => {
|
||||||
if (data['articleId']) {
|
if (data['articleId']) {
|
||||||
this.id = data['articleId'];
|
this.id = data['articleId'];
|
||||||
|
@ -422,8 +423,9 @@ export class ResultLandingComponent {
|
||||||
this.handleError("Error getting " + this.type + " for " + (this.id ? ("id: " + this.id) : ("pid: " + this.identifier.id + " ("+this.identifier.class+")")), err);
|
this.handleError("Error getting " + this.type + " for " + (this.id ? ("id: " + this.id) : ("pid: " + this.identifier.id + " ("+this.identifier.class+")")), err);
|
||||||
if (err.status == 404) {
|
if (err.status == 404) {
|
||||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": this.type}});
|
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") {
|
if (this.type == "publication" || this.type == "software") {
|
||||||
this.errorMessage = 'No ' + this.type + ' found';
|
this.errorMessage = 'No ' + this.type + ' found';
|
||||||
} else if (this.type == "dataset") {
|
} else if (this.type == "dataset") {
|
||||||
|
@ -431,9 +433,10 @@ export class ResultLandingComponent {
|
||||||
} else if (this.type == "orp") {
|
} else if (this.type == "orp") {
|
||||||
this.errorMessage += "No research product found";
|
this.errorMessage += "No research product found";
|
||||||
}
|
}
|
||||||
this.showLoading = false;
|
|
||||||
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToSearchPage);
|
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToSearchPage);
|
||||||
}
|
}
|
||||||
|
this.showLoading = false;
|
||||||
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue