[Connect Admin | Library | new-theme]: Removed RootMenuItem | Fixes in wording.

1. app.component.ts: Removed deprecated RootMenuItem and used MenuItem instead.
2. criteria.component.ts: Import OpenaireEntities and set variable openaireEntities.
3. criteria.component.html: [Bug fix] Use openaireEntities in no filters message.
4. searchAll.component.ts: [Bug fix] In method "getDefaultEntityToShow()", return "datasources" instead of "content providers".
5. add-content-providers.component.ts: [Bug fix] In error messages use "data sources" wording instead of "content providers".
6. manage-zenodo-communities.component.html: [Bug fix] In <no-load-paging>, set type to "Zenodo communities".
This commit is contained in:
Konstantina Galouni 2022-09-21 10:29:11 +03:00
parent 95e23ea67c
commit fcc23ec289
6 changed files with 53 additions and 54 deletions

View File

@ -1,5 +1,5 @@
import {ChangeDetectorRef, Component, HostListener, OnInit} from '@angular/core'; import {ChangeDetectorRef, Component, HostListener, OnInit} from '@angular/core';
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu'; import {MenuItem} from './openaireLibrary/sharedComponents/menu';
import {ActivatedRoute, Data, NavigationEnd, Params, Router} from '@angular/router'; import {ActivatedRoute, Data, NavigationEnd, Params, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {Session, User} from './openaireLibrary/login/utils/helper.class'; import {Session, User} from './openaireLibrary/login/utils/helper.class';
@ -33,7 +33,7 @@ export class AppComponent implements OnInit {
isFrontPage: boolean = false; isFrontPage: boolean = false;
sideBarItems: MenuItem[] = []; sideBarItems: MenuItem[] = [];
specialSideBarMenuItem: MenuItem = null; specialSideBarMenuItem: MenuItem = null;
menuItems: RootMenuItem[] = []; menuItems: MenuItem[] = [];
menuHeader: Header = { menuHeader: Header = {
route: "/", route: "/",
url: null, url: null,
@ -221,36 +221,36 @@ export class AppComponent implements OnInit {
this.specialSideBarMenuItem = new MenuItem("back", "Manage communities", "", "/", false, [], null, {}, {name: 'search', class: 'uk-text-secondary'}); this.specialSideBarMenuItem = new MenuItem("back", "Manage communities", "", "/", false, [], null, {}, {name: 'search', class: 'uk-text-secondary'});
this.menuItems = []; this.menuItems = [];
this.menuItems.push({ this.menuItems.push(new MenuItem("home", "Home",
rootItem: new MenuItem("home", "Home",
"https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/", "", false, [], null, null "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/", "", false, [], null, null
, null, null, null, null, "_self"), items: [] , null, null, null, null, "_self")
}); );
this.menuItems.push({
rootItem: new MenuItem("deposit", "Deposit", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/participate/deposit/learn-how", "", false, [], ['/participate/deposit/learn-how'], null, null, null, null, null, "_self"),
items: []
});
this.menuItems.push( this.menuItems.push(
{ new MenuItem("deposit", "Deposit", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/participate/deposit/learn-how", "", false, [], ['/participate/deposit/learn-how'], null, null, null, null, null, "_self")
rootItem: new MenuItem("link", "Link", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/claim", "", false, [], ['/participate/claim'], null, null, null, null, null, "_self"), );
items: [ this.menuItems.push(
new MenuItem("link", "Link", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/claim", "", false, [], ['/participate/claim'], null, null, null, null, null, "_self",
"_internal", false,
[
new MenuItem("", "Start linking", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/claim", "", false, [], ['/participate/claim'], null, null, null, null, null, "_self"), new MenuItem("", "Start linking", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/claim", "", false, [], ['/participate/claim'], null, null, null, null, null, "_self"),
new MenuItem("", "Learn more", this.properties.claimsInformationLink, "", false, [], [], null), new MenuItem("", "Learn more", this.properties.claimsInformationLink, "", false, [], [], null),
] ]
}); )
);
this.menuItems.push( this.menuItems.push(
{ new MenuItem("search", "Search", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find", "", false, [], ["/search/find"], null, null, null, null, null, "_self",
rootItem: new MenuItem("search", "Search", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find", "", false, [], ["/search/find"], null, null, null, null, null, "_self"), "internal", false,
items: [ [
new MenuItem("", OpenaireEntities.RESULTS, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/research-outcomes?resultbestaccessright=\"" + encodeURIComponent("Open Access") + '"', "", false, [], ["/search/find/research-outcomes"], null, null, null, null, null, "_self"), new MenuItem("", OpenaireEntities.RESULTS, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/research-outcomes?resultbestaccessright=\"" + encodeURIComponent("Open Access") + '"', "", false, [], ["/search/find/research-outcomes"], null, null, null, null, null, "_self"),
new MenuItem("", OpenaireEntities.PROJECTS, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/projects", "", false, [], ["/search/find/projects"], null, null, null, null, null, "_self"), new MenuItem("", OpenaireEntities.PROJECTS, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/projects", "", false, [], ["/search/find/projects"], null, null, null, null, null, "_self"),
new MenuItem("", OpenaireEntities.DATASOURCES, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/dataproviders", "", false, [], ["/search/find/dataproviders"], null, null, null, null, null, "_self") new MenuItem("", OpenaireEntities.DATASOURCES, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/dataproviders", "", false, [], ["/search/find/dataproviders"], null, null, null, null, null, "_self")
] ]
}); )
);
this.menuItems.push( this.menuItems.push(
{ new MenuItem("about", "About", "", "", false, [], [], {},
rootItem: new MenuItem("about", "About", "", "", false, [], [], {}), null, null, null, null, "_blank", "internal", false,
items: [ [
new MenuItem("", "Supporting organizations", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/organizations", "", false, [], ["/organizations"], null, null, null, null, null, "_self"), new MenuItem("", "Supporting organizations", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/organizations", "", false, [], ["/organizations"], null, null, null, null, null, "_self"),
new MenuItem("", "Curators", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/curators", "", false, [], ["/organizations"], null, null, null, null, null, "_self"), new MenuItem("", "Curators", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/curators", "", false, [], ["/organizations"], null, null, null, null, null, "_self"),
new MenuItem("", "Sources and methodology", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/content", "", false, [], ["/content"], null, null, null, null, null, "_self"), new MenuItem("", "Sources and methodology", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/content", "", false, [], ["/content"], null, null, null, null, null, "_self"),
@ -258,20 +258,17 @@ export class AppComponent implements OnInit {
new MenuItem("", "Subjects", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/subjects", "", false, [], ["/subjects"], null, null, null, null, null, "_self"), new MenuItem("", "Subjects", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/subjects", "", false, [], ["/subjects"], null, null, null, null, null, "_self"),
new MenuItem("", "Projects and funding Opportunities", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/projects", "", false, [], ["/projects"], null, null, null, null, null, "_self") new MenuItem("", "Projects and funding Opportunities", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/projects", "", false, [], ["/projects"], null, null, null, null, null, "_self")
] ]
}); )
this.menuItems.push({ );
rootItem: new MenuItem("develop", "Develop", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/develop", "", false, [], ['/develop'], null, null, null, null, null, "_self"), this.menuItems.push(
items: [] new MenuItem("develop", "Develop", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/develop", "", false, [], ['/develop'], null, null, null, null, null, "_self"),
}); );
// if (this.isManager) { // if (this.isManager) {
this.menuItems.push( this.menuItems.push(
{ new MenuItem("manage", "Manage",
// rootItem: new MenuItem("manage", "Manage", "", "/"+this.community.communityId, false, [], [], {}), "", "/"+this.community.communityId, false, [], null, {},
// items: [] null, null, null, "/"+this.community.communityId)
rootItem: new MenuItem("manage", "Manage", );
"", "/"+this.community.communityId, false, [], null, {}
, null, null, null, "/"+this.community.communityId), items: []
});
// } // }
} else { } else {
this.headerLogoUrl = null; this.headerLogoUrl = null;
@ -287,20 +284,20 @@ export class AppComponent implements OnInit {
menuPosition: "center" menuPosition: "center"
}; };
this.menuItems = []; this.menuItems = [];
this.menuItems.push({ this.menuItems.push(
rootItem: new MenuItem("about", "About", this.headerUrl + "/about/learn-how", "", false, [], [], {}, null, null, null, null, "_self"), new MenuItem("about", "About", this.headerUrl + "/about/learn-how", "", false, [], [], {}, null, null, null, null, "_self",
items: [ "internal", false,
new MenuItem("", "Learn the process", this.headerUrl + "/about/learn-how", "", false, [], [], {}, null, null, null, null, "_self"), [
new MenuItem("", "Publications", this.headerUrl + "/publications", "", false, [], [], {}, null, null, null, null, "_self"), new MenuItem("", "Learn the process", this.headerUrl + "/about/learn-how", "", false, [], [], {}, null, null, null, null, "_self"),
new MenuItem("", "Roadmap", "https://trello.com/b/yfzUz0kp/openaire-connect-dashboard", "", false, [], [], {}), new MenuItem("", "Publications", this.headerUrl + "/publications", "", false, [], [], {}, null, null, null, null, "_self"),
new MenuItem("", "FAQs", this.headerUrl + "/about/faq", "", false, [], [], {}, null, null, null, null, "_self") new MenuItem("", "Roadmap", "https://trello.com/b/yfzUz0kp/openaire-connect-dashboard", "", false, [], [], {}),
] new MenuItem("", "FAQs", this.headerUrl + "/about/faq", "", false, [], [], {}, null, null, null, null, "_self")
]
}); )
this.menuItems.push({ );
rootItem: new MenuItem("communities", "Communities", this.headerUrl + "/search/find/communities", "", false, [], [], {}, null, null, null, null, "_self"), this.menuItems.push(
items: [] new MenuItem("communities", "Communities", this.headerUrl + "/search/find/communities", "", false, [], [], {}, null, null, null, null, "_self")
}); );
if(this.isCurator()) { if(this.isCurator()) {
this.sideBarItems.push(new MenuItem("communities", "Manage communities", "", "/", false, [], [], {}, {name: 'settings'})); this.sideBarItems.push(new MenuItem("communities", "Manage communities", "", "/", false, [], [], {}, {name: 'settings'}));
} }

@ -1 +1 @@
Subproject commit 876b51d4205c7941862b5455f0763df7a66ffcd1 Subproject commit 95c9301aa30211212e8db43b1757f66718c308bc

View File

@ -173,10 +173,10 @@ export class AddContentProvidersComponent implements OnInit {
}, },
error => { error => {
if (error.status == '404') { if (error.status == '404') {
this.handleError('No OpenAIRE content providers found.', error); this.handleError('No OpenAIRE data sources found.', error);
this.openaireSearchUtils.status = this.errorCodes.NOT_FOUND; this.openaireSearchUtils.status = this.errorCodes.NOT_FOUND;
} else if (error.status == '500') { } else if (error.status == '500') {
this.handleError('An Error Occurred. No OpenAIRE content providers found.', error); this.handleError('An Error Occurred. No OpenAIRE data sources found.', error);
this.openaireSearchUtils.status = this.errorCodes.ERROR; this.openaireSearchUtils.status = this.errorCodes.ERROR;
} else { } else {
this.handleError('Service temporarily unavailable. Please try again later.', error); this.handleError('Service temporarily unavailable. Please try again later.', error);

View File

@ -12,8 +12,8 @@
</div> </div>
<div *ngIf="criteria.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold"> <div *ngIf="criteria.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div *ngIf="dataProvider">No filters for {{dataProvider.officialname}}.</div> <div *ngIf="dataProvider">No filters for {{dataProvider.officialname}}.</div>
<div>If no filters are specified, all research results of this content provider will be included in your <div>If no filters are specified, all {{openaireEntities.RESULTS | lowercase}} of this {{openaireEntities.DATASOURCE | lowercase}} will be included in your
community. {{openaireEntities.COMMUNITY | lowercase}}.
</div> </div>
</div> </div>
<form *ngIf="criteria.length > 0" [formGroup]="selectionCriteria"> <form *ngIf="criteria.length > 0" [formGroup]="selectionCriteria">

View File

@ -14,6 +14,7 @@ import {MatSlideToggleChange} from "@angular/material/slide-toggle";
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class"; import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
import {CriteriaUtils} from "../criteria-utils"; import {CriteriaUtils} from "../criteria-utils";
import {NotificationHandler} from "../../../openaireLibrary/utils/notification-handler"; import {NotificationHandler} from "../../../openaireLibrary/utils/notification-handler";
import {OpenaireEntities} from "../../../openaireLibrary/utils/properties/searchFields";
@Component({ @Component({
selector: 'criteria', selector: 'criteria',
@ -31,6 +32,7 @@ export class CriteriaComponent implements OnInit {
/** Paging */ /** Paging */
public page: number = 1; public page: number = 1;
public pageSize: number = 5; public pageSize: number = 5;
public openaireEntities = OpenaireEntities;
constructor(private manageCommunityContentProvidersService: ManageCommunityContentProvidersService, constructor(private manageCommunityContentProvidersService: ManageCommunityContentProvidersService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,

View File

@ -41,7 +41,7 @@
</div> </div>
</div> </div>
<div *ngIf="previewCommunities.length > 0"> <div *ngIf="previewCommunities.length > 0">
<no-load-paging [type]="'content providers'" <no-load-paging [type]="'Zenodo communities'"
(pageChange)="updatePage($event)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="size" [page]="page" [pageSize]="size"
[totalResults]="previewCommunities.length"> [totalResults]="previewCommunities.length">