Merge from develop

This commit is contained in:
Konstantinos Triantafyllou 2023-10-11 16:33:33 +03:00
commit cfb321f93f
6 changed files with 105 additions and 61 deletions

View File

@ -9,7 +9,7 @@ export class ConnectHelper {
if(properties.environment == "development" && if(properties.environment == "development" &&
(properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community" (properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community"
|| properties.adminToolsPortalType == "aggregator" || properties.adminToolsPortalType == "eosc")) { || properties.adminToolsPortalType == "aggregator" || properties.adminToolsPortalType == "eosc")) {
domain = "test.openaire.eu"; //for testing domain = "covid-19.openaire.eu"; //for testing
} }
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
if (domain.indexOf('eosc-portal.eu') != -1) { if (domain.indexOf('eosc-portal.eu') != -1) {

View File

@ -11,8 +11,22 @@ import {RouterHelper} from "../../utils/routerHelper.class";
selector: 'availableOn', selector: 'availableOn',
template: ` template: `
<ng-container *ngIf="availableOn && availableOn.length > 0"> <ng-container *ngIf="availableOn && availableOn.length > 0">
<div class="uk-flex uk-flex-middle" [ngClass]="isMobile && !(usedBy == 'landing') ? 'uk-margin-left uk-margin-xsmall-bottom' : ''"> <div class="uk-flex uk-flex-middle"
<ng-container *ngIf="availableOn[0].downloadUrl"> [ngClass]="isMobile ? ('uk-flex-column ' + (!(usedBy == 'landing') ? 'uk-margin-left uk-margin-xsmall-bottom' : '')) : 'uk-grid uk-grid-small uk-child-width-auto'"
[attr.uk-grid]="!isMobile ? '' : null">
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle"
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
<a [href]="availableOn[0].fulltext" target="_blank"
class="uk-flex uk-flex-middle uk-button-link"
[ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-width-1-1 uk-padding-small uk-padding-remove-horizontal' : '') : 'uk-flex-center'">
<!-- <icon [flex]="true" [ratio]="0.7" name="download" visuallyHidden="download"></icon>-->
<icon name="download" visuallyHidden="donwload" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
<span class="uk-margin-xsmall-left">Full-Text</span>
</a>
</div>
<div *ngIf="isMobile && (usedBy == 'landing') && availableOn[0].fulltext" class="uk-width-1-1"><hr></div>
<div *ngIf="availableOn[0].downloadUrl" [ngClass]="isMobile ? 'uk-width-1-1' : ''">
<div class="uk-flex uk-flex-middle" [ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-padding-small uk-padding-remove-horizontal' : '') : ''">
<span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')" <span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)"> uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)">
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon> <icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
@ -49,7 +63,8 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</div> </div>
</mobile-dropdown> </mobile-dropdown>
</ng-container> </ng-container>
</ng-container> </div>
</div>
</div> </div>
</ng-container> </ng-container>
@ -80,6 +95,14 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</a> </a>
<ng-template #elseBlock> {{instance.license}}</ng-template> <ng-template #elseBlock> {{instance.license}}</ng-template>
</div> </div>
<div *ngIf="properties.environment != 'production' && instance.fulltext" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.fulltext">
Full-Text:
<a *ngIf="isUrl(instance.fulltext); else elseBlock"
[href]="instance.fulltext" target="_blank" class="custom-external uk-link-text">
{{instance.fulltext}}
</a>
<ng-template #elseBlock> {{instance.fulltext}}</ng-template>
</div>
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta"> <div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
<span>Data sources: </span> <span>Data sources: </span>
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl" <a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
@ -145,4 +168,6 @@ export class AvailableOnComponent {
} }
return obj; return obj;
} }
protected readonly properties = properties;
} }

View File

