data-transfer-v2 #6

Merged
konstantina.galouni merged 26 commits from data-transfer-v2 into develop 2023-06-13 16:20:04 +02:00
2 changed files with 14 additions and 1 deletions
Showing only changes of commit cde97c09b9 - Show all commits

View File

@ -54,7 +54,7 @@
<p class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom uk-margin-top">Please select the
Destination Storage technology:</p>
<div input type="select" [(value)]="selectedDestination" placeholder="Destination Storage" hint="Select..."
[options]="destinationOptions" (valueChange)="folders = {}"></div>
[options]="destinationOptions" (valueChange)="folders = {}; sourceUrlValidators()"></div>
<p class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom uk-margin-top">Provide the
corresponding storage destination url:</p>

View File

@ -110,6 +110,7 @@ export class EGIDataTransferComponent {
(res: Array<any>) => {
this.destinationOptions = res.map(dest => {return {"label": dest.destination, "value": dest}});
this.selectedDestination = res[0];
this.sourceUrlValidators();
}
));
@ -468,6 +469,18 @@ export class EGIDataTransferComponent {
}
validateDestinationUrl():boolean {
if(this.selectedDestination.destination == "s3") {
return (this.destinationUrl.length > 0 && new RegExp('s3:\/\/[a-zA-Z0-9]+').test(this.destinationUrl));
}
return (this.destinationUrl.length > 0 && StringUtils.isValidUrl(this.destinationUrl));
}
public sourceUrlValidators() {
this.URLValidators = [];
if(this.selectedDestination.destination == 's3') {
this.URLValidators = [Validators.required, Validators.pattern('s3:\/\/[a-zA-Z0-9]+')];
} else {
this.URLValidators = [Validators.required, StringUtils.urlValidator()];
}
}
}