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

This commit is contained in:
Konstantina Galouni 2023-09-04 15:45:29 +03:00
commit 35d287511b
5 changed files with 32 additions and 14 deletions

View File

@ -31,10 +31,14 @@ import {StringUtils} from "../../utils/string-utils.class";
</div>
<div class="uk-margin-small-top">
<div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate">
<a [routerLink]="properties.searchLinkToResults"
[queryParams]="buildFosQueryParam(subject)">
<a *ngIf="properties.adminToolsPortalType != 'eosc'"
[routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subject)">
{{subject.label}}
</a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="custom-external" target="_blank"
[href]="'https://explore.openaire.eu'+properties.searchLinkToResults+'?fos='+urlEncodeAndQuote(subject.label)">
{{subject.label}}
</a>
</div>
</div>
</div>

View File

@ -213,7 +213,10 @@
</div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<i class="uk-text-meta uk-text-xsmall" *ngIf="properties.adminToolsPortalType == 'eosc' && !belongsInEOSC && properties.environment !== 'production'">
This {{getTypeName() | lowercase}} is not part of the European Open Science Cloud
</i>
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
[subTitle]="resultLandingInfo.subtitle"
[authors]="resultLandingInfo.authors"
@ -506,6 +509,9 @@
<icon [name]="resultLandingInfo.hostedBy_collectedFrom[0].accessRightIcon" [flex]="true" [ratio]="1"></icon>
<span class="uk-margin-xsmall-left uk-text-small uk-text-uppercase uk-text-bolder">{{getAccessLabel(resultLandingInfo.hostedBy_collectedFrom[0].accessRight)}}</span>
</div>
<i class="uk-text-meta uk-text-xsmall" *ngIf="properties.adminToolsPortalType == 'eosc' && !belongsInEOSC && properties.environment !== 'production'">
This {{getTypeName() | lowercase}} is not part of the European Open Science Cloud
</i>
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
[subTitle]="resultLandingInfo.subtitle"
[authors]="resultLandingInfo.authors"

View File

@ -55,6 +55,7 @@ export class ResultLandingComponent {
public deleteByInferenceOpened: boolean = false;
@Input() public resultFromInput: boolean = false;
@Input() public resultLandingInfo: ResultLandingInfo;
public belongsInEOSC: boolean = false;
public supplementaryResults: RelationResult[];
public relation: string = 'trust';
public id: string;
@ -592,7 +593,12 @@ export class ResultLandingComponent {
if (contexts) {
await this.promise;
if(this.publicCommunities && this.publicCommunities.length > 0) {
this.resultLandingInfo.contexts = contexts.filter(context => this.publicCommunities.includes(context.idContext));
this.resultLandingInfo.contexts = contexts.filter(context => {
if(context.idContext == "eosc") {
this.belongsInEOSC = true;
}
return this.publicCommunities.includes(context.idContext)
});
this.cdr.detectChanges();
}
}

View File

@ -15,10 +15,11 @@
<ng-container *ngTemplateOutlet="modalContents;"></ng-container>
</modal-alert>
<!-- [okButtonDisabled]="!privacyAccepted || destinationPath.length == 0 || status == 'succeeded' || (requests > 0)-->
<!-- || !validatePath() || !validateDestinationUrl() || (!this.downloadElements || this.downloadElements.length == 0)"-->
<!-- (okEmitter)="transfer()" (cancelEmitter)="init()"-->
<fs-modal #egiTransferFsModal classTitle="uk-tile-default uk-border-bottom" classBody="uk-container-xlarge"
[okButtonDisabled]="!privacyAccepted || destinationPath.length == 0 || status == 'succeeded' || (requests > 0)
|| !validatePath() || !validateDestinationUrl() || (!this.downloadElements || this.downloadElements.length == 0)"
(okEmitter)="transfer()" (cancelEmitter)="init()">
(cancelEmitter)="init()">
<ng-container *ngTemplateOutlet="modalContents;"></ng-container>
</fs-modal>
@ -85,7 +86,7 @@
</ng-container>
<p class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom uk-margin-top">Destination path (e.g. /folder1/folder2):</p>
<div input [(value)]="destinationPath" [inputClass]="'flat'"
<div #destinationPathInput input [(value)]="destinationPath" [inputClass]="'flat'"
[validators]="pathValidators" class=""></div>
<!-- <div *ngIf="selectedDestination.hasBrowse">-->
<p *ngIf="selectedDestination.canBrowse" class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom"> or <a
@ -111,9 +112,9 @@
<div *ngIf="isMobile" class="uk-align-right uk-margin-medium-top uk-margin-bottom">
<button class="uk-button uk-button-primary"
[disabled]="!privacyAccepted || destinationPath.length == 0 || status == 'succeeded'
|| (requests > 0) || !validatePath() || !validateDestinationUrl() || (!this.downloadElements || this.downloadElements.length == 0)"
|| (requests > 0) || !destinationPathInput.formControl.valid || !validateDestinationUrl() || (!this.downloadElements || this.downloadElements.length == 0)"
[class.uk-disabled]="!privacyAccepted || destinationPath.length == 0 || status == 'succeeded'
|| (requests > 0) || !validatePath() || !validateDestinationUrl() || (!this.downloadElements || this.downloadElements.length == 0)"
|| (requests > 0) || !destinationPathInput.formControl.valid || !validateDestinationUrl() || (!this.downloadElements || this.downloadElements.length == 0)"
(click)="transfer()">
>> Transfer
</button>

View File

@ -164,7 +164,7 @@ export class EGIDataTransferComponent {
this.egiTransferFsModal.back = false;
this.egiTransferFsModal.cancelButton = true;
this.egiTransferFsModal.okButton = false;
this.egiTransferFsModal.okButtonText = ">> Transfer";
// this.egiTransferFsModal.okButtonText = ">> Transfer";
this.egiTransferFsModal.title = "EOSC Data Transfer";
if(typeof document !== 'undefined') {
this.egiTransferFsModal.open();
@ -254,7 +254,7 @@ export class EGIDataTransferComponent {
"files": [],
"params": {
"priority": 0,
"overwrite": true,
"overwrite": false,
"retry": 3
}
};
@ -560,8 +560,9 @@ export class EGIDataTransferComponent {
}
}
validatePath():boolean {
let exp1 = /^\/([A-z0-9-_+]+\/?)*$/g;
return (this.destinationPath.length > 0 && this.destinationPath.match(exp1) != null)
// let exp1 = /^\/([A-z0-9-_+]+\/?)*$/g;
// let exp1 = /^\/([A-z0-9-_]+[+\/]?)*$/;
return (this.destinationPath.length > 0 && this.destinationPath.startsWith("/"))
}