Merge remote-tracking branch 'origin/develop' into umbrella

This commit is contained in:
Konstantinos Triantafyllou 2024-06-04 13:58:13 +03:00
commit 472eeef326
23 changed files with 73 additions and 109 deletions

View File

@ -129,7 +129,7 @@ export class ClaimContextSearchFormComponent {
}
select(communityId, communityLabel) {
console.log("SELECT", communityId)
// console.log("SELECT", communityId)
this.selectedCommunityId = communityId;
this.selectedCommunityLabel = communityLabel;
this.getCategories();

View File

@ -202,6 +202,6 @@ export class ShowOptions {
options.push({value: 'context',label: OpenaireEntities.COMMUNITIES})
}
this.selectOptions = options;
console.log(options, claimProperties.SELECT_ENTITIES.projects)
// console.log(options, claimProperties.SELECT_ENTITIES.projects)
}
}

View File

@ -329,7 +329,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
delete() {
let claimsToBeDeleted = ((this.index != null) ? [this.claims[this.index].id] : this.selected.map(claim => claim.id));
console.log(claimsToBeDeleted);
// console.log(claimsToBeDeleted);
this.subscriptions.push(this._claimService.deleteBulk(claimsToBeDeleted, this.properties.claimsAPIURL).subscribe(
res => {
if (this.index != null) {

View File

@ -108,7 +108,6 @@ export class SearchOrcidService {
static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any {
console.log(data)
if (data[2] != null) {
if (addId) {
authorIds.push(data[2].path);
@ -128,9 +127,7 @@ export class SearchOrcidService {
if (data[3] != null) {
author['institution'] = data[3];
}
console.log(author['institution'])
authors.push(author);
return true;
}
return false;

View File

@ -1,3 +1,4 @@
<loading *ngIf="validInput === null" [full]="true" class="uk-position-center"></loading>
<linking-generic *ngIf="validInput" [localStoragePrefix]="localStoragePrefix" [results]="results" [sources]="sources"
[communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions"
pageTitle="Direct Linking" [claimsProperties]="claimsProperties">

View File

@ -8,12 +8,13 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {LinkingGenericModule} from '../linking/linkingGeneric.module';
import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({
imports: [
SharedModule,
EntitySearchServiceModule, SearchResearchResultsServiceModule,
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule, LoadingModule
],
providers:[],
declarations: [

View File

@ -133,11 +133,11 @@ export class BulkClaimComponent {
}
});
}
upload() {
this.enableUpload = false;
this.showReport = false;
this.errorMessage = "";
console.log(this.filesToUpload);
if (this.filesToUpload.length == 0) {
this.errorMessage = "There is no selected file to upload.";
return;

View File

@ -232,7 +232,7 @@ export class ClaimInsertComponent {
data => {
this.feedRecordsJob = data.data;
this.records2Insert = directclaims.length;
console.log(data);
// console.log(data);
// this.insertedRecords = data.insertedIds;
//
// this.errorInRecords = data.errorInClaims;

View File

@ -132,42 +132,6 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {end: true, offset: footer_offset});
}
/**
* @deprecated
*
* Should be smooth
*
* */
private observeBottom() {
let bottom = document.getElementById('bottom');
if (bottom) {
let bottomObs = new IntersectionObserver(entries => {
entries.forEach(entry => {
this.shouldSticky = !entry.isIntersecting;
})
});
this.subscriptions.push(bottomObs);
bottomObs.observe(bottom);
}
}
/**
* @deprecated
* */
private observeHeader() {
if (this.header) {
let headerObs = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.boundingClientRect.height > 0) {
this.layoutService.setReplaceHeader(!entry.isIntersecting);
}
})
});
this.subscriptions.push(headerObs);
headerObs.observe(this.header.nativeElement);
}
}
private observeStickyFooter() {
if (this.sticky_footer) {
let resizeObs = new ResizeObserver(entries => {

View File

@ -1,4 +1,4 @@
import {Injectable} from "@angular/core";
import {AfterViewInit, Injectable} from "@angular/core";
import {BehaviorSubject, Observable, Subscriber} from "rxjs";
import {ActivationStart, Router} from "@angular/router";
import {Icon} from "../../../sharedComponents/menu";
@ -92,6 +92,7 @@ export class LayoutService {
* Display help pop-up on non-admin pages. (default true for the rest of the pages)
* */
private hasHelpPopUpSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
private isBottomIntersectingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
private subscriptions: any[] = [];
ngOnDestroy() {
@ -119,6 +120,20 @@ export class LayoutService {
this.subscriptions.push(resizeObs);
resizeObs.observe(document.documentElement);
}
if(typeof document !== "undefined") {
setTimeout(() => {
let bottom = document.getElementById('bottom');
if (bottom) {
let bottomObs = new IntersectionObserver(entries => {
entries.forEach(entry => {
this.isBottomIntersectingSubject.next(entry.isIntersecting);
})
});
this.subscriptions.push(bottomObs);
bottomObs.observe(bottom);
}
}, 500)
}
}
constructor(private router: Router) {
@ -355,4 +370,8 @@ export class LayoutService {
setHasHelpPopUp(value: boolean) {
this.hasHelpPopUpSubject.next(value);
}
get isBottomIntersecting(): Observable<boolean> {
return this.isBottomIntersectingSubject.asObservable();
}
}

View File

@ -40,7 +40,7 @@
<a [routerLink]="getItemRoute(item)" [title]="item.title" (click)="item.items.length === 0?closeOffcanvas():null"
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
<div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto">
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" ratio="0.9" [svg]="item.icon.svg" [flex]="true"></icon>
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" [ratio]="item.icon.ratio?item.icon.ratio:0.9" [svg]="item.icon.svg" [flex]="true"></icon>
</div>
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
<span *ngIf="item.items.length > 0" class="uk-nav-parent-icon hide-on-close"></span>

View File

@ -2,7 +2,7 @@
<schema2jsonld *ngIf="dataProviderInfo"
[data]=dataProviderInfo [URL]="canonicalUrl" type="datasource"
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
<div *ngIf="dataProviderInfo && !dataProviderInfo.belongsTo" [innerHTML]="dataProviderInfo.message"
<div *ngIf="dataProviderInfo && !dataProviderInfo.belongsTo && !isBottomIntersecting" [innerHTML]="dataProviderInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->

View File

@ -148,14 +148,13 @@ export class DataProviderComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
subscriptions = [];
private sub: Subscription;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = "";
public viewAllMobile: string = "";
@ -198,6 +197,11 @@ export class DataProviderComponent {
ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
@ -261,16 +265,6 @@ export class DataProviderComponent {
} else {
this.offset = 0;
}
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) {
this.observeGraphAndFeedback();
}

View File

@ -3,7 +3,7 @@
[URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId"
type="organization">
</schema2jsonld>
<div *ngIf="organizationInfo && !organizationInfo.belongsTo" [innerHTML]="organizationInfo.message"
<div *ngIf="organizationInfo && !organizationInfo.belongsTo && !isBottomIntersecting" [innerHTML]="organizationInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->

View File

@ -115,8 +115,6 @@ export class OrganizationComponent {
public graph_height: number = 0;
@ViewChild("graph_and_feedback") graph_and_feedback;
// public shouldSticky: boolean = true;
subscriptions = [];
innerReportSubscriptions = [];
properties: EnvProperties;
@ -131,6 +129,7 @@ export class OrganizationComponent {
public deleteByInferenceOpened: boolean = false;
public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
public mobileContent: "info" | "actions" = "info";
public viewAllMobile: string = "";
@ -162,6 +161,11 @@ export class OrganizationComponent {
ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.properties = properties;
if (typeof document !== 'undefined') {
@ -218,16 +222,6 @@ export class OrganizationComponent {
} else {
this.offset = 0;
}
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) {
this.observeGraphAndFeedback();
}

View File

@ -2,7 +2,7 @@
<schema2jsonld *ngIf="projectInfo"
[data]=projectInfo [URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId"
type="project"></schema2jsonld>
<div *ngIf="projectInfo && !projectInfo.belongsTo" [innerHTML]="projectInfo.message"
<div *ngIf="projectInfo && !projectInfo.belongsTo && !isBottomIntersecting" [innerHTML]="projectInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->

View File

@ -169,14 +169,13 @@ export class ProjectComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
subscriptions = [];
private sub: Subscription;
properties: EnvProperties;
public openaireEntities = OpenaireEntities;
public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = "";
public viewAllMobile: string = "";
@ -209,6 +208,11 @@ export class ProjectComponent {
ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.properties = properties;
if (typeof document !== 'undefined') {
@ -278,16 +282,6 @@ export class ProjectComponent {
} else {
this.offset = 0;
}
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) {
this.observeGraphAndFeedback();
}
@ -467,7 +461,6 @@ export class ProjectComponent {
data => {
this.projectInfo = data;
this.projectInfo.setBelongsTo(id);
console.log(this.projectInfo);
this.projectInfo.id = this.projectId;
this.actionsAfterGettingProjectInfo();

View File

@ -2,7 +2,7 @@
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
[data]=resultLandingInfo.record [URL]="canonicalUrl"
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
<div *ngIf="resultLandingInfo && !resultLandingInfo.belongsTo" [innerHTML]="resultLandingInfo.message"
<div *ngIf="resultLandingInfo && !resultLandingInfo.belongsTo && !isBottomIntersecting" [innerHTML]="resultLandingInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->

View File

@ -155,8 +155,6 @@ export class ResultLandingComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = "";
public viewAllMobile: string = "";
@ -164,6 +162,7 @@ export class ResultLandingComponent {
@ViewChild("sdgFosSuggest") sdgFosSuggest: SdgFosSuggestComponent;
public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
// Full screen modals for small screens (mobile)
@ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent;
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
@ -208,6 +207,11 @@ export class ResultLandingComponent {
ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.isLoggedIn = !!user;
@ -294,16 +298,6 @@ export class ResultLandingComponent {
} else {
this.offset = 0;
}
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) {
this.observeGraphAndFeedback();
}

View File

@ -1,7 +1,8 @@
export interface Icon {
name?: string,
svg?: string,
class?: string
class?: string,
ratio?: number
}
export class MenuItem {

View File

@ -70,7 +70,7 @@ export class BelongsTo {
if (field) {
field = Object.assign({}, field);
let json: any = element;
if (field.path.length > 0) {
if (field.path.length > 0 && json) {
if (Array.isArray(json)) {
return json.findIndex(value => BelongsTo.check(value, field)) != -1;
} else {
@ -209,7 +209,7 @@ export class ResultLandingInfo {
this.belongsTo = !BelongsTo.result || BelongsTo.result.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
this.message = !this.belongsTo ? BelongsTo.result.message : null;
if (this.message) {
this.message = this.message.replace('((result))', StringUtils.getEntityName(this.resultType));
this.message = this.message.replace('((result))', StringUtils.capitalizeAll(StringUtils.getEntityName(this.resultType)));
this.message = this.message.replace('((type_id))', typeId);
this.message = this.message.replace('((id))', id);
}

View File

@ -3,9 +3,11 @@
<span *ngIf="result.acronym">
{{result.acronym}}
</span>
<ng-container *ngIf="result.acronym != result.title">
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
</ng-container>
</div>
<div *ngIf="!result.title && !result.acronym">
[no title available]

View File

@ -444,8 +444,12 @@ export class StringUtils {
return <string []>words;
}
public static capitalize(value: string): string {
return value.charAt(0).toUpperCase() + value.slice(1);
public static capitalizeAll(str: string): string {
return str.split(' ').map(value => StringUtils.capitalize(value)).join(' ');
}
public static capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.slice(1);
}
/**