[develop | DONE | FIXED] resultLanding.service.ts: Parse services for relatedServices only when the portal is eosc, otherwise datasources only | resultLanding.component.html: For relatedServices, change label of tab and type of results depending on if the portal is eosc (service) or not (datasource).

This commit is contained in:
Konstantina Galouni 2024-09-19 11:12:24 +03:00
parent 8f646a883f
commit 3ea0ee3d1e
2 changed files with 8 additions and 7 deletions

View File

@ -154,7 +154,7 @@
[tabNumber]="resultLandingInfo.relatedResults.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.relatedServices?.length > 0"
[tabTitle]="openaireEntities.DATASOURCES" [tabId]="'dataProviders'"
[tabTitle]="properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES" [tabId]="'dataProviders'"
[tabNumber]="resultLandingInfo.relatedServices.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
@ -188,7 +188,7 @@
</ng-container>
<div *ngIf="resultLandingInfo.relatedServices?.length > 0"
id="dataProviders" class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: properties.adminToolsPortalType == 'eosc' ? 'service' : 'datasource', header: ''}"></ng-container>
</div>
<ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div id="bioentities" class="landing-section">
@ -467,8 +467,8 @@
</ng-container>
<ng-container *ngIf="resultLandingInfo.relatedServices?.length > 0">
<div class="clickable uk-flex uk-flex-middle uk-flex-between"
(click)="openFsModal(servicesFsModal, openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')">
<span>{{openaireEntities.DATASOURCES}}</span>
(click)="openFsModal(servicesFsModal, properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')">
<span>{{properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES}}</span>
<icon name="chevron_right" [ratio]="1.5" [flex]="true"></icon>
</div>
<hr>
@ -662,7 +662,7 @@
<fs-modal *ngIf="isMobile" #servicesFsModal classTitle="uk-tile-default uk-border-bottom">
<div *ngIf="activeTab == 'dataProviders' && resultLandingInfo.relatedServices?.length > 0"
class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: properties.adminToolsPortalType == 'eosc' ? 'service' : 'datasource', header: ''}"></ng-container>
</div>
</fs-modal>
@ -800,7 +800,7 @@
(valueChange)="relatedClassChanged(type)"></div>
<results-and-pages
[type]="((type == 'datasource') ? openaireEntities.DATASOURCES : openaireEntities.RESULTS)"
[type]="((type == 'datasource') ? openaireEntities.DATASOURCES : (type == 'service' ? openaireEntities.SERVICES : openaireEntities.RESULTS))"
[page]="props.page" [pageSize]="pageSize"
[totalResults]="related.length">
</results-and-pages>

View File

@ -210,7 +210,8 @@ export class ResultLandingService {
this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
} else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
} else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations") {
} else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations" &&
(relation['datasourcetype']?.classname!== "service" || properties.adminToolsPortalType == "eosc")) {
let relationName: string = relation.to.class;
if (!this.resultLandingInfo.relatedServicesClassFilters.has(relationName)) {
this.resultLandingInfo.relatedServicesClassFilters.add(relationName);