Production release July 2024 [EXPLORE] #47
|
@ -8,33 +8,36 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
|
||||||
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
||||||
|
|
||||||
import {DeletedByInferenceService} from './deletedByInference.service';
|
import {DeletedByInferenceService} from './deletedByInference.service';
|
||||||
import {ResultPreview} from "../../../utils/result-preview/result-preview";
|
import {HostedByCollectedFrom, ResultPreview} from "../../../utils/result-preview/result-preview";
|
||||||
import {AlertModal} from "../../../utils/modal/alert";
|
import {AlertModal} from "../../../utils/modal/alert";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
import {properties} from "../../../../../environments/environment";
|
import {properties} from "../../../../../environments/environment";
|
||||||
import {HelperFunctions} from "../../../utils/HelperFunctions.class";
|
import {HelperFunctions} from "../../../utils/HelperFunctions.class";
|
||||||
|
import {Dates, StringUtils} from "../../../utils/string-utils.class";
|
||||||
|
import {ParsingFunctions} from "../../landing-utils/parsingFunctions.class";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'deletedByInference',
|
selector: 'deletedByInference',
|
||||||
template: `
|
template: `
|
||||||
<div id="versions_container">
|
<div id="versions_container">
|
||||||
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
|
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
|
||||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
|
||||||
|
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
|
||||||
(pageChange)="updatePage($event)"
|
(pageChange)="updatePage($event)"
|
||||||
[page]="page" [pageSize]="pageSize"
|
[page]="page" [pageSize]="pageSize"
|
||||||
[totalResults]="results.length">
|
[totalResults]="resultsPreview.length">
|
||||||
</no-load-paging>
|
</no-load-paging>
|
||||||
<ul class="uk-list uk-margin">
|
<ul class="uk-list uk-margin">
|
||||||
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
|
<li *ngFor="let result of resultsPreview.slice((page-1)*pageSize, page*pageSize)">
|
||||||
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)"
|
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="result"
|
||||||
[showOrcid]="false" [prevPath]="prevPath" [showInline]="true"
|
[showOrcid]="false" [prevPath]="prevPath" [showInline]="true"
|
||||||
[isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview>
|
[isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
|
||||||
(pageChange)="updatePage($event)"
|
(pageChange)="updatePage($event)"
|
||||||
[page]="page" [pageSize]="pageSize"
|
[page]="page" [pageSize]="pageSize"
|
||||||
[totalResults]="results.length">
|
[totalResults]="resultsPreview.length">
|
||||||
</no-load-paging>
|
</no-load-paging>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -42,7 +45,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
|
||||||
export class DeletedByInferenceComponent {
|
export class DeletedByInferenceComponent {
|
||||||
@Input() isMobile: boolean = false;
|
@Input() isMobile: boolean = false;
|
||||||
@Input() prevPath: string = "";
|
@Input() prevPath: string = "";
|
||||||
public results: ResultLandingInfo[] = [];
|
public resultsPreview: ResultPreview[] = [];
|
||||||
|
@Input() children = [];
|
||||||
@Input() id: string;
|
@Input() id: string;
|
||||||
@Input() ids: string[] = [];
|
@Input() ids: string[] = [];
|
||||||
@Input() type: string;
|
@Input() type: string;
|
||||||
|
@ -74,7 +78,7 @@ export class DeletedByInferenceComponent {
|
||||||
this.errorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.status = this.errorCodes.LOADING;
|
this.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.getDeletedByInference();
|
this.parseDeletedByInference();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,25 +89,89 @@ export class DeletedByInferenceComponent {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeletedByInference() {
|
public parseDeletedByInference() {
|
||||||
this.results = [];
|
let parsingFunctions: ParsingFunctions = new ParsingFunctions();
|
||||||
this.status = this.errorCodes.LOADING;
|
let length = Array.isArray(this.children) ? this.children.length : 1;
|
||||||
this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe(
|
for (let i = 0; i < length; i++) {
|
||||||
data => {
|
let result = Array.isArray(this.children) ? this.children[i] : this.children;
|
||||||
this.results = data;
|
let preview = new ResultPreview();
|
||||||
this.status = this.errorCodes.DONE;
|
if(result.hasOwnProperty("creator")) {
|
||||||
},
|
preview.authors = [];
|
||||||
error => {
|
let authorsLength = Array.isArray(result.creator) ? result.creator.length : 1;
|
||||||
if (error.status == '404') {
|
for (let j = 0; j < authorsLength; j++) {
|
||||||
this.status = this.errorCodes.NOT_FOUND;
|
let author = {"fullName": Array.isArray(result.creator) ? result.creator[j] : result.creator, "orcid": null, "orcid_pending": null};
|
||||||
} else if (error.status == '500') {
|
preview.authors.push(author);
|
||||||
this.status = this.errorCodes.ERROR;
|
|
||||||
} else {
|
|
||||||
this.status = this.errorCodes.NOT_AVAILABLE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
if(result.hasOwnProperty("dateofacceptance")) {
|
||||||
|
preview.year = new Date(result.dateofacceptance).getFullYear().toString();
|
||||||
|
}
|
||||||
|
if(result.hasOwnProperty("title")) {
|
||||||
|
let titleLength = Array.isArray(result.title) ? result.title.length : 1;
|
||||||
|
for (let j = 0; j < titleLength; j++) {
|
||||||
|
let title = Array.isArray(result.title) ? result.title[j] : result.title;
|
||||||
|
if (!preview.title || title.classid == "main title") {
|
||||||
|
preview.title = StringUtils.HTMLToString(String(title.content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(result.hasOwnProperty("description")) {
|
||||||
|
preview.description = result.description;
|
||||||
|
}
|
||||||
|
preview.resultType = result?.resulttype?.classid ? result.resulttype.classid : this.resultType;
|
||||||
|
|
||||||
|
|
||||||
|
if (result.hasOwnProperty("instance")) {
|
||||||
|
preview.hostedBy_collectedFrom = new Array<HostedByCollectedFrom>();
|
||||||
|
|
||||||
|
preview.types = new Array<string>();
|
||||||
|
let types = new Set<string>();
|
||||||
|
|
||||||
|
let counter = 0;
|
||||||
|
let instance;
|
||||||
|
|
||||||
|
let instanesLength = Array.isArray(result['instance']) ? result['instance'].length : 1;
|
||||||
|
|
||||||
|
for (let j = 0; j < instanesLength; j++) {
|
||||||
|
instance = Array.isArray(result['instance']) ? result['instance'][j] : result['instance'];
|
||||||
|
if(result.hasOwnProperty('collectedfrom')) {
|
||||||
|
if(Array.isArray(result['collectedfrom'])) {
|
||||||
|
// not sure if this is correct mapping
|
||||||
|
instance['collectedfrom'] = result['collectedfrom'].length >= j ? result['collectedfrom'][j] : result['collectedfrom'][result['collectedfrom'].length - 1];
|
||||||
|
} else {
|
||||||
|
instance['collectedfrom'] = result['collectedfrom'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parsingFunctions.parseTypes(preview.types, types, instance);
|
||||||
|
|
||||||
|
if (instance.hasOwnProperty("webresource")) {
|
||||||
|
let url;
|
||||||
|
if (!Array.isArray(instance['webresource'])) {
|
||||||
|
url = instance['webresource'].url;
|
||||||
|
} else {
|
||||||
|
url = instance['webresource'][0].url;
|
||||||
|
}
|
||||||
|
if (url.includes('&')) {
|
||||||
|
url = url.replace(/&/gmu, '&');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************/
|
||||||
|
if (instance.hasOwnProperty("hostedby")) {
|
||||||
|
parsingFunctions.parseHostedBy_collectedFrom(preview.hostedBy_collectedFrom, instance, url, null);
|
||||||
|
}
|
||||||
|
/**********************************************************/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// /* Order Download from via openness*/
|
||||||
|
preview.hostedBy_collectedFrom.sort(parsingFunctions.compareHostedByCollectedFrom);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.resultsPreview.push(preview);
|
||||||
|
}
|
||||||
|
this.status = this.errorCodes.DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultPreview(result: ResultLandingInfo): ResultPreview {
|
public getResultPreview(result: ResultLandingInfo): ResultPreview {
|
||||||
|
|
|
@ -724,22 +724,26 @@
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[modal]="AlertModalDeletedByInference"
|
[modal]="AlertModalDeletedByInference"
|
||||||
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"></deletedByInference>
|
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[modal]="AlertModalDeletedByInference"
|
[modal]="AlertModalDeletedByInference"
|
||||||
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"></deletedByInference>
|
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[modal]="AlertModalDeletedByInference"
|
[modal]="AlertModalDeletedByInference"
|
||||||
[resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"></deletedByInference>
|
[resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[modal]="AlertModalDeletedByInference"
|
[modal]="AlertModalDeletedByInference"
|
||||||
[resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"></deletedByInference>
|
[resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert *ngIf="resultLandingInfo" #citeModal>
|
<modal-alert *ngIf="resultLandingInfo" #citeModal>
|
||||||
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
|
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
|
||||||
|
@ -1195,25 +1199,29 @@
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"
|
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"
|
||||||
[isMobile]="isMobile"
|
[isMobile]="isMobile"
|
||||||
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
[modal]="alertModalDeletedByInferenceFS"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"
|
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"
|
||||||
[isMobile]="isMobile"
|
[isMobile]="isMobile"
|
||||||
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
[modal]="alertModalDeletedByInferenceFS"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="type" [type]="openaireEntities.SOFTWARE"
|
[resultType]="type" [type]="openaireEntities.SOFTWARE"
|
||||||
[isMobile]="isMobile"
|
[isMobile]="isMobile"
|
||||||
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
[modal]="alertModalDeletedByInferenceFS"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
||||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||||
[resultType]="'other'" [type]="openaireEntities.OTHER"
|
[resultType]="'other'" [type]="openaireEntities.OTHER"
|
||||||
[isMobile]="isMobile"
|
[isMobile]="isMobile"
|
||||||
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
|
[modal]="alertModalDeletedByInferenceFS"
|
||||||
|
[children]="resultLandingInfo.children"></deletedByInference>
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
|
|
||||||
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom">
|
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom">
|
||||||
|
|
|
@ -238,6 +238,7 @@ export class ResultLandingService {
|
||||||
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
|
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
|
||||||
this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier);
|
this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier);
|
||||||
}
|
}
|
||||||
|
this.resultLandingInfo.children = data[3]['result'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ export class ResultLandingInfo {
|
||||||
contexts: Context[];
|
contexts: Context[];
|
||||||
|
|
||||||
deletedByInferenceIds: string[];
|
deletedByInferenceIds: string[];
|
||||||
|
children;
|
||||||
|
|
||||||
// PUBLICATION, DATASET, ORP
|
// PUBLICATION, DATASET, ORP
|
||||||
references: Reference[];
|
references: Reference[];
|
||||||
|
|
Loading…
Reference in New Issue