diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts
index 70d46032..f84b0e59 100644
--- a/claims/directLinking/directLinking.component.ts
+++ b/claims/directLinking/directLinking.component.ts
@@ -1,7 +1,7 @@
import {Component, Input, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {EnvProperties} from '../../utils/properties/env-properties';
-import {ClaimEntity, ClaimProject, ShowOptions} from '../claim-utils/claimHelper.class';
+import {ClaimEntity, ClaimOrganization, ClaimProject, ShowOptions} from '../claim-utils/claimHelper.class';
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
import {SearchResearchResultsService} from '../../services/searchResearchResults.service';
import {LinkingGenericComponent} from "../linking/linkingGeneric.component";
@@ -11,6 +11,7 @@ import {properties} from "../../../../environments/environment";
import {OpenaireEntities} from "../../utils/properties/searchFields";
import {StringUtils} from "../../utils/string-utils.class";
import {ClaimProjectsSearchFormComponent} from "../claim-utils/claimProjectSearchForm.component";
+import {ClaimsProperties} from "../claim-utils/claims.properties";
@Component({
@@ -24,18 +25,20 @@ export class DirectLinkingComponent {
// linkType: string = "project"; // link type (selected in home page) : project, context, software, etc
/* url Parameters for inline linking */
- id: string = null; //entity id
+ @Input() id: string = null; //entity id
type: string = null; // entity type (publication or dataset)
// linkTo: string = null; // entity type (project or context or entity)
// linkToEntities: string[] = [];
showOptions:ShowOptions = new ShowOptions();
- validEntityTypes = ["dataset", "publication", "software", "other", "project", "context"];
+ validEntityTypes = ["dataset", "publication", "software", "other", "project", "context", "organization"];
sources: ClaimEntity[] = [];
inlineEntity: ClaimEntity = null;
validInput: boolean = null;//'true;
properties: EnvProperties;
@Input() communityId: string = null;
localStoragePrefix: string = "";
+ @Input() organizationClaim: boolean = false;
+ @Input() claimsProperties:ClaimsProperties = new ClaimsProperties();
constructor(private _router: Router, private route: ActivatedRoute,private entitySearch:EntitiesSearchService,
private _searchResearchResultsService: SearchResearchResultsService) {}
subscriptions = [];
@@ -48,11 +51,18 @@ export class DirectLinkingComponent {
}
ngOnInit() {
this.properties = properties;
-
+ /* if(!this.claimsProperties){
+ this.claimsProperties = new ClaimsProperties();
+ }*/
this.subscriptions.push(this.route.queryParams.subscribe(params => {
- this.id = params['id'];
- this.type = params['type'];
- this.showOptions.linkTo = params['linkTo'];
+ if(this.organizationClaim){
+ this.type = "organization";
+ this.showOptions.linkTo = "result";
+ }else {
+ this.id = params['id'];
+ this.type = params['type'];
+ this.showOptions.linkTo = params['linkTo'];
+ }
if (this.type != null && this.showOptions.linkTo != null) {
this.type = (this.validEntityTypes.indexOf(this.type) != -1) ? this.type : 'publication';
this.showOptions.linkTo = (this.validEntityTypes.indexOf(this.showOptions.linkTo) != -1 || this.showOptions.linkTo == "result") ? this.showOptions.linkTo : 'project';
@@ -68,6 +78,8 @@ export class DirectLinkingComponent {
if (this.type == "project") {
// this.linkType = "project";
this.getProjectById(this.id);
+ } else if (this.type == "organization") {
+ this.getOrganizationById(this.id);
} else if (this.type == "publication") {
this.getResearchResultById("publication", this.id);
} else if (this.type == "dataset") {
@@ -81,7 +93,7 @@ export class DirectLinkingComponent {
}
//set which entities it is allowed to link to.
// add first the
- if(this.type == "project"){
+ if(this.type == "project" || this.type == "organization"){
this.showOptions.linkToEntities = ["result"];
this.showOptions.linkTo = "result";
}else{
@@ -95,24 +107,27 @@ export class DirectLinkingComponent {
this.showOptions.linkToEntities = ["result","project","context" ];
}
+ }
+
+ } else {
+ this.validInput = this.isValidInput(null);
+
}
- } else {
- this.validInput = this.isValidInput(null);
+ }));
- }
-
- }));
}
isValidInput(result: ClaimEntity) {
if (result == null) {
return false;
- } else if (this.type == "project" && this.showOptions.linkTo != "result") {
+ } else if (this.type == "organization" && !this.claimsProperties.ALLOW_ORGANIZATION_LINKING) {
+ return false;
+ } else if ((this.type == "project" || this.type == "organization") && this.showOptions.linkTo != "result") {
return false;
} else if (["dataset", "publication", "software", "other"].indexOf(this.type) != -1 && (["project", "context", "result"].indexOf(this.showOptions.linkTo) == -1)) {
return false;
- } else if (["project", "dataset", "publication", "software", "other"].indexOf(this.type) == -1) {
+ } else if (["project", "dataset", "publication", "software", "other", "organization"].indexOf(this.type) == -1) {
return false;
} else {
return true;
@@ -130,6 +145,17 @@ export class DirectLinkingComponent {
this.handleError("Error getting project by id: " + id, err);
}));
}
+ getOrganizationById(id: string) {
+ this.subscriptions.push(this.entitySearch.fetchByType(id,"organization", this.properties).subscribe(
+ data => {
+ this.createClaimEntity(data, "organization");
+ },
+ err => {
+ this.validInput = this.isValidInput(null);
+ //console.log("An error occured")
+ this.handleError("Error getting project by id: " + id, err);
+ }));
+ }
getResearchResultById(resultType: string, id: string) {
this.subscriptions.push(this._searchResearchResultsService.searchById(resultType, id, this.properties).subscribe(data => {
@@ -162,7 +188,17 @@ export class DirectLinkingComponent {
entity.project.jurisdiction = project.jurisdiction;
entity.project.startDate = project.startDate;
this.inlineEntity = entity;
- }else{
+ }else if(type =="organization"){
+ let organization = data[0];
+ let entity:ClaimEntity = new ClaimEntity();
+ entity.id = organization.id;
+ entity.type = "organization";
+ entity.title = organization.label;
+ entity.organization = new ClaimOrganization();
+ // entity.organization.url = properties.searchLinkToOrganization + entity.id;
+ entity.organization.name = organization.label;
+ this.inlineEntity = entity;
+ }else{
results = ClaimResultSearchFormComponent.openaire2ClaimResults(data, this.properties);
}
diff --git a/claims/linking/insertClaim/insertClaim.component.ts b/claims/linking/insertClaim/insertClaim.component.ts
index 0cf983e5..4aebe5f3 100644
--- a/claims/linking/insertClaim/insertClaim.component.ts
+++ b/claims/linking/insertClaim/insertClaim.component.ts
@@ -176,7 +176,7 @@ export class ClaimInsertComponent {
"id": entity.id,
"record": ClaimInsertComponent.createDirectClaim(entity, this.sources, idSuffix)
});
- } else if (this.inlineEntity) {
+ } else if (this.inlineEntity && this.inlineEntity.type != "organization") {
directclaims.push({
"id": entity.id,
"record": ClaimInsertComponent.createDirectClaim(entity, [this.inlineEntity], idSuffix)
@@ -193,6 +193,8 @@ export class ClaimInsertComponent {
claims.push(ClaimInsertComponent.createContextClaim(result, entity, user.email, dashboard, idSuffix));
} else if (entity.project) {
claims.push(ClaimInsertComponent.createProjectClaim(result, entity, user.email, dashboard, idSuffix));
+ /* } else if (entity.organization) {
+ claims.push(ClaimInsertComponent.createOrganizationClaim(result, entity, user.email, dashboard, idSuffix));*/
}
this.infoToLog.push([ result.title?result.title: result.id, entity.title?entity.title:entity.id]);
@@ -212,6 +214,10 @@ export class ClaimInsertComponent {
if (entity.result) {
claims.push(ClaimInsertComponent.createProjectClaim(entity, this.inlineEntity, user.email, dashboard, idSuffix));
}
+ } else if (this.inlineEntity.organization) {
+ if (entity.result) {
+ claims.push(ClaimInsertComponent.createOrganizationClaim(entity, this.inlineEntity, user.email, dashboard, idSuffix));
+ }
}
}
@@ -385,8 +391,13 @@ export class ClaimInsertComponent {
localStorage.removeItem(this.localStoragePrefix + "results");
localStorage.removeItem(this.localStoragePrefix + "claimsJob");
localStorage.removeItem(this.localStoragePrefix + "feedRecordsJob");
-
- this._router.navigate([this.properties.myClaimsLink], {queryParams: this.params});
+ if(this.properties.myClaimsLink && this.properties.myClaimsLink.indexOf(".") == -1) {
+ this._router.navigate([this.properties.myClaimsLink], {queryParams: this.params});
+ }else if(this.properties.myClaimsLink && this.properties.myClaimsLink.indexOf(".") != -1) {
+ this._router.navigate([this.properties.myClaimsLink], {relativeTo: this.route});
+ }else{
+ this._router.navigate(["/"]);
+ }
}
}
@@ -426,6 +437,23 @@ export class ClaimInsertComponent {
idSuffix : idSuffix
};
}
+ private static createOrganizationClaim(resultEntity: ClaimEntity, organizationEntity: ClaimEntity, user: any, dashboard:string, idSuffix:string): ClaimRecord2Insert {
+ return {
+ claimedBy: user,
+ sourceId: organizationEntity.id,
+ sourceType: "organization",
+ sourceCollectedFrom: "openaire",
+ sourceAccessRights: "OPEN",
+ sourceEmbargoEndDate: "",
+ targetId: resultEntity.id,
+ targetType: resultEntity.type,
+ targetCollectedFrom: resultEntity.result.source,
+ targetAccessRights: resultEntity.result.accessRights,
+ targetEmbargoEndDate: ClaimInsertComponent.getEmbargoEndDate(resultEntity),
+ claimedInDashboard : dashboard,
+ idSuffix : idSuffix
+ };
+ }
private static createResultClaim(inlineResult: ClaimEntity, resultEntity: ClaimEntity, user: string, dashboard:string, idSuffix:string): ClaimRecord2Insert {
diff --git a/claims/linking/linkingGeneric.component.html b/claims/linking/linkingGeneric.component.html
index 16cb04bf..625d75d0 100644
--- a/claims/linking/linkingGeneric.component.html
+++ b/claims/linking/linkingGeneric.component.html
@@ -67,18 +67,19 @@
[results]="results" [sources]="sources"
[localStoragePrefix]="localStoragePrefix" [inlineEntity]="inlineEntity"
[showOptions]="showOptions" [properties]=properties [pageContents]="pageContents"
- [defaultColors]="!communityId" [communityId]="communityId"
+ [defaultColors]="!communityId" [communityId]="communityId" [claimsProperties]="claimsProperties"
>
-
+
-
Link source to
+
Link source to
+
{{claimsProperties.INLINE_ENTITY.guideText}}
-
-
Source
+
+
{{claimsProperties.BASKET.source_title}}
-
+
-
Link source to 0">({{(results.length) | number}})
+
{{claimsProperties.BASKET.target_title}} 0">({{(results.length) | number}})
diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts
index 31b76062..229fb9de 100644
--- a/claims/linking/linkingGeneric.component.ts
+++ b/claims/linking/linkingGeneric.component.ts
@@ -18,6 +18,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
import { Location } from '@angular/common';
import {LoginErrorCodes} from "../../login/utils/guardHelper.class";
import {UserManagementService} from "../../services/user-management.service";
+import {ClaimsProperties} from "../claim-utils/claims.properties";
@Component({
selector: 'linking-generic',
@@ -41,7 +42,7 @@ export class LinkingGenericComponent {
// show linkToEntities /values: result, project, context
@Input() sources:ClaimEntity[] =[];
- properties:EnvProperties;
+ properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() localStoragePrefix:string = "linking_";
url=null;
@@ -49,7 +50,7 @@ export class LinkingGenericComponent {
public pageContents = null;
@Input() breadcrumbs: Breadcrumb[] = [];
public routerHelper: RouterHelper = new RouterHelper();
-
+ @Input() claimsProperties:ClaimsProperties = new ClaimsProperties();
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
private _meta: Meta, private _title: Title, private _piwikService:PiwikService,
private seoService: SEOService, private helper: HelperService, private cdr: ChangeDetectorRef,
@@ -58,6 +59,9 @@ export class LinkingGenericComponent {
subscriptions = [];
ngOnInit() {
+ /* if(!this.claimsProperties){
+ this.claimsProperties = new ClaimsProperties();
+ }*/
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
if (!user) {
this.saveStateAndRedirectLogin();
@@ -68,14 +72,13 @@ export class LinkingGenericComponent {
this.breadcrumbs.push({name: "Link", route: null});
}
this.showOptions.show = 'source';
- this.showOptions.initSelectOptions();
+ this.showOptions.initSelectOptions(this.claimsProperties);
if(this.inlineEntity){
this.showOptions.showLinkTo();
// this.showOptions.basketShowLinksTo = true;
this.showOptions.show = this.showOptions.linkTo;
}
- this.properties = properties;
this.url = this.properties.domain + this.properties.baseLink+this._router.url;
var description = "Linking is a functionality provided by OpenAIRE, in order to link research results with a project, a research community or other research results.";
diff --git a/claims/linking/selected/ClaimEntitiesMetadata.module.ts b/claims/linking/selected/ClaimEntitiesMetadata.module.ts
index 444f3f9f..c4116c3c 100644
--- a/claims/linking/selected/ClaimEntitiesMetadata.module.ts
+++ b/claims/linking/selected/ClaimEntitiesMetadata.module.ts
@@ -3,13 +3,21 @@ import {SharedModule} from '../../../../openaireLibrary/shared/shared.module';
import {ClaimEntityTitleComponent} from "./ClaimEntityTitle.component";
import {ClaimEntityResultMetadataComponent} from "./ClaimEntityResultMetadata.component";
import {ClaimEntityProjectMetadataComponent} from "./ClaimEntityProjectMetadata.component";
+import {IconsService} from "../../../utils/icons/icons.service";
+import {coins} from "../../../utils/icons/icons";
+import {IconsModule} from "../../../utils/icons/icons.module";
@NgModule({
imports: [
- SharedModule
+ SharedModule,
+ IconsModule
],
declarations: [
ClaimEntityTitleComponent, ClaimEntityResultMetadataComponent, ClaimEntityProjectMetadataComponent
], exports:[ ClaimEntityTitleComponent, ClaimEntityResultMetadataComponent, ClaimEntityProjectMetadataComponent]
})
-export class ClaimEntitiesMetadataModule { }
+export class ClaimEntitiesMetadataModule {
+ constructor(private _iconsService:IconsService) {
+ this._iconsService.registerIcons([coins])
+ }
+}
diff --git a/claims/linking/selected/ClaimEntityProjectMetadata.component.ts b/claims/linking/selected/ClaimEntityProjectMetadata.component.ts
index 229ebeca..1d51a233 100644
--- a/claims/linking/selected/ClaimEntityProjectMetadata.component.ts
+++ b/claims/linking/selected/ClaimEntityProjectMetadata.component.ts
@@ -8,20 +8,28 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
- {{entity.type}}
+ {{entity.type == 'project' && entity.project.code == 'unidentified'?'funder':entity.type}}
{{(entity.project.startDate) ? entity.project.startDate : 'Unknown'}}{{'-' + ((entity.project.endDate) ? entity.project.endDate : 'Unknown')}}
-
+
+ funder
+
+
+
+
-
- Funder: {{entity.project.funderName?entity.project.funderName:entity.project.funderShortname}}
-
-
+
Project Code: {{entity.project.code}}
-
+
+
+ Funding: {{entity.project.funderName?entity.project.funderName:entity.project.funderShortname}}
+
+
`,
diff --git a/claims/linking/selected/ClaimEntityTitle.component.ts b/claims/linking/selected/ClaimEntityTitle.component.ts
index 12231e53..ab5a8db8 100644
--- a/claims/linking/selected/ClaimEntityTitle.component.ts
+++ b/claims/linking/selected/ClaimEntityTitle.component.ts
@@ -5,16 +5,18 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
selector: 'claim-title',
template: `
-
-
- insert_drive_file
-
-
- assignment_turned_in
-
-
- people
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -27,7 +29,15 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
{{entity.title ? sliceString(entity.title) : '[No title available]'}}
-
+
+
+ {{(entity.project.funderShortname ? '[' + entity.project.funderShortname + '] ' : '') + entity.project.funderName}}
+
+
+ {{sliceString(entity.project.funderName)}}
+
+
+
@@ -46,6 +56,9 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
+
+ {{sliceString(entity.title)}}
+
{{entity.context.community }} > {{entity.context.category}} >
diff --git a/claims/linking/selected/metadataPreview.component.html b/claims/linking/selected/metadataPreview.component.html
index a0723118..9a6dd093 100644
--- a/claims/linking/selected/metadataPreview.component.html
+++ b/claims/linking/selected/metadataPreview.component.html
@@ -6,15 +6,14 @@
-
+
-
+
-
SOURCES ({{sources.length + (inlineEntity ? 1 : 0) | number}})
+ {{claimsProperties.METADATA_PREVIEW.source_title}} ({{sources.length + (inlineEntity ? 1 : 0) | number}})
Edit
- sources
+ uk-icon="pencil" class="uk-margin-xsmall-right"> {{claimsProperties.METADATA_PREVIEW.edit_source_title}}
-
-
LINK TO ({{results.length | number}})
+
+
{{claimsProperties.METADATA_PREVIEW.target_title}} ({{results.length | number}})
+
diff --git a/claims/linking/selected/metadataPreview.component.ts b/claims/linking/selected/metadataPreview.component.ts
index 8aedd081..cd2ce799 100644
--- a/claims/linking/selected/metadataPreview.component.ts
+++ b/claims/linking/selected/metadataPreview.component.ts
@@ -4,6 +4,7 @@ import {ClaimEntity, ClaimsErrorMessage, Message, ShowOptions} from '../../claim
import {EnvProperties} from "../../../utils/properties/env-properties";
import {Dates} from "../../../utils/string-utils.class";
import {HelperFunctions} from "../../../utils/HelperFunctions.class";
+import {ClaimsProperties} from "../../claim-utils/claims.properties";
@Component({
selector: 'metadata-preview',
@@ -28,6 +29,7 @@ export class MetadataPreviewComponent {
@ViewChild(AlertModal) alertApplyAll;
@Input() localStoragePrefix: string = "";
@Input() communityId:string= null;
+ @Input() claimsProperties:ClaimsProperties;
errors:ClaimsErrorMessage[] = [];
warnings:Message[] = [];
public commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every entity
diff --git a/claims/linking/selected/metadataPreview.module.ts b/claims/linking/selected/metadataPreview.module.ts
index 2c7fdb17..7e414381 100644
--- a/claims/linking/selected/metadataPreview.module.ts
+++ b/claims/linking/selected/metadataPreview.module.ts
@@ -11,16 +11,17 @@ import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import {HelperModule} from "../../../utils/helper/helper.module";
import {SelectedPublicationsModule} from "./selectedResults.module";
+import {IconsModule} from "../../../utils/icons/icons.module";
@NgModule({
- imports: [
- SharedModule,
- AlertModalModule,
- ClaimEntitiesMetadataModule,
- InsertClaimsModule,
- MatDatepickerModule, MatNativeDateModule, MatFormFieldModule, MatInputModule, MatSelectModule,
- HelperModule, SelectedPublicationsModule
- ],
+ imports: [
+ SharedModule,
+ AlertModalModule,
+ ClaimEntitiesMetadataModule,
+ InsertClaimsModule,
+ MatDatepickerModule, MatNativeDateModule, MatFormFieldModule, MatInputModule, MatSelectModule,
+ HelperModule, SelectedPublicationsModule, IconsModule
+ ],
declarations: [MetadataPreviewComponent],
exports:[MetadataPreviewComponent]
})
diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts
index abf77901..11914b6c 100644
--- a/dashboard/menu/menu.component.ts
+++ b/dashboard/menu/menu.component.ts
@@ -370,8 +370,10 @@ export class MenuComponent implements OnInit {
}
public valueChange() {
+ this.elements.disable();
this.cdr.detectChanges();
this.elements.init();
+ this.elements.enable();
}
public get displayMenuItems() {
diff --git a/dashboard/users/role-users/role-users.component.html b/dashboard/users/role-users/role-users.component.html
index 88befe57..e4a39cc3 100644
--- a/dashboard/users/role-users/role-users.component.html
+++ b/dashboard/users/role-users/role-users.component.html
@@ -8,16 +8,16 @@
+ [searchControl]="filterForm.get('active')" [expandable]="true" [placeholder]="'Search ' + roleUtils.roles[role] + 's'" searchInputClass="outer">
@@ -27,7 +27,7 @@
[attr.uk-tooltip]="inviteDisableMessage" [class.uk-disabled]="loadPending || loadPending"
[disabled]="loadActive || loadPending || !!inviteDisableMessage" (click)="openInviteModal()">
-
Invite {{stakeholderUtils.roles[role]}}
+
Invite {{roleUtils.roles[role]}}
@@ -47,16 +47,16 @@
-
No {{stakeholderUtils.roles[role]}}s found
-
No pending {{stakeholderUtils.roles[role]}} invitations found
+
No {{roleUtils.roles[role]}}s found
+
No pending {{roleUtils.roles[role]}} invitations found
0) || (!showCurrent && showPending.length > 0)">
-
1)?(stakeholderUtils.roles[role] + 's'):role"
+ 1)?(roleUtils.roles[role] + 's'):role"
(pageChange)="updateActivePage($event)"
[page]="activePage" [pageSize]="pageSize"
[totalResults]="showActive.length">
- 1?'invitations':'invitation')"
+ 1?'invitations':'invitation')"
(pageChange)="updatePendingPage($event)"
[page]="pendingPage" [pageSize]="pageSize"
[totalResults]="showPending.length">
@@ -109,12 +109,12 @@
- Are you sure you want to remove {{selectedUser}} from {{stakeholderUtils.roles[role]}}s?
+ Are you sure you want to remove {{selectedUser}} from {{roleUtils.roles[role]}}s?
- Are you sure you want to cancel {{stakeholderUtils.roles[role]}} invitation of {{selectedUser}} ?
+ Are you sure you want to cancel {{roleUtils.roles[role]}} invitation of {{selectedUser}} ?
{
+ this.subs.push(this.userRegistryService.getActive(this._type, this.id, this.role, true).subscribe(users => {
this.active = users;
this.filterActiveBySearch(this.filterForm.value.active);
this.loadActive = false;
@@ -156,7 +160,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}
this.loadActive = false;
}));
- this.subs.push(this.userRegistryService.getPending(this.type, this.id, this.role, true).subscribe(users => {
+ this.subs.push(this.userRegistryService.getPending(this._type, this.id, this.role, true).subscribe(users => {
this.pending = users;
this.filterPendingBySearch(this.filterForm.value.pending);
this.loadPending = false;
@@ -185,7 +189,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
openDeleteModal(item: any) {
if (this.showCurrent) {
this.selectedUser = item.email;
- this.deleteModal.alertTitle = 'Delete ' + this.stakeholderUtils.roles[this.role];
+ this.deleteModal.alertTitle = 'Delete ' + this.roleUtils.roles[this.role];
this.deleteModal.open();
} else {
this.selectedUser = item;
@@ -195,7 +199,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}
openInviteModal() {
- this.inviteModal.alertTitle = 'Invite ' + this.stakeholderUtils.roles[this.role];
+ this.inviteModal.alertTitle = 'Invite ' + this.roleUtils.roles[this.role];
this.inviteModal.okButtonLeft = false;
this.inviteModal.okButtonText = 'Send';
this.emailsForm = this.fb.array([], Validators.required);
@@ -208,8 +212,8 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
this.createRoleModal.okButtonLeft = false;
this.createRoleModal.okButtonText = 'Create';
this.roleFb = this.fb.group({
- name: this.fb.control(Role.roleName(this.type, this.id), Validators.required),
- description: this.fb.control(Role.roleName(this.type, this.id), Validators.required)
+ name: this.fb.control(Role.roleName(this._type, this.id), Validators.required),
+ description: this.fb.control(Role.roleName(this._type, this.id), Validators.required)
});
setTimeout(() => {
this.roleFb.get('name').disable();
@@ -220,7 +224,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
deleteActive() {
this.loadActive = true;
- this.subs.push(this.userRegistryService.remove(this.type, this.id, this.selectedUser, this.role).subscribe(() => {
+ this.subs.push(this.userRegistryService.remove(this._type, this.id, this.selectedUser, this.role).subscribe(() => {
this.active = this.active.filter(user => user.email != this.selectedUser);
if (this.currentActivePage.length === 0) {
this.activePage = 1;
@@ -239,13 +243,13 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
deletePending() {
this.loadPending = true;
- this.subs.push(this.userRegistryService.cancelInvitation(this.type, this.id, this.selectedUser, this.role).subscribe(() => {
+ this.subs.push(this.userRegistryService.cancelInvitation(this._type, this.id, this.selectedUser, this.role).subscribe(() => {
this.pending = this.pending.filter(user => user != this.selectedUser);
this.filterPendingBySearch(this.filterForm.value.pending);
if (this.currentPendingPage.length === 0) {
this.pendingPage = 1;
}
- NotificationHandler.rise(StringUtils.capitalize(this.stakeholderUtils.roles[this.role]) + ' invitation to ' + this.selectedUser + ' has been canceled ');
+ NotificationHandler.rise(StringUtils.capitalize(this.roleUtils.roles[this.role]) + ' invitation to ' + this.selectedUser + ' has been canceled ');
this.loadPending = false;
}, error => {
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
@@ -266,7 +270,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
let current = null;
let invitations = (>this.emailsForm.value).map(email => {
current = email;
- return this.userRegistryService.invite(this.type, this.id, {
+ return this.userRegistryService.invite(this._type, this.id, {
link: this.link,
email: this.emailComposer(this.name, email, this.role)
}, this.role).pipe(catchError(error => {
@@ -294,7 +298,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}
} else {
NotificationHandler.rise('An error has occurred while sending the invitation mail to ' +
- response.email + '.Check if the user is already a ' + this.stakeholderUtils.roles[this.role] + ' or try again later', 'danger');
+ response.email + '.Check if the user is already a ' + this.roleUtils.roles[this.role] + ' or try again later', 'danger');
return of(null);
}
});
@@ -309,12 +313,12 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
createGroup() {
this.loadActive = true;
this.loadPending = true;
- this.userRegistryService.createRole(this.type, this.id).subscribe(() => {
+ this.userRegistryService.createRole(this._type, this.id).subscribe(() => {
NotificationHandler.rise('Group has been successfully created ');
this.updateLists();
}, error => {
if(error.status === 409) {
- NotificationHandler.rise('Group already exists. You can try to invite a ' + this.stakeholderUtils.roles[this.role] + ' instead.', 'warning');
+ NotificationHandler.rise('Group already exists. You can try to invite a ' + this.roleUtils.roles[this.role] + ' instead.', 'warning');
this.updateLists();
} else {
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
@@ -337,11 +341,11 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}
public get isManager(): boolean {
- return this.isCurator || !!Session.isManager(this.type, this.id, this.user);
+ return this.isCurator || !!Session.isManager(this._type, this.id, this.user);
}
public get isCurator(): boolean {
- return this.isPortalAdmin || !!Session.isCurator(this.type, this.user);
+ return this.isPortalAdmin || !!Session.isCurator(this._type, this.user);
}
public get isPortalAdmin(): boolean {
diff --git a/fos/fos.component.html b/fos/fos.component.html
index 1d0c8bf5..5bc80108 100644
--- a/fos/fos.component.html
+++ b/fos/fos.component.html
@@ -36,9 +36,11 @@
-
+
+
-
+
-
+ 0" [id]="selectedParentLevels[0].id+'||'+selectedParentLevels[1].code+'||'+selectedParentLevels[2].code">
+
+
+ Back
+
+
+
+
@@ -137,10 +223,16 @@
class="uk-link-text" [innerHTML]="highlightKeyword(subItem.id)">
-
diff --git a/fos/fos.component.ts b/fos/fos.component.ts
index 3065b2c0..e86317ea 100644
--- a/fos/fos.component.ts
+++ b/fos/fos.component.ts
@@ -16,6 +16,7 @@ import {debounceTime, distinctUntilChanged} from "rxjs/operators";
import Timeout = NodeJS.Timeout;
import {ISVocabulariesService} from "../utils/staticAutoComplete/ISVocabularies.service";
import {SearchFields} from "../utils/properties/searchFields";
+import {HelperFunctions} from "../utils/HelperFunctions.class";
declare var UIkit;
@@ -28,6 +29,8 @@ export class FosComponent implements OnInit, OnDestroy {
public url: string = null;
public pageTitle: string = "OpenAIRE | Fields of Science";
public pageDescription: string = "We have integrated a Field-of-Science (FoS) taxonomy into our dataset to organize and discover research more effectively. Using the full capabilities of the OpenAIRE Graph (full-texts, citations, references, venues) we apply AI and bring forward any multidisciplinarity potential.";
+ public scrollPos = 0;
+ public selectedParentLevels = [];
public fos: any[] = [];
public fosOptions: string[] = [];
public activeSection: string;
@@ -82,21 +85,43 @@ export class FosComponent implements OnInit, OnDestroy {
item.classList.remove('uk-active');
});
if (this.route.snapshot.fragment) {
- this.activeSection = this.route.snapshot.fragment;
- let i = this.fos.findIndex(item => item.id == this.route.snapshot.fragment);
- slider.show(i);
+ let splitFragment = this.route.snapshot.fragment.split("||");
+ this.activeSection = this.route.snapshot.fragment.split("||")[0];
+ let i = this.fos.findIndex(item => (item.id == this.route.snapshot.fragment || this.route.snapshot.fragment.startsWith(item.id+"||")));
+ if(i <0 || i>this.fos.length-1) {
+ this._router.navigate(['./'], {fragment: "", relativeTo: this.route, state: {disableScroll: true}});
+ } else {
+ if (splitFragment.length > 1) {
+ let level1 = this.fos[i];
+ let level2 = null;
+ let level3 = null;
+ if (level1.children) {
+ level2 = level1.children.find(item => item.code == splitFragment[1]);
+ if (level2 && level2.children) {
+ level3 = level2.children.find(item => item.code == splitFragment[2]);
+ this.selectedParentLevels = [this.fos[i], level2, level3];
+ }
+ }
+ if(!level2 || !level3) {
+ this._router.navigate(['./'], {fragment: level1.id, relativeTo: this.route, state: {disableScroll: true}});
+ }
+ } else {
+ slider.show(i);
+ }
+ }
} else {
this.activeSection = this.fos[0].id;
}
this.cdr.detectChanges();
});
}
+
this.subscriptions.push(this.route.fragment.subscribe(fragment => {
if(fragment) {
- this.activeSection = fragment;
+ this.activeSection = fragment.split("||")[0];
if(this.tabs) {
let slider = UIkit.slider(this.tabs.nativeElement);
- let i = this.fos.findIndex(item => item.id == fragment);
+ let i = this.fos.findIndex(item => (item.id == fragment || fragment.startsWith(item.id+"||")));
slider.show(i);
}
} else {
@@ -105,13 +130,16 @@ export class FosComponent implements OnInit, OnDestroy {
}));
this.keywordControl = this.fb.control('');
this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => {
- this.keyword = value;
- this.findMatches(this.keyword);
- if (typeof IntersectionObserver !== 'undefined') {
- setTimeout(() => {
- this.setObserver();
- });
- }
+ if(this.keyword !== undefined || value) {
+ this.selectedParentLevels = [];
+ }
+ this.keyword = value;
+ this.findMatches(this.keyword);
+ if (typeof IntersectionObserver !== 'undefined') {
+ setTimeout(() => {
+ this.setObserver();
+ });
+ }
}));
});
}
@@ -154,11 +182,16 @@ export class FosComponent implements OnInit, OnDestroy {
this.fos.forEach(fos => {
this.fosOptions.push(fos.id);
if(fos.children) {
- fos.children.forEach(child => {
- this.fosOptions.push(child.id);
- if(child.children) {
- child.children.forEach(child2 => {
- this.fosOptions.push(child2.id);
+ fos.children.forEach(l2 => {
+ this.fosOptions.push(l2.id);
+ if(l2.children) {
+ l2.children.forEach(l3 => {
+ this.fosOptions.push(l3.id);
+ if(l3.children) {
+ l3.children.forEach(l4 => {
+ this.fosOptions.push(l4.id);
+ })
+ }
});
}
});
@@ -170,19 +203,29 @@ export class FosComponent implements OnInit, OnDestroy {
this.viewResults = JSON.parse(JSON.stringify(this.fos));
let matchLevel1: boolean = false;
let matchLevel2: boolean = false;
+ let matchLevel3: boolean = false;
// 1st level search
if(this.viewResults.length) {
this.viewResults = this.viewResults.filter(item => {
matchLevel1 = !!item.id.includes(value?.toLowerCase());
- // // 2nd level search
+ // 2nd level search
if(item.children?.length && !matchLevel1) {
item.children = item.children.filter(subItem => {
matchLevel2 = !!subItem.id.includes(value?.toLowerCase());
// 3rd level search
if(subItem.children?.length && !matchLevel2) {
- subItem.children = subItem.children.filter(subSubItem => subSubItem.id.includes(value?.toLowerCase()));
+ subItem.children = subItem.children.filter(subSubItem => {
+ matchLevel3 = subSubItem.id.includes(value?.toLowerCase());
+ // 4th level search
+ if(subSubItem.children?.length && !matchLevel3) {
+ subSubItem.children = subSubItem.children.filter(level4Item => {
+ return level4Item.id.toLowerCase().includes(value?.toLowerCase())
+ });
+ }
+ return subSubItem.children?.length > 0 || matchLevel3;
+ });
}
- return subItem.children?.length > 0 || matchLevel2;
+ return subItem.children?.length > 0;
});
}
return item.children?.length > 0;
@@ -191,7 +234,7 @@ export class FosComponent implements OnInit, OnDestroy {
}
highlightKeyword(name) {
- if(name.includes(this.keyword.toLowerCase())) {
+ if(name.toLowerCase().includes(this.keyword.toLowerCase())) {
return name.replace(new RegExp(this.keyword, "gi"), (matchedValue) => `
${matchedValue} `);
} else {
return name;
@@ -221,4 +264,41 @@ export class FosComponent implements OnInit, OnDestroy {
// return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)};
return (this.searchFieldsHelper.getFosParameter() == 'foslabel' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)}));
}
+
+ public backClicked() {
+ let id = this.selectedParentLevels[0].id;
+ this.selectedParentLevels=[];
+ this.cdr.detectChanges();
+
+ if(this.scrollPos) {
+ HelperFunctions.scrollTo(0, this.scrollPos);
+ this._router.navigate(['./'], {fragment: id, relativeTo: this.route, state: {disableScroll: true}});
+ } else {
+ this._router.navigate(['./'], {
+ fragment: id,
+ relativeTo: this.route,
+ state: {disableScroll: false, behavior: 'auto'}
+ });
+ }
+
+ this.cdr.detectChanges();
+ if (typeof IntersectionObserver !== 'undefined') {
+ setTimeout(() => {
+ this.setObserver();
+ }, 200);
+ }
+ }
+
+ public moreClicked(level1, level2, level3) {
+ this.scrollPos = window.scrollY;
+
+ if(this.observer) {
+ this.observer.disconnect();
+ }
+ this.selectedParentLevels=[level1, level2, level3];
+ this.cdr.detectChanges();
+ this._router.navigate(['./'],
+ {fragment: this.selectedParentLevels[0].id+"||"+this.selectedParentLevels[1].code+"||"+this.selectedParentLevels[2].code,
+ relativeTo: this.route, state: {disableScroll: false, behavior: 'auto'}});
+ }
}
diff --git a/landingPages/dataProvider/relatedDatasourcesTab.component.ts b/landingPages/dataProvider/relatedDatasourcesTab.component.ts
index c8b1b25d..8c7662ad 100644
--- a/landingPages/dataProvider/relatedDatasourcesTab.component.ts
+++ b/landingPages/dataProvider/relatedDatasourcesTab.component.ts
@@ -17,8 +17,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
-
- *Only top 100 {{openaireEntities.DATASOURCES}} that host {{openaireEntities.RESULTS}} which are also available via the Federated Research Data Repository are shown.
+
90" class="uk-text-meta uk-margin-medium-bottom">
+ *Only top 100 {{openaireEntities.DATASOURCES}} that host {{openaireEntities.RESULTS}} which are also available via {{collectedFromName}} are shown.
pageSize" [type]="openaireEntities.DATASOURCES"
[page]="page" [pageSize]="pageSize"
diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts
index 85fef1ea..507afcb8 100644
--- a/landingPages/landing-utils/availableOn.component.ts
+++ b/landingPages/landing-utils/availableOn.component.ts
@@ -33,8 +33,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
-
-
+
+
+
diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts
index d27eb26e..42e74781 100644
--- a/landingPages/landing-utils/entity-metadata.component.ts
+++ b/landingPages/landing-utils/entity-metadata.component.ts
@@ -159,7 +159,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}
projectsLimit">