@ -264,7 +264,8 @@ export class ParsingFunctions {
"accessRightIcon": "", "accessRightIcon": "",
"types": [], "types": [],
"years": [], "years": [],
"license": "" "license": "",
"fulltext": ""
}; };
if (instance.hasOwnProperty("hostedby")) { if (instance.hasOwnProperty("hostedby")) {
@ -354,42 +355,59 @@ export class ParsingFunctions {
available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license']; available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license'];
} }
if(instance.hasOwnProperty("fulltext")) {
available.fulltext = instance['fulltext'];
}
hostedBy_collectedFrom.push(available); hostedBy_collectedFrom.push(available);
} }
compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) { compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) {
let retValue: number = 0;
let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null); let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null);
let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null); let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null);
if (firstAccessRight === secondAccessRight) { if (firstAccessRight !== secondAccessRight) {
return 0;
} else {
if (firstAccessRight === 'open access') { if (firstAccessRight === 'open access') {
return -1; retValue = -1;
} else if (secondAccessRight === 'open access') { } else if (secondAccessRight === 'open access') {
return 1; retValue = 1;
} else if (firstAccessRight === "open source") { } else if (firstAccessRight === "open source") {
return -1; retValue = -1;
} else if (secondAccessRight === "open source") { } else if (secondAccessRight === "open source") {
return 1; retValue = 1;
} else if (firstAccessRight === "embargo") { } else if (firstAccessRight === "embargo") {
return -1; retValue = -1;
} else if (secondAccessRight === "embargo") { } else if (secondAccessRight === "embargo") {
return 1; retValue = 1;
} else if (firstAccessRight === "restricted") { } else if (firstAccessRight === "restricted") {
return -1; retValue = -1;
} else if (secondAccessRight === "restricted") { } else if (secondAccessRight === "restricted") {
return 1; retValue = 1;
} else if (firstAccessRight === "closed access") { } else if (firstAccessRight === "closed access") {
return -1; retValue = -1;
} else if (secondAccessRight === "closed access") { } else if (secondAccessRight === "closed access") {
return 1; retValue = 1;
} else if (firstAccessRight === "not available") { } else if (firstAccessRight === "not available") {
return -1; retValue = -1;
} else if (secondAccessRight === "not available") { } else if (secondAccessRight === "not available") {
retValue = 1;
}
}
if(retValue == 0) {
let firstFulltext: string = (a.fulltext ? a.fulltext : null);
let secondFulltext: string = (b.fulltext ? b.fulltext : null);
if (firstFulltext && !secondFulltext) {
return -1;
} else if (!firstFulltext && secondFulltext) {
return 1; return 1;
} }
} else {
return retValue;
} }
return 0; return 0;
} }

View File

@ -613,7 +613,7 @@
</div> </div>
<div *ngIf="mobileContent == 'actions'" class="uk-container uk-section"> <div *ngIf="mobileContent == 'actions'" class="uk-container uk-section">
<ng-container *ngIf="resultLandingInfo?.hostedBy_collectedFrom"> <ng-container *ngIf="resultLandingInfo?.hostedBy_collectedFrom">
<div class="uk-padding-small uk-padding-remove-horizontal"> <div class="">
<div class="clickable uk-button-link uk-flex uk-flex-middle uk-h6 uk-margin-remove" <div class="clickable uk-button-link uk-flex uk-flex-middle uk-h6 uk-margin-remove"
(click)=" onSelectActiveTab('availableOn')"> (click)=" onSelectActiveTab('availableOn')">
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom" (viewAllClicked)="viewAll=$event" <availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom" (viewAllClicked)="viewAll=$event"

View File

@ -16,7 +16,7 @@ import {EnvProperties} from "../properties/env-properties";
routerLinkActive="router-link-active" routerLink="/participate/direct-claim" routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
[title]="'Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.'" [title]="'Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.'"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'" [attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon> <icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon>
<span class="uk-margin-xsmall-left">Link to</span> <span class="uk-margin-xsmall-left">Link to</span>
</a> </a>
@ -25,15 +25,15 @@ import {EnvProperties} from "../properties/env-properties";
<a (click)="openAddThisModal()" <a (click)="openAddThisModal()"
[title]="'Share this '+getTypeName() + ' in your social networks'" [title]="'Share this '+getTypeName() + ' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'" [attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'"
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon> <icon class="uk-text-bolder" [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon>
<span class="uk-margin-xsmall-left">Share</span> <span class="uk-margin-xsmall-left">Share</span>
</a> </a>
</div> </div>
<div *ngIf="cite"> <div *ngIf="cite">
<a (click)="openCiteModal()" <a (click)="openCiteModal()"
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon [flex]="true" [ratio]="0.7" name="cite" visuallyHidden="cite"></icon> <icon class="uk-text-bolder" [flex]="true" [ratio]="0.7" name="cite" visuallyHidden="cite"></icon>
<span class="uk-margin-xsmall-left">Cite</span> <span class="uk-margin-xsmall-left">Cite</span>
</a> </a>
</div> </div>
@ -41,7 +41,7 @@ import {EnvProperties} from "../properties/env-properties";
<a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how" <a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how"
[title]="'Find a repository to deposit or publish your research in Open Access'" [title]="'Find a repository to deposit or publish your research in Open Access'"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'" [attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon> <icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon>
<span class="uk-margin-xsmall-left">Deposit</span> <span class="uk-margin-xsmall-left">Deposit</span>
</a> </a>
@ -50,7 +50,7 @@ import {EnvProperties} from "../properties/env-properties";
<a (click)="openEmbedResultsModal()" <a (click)="openEmbedResultsModal()"
[title]="'Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website'" [title]="'Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website'"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'" [attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon> <icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon>
<span class="uk-margin-xsmall-left">Embed</span> <span class="uk-margin-xsmall-left">Embed</span>
</a> </a>

View File

@ -11,6 +11,7 @@ export interface HostedByCollectedFrom {
years: string[]; years: string[];
accessRightIcon: string; accessRightIcon: string;
license?: string; license?: string;
fulltext?: string;
} }
export interface Journal { export interface Journal {