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..b5c0a683 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',
@@ -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();
diff --git a/claims/linking/selected/ClaimEntityTitle.component.ts b/claims/linking/selected/ClaimEntityTitle.component.ts
index 12231e53..c432a266 100644
--- a/claims/linking/selected/ClaimEntityTitle.component.ts
+++ b/claims/linking/selected/ClaimEntityTitle.component.ts
@@ -12,6 +12,9 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
assignment_turned_in
+
+ account_balance
+
people
@@ -46,6 +49,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 9f89224b..d756a77f 100644
--- a/dashboard/menu/menu.component.ts
+++ b/dashboard/menu/menu.component.ts
@@ -372,8 +372,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/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/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/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts
index 26c1f9d0..00e90aa8 100644
--- a/landingPages/landing-utils/parsingFunctions.class.ts
+++ b/landingPages/landing-utils/parsingFunctions.class.ts
@@ -665,6 +665,9 @@ export class ParsingFunctions {
}
if(properties.environment != "production" && classifiedSubjects != null) {
+ if (subjects == undefined) {
+ subjects = new Array();
+ }
for (let classified of classifiedSubjects.keys()) {
subjects = subjects.concat(classifiedSubjects.get(classified));
}
diff --git a/monitor-admin/topic/topic.component.html b/monitor-admin/topic/topic.component.html
index c264fee7..9e7e1bed 100644
--- a/monitor-admin/topic/topic.component.html
+++ b/monitor-admin/topic/topic.component.html
@@ -222,10 +222,6 @@
[queryParams]="{view: 'RESTRICTED'}"
(click)="hide(element)">Restricted view
-
diff --git a/monitor-admin/topic/topic.component.ts b/monitor-admin/topic/topic.component.ts
index 9c42c135..a7308db8 100644
--- a/monitor-admin/topic/topic.component.ts
+++ b/monitor-admin/topic/topic.component.ts
@@ -242,18 +242,30 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
}
topicChanged(callback: Function, save: boolean = false) {
+ if(this.topics && save) {
+ this.topics.disable();
+ }
+ if(this.categories) {
+ this.categories.disable();
+ }
+ if(this.subCategories) {
+ this.subCategories.disable();
+ }
if(callback) {
callback();
}
this.cdr.detectChanges();
if(this.topics && save) {
this.topics.init();
+ this.topics.enable();
}
if(this.categories) {
this.categories.init();
+ this.categories.enable();
}
if(this.subCategories) {
this.subCategories.init();
+ this.subCategories.enable();
}
}
@@ -378,15 +390,23 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
}
categoryChanged(callback: Function, save: boolean = false) {
+ if(this.categories && save) {
+ this.categories.disable();
+ }
+ if(this.subCategories) {
+ this.subCategories.disable();
+ }
if(callback) {
callback();
}
this.cdr.detectChanges();
if(this.categories && save) {
this.categories.init();
+ this.categories.enable();
}
if(this.subCategories) {
this.subCategories.init();
+ this.subCategories.enable();
}
}
@@ -512,12 +532,16 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit,
}
subCategoryChanged(callback: Function, save: boolean = false) {
+ if(this.subCategories && save) {
+ this.subCategories.disable();
+ }
if(callback) {
callback();
}
this.cdr.detectChanges();
if(this.subCategories && save) {
this.subCategories.init();
+ this.subCategories.enable();
}
}
diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts
index 3e76c8fc..04dc243d 100644
--- a/monitor-admin/utils/indicator-utils.ts
+++ b/monitor-admin/utils/indicator-utils.ts
@@ -7,14 +7,12 @@ import {
IndicatorPathType,
IndicatorType,
SourceType,
- Stakeholder, SubCategory,
- Topic,
+ Stakeholder,
Visibility,
} from "../../monitor/entities/stakeholder";
import {AbstractControl, ValidatorFn, Validators} from "@angular/forms";
import {Option} from "../../sharedComponents/input/input.component";
import {Session} from "../../login/utils/helper.class";
-import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {properties} from "src/environments/environment";
class Roles {
@@ -41,6 +39,11 @@ class Entities {
researchers = 'Researchers';
}
+export interface OAIndicator {
+ numerator: IndicatorPath;
+ denominator: IndicatorPath;
+}
+
export class StakeholderConfiguration {
public static ROLES: Roles = new Roles();
public static ENTITIES: Entities = new Entities();
@@ -63,6 +66,7 @@ export class StakeholderConfiguration {
public static CACHE_INDICATORS: boolean = true;
public static NUMBER_MULTI_INDICATOR_PATHS = false;
public static CHART_MULTI_INDICATOR_PATHS = true;
+ public static openAccess: Map
= new Map();
}
export class StakeholderUtils {
@@ -102,6 +106,10 @@ export class StakeholderUtils {
return StakeholderConfiguration.CHART_MULTI_INDICATOR_PATHS;
}
+ get openAccess(): Map {
+ return StakeholderConfiguration.openAccess;
+ }
+
visibilityIcon: Map = new Map(this.visibilities.map(option => [option.value, option.icon]));
defaultValue(options: Option[]) {
diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts
index 75b88d74..c4fbe21e 100644
--- a/monitor/entities/stakeholder.ts
+++ b/monitor/entities/stakeholder.ts
@@ -207,7 +207,7 @@ export class IndicatorPath {
type: IndicatorPathType;
source: SourceType;
url: string;
- safeResourceUrl: SafeResourceUrl; // initialize on front end
+ safeResourceUrl?: SafeResourceUrl; // initialize on front end
jsonPath: string[];
chartObject: string;
parameters: any;
diff --git a/services/organization.service.ts b/services/organization.service.ts
index b74bd92f..44a81633 100644
--- a/services/organization.service.ts
+++ b/services/organization.service.ts
@@ -95,7 +95,7 @@ export class OrganizationService {
}
}
- if(organization['pid'] && properties.environment != "production") {
+ if(organization['pid']) {
this.organizationInfo.identifiers = this.parsingFunctions.parseIdentifiers(organization['pid']);
}
}
diff --git a/services/searchOrganizations.service.ts b/services/searchOrganizations.service.ts
index 019b8146..2bf09fca 100644
--- a/services/searchOrganizations.service.ts
+++ b/services/searchOrganizations.service.ts
@@ -100,13 +100,16 @@ export class SearchOrganizationsService {
result['title'] = {"name": '', "accessMode": ''};
- if(resData.legalshortname) {
- result['title'].name = StringUtils.HTMLToString(String(resData.legalshortname));
- }
- if(!result['title'].name || result['title'].name == '') {
+ if(resData.legalname) {
result['title'].name = StringUtils.HTMLToString(String(resData.legalname));
+ } else {
+ result['title'].name = "";
}
+ if(resData.legalshortname) {
+ result['acronym'] = StringUtils.HTMLToString(String(resData.legalshortname));
+ }
+
//result['title'].url = OpenaireProperties.getsearchLinkToOrganization();
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
@@ -175,7 +178,7 @@ export class SearchOrganizationsService {
result.country = resData.country.classname;
}
- if(resData['pid'] && properties.environment != "production") {
+ if(resData['pid']) {
result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
}
diff --git a/shared/custom-route-reuse-strategy.ts b/shared/custom-route-reuse-strategy.ts
new file mode 100644
index 00000000..05bc2630
--- /dev/null
+++ b/shared/custom-route-reuse-strategy.ts
@@ -0,0 +1,7 @@
+import {ActivatedRouteSnapshot, BaseRouteReuseStrategy} from "@angular/router";
+
+export class CustomRouteReuseStrategy extends BaseRouteReuseStrategy {
+ shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean {
+ return future.routeConfig === curr.routeConfig || (!!future.routeConfig?.component && future.routeConfig?.component === curr.routeConfig?.component)
+ }
+}
\ No newline at end of file
diff --git a/utils/email/composer.ts b/utils/email/composer.ts
index ab3c69f0..21799076 100644
--- a/utils/email/composer.ts
+++ b/utils/email/composer.ts
@@ -108,6 +108,20 @@ export class Composer {
return email;
}
+ public static composeEmailForDevelopPersonalInfo(user: User): Email {
+ let email: Email = new Email();
+ email.subject = "Welcome to The OpenAIRE API mailing list";
+ email.body = ""
+ + "
Dear " + user.fullname + ",
"
+ + "
As a user of the OpenAIRE APIs, you are a member of the openaire-api mailing list. " +
+ " We will use this list to inform you of relevant news and updates. If you wish to unsubscribe, " +
+ " please send an email to the list admin at gbikas@openaire.eu " +
+ " and stefania.amodeo@openaire.eu.
"
+ + "
The OpenAIRE Graph team
";
+ email.recipients = [user.email];
+ return email;
+ }
+
public static composeEmailForDevelop(contactForm: any, admins: any, user: User): Email {
let email: Email = new Email();
email.subject = "OpenAIRE - Develop [" + properties.environment.toUpperCase() + "]";
diff --git a/utils/smooth-scroll.ts b/utils/smooth-scroll.ts
index c828b450..40014030 100644
--- a/utils/smooth-scroll.ts
+++ b/utils/smooth-scroll.ts
@@ -24,6 +24,7 @@ export class SmoothScroll {
} else if (event instanceof NavigationEnd) {
let headerOffset = (this.layoutService.isMobileValue?0:Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height'))) + 35;
if(!this.router.getCurrentNavigation().extras?.state?.disableScroll) {
+ let behavior = this.router.getCurrentNavigation().extras?.state?.behavior ? this.router.getCurrentNavigation().extras?.state?.behavior : "smooth";
if (this.interval) {
clearInterval(this.interval);
}
@@ -48,7 +49,7 @@ export class SmoothScroll {
} else {
clearInterval(interval);
const y = element.getBoundingClientRect().top + window.scrollY + yOffset;
- window.scrollTo({top: y, behavior: 'smooth'});
+ window.scrollTo({top: y, behavior: behavior});
}
}, 50);
}
@@ -58,7 +59,7 @@ export class SmoothScroll {
}, 100);
} else {
setTimeout( () => {
- window.scrollTo({top: 0, behavior: 'smooth'});
+ window.scrollTo({top: 0, behavior: behavior});
}, 0);
}
}
@@ -76,4 +77,4 @@ export class SmoothScroll {
clearInterval(this.interval);
}
}
-}
+}
\ No newline at end of file
diff --git a/utils/transition-group/transition-group.component.ts b/utils/transition-group/transition-group.component.ts
index 8cea910d..e5d9a484 100644
--- a/utils/transition-group/transition-group.component.ts
+++ b/utils/transition-group/transition-group.component.ts
@@ -30,13 +30,14 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy {
@Input()
public id: string;
public size: number;
+ private disabled: boolean = false;
private subscription: Subscription;
constructor(public element: ElementRef) {}
ngAfterViewInit() {
this.subscription = this.items.changes.subscribe(items => {
- if(items.length === this.size) {
+ if(items.length === this.size && !this.disabled) {
items.forEach(item => item.prevPos = item.newPos || item.prevPos);
items.forEach(this.runCallback);
this.refreshPosition('newPos');
@@ -126,17 +127,17 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy {
/**
* Enable transition
- * @deprecated
+ *
* */
enable() {
- console.debug('Deprecated')
+ this.disabled = false;
}
/**
* Disable transition
- * @deprecated
+ *
* */
disable() {
- console.debug('Deprecated')
+ this.disabled = true;
}
}