[Explore | Library | new-theme]: resources.service.ts & menu.ts & navigationBar.component.ts & navigationBar.component.html & app.component.ts: Removed deprecated RootMenuItem and used MenuItem instead.

This commit is contained in:
Konstantina Galouni 2022-09-20 18:00:20 +03:00
parent a194132dfe
commit 89b51d9838
1 changed files with 15 additions and 22 deletions

View File

@ -2,7 +2,7 @@ import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
import {MenuItem} from './openaireLibrary/sharedComponents/menu';
import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
import {Session, User} from './openaireLibrary/login/utils/helper.class';
@ -51,7 +51,7 @@ import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields"
export class AppComponent {
isClient: boolean = false;
userMenuItems: MenuItem[] = [];
menuItems: RootMenuItem [] = [];
menuItems: MenuItem [] = [];
feedbackmail: string;
properties: EnvProperties = properties;
user: User;
@ -115,36 +115,29 @@ export class AppComponent {
new MenuItem("", OpenaireEntities.OTHER, "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], {type: '"' + encodeURIComponent("other") + '"'})];
//TODO add check for research results route
this.menuItems = [
{
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {qf: true}),
items: [
new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {qf: true},
null, null, null, null, "_blank", "internal", false,
[
researchOutcomesMenu,
new MenuItem("", OpenaireEntities.PROJECTS, "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], {}),
new MenuItem("", OpenaireEntities.DATASOURCES, "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {}),
new MenuItem("", OpenaireEntities.ORGANIZATIONS, "", "/search/find/organizations/", false, ["organization"], ["/search/find/organizations"], {})
]
},
{
rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], {}),
//rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], {}),
items: []
//rootItem: new MenuItem("share", "Share", "", "", false, [], ["/participate/deposit-publications", "/participate/deposit-datasets"], {}),
//items: [new MenuItem("", "Publications", "", "/participate/deposit-publications", false, ["publication"], ["/participate/deposit-publications"], {}),
// new MenuItem("", "Research Data", "", "/participate/deposit-datasets", false, ["dataset"], ["/participate/deposit-datasets"], {})]
},
{
rootItem: new MenuItem("link", "Link", "", "/participate/claim", false, [], ["/participate/claim"], {}),
items: [new MenuItem("", "Start linking", "", "/participate/claim", false, [], ["/participate/claim"], {}),
),
new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], {}),
new MenuItem("link", "Link", "", "/participate/claim", false, [], ["/participate/claim"], {},
null, null, null, null, "_blank", "internal", false,
[new MenuItem("", "Start linking", "", "/participate/claim", false, [], ["/participate/claim"], {}),
new MenuItem("", "Learn more", this.properties.claimsInformationLink, "", false, [], [], {})]
},
{
rootItem: new MenuItem("datasources", OpenaireEntities.DATASOURCES, "", "", false, ["datasource"], [], {}),
items: [new MenuItem("", "Data Policies", "https://beta.openaire.eu/oa-policies-mandates", "", false, ["datasource"], [""], {}),
),
new MenuItem("datasources", OpenaireEntities.DATASOURCES, "", "", false, ["datasource"], [], {},
null, null, null, null, "_blank", "internal", false,
[new MenuItem("", "Data Policies", "https://beta.openaire.eu/oa-policies-mandates", "", false, ["datasource"], [""], {}),
new MenuItem("", "Repositories", "", "/search/content-providers", false, ["datasource"], ["/search/content-providers"], {}),
new MenuItem("", "Journals", "", "/search/journals", false, ["datasource"], ["/search/journals"], {}),
new MenuItem("", "Registries", "", "/search/entity-registries", false, ["datasource"], ["/search/entity-registries"], {}),
new MenuItem("", "Browse all", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {})]
}
)
];
if (Session.isPortalAdministrator(this.user)) {
this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {}));