[Library | develop]: transferData.component.ts: Set "overwrite": false & in method "validatePath()", removed regex and check only if path starts with / | transferData.component.html: Updated checks for path validation | resultLanding.component.ts: Added field public belongsInEOSC: boolean = false; and initialize it | resultLanding.component.html: Added message above title "This {{getTypeName() | lowercase}} is not part of the European Open Science Cloud" when in EOSC portal, but result has no EOSC context.
This commit is contained in:
parent
1b989441db
commit
37208d82b6
|
@ -214,6 +214,9 @@
|
|||
<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">
|
||||
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">
|
||||
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"
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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("/"))
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